:root {
    --primary: #00ffcc;
    --danger: #ff3366;
    --bg-dark: #020204;
    --panel-bg: rgba(10, 10, 18, 0.85);
    --text-main: #e0e0e0;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    color: var(--text-main);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.04) 0px,
        rgba(0, 0, 0, 0.04) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9999;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    cursor: none;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.screen.active {
    display: flex;
}

#start-screen, #game-over-screen, #pause-screen {
    background: radial-gradient(ellipse at center, rgba(5, 5, 20, 0.95) 0%, rgba(2, 2, 4, 0.98) 100%);
    backdrop-filter: blur(8px);
}

#start-screen h1 {
    font-size: 4rem;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(0, 255, 204, 0.8), 0 0 60px rgba(0, 255, 204, 0.4), 0 0 100px rgba(0, 255, 204, 0.2);
    margin-bottom: 10px;
    text-align: center;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(0, 255, 204, 0.6), 0 0 40px rgba(0, 255, 204, 0.3); }
    50%       { text-shadow: 0 0 40px rgba(0, 255, 204, 1.0), 0 0 80px rgba(0, 255, 204, 0.5), 0 0 120px rgba(0, 200, 255, 0.3); }
}

#start-screen p {
    font-family: 'Orbitron', sans-serif;
    color: rgba(0, 255, 204, 0.6);
    letter-spacing: 4px;
    font-size: 0.95rem;
    margin-bottom: 35px;
    text-transform: uppercase;
}

button {
    font-family: 'Orbitron', sans-serif;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 14px 36px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.15) inset, 0 0 8px rgba(0, 255, 204, 0.1);
}

button:hover {
    background: rgba(0, 255, 204, 0.12);
    color: #ffffff;
    border-color: #fff;
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.5), 0 0 50px rgba(0, 255, 204, 0.2), 0 0 8px rgba(0, 255, 204, 0.4) inset;
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.9);
}

/* HUD elements */
#hud {
    pointer-events: none;
    justify-content: flex-start;
}

.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#score-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.8), 0 0 30px rgba(0, 255, 204, 0.4);
}

.multiplier {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    margin-left: 10px;
}

#xp-bar-container {
    width: 30%;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
}

#xp-bar {
    width: 0%;
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.2s ease;
}

#level-display, #time-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.8), 0 0 20px rgba(0, 255, 204, 0.4);
}

.pause-hint {
    font-family: 'Orbitron', sans-serif;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

#bottom-hud {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#bh-container {
    font-family: 'Orbitron', sans-serif;
    color: #aa00ff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 5px #aa00ff;
}

#bomb-container {
    font-family: 'Orbitron', sans-serif;
    color: #ffaa00;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px #ffaa00;
}

#bh-bar {
    width: 200px;
    height: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #aa00ff;
    border-radius: 5px;
    overflow: hidden;
}

#bh-fill {
    width: 100%;
    height: 100%;
    background: #aa00ff;
    box-shadow: 0 0 10px #aa00ff;
    transition: width 0.1s linear;
}

#health-bar-container {
    width: 300px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 10px;
    overflow: hidden;
}

#health-bar {
    width: 100%;
    height: 100%;
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
    transition: width 0.1s linear;
}

/* Level Up Screen */
#level-up-screen {
    background: radial-gradient(ellipse at center, rgba(10, 0, 30, 0.96) 0%, rgba(2, 2, 4, 0.98) 100%);
    backdrop-filter: blur(10px);
}

#level-up-screen h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.7), 0 0 50px rgba(0, 255, 204, 0.3);
    animation: title-glow 2s ease-in-out infinite;
}

#level-up-screen p {
    color: rgba(255,255,255,0.5);
    letter-spacing: 3px;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 25px;
}

#upgrades-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
}

.upgrade-card {
    background: linear-gradient(145deg, rgba(5, 5, 20, 0.9), rgba(15, 5, 30, 0.8));
    border: 1px solid rgba(100, 0, 200, 0.4);
    border-radius: 10px;
    padding: 22px;
    width: 240px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.upgrade-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.03), rgba(170, 0, 255, 0.03));
    opacity: 0;
    transition: opacity 0.25s;
}

.upgrade-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 255, 204, 0.25), 0 0 0 1px rgba(0, 255, 204, 0.3);
}

.upgrade-card:hover::before {
    opacity: 1;
}

.upgrade-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.upgrade-desc {
    font-size: 0.9rem;
    color: #bbb;
}

/* Settings Container */
.settings-container {
    background: rgba(10, 10, 18, 0.8);
    border: 2px solid var(--primary);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    width: 400px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}

.setting-row {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.setting-row label {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.setting-row input[type=range] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Menu & Game Over Buttons Layout */
.menu-buttons, .game-over-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Highscore Submit Container */
#highscore-submit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 25px 0;
    padding: 20px;
    border: 1px dashed rgba(0, 255, 204, 0.4);
    border-radius: 8px;
    background: rgba(10, 10, 18, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.05);
}

#player-name-input {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid #555;
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    outline: none;
    width: 250px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#player-name-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
}

#submit-score-btn {
    font-size: 1.1rem;
    padding: 8px 25px;
    border-color: var(--primary);
}

/* Leaderboard Screen Overlay */
#leaderboard-screen {
    background-color: rgba(2, 2, 4, 0.92);
    backdrop-filter: blur(10px);
}

.leaderboard-container {
    width: 85%;
    max-width: 650px;
    background: var(--panel-bg);
    border: 2px solid var(--primary);
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(0, 0, 0, 0.5);
}

.leaderboard-container::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.leaderboard-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

#leaderboard-loading {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
    padding: 40px;
    text-align: center;
    font-size: 1.2rem;
    animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; text-shadow: 0 0 15px rgba(0, 255, 204, 0.8); }
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Orbitron', sans-serif;
    text-align: left;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Orbitron', sans-serif;
}

#leaderboard-table th {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    padding: 12px;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.3);
    text-align: left;
}

#leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.95rem;
    text-align: left;
}

#leaderboard-table tr:hover td {
    background: rgba(0, 255, 204, 0.05);
}

/* Rank Medals Styles */
.rank-1 {
    color: #ffd700 !important; /* Gold */
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    font-weight: bold;
}

.rank-2 {
    color: #c0c0c0 !important; /* Silver */
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
    font-weight: bold;
}

.rank-3 {
    color: #cd7f32 !important; /* Bronze */
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
    font-weight: bold;
}

.setting-select {
    font-family: 'Orbitron', sans-serif;
    background: rgba(0, 0, 0, 0.7);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 0 5px rgba(0, 255, 204, 0.2);
    transition: all 0.3s ease;
}

.setting-select:focus, .setting-select:hover {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    color: #fff;
}

.setting-select option {
    background: #020204;
    color: var(--primary);
}


