* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #0c0c0c 100%);
    color: #ffffff;
    overflow: hidden;
    min-height: 100vh;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.8) 100%);
}

/* Header Styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(90deg, #ff6b00 0%, #ff8500 50%, #ff6b00 100%);
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.3);
    border-bottom: 2px solid #ff8500;
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    letter-spacing: 3px;
}

.game-stats {
    display: flex;
    gap: 30px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.4);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.stat .label {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
}

.stat .unit {
    font-size: 0.7rem;
    opacity: 0.6;
}

#speed-display, #lap-display, #time-display, #best-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Game Area */
.game-area {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
}

#gameCanvas {
    border: 3px solid #ff6b00;
    border-radius: 15px;
    background: #111;
    box-shadow: 0 0 30px rgba(255, 107, 0, 0.4);
    flex-shrink: 0;
}

/* Controls Panel */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.3) 100%);
    border-radius: 15px;
    border: 1px solid rgba(255, 107, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 250px;
    height: fit-content;
}

.control-info h3, .car-selection h3 {
    color: #ff6b00;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.key {
    background: linear-gradient(145deg, #333, #555);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid #666;
}

/* Car Selection */
.car-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.car-btn {
    padding: 12px 16px;
    background: linear-gradient(145deg, #333, #555);
    color: #fff;
    border: 2px solid #666;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.car-btn:hover {
    background: linear-gradient(145deg, #555, #777);
    border-color: #ff6b00;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.car-btn.active {
    background: linear-gradient(145deg, #ff6b00, #ff8500);
    border-color: #ffaa00;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
}

/* Game Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.game-overlay.show {
    display: flex;
}

.overlay-content {
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.5) 100%);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #ff6b00;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 107, 0, 0.5);
    backdrop-filter: blur(15px);
    max-width: 500px;
    width: 90%;
}

#overlayTitle {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #ff6b00;
    text-shadow: 0 0 20px rgba(255, 107, 0, 0.7);
}

#overlayMessage {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.overlay-stats {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

#finalTime, #avgSpeed {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.restart-btn {
    padding: 15px 30px;
    background: linear-gradient(145deg, #ff6b00, #ff8500);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.restart-btn:hover {
    background: linear-gradient(145deg, #ff8500, #ffaa00);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 107, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 1280px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    #gameCanvas {
        width: 800px;
        height: 480px;
    }
    
    .game-controls {
        flex-direction: row;
        min-width: auto;
        width: 100%;
        max-width: 800px;
    }
    
    .control-info, .car-selection {
        flex: 1;
    }
}

@media (max-width: 900px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    #gameCanvas {
        width: 600px;
        height: 360px;
    }
    
    .overlay-stats {
        flex-direction: column;
    }
} 