/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0e1a;
    --bg-mid: #111827;
    --bg-card: #1a2035;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --accent2: #ff6b35;
    --accent2-glow: rgba(255, 107, 53, 0.3);
    --success: #00ff88;
    --error: #ff3366;
    --text: #e8eaf0;
    --text-dim: #6b7280;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

html {
    height: 100%;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ========== SCREENS ========== */
.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ========== MAIN MENU ========== */
#main-menu {
    background: var(--bg-dark);
}

/* -- Top Nav Bar -- */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: 60px;
    background: var(--bg-mid);
    border-bottom: 2px solid rgba(0, 212, 255, 0.15);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    flex-shrink: 0;
}

.nav-logo { flex-shrink: 0; }

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--text);
}

.logo-text .accent { color: var(--accent); }

.nav-links { display: flex; gap: 4px; }

.nav-link {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 8px 20px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.nav-link.active-link {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.nav-player { display: flex; align-items: center; gap: 14px; }

.nav-cash {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
}

.nav-level-badge {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #0088aa);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 12px var(--accent-glow);
}

.level-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px; font-weight: 900; color: #fff;
}

/* -- Dashboard Grid -- */
.dashboard {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.dash-left { display: flex; flex-direction: column; gap: 16px; }

.profile-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-jet {
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px var(--accent-glow));
    display: flex; justify-content: center;
}

.profile-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px; font-weight: 700;
    letter-spacing: 4px; margin-bottom: 4px;
}

.profile-rank {
    font-size: 13px; color: var(--accent);
    letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px;
}

.profile-xp { text-align: left; }

.xp-label {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-dim);
    margin-bottom: 6px; font-family: 'Orbitron', sans-serif;
}

.quick-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.quick-stat {
    background: var(--bg-card); border-radius: 10px;
    padding: 14px 12px; text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.qs-value {
    display: block; font-family: 'Orbitron', sans-serif;
    font-size: 20px; font-weight: 700;
    color: var(--accent); margin-bottom: 4px;
}

.qs-label {
    font-size: 11px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 1px;
}

/* -- Center Column -- */
.dash-center { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.race-card {
    position: relative; border-radius: 16px;
    overflow: hidden; flex-shrink: 0;
}

.race-card-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #0f2847 0%, #1a4a7a 40%, #2d7bb5 70%, #4aa3df 100%);
    z-index: 0;
}

.race-card-bg::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse 200px 60px at 20% 40%, rgba(255,255,255,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 150px 40px at 70% 60%, rgba(255,255,255,0.06) 0%, transparent 70%);
}

.race-card-content {
    position: relative; z-index: 1;
    padding: 36px 32px; text-align: center;
}

.race-card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px; font-weight: 900;
    letter-spacing: 6px; margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.race-card-subtitle {
    font-size: 15px; color: rgba(255,255,255,0.7); margin-bottom: 28px;
}

.btn-race-big {
    display: inline-flex; align-items: center; gap: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px; font-weight: 900; letter-spacing: 5px;
    padding: 18px 50px;
    background: linear-gradient(135deg, #ff6b35, #ff9500);
    color: #fff; border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 24px rgba(255,107,53,0.4);
    transition: all 0.2s ease;
}

.btn-race-big:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 32px rgba(255,107,53,0.5);
}

.race-card-info {
    display: flex; justify-content: center; gap: 30px;
    margin-top: 20px; font-size: 13px; color: rgba(255,255,255,0.6);
}

.race-card-info strong { color: #fff; }

.recent-races-card {
    background: var(--bg-card); border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; min-height: 0;
}

.card-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px; font-weight: 700; letter-spacing: 3px;
    color: var(--text-dim); padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}

.recent-races-list { flex: 1; overflow-y: auto; padding: 8px; }

.empty-state {
    text-align: center; color: var(--text-dim);
    padding: 30px 20px; font-size: 14px;
}

