* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', 'Courier New', monospace;
    overflow: hidden;
    background: #000;
    color: white;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.screen.active {
    display: flex;
}

/* ========== MAIN MENU DESIGN ========== */
#mainMenu {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#mainMenu::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 0, 110, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.menu-container {
    position: relative;
    z-index: 10;
    text-align: center;
}

.logo-container {
    margin-bottom: 60px;
}

.logo {
    font-family: 'Orbitron', monospace;
    font-size: 120px;
    font-weight: 900;
    color: white;
    text-shadow: 
        0 0 40px rgba(0, 217, 255, 0.8),
        0 0 80px rgba(0, 217, 255, 0.4),
        0 5px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 8px;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 40px rgba(0, 217, 255, 0.8), 0 0 80px rgba(0, 217, 255, 0.4); }
    to { text-shadow: 0 0 60px rgba(0, 217, 255, 1), 0 0 100px rgba(0, 217, 255, 0.6); }
}

.tagline {
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #00d9ff;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.9;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.menu-btn {
    width: 450px;
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(0, 217, 255, 0.5);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 217, 255, 0.4);
    border-color: #00d9ff;
}

.free-drive-btn:hover {
    border-color: #ff006e;
    box-shadow: 0 10px 40px rgba(255, 0, 110, 0.4);
}

.practice-btn:hover {
    border-color: #00ff88;
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.4);
}

.btn-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.btn-text {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
}

.btn-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    letter-spacing: 1px;
}

.menu-footer {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
}

/* ========== BACK BUTTON ========== */
.back-button {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(0, 217, 255, 0.6);
    border-radius: 12px;
    padding: 12px 30px;
    cursor: pointer;
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    color: #00d9ff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.back-button:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: #00d9ff;
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
    transform: translateX(-50%) translateY(-2px);
}

.back-arrow {
    font-size: 24px;
    font-weight: 900;
}

.back-text {
    font-size: 16px;
}

/* ========== GAME CANVAS ========== */
#gameCanvas {
    display: block;
}

/* ========== HUD PANELS ========== */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    font-family: 'Rajdhani', sans-serif;
}

.hud-panel {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(0, 217, 255, 0.6);
    border-radius: 12px;
    padding: 18px;
    color: white;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.hud-label {
    font-size: 12px;
    color: #0df;
    font-weight: 600;
    letter-spacing: 2px;
}

.hud-unit {
    font-size: 14px;
    color: #0df;
    font-weight: 600;
}

.speed-panel {
    top: 20px;
    left: 20px;
    width: 200px;
}

.speed-value {
    font-family: 'Orbitron', monospace;
    font-size: 64px;
    font-weight: 900;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88;
    line-height: 1;
}

.gear-panel {
    top: 20px;
    right: 20px;
    width: 140px;
    text-align: center;
}

.gear-value {
    font-family: 'Orbitron', monospace;
    font-size: 80px;
    font-weight: 900;
    color: #00d9ff;
    text-shadow: 0 0 25px #00d9ff;
    line-height: 1;
}

.engine-panel {
    top: 180px;
    left: 20px;
    width: 200px;
    text-align: center;
}

.engine-status {
    font-size: 20px;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
}

.engine-status.on {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 2px solid #00ff88;
}

.engine-status.off {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    border: 2px solid #ff4444;
}

.clutch-panel {
    top: 180px;
    right: 20px;
    width: 140px;
    text-align: center;
}

.clutch-bar {
    width: 100%;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.clutch-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #00ff88, #00d9ff);
    transition: height 0.1s;
}

.handbrake-panel {
    top: 320px;
    left: 20px;
    width: 200px;
    text-align: center;
}

.handbrake-status {
    font-size: 20px;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
}

.handbrake-status.on {
    background: rgba(255, 100, 0, 0.3);
    color: #ff6400;
    border: 2px solid #ff6400;
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

.handbrake-status.off {
    background: rgba(100, 100, 100, 0.2);
    color: #888;
    border: 2px solid #888;
}

.info-panel {
    bottom: 20px;
    left: 20px;
}

.info-line {
    color: #0df;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.info-line span {
    color: #00ff88;
}

.controls-panel {
    bottom: 20px;
    right: 20px;
}

.controls-title {
    color: #00d9ff;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.control-line {
    font-size: 14px;
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.8);
}

.key {
    display: inline-block;
    background: rgba(0, 217, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 217, 255, 0.5);
    font-weight: 700;
    color: #00d9ff;
    min-width: 30px;
    text-align: center;
    margin-right: 8px;
}

/* ========== INSTRUCTION PANEL - TOP POSITION ========== */
.instruction-panel-top {
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.95), rgba(0, 255, 136, 0.95));
    border: 3px solid #00ff88;
    z-index: 200;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.5);
}

.instruction-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.instruction-icon {
    font-size: 32px;
}

.instruction-title {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    letter-spacing: 2px;
}

.instruction-text {
    font-size: 18px;
    line-height: 1.6;
    color: #000;
    font-weight: 600;
    margin-bottom: 15px;
}

.instruction-progress {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 700;
    letter-spacing: 1px;
}

/* ========== NOTIFICATIONS ========== */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 217, 255, 0.95);
    color: #000;
    padding: 35px 70px;
    border-radius: 18px;
    font-family: 'Orbitron', monospace;
    font-size: 55px;
    font-weight: 700;
    z-index: 1000;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.6);
}

.warning {
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.95);
    color: #fff;
    padding: 25px 50px;
    border-radius: 12px;
    font-family: 'Orbitron', monospace;
    font-size: 26px;
    font-weight: 700;
    z-index: 999;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.6);
}

.hidden {
    display: none !important;
}