﻿/* ==========================================================================
   NEON HIGHWAY: INFINITE - Cyberpunk UI & Style System (PC Arcade Edition)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800;900&family=Rajdhani:wght@500;600;700&display=swap');

:root {
    --bg-dark: #06070b;
    --bg-panel: rgba(10, 12, 18, 0.88);
    --bg-card: rgba(16, 20, 30, 0.78);
    --neon-cyan: #3dd6e0;
    --neon-magenta: #e84a8a;
    --neon-gold: #d4af37;
    --neon-green: #4ade80;
    --neon-purple: #8b7ec8;
    --neon-red: #ef4444;
    --text-main: #f2f4f8;
    --text-dim: #8b93a7;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: 0 0 8px rgba(61, 214, 224, 0.1);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --accent: var(--neon-cyan);
    --panel-graphite: rgba(14, 16, 22, 0.92);
    --panel-border: rgba(255, 255, 255, 0.1);
}

* {
    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-body);
    color: var(--text-main);
}

/* Background Cyber Grid */
#game-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000;
    overflow: hidden;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background-color: #000;
}

/* Extremely subtle scanlines â€” not CRT-heavy */
.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.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 5;
    opacity: 0.1;
}

/* Soft vignette overlay */
.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 6;
}

/* ==========================================================================
   UI SCREENS & OVERLAYS
   ========================================================================== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(7, 8, 20, 0.75);
    transition: opacity 0.25s ease;
}

.screen.active {
    display: flex;
}

/* Cyber Modal Panels */
.cyber-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border-radius: 8px;
    padding: 30px;
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 88vh;
    overflow-y: auto;
}

.cyber-panel::-webkit-scrollbar {
    width: 6px;
}
.cyber-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}
.cyber-panel::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 3px;
}

/* Glowing Typography */
h1, h2, h3, .brand-title {
    font-family: var(--font-heading);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.brand-title {
    font-size: 3.8rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #c8d4e0 45%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.brand-subtitle {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-dim);
    letter-spacing: 8px;
    text-align: center;
    margin-bottom: 35px;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.cyber-btn {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 14px 28px;
    background: rgba(22, 28, 40, 0.9);
    color: #ffffff;
    border: 1px solid rgba(61, 214, 224, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    border-radius: 4px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}

.cyber-btn:hover {
    background: rgba(35, 48, 64, 0.95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
    border-color: var(--neon-cyan);
}

.cyber-btn:active {
    transform: translateY(1px) scale(0.98);
}

.cyber-btn.primary {
    background: linear-gradient(135deg, #2a9aaa 0%, #1a6a9a 100%);
    color: #061018;
    font-weight: 900;
    font-size: 1.3rem;
    padding: 16px 45px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(61, 214, 224, 0.5);
}

.cyber-btn.primary:hover {
    background: linear-gradient(135deg, #3dd6e0 0%, #2a9aaa 100%);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.cyber-btn.secondary {
    border-color: var(--neon-magenta);
    box-shadow: 0 0 12px rgba(255, 0, 119, 0.3);
}

.cyber-btn.secondary:hover {
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 0, 119, 0.7);
}

.cyber-btn.gold {
    border-color: var(--neon-gold);
    color: var(--neon-gold);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.cyber-btn.gold:hover {
    background: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
}

.cyber-btn.danger {
    border-color: var(--neon-red);
    color: var(--neon-red);
}

/* ==========================================================================
   MAIN MENU
   ========================================================================== */

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 320px;
}

.menu-top-stats {
    position: absolute;
    top: 25px;
    right: 35px;
    display: flex;
    gap: 20px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.stat-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 8px 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   GAME HUD
   ========================================================================== */

#game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 8;
    padding: 25px 35px;
}

#game-hud.active {
    display: block;
}

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

.hud-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(8, 10, 16, 0.72);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.hud-score {
    font-family: var(--font-heading);
    font-size: 2.0rem;
    font-weight: 900;
    color: var(--text-main);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
    line-height: 1.1;
}

.hud-combo {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--neon-magenta);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease;
}

/* Stage Campaign Finish Line Tracker on HUD */
.hud-stage-tracker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(5, 7, 18, 0.55);
    backdrop-filter: blur(8px);
    padding: 8px 22px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.hud-stage-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--neon-gold);
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

.hud-stage-bar-bg {
    width: 200px;
    height: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--neon-gold);
    border-radius: 4px;
    overflow: hidden;
}

.hud-stage-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd700, #ff007f);
    box-shadow: 0 0 10px #ffd700;
    transition: width 0.1s linear;
}