.recent-race-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-radius: 6px; margin-bottom: 4px;
    background: rgba(255,255,255,0.02); transition: background 0.15s;
}

.recent-race-row:hover { background: rgba(255,255,255,0.05); }

.rr-place { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 14px; width: 50px; }
.rr-place.gold { color: var(--gold); }
.rr-place.silver { color: var(--silver); }
.rr-place.bronze { color: var(--bronze); }
.rr-wpm { font-family: 'Orbitron', sans-serif; font-size: 13px; color: var(--accent); }
.rr-acc { font-size: 13px; color: var(--success); }
.rr-date { font-size: 12px; color: var(--text-dim); }

/* -- Right Column -- */
.dash-right { display: flex; flex-direction: column; gap: 16px; }

.leaderboard-card {
    background: var(--bg-card); border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05); overflow: hidden;
}

.record-list { padding: 8px 12px; }

.record-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.03);
}

.record-item:last-child { border-bottom: none; }
.record-icon { font-size: 18px; width: 28px; text-align: center; }
.record-text { flex: 1; font-size: 13px; color: var(--text-dim); }
.record-value { font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 700; color: var(--accent); }

.fleet-card {
    background: var(--bg-card); border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 0 0 16px; overflow: hidden; flex: 1;
}

.fleet-count {
    font-family: 'Orbitron', sans-serif; font-size: 12px;
    color: var(--text-dim); text-align: center; padding: 10px;
}

.fleet-preview {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 6px; padding: 0 12px;
}

.fleet-jet {
    width: 56px; height: 28px; display: flex; align-items: center;
    justify-content: center; background: rgba(255,255,255,0.03);
    border-radius: 6px; border: 1px solid rgba(255,255,255,0.05); overflow: hidden;
}

.fleet-jet.locked { opacity: 0.2; filter: grayscale(1); }

/* ========== BUTTONS ========== */
.btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
    background: #222b45;
    border-color: var(--accent);
}

.btn-back {
    background: none;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-back:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* ========== PLAYER INFO ========== */
.player-cash {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
}

.player-xp-bar {
    width: 120px;
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ========== RACE SCREEN ========== */
#race-screen {
    background: linear-gradient(180deg,
        #0a1628 0%,
        #0f2847 15%,
        #1a4a7a 30%,
        #2d7bb5 50%,
        #4aa3df 65%,
        #7ec8e3 78%,
        #b5e4f7 88%,
        #d4f0fc 95%,
        #e8f7ff 100%
    );
    position: relative;
}

/* Animated clouds */
#race-screen::before {
    content: '';
    position: absolute;
    top: 10%;
    left: -200px;
    width: calc(100% + 400px);
    height: 60%;
    background:
        radial-gradient(ellipse 120px 40px at 10% 20%, rgba(255,255,255,0.15) 0%, transparent 70%),
        radial-gradient(ellipse 180px 50px at 30% 60%, rgba(255,255,255,0.1) 0%, transparent 70%),
        radial-gradient(ellipse 150px 35px at 55% 30%, rgba(255,255,255,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 200px 45px at 75% 70%, rgba(255,255,255,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 100px 30px at 90% 40%, rgba(255,255,255,0.14) 0%, transparent 70%),
        radial-gradient(ellipse 160px 40px at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 70%),
        radial-gradient(ellipse 130px 35px at 65% 15%, rgba(255,255,255,0.11) 0%, transparent 70%);
    animation: driftClouds 60s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes driftClouds {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

#race-screen.racing::before {
    animation: driftClouds 12s linear infinite;
}

/* Sun */
#race-screen::after {
    content: '';
    position: absolute;
    top: 8%;
    right: 12%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fff7d4 0%, #ffe066 40%, rgba(255,200,50,0.3) 70%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(255, 220, 100, 0.4), 0 0 80px rgba(255, 200, 50, 0.2);
    z-index: 0;
    pointer-events: none;
}

.race-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.race-wpm { color: var(--accent); }
.race-accuracy { color: var(--success); }
.race-timer { color: var(--text-dim); }

.race-nitro {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nitro-label {
    color: var(--accent2);
    font-weight: 700;
}

.nitro-bar {
    width: 100px;
    height: 10px;
    background: var(--bg-dark);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--accent2);
}

.nitro-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent2), #ff9500);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.nitro-key {
    color: var(--text-dim);
    font-size: 11px;
}

