/* ============================================================
   HUD BAR — top score + next preview
   ============================================================ */
.hud-bar {
    position: absolute;
    top: 22px;
    left: 22px;
    right: 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

.score-container,
.next-container {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 60%),
        rgba(10, 10, 18, 0.55);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.score-container {
    padding: 12px 26px;
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.next-container {
    padding: 8px 8px 8px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hud-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 700;
    font-family: 'Inter', 'Rajdhani', sans-serif;
}
.score-container .hud-label { margin-bottom: 2px; }

.score-val {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 0.9;
    color: white;
    text-shadow: 0 2px 12px rgba(99, 102, 241, 0.35);
    font-family: 'Rajdhani', sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    transition: transform 0.2s var(--ease-spring), color 0.2s ease;
}
.score-val.bump {
    transform: scale(1.18);
    color: #bae6fd;
}

.next-preview {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.next-preview canvas { display: block; }

.best-score-hint {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.12em;
    margin-top: 4px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.hud-center {
    flex: 1;
    max-width: 220px;
    margin: 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.tier-track {
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tier-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, #818cf8, #22d3ee, #fde047);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.65);
    transition: width 0.45s var(--ease-out);
}

.tier-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Rajdhani', sans-serif;
}

.combo-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: #67e8f9;
    text-shadow: 0 0 14px rgba(34, 211, 238, 0.8);
    min-height: 1.2rem;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.2s ease, transform 0.25s var(--ease-spring);
}
.combo-val.active {
    opacity: 1;
    transform: scale(1);
}

.discovery-banner {
    position: absolute;
    top: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    padding: 10px 28px;
    border-radius: 999px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02)),
        rgba(8, 8, 20, 0.72);
    border: 1px solid color-mix(in srgb, var(--disc-color, #818cf8) 55%, transparent);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.45),
        0 0 24px color-mix(in srgb, var(--disc-color, #818cf8) 35%, transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    transition: opacity 0.35s ease, transform 0.4s var(--ease-out);
}
.discovery-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gameover-stats {
    display: flex;
    gap: 32px;
    margin: -12px 0 28px;
    z-index: 2;
}
.go-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.go-label {
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
    text-transform: uppercase;
}
.go-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #e2e8f0;
}

.orb-preview-row {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 320px;
    gap: 8px 10px;
}

/* ============================================================
   CONTROL DECK — bottom shake button
   ============================================================ */
.control-deck {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 30px 36px;
    background: linear-gradient(to top, rgba(2, 2, 8, 0.75) 0%, transparent 100%);
    pointer-events: auto;
    z-index: 20;
    display: flex;
    justify-content: center;
}

.shake-btn {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 60%),
        rgba(10, 10, 18, 0.5);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.32);
    color: white;
    padding: 14px 36px 16px;
    border-radius: 60px;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.25s var(--ease-out), background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), filter 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.shake-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow:
        0 22px 44px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 243, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.shake-btn:active:not(:disabled) { transform: scale(0.97); }
.shake-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.7); }