.hud-stage-dist {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: #ffffff;
    letter-spacing: 1px;
}

.hud-right {
    display: flex;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.hud-bottom {
    position: absolute;
    bottom: 25px;
    left: 35px;
    right: 35px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Bottom-Left Integrated Driver Cockpit Cluster */
.hud-bottom-left-cluster {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(5, 7, 18, 0.55);
    backdrop-filter: blur(10px);
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.hud-speedometer-group {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
}

.hud-speed {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    color: #e8f4f8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    line-height: 1;
    letter-spacing: 1px;
}

.hud-speed-unit {
    font-size: 0.95rem;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 700;
}

.hud-env-name {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: none;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Boost Meter */
.boost-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 270px;
}

.boost-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--neon-cyan);
}

.boost-bar-bg {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    border-radius: 3px;
    overflow: hidden;
}

.boost-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #2a8a9a 0%, var(--neon-cyan) 100%);
    box-shadow: none;
    transition: width 0.05s linear;
}

/* Shield Integrity */
.shield-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    background: rgba(5, 7, 18, 0.55);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.shield-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--neon-cyan);
}

.shield-icons {
    display: flex;
    gap: 6px;
    font-size: 1.3rem;
}

/* Powerup Bar */
.hud-powerups {
    display: flex;
    gap: 10px;
}

.powerup-tag {
    background: var(--bg-card);
    border: 1px solid var(--neon-cyan);
    padding: 6px 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
}

/* ==========================================================================
   GARAGE SCREEN
   ========================================================================== */

.garage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.garage-vehicle-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 20px;
}

.garage-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.garage-vehicle-name {
    font-size: 1.6rem;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.garage-specs-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.spec-name {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--text-dim);
    width: 130px;
}

.spec-bar-bg {
    flex-grow: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
}

.spec-bar-fill {
    height: 100%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
    transition: width 0.3s ease;
}

.spec-upgrade-btn {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    color: #ffffff;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.spec-upgrade-btn:hover {
    background: var(--neon-cyan);
    color: #000000;
}

.color-swatches {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-swatch:hover, .color-swatch.active {
    transform: scale(1.2);
    border-color: #ffffff;
    box-shadow: 0 0 12px #ffffff;
}

/* ==========================================================================
   DAILY REWARDS & MODALS
   ========================================================================== */

.daily-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin: 25px 0;
}

.daily-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.daily-day-card.claimed {
    opacity: 0.45;
    border-color: var(--neon-green);
}

.daily-day-card.ready {
    border-color: var(--neon-gold);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

/* Missions & Achievements List */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-item.completed {
    border-color: var(--neon-green);
    background: rgba(0, 255, 102, 0.08);
}

/* ==========================================================================
   SETTINGS & HOW TO PLAY
   ========================================================================== */

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #ffffff;
}

input[type="range"] {
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

input[type="checkbox"] {
    accent-color: var(--neon-cyan);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

select {
    background: #000000;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 6px 12px;
    font-family: var(--font-heading);
    border-radius: 4px;
}

/* Key Diagram in How to Play */
.key-diagram {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 25px 0;
}

.key-box {
    background: #000000;
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    padding: 10px 18px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 800;
    color: #ffffff;
}

/* ==========================================================================
   GARAGE 3D SHOWROOM CANVAS
   ========================================================================== */
.garage-canvas-wrapper {
    width: 100%;
    height: 210px;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.08) 0%, rgba(0, 0, 0, 0.7) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    box-shadow: inset 0 0 25px rgba(0, 243, 255, 0.15), 0 0 15px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

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

/* ==========================================================================
   TUTORIAL / PILOT BRIEFING CARDS
   ========================================================================== */
.tutorial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.tutorial-icon {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.6));
}

/* ==========================================================================
   STAGE CAMPAIGN SELECT GRID (50 LEVELS / 5 CHAPTERS)
   ========================================================================== */
.chapter-tabs {
    display: flex;
    gap: 8px;
    margin: 15px 0 10px 0;
    flex-wrap: wrap;
}

.chapter-tab-btn {
    background: rgba(10, 14, 28, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chapter-tab-btn:hover {
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
}

.chapter-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.25) 0%, rgba(255, 0, 127, 0.25) 100%);
    border-color: var(--neon-gold);
    color: var(--neon-gold);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

