/* 3D City Explorer - Retro 2010 Nokia J2ME & Vice City Emergency Dispatch Edition */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --neon-blue: #38bdf8;
    --neon-pink: #f43f5e;
    --bg-glass: rgba(15, 23, 42, 0.78);
    --bg-glass-card: rgba(30, 41, 59, 0.88);
    --border-glass: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #060911;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--text-main);
}

/* ========================================================
   MODERN FULLSCREEN MODE (Default)
   ======================================================== */
body.theme-modern .phone-wrapper {
    width: 100%;
    height: 100%;
}

body.theme-modern .nokia-bezel {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

body.theme-modern .nokia-top-earpiece,
body.theme-modern .nokia-keypad-panel,
body.theme-modern .crt-scanlines {
    display: none !important;
}

body.theme-modern .nokia-screen-frame {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
}

/* ========================================================
   2010 NOKIA DEVICE BEZEL MODE
   ======================================================== */
body.theme-nokia {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
}

body.theme-nokia .phone-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 12px;
}

body.theme-nokia .nokia-bezel {
    width: 380px;
    height: 96vh;
    max-height: 760px;
    background: linear-gradient(135deg, #475569 0%, #1e293b 40%, #0f172a 100%);
    border: 4px solid #64748b;
    border-radius: 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 20px 16px;
    position: relative;
}

body.theme-nokia .nokia-top-earpiece {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.nokia-speaker-slot {
    width: 48px;
    height: 6px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.8);
}

.nokia-brand-text {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    color: #cbd5e1;
    text-shadow: 0 1px 1px rgba(0,0,0,0.9);
}

body.theme-nokia .nokia-screen-frame {
    width: 330px;
    height: 440px;
    position: relative;
    border: 4px solid #0f172a;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.9);
}

/* Retro CRT Scanline Shader Effect */
.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 18;
}

/* Nokia Physical Tactile Keypad */
.nokia-keypad-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    gap: 6px;
}

