/* ==========================================================
   TBILISI DRIFT — PREMIUM DASHBOARD UI
   Design language: brushed carbon-fiber + polished chrome,
   amber instrument-cluster glow, real automotive depth.
   Drop-in replacement — all original selectors preserved.
   ========================================================== */

/* ----------------------------------------
   0. DESIGN TOKENS
   ---------------------------------------- */
:root {
    --onyx: #08090c;
    --carbon: #14161c;
    --carbon-light: #1d2027;
    --steel: #2a2d36;
    --steel-light: #3a3e4a;
    --chrome: #e8ecf3;
    --chrome-dim: #9aa0ad;

    --amber: #ff8a1e;
    --amber-deep: #d9530a;
    --amber-glow: #ffb03a;
    --gold: #ffcf6b;

    --ink: #f4f6fa;
    --ink-dim: #aab0bd;

    --r-lg: 22px;
    --r-md: 14px;
    --r-sm: 10px;

    --ease-snap: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ----------------------------------------
   1. RESET & BASE (iOS 18+)
   ---------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    background: var(--onyx);
    color: var(--ink);
    perspective: 1200px;
}

.hidden { display: none !important; }

/* ----------------------------------------
   2. ATMOSPHERIC BACKGROUND — Tbilisi at dusk
   ---------------------------------------- */
body::before {
    content: '';
    position: fixed;
    top: -6%;
    left: -6%;
    width: 112%;
    height: 112%;
    background-image: url('tbilisi.webp');
    background-size: cover;
    background-position: center;
    filter: brightness(0.5) contrast(1.22) saturate(1.15) blur(2px);
    transform: translateZ(-60px) scale(1.1);
    will-change: transform, filter;
    z-index: 0;
}

/* cinematic depth grade: cool shadows, warm amber kiss on the horizon */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 78%, rgba(0, 0, 0, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 30% 45%, transparent 15%, rgba(3, 4, 8, 0.88) 92%),
        linear-gradient(180deg, rgba(4, 5, 9, 0.55) 0%, transparent 35%, rgba(2, 2, 5, 0.95) 100%);
    pointer-events: none;
    z-index: 2;
}

@keyframes atmosphericSubtle {
    0%   { transform: scale(1.06) translateY(0px); filter: brightness(0.5) contrast(1.22) saturate(1.15) blur(2px); }
    100% { transform: scale(1.11) translateY(-6px); filter: brightness(0.58) contrast(1.26) saturate(1.25) blur(1.5px); }
}

/* ----------------------------------------
   3. 3D CANVAS
   ---------------------------------------- */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 1;
}

/* ----------------------------------------
   4. HUD SHELL
   ---------------------------------------- */
.hud-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

/* Score / khinkali counter — brushed metal chip with amber readout */
#score, .score-badge {
    position: fixed;
    top: max(14px, env(safe-area-inset-top) + 19px);
    right: max(14px, env(safe-area-inset-left) + 12px);
    z-index: 100;
    white-space: nowrap;
    pointer-events: none;
    display: flex;
    align-items: center;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: rgba(152, 145, 113, 0.912);
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.35);

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
        rgba(14, 15, 20, 0.72);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 254, 0.22);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------
   5. CONTROL BUTTONS — machined metal keys
   ---------------------------------------- */
.hud-controls {
    position: fixed;
    right: max(14px, env(safe-area-inset-right) + 6px);
    bottom: max(14px, env(safe-area-inset-bottom) + 6px);
    z-index: 100;
    pointer-events: auto;

    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-end;
}

.icon-btn,
.ios-btn,
#view-btn,
#change-car-btn,
#lang-toggle-hud {
    position: relative !important;
    top: auto !important;
    right: auto !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 13px !important;

    font-family: inherit;
    font-size: 12px !important;
    font-weight: 700;
    color: var(--ink) !important;
    white-space: nowrap;

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 45%, rgba(0, 0, 0, 0.1) 100%),
        rgba(24, 26, 33, 0.78) !important;
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);

    border: 0.5px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 13px !important;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 1px rgba(0, 0, 0, 0.35);

    cursor: pointer;
    outline: none;
    transition: transform 0.15s var(--ease-out), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:active,