/* ========== RACE TRACK ========== */
.race-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.lane {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(2px);
    border-radius: 8px;
    position: relative;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.race-finish-line {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 30px;
    width: 6px;
    z-index: 3;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        0deg,
        #fff 0,
        #fff 10px,
        #000 10px,
        #000 20px
    );
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.6);
    transform: translateX(60px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
}

.race-track.finished .race-finish-line {
    transform: translateX(0);
    opacity: 1;
}

.lane.player-lane {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.15);
}

.lane-finish {
    display: none;
}

.jet-container {
    position: absolute;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: left 0.15s ease-out;
    z-index: 2;
}

.jet-icon {
    display: flex;
    align-items: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.jet-icon img,
.jet-icon svg {
    display: block;
    max-height: 100%;
}

.jet-trail {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--accent));
    border-radius: 3px;
    opacity: 0.7;
    box-shadow: 0 0 8px var(--accent-glow);
}

.lane-name {
    position: absolute;
    left: 12px;
    top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    letter-spacing: 0.5px;
}

.lane-wpm {
    position: absolute;
    right: 50px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ========== TYPING AREA ========== */
.typing-area {
    padding: 15px 20px 20px;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.countdown {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 60px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
    z-index: 10;
    display: none;
}

.countdown.active {
    display: block;
    animation: countPulse 0.5s ease-out;
}

@keyframes countPulse {
    0% { transform: translateX(-50%) scale(1.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.text-display {
    font-size: 28px;
    line-height: 1.8;
    padding: 16px 24px;
    background: #0d1425;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
    font-family: 'Rajdhani', sans-serif;
    word-spacing: 3px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,212,255,0.3) transparent;
}

.text-display .char {
    transition: color 0.05s, background 0.05s;
    padding: 2px 0;
    font-weight: 500;
}

.text-display .char.correct {
    color: #00e676;
    text-shadow: 0 0 4px rgba(0, 230, 118, 0.3);
}

.text-display .char.incorrect {
    color: #ff1744;
    background: rgba(255, 23, 68, 0.25);
    border-radius: 3px;
    text-decoration: underline;
    text-decoration-color: #ff1744;
}

.text-display .char.current {
    color: #ffffff;
    background: rgba(0, 212, 255, 0.25);
    border-bottom: 3px solid var(--accent);
    border-radius: 2px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { border-bottom-color: var(--accent); }
    50% { border-bottom-color: transparent; }
}

.text-display .char.pending {
    color: #8a94a6;
}

.typing-input {
    width: 100%;
    padding: 16px 24px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 22px;
    background: #0d1425;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: 1px;
}

.typing-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow), inset 0 0 8px rgba(0, 212, 255, 0.05);
}

.typing-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.typing-input::placeholder {
    color: #4a5568;
    letter-spacing: 2px;
}

/* ========== RESULTS SCREEN ========== */
#results-screen {
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    overflow-y: auto;
}

.results-container {
    text-align: center;
    max-width: 700px;
    width: 100%;
    padding: 30px 40px;
    animation: slideIn 0.4s ease-out;
}

/* Placement Banner */
.results-banner {
    margin-bottom: 24px;
}

.results-placement {
    font-family: 'Orbitron', sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    letter-spacing: 4px;
}

/* Scoreboard */
.results-scoreboard {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.scoreboard-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-dim);
    padding: 12px 20px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.scoreboard-row {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}

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

.scoreboard-row.is-player {
    background: rgba(0, 212, 255, 0.08);
}

.sb-place {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    width: 50px;
    text-align: left;
}

.sb-place.gold { color: var(--gold); }
.sb-place.silver { color: var(--silver); }
.sb-place.bronze { color: var(--bronze); }
.sb-place.other { color: var(--text-dim); }

.sb-jet {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-name {
    flex: 1;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    padding-left: 12px;
}

.sb-wpm {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--accent);
    width: 100px;
    text-align: right;
}

/* Stats Row */
.results-stats-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.result-stat {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 18px 28px;
    border: 1px solid rgba(255,255,255,0.05);
    min-width: 120px;
}

.result-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.result-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
}

