/* ==========================================================================
   Springbok Flyover 3D — Global Styles & Glassmorphic Arcade HUD
   ========================================================================== */

:root {
    --bg-dark: #08090e;
    --primary-green: #00e676;
    --primary-gold: #ffd600;
    --primary-red: #ff1744;
    --primary-blue: #00b0ff;
    --accent-glow: rgba(0, 230, 118, 0.4);
    --glass-bg: rgba(10, 10, 10, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --font-heading: 'Outfit', sans-serif;
    --font-retro: 'Press Start 2P', monospace;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-heading);
    color: #ffffff;
}

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

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

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

.ui-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    pointer-events: auto;
}

.ui-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
}

/* ==========================================================================
   Global Game Mode Navigation Bar
   ========================================================================== */
.top-nav-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 21, 35, 0.75);


    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    margin-bottom: 12px;
    z-index: 100;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #90a4ae;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.nav-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
    color: #0b1220;
    background: #00e676;
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.4);
}

.card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-card-inspect {
    background: rgba(0, 176, 255, 0.12);
    border: 1px solid rgba(0, 176, 255, 0.3);
    color: #00b0ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-inspect:hover {
    background: rgba(0, 176, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 176, 255, 0.4);
}

.btn-card-fly {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-green);
    letter-spacing: 1px;
}

/* ==========================================================================
   Main Menu Screen
   ========================================================================== */
#menu-screen {
    background: radial-gradient(circle at center 30%, rgba(10, 20, 35, 0.85) 0%, rgba(5, 7, 12, 0.96) 100%);
    padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    justify-content: flex-start;
    gap: 16px;
}

.menu-header {
    text-align: center;
    margin-top: 10px;
}

.flag-stripe {
    display: flex;
    height: 6px;
    width: 280px;
    margin: 0 auto 16px auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
}

