:root {
  --ink: #fff8e6;
  --shadow: #1a1206;
  --gold: #ffd84a;
  --red: #ff5a4a;
  --sea: #2a9bb5;
  --panel: rgba(18, 24, 40, 0.88);
  --edge: #f4e2b0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1020; color: var(--ink); font-family: 'Galmuri11', 'Galmuri9', monospace; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.hidden { display: none !important; }
.txt { text-shadow: 2px 2px 0 var(--shadow); }

#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 2px 2px 0 var(--shadow); }
#top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; }
#phase { font-family: 'Galmuri11', monospace; font-size: 15px; letter-spacing: 2px; color: var(--gold); }
#timer { font-family: 'Galmuri14', 'Galmuri11', monospace; font-size: 34px; line-height: 1.1; }
#sub { font-size: 12px; opacity: 0.9; }

#roster { position: absolute; top: 12px; left: 12px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
#roster .r { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.35); padding: 3px 8px 3px 4px; }
#roster .r i { width: 10px; height: 10px; display: inline-block; border: 1px solid #000; }
#roster .r.dead { opacity: 0.45; text-decoration: line-through; }
#roster .r .w { opacity: 0.7; font-size: 11px; }

#cross { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%); }
#cross i { position: absolute; background: #fff; box-shadow: 1px 1px 0 #000; }
#cross i:nth-child(1) { left: 6px; top: 0; width: 2px; height: 14px; }
#cross i:nth-child(2) { top: 6px; left: 0; height: 2px; width: 14px; }
#cross.hit i { background: var(--red); }

#info { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); font-size: 12px; text-align: center; background: rgba(0,0,0,0.35); padding: 4px 10px; }
#info:empty { display: none; }
#info .bad { color: var(--red); }
#info .ok { color: #9dff8a; }
#hint { position: absolute; left: 50%; top: calc(50% + 22px); transform: translateX(-50%); font-size: 12px; color: var(--red); }

#hotbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.slot { width: 76px; height: 60px; background: rgba(10, 14, 26, 0.72); border: 2px solid rgba(255,255,255,0.25); padding: 3px 4px; font-size: 11px; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.slot.on { border-color: var(--gold); background: rgba(60, 50, 10, 0.75); }
.slot .k { position: absolute; top: 2px; right: 4px; color: var(--gold); font-size: 10px; }
.slot .sw { width: 16px; height: 16px; border: 1px solid #000; }
.slot .n { line-height: 1.1; }
.slot .p { color: var(--gold); }
.slot.off { opacity: 0.4; }

#stats { position: absolute; right: 16px; bottom: 16px; text-align: right; }
#money { font-family: 'Galmuri14', monospace; font-size: 26px; color: var(--gold); }
#ammo { font-family: 'Galmuri14', monospace; font-size: 26px; }
#ammo small { font-size: 13px; opacity: 0.8; }
#ammo .bar { width: 160px; height: 6px; background: rgba(0,0,0,0.5); margin-left: auto; margin-top: 2px; }
#ammo .bar b { display: block; height: 100%; background: #fff; }

#drown { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); text-align: center; font-size: 13px; color: #9be7ff; }
#drown .bar { width: 220px; height: 8px; background: rgba(0,0,0,0.55); margin: 4px auto 0; border: 1px solid #000; }
#drown .bar b { display: block; height: 100%; background: #6fd3ff; }
#drown .bar.hp b { background: var(--red); }

#feed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; font-size: 12px; }
#feed div { background: rgba(0,0,0,0.4); padding: 3px 8px; }
#toasts { position: absolute; top: 62%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
#toasts div { background: rgba(120, 20, 10, 0.75); padding: 4px 10px; }
#center { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-family: 'Galmuri14', monospace; font-size: 34px; color: var(--gold); white-space: nowrap; }
#center small { display: block; font-family: 'Galmuri11', monospace; font-size: 14px; color: var(--ink); margin-top: 6px; }
#keys { position: absolute; left: 12px; bottom: 14px; font-size: 11px; opacity: 0.85; line-height: 1.55; }
#keys b { display: inline-block; min-width: 18px; padding: 0 3px; text-align: center; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35); margin-right: 3px; }

.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--panel); border: 3px solid var(--edge); box-shadow: 6px 6px 0 rgba(0,0,0,0.6); padding: 22px 26px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
#lobby h1 { margin: 0; font-family: 'Galmuri14', monospace; font-size: 46px; letter-spacing: 2px; color: var(--gold); text-shadow: 4px 4px 0 #b0452f, 7px 7px 0 #1a1206; line-height: 1; }
#lobby h1 span { color: #6fd3ff; margin-left: 10px; text-shadow: 4px 4px 0 #1d4f7a, 7px 7px 0 #1a1206; }
#lobby .tag { margin: 10px 0 18px; font-size: 13px; opacity: 0.9; }
#joinbox { display: flex; gap: 8px; }
input, button { font-family: inherit; font-size: 15px; }
#name { flex: 1; padding: 10px 12px; background: #0b1020; color: var(--ink); border: 2px solid var(--edge); outline: none; min-width: 0; }
button { padding: 10px 16px; background: var(--gold); color: #1a1206; border: 0; box-shadow: 3px 3px 0 #7a5a10; cursor: pointer; }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #7a5a10; }
button:disabled { background: #666; box-shadow: none; cursor: default; }
#waitbox { margin-top: 4px; }
#lobbyState { color: #9be7ff; font-size: 14px; }
#lobbyList { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
#lobbyList li { padding: 4px 8px; background: rgba(255,255,255,0.08); font-size: 13px; display: flex; gap: 6px; align-items: center; }
#lobbyList li i { width: 10px; height: 10px; display: inline-block; border: 1px solid #000; }
.rules { margin-top: 18px; font-size: 12px; display: grid; gap: 6px; opacity: 0.92; }
.rules b { display: inline-block; width: 18px; height: 18px; text-align: center; background: var(--gold); color: #1a1206; margin-right: 6px; }

#shop h2 { margin: 0 0 6px; font-size: 22px; color: var(--gold); }
#shop h2 small { font-size: 12px; color: var(--ink); opacity: 0.7; margin-left: 8px; }
#shop h3 { margin: 12px 0 6px; font-size: 14px; color: #9be7ff; }
#shopMoney { font-size: 20px; color: var(--gold); }
#shop .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { #shop .cols { grid-template-columns: 1fr; } }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 8px; background: rgba(255,255,255,0.06); margin-bottom: 5px; font-size: 12px; }
.item .nm { font-size: 13px; }
.item .st { opacity: 0.75; font-size: 11px; grid-column: 1; }
.item .bt { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 4px; align-items: center; }
.item button { padding: 5px 8px; font-size: 12px; box-shadow: 2px 2px 0 #7a5a10; }
.item button.sell { background: #c9c2b0; box-shadow: 2px 2px 0 #555; }
.item.own { outline: 2px solid #9dff8a; }
#shop .note { font-size: 11px; opacity: 0.7; margin: 10px 0 0; }

#clickToPlay { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 8px 14px; background: rgba(0,0,0,0.6); border: 2px solid var(--edge); font-size: 14px; pointer-events: none; }