.stages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    max-height: 480px;
    overflow-y: auto;
    padding: 10px 5px;
    margin: 10px 0;
}

.stage-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    cursor: pointer;
}

.stage-card:hover:not(.stage-card-locked) {
    transform: translateY(-3px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.4);
}

.stage-card-locked {
    opacity: 0.55;
    filter: grayscale(0.6);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
}

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

.stage-num-badge {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--neon-gold);
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--neon-gold);
    padding: 3px 8px;
    border-radius: 4px;
}

.stage-card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
}

.stage-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.stage-card-stars {
    display: flex;
    gap: 6px;
    font-size: 1.25rem;
    margin: 4px 0;
}

.stage-star-active {
    color: var(--neon-gold);
    text-shadow: 0 0 10px var(--neon-gold);
}

.stage-star-inactive {
    color: rgba(255, 255, 255, 0.2);
}

.stage-card-rewards {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--neon-gold);
    font-weight: 700;
}

/* ==========================================================================
   STAGE VICTORY / LEVEL COMPLETE MODAL
   ========================================================================== */
.victory-stars-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.victory-star {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.victory-star.active {
    color: var(--neon-gold);
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
    transform: scale(1.12);
}

.victory-objectives-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 14px 20px;
    margin: 15px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v-obj-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-family: var(--font-heading);
}

.v-obj-item.met {
    color: var(--neon-gold);
}

.v-obj-item.unmet {
    color: var(--text-dim);
}

/* ==========================================================================
   PREMIUM CAMPAIGN MAP SELECT + INTRO + RESULTS
   Dark graphite panels, cyan / gold accents (minimal neon)
   ========================================================================== */

@keyframes mapFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.map-select-panel {
    background: linear-gradient(165deg, rgba(12, 14, 20, 0.94) 0%, rgba(8, 10, 14, 0.96) 100%);
    border-color: rgba(61, 214, 224, 0.22);
}

.map-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    max-height: min(520px, 58vh);
    overflow-y: auto;
    padding: 14px 6px 8px;
    margin: 12px 0 4px;
}

.map-select-grid::-webkit-scrollbar {
    width: 6px;
}
.map-select-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.35);
}
.map-select-grid::-webkit-scrollbar-thumb {
    background: rgba(61, 214, 224, 0.45);
    border-radius: 3px;
}

.map-card {
    --map-accent: var(--neon-cyan);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 0 14px;
    background: linear-gradient(180deg, rgba(22, 26, 36, 0.92) 0%, rgba(12, 14, 20, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
    animation: mapFadeInUp 0.32s ease both;
    animation-delay: calc(var(--i, 0) * 40ms);
}

.map-card:hover:not(.is-locked) {
    transform: scale(1.035) translateY(-2px);
    border-color: rgba(61, 214, 224, 0.55);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(61, 214, 224, 0.12);
}

.map-card.selected,
.map-card.is-unlocked.selected {
    border-color: var(--neon-gold);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35), 0 10px 28px rgba(0, 0, 0, 0.5);
}

.map-card.is-unlocked {
    border-color: rgba(61, 214, 224, 0.2);
}

.map-card.is-locked {
    opacity: 0.52;
    filter: grayscale(0.55) brightness(0.85);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.06);
}

.map-card.is-locked:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.map-card-preview {
    height: 52px;
    width: 100%;
    background: linear-gradient(120deg, #0a0c12 0%, #151a24 45%, var(--map-accent) 160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.map-card-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 40%, rgba(255, 255, 255, 0.06) 100%);
    pointer-events: none;
}

.map-card-preview.is-rain::before {
    content: '';
    position: absolute;
    inset: -40% -10%;
    background: repeating-linear-gradient(
        105deg,
        transparent 0 10px,
        rgba(180, 210, 240, 0.18) 10px 11px,
        transparent 11px 22px
    );
    animation: mapRainLines 0.28s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.map-card-preview.is-storm {
    filter: brightness(0.92) saturate(1.05);
}

.map-card-preview.is-blackout {
    filter: brightness(0.45) contrast(1.15);
}

.map-card-preview.is-industrial {
    filter: grayscale(0.35) brightness(0.9);
}

.map-card-preview.is-industrial.is-blackout {
    filter: brightness(0.4) grayscale(0.5);
}

@keyframes mapRainLines {
    from { transform: translateY(-8%); }
    to { transform: translateY(8%); }
}

.map-card-body {
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-card-play {
    margin-top: 4px;
    align-self: flex-start;
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    color: #0a0c10;
    background: linear-gradient(90deg, var(--map-accent, #3dd6e0), #d4af37);
    padding: 4px 12px;
    border-radius: 2px;
    font-weight: 700;
}

.map-card-code {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--map-accent);
    opacity: 0.9;
}

.map-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-main);
    line-height: 1.2;
}

.map-card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.map-card-dist {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--neon-cyan);
}

.map-card-diff {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--neon-gold);
}

