:root {
    --bg-dark: #070710;
    --neon-cyan: #00f3ff;
    --neon-pink: #ff0055;
    --neon-yellow: #f3e600;
    --neon-purple: #9d00ff;
    --panel-bg: rgba(10, 10, 25, 0.85);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 50%, #12122c 0%, #070710 100%);
    color: #ffffff;
    font-family: var(--font-body);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 1024px;
    height: 576px;
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3), inset 0 0 20px rgba(0, 243, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.overlay-screen.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.brand-header {
    text-align: center;
    margin-bottom: 40px;
}

.glitch-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
    letter-spacing: 4px;
    animation: pulseGlow 2s infinite alternate;
}

.subtitle {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--neon-pink);
    letter-spacing: 6px;
    margin-top: 5px;
}

@keyframes pulseGlow {
    0% { text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan); }
    100% { text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan), 0 0 60px var(--neon-cyan); }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 280px;
}

.arcade-btn {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 24px;
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.arcade-btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--neon-cyan);
    transform: translateY(-2px);
}

.arcade-btn.primary {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.2);
}

.arcade-btn.primary:hover {
    background: var(--neon-pink);
    color: #ffffff;
    box-shadow: 0 0 25px var(--neon-pink);
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    letter-spacing: 2px;
}

.track-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.track-card {
    width: 220px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.track-card:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
}

.track-card.selected {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 85, 0.08);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.3);
}

.track-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #fff;
}

.track-card p {
    font-size: 0.95rem;
    color: #aaa;
    line-height: 1.4;
}

.instructions-content {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 25px 40px;
    border-radius: 6px;
    margin-bottom: 30px;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-row span {
    color: #aaa;
    display: inline-block;
    width: 140px;
}

.control-row strong {
    color: var(--neon-yellow);
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.score-board {
    font-size: 1.3rem;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-board span {
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-weight: 700;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 5;
}

#hud.hidden {
    display: none;
}

.hud-top {
    display: flex;
    justify-content: space-between;
}

.hud-box {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-heading);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.hud-label {
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 1px;
}

.hud-box span:last-child {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 700;
}

.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.speedometer-container {
    background: var(--panel-bg);
    border: 2px solid var(--neon-cyan);
    padding: 10px 20px;
    border-radius: 6px;
    font-family: var(--font-heading);
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

#hud-speed {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--neon-cyan);
    line-height: 1;
}

speedometer-container small {
    font-size: 0.8rem;
    color: #aaa;
}

.nitro-gauge {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 0, 85, 0.4);
    padding: 10px 15px;
    border-radius: 6px;
    width: 220px;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.15);
}

.nitro-gauge .hud-label {
    color: var(--neon-pink);
    margin-bottom: 5px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.gauge-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

#nitro-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-yellow), var(--neon-pink));
    transition: width 0.1s linear;
}