.ios-btn:active,
#view-btn:active,
#change-car-btn:active,
#lang-toggle-hud:active {
    transform: scale(0.93) !important;
    background:
        linear-gradient(180deg, rgba(255, 138, 30, 0.16) 0%, rgba(255, 255, 255, 0.03) 60%),
        rgba(24, 26, 33, 0.85) !important;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

@media (hover: hover) {
    .icon-btn:hover,
    .ios-btn:hover,
    #view-btn:hover,
    #change-car-btn:hover,
    #lang-toggle-hud:hover {
        border-color: rgba(255, 176, 58, 0.45) !important;
        box-shadow:
            0 8px 18px rgba(0, 0, 0, 0.4),
            0 0 16px rgba(255, 138, 30, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
}

/* ----------------------------------------
   6. OVERLAY SCREENS (menu / game over)
   ---------------------------------------- */
.overlay-screen {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;

    padding-top: calc(60px + env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.overlay-bg {
    position: absolute;
    inset: 0;
    background-image: url('over.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    filter: brightness(0.75) saturate(1.1);
    z-index: -1;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 138, 30, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 20% 30%, rgba(10, 10, 18, 0.35) 0%, rgba(2, 2, 5, 0.88) 100%);
}

/* Cards: carbon-fiber weave + chrome edge + amber underglow — the signature surface */
.menu-card, #game-over {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    width: 100%;
    max-width: 220px;

    background:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.018) 0px,
            rgba(255, 255, 255, 0.018) 2px,
            transparent 2px,
            transparent 4px
        ),
        linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, transparent 30%),
        rgba(15, 17, 24, 0.78);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.28);
    border-radius: var(--r-lg);
    padding: 18px 13px 16px;
    text-align: center;
    color: var(--ink);

    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 138, 30, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);

    animation: cardAppear 0.4s var(--ease-snap);
}

@keyframes cardAppear {
    from { opacity: 0; transform: scale(0.93) translateY(-14px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--amber-glow);
    background: linear-gradient(180deg, rgba(255, 176, 58, 0.16), rgba(255, 176, 58, 0.06));
    padding: 3px 7px;
    border-radius: 6px;
    margin-bottom: 9px;
    border: 1px solid rgba(255, 176, 58, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-card h1, #game-over h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
    margin-bottom: 11px;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--chrome) 0%, #dfe4ee 45%, var(--chrome-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.stats-container {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15));
    border-radius: var(--r-md);
    padding: 9px 11px;
    margin-bottom: 13px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 10px;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--amber-glow);
    text-shadow: 0 0 10px rgba(255, 176, 58, 0.3);
}

/* ----------------------------------------
   7. MENU BUTTONS — ignition-key press feel
   ---------------------------------------- */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
}

.btn, #restart-btn {
    width: 100%;
    padding: 11px 8px;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
}

#restart-btn { margin-top: 9px; }

.btn::after, #restart-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 55%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(155deg, #ff9a30 0%, var(--amber-deep) 55%, #b8420a 100%);
    color: #180900;
    box-shadow:
        0 6px 18px rgba(217, 83, 10, 0.4),
        0 0 24px rgba(255, 138, 30, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:active, #restart-btn:active, .btn-secondary:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow:
            0 9px 22px rgba(217, 83, 10, 0.5),
            0 0 30px rgba(255, 138, 30, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.45);
    }
    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.14) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }
}

.btn-secondary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)) !important;
    color: var(--ink) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#restart-btn {
    color: var(--ink);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ----------------------------------------
   9. GARAGE MODAL — showroom display case
   ---------------------------------------- */
