/* === CYBERPUNK NEON THEME === */
:root {
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --neon-yellow: #ffff00;
    --neon-green: #00ff88;
    --neon-orange: #ff6600;
    --neon-purple: #9900ff;
    --neon-red: #ff3366;
    --dark-bg: #0a0a1a;
    --darker-bg: #050510;
    --grid-color: rgba(0, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace, sans-serif;
    background: var(--darker-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Animated grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

#game-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

#gameCanvas {
    border: 3px solid var(--neon-cyan);
    border-radius: 8px;
    box-shadow:
        0 0 20px var(--neon-cyan),
        0 0 40px rgba(0, 255, 255, 0.3),
        inset 0 0 60px rgba(0, 255, 255, 0.1);
    background: var(--dark-bg);
}

/* === HUD === */
#hud {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

#hud.hidden {
    display: none;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 12px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    letter-spacing: 2px;
}

.hud-value {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 30px var(--neon-pink);
}

/* === OVERLAYS === */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 16, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    z-index: 100;
    overflow-y: auto;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 30px;
    max-height: 100%;
}

.wide-content {
    min-width: 400px;
}

.game-title {
    font-size: 64px;
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 40px var(--neon-pink),
        0 0 80px var(--neon-pink);
    margin-bottom: 20px;
    letter-spacing: 4px;
    line-height: 1.1;
    animation: titlePulse 2s ease-in-out infinite;
}

.highscore-page-title {
    font-size: 36px;
    text-shadow:
        0 0 10px var(--neon-yellow),
        0 0 20px var(--neon-yellow),
        0 0 40px var(--neon-yellow);
}

.level-complete {
    text-shadow:
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green),
        0 0 40px var(--neon-green),
        0 0 80px var(--neon-green);
}

@keyframes titlePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.subtitle {
    font-size: 18px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.section-title {
    font-size: 14px;
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

/* === BUTTONS === */
.neon-btn {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 700;
    padding: 15px 40px;
    background: transparent;
    color: var(--neon-cyan);
    border: 3px solid var(--neon-cyan);
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    display: block;
    width: 100%;
    margin-bottom: 12px;
}

.neon-btn:last-child {
    margin-bottom: 0;
}

.neon-btn:hover {
    background: var(--neon-cyan);
    color: var(--dark-bg);
    box-shadow:
        0 0 40px var(--neon-cyan),
        0 0 80px rgba(0, 255, 255, 0.5);
    transform: scale(1.02);
}

.neon-btn:active {
    transform: scale(0.98);
}

.neon-btn.secondary {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow:
        0 0 15px rgba(153, 0, 255, 0.3),
        inset 0 0 15px rgba(153, 0, 255, 0.1);
}

.neon-btn.secondary:hover {
    background: var(--neon-purple);
    color: #fff;
    box-shadow: 0 0 40px var(--neon-purple);
}

.neon-btn.danger {
    border-color: var(--neon-red);
    color: var(--neon-red);
    box-shadow:
        0 0 15px rgba(255, 51, 102, 0.3),
        inset 0 0 15px rgba(255, 51, 102, 0.1);
}

.neon-btn.danger:hover {
    background: var(--neon-red);
    color: #fff;
    box-shadow: 0 0 40px var(--neon-red);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.controls-info {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.controls-info p {
    margin: 6px 0;
}

/* === DIFFICULTY SELECTION === */
.difficulty-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(153, 0, 255, 0.3);
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-btn {
    font-family: 'Orbitron', monospace;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.difficulty-btn .diff-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.difficulty-btn .diff-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.difficulty-btn:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.1);
}

.difficulty-btn.active {
    border-color: var(--neon-green);
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.difficulty-btn.active .diff-name {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.difficulty-btn[data-difficulty="easy"] .diff-name {
    color: var(--neon-green);
}

.difficulty-btn[data-difficulty="medium"] .diff-name {
    color: var(--neon-yellow);
}

.difficulty-btn[data-difficulty="hard"] .diff-name {
    color: var(--neon-red);
}

/* === HIGHSCORE TABS === */
.highscore-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
}

.tab-btn {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px 6px 0 0;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.tab-btn.active {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.tab-btn[data-tab="easy"].active {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.1);
    text-shadow: 0 0 10px var(--neon-green);
}

.tab-btn[data-tab="medium"].active {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    background: rgba(255, 255, 0, 0.1);
    text-shadow: 0 0 10px var(--neon-yellow);
}

.tab-btn[data-tab="hard"].active {
    border-color: var(--neon-red);
    color: var(--neon-red);
    background: rgba(255, 51, 102, 0.1);
    text-shadow: 0 0 10px var(--neon-red);
}

.highscore-content {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 12px 12px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
}

.highscore-tab-content {
    display: none;
}

.highscore-tab-content.active {
    display: block;
}

.full-list .highscore-item {
    padding: 12px 20px;
}

/* === PAUSE BUTTON === */
.pause-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    color: var(--neon-cyan);
    font-size: 18px;
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.pause-btn:hover {
    background: var(--neon-cyan);
    color: var(--dark-bg);
    box-shadow: 0 0 25px var(--neon-cyan);
    transform: scale(1.1);
}

.pause-btn.hidden {
    display: none;
}

.pause-title {
    text-shadow:
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        0 0 80px var(--neon-cyan) !important;
}

/* === HIGHSCORE SECTION === */
.highscore-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.highscore-title {
    font-size: 14px;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.highscore-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.highscore-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border-left: 3px solid var(--neon-cyan);
    transition: all 0.3s ease;
}

.highscore-item:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateX(5px);
}

.highscore-item.rank-1 {
    border-left-color: var(--neon-yellow);
    background: rgba(255, 255, 0, 0.1);
}

.highscore-item.rank-2 {
    border-left-color: #c0c0c0;
}

.highscore-item.rank-3 {
    border-left-color: #cd7f32;
}

.highscore-rank {
    font-size: 16px;
    font-weight: 900;
    color: var(--neon-cyan);
    min-width: 30px;
}

.highscore-item.rank-1 .highscore-rank {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

.highscore-score {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px var(--neon-pink);
    flex: 1;
    text-align: center;
}

.highscore-level {
    font-size: 11px;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.no-scores {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    padding: 20px 10px;
}

.new-highscore {
    font-size: 18px;
    color: var(--neon-yellow);
    text-shadow:
        0 0 10px var(--neon-yellow),
        0 0 20px var(--neon-yellow);
    margin-bottom: 15px;
    animation: newHighscorePulse 0.5s ease-in-out infinite alternate;
}

.new-highscore.hidden {
    display: none;
}

@keyframes newHighscorePulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .game-title {
        font-size: 36px;
    }

    .highscore-page-title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .neon-btn {
        font-size: 14px;
        padding: 12px 30px;
    }

    #hud {
        top: -50px;
    }

    .hud-value {
        font-size: 22px;
    }

    .difficulty-buttons {
        flex-direction: column;
    }

    .difficulty-btn {
        width: 100%;
    }

    .wide-content {
        min-width: auto;
        width: 100%;
    }

    .highscore-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 10px;
    }
}