/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Courier New', Courier, monospace;
    color: #00ffff;
}

/* ===== CANVAS CONTAINER ===== */
#game-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    z-index: 0;
    border: 1px solid rgba(0, 255, 255, 0.1);
    overflow: hidden;
}

#game-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== OVERLAYS (shared) ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.92);
    transition: opacity 0.6s ease, visibility 0.6s ease;
    opacity: 1;
    visibility: visible;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 540px;
    width: 90%;
    position: relative;
    z-index: 1;
}

/* ===== COUNTDOWN OVERLAY ===== */
#countdown-overlay {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.85);
}

.countdown-controls {
    width: min(90vw, 620px);
    position: absolute;
    top: clamp(2.8rem, 9vh, 6.2rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    padding: 1em 1.4em 0.9em;
    border: 1px solid rgba(0, 255, 255, 0.25);
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.05), rgba(10, 10, 10, 0.72));
    box-shadow:
        0 0 18px rgba(0, 255, 255, 0.12),
        inset 0 0 18px rgba(0, 255, 255, 0.05);
}

.controls-title {
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    color: rgba(0, 255, 255, 0.7);
    margin-bottom: 0.9em;
}

.controls-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4em;
}

.wasd-cluster {
    display: grid;
    grid-template-columns: repeat(3, minmax(42px, 52px));
    grid-template-rows: repeat(2, minmax(38px, 48px));
    gap: 0.45em;
}

.key {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 255, 255, 0.45);
    background: rgba(0, 255, 255, 0.08);
    color: #00ffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.55);
    box-shadow: inset 0 0 12px rgba(0, 255, 255, 0.08);
}

.key-wide {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.key-w { grid-column: 2; grid-row: 1; }
.key-q { grid-column: 1; grid-row: 2; }
.key-s { grid-column: 2; grid-row: 2; }
.key-d { grid-column: 3; grid-row: 2; }

.mouse-hint {
    display: flex;
    align-items: center;
    gap: 0.8em;
    border-left: 1px solid rgba(0, 255, 255, 0.2);
    padding-left: 1.1em;
}

.mouse-icon {
    width: 30px;
    height: 46px;
    border: 1px solid rgba(255, 0, 255, 0.5);
    border-radius: 16px;
    position: relative;
    box-shadow: 0 0 12px rgba(255, 0, 255, 0.2);
}

.mouse-left-btn {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 11px;
    height: 18px;
    border-radius: 9px 2px 3px 3px;
    background: rgba(255, 0, 255, 0.85);
    box-shadow: 0 0 9px rgba(255, 0, 255, 0.8);
}

.mouse-icon::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 1px;
    height: 16px;
    transform: translateX(-50%);
    background: rgba(255, 0, 255, 0.35);
}

.mouse-wheel {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 5px;
    height: 9px;
    border-radius: 3px;
    transform: translateX(-50%);
    background: #ff00ff;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
}

.mouse-text {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    text-align: left;
}

.mouse-line {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    color: rgba(0, 255, 255, 0.8);
}

.mouse-line:last-child {
    letter-spacing: 0.1em;
}

.controls-footnote {
    text-align: center;
    font-size: 0.6rem;
    letter-spacing: 0.36em;
    color: rgba(0, 255, 255, 0.5);
    margin-top: 0.95em;
}

.countdown-number {
    position: relative;
    z-index: 2;
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    padding-left: 0.1em;
    color: #00ffff;
    text-shadow:
        0 0 20px #00ffff,
        0 0 60px #00ffff,
        0 0 100px #0088ff;
    animation: countdownPop 0.7s ease-out;
    text-transform: uppercase;
}

.countdown-number.go-text {
    font-size: clamp(2rem, 8vw, 5rem);
    color: #ff00ff;
    text-shadow:
        0 0 20px #ff00ff,
        0 0 60px #ff00ff,
        0 0 100px #ff0088;
    letter-spacing: 0.2em;
    padding-left: 0.2em;
}

.countdown-number.tutorial-text {
    font-size: clamp(1.5rem, 5vw, 3rem);
    letter-spacing: 0.15em;
    padding-left: 0.15em;
}

