:root {
    --bg: #1a0e0e;
    --panel: rgba(20, 10, 10, 0.88);
    --border: rgba(240, 120, 80, 0.25);
    --accent: #f07050;
    --accent-glow: rgba(240, 112, 80, 0.3);
    --text: #fff5f0;
    --text-dim: rgba(255, 245, 240, 0.6);
    --danger: #ff5252;
    --success: #69f0ae;
    --radius: 12px;
}

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

body {
    background: var(--bg);
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

#distanceDisplay {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

#speedDisplay {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 4px;
}

#ammoDisplay {
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 4px;
}

#speedMessage {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    color: var(--success);
    font-weight: 600;
    animation: fadeUp 1.5s ease forwards;
}

@keyframes fadeUp {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 10;
    transition: none;
}

.crosshair-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
}

.crosshair-line.top,
.crosshair-line.bottom {
    width: 2px;
    height: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-line.top { top: 0; }
.crosshair-line.bottom { bottom: 0; }

.crosshair-line.left,
.crosshair-line.right {
    height: 2px;
    width: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.crosshair-line.left { left: 0; }
.crosshair-line.right { right: 0; }

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

/* Menu Panels */
.menu-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 50px;
    text-align: center;
    backdrop-filter: blur(10px);
    min-width: 340px;
}

.game-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 24px;
}

.best-score-display {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.gameover-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--danger);
    margin-bottom: 16px;
}

.score-display {
    margin-bottom: 24px;
    font-size: 1.2rem;
    line-height: 2;
}

/* Buttons */
.menu-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.menu-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.menu-btn.primary {
    background: rgba(79, 195, 247, 0.15);
    border-color: var(--accent);
}

.menu-btn.primary:hover {
    background: rgba(79, 195, 247, 0.25);
}

/* Controls */
.controls-list {
    text-align: left;
    margin: 20px 0;
}

.control-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.control-row .key {
    color: var(--accent);
    font-weight: 600;
}

/* Volume Controls */
.volume-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.volume-controls label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.volume-controls input[type="range"] {
    width: 120px;
    accent-color: var(--accent);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Orbital Cannon Charge Meter */
#orbitalMeter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

#orbitalLabel {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 6px;
}

#orbitalBarContainer {
    width: 100%;
    height: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 7px;
    overflow: hidden;
}

#orbitalBarFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #006688, #00ffff);
    border-radius: 7px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0,255,255,0.5);
}

#orbitalBarFill.ready {
    background: linear-gradient(90deg, #00ffff, #ffffff);
    box-shadow: 0 0 16px rgba(0,255,255,0.8);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#orbitalStatus {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 4px;
}

#orbitalStatus.ready {
    color: #00ffff;
    font-weight: 600;
}

/* Pause overlay */
#pauseOverlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pauseOverlay.hidden {
    display: none !important;
}

/* Targeting mode - purple tint */
#gameContainer.targeting-mode::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(80, 0, 120, 0.3);
    pointer-events: none;
    z-index: 5;
    animation: targetPulse 1s ease-in-out infinite;
}

@keyframes targetPulse {
    0%, 100% { background: rgba(80, 0, 120, 0.3); }
    50% { background: rgba(100, 0, 150, 0.4); }
}

#gameContainer.targeting-mode #crosshair .crosshair-line {
    background: rgba(255, 220, 0, 0.9);
}

#gameContainer.targeting-mode #crosshair .crosshair-dot {
    background: rgba(255, 220, 0, 1);
    box-shadow: 0 0 8px rgba(255, 220, 0, 0.8);
}
