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

body {
    background: #0a0a14;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
}

#hud-top {
    display: flex;
    gap: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    align-items: center;
}

#exit-btn {
    background: rgba(244, 67, 54, 0.3);
    border: 1px solid rgba(244, 67, 54, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#exit-btn:active {
    background: rgba(244, 67, 54, 0.6);
}

/* Pause Menu */
#pause-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#pause-menu.hidden {
    display: none !important;
}

.pause-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pause-inner h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 10px;
}

.pause-inner button {
    width: 200px;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#resume-btn {
    background: #4caf50;
}

#resume-btn:active {
    background: #388e3c;
}

#exit-btn {
    background: rgba(244, 67, 54, 0.5);
    border: 1px solid rgba(244, 67, 54, 0.7) !important;
}

#exit-btn:active {
    background: rgba(244, 67, 54, 0.8);
}

#fuel-display {
    color: #ffd700;
}

/* Touch Controls */
#touch-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
    gap: 20px;
}

.pedal {
    flex: 1;
    max-width: 140px;
    height: 70px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.pedal.gas {
    background: rgba(76, 175, 80, 0.4);
    border-color: rgba(76, 175, 80, 0.6);
}

.pedal.gas:active {
    background: rgba(76, 175, 80, 0.7);
}

.pedal.brake {
    background: rgba(244, 67, 54, 0.4);
    border-color: rgba(244, 67, 54, 0.6);
}

.pedal.brake:active {
    background: rgba(244, 67, 54, 0.7);
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 20px;
}

#start-screen h1 {
    font-size: 2rem;
    color: #e94560;
    text-align: center;
}

#start-btn {
    padding: 14px 48px;
    font-size: 1.2rem;
    font-weight: 700;
    background: #e94560;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s;
}

#start-btn:active {
    transform: scale(0.95);
}

.hint {
    color: #666;
    font-size: 0.85rem;
}

/* Game Over */
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 16px;
}

#game-over.hidden {
    display: none !important;
}

#start-screen.hidden {
    display: none !important;
}

#game-over h2 {
    font-size: 1.8rem;
    color: #e94560;
}

#final-distance {
    font-size: 1.2rem;
    color: #ffd700;
}

#restart-btn {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    background: #e94560;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    margin-top: 10px;
}

#restart-btn:active {
    transform: scale(0.95);
}