.flag-green { flex: 2; background: #007749; }
.flag-black { flex: 1; background: #000000; }
.flag-yellow { flex: 1; background: #FFB612; }
.flag-blue { flex: 1; background: #001489; }
.flag-red { flex: 1; background: #DE3831; }
.flag-white { flex: 1; background: #FFFFFF; }

.game-title {
    font-size: 52px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -1px;
    text-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
}

.title-accent {
    color: var(--primary-gold);
    text-shadow: 0 0 30px rgba(255, 214, 0, 0.6);
    background: linear-gradient(135deg, #FFE082, #FFB300);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-subtitle {
    font-size: 13px;
    letter-spacing: 4px;
    color: #90a4ae;
    margin-top: 10px;
    font-weight: 600;
}

.stadium-select-container {
    width: 100%;
    max-width: 1100px;
    margin: auto 0;
}

.section-title {
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--primary-green);
    margin-bottom: 18px;
    text-align: center;
    font-weight: 800;
}

.stadium-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stadium-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    border-radius: 14px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.stadium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--glass-border);
    transition: background 0.3s ease;
}

.stadium-card:hover:not(.locked) {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--primary-green);
    box-shadow: 0 12px 30px rgba(0, 230, 118, 0.25);
}

.stadium-card:hover:not(.locked)::before {
    background: var(--primary-green);
}

.stadium-card.locked {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-num {
    font-family: var(--font-retro);
    font-size: 14px;
    color: var(--primary-green);
}

.card-stars {
    color: var(--primary-gold);
    font-size: 15px;
    letter-spacing: 2px;
}

.card-name {
    font-size: 20px;
    font-weight: 800;
    margin: 12px 0 4px 0;
    line-height: 1.2;
}

.card-city {
    font-size: 11px;
    letter-spacing: 2px;
    color: #78909c;
    font-weight: 700;
}

.card-hazard {
    font-size: 11px;
    color: #ffb74d;
    line-height: 1.4;
    margin-top: 14px;
    padding: 8px 10px;
    background: rgba(255, 152, 0, 0.12);
    border-radius: 6px;
    border-left: 2px solid #ff9800;
}

.card-lock-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
}

.menu-footer {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.control-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    color: #b0bec5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-only {
    display: none !important;
}

@media (hover: none) and (pointer: coarse) {
    .laptop-only { display: none !important; }
    .mobile-only { display: inline-flex !important; }
}

kbd {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: monospace;
    color: #ffffff;
}

/* ==========================================================================
   Cinematic Overlay Screen (GTA Flyover)
   ========================================================================== */
#cinematic-screen {
    justify-content: space-between;
    background: transparent;
}

.cinematic-bars {
    width: 100%;
    height: 80px;
    background: #000000;
    z-index: 5;
}

.cinematic-content {
    margin-left: 80px;
    margin-top: auto;
    margin-bottom: 40px;
    max-width: 600px;
    animation: cinematicSlideIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cinematicSlideIn {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

.cinematic-badge {
    display: inline-block;
    background: var(--primary-green);
    color: #000000;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.cinematic-title {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.cinematic-subtitle {
    font-size: 15px;
    color: #cfd8dc;
    margin-top: 6px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.cinematic-hazard {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: rgba(0, 0, 0, 0.65);

    border-left: 3px solid #ff9800;
    padding: 8px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #ffe082;
}

.cinematic-prompt {
    position: absolute;
    bottom: 110px;
    right: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.prompt-hint {
    font-size: 11px;
    color: #90a4ae;
    letter-spacing: 1px;
}

.skip-btn {
    position: absolute;
    top: 100px;
    right: 80px;
    z-index: 20;
}

/* ==========================================================================
   In-Flight HUD
   ========================================================================== */
#hud-screen {
    padding: 24px 32px;
    pointer-events: none;
}

.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hud-stadium-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    padding: 10px 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.hud-stadium-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-green);
}

.hud-stadium-city {
    font-size: 10px;
    letter-spacing: 2px;
    color: #90a4ae;
    font-weight: 700;
}

/* Center Cluster (Hype + Gate Tracker) */
.hud-center-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hud-hype-container {
    width: 380px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    padding: 10px 18px;
    border-radius: 10px;
}

.hype-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
}

.hype-title {
    color: var(--primary-gold);
    letter-spacing: 1px;
}

.hype-bar-track {
    height: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hype-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00e676, #ffd600, #ff1744);
    border-radius: 5px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 10px var(--accent-glow);
}

.gate-tracker-tag {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid var(--primary-gold);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-gold);
    letter-spacing: 1px;

}

/* Score Card */
.hud-score-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    padding: 10px 20px;
    border-radius: 10px;
    text-align: right;
}

.score-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.hud-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: #78909c;
    font-weight: 700;
}

.hud-score-val {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.multiplier-tag {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-gold);
    letter-spacing: 1px;
}

/* Real-time Clearance Dial */
.hud-clearance-widget {
    position: absolute;
    top: 100px;
    left: 32px;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease;
}

.clearance-dial {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(8, 11, 18, 0.7);
    border-radius: 50%;

    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.dial-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dial-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 6;
}

.dial-progress {
    fill: none;
    stroke: var(--primary-green);
    stroke-width: 7;
    stroke-dasharray: 314;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear, stroke 0.2s ease;
}

.dial-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dial-label {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: #90a4ae;
    font-weight: 700;
}

.dial-number {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.dial-unit {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: var(--primary-green);
    font-weight: 800;
}

.danger-warning-banner {
    margin-top: 10px;
    background: rgba(255, 23, 68, 0.88);

    color: #ffffff;
    font-family: var(--font-retro);
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 6px;
    animation: dangerBlink 0.35s infinite alternate;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.danger-warning-banner.active {
    opacity: 1;
}

@keyframes dangerBlink {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(1.05); opacity: 0.8; }
}

/* Instruments */
.hud-instruments {
    position: absolute;
    bottom: 30px;
    left: 32px;
    display: flex;
    gap: 14px;
}

.instrument-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 90px;
}

.inst-label {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #78909c;
    font-weight: 700;
}

.inst-val {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 2px;
}

.inst-val small {
    font-size: 11px;
    color: #90a4ae;
    margin-left: 3px;
}

