/* Lumyna v1.4 - High Fidelity Design System */

:root {
    --primary-glow: #00ffff;
    --primary-bg: #050505;
    --danger-glow: #ff0055;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(15px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    background:
        radial-gradient(circle at top, rgba(0, 255, 255, 0.08), transparent 35%),
        linear-gradient(180deg, #05070a 0%, #010203 100%);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    -webkit-touch-callout: none;
}

.hidden {
    display: none !important;
}

button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    font: inherit;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 18%, rgba(52, 140, 196, 0.16), transparent 24%),
        radial-gradient(circle at center, #0b1216 0%, #000000 100%);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#touch-controls {
    position: absolute;
    inset: auto 0 18px 0;
    display: none;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 6px);
    pointer-events: none;
    z-index: 18;
}

.touch-cluster {
    display: flex;
    gap: 14px;
    pointer-events: auto;
}

.touch-move {
    align-items: flex-end;
}

.touch-jump-wrap {
    align-items: center;
}

.touchpad-btn {
    position: relative;
    min-width: 82px;
    min-height: 82px;
    padding: 0;
    border: 1px solid rgba(90, 240, 255, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(15, 45, 58, 0.58), rgba(2, 12, 18, 0.8)),
        radial-gradient(circle at 30% 25%, rgba(120, 250, 255, 0.16), transparent 42%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(0, 255, 255, 0.04),
        0 18px 35px rgba(0, 0, 0, 0.28),
        0 0 22px rgba(0, 255, 255, 0.08);
    color: #e9ffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
}

.touchpad-btn::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 18px;
    border: 1px solid rgba(96, 220, 255, 0.08);
    pointer-events: none;
}

.touchpad-btn:active,
.touchpad-btn.is-pressed {
    transform: translateY(1px) scale(0.98);
    border-color: rgba(130, 255, 255, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 26px rgba(0, 255, 255, 0.16),
        0 12px 20px rgba(0, 0, 0, 0.22);
}

.touchpad-btn-primary {
    border-color: rgba(86, 180, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(17, 48, 72, 0.58), rgba(2, 12, 18, 0.82)),
        radial-gradient(circle at 30% 25%, rgba(112, 190, 255, 0.18), transparent 44%);
}

.touchpad-btn-jump {
    min-width: 104px;
    min-height: 104px;
    border-radius: 50%;
    border-color: rgba(120, 250, 255, 0.26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(0, 255, 255, 0.05),
        0 18px 38px rgba(0, 0, 0, 0.32),
        0 0 28px rgba(0, 255, 255, 0.12);
}

.touchpad-glyph {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    line-height: 1;
    text-shadow: 0 0 18px rgba(0, 255, 255, 0.22);
}

.touchpad-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(224, 255, 255, 0.72);
    pointer-events: none;
}

.touchpad-ring {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(140, 255, 255, 0.18);
    box-shadow: inset 0 0 24px rgba(0, 255, 255, 0.06);
}

.touchpad-core {
    position: relative;
    z-index: 1;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #efffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.22);
    pointer-events: none;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

#hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 12px;
    margin-left: auto;
    text-align: right;
}

#hud-actions {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 100%;
}

#audio-toggle {
    width: 54px;
    height: 54px;
    border: 1px solid rgba(120, 240, 255, 0.18);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(9, 31, 40, 0.78), rgba(2, 10, 16, 0.92)),
        radial-gradient(circle at 28% 20%, rgba(0, 255, 255, 0.1), transparent 55%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 18px rgba(0, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#audio-toggle:hover,
#audio-toggle:focus-visible {
    border-color: rgba(120, 240, 255, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 24px rgba(0, 255, 255, 0.14);
}

#audio-toggle:active {
    transform: translateY(1px) scale(0.98);
}

#audio-toggle[aria-pressed="false"] {
    border-color: rgba(120, 160, 176, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.audio-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.audio-speaker {
    position: absolute;
    left: 1px;
    top: 7px;
    width: 8px;
    height: 10px;
    background: rgba(222, 252, 255, 0.95);
    clip-path: polygon(0 20%, 56% 20%, 100% 0, 100% 100%, 56% 80%, 0 80%);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.16);
}

.audio-wave {
    position: absolute;
    right: 0;
    top: 50%;
    border: 2px solid transparent;
    border-right-color: rgba(170, 248, 255, 0.9);
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wave-one {
    width: 10px;
    height: 12px;
    right: 6px;
}

.wave-two {
    width: 15px;
    height: 18px;
    right: 0;
}

.audio-status {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7ffff2;
    box-shadow: 0 0 10px rgba(127, 255, 242, 0.7);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#audio-toggle[aria-pressed="false"] .audio-wave {
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
}

#audio-toggle[aria-pressed="false"] .audio-speaker {
    background: rgba(192, 214, 219, 0.66);
}

#audio-toggle[aria-pressed="false"] .audio-status {
    background: rgba(173, 188, 196, 0.5);
    box-shadow: none;
    transform: scale(0.9);
}