@media (max-width: 700px) {
    .countdown-controls {
        width: min(92vw, 480px);
        top: clamp(1rem, 4.5vh, 2.2rem);
        padding: 0.8em 1em;
    }

    .controls-grid {
        flex-direction: column;
        gap: 0.9em;
    }

    .mouse-hint {
        border-left: 0;
        border-top: 1px solid rgba(0, 255, 255, 0.2);
        padding-left: 0;
        padding-top: 0.8em;
    }

    .mouse-line {
        font-size: 0.62rem;
        letter-spacing: 0.15em;
    }
}

@keyframes countdownPop {
    0% { transform: scale(2); opacity: 0; }
    50% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== START SCREEN LOGO ===== */
.start-logo-wrap {
    position: relative;
    display: inline-block;
    margin: 0 auto 1.6rem;
}

/* Left + right side glow panels */
.start-logo-wrap::before {
    content: '';
    position: absolute;
    top: -10%; bottom: -10%;
    left: -50px; right: -50px;
    background: linear-gradient(to right,
        rgba(0, 255, 255, 0.4),
        transparent 35%,
        transparent 65%,
        rgba(255, 0, 255, 0.4)
    );
    filter: blur(28px);
    z-index: 0;
}

/* Top + bottom ambient glow */
.start-logo-wrap::after {
    content: '';
    position: absolute;
    inset: -20px -14px;
    background: linear-gradient(to bottom, rgba(0, 255, 255, 0.3) 0%, rgba(255, 0, 255, 0.3) 100%);
    filter: blur(22px);
    z-index: 0;
    border-radius: 8px;
}

.start-logo {
    max-width: min(440px, 88vw);
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    animation: startLogoIdle 8s ease-in-out infinite;
}

/* Horror double-flash — fires every ~8s */
@keyframes startLogoIdle {
    0%, 88%   { opacity: 1; filter: none; }
    89%        { opacity: 0.05; filter: brightness(4) blur(1px); }
    89.5%      { opacity: 1;    filter: brightness(3); }
    90%        { opacity: 0.05; filter: brightness(4) blur(1px); }
    90.5%      { opacity: 1;    filter: none; }
    100%       { opacity: 1;    filter: none; }
}

/* ===== GAME TITLE ===== */
.game-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    margin-right: -0.3em;
    color: #00ffff;
    text-shadow:
        0 0 10px #00ffff,
        0 0 30px #00ffff,
        0 0 60px #0088ff;
    margin-bottom: 0.2em;
    animation: titlePulse 2s ease-in-out infinite;
}

.start-title {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 0.4em;
    animation: titleFlash 3s ease-in-out infinite;
}

/* ===== AMBIENT RUNE BACKGROUND ===== */
#rune-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ===== GIODE PREVIEW ===== */
#giode-preview {
    display: block;
    margin: 0 auto 1.5em;
    width: 260px;
    height: 260px;
    filter: drop-shadow(0 0 12px #00ffff) drop-shadow(0 0 30px rgba(0, 255, 255, 0.3));
}

.gameover-title {
    color: #ff00ff;
    text-shadow:
        0 0 10px #ff00ff,
        0 0 30px #ff00ff,
        0 0 60px #ff0088;
}

.gameover-subtitle {
    font-size: 0.85rem;
    color: #ff00ff88;
    letter-spacing: 0.15em;
    margin-top: -0.3em;
    margin-bottom: 1em;
    font-style: italic;
}

@keyframes titlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes titleFlash {
    0%, 100% {
        color: #00ffff;
        text-shadow:
            0 0 10px #00ffff,
            0 0 30px #00ffff,
            0 0 60px #0088ff;
    }
    42% {
        color: #00ffff;
        text-shadow:
            0 0 10px #00ffff,
            0 0 30px #00ffff,
            0 0 60px #0088ff;
    }
    45% {
        color: #ff00ff;
        text-shadow:
            0 0 15px #ff00ff,
            0 0 40px #ff00ff,
            0 0 80px #ff0088;
    }
    48% {
        color: #00ffff;
        text-shadow:
            0 0 10px #00ffff,
            0 0 30px #00ffff,
            0 0 60px #0088ff;
    }
    51% {
        color: #ff00ff;
        text-shadow:
            0 0 20px #ff00ff,
            0 0 50px #ff00ff,
            0 0 100px #ff0088;
    }
    54% {
        color: #00ffff;
        text-shadow:
            0 0 10px #00ffff,
            0 0 30px #00ffff,
            0 0 60px #0088ff;
    }
}