/* Controls Dock */
.hud-controls-dock {
    position: absolute;
    bottom: 30px;
    right: 32px;
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.btn-hud {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-hud:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Danger Border Glow */
.danger-screen-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: 0px solid rgba(255, 23, 68, 0.6);
    transition: border-width 0.2s ease;
}

.danger-screen-glow.active {
    border-width: 12px;
    box-shadow: inset 0 0 50px rgba(255, 23, 68, 0.5);
}

.bonus-float-text {
    position: absolute;
    font-family: var(--font-retro);
    font-size: 14px;
    color: var(--primary-gold);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: floatUpFade 1.2s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}

@keyframes floatUpFade {
    0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
    20% { transform: translate(-50%, -20px) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -80px) scale(1); opacity: 0; }
}

/* ==========================================================================
   Result Screen
   ========================================================================== */
#result-screen {
    background: radial-gradient(circle at center, rgba(10, 16, 28, 0.88) 0%, rgba(4, 6, 12, 0.96) 100%);
    justify-content: center;
    align-items: center;
}

.result-modal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);

    border-radius: 20px;
    padding: 40px 50px;
    width: 100%;
    max-width: 580px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: modalPop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.result-title {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary-green);
    letter-spacing: -0.5px;
}

.result-title.crashed {
    color: var(--primary-red);
}

.result-title.too-high {
    color: #ff9800;
}

.result-verdict {
    font-size: 13px;
    color: var(--primary-gold);
    margin-top: 6px;
    font-weight: 600;
    line-height: 1.4;
}

.stars-row {
    margin: 24px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.star-icon {
    font-size: 38px;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.star-icon.filled {
    color: var(--primary-gold);
    text-shadow: 0 0 20px rgba(255, 214, 0, 0.8);
    transform: scale(1.15);
}

.stats-table {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row.total-row {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-label {
    color: #90a4ae;
    font-weight: 600;
}

.stat-val {
    font-weight: 700;
    color: #ffffff;
}

.stat-val.highlight {
    color: var(--primary-green);
}

.stat-val.gold {
    color: var(--primary-gold);
    font-size: 20px;
    font-weight: 900;
}

.result-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
button {
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.btn-primary {
    background: #ffb300;
    color: #000000;
    box-shadow: 0 4px 20px rgba(255, 214, 0, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 214, 0, 0.6);
}

.btn-primary.green-btn {
    background: #00c853;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.4);
}

.btn-primary.green-btn:hover {
    box-shadow: 0 8px 25px rgba(0, 230, 118, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.pulse-btn {
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 214, 0, 0.7); }
    70% { box-shadow: 0 0 0 16px rgba(255, 214, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 214, 0, 0); }
}

@media (max-width: 900px) {
    .stadium-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .game-title {
        font-size: 36px;
    }
    .hud-hype-container {
        width: 220px;
    }
    .cinematic-title {
        font-size: 32px;
    }
    .cinematic-content {
        margin-left: 30px;
    }
}

@media (max-width: 600px) {
    .stadium-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stadium-card {
        min-height: auto;
        padding: 16px;
    }
    .card-name {
        font-size: 18px;
    }
    .card-hazard {
        font-size: 11px;
        margin-top: 8px;
        padding: 6px 8px;
    }
    .game-title {
        font-size: 26px;
        letter-spacing: -0.5px;
    }
    .game-subtitle {
        font-size: 10px;
        letter-spacing: 2px;
    }
    .top-nav-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 4px 8px;
        max-width: 95%;
    }
    .nav-tab {
        padding: 6px 11px;
        font-size: 11px;
    }
    .cinematic-content {
        margin-left: 16px;
        margin-right: 16px;
        margin-bottom: 24px;
    }
    .cinematic-title {
        font-size: 26px;
    }
    .cinematic-bars {
        height: 50px;
    }
    .cinematic-hazard {
        font-size: 12px;
    }
}

/* ==========================================================================
   Cockpit FPV Crosshair & Flight HUD
   ========================================================================== */
.cockpit-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    pointer-events: none;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.cockpit-crosshair.hidden {
    display: none;
}

.reticle-circle {
    width: 140px;
    height: 140px;
    border: 1.5px solid rgba(0, 230, 118, 0.45);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
}

.reticle-center-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
}

.reticle-horizon-line {
    position: absolute;
    width: 180px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.6), transparent);
}

.reticle-pitch-lines {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    font-size: 9px;
    font-family: var(--font-retro);
    color: rgba(0, 230, 118, 0.7);
}

.pitch-line {
    position: relative;
    padding: 0 8px;
}

.pitch-line::before, .pitch-line::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 12px;
    height: 1px;
    background: rgba(0, 230, 118, 0.7);
}
.pitch-line::before { left: -14px; }
.pitch-line::after { right: -14px; }

