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

body {
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    background: #1a1a2e;
    touch-action: none;
}

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

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
}

#speed-display {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid #E63946;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.4);
}

#speed-value {
    font-size: 2rem;
    font-weight: 800;
    color: #E63946;
    line-height: 1;
}

#speed-label {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 4px;
}

#gift-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 25px;
    color: #FFD700;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

#airborne-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #E63946, #C41E3A);
    padding: 15px 40px;
    border-radius: 10px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

#settings-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 200;
    border: 2px solid #4CAF50;
    transition: transform 0.3s, background 0.3s;
}

#settings-toggle:hover {
    transform: rotate(90deg);
    background: rgba(76, 175, 80, 0.3);
}

#settings-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: rgba(10, 10, 30, 0.95);
    padding: 80px 20px 20px;
    z-index: 150;
    transition: left 0.3s ease;
    border-right: 3px solid #4CAF50;
    overflow-y: auto;
}

#settings-panel.open {
    left: 0;
}

#settings-panel h3 {
    color: #4CAF50;
    margin-bottom: 25px;
    font-size: 1.2rem;
    text-align: center;
}

.slider-group {
    margin-bottom: 20px;
}

.slider-group label {
    display: block;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.slider-group label span {
    color: #4CAF50;
    font-weight: 700;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #333;
    border-radius: 4px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#settings-panel button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#regenerate-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: #fff;
}

#reset-car-btn {
    background: linear-gradient(135deg, #E63946, #C41E3A);
    color: #fff;
}

#settings-panel button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
    z-index: 100;
}

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

#joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#joystick-stick {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: transform 0.1s;
}

#pedal-zone {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

#gas-btn, #brake-btn {
    width: 80px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#gas-btn {
    background: rgba(76, 175, 80, 0.6);
    border: 3px solid #4CAF50;
}

#brake-btn {
    background: rgba(230, 57, 70, 0.6);
    border: 3px solid #E63946;
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #888;
    z-index: 50;
}

#footer a {
    color: #4CAF50;
    text-decoration: none;
    transition: color 0.3s;
}

#footer a:hover {
    color: #8BC34A;
}

@media (max-width: 768px) {
    #speed-display {
        width: 80px;
        height: 80px;
        bottom: 220px;
    }
    
    #speed-value {
        font-size: 1.5rem;
    }
    
    #gift-counter {
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    #settings-panel {
        width: 280px;
        left: -300px;
    }
    
    #footer {
        display: none;
    }
}