.game-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.5em;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    margin-bottom: 2.5em;
    opacity: 0.8;
}

/* ===== INPUT ===== */
.input-group {
    margin-bottom: 1.5em;
}

#username-input {
    width: 100%;
    max-width: 320px;
    padding: 0.8em 1em;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #00ffff;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#username-input::placeholder {
    color: rgba(0, 255, 255, 0.3);
    letter-spacing: 0.15em;
}

#username-input:focus {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

/* ===== NEON BUTTON ===== */
.neon-btn {
    display: inline-block;
    padding: 0.8em 2.5em;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #00ffff;
    background: transparent;
    border: 2px solid #00ffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.neon-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow:
        0 0 10px rgba(0, 255, 255, 0.4),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    text-shadow: 0 0 8px #00ffff;
}

.neon-btn:active {
    background: rgba(0, 255, 255, 0.2);
}



/* ===== HUD ===== */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    padding: 1.2em 1.8em;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.hud.hidden {
    opacity: 0;
    pointer-events: none;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6em;
    flex: 1;
    max-width: 400px;
    margin: 0 2em;
}

.hud-right {
    align-items: flex-end;
}

/* Hall number */
#hud-hall-value {
    font-size: 2.0rem;
    font-weight: 900;
    color: #ff00ff;
    text-shadow:
        0 0 10px #ff00ff,
        0 0 25px rgba(255, 0, 255, 0.4);
    line-height: 1;
}

/* Hall progress bar */
.hud-hall-progress {
    width: 100%;
    height: 6px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.hud-hall-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    transition: width 0.3s ease;
}

/* Boss HP bar */
.boss-hp-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2em;
    transition: opacity 0.4s ease;
}

.boss-hp-bar.hidden {
    opacity: 0;
}

.boss-hp-label {
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    color: rgba(255, 68, 68, 0.7);
}

.boss-hp-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    position: relative;
    overflow: hidden;
}

.boss-hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff4444, #ff8800);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
    transition: width 0.2s ease;
}

.hud-label {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: rgba(0, 255, 255, 0.5);
    display: block;
    line-height: 1;
}

#hud-timer-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
    line-height: 1;
}

#hud-timer-value.warning {
    color: #ff4444;
    text-shadow: 0 0 12px rgba(255, 68, 68, 0.6);
    animation: timerBlink 0.5s ease-in-out infinite;
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#hud-score-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
    line-height: 1;
}

#hud-distance-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #44ffaa;
    text-shadow: 0 0 8px rgba(68, 255, 170, 0.4);
    line-height: 1;
}

.hud-combo {
    transition: opacity 0.3s ease;
}

.hud-combo.hidden {
    opacity: 0;
}

#hud-combo-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ff00ff;
    text-shadow:
        0 0 10px #ff00ff,
        0 0 25px rgba(255, 0, 255, 0.4);
    line-height: 1;
}

/* ===== GAME OVER STATS ===== */
.gameover-stats {
    margin: 1.5em 0 2em;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    width: 100%;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4em 0.6em;
    border-bottom: 1px solid rgba(255, 0, 255, 0.15);
}

.stat-label {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: rgba(255, 0, 255, 0.6);
    text-align: left;
    flex: 1;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff00ff;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 6em;
}

/* ===== LEADERBOARD ===== */
.leaderboard-section {
    margin: 1.5em 0;
    width: 100%;
}

.leaderboard-title {
    font-size: 0.85rem;
    letter-spacing: 0.35em;
    color: rgba(0, 255, 255, 0.6);
    margin-bottom: 0.8em;
}

.leaderboard-list {
    list-style: none;
    counter-reset: lb;
    max-height: 260px;
    overflow-y: auto;
}