.garage-card {
    position: relative;
    z-index: 3;
    pointer-events: auto;
    width: 100%;
    max-width: 280px;

    background:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.015) 0px,
            rgba(255, 255, 255, 0.015) 2px,
            transparent 2px,
            transparent 4px
        ),
        linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, transparent 35%),
        rgba(15, 17, 24, 0.88);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-top-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--r-lg);
    padding: 15px;
    color: var(--ink);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(255, 138, 30, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: cardAppear 0.35s var(--ease-snap);
}

.garage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.garage-header h2 {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--amber-glow);
    text-shadow: 0 0 12px rgba(255, 176, 58, 0.3);
}

.close-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, transform 0.15s ease;
}

.close-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.92);
}

.car-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.car-grid::-webkit-scrollbar { width: 4px; }
.car-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--amber), var(--amber-deep));
    border-radius: 4px;
}

.car-card {
    display: flex;
    align-items: center;
    gap: 11px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--r-md);
    padding: 9px;
    cursor: pointer;
    transition: transform 0.15s var(--ease-out), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.car-card:active { transform: scale(0.97); }

.car-card.active {
    background: linear-gradient(180deg, rgba(255, 138, 30, 0.2), rgba(255, 138, 30, 0.08));
    border-color: rgba(255, 138, 30, 0.65);
    box-shadow:
        0 0 18px rgba(255, 138, 30, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.car-preview {
    width: 52px;
    height: 38px;
    border-radius: 9px;
    background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.car-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.img-placeholder { font-size: 18px; }

.car-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    text-align: left;
}

.car-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
}

.car-status {
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-dim);
    margin-top: 2px;
}

.car-card.active .car-status { color: var(--amber-glow); }

/* ----------------------------------------
   SPEEDOMETER — analog instrument feel
   ---------------------------------------- */
.hud-speedometer-image {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom) + 10px);
    left: max(20px, env(safe-area-inset-left) + 12px);
    z-index: 100;
    width: 104px;
    pointer-events: none;
    filter: drop-shadow(0 0 18px rgba(255, 138, 30, 0.12));
}

.hud-speedometer-image img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.speed-overlay-text {
    position: absolute;
    bottom: 52px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 138, 30, 0.6), 0 0 3px rgba(0, 0, 0, 0.9);
}

/* ----------------------------------------
   KHINKALI BALANCE — gold ingot readout
   ---------------------------------------- */
#khinkali-balance-display {
    font-size: 15px;
    font-weight: 800;
    color: var(--gold);
    margin: 7px 0 13px 0;
    background: linear-gradient(180deg, rgba(255, 176, 58, 0.1), rgba(255, 176, 58, 0.04));
    padding: 11px 15px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 176, 58, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 20px rgba(255, 176, 58, 0.06);
    transition: all 0.3s ease;
}

#khinkali-balance-display:hover {
    background: linear-gradient(180deg, rgba(255, 176, 58, 0.18), rgba(255, 176, 58, 0.06));
    border-color: rgba(255, 176, 58, 0.38);
}

#khinkali-balance-display .balance-icon { font-size: 18px; }

#khinkali-balance-display .balance-amount {
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold), var(--amber-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Khinkali icon sizing */
.khinkali-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    filter: drop-shadow(0 2px 4px rgba(255, 176, 58, 0.35));
}

.khinkali-icon-small {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 3px;
}

.khinkali-icon-large {
    width: 32px;
    height: 32px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    filter: drop-shadow(0 4px 8px rgba(255, 176, 58, 0.45));
}

#khinkali-balance-display .khinkali-icon { width: 28px; height: 28px; margin-right: 8px; }
.score-badge .khinkali-icon { width: 16px; height: 16px; margin-right: 3px; }
.car-status .khinkali-icon { width: 14px; height: 14px; margin-right: 2px; }

/* ----------------------------------------
   FOOTER CREDIT
   ---------------------------------------- */
#footer-credit {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0.35;
    transition: opacity 0.5s ease, transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
}

#footer-credit.hidden-credit {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none !important;
}

#footer-credit .credit-label { opacity: 0.6; font-weight: 400; }

#footer-credit .credit-name {
    font-weight: 700;
    color: rgba(255, 176, 58, 0.9);
    text-shadow: 0 0 20px rgba(255, 176, 58, 0.15);
    letter-spacing: 0.5px;
}