/* ==========================================================================
   Virtual Touch Controls Layer (Mobile / Touch Devices)
   ========================================================================== */
.touch-controls-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
    display: none; /* Shown automatically on touch devices or small viewports */
}

/* Show touch controls on touchscreens or narrow mobile viewports */
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
    .touch-controls-layer {
        display: block;
    }
}

/* Left Thumbstick Zone */
.touch-joystick-zone {
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 160px;
    height: 160px;
    pointer-events: auto;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.touch-joystick-base {
    position: relative;
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.08) 0%, rgba(14, 18, 28, 0.65) 100%);
    border: 2px solid rgba(0, 230, 118, 0.35);
    border-radius: 50%;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 230, 118, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}

.touch-joystick-stick {
    position: absolute;
    width: 54px;
    height: 54px;
    background: radial-gradient(circle at 35% 35%, #00e676, #009624);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.6);
    transform: translate(0, 0);
    transition: transform 0.08s ease-out;
    pointer-events: none;
}

.stick-guides {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
}

.guide-arrow {
    position: absolute;
    font-size: 8px;
    font-weight: 800;
    color: var(--primary-green);
    letter-spacing: 0.5px;
}

.guide-arrow.up { top: 6px; left: 50%; transform: translateX(-50%); }
.guide-arrow.down { bottom: 6px; left: 50%; transform: translateX(-50%); }
.guide-arrow.left { left: 8px; top: 50%; transform: translateY(-50%); }
.guide-arrow.right { right: 8px; top: 50%; transform: translateY(-50%); }

/* Right Action Buttons */
.touch-action-buttons {
    position: absolute;
    bottom: 26px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    pointer-events: auto;
}

.touch-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    user-select: none;
}

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

.touch-btn-icon {
    font-size: 22px;
    line-height: 1;
}

.touch-btn-label {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-top: 3px;
}

.btn-boost {
    background: #ffb300;
    border-color: #ffe082;
    color: #000000;
    box-shadow: 0 4px 20px rgba(255, 214, 0, 0.45);
}

.btn-boost:active {
    box-shadow: 0 0 25px rgba(255, 214, 0, 0.8);
}

.btn-dive {
    background: #00b0ff;
    border-color: #80d8ff;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 176, 255, 0.45);
}

.btn-dive:active {
    box-shadow: 0 0 25px rgba(0, 176, 255, 0.8);
}

/* ==========================================================================
   Rotate Device Prompt (Mobile Portrait)
   ========================================================================== */
.rotate-device-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 16, 0.96);


    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    text-align: center;
}

.rotate-device-prompt.hidden,
.rotate-device-prompt.dismissed {
    display: none !important;
}