.leaderboard-list li {
    counter-increment: lb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35em 0.5em;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(0, 255, 255, 0.08);
}

.leaderboard-list li::before {
    content: counter(lb) ".";
    width: 2em;
    color: rgba(0, 255, 255, 0.3);
    flex-shrink: 0;
}

.leaderboard-list li .lb-name {
    flex: 1;
    text-align: left;
    color: #00ffff;
    padding: 0 0.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-list li .lb-score {
    color: #ff00ff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.3);
    flex-shrink: 0;
    min-width: 5em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ===== SCROLLBAR ===== */
.leaderboard-list::-webkit-scrollbar {
    width: 4px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(0, 255, 255, 0.05);
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.2);
}

/* ===== DAMAGE FLASH ===== */
.damage-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    background: rgba(255, 0, 100, 0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease-out;
}

.damage-flash.active {
    opacity: 1;
    transition: none;
}

/* ===== WARP FLASH ===== */
.warp-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    background: radial-gradient(ellipse at center, rgba(0, 255, 255, 0.9), rgba(136, 0, 255, 0.6), transparent 70%);
}

.warp-flash.active {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

.warp-flash.fade-out {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

/* ===== POWERUP SELECTION OVERLAY ===== */
.powerup-title {
    font-size: 2rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.5em;
    color: #ffaa00;
    text-shadow:
        0 0 10px #ffaa00,
        0 0 30px #ffaa00,
        0 0 60px #ff8800;
}

.powerup-content {
    max-width: 800px;
}

.powerup-cards {
    display: flex;
    gap: 1.5em;
    justify-content: center;
    flex-wrap: nowrap;
}

.powerup-card {
    flex: 1 1 200px;
    max-width: 220px;
    padding: 1.5em 1.2em;
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid rgba(0, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8em;
    position: relative;
}

.powerup-card:hover {
    transform: scale(1.05);
}

.powerup-card.tier-common {
    border-color: #44ff44;
    box-shadow: 0 0 10px rgba(68, 255, 68, 0.15);
}

.powerup-card.tier-common:hover {
    box-shadow:
        0 0 15px rgba(68, 255, 68, 0.3),
        inset 0 0 15px rgba(68, 255, 68, 0.05);
}

.powerup-card.tier-rare {
    border-color: #4488ff;
    box-shadow: 0 0 10px rgba(68, 136, 255, 0.15);
}

.powerup-card.tier-rare:hover {
    box-shadow:
        0 0 15px rgba(68, 136, 255, 0.3),
        inset 0 0 15px rgba(68, 136, 255, 0.05);
}

.powerup-card.tier-epic {
    border-color: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.15);
}

.powerup-card.tier-epic:hover {
    box-shadow:
        0 0 15px rgba(255, 170, 0, 0.3),
        inset 0 0 15px rgba(255, 170, 0, 0.05);
}

.powerup-card-icon {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.powerup-card-icon img {
    width: 48px;
    height: 48px;
    display: block;
}

.powerup-card-name {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #00ffff;
    text-align: center;
}

.powerup-card-tier {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    padding: 0.2em 0.8em;
    border: 1px solid currentColor;
}

.powerup-card-desc {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: rgba(0, 255, 255, 0.5);
    text-align: center;
    line-height: 1.4;
}

/* ===== HUD POWERUP INDICATORS ===== */
.hud-powerups {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    margin-top: 0.6em;
}

.hud-powerup-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    padding: 0.15em 0.5em;
    border: 1px solid currentColor;
    text-align: right;
    white-space: nowrap;
    opacity: 0.8;
}

/* ===== POWERUP STATS SUMMARY ===== */
.powerup-stats {
    margin-top: 2em;
    padding: 1.5em 2em;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(0, 255, 255, 0.15);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.powerup-stats-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ffaa00;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.4);
    margin-bottom: 1.2em;
    text-align: center;
}

.powerup-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 140px);
    gap: 0.8em;
    justify-content: center;
    max-width: 460px;
    margin: 0 auto;
}

.powerup-stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    width: 140px;
    height: 140px;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.12);
    transition: border-color 0.2s ease;
}