@keyframes creditAppear {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 0.35; transform: translateX(-50%) translateY(0); }
}

#footer-credit:not(.hidden-credit) { animation: creditAppear 1.5s ease-out; }

@media (max-width: 360px) {
    #footer-credit { font-size: 8px; padding: 3px 10px; bottom: 6px; }
}

:fullscreen #footer-credit { opacity: 0.25; }

@media (prefers-color-scheme: dark) {
    #footer-credit { background: rgba(0, 0, 0, 0.28); }
}

#lang-toggle-btn.hidden { display: none !important; }

/* ----------------------------------------
   LOADING BAR — spooling turbine feel
   ---------------------------------------- */
#loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    margin-top: 9px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

#loading-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--amber-deep), var(--amber), var(--amber-glow));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 138, 30, 0.5);
}

#loading-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 22px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45));
    animation: loadingShine 1.5s infinite;
}

@keyframes loadingShine {
    0%   { transform: translateX(-22px); }
    100% { transform: translateX(44px); }
}

.btn:disabled { cursor: not-allowed; opacity: 0.55; }

/* ----------------------------------------
   AUTH TABS
   ---------------------------------------- */
.auth-tab {
    font-family: inherit;
    transition: all 0.2s ease;
}

.auth-tab:active { transform: scale(0.96); }

.auth-tab.active {
    background: linear-gradient(155deg, #ff9a30, var(--amber-deep));
    color: #180900;
    box-shadow: 0 3px 10px rgba(217, 83, 10, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.auth-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.09);
}

#start-btn:disabled {
    cursor: wait !important;
    opacity: 0.7 !important;
}

#start-btn .btn-text {
    transition: all 0.3s ease;
}

#start-btn.loading .btn-text {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}




/* ========================================
   ПОДСКАЗКА УПРАВЛЕНИЯ — PREMIUM STYLE
   ======================================== */
#control-hint {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), 
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

#control-hint .hint-container {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0);
    padding: 8px 20px;
    border-radius: 30px;
    border: 0.5px solid rgba(255, 255, 255, 0);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0);
}

#control-hint .hint-arrow {
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: -1px;
    transition: color 0.3s ease;
    text-shadow: 0 0 20px rgba(255, 176, 58, 0.05);
}

#control-hint .hint-arrow-left {
    animation: arrowSlideLeft 2.5s ease-in-out infinite;
}

#control-hint .hint-arrow-right {
    animation: arrowSlideRight 2.5s ease-in-out infinite;
}

#control-hint .hint-text {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 176, 58, 0.08);
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.3) 0%, 
        rgba(255,255,255,0.5) 50%, 
        rgba(255,255,255,0.3) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

@keyframes arrowSlideLeft {
    0%, 100% { 
        transform: translateX(0);
        opacity: 0.25;
    }
    50% { 
        transform: translateX(-6px);
        opacity: 0.7;
        color: rgba(255, 252, 248, 0.6);
    }
}

@keyframes arrowSlideRight {
    0%, 100% { 
        transform: translateX(0);
        opacity: 0.25;
    }
    50% { 
        transform: translateX(6px);
        opacity: 0.7;
        color: rgba(255, 252, 248, 0.6);
    }
}

@keyframes hintAppear {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(12px) scale(0.95);
    }
    100% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

#control-hint.visible {
    animation: hintAppear 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.game-over #control-hint {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(10px) !important;
    animation: none !important;
}

@media (max-width: 400px) {
    #control-hint .hint-container {
        gap: 10px;
        padding: 6px 14px;
    }
    #control-hint .hint-arrow {
        font-size: 15px;
    }
    #control-hint .hint-text {
        font-size: 9px;
        letter-spacing: 0.5px;
    }
}

@media (min-width: 768px) {
    #control-hint .hint-arrow {
        font-size: 22px;
    }
    #control-hint .hint-text {
        font-size: 13px;
        letter-spacing: 1px;
    }
}