.shake-label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', 'Rajdhani', sans-serif;
}
.shake-ammo {
    display: flex;
    gap: 5px;
    width: 100%;
    justify-content: center;
}
.ammo-pip {
    width: 100%;
    max-width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.ammo-pip.active {
    background: linear-gradient(90deg, #00f3ff, #67e8f9);
    box-shadow:
        0 0 10px rgba(0, 243, 255, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.ammo-pip.spent { opacity: 0.25; }

/* ============================================================
   MENU OVERLAY — liquid glass dialog
   ============================================================ */
.menu {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 35%, rgba(129, 140, 248, 0.10), transparent 70%),
        rgba(5, 5, 12, 0.55);
    backdrop-filter: blur(36px) saturate(180%);
    -webkit-backdrop-filter: blur(36px) saturate(180%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease-out), backdrop-filter 0.45s ease;
    overflow: hidden;
}
.menu.active { opacity: 1; pointer-events: auto; }

.menu-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 35% at 50% 30%, rgba(165, 180, 252, 0.18), transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 85%, rgba(99, 102, 241, 0.12), transparent 70%);
    pointer-events: none;
    animation: menuGlow 8s ease-in-out infinite;
}
@keyframes menuGlow {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

/* Typography */
.title-group {
    position: relative;
    margin-bottom: 16px;
    z-index: 2;
    text-align: center;
    animation: titleFloat 6s ease-in-out infinite;
}
@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hero-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(3.5rem, 9vw, 5.5rem);
    line-height: 0.9;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 60%, #a5b4fc 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 12px 28px rgba(99, 102, 241, 0.32));
}
.hero-title.bottom {
    font-size: clamp(4rem, 10vw, 6.2rem);
    background: linear-gradient(180deg, #c7d2fe 0%, #818cf8 60%, #4f46e5 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 14px 38px rgba(99, 102, 241, 0.55));
    margin-top: -8px;
}

.sub-text {
    font-family: 'Inter', 'Rajdhani', sans-serif;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 36px;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.menu-hint {
    margin-top: 28px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.15em;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-weight: 500;
}

.orb-preview-row {
    display: flex;
    gap: 14px;
    margin-top: 36px;
    z-index: 2;
}
.orb-preview-dot {
    --c: #ffffff;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, var(--c) 60%, color-mix(in srgb, var(--c) 60%, black) 100%);
    box-shadow:
        0 0 12px color-mix(in srgb, var(--c) 60%, transparent),
        0 0 24px color-mix(in srgb, var(--c) 30%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: orbDotFloat 3s ease-in-out infinite;
}
.orb-preview-dot:nth-child(1) { animation-delay: 0s; }
.orb-preview-dot:nth-child(2) { animation-delay: 0.2s; width: 16px; height: 16px; }
.orb-preview-dot:nth-child(3) { animation-delay: 0.4s; width: 18px; height: 18px; }
.orb-preview-dot:nth-child(4) { animation-delay: 0.6s; width: 20px; height: 20px; }
.orb-preview-dot:nth-child(5) { animation-delay: 0.8s; width: 22px; height: 22px; }
.orb-preview-dot:nth-child(6) { animation-delay: 1.0s; width: 24px; height: 24px; }
.orb-preview-dot:nth-child(7) { animation-delay: 1.2s; width: 26px; height: 26px; }
@keyframes orbDotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Fail screen */
.fail-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(3rem, 7vw, 4.8rem);
    line-height: 1;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fecaca 50%, #f43f5e 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 14px 38px rgba(244, 63, 94, 0.55));
}
.final-score-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    color: white;
    margin-bottom: 36px;
    text-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ============================================================
   LIQUID GLASS BUTTONS
   ============================================================ */
.btn-main {
    position: relative;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 55%),
        rgba(10, 10, 18, 0.45);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-top-color: rgba(255, 255, 255, 0.42);
    padding: 0;
    width: 240px;
    height: 72px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    cursor: pointer;
    z-index: 2;
    border-radius: 100px;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background 0.35s ease, border-color 0.25s ease;
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.btn-main.danger {
    background:
        linear-gradient(135deg, rgba(244, 63, 94, 0.32), rgba(244, 63, 94, 0.06) 55%),
        rgba(28, 8, 12, 0.55);
    border-color: rgba(244, 63, 94, 0.45);
    border-top-color: rgba(255, 200, 200, 0.55);
    box-shadow:
        0 18px 50px rgba(244, 63, 94, 0.32),
        inset 0 1px 0 rgba(255, 200, 200, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.btn-content {
    position: relative;
    z-index: 2;
}

.btn-glare {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, transparent 55%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s, transform 0.5s var(--ease-out);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

.btn-main:hover {
    transform: translateY(-4px) scale(1.025);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -1px 0 rgba(0, 0, 0, 0.32);
}
.btn-main.danger:hover {
    box-shadow:
        0 28px 60px rgba(244, 63, 94, 0.42),
        0 0 0 1px rgba(244, 63, 94, 0.3),
        inset 0 1px 0 rgba(255, 200, 200, 0.5);
}
.btn-main:hover .btn-glare {
    opacity: 1;
    transform: scale(1);
}
.btn-main:active {
    transform: scale(0.96);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
    .hud-bar { top: 14px; left: 14px; right: 14px; flex-wrap: wrap; }
    .score-container { padding: 10px 18px; min-width: 100px; }
    .score-val { font-size: 1.9rem; }
    .hud-center { order: 3; width: 100%; max-width: none; margin: 8px 0 0; }
    .next-container { padding: 6px 6px 6px 16px; gap: 10px; }
    .next-preview { width: 44px; height: 44px; }
    .discovery-banner { top: 72px; font-size: 0.8rem; padding: 8px 18px; }
    .danger-line { top: 130px; }
    .shake-btn { min-width: 180px; padding: 12px 26px 14px; }
    .control-deck { padding: 22px 22px 26px; }
    .menu-hint { font-size: 0.66rem; }
}