/* Rewards */
.results-rewards {
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.reward-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.reward-label {
    color: var(--text-dim);
    font-size: 15px;
}

.reward-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--gold);
}

.results-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ========== SCREEN HEADER ========== */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
    background: var(--bg-mid);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.screen-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    letter-spacing: 4px;
}

/* ========== GARAGE ========== */
.garage-content {
    flex: 1;
    display: flex;
    padding: 30px;
    gap: 30px;
    overflow: hidden;
}

.jet-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.jet-display {
    margin-bottom: 20px;
    filter: drop-shadow(0 0 30px var(--accent-glow));
    display: flex;
    justify-content: center;
    align-items: center;
}

.jet-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    color: var(--accent);
}

.garage-right {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.garage-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.garage-tab {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px 6px 0 0;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.garage-tab:hover { color: var(--text); }

.garage-tab.active {
    background: var(--bg-mid);
    color: var(--accent);
    border-color: var(--accent);
    border-bottom-color: var(--bg-mid);
}

.garage-equipped-info {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
}

#garage-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 10px;
    flex: 1;
}

.jet-list {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Trail/Paint list items */
.garage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
}

.garage-item:hover { border-color: var(--accent); }

.garage-item.selected {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
}

.garage-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.garage-item-icon {
    width: 40px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trail-preview {
    width: 40px;
    height: 8px;
    border-radius: 4px;
}

.paint-preview {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.garage-item-info { flex: 1; }
.garage-item-name { font-weight: 700; font-size: 14px; }
.garage-item-detail { font-size: 12px; color: var(--text-dim); }

.jet-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
}

.jet-list-item:hover {
    border-color: var(--accent);
}

.jet-list-item.selected {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
}

.jet-list-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.jet-list-icon {
    display: flex;
    align-items: center;
    width: 50px;
    flex-shrink: 0;
}

.jet-list-info {
    flex: 1;
}

.jet-list-name {
    font-weight: 700;
    font-size: 15px;
}

.jet-list-speed {
    font-size: 12px;
    color: var(--text-dim);
}

/* ========== SHOP ========== */
.shop-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
    overflow: hidden;
}

.shop-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.shop-tab {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px 6px 0 0;
    color: var(--text-dim);
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}

.shop-tab:hover {
    color: var(--text);
}

.shop-tab.active {
    background: var(--bg-mid);
    color: var(--accent);
    border-color: var(--accent);
    border-bottom-color: var(--bg-mid);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    overflow-y: auto;
    flex: 1;
}

.shop-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
    cursor: pointer;
}

.shop-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.shop-item.owned {
    border-color: var(--success);
    opacity: 0.7;
}

.shop-item-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.shop-item-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.shop-item-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.shop-item-price {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--gold);
}

.shop-item-owned {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--success);
    letter-spacing: 2px;
}

/* ========== STATS ========== */
.stats-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    color: var(--accent);
}

.race-history h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    letter-spacing: 3px;
    margin-bottom: 16px;
    color: var(--text-dim);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.03);
}

.history-place {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    width: 60px;
}

.history-place.gold { color: var(--gold); }
.history-place.silver { color: var(--silver); }
.history-place.bronze { color: var(--bronze); }