#lumination-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    background: rgba(4, 20, 30, 0.38);
    padding: 12px 25px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
    animation: hud-breathe 4s infinite ease-in-out;
}

#stats-container .stat-box {
    background: rgba(4, 20, 30, 0.32);
    border: 1px solid rgba(120, 235, 255, 0.12);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 172px;
    text-align: right;
    box-shadow: 0 0 24px rgba(0, 255, 255, 0.05);
}

#hit-indicator {
    position: absolute;
    left: 50%;
    top: 28%;
    transform: translate(-50%, 10px) scale(0.96);
    padding: 14px 18px;
    border: 1px solid rgba(255, 120, 165, 0.22);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(40, 7, 20, 0.76), rgba(15, 3, 10, 0.92)),
        radial-gradient(circle at 50% 10%, rgba(255, 80, 140, 0.12), transparent 58%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 30px rgba(0, 0, 0, 0.2),
        0 0 28px rgba(255, 0, 96, 0.1);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffd5e5;
    text-shadow: 0 0 18px rgba(255, 70, 140, 0.35);
    opacity: 0;
    pointer-events: none;
    z-index: 16;
}

#hit-indicator.visible {
    animation: hit-toast 3s ease forwards;
}

@keyframes hit-toast {
    0% {
        opacity: 0;
        transform: translate(-50%, 18px) scale(0.92);
    }

    12% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }

    76% {
        opacity: 1;
        transform: translate(-50%, -10px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -34px) scale(0.98);
    }
}

@keyframes hud-breathe {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.9;
    }

    50% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

.label {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
}

.bar-glass {
    position: relative;
    width: 200px;
    flex: 0 0 200px;
    height: 12px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
}

#lumination-fill {
    position: absolute;
    left: 0;
    width: 100%;
    /* Dynamic */
    height: 100%;
    background: linear-gradient(to right, #0050ff, #00ffff, #0050ff);
    background-size: 200% 100%;
    box-shadow: 0 0 20px #00ffff, 0 0 40px rgba(0, 255, 255, 0.4);
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    animation: liquid-flow 3s infinite linear;
}

@keyframes liquid-flow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.glass-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
    z-index: 2;
}

#lumination-percent {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: var(--primary-glow);
    text-shadow: 0 0 10px var(--primary-glow);
}

.stat-box #score {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 20px var(--primary-glow);
}

.unit {
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
}

/* Overlays */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at center, rgba(0, 255, 255, 0.08), transparent 35%),
        rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(0);
}

.cinematic-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px;
    width: min(100%, 560px);
}

.version-tag {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 5px;
    color: var(--primary-glow);
    margin-bottom: 20px;
}

.lumyna-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(62px, 11vw, 100px);
    font-weight: 900;
    letter-spacing: 0.3em;
    line-height: 0.9;
    color: #fff;
    text-shadow: 0 0 40px var(--primary-glow);
}

.separator-line {
    width: 150px;
    height: 4px;
    background: #00ffff;
    margin: 25px 0;
    box-shadow: 0 0 15px #00ffff;
}

.subtitle {
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-bottom: 50px;
    max-width: 560px;
    line-height: 1.7;
}

.controls-guide {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 50px;
}

.control-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.keycap {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.05);
}

.divider {
    font-size: 20px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    opacity: 0.8;
}

.label-sub {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 5px;
}

.lumyna-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #00ffff;
    padding: 20px 60px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    letter-spacing: 4px;
    transition: all 0.3s ease;
    border-radius: 4px;
    text-transform: uppercase;
}

.lumyna-btn:hover {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 40px #00ffff;
    transform: scale(1.05);
}

.danger-action {
    border-color: #ff0055;
}

.danger-action:hover {
    background: #ff0055;
    box-shadow: 0 0 40px #ff0055;
}

.revive-action {
    width: 100%;
    max-width: 360px;
    margin-bottom: 14px;
    border-color: rgba(255, 210, 90, 0.55);
    background:
        linear-gradient(180deg, rgba(40, 28, 0, 0.55), rgba(12, 10, 0, 0.84)),
        radial-gradient(circle at 50% 0%, rgba(255, 220, 110, 0.15), transparent 60%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 22px rgba(255, 210, 90, 0.1);
}

.revive-action:hover {
    background: rgba(255, 210, 90, 0.92);
    color: #150d00;
    box-shadow: 0 0 36px rgba(255, 210, 90, 0.26);
}

.revive-action.is-loading {
    pointer-events: none;
    opacity: 0.76;
    box-shadow: 0 0 26px rgba(255, 210, 90, 0.18);
}

#revive-ad-panel {
    width: 100%;
    max-width: 360px;
    margin: 0 auto 18px;
    padding: 14px 14px 10px;
    border: 1px solid rgba(255, 220, 120, 0.14);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(24, 18, 4, 0.68), rgba(8, 8, 4, 0.9)),
        radial-gradient(circle at 50% 0%, rgba(255, 214, 110, 0.08), transparent 65%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 24px rgba(255, 210, 90, 0.06);
}