.map-card-diff .empty,
.map-card-stars .empty {
    color: rgba(255, 255, 255, 0.18);
}

.map-card-stars {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--neon-gold);
}

.map-card-best {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: var(--text-dim);
}

.map-card-reward {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    color: var(--neon-gold);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.map-card-req {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: rgba(180, 190, 210, 0.75);
    margin-top: 2px;
}

.map-card-lock {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.55);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    max-width: 70%;
    text-align: right;
}

/* Map intro briefing */
.map-intro-panel {
    max-width: 560px;
    text-align: center;
    background: linear-gradient(180deg, rgba(14, 16, 24, 0.96) 0%, rgba(8, 9, 12, 0.98) 100%);
    border-color: rgba(61, 214, 224, 0.28);
    padding: 32px 36px 28px;
    animation: mapFadeInUp 0.35s ease both;
}

.map-intro-code {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.28em;
    color: var(--neon-cyan);
    margin-bottom: 10px;
}

.map-intro-name {
    font-size: 2rem;
    letter-spacing: 0.08em;
    margin: 0;
    background: linear-gradient(135deg, #f2f4f8 0%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.map-intro-sub {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    margin-top: 8px;
    margin-bottom: 22px;
}

.map-intro-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    text-align: left;
}

.map-intro-meta-item {
    background: rgba(16, 20, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-intro-meta-item.is-secondary {
    display: none;
}

.map-intro-meta-label {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    color: var(--text-dim);
}

.map-intro-meta-value {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-main);
    letter-spacing: 0.04em;
}

.map-intro-objectives {
    margin-top: 18px;
    text-align: left;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 14px;
    background: rgba(14, 16, 22, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.map-intro-obj-title {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    color: var(--neon-gold);
    margin-bottom: 8px;
}

.map-intro-obj {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin: 4px 0;
}

.map-intro-reward {
    margin-top: 10px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--neon-gold);
}

/* Victory / results sequenced reveal */
.victory-panel {
    max-width: 620px;
    text-align: center;
    background: linear-gradient(180deg, rgba(14, 16, 22, 0.96) 0%, rgba(8, 9, 12, 0.98) 100%);
    border-color: rgba(61, 214, 224, 0.22);
    padding: 28px 32px 24px;
}

.victory-headline {
    color: var(--neon-gold);
    font-size: 2.2rem;
    letter-spacing: 0.2em;
    margin: 0;
}

.victory-stage-name {
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    margin-top: 6px;
}

.victory-record-flash {
    display: none;
    margin: 10px auto 0;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    color: var(--neon-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.victory-record-flash.show {
    display: block;
    opacity: 1;
}

.victory-bonus-lines {
    margin: 8px 0 4px;
    min-height: 0;
}

.victory-bonus-line {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--neon-gold);
    margin: 4px 0;
}

.map-card-best-sub {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.v-obj-item.bonus {
    opacity: 0.9;
    border-color: rgba(212, 175, 55, 0.25);
}

/* Results stats — large count-up friendly numbers */
.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 8px;
}

.results-stat {
    background: rgba(12, 14, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.results-stat.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.results-stat-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    color: var(--text-dim);
}

.results-stat-value {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--neon-cyan);
    letter-spacing: 0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    min-height: 1.2em;
}

#res-score {
    color: var(--neon-gold);
    font-size: 1.4rem;
}

#res-perfect.is-perfect {
    color: var(--neon-gold);
}

.victory-reward-breakdown {
    margin: 12px auto 6px;
    max-width: 320px;
    text-align: left;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.victory-reward-breakdown.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.reward-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reward-line span {
    color: var(--neon-gold);
}

.reward-line-total {
    margin-top: 4px;
    color: var(--text-main);
    border-bottom: none;
    font-size: 0.8rem;
}

.reward-line-total span {
    color: var(--neon-gold);
}

.victory-reward-totals {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 10px 0 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.victory-reward-totals.is-revealed {
    opacity: 1;
}

.stat-badge.gold {
    color: var(--neon-gold);
    border-color: rgba(212, 175, 55, 0.35);
}

.victory-actions {
    width: 100%;
    max-width: 360px;
    margin: 18px auto 0;
}

.victory-actions .cyber-btn.primary {
    font-size: 1.35rem;
    padding: 18px 48px;
}

.campaign-complete-panel {
    display: none;
    margin: 16px auto 4px;
    padding: 16px 18px;
    max-width: 420px;
    background: rgba(12, 14, 20, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.campaign-complete-panel.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.campaign-complete-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    color: var(--neon-gold);
}

.campaign-complete-maps {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: var(--neon-cyan);
    margin: 6px 0 12px;
}

.campaign-complete-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    text-align: left;
}

.campaign-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(8, 10, 14, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
}

.campaign-stat-label {
    font-family: var(--font-heading);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

.campaign-stat-value {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-main);
}

.campaign-bonus-line {
    margin-top: 12px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--neon-gold);
}

/* Unlock banner on results */
.map-unlock-banner {
    display: none;
    margin: 12px auto 4px;
    padding: 8px 18px;
    max-width: 360px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.16em;
    color: var(--neon-gold);
    background: linear-gradient(90deg, rgba(20, 18, 10, 0.2), rgba(40, 32, 12, 0.85), rgba(20, 18, 10, 0.2));
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 6px;
    animation: mapUnlockIn 0.35s ease both;
}

.map-unlock-banner.show {
    display: inline-block;
}

@keyframes mapUnlockIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Countdown overlay */
.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(8, 10, 14, 0.35) 0%, rgba(5, 6, 10, 0.55) 100%);
}

