* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #000;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* UI Elements */
#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 10;
    pointer-events: none;
}

#cameraInfo {
    margin-top: 10px;
    font-size: 18px;
    color: #0ff;
}

#speedometer {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 15px;
    color: #0ff;
    font-size: 28px;
    font-weight: bold;
    border: 2px solid #0ff;
    text-shadow: 0 0 10px #0ff;
    z-index: 10;
    pointer-events: none;
}

/* Start and Game Over Screens */
#startScreen, #gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#gameOverScreen {
    display: none;
}

h1 {
    font-size: 60px;
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
    margin-bottom: 20px;
}

.button {
    padding: 15px 40px;
    font-size: 24px;
    background: linear-gradient(45deg, #0ff, #00a0ff);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 10px;
}

.button:hover, .button:active {
    transform: scale(1.1);
}

.controls {
    color: #fff;
    margin-top: 30px;
    font-size: 18px;
    text-align: center;
}

#finalScore {
    font-size: 36px;
    color: #0ff;
    margin: 20px 0;
}

/* Mobile Touch Controls */
#touchZones {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    display: none;
}

.touch-zone {
    position: absolute;
    width: 50%;
    height: 100%;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

#touchLeft {
    left: 0;
    background: linear-gradient(to right, rgba(255, 0, 0, 0.2), transparent);
}

#touchRight {
    right: 0;
    background: linear-gradient(to left, rgba(0, 255, 0, 0.2), transparent);
}

.touch-zone.active {
    opacity: 1;
}

.zone-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.touch-zone.active .zone-label {
    opacity: 0.7;
}

#touchIndicator {
    position: fixed;
    width: 60px;
    height: 60px;
    border: 3px solid #0ff;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.3);
    pointer-events: none;
    z-index: 20;
    display: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px #0ff;
}

/* Camera Control Button */
#cameraControl {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.camera-btn {
    padding: 12px 20px;
    font-size: 16px;
    background: rgba(0, 255, 255, 0.3);
    border: 2px solid #0ff;
    border-radius: 10px;
    color: #0ff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 0 5px #0ff;
}

.camera-btn:hover, .camera-btn:active {
    background: rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #touchZones {
        display: block;
    }
    
    #cameraControl {
        top: 10px;
        right: 10px;
    }
    
    .camera-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 40px;
    }
    
    .button {
        font-size: 20px;
        padding: 12px 30px;
    }
    
    .controls {
        font-size: 14px;
    }
    
    #ui {
        font-size: 18px;
        top: 10px;
        left: 10px;
    }
    
    #speedometer {
        bottom: 15px;
        right: 15px;
        padding: 15px;
        font-size: 20px;
    }
    
    .zone-label {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 32px;
    }
    
    .camera-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #ui {
        font-size: 16px;
    }
    
    #speedometer {
        padding: 10px;
        font-size: 18px;
    }
    
    #finalScore {
        font-size: 24px;
    }
    
    .zone-label {
        font-size: 18px;
    }
}

/* Landscape mode for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #ui {
        font-size: 14px;
        top: 5px;
        left: 5px;
    }
    
    #speedometer {
        bottom: 5px;
        right: 5px;
        padding: 8px;
        font-size: 16px;
    }
    
    .zone-label {
        font-size: 16px;
    }
}