/* ========================================================
   Mumbai Island Taxi Sim 3D - High-End AAA UI/UX Styles
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Chakra Petch', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --taxi-yellow: #f59e0b;
    --taxi-amber: #fbbf24;
    --hud-bg: rgba(10, 15, 29, 0.76);
    --hud-border: rgba(255, 255, 255, 0.10);
    --hud-glow: rgba(245, 158, 11, 0.15);
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #090d16;
    font-family: var(--font-sans);
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

.font-display {
    font-family: var(--font-display);
}

.font-mono {
    font-family: var(--font-mono);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Glassmorphism Panels */
.glass-hud {
    background: var(--hud-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--hud-border);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-card {
    background: rgba(12, 19, 36, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.14);
}

/* Interactive Glass Buttons */
.hud-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.75rem;
    background: rgba(20, 30, 52, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-btn:hover {
    background: rgba(35, 52, 88, 0.8);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.35);
}

.hud-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Automotive Keycaps */
.hud-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    font-size: 0.625rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: #cbd5e1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 2px solid rgba(255, 255, 255, 0.32);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    line-height: 1;
    flex-shrink: 0;
}

/* Modern Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    height: 6px;
    border-radius: 9999px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 2px solid #0f172a;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.9);
}

/* Equalizer Visualizer */
@keyframes eqBounce {
    0%, 100% { height: 3px; }
    50% { height: 14px; }
}

.eq-bar {
    width: 3px;
    background: #f472b6;
    border-radius: 2px;
    display: inline-block;
}
.eq-1 { animation: eqBounce 0.7s ease-in-out infinite; }
.eq-2 { animation: eqBounce 0.5s ease-in-out infinite 0.15s; }
.eq-3 { animation: eqBounce 0.8s ease-in-out infinite 0.3s; }
.eq-4 { animation: eqBounce 0.6s ease-in-out infinite 0.45s; }

/* Radar Beacon Ripple */
@keyframes radarPing {
    0% { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(2.4); opacity: 0; }
}

.radar-ping {
    animation: radarPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97) translateY(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Cinematic Menu Vignette */
.cinematic-vignette {
    background: radial-gradient(circle at 68% 45%, rgba(15, 23, 42, 0.2) 0%, rgba(9, 13, 22, 0.72) 58%, rgba(5, 8, 15, 0.95) 100%);
}

/* Studio Setting Selection Cards */
.setting-card {
    background: rgba(18, 27, 49, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.setting-card:hover {
    background: rgba(30, 45, 80, 0.8);
    border-color: rgba(251, 191, 36, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
}

.setting-card.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 20px -3px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Menu Button Card */
.menu-btn-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(18, 27, 49, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
}

.menu-btn-card:hover {
    background: rgba(28, 42, 75, 0.9);
    border-color: rgba(251, 191, 36, 0.4);
    transform: translateX(4px);
    box-shadow: 0 8px 28px -4px rgba(245, 158, 11, 0.2);
}

.menu-btn-card:active {
    transform: translateX(2px) scale(0.99);
}

.menu-btn-primary {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.92) 0%, rgba(217, 119, 6, 0.96) 100%);
    border: 1px solid rgba(254, 240, 138, 0.45);
    color: #020617;
    box-shadow: 0 8px 30px -4px rgba(245, 158, 11, 0.45);
}

.menu-btn-primary:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.98) 0%, rgba(245, 158, 11, 1) 100%);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateX(6px) scale(1.01);
    box-shadow: 0 12px 36px -4px rgba(245, 158, 11, 0.6);
}

/* ========================================================
   Mobile Touch Controls & Responsive Styles
   ======================================================== */
.touch-btn {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
    cursor: pointer;
}

.touch-btn:active {
    transform: scale(0.94);
}

/* Touch layer display rules */
#mobileTouchLayer {
    display: none;
}

@media (pointer: coarse), (max-width: 1024px) {
    #mobileTouchLayer {
        display: flex;
    }

    /* On mobile, collapse keyboard action dock to avoid crowding */
    .desktop-action-dock {
        display: none !important;
    }

    /* Compact telemetry on mobile */
    .mobile-compact-hud {
        max-width: 210px !important;
        padding: 0.65rem 0.75rem !important;
    }
}

/* Ensure no bounce scrolling or zoom gestures on game canvas and controls */
body, #gameCanvas, #mobileTouchLayer {
    overscroll-behavior: none;
}