@media (orientation: portrait) and (max-width: 800px) {
    .rotate-device-prompt:not(.dismissed) {
        display: flex !important;
    }

    /* In-Flight HUD adjustments when user continues in Portrait mode */
    #hud-screen {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .hud-top-bar {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .hud-stadium-card {
        padding: 4px 12px;
    }
    .hud-stadium-name {
        font-size: 13px;
    }
    .hud-stadium-city {
        font-size: 10px;
    }

    .hud-center-cluster {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    .hud-hype-container {
        width: 100%;
        padding: 4px 10px;
    }
    .gate-tracker-tag {
        font-size: 9px;
        padding: 2px 8px;
    }

    .hud-score-card {
        padding: 4px 12px;
    }
    .hud-score-val {
        font-size: 18px;
    }

    /* Mobile Clearance Widget: Relocated to top-left to clear the center flight path */
    .hud-clearance-widget {
        top: 75px;
        left: max(16px, env(safe-area-inset-left));
        transform: scale(0.65);
        transform-origin: top left;
        pointer-events: none;
    }
    .danger-warning-banner {
        position: fixed;
        top: max(14px, env(safe-area-inset-top));
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        padding: 4px 12px;
        white-space: nowrap;
    }

    .hud-instruments {
        bottom: max(140px, env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        gap: 6px;
    }
    .instrument-box {
        padding: 4px 8px;
        min-width: 60px;
    }
    .inst-val {
        font-size: 14px;
    }

    .hud-controls-dock {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        bottom: auto;
        flex-direction: column;
        gap: 5px;
    }
    .btn-hud {
        padding: 5px 8px;
        font-size: 10px;
    }

    .touch-joystick-zone {
        bottom: max(16px, env(safe-area-inset-bottom));
        left: max(14px, env(safe-area-inset-left));
        width: 135px;
        height: 135px;
    }
    .touch-joystick-base {
        width: 115px;
        height: 115px;
    }
    .touch-joystick-stick {
        width: 46px;
        height: 46px;
    }

    .touch-action-buttons {
        bottom: max(16px, env(safe-area-inset-bottom));
        right: max(14px, env(safe-area-inset-right));
        gap: 12px;
    }
    .touch-btn {
        width: 60px;
        height: 60px;
    }
}

.rotate-phone-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px 22px;
    max-width: 330px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.rotate-phone-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: rotateIcon 2.4s ease-in-out infinite;
}

@keyframes rotateIcon {
    0%, 20% { transform: rotate(0deg); }
    50%, 70% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

.rotate-phone-card h2 {
    font-size: 18px;
    color: var(--primary-gold);
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.rotate-phone-card p {
    font-size: 13px;
    color: #cfd8dc;
    line-height: 1.5;
}

.rotate-prompt-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-continue-btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.prompt-continue-btn:hover,
.prompt-continue-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* ==========================================================================
   Mobile Landscape Optimizations (< 520px height)
   ========================================================================== */
@media (max-height: 520px) {
    #hud-screen {
        padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    }

    .hud-stadium-card {
        padding: 4px 10px;
    }
    .hud-stadium-name {
        font-size: 12px;
    }
    .hud-stadium-city {
        font-size: 9px;
    }

    .hud-hype-container {
        width: 160px;
        padding: 4px 10px;
    }
    .gate-tracker-tag {
        font-size: 8.5px;
        padding: 2px 8px;
    }

    .hud-score-card {
        padding: 4px 10px;
    }
    .hud-score-val {
        font-size: 16px;
    }

    /* Mobile Landscape: Relocated to top-left under venue name, leaving the entire center 70% unobstructed */
    .hud-clearance-widget {
        top: 52px;
        left: max(12px, env(safe-area-inset-left));
        transform: scale(0.58);
        transform-origin: top left;
        pointer-events: none;
    }

    .hud-instruments {
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(150px, calc(130px + env(safe-area-inset-left))); /* Avoid joystick */
        gap: 4px;
    }
    .instrument-box {
        padding: 3px 8px;
        min-width: 58px;
    }
    .inst-val {
        font-size: 13px;
    }

    .hud-controls-dock {
        top: max(8px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        bottom: auto;
        gap: 4px;
    }
    .btn-hud {
        padding: 5px 8px;
        font-size: 9.5px;
    }

    .touch-joystick-zone {
        bottom: max(8px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        width: 120px;
        height: 120px;
    }
    .touch-joystick-base {
        width: 100px;
        height: 100px;
    }
    .touch-joystick-stick {
        width: 40px;
        height: 40px;
    }

    .touch-action-buttons {
        bottom: max(8px, env(safe-area-inset-bottom));
        right: max(12px, env(safe-area-inset-right));
        gap: 6px;
    }
    .touch-btn {
        width: 52px;
        height: 52px;
    }
    .touch-btn-icon {
        font-size: 17px;
    }
    .touch-btn-label {
        font-size: 7.5px;
    }
}