.revive-ad-label {
    margin-bottom: 12px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(255, 224, 152, 0.62);
}

.revive-ad-slot {
    min-height: 90px;
}

@media (max-width: 900px), (pointer: coarse) {
    #touch-controls {
        display: flex;
    }

    #hud {
        padding: 18px 16px;
        gap: 12px;
    }

    #hud-right {
        gap: 10px;
    }

    #lumination-container {
        padding: 10px 14px;
        gap: 10px;
    }

    .bar-glass {
        width: min(34vw, 180px);
    }

    #stats-container .stat-box {
        min-width: 132px;
        padding: 10px 12px;
    }

    #audio-toggle {
        width: 48px;
        height: 48px;
    }

    .stat-box #score {
        font-size: clamp(30px, 10vw, 42px);
    }

    .overlay {
        align-items: flex-start;
        overflow-y: auto;
    }

    .cinematic-content {
        width: min(100%, 440px);
        min-height: 100%;
        justify-content: center;
        padding:
            calc(env(safe-area-inset-top, 0px) + 28px)
            22px
            calc(env(safe-area-inset-bottom, 0px) + 124px);
    }

    .lumyna-logo {
        font-size: clamp(48px, 13vw, 78px);
        letter-spacing: 0.18em;
    }

    .subtitle {
        margin-bottom: 32px;
        max-width: 32ch;
    }

    .controls-guide {
        gap: 18px;
        margin-bottom: 32px;
    }

    .mobile-note {
        max-width: 30ch;
        line-height: 1.6;
    }
}

@media (max-width: 640px) {
    #hud {
        align-items: flex-start;
    }

    #hud-right {
        width: 100%;
        align-items: flex-end;
    }

    #hud-actions {
        width: 100%;
        justify-content: flex-end;
    }

    #lumination-container {
        max-width: 62vw;
    }

    .label {
        font-size: 8px;
        letter-spacing: 1.6px;
    }

    #lumination-percent {
        font-size: 12px;
    }

    .unit {
        font-size: 10px;
    }

    #touch-controls {
        padding: 0 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
    }

    .touch-cluster {
        gap: 10px;
    }

    .touchpad-btn {
        min-width: 72px;
        min-height: 72px;
        border-radius: 20px;
    }

    .touchpad-btn-jump {
        min-width: 92px;
        min-height: 92px;
    }

    .touchpad-glyph {
        font-size: 24px;
    }

    .touchpad-core {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .cinematic-content {
        width: 100%;
        padding:
            calc(env(safe-area-inset-top, 0px) + 20px)
            16px
            calc(env(safe-area-inset-bottom, 0px) + 118px);
    }

    .version-tag {
        margin-bottom: 14px;
        letter-spacing: 3px;
    }

    .lumyna-logo {
        font-size: clamp(38px, 13.5vw, 56px);
        letter-spacing: 0.12em;
        max-width: 100%;
    }

    .separator-line {
        width: min(120px, 34vw);
        margin: 18px 0;
    }

    .subtitle {
        font-size: 10px;
        letter-spacing: 2px;
        margin-bottom: 24px;
    }

    .controls-guide {
        width: 100%;
        gap: 12px;
        margin-bottom: 24px;
    }

    .control-col {
        width: 100%;
        gap: 8px;
    }

    .keycap {
        min-width: 88px;
        padding: 9px 14px;
        font-size: 12px;
    }

    .lumyna-btn {
        width: 100%;
        max-width: 100%;
        padding: 16px 18px;
        font-size: 12px;
        letter-spacing: 3px;
    }

    .mobile-note {
        margin-top: 18px;
        font-size: 9px;
        letter-spacing: 0.8px;
    }

    #hit-indicator {
        top: 24%;
        max-width: calc(100vw - 34px);
        font-size: 12px;
        letter-spacing: 1.5px;
        text-align: center;
    }
}

