* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background: #0a0a0f;
    font-family: 'Share Tech Mono', monospace;
    color: #e0e0e0;
    user-select: none;
}

#scene-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
}

#scene-container canvas {
    display: block;
}

/* ===== START SCREEN ===== */
#start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: linear-gradient(135deg, #0a0a1aee, #1a0a2aee, #0a1a2aee);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.start-content {
    text-align: center;
}

.title-glow {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    color: #ff3030;
    text-shadow: 0 0 40px #ff303088, 0 0 80px #ff303044, 0 0 120px #ff303022;
    letter-spacing: 0.2em;
    margin-bottom: 0.2em;
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    font-weight: 400;
    color: #8888aa;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 2em;
}

.controls-summary {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4em 2em;
    text-align: left;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #7777aa;
    margin-bottom: 2em;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.key {
    background: #ffffff15;
    border: 1px solid #ffffff25;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8em;
    color: #aaaacc;
    font-family: 'Share Tech Mono', monospace;
}

.start-prompt {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: #ccccee;
    animation: pulse 2s ease-in-out infinite;
    letter-spacing: 0.15em;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.footer-link {
    margin-top: 2em;
}

.footer-link a {
    color: #555577;
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.footer-link a:hover {
    color: #8888bb;
}

/* ===== PAUSE MENU ===== */
#pause-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    background: #000000cc;
    backdrop-filter: blur(6px);
}

.pause-content {
    text-align: center;
}

.pause-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #ff3030;
    letter-spacing: 0.3em;
    margin-bottom: 1.5em;
    text-shadow: 0 0 20px #ff303066;
}

.pause-btn {
    display: block;
    width: 260px;
    margin: 0.6em auto;
    padding: 0.8em 1.5em;
    background: #ffffff0a;
    border: 1px solid #ffffff20;
    border-radius: 6px;
    color: #ccccee;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
}

.pause-btn:hover {
    background: #ff303025;
    border-color: #ff303055;
    color: #ffffff;
}

/* ===== HUD ===== */
#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 50;
}

#hud-speed {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

#gauge-canvas {
    display: block;
    margin: 0 auto;
}

#speed-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 15px #ff303066;
    line-height: 1;
    margin-top: -10px;
}

#speed-unit {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: #888899;
    letter-spacing: 0.15em;
}

#hud-tach {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 130px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#tach-bar-container {
    width: 8px;
    height: 80px;
    background: #ffffff10;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
}

#tach-bar {
    width: 100%;
    height: 0%;
    background: #33ff66;
    border-radius: 4px;
    transition: height 0.05s, background 0.2s;
}

#gear-indicator {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffcc00;
    text-shadow: 0 0 10px #ffcc0044;
}

#hud-minimap {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffffff20;
    background: #00000088;
}

#minimap-canvas {
    display: block;
}

/* Help Panel */
#hud-help {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #000000bb;
    border: 1px solid #ffffff15;
    border-radius: 8px;
    padding: 12px 16px;
    pointer-events: auto;
}

.help-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ff3030;
    letter-spacing: 0.2em;
    margin-bottom: 0.5em;
}

.help-row {
    font-size: 0.75rem;
    color: #8888aa;
    margin: 0.3em 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.key-sm {
    background: #ffffff10;
    border: 1px solid #ffffff20;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.7em;
    color: #aaaacc;
    min-width: 40px;
    text-align: center;
}

#help-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.7rem;
    color: #555566;
    letter-spacing: 0.1em;
}

/* ===== MOBILE CONTROLS ===== */
#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 200px;
    z-index: 60;
    pointer-events: none;
}

#joystick-zone {
    position: absolute;
    bottom: 30px;
    left: 30px;
    pointer-events: auto;
}

#joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #ffffff10;
    border: 2px solid #ffffff20;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#joystick-stick {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ff303055;
    border: 2px solid #ff303088;
    position: absolute;
    transition: none;
}

#mobile-buttons {
    position: absolute;
    bottom: 30px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    pointer-events: auto;
}

.mobile-btn {
    width: 70px;
    height: 50px;
    border-radius: 10px;
    border: 2px solid #ffffff30;
    background: #ffffff10;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-user-select: none;
}

.mobile-btn.small {
    width: 50px;
    height: 40px;
    font-size: 0.6rem;
}

.mobile-btn:active {
    background: #ff303044;
    border-color: #ff3030;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    #hud-speed { bottom: 210px; }
    #hud-tach { bottom: 230px; margin-left: 100px; }
    #hud-minimap { bottom: 210px; right: 10px; width: 100px; height: 100px; }
    #minimap-canvas { width: 100px; height: 100px; }
    #speed-value { font-size: 2rem; }
    #gear-indicator { font-size: 1.3rem; }
    .controls-summary { grid-template-columns: 1fr; }
}