.countdown-overlay.active {
    display: flex;
}

.countdown-val {
    font-family: var(--font-heading);
    font-size: clamp(4.5rem, 14vw, 7.5rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #e8eef8;
    text-shadow:
        0 0 24px rgba(61, 214, 224, 0.45),
        0 0 48px rgba(212, 175, 55, 0.2);
}

.countdown-val.pop {
    animation: countdownPop 0.28s ease both;
}

@keyframes countdownPop {
    from { opacity: 0.35; transform: scale(1.35); }
    to { opacity: 1; transform: scale(1); }
}

/* Checkpoint HUD toast */
.hud-checkpoint-toast {
    position: absolute;
    top: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    color: var(--neon-gold);
    background: rgba(12, 14, 18, 0.82);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    z-index: 40;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.hud-checkpoint-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Game Over / Crash */
.gameover-panel {
    max-width: 520px;
    text-align: center;
    background: linear-gradient(180deg, rgba(18, 14, 18, 0.96) 0%, rgba(8, 9, 12, 0.98) 100%);
    border-color: rgba(255, 0, 85, 0.28);
    padding: 28px 30px 24px;
}

.gameover-title {
    color: var(--neon-magenta);
    font-size: 2.1rem;
    letter-spacing: 0.22em;
    margin: 0;
}

.gameover-reason {
    margin-top: 8px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    color: rgba(220, 220, 230, 0.72);
}

.gameover-record-badge {
    color: var(--neon-gold);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin: 10px 0 0;
}

.gameover-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 14px;
    text-align: center;
}

.gameover-stat-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    color: rgba(180, 190, 200, 0.55);
    margin-bottom: 4px;
}

.gameover-stat-value {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #f2f4f8;
    letter-spacing: 0.04em;
}

.gameover-objectives {
    text-align: left;
    margin: 8px 0 6px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.gameover-obj {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: rgba(210, 215, 225, 0.85);
    padding: 4px 0;
}

.gameover-obj-star {
    color: rgba(212, 175, 55, 0.55);
    flex-shrink: 0;
}

.gameover-obj.is-complete .gameover-obj-star {
    color: var(--neon-gold);
}

.gameover-obj.is-complete .gameover-obj-status {
    color: #3dd6a0;
}

.gameover-obj.is-failed {
    color: rgba(170, 175, 185, 0.55);
}

.gameover-obj.is-failed .gameover-obj-status {
    color: var(--neon-magenta);
}

.gameover-obj-status {
    margin-left: auto;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
}

.gameover-actions {
    width: 100%;
    margin-top: 18px;
}

@media (max-width: 720px) {
    .map-intro-meta {
        grid-template-columns: 1fr;
    }
    .results-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .map-intro-name {
        font-size: 1.55rem;
    }
    .countdown-val {
        font-size: 4rem;
    }
    .gameover-stats {
        grid-template-columns: 1fr;
    }
}