@media (pointer: coarse) and (orientation: landscape), (pointer: coarse) and (max-height: 540px) {
    #hud {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        padding:
            calc(env(safe-area-inset-top, 0px) + 10px)
            12px
            0;
        gap: 10px;
    }

    #hud-right {
        gap: 8px;
    }

    #lumination-container {
        max-width: min(58vw, 430px);
        padding: 8px 12px;
        gap: 8px;
    }

    #stats-container .stat-box {
        min-width: 118px;
        width: auto;
        padding: 8px 10px;
    }

    #hud-actions {
        width: auto;
    }

    .bar-glass {
        width: min(28vw, 160px);
    }

    .stat-box #score {
        font-size: clamp(24px, 7vw, 34px);
    }

    #touch-controls {
        padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
    }

    .touchpad-btn {
        min-width: 64px;
        min-height: 64px;
        border-radius: 18px;
    }

    .touchpad-btn-jump {
        min-width: 84px;
        min-height: 84px;
    }

    .touchpad-glyph {
        font-size: 22px;
    }

    .touchpad-label,
    .touchpad-core {
        letter-spacing: 1.5px;
    }

    .overlay {
        align-items: flex-start;
    }

    .cinematic-content {
        width: min(100%, 700px);
        min-height: 100%;
        justify-content: center;
        padding:
            calc(env(safe-area-inset-top, 0px) + 14px)
            18px
            calc(env(safe-area-inset-bottom, 0px) + 104px);
    }

    .version-tag {
        margin-bottom: 10px;
        font-size: 8px;
        letter-spacing: 2px;
    }

    .lumyna-logo {
        font-size: clamp(34px, 7vw, 52px);
        letter-spacing: 0.1em;
    }

    .separator-line {
        width: 92px;
        margin: 12px 0;
    }

    .subtitle {
        font-size: 9px;
        letter-spacing: 1.8px;
        margin-bottom: 18px;
        max-width: 40ch;
    }

    .controls-guide {
        flex-direction: row;
        gap: 12px;
        margin-bottom: 18px;
    }

    .control-col {
        gap: 6px;
    }

    .keycap {
        min-width: 76px;
        padding: 8px 10px;
        font-size: 11px;
    }

    .divider {
        font-size: 16px;
    }

    .label-sub {
        font-size: 8px;
        letter-spacing: 2px;
    }

    .lumyna-btn {
        max-width: 280px;
        padding: 14px 18px;
        font-size: 11px;
        letter-spacing: 2px;
    }

    .mobile-note {
        margin-top: 12px;
        font-size: 8px;
    }

    #hit-indicator {
        top: 22%;
        padding: 10px 14px;
        font-size: 11px;
    }
}

.mobile-note {
    margin-top: 30px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.32);
    letter-spacing: 1px;
}

.shattered-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 85px;
    font-weight: 900;
    color: #ff0055;
    text-shadow: 0 0 30px rgba(255, 0, 85, 0.6);
    letter-spacing: 0.08em;
    line-height: 0.92;
    max-width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.separator-line-red {
    width: 80px;
    height: 4px;
    background: #ff0055;
    margin-bottom: 30px;
    box-shadow: 0 0 15px #ff0055;
}

.final-stats {
    margin-bottom: 40px;
}

.final-stats #final-score {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(52px, 10vw, 80px);
    font-weight: 400;
    line-height: 1;
    margin: 8px 0;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}

/* --- NEW BEST Badge --- */
#new-best-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 4px;
    color: #ffd700;
    text-shadow: 0 0 14px #ffd700;
    margin-top: 10px;
    animation: best-pulse 1.2s infinite ease-in-out;
}

@keyframes best-pulse {

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

    50% {
        opacity: 0.7;
        transform: scale(1.06);
    }
}

/* --- Session Leaderboard --- */
#leaderboard {
    width: 100%;
    max-width: 400px;
    margin: 18px auto 24px;
    background: rgba(0, 20, 30, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.14);
    border-radius: 10px;
    padding: 16px 20px;
    backdrop-filter: blur(8px);
}

.lb-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 4px;
    color: rgba(0, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 14px;
}

#leaderboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
}

.lb-entry.lb-current {
    background: rgba(0, 255, 255, 0.08);
    border-color: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.lb-rank {
    font-size: 18px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.lb-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    text-align: center;
}

.lb-unit {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 3px;
}

.lb-time {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    width: 70px;
    text-align: right;
    flex-shrink: 0;
}

/* Ensure game-over cinematic content scrolls if needed */
#game-over-screen .cinematic-content {
    max-height: 100vh;
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
    scrollbar-width: none;
}

#game-over-screen .cinematic-content::-webkit-scrollbar {
    display: none;
}

@media (max-width: 820px) {
    #hud {
        padding: 18px;
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    #lumination-container,
    #stats-container .stat-box {
        width: 100%;
    }

    .bar-glass {
        width: 100%;
    }

    .controls-guide {
        gap: 18px;
        flex-direction: column;
    }

    .lumyna-btn {
        width: 100%;
        max-width: 320px;
    }

    .shattered-text {
        font-size: clamp(48px, 14vw, 85px);
        letter-spacing: 0.05em;
    }

    .final-stats #final-score {
        font-size: clamp(58px, 20vw, 100px);
    }
}

@media (min-width: 821px) {
    .shattered-text {
        font-size: clamp(64px, 9vw, 85px);
    }
}