.keypad-row-softkeys {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nokia-key {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border: 1px solid #475569;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    touch-action: manipulation;
}

.nokia-key:active, .dpad-btn:active, .nokia-num-btn:active {
    transform: translateY(2px);
    background: #0f172a;
}

.btn-softkey {
    width: 62px;
    height: 32px;
}

/* 4-Way D-Pad */
.nokia-dpad {
    width: 90px;
    height: 80px;
    position: relative;
}

.dpad-btn {
    position: absolute;
    background: #334155;
    border: 1px solid #475569;
    color: #fff;
    cursor: pointer;
    font-size: 0.65rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-up { top: 0; left: 30px; width: 30px; height: 24px; }
.dpad-down { bottom: 0; left: 30px; width: 30px; height: 24px; }
.dpad-left { top: 26px; left: 4px; width: 24px; height: 28px; }
.dpad-right { top: 26px; right: 4px; width: 24px; height: 28px; }
.dpad-center { top: 26px; left: 30px; width: 30px; height: 28px; background: #2563eb; font-weight: 800; font-size: 0.7rem; }

.keypad-call-row {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.btn-call-green { width: 54px; height: 26px; background: #15803d; color: #fff; }
.btn-clear { width: 54px; height: 26px; }
.btn-call-red { width: 54px; height: 26px; background: #b91c1c; color: #fff; }

.nokia-num-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.nokia-num-btn {
    height: 28px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nokia-num-btn .sub {
    font-size: 0.55rem;
    color: #94a3b8;
}

/* ========================================================
   REAL MAP VIEWPORT & 2D CANVAS
   ======================================================== */
#real-map-container, .map-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #0f172a;
}

/* Real OpenStreetMap Tiles - 100% Authentic, Crisp & Natural Cartography */
.map-viewport .leaflet-tile {
    filter: none !important;
}

/* Retro Map Landmark Pins */
.retro-map-pin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
    border: 2px solid #ffffff;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
}

.retro-map-pin .pin-symbol {
    font-size: 0.9rem;
}

.retro-map-pin .pin-label {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.retro-popup {
    font-family: inherit;
    font-size: 0.8rem;
    color: #0f172a;
    line-height: 1.35;
}

.retro-popup strong {
    font-size: 0.95rem;
    color: #1e3a8a;
}

.retro-popup .popup-sub {
    font-size: 0.8rem;
    color: #64748b;
}

.retro-popup .popup-desc {
    margin: 4px 0 8px 0;
    color: #334155;
}

.retro-popup .popup-btn {
    display: inline-block;
    padding: 4px 8px;
    background: #2563eb;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Glassmorphism UI Base */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

/* Top Navigation Bar */
#top-hud {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 10;
    pointer-events: none;
}

#top-hud > * {
    pointer-events: auto;
}

.district-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(-2px);
}

.district-titles h1 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.district-titles .badge-state {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    background: rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 6px;
    color: #60a5fa;
    text-transform: uppercase;
}

.district-titles p {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Weather Pill */
.weather-hud {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.85);
    padding: 5px 12px;
    border-radius: 24px;
    border: 1px solid var(--border-glass);
}

.weather-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;
}

.time-badge {
    font-size: 0.78rem;
    color: var(--text-muted);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 8px;
}

/* Actions */
.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.district-select-wrapper {
    position: relative;
}

.district-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 6px 28px 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.select-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.hud-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.hud-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    transform: translateY(-1px);
}

.hud-btn.active {
    background: var(--primary);
    border-color: #60a5fa;
}

/* ========================================================
   EMERGENCY DISPATCH RADIO BANNER (Top Center)
   ======================================================== */
.dispatch-alert-card {
    position: absolute;
    top: 76px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    width: 90%;
    max-width: 480px;
    background: rgba(15, 23, 42, 0.94);
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 15;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.35);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.dispatch-alert-card.visible {
    transform: translateX(-50%) translateY(0);
}

.dispatch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.dispatch-badge {
    font-size: 0.82rem;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 0.05em;
    animation: flash-badge 0.8s infinite alternate;
}

@keyframes flash-badge {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.dispatch-reward {
    font-size: 0.78rem;
    font-weight: 700;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.dispatch-text {
    font-size: 0.84rem;
    color: #f1f5f9;
    line-height: 1.4;
    margin-bottom: 8px;
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    transition: width 0.1s linear;
}

.timer-text {
    position: absolute;
    right: 6px;
    top: -15px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fbbf24;
}

/* Mission Passed / Failed Notification */
.mission-notif-box {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%) scale(0.7);
    opacity: 0;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 12px 24px;
    text-align: center;
    z-index: 25;
    pointer-events: none;
    box-shadow: 0 10px 35px rgba(34, 197, 94, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mission-notif-box.visible {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.notif-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.notif-msg {
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* ========================================================
   NAVIGATION ARROW (Floating 3D Guide)
   ======================================================== */
.nav-compass-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    color: #ef4444;
    font-size: 1.6rem;
    text-align: center;
    line-height: 32px;
    z-index: 12;
    pointer-events: none;
    display: none;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
    transform-origin: center center;
}

/* Top Right: Minimap & Score Board */
#hud-top-right {
    position: absolute;
    top: 80px;
    right: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

#hud-top-right > * {
    pointer-events: auto;
}

/* ========================================================
   OPENSTREETMAP EXPLORATION CONTROLS & CIVIC DISCOVERY
   ======================================================== */
.map-explore-controls {
    position: absolute;
    top: 76px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 25;
}

.map-ctrl-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.map-ctrl-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: #38bdf8;
    transform: scale(1.06);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.map-ctrl-btn:active {
    transform: scale(0.92);
    background: #0284c7;
    border-color: #7dd3fc;
}

/* Civic Landmark Proximity Discovery Card */
.discovery-card {
    position: absolute;
    top: 76px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid #f59e0b;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 18px rgba(245, 158, 11, 0.35);
    color: #fff;
    z-index: 26;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    max-width: 90vw;
}

.discovery-card.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.discovery-icon {
    font-size: 1.45rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.discovery-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.discovery-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #fbbf24;
    text-transform: uppercase;
}

.discovery-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.discovery-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}

.score-pill {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 130px;
}

.score-item {
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-quick-dispatch {
    margin-top: 4px;
    padding: 5px 8px;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transition: background 0.2s;
}

.btn-quick-dispatch:hover {
    background: #dc2626;
}

/* Landmark Information Card */
#landmark-card {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: 90%;
    max-width: 480px;
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 16px;
    z-index: 20;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

#landmark-card.visible {
    transform: translateX(-50%) translateY(0);
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.landmark-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 16px;
    text-transform: uppercase;
}

.badge-hospital { background: rgba(39, 174, 96, 0.25); color: #2ecc71; border: 1px solid #27ae60; }
.badge-police { background: rgba(41, 128, 185, 0.25); color: #3498db; border: 1px solid #2980b9; }
.badge-railway { background: rgba(243, 156, 18, 0.25); color: #f39c12; border: 1px solid #e67e22; }
.badge-court { background: rgba(142, 68, 173, 0.25); color: #9b59b6; border: 1px solid #8e44ad; }
.badge-admin { background: rgba(192, 57, 43, 0.25); color: #e74c3c; border: 1px solid #c0392b; }
.badge-education { background: rgba(230, 126, 34, 0.25); color: #f39c12; border: 1px solid #d35400; }

.landmark-distance { font-size: 0.78rem; color: var(--text-muted); }
.landmark-title-en { font-size: 1.15rem; font-weight: 700; margin-bottom: 2px; }
.landmark-title-hi { font-size: 0.88rem; color: #cbd5e1; margin-bottom: 6px; }
.landmark-desc { font-size: 0.8rem; color: #94a3b8; line-height: 1.4; margin-bottom: 10px; }

.card-actions { display: flex; gap: 8px; }
.btn-card-action { flex: 1; padding: 7px 12px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.btn-card-dismiss { padding: 7px 12px; background: rgba(255, 255, 255, 0.1); color: #e2e8f0; border: 1px solid var(--border-glass); border-radius: 6px; font-size: 0.8rem; cursor: pointer; }

/* Vehicle HUD */
#vehicle-hud {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 10;
}

.vehicle-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.85);
    padding: 3px 8px;
    border-radius: 4px;
}

.vehicle-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-meter {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid var(--border-glass);
    padding: 8px 14px;
    border-radius: 10px;
    text-align: right;
}

.speed-val { font-size: 1.7rem; font-weight: 800; color: #38bdf8; font-variant-numeric: tabular-nums; }
.speed-unit { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-left: 2px; }

.btn-siren-toggle {
    padding: 8px 12px;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.btn-siren-toggle.active {
    animation: flash-siren-btn 0.6s infinite alternate;
}

@keyframes flash-siren-btn {
    0% { background: #ef4444; }
    100% { background: #3b82f6; }
}

.vehicle-prompt {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(37, 99, 235, 0.85);
    border-radius: 6px;
    font-weight: 600;
}

#interact-prompt {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(245, 158, 11, 0.6);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    display: none;
    z-index: 15;
}

#controls-helper {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: none;
}

.key-badge {
    display: inline-block;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    margin-right: 3px;
}

/* ========================================================
   LEFT RIGHT UP DOWN VEHICLE ROUNDED HANDLE CONTROLLER
   ======================================================== */
.handle-controls-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 35;
    pointer-events: none;
}

.rounded-handle-frame {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #1e293b 0%, #090d16 100%);
    border: 3px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75), inset 0 2px 6px rgba(255, 255, 255, 0.15);
    position: relative;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.rounded-handle-disc {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
}

.handle-btn {
    position: absolute;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.handle-btn .btn-arrow {
    font-size: 1.1rem;
    line-height: 1;
}

.handle-btn .btn-tag {
    font-size: 0.52rem;
    font-weight: 800;
    color: #94a3b8;
    margin-top: 1px;
}

/* 4 Cardinal Handle Buttons */
.handle-btn.btn-up {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 44px;
    border-radius: 20px 20px 8px 8px;
}

.handle-btn.btn-down {
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 44px;
    border-radius: 8px 8px 20px 20px;
}

.handle-btn.btn-left {
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 52px;
    border-radius: 20px 8px 8px 20px;
}

.handle-btn.btn-right {
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 52px;
    border-radius: 8px 20px 20px 8px;
}

.handle-btn:active,
.handle-btn.active {
    background: #2563eb !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.85);
}

.handle-btn.active .btn-arrow,
.handle-btn.active .btn-tag {
    color: #ffffff;
}

/* Center Handbrake Hub */
.handle-center-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, #b91c1c 0%, #7f1d1d 100%);
    border: 2px solid #ef4444;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
    z-index: 5;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.1s, box-shadow 0.1s;
}

.handle-center-knob:active,
.handle-center-knob.active {
    transform: translate(-50%, -50%) scale(0.92);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.9);
}

.handle-center-knob .knob-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.handle-center-knob .knob-label {
    font-size: 0.52rem;
    font-weight: 800;
}

/* Side Action Buttons (Siren & Horn) */
.handle-action-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.action-round-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.88);
    border: 2px solid var(--border-glass);
    color: #ffffff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s, border-color 0.2s;
    touch-action: manipulation;
}

.action-round-btn:active {
    transform: scale(0.92);
}

.btn-siren-round.active {
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
    animation: siren-pulse 0.9s infinite alternate;
}

@keyframes siren-pulse {
    from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
    to { box-shadow: 0 0 20px rgba(239, 68, 68, 0.9); }
}

.road-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    padding: 2px 8px;
    margin-top: 4px;
    display: inline-block;
    transition: all 0.25s;
}

.road-status-badge.off-road {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
}

/* Loading Screen */
#loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #090d16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

#loader-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loader-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.loader-sub { font-size: 0.84rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    #controls-helper { display: none; }
    .handle-controls-panel { display: flex; }
    .weather-hud { display: none; }
    #top-hud { height: 46px; padding: 0 8px; }
    .map-explore-controls { top: 62px; right: 10px; gap: 6px; }
    .map-ctrl-btn { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
    .rounded-handle-frame { width: 144px; height: 144px; }
    .handle-btn.btn-up { width: 46px; height: 38px; top: 4px; }
    .handle-btn.btn-down { width: 46px; height: 38px; bottom: 4px; }
    .handle-btn.btn-left { width: 38px; height: 46px; left: 4px; }
    .handle-btn.btn-right { width: 38px; height: 46px; right: 4px; }
    .handle-center-knob { width: 42px; height: 42px; }
}