.powerup-stat-tile:hover {
    border-color: rgba(0, 255, 255, 0.35);
}

.powerup-stat-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(0, 255, 255, 0.5);
}

.powerup-stat-icon {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.powerup-stat-icon img {
    width: 32px;
    height: 32px;
    display: block;
}

.powerup-stat-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.3);
    letter-spacing: 0.05em;
}

.powerup-collected-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(0, 255, 255, 0.4);
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    text-align: center;
}

.powerup-collected-list {
    display: flex;
    gap: 0.6em;
    flex-wrap: wrap;
    justify-content: center;
}

.powerup-collected-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    padding: 0.35em 0.8em;
    border: 1px solid currentColor;
    white-space: nowrap;
    opacity: 0.85;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.powerup-badge-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* ===== CREDITS EASTER EGG ===== */
.credits-btn {
    background: none;
    border: none;
    color: rgba(255, 0, 255, 0.25);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    margin-top: 0.8em;
    padding: 0.3em 0.8em;
    transition: color 0.3s;
}
.credits-btn:hover {
    color: rgba(255, 0, 255, 0.5);
}

#credits-overlay {
    background: #000;
    z-index: 200;
}

.credits-terminal {
    width: 100%;
    height: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2em 1.5em;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    color: #ffb000;
    font-size: clamp(0.7rem, 1.4vw, 0.95rem);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.credits-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 201;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
}

.credits-split {
    display: flex;
    gap: 2em;
    flex: 0 1 70vh;
    max-height: 70vh;
    min-height: 0;
    overflow: hidden;
}

.credits-left {
    flex: 1;
    border: 1px dashed rgba(255, 176, 0, 0.3);
    padding: 1em;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.credits-left::-webkit-scrollbar { display: none; }

.credits-right {
    flex: 1;
    border: 1px dashed rgba(255, 176, 0, 0.3);
    padding: 1em;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.credits-right::-webkit-scrollbar { display: none; }

.credits-lyrics {
    white-space: pre-wrap;
    word-break: break-word;
}

.credits-lyrics .lyric-line {
    display: block;
}

@keyframes lyricFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.credits-cursor {
    display: inline-block;
    animation: cursorBlink 0.6s step-end infinite;
    color: #ffb000;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.credits-names {
    white-space: pre-wrap;
}

.credits-names .credit-line {
    opacity: 0;
    animation: lyricFadeIn 0.4s forwards;
}

.credits-ascii {
    margin-top: 1em;
    text-align: center;
    white-space: pre;
    font-size: clamp(0.35rem, 0.8vw, 0.6rem);
    line-height: 1.15;
    color: #ffb000;
    opacity: 0;
    transition: opacity 1s ease-in;
    flex-shrink: 0;
}

.credits-ascii.visible {
    opacity: 1;
}

.credits-close-btn {
    position: fixed;
    bottom: 1.5em;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: 1px solid rgba(255, 176, 0, 0.4);
    color: #ffb000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    padding: 0.5em 1.5em;
    cursor: pointer;
    z-index: 202;
    transition: border-color 0.3s, text-shadow 0.3s;
}
.credits-close-btn:hover {
    border-color: #ffb000;
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.6);
}

@media (max-width: 600px) {
    .credits-split {
        flex-direction: column;
        gap: 1em;
    }
}

/* Credits text styles */
.credit-section {
    color: #ffb000;
    letter-spacing: 0.3em;
    font-size: 0.85em;
    margin-top: 0.5em;
}

.credit-role {
    color: rgba(255, 176, 0, 0.5);
    font-size: 0.75em;
    letter-spacing: 0.15em;
}

.credit-name {
    color: #ffb000;
    font-size: 1em;
    padding-left: 1em;
}

.lyric-header {
    color: rgba(255, 176, 0, 0.6);
    font-size: 0.85em;
}

.lyric-verse,
.lyric-bridge {
    color: #ffb000;
}

.lyric-chorus {
    color: #ffd060;
    font-style: italic;
}

.lyric-outro {
    color: rgba(255, 176, 0, 0.7);
    font-style: italic;
}
