* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; color: #eee; font-family: Georgia, 'Times New Roman', serif; overflow: hidden; }
#game { display: block; width: 100vw; height: 100vh; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 0 4px #000; }
#objective { position: absolute; top: 16px; left: 16px; font-size: 18px; text-shadow: 0 0 6px #000; max-width: 40vw; }
#timer { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 40px; font-weight: bold; color: #ff4d4d; text-shadow: 0 0 10px #000; }
#prompt { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); font-size: 20px; background: rgba(0,0,0,.55); padding: 6px 14px; border-radius: 4px; }
#prompt:empty { display: none; }
#subtitle { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); font-size: 26px; font-style: italic; color: #f2d7d5; text-shadow: 0 0 12px #600; text-align: center; width: 80vw; }
#stance { position: absolute; bottom: 100px; right: 16px; font-size: 16px; letter-spacing: 2px; color: #ffd166; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 4px; }
#stance:empty { display: none; }
#controls-help { position: absolute; top: 16px; right: 16px; font-size: 15px; line-height: 1.5; background: rgba(0,0,0,.45); padding: 10px 14px; border-radius: 6px; white-space: pre; }
#controls-help:empty { display: none; }

#inventory { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.slot { width: 64px; height: 64px; border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.5); border-radius: 6px; position: relative; font-size: 11px; text-align: center; display: flex; align-items: center; justify-content: center; padding: 4px; }
.slot b { position: absolute; top: 2px; left: 5px; font-size: 12px; color: #aaa; }
.slot.selected { border-color: #ffd166; box-shadow: 0 0 10px #ffd166; }
.slot .swatch { width: 14px; height: 14px; border-radius: 50%; position: absolute; bottom: 4px; right: 4px; }

#bars { position: absolute; bottom: 100px; left: 16px; width: 260px; }
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.bar span { width: 50px; }
.bar div { flex: 1; height: 14px; background: rgba(255,255,255,.15); border: 1px solid #555; }
.bar i { display: block; height: 100%; background: #e74c3c; width: 100%; transition: width .15s; }
#hp-player { background: #2ecc71; }
#ammo { font-size: 13px; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.75); z-index: 10; }
.panel { background: #111; border: 1px solid #333; padding: 32px 40px; border-radius: 8px; text-align: center; max-width: 640px; }
.panel h1 { font-size: 72px; line-height: 1; color: #b71c1c; letter-spacing: 4px; text-shadow: 0 0 30px #f00; margin-bottom: 24px; }
.panel h2 { margin-bottom: 12px; }
.panel p { margin: 10px 0; line-height: 1.5; }
.dim { color: #888; font-size: 14px; }
button { font: inherit; font-size: 22px; padding: 10px 40px; background: #b71c1c; color: #fff; border: 0; border-radius: 4px; cursor: pointer; margin-top: 12px; }
button:hover { background: #e53935; }
#picker-slots { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
#picker-slots .slot { cursor: pointer; pointer-events: auto; }
#picker-slots .slot:hover { border-color: #fff; }

#intro { background: #000; }
#intro-canvas { max-width: 100vw; max-height: 100vh; }
#fade { position: fixed; inset: 0; background: #000; opacity: 1; pointer-events: none; transition: opacity 1.5s ease; z-index: 20; }
#message, #slot-picker { z-index: 30; }
#fade.show { opacity: 1; }
#fade.clear { opacity: 0; }
