:root {
    --neon-blue: #00f0ff;
    --neon-pink: #ff007f;
    --neon-green: #39ff14;
    --neon-red: #ff2222;
    --neon-orange: #ff8c00;
    --glass-bg: rgba(12, 18, 35, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    background: #000;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
#game-container canvas { display: block; width: 100%; height: 100%; }

/* Crosshair */
.crosshair {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    display: none;
}
.crosshair.active { display: block; }
.ch-h {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 24px; height: 2px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}
.ch-v {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 2px; height: 24px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}
.ch-dot {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--neon-pink);
    box-shadow: 0 0 6px var(--neon-pink);
}

/* HUD */
.hud {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 30px;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.hud-left { display: flex; flex-direction: column; gap: 8px; }

.hp-section { display: flex; align-items: center; gap: 10px; }

.hp-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #94a3b8;
    min-width: 55px;
}

.hp-bar-bg {
    width: 220px; height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.hp-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.player-hp {
    width: 100%;
    background: linear-gradient(90deg, var(--neon-green), #66ff66);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.hp-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #fff;
    min-width: 60px;
}

.hud-stats {
    display: flex; gap: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: #64748b;
}

.hud-right {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: #94a3b8;
}

/* Boss Bar */
.boss-bar-container {
    position: fixed;
    top: 20px; left: 50%;
    transform: translateX(-50%);
    width: 380px;
    z-index: 10;
    text-align: center;
    display: none;
    animation: bossIn 0.5s ease-out;
}

@keyframes bossIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.boss-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(255, 34, 34, 0.6);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 6px;
}

.boss-bar-container .boss-bar-bg {
    width: 100%; height: 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(255, 34, 34, 0.3);
    overflow: hidden;
}

.boss-bar-fill {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, var(--neon-red), var(--neon-orange), var(--neon-red));
    background-size: 200% 100%;
    animation: bossBarPulse 2s ease-in-out infinite;
    border-radius: 10px;
    transition: width 0.25s ease;
    box-shadow: 0 0 10px rgba(255, 34, 34, 0.4);
}

@keyframes bossBarPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 8, 18, 0.8);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.overlay.active { opacity: 1; pointer-events: auto; }

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px;
    width: 90%; max-width: 460px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.06);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.overlay.active .glass-panel { transform: translateY(0) scale(1); }

.game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 24px;
    line-height: 1.5;
    color: #fff;
    margin-bottom: 4px;
}
.t1 { color: var(--neon-blue); text-shadow: 0 0 12px rgba(0,240,255,0.5); }
.t2 { color: var(--neon-pink); text-shadow: 0 0 12px rgba(255,0,127,0.5); }
.t3 { color: var(--neon-orange); text-shadow: 0 0 15px rgba(255,140,0,0.6); font-size: 36px; }

.game-subtitle {
    font-size: 11px; font-weight: 300;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 22px;
}

.btn-play {
    background: linear-gradient(135deg, var(--neon-pink), #c0005f);
    border: none; border-radius: 50px;
    color: #fff; padding: 14px 38px;
    font-size: 13px; font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 2px; cursor: pointer;
    box-shadow: 0 8px 25px rgba(255,0,127,0.3);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative; overflow: hidden;
}
.btn-play span { position: relative; z-index: 2; }
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,0,127,0.55); }

.controls-guide {
    background: rgba(0,0,0,0.3);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.03);
}
.controls-guide h3 {
    font-size: 8px;
    font-family: 'Press Start 2P', monospace;
    color: #475569;
    margin-bottom: 10px;
    text-align: center;
}
.control-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px; color: #94a3b8;
}
.control-row:last-child { margin-bottom: 0; }
.control-row .key {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-bottom: 3px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    padding: 3px 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px; color: #fff;
}

.audio-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #94a3b8;
    padding: 7px 16px; border-radius: 30px;
    font-size: 11px; cursor: pointer;
    transition: all 0.2s ease;
}
.audio-toggle:hover { border-color: var(--neon-blue); color: #fff; }

/* State panels */
.glass-panel.danger .state-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px; color: var(--neon-pink);
    text-shadow: 0 0 12px rgba(255,0,127,0.5);
    margin-bottom: 16px;
}
.state-msg { color: #94a3b8; font-size: 13px; margin-bottom: 20px; }

.glass-panel.success .state-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px; color: var(--neon-green);
    text-shadow: 0 0 12px rgba(57,255,20,0.5);
    margin-bottom: 16px;
}
.glass-panel.success .btn-play { background: linear-gradient(135deg, var(--neon-green), #1a9f0a); color: #000; }

/* Hit flash */
.hit-flash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 0, 0, 0.3);
    z-index: 9;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}
.hit-flash.active { opacity: 1; }
