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

body, html {
    width: 100%; height: 100%; overflow: hidden;
    background-color: #000;
    font-family: 'Metamorphous', cursive;
}

#gameCanvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}

/* UI Layer */
#ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none;
    background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.8) 100%); /* Vignette */
}

/* Typography & Colors */
.label { font-family: 'Cinzel', serif; font-size: 14px; color: #FFD700; text-shadow: 1px 1px 5px rgba(255,215,0,0.5); letter-spacing: 2px; }
.red-text { color: #FF4500; text-shadow: 0 0 20px #FF0000, 0 0 10px #FF4500; }

/* Top HUD */
#top-hud {
    position: absolute; top: 20px; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 0 40px; pointer-events: auto;
}

.hud-panel {
    background: radial-gradient(circle, rgba(40,25,15,0.8), rgba(20,10,5,0.9));
    border: 3px solid #8B6508;
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8), inset 0 0 15px rgba(255,215,0,0.1);
}

.stats-panel { width: 300px; display: flex; flex-direction: column; gap: 10px; }
.health-bar-bg { width: 100%; height: 20px; background: #111; border: 2px solid #555; border-radius: 10px; overflow: hidden; margin-top: 5px; box-shadow: inset 0 3px 6px rgba(0,0,0,0.8); }
#health-bar { width: 100%; height: 100%; background: linear-gradient(90deg, #8B0000, #FF4500); box-shadow: 0 0 10px #FF4500; transition: width 0.3s; }
.score-container { font-family: 'Cinzel', serif; font-size: 20px; color: #fff; text-shadow: 1px 1px 0 #000; }
#kills-val { color: #FFD700; font-size: 24px; }

/* Radar */
.radar-panel { 
    padding: 15px; border-radius: 50%; 
    background: radial-gradient(circle, rgba(40,25,15,0.9), rgba(10,5,0,0.9));
    border: 4px solid #B8860B;
    box-shadow: 0 0 30px rgba(184,134,11,0.4), inset 0 0 20px rgba(0,0,0,1);
    position: relative;
}
.radar-panel::after {
    content: ''; position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px;
    border: 2px dashed #FFD700; border-radius: 50%; opacity: 0.3;
    animation: spin 20s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
#radarCanvas { border-radius: 50%; background: rgba(0,0,0,0.6); box-shadow: inset 0 0 30px rgba(0,0,0,0.9); }

/* Crosshair & Breath Meter */
#crosshair {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100px; height: 100px;
    display: flex; justify-content: center; align-items: center;
}
.reticle {
    position: absolute; width: 6px; height: 6px;
    background: #FFD700; border-radius: 50%;
    box-shadow: 0 0 8px #FFD700;
}
.breath-meter {
    position: absolute; top: 0; left: 0; transform: rotate(-90deg);
}
.meter-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 4; }
.meter-fill { 
    fill: none; stroke: #FF4500; stroke-width: 6; 
    stroke-dasharray: 251; stroke-dashoffset: 0; 
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s;
    filter: drop-shadow(0 0 5px #FF4500);
}

@keyframes spinLock { 100% { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes counterSpin { 100% { transform: rotate(-360deg); } }

/* Bottom HUD */
#bottom-hud {
    position: absolute; bottom: 20px; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 0 40px; pointer-events: auto;
}

.flight-gauges { display: flex; gap: 20px; }
.gauge {
    background: rgba(20,10,5,0.8); border: 2px solid #8B6508;
    padding: 10px 20px; border-radius: 5px; text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}
.gauge .val { display: block; font-family: 'Cinzel', serif; font-size: 28px; color: #fff; margin-top: 5px; }

.abilities-panel { display: flex; gap: 15px; }
.ability-slot {
    width: 80px; height: 80px; background: #222;
    border: 3px solid #555; border-radius: 10px;
    position: relative; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
}
.ability-slot.active { border-color: #FFD700; box-shadow: 0 0 15px rgba(255,215,0,0.5); }
.fire-icon { width: 40px; height: 40px; background: radial-gradient(circle, #FF4500, transparent); border-radius: 50%; }
.ability-slot .key { position: absolute; bottom: -25px; font-size: 12px; color: #ccc; white-space: nowrap; }

/* Mobile Controls */
#mobile-controls {
    position: absolute; top: 60%; left: 0; width: 100%;
    transform: translateY(-50%);
    display: none; justify-content: space-between; align-items: flex-end;
    padding: 0 20px; pointer-events: none; z-index: 20;
}

#joystick-zone {
    width: 120px; height: 120px; position: relative; pointer-events: auto;
}
#joystick-base {
    width: 100px; height: 100px; background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3); border-radius: 50%;
    position: absolute; bottom: 0; left: 0;
}
#joystick-stick {
    width: 40px; height: 40px; background: rgba(255, 215, 0, 0.5);
    border-radius: 50%; position: absolute; top: 30px; left: 30px;
    box-shadow: 0 0 10px #FFD700; pointer-events: none;
}

.m-actions { display: flex; gap: 10px; align-items: flex-end; pointer-events: auto; }
.throttle-controls { display: flex; flex-direction: column; gap: 10px; }
.mobile-btn {
    width: 50px; height: 50px; background: rgba(40, 20, 10, 0.7);
    border: 2px solid #FFD700; border-radius: 50%; color: #FFD700;
    font-family: 'Cinzel', serif; font-size: 20px; font-weight: bold;
    box-shadow: 0 0 10px rgba(255,215,0,0.3); outline: none; cursor: pointer;
}
.mobile-btn:active { background: rgba(255, 215, 0, 0.3); transform: scale(0.9); }

.m-btn {
    background: rgba(255, 69, 0, 0.6); border: 2px solid #FF4500; color: #fff;
    width: 70px; height: 70px; border-radius: 50%; font-family: 'Cinzel', serif; font-size: 14px;
    text-shadow: 0 0 5px #000; box-shadow: 0 0 15px rgba(255,69,0,0.5); pointer-events: auto;
}
.dash-btn { background: rgba(138, 43, 226, 0.6); border-color: #8A2BE2; }

/* Menus */
#start-menu, #end-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 5, 0, 0.9);
    display: flex; justify-content: center; align-items: center; z-index: 100;
}

.menu-box {
    background: linear-gradient(135deg, rgba(40,25,15,0.95), rgba(15,5,0,0.95));
    border: 4px solid #B8860B; padding: 40px; text-align: center;
    box-shadow: 0 0 50px rgba(184,134,11,0.2), inset 0 0 30px rgba(0,0,0,0.8);
    max-width: 700px; width: 90%; border-radius: 15px;
}

.menu-box h1 { font-family: 'Cinzel', serif; font-size: 48px; color: #fff; margin-bottom: 10px; text-shadow: 0 5px 15px #000; }
.menu-box h1 span { color: #FFD700; }
.menu-box p { font-size: 18px; color: #aaa; margin-bottom: 30px; }

.class-selection h3 { color: #FFD700; margin-bottom: 15px; font-family: 'Cinzel', serif; }
.drake-options { display: flex; justify-content: center; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.drake-card {
    background: #222; border: 2px solid #555; padding: 15px; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; width: 140px;
}
.drake-card:hover { border-color: #888; background: #333; }
.drake-card.selected { border-color: #FFD700; box-shadow: 0 0 20px rgba(255,215,0,0.4); background: #3a2211; }
.drake-color { width: 50px; height: 50px; border-radius: 50%; margin: 0 auto 10px; border: 2px solid #fff; }
.drake-card h4 { font-size: 14px; color: #fff; }

.start-btn {
    background: linear-gradient(to bottom, #B8860B, #8B6508); color: #fff; border: 2px solid #FFD700;
    padding: 15px 50px; font-family: 'Cinzel', serif; font-size: 24px; font-weight: bold;
    cursor: pointer; transition: all 0.2s; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}
.start-btn:hover { background: linear-gradient(to bottom, #FFD700, #B8860B); color: #000; }
.start-btn:active { transform: translateY(4px); box-shadow: none; }

.controls-info { margin-top: 30px; padding-top: 20px; border-top: 1px solid #555; font-size: 14px; color: #888; }
.controls-info p { margin-bottom: 5px; }

#damage-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(255,0,0,0.6) 100%);
    opacity: 0; pointer-events: none; z-index: 5; transition: opacity 0.2s;
}

/* Mobile Responsive */
@media (max-width: 800px) {
    #top-hud { padding: 5px; flex-wrap: nowrap; justify-content: space-between; }
    .stats-panel { width: 60%; margin-bottom: 0; padding: 10px; }
    .health-container .label { font-size: 10px; }
    .score-container { font-size: 14px; }
    #kills-val { font-size: 18px; }
    
    .radar-panel { padding: 5px; width: 80px; height: 80px; }
    #radarCanvas { width: 100%; height: 100%; }
    
    #bottom-hud { padding: 5px; flex-direction: row; justify-content: center; bottom: 10px; }
    .flight-gauges { width: auto; gap: 10px; }
    .gauge { padding: 5px 10px; }
    .gauge .val { font-size: 16px; }
    
    .abilities-panel { display: none; } /* Hide PC abilities */
    #mobile-controls { display: flex; }
    
    /* Make sure start menu scales without overlapping */
    .menu-box { padding: 20px; max-height: 90vh; overflow-y: auto; }
    .menu-box h1 { font-size: 28px; }
    .drake-options { gap: 10px; }
    .drake-card { width: 90px; padding: 10px; }
    .drake-color { width: 30px; height: 30px; }
    .start-btn { font-size: 18px; padding: 10px 20px; }
}