.history-wpm {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent);
}

.history-accuracy {
    color: var(--success);
}

.history-date {
    color: var(--text-dim);
    font-size: 13px;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a3555;
}

/* ========== NITRO BOOST EFFECT ========== */
.nitro-active .jet-trail {
    width: 120px;
    background: linear-gradient(90deg, transparent, var(--accent2), #ff9500);
    opacity: 1;
    animation: nitroFlare 0.3s ease-in-out infinite alternate;
}

@keyframes nitroFlare {
    0% { width: 100px; opacity: 0.8; }
    100% { width: 140px; opacity: 1; }
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.screen.active .results-container,
.screen.active .garage-content,
.screen.active .shop-content,
.screen.active .stats-content {
    animation: slideIn 0.3s ease-out;
}

/* ========== LEVEL UP NOTIFICATION ========== */
.level-up-notif {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    z-index: 9999;
    text-align: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.level-up-notif.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.level-up-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3), 0 4px 8px rgba(0,0,0,0.5);
}

.level-up-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 2px 4px rgba(0,0,0,0.5);
    margin-top: 8px;
}

/* ========== RACE BACKGROUNDS ========== */
#race-screen.bg-sky {
    background: linear-gradient(180deg, #0a1628 0%, #0f2847 15%, #1a4a7a 30%, #2d7bb5 50%, #4aa3df 65%, #7ec8e3 78%, #b5e4f7 88%, #d4f0fc 95%, #e8f7ff 100%);
}

#race-screen.bg-sunset {
    background: linear-gradient(180deg, #0a0520 0%, #1a0a3a 10%, #3d1155 20%, #8b2252 35%, #cc4433 50%, #ee7722 65%, #ffaa33 78%, #ffcc66 88%, #ffe4a0 100%);
}

#race-screen.bg-storm {
    background: linear-gradient(180deg, #0a0a15 0%, #15152a 15%, #222240 30%, #2a2a4a 45%, #333355 55%, #444466 70%, #555577 85%, #666688 100%);
}

#race-screen.bg-space {
    background: linear-gradient(180deg, #000005 0%, #050510 20%, #0a0a1a 40%, #0f0f25 60%, #141430 80%, #1a1a3a 100%);
}

#race-screen.bg-ocean {
    background: linear-gradient(180deg, #88ccee 0%, #55aadd 15%, #3388cc 30%, #1166aa 45%, #004488 60%, #003366 75%, #002244 90%, #001133 100%);
}

#race-screen.bg-aurora {
    background: linear-gradient(180deg, #0a0a20 0%, #0a1a30 15%, #0a3040 25%, #0a4a3a 35%, #1a6644 45%, #228844 55%, #33aa55 65%, #22886a 75%, #1a6688 85%, #0a3060 100%);
}

#race-screen.bg-desert {
    background: linear-gradient(180deg, #1a3355 0%, #2a5588 15%, #4488bb 30%, #88bbdd 45%, #ccddbb 55%, #ddcc88 65%, #ccaa55 75%, #bb8833 85%, #996622 95%, #774411 100%);
}

/* Stars for space bg */
#race-screen.bg-space::before {
    background:
        radial-gradient(1px 1px at 5% 15%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 15% 45%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 25% 25%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 35% 65%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 45% 10%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 55% 50%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 65% 35%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 75% 70%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 95% 55%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 10% 80%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 40% 90%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 70% 5%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 90% 40%, rgba(255,255,255,0.5), transparent);
    animation: none;
}

/* Aurora shimmer */
#race-screen.bg-aurora::before {
    background:
        radial-gradient(ellipse 300px 80px at 30% 40%, rgba(50,255,100,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 250px 60px at 60% 55%, rgba(100,200,255,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 200px 50px at 80% 30%, rgba(150,100,255,0.04) 0%, transparent 70%);
    animation: none;
}
