:root {
  --bg: rgba(17, 19, 14, .93);
  --line: #55543e;
  --text: #d9d0ae;
  --dim: #8f8a6e;
  --red: #b8281f;
  --gold: #d8b040;
  --head: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  --mono: Consolas, "Lucida Console", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c0d0a; color: var(--text); font: 13px/1.35 var(--mono); user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; cursor: crosshair; }
[hidden] { display: none !important; }
.panel { background: var(--bg); border: 1px solid var(--line); box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0, 0, 0, .6); }
button { font: 14px var(--head); letter-spacing: 1.5px; color: var(--text); background: #2a2b20; border: 1px solid var(--line); padding: 7px 14px; cursor: pointer; }
button:hover:not(:disabled) { background: #3d3e2c; color: #fff; border-color: #8a8862; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button.pri { background: #6a1b16; border-color: #a0352c; }
button.pri:hover:not(:disabled) { background: #8a231c; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
h1, h2, h3 { font-family: var(--head); font-weight: normal; letter-spacing: 2px; margin: 0; }
.red { color: var(--red); }

/* HUD */
#hud > * { position: fixed; }
#stats { left: 12px; top: 12px; width: 210px; padding: 8px 10px; }
.bar { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.bar label { width: 44px; font: 11px var(--head); letter-spacing: 1px; color: var(--dim); }
.bar > div { flex: 1; height: 9px; background: #000; border: 1px solid #3a3a2c; }
.bar i { display: block; height: 100%; width: 100%; transition: width .2s; }
.hp { background: linear-gradient(#d83a2e, #8a1a14); } .st { background: linear-gradient(#e0c050, #8a7420); }
.hu { background: linear-gradient(#d88a3a, #8a4a1a); } .th { background: linear-gradient(#5aa8d8, #2a5a8a); }
#tags { min-height: 0; } #tags span { display: inline-block; font: 10px var(--head); letter-spacing: 1px; background: var(--red); color: #fff; padding: 1px 6px; margin: 2px 4px 2px 0; }
#kills { font: 13px var(--head); letter-spacing: 1.5px; margin-top: 4px; } #kills b { color: var(--red); font-weight: normal; }
#topright { right: 12px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#clock { padding: 4px 10px; font: 14px var(--head); letter-spacing: 1.5px; } #clock span { color: var(--dim); }
#minimap { width: 150px; height: 150px; border-radius: 50%; border: 2px solid var(--line); box-shadow: 0 0 0 1px #000, 0 4px 12px rgba(0, 0, 0, .6); image-rendering: pixelated; }
#msgs { left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
#msgs div { background: rgba(10, 11, 8, .82); border-left: 3px solid var(--dim); padding: 3px 12px; animation: msg 4s forwards; white-space: nowrap; }
#msgs .good { border-color: #7aa84a; } #msgs .bad { border-color: var(--red); color: #ffb0a8; }
@keyframes msg { 0% { opacity: 0; transform: translateY(-6px); } 6%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#prompt { left: 50%; bottom: 120px; transform: translateX(-50%); background: rgba(10, 11, 8, .88); border: 1px solid var(--line); padding: 5px 14px; font: 14px var(--head); letter-spacing: 1px; white-space: nowrap; }
#prompt kbd { font: 12px var(--mono); background: var(--text); color: #111; padding: 0 6px; margin-right: 7px; border-radius: 2px; }
#prompt span { margin-left: 16px; color: var(--dim); }
#hotbar { right: 14px; bottom: 14px; display: flex; gap: 8px; }
.hot { position: relative; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(#2c2d22, #121310); border: 2px solid #4a4a38; display: grid; place-items: center; cursor: pointer; }
.hot.sel { border-color: var(--gold); box-shadow: 0 0 10px rgba(216, 176, 64, .5); }
.hot img { width: 40px; height: 40px; image-rendering: pixelated; }
.hot kbd { position: absolute; left: 2px; top: -2px; font: 11px var(--head); color: var(--dim); }
.hot small { position: absolute; right: 0; bottom: -3px; font: 11px var(--mono); background: #000; padding: 0 3px; }
#weapon { right: 16px; bottom: 80px; text-align: right; text-shadow: 0 1px 2px #000; }
#wName { font: 16px var(--head); letter-spacing: 1.5px; } #wAmmo { font: 20px var(--head); color: var(--gold); letter-spacing: 1px; }
#hint { left: 12px; bottom: 10px; font-size: 11px; color: rgba(217, 208, 174, .55); text-shadow: 0 1px 2px #000; max-width: 60vw; }

/* overlays */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; }
.menu { background: radial-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .8)); }
#menu { grid-template-rows: 42% auto; align-items: end; }
#menu .menubox { align-self: start; margin-top: 24px; }
.title { text-align: center; }
.title h1 { font-size: clamp(56px, 11vw, 140px); line-height: .9; color: #c9c1a0; text-shadow: 0 0 2px #000, 4px 4px 0 var(--red), 0 0 40px rgba(184, 40, 31, .5); letter-spacing: 8px; }
.title p { font: 16px var(--head); letter-spacing: 8px; color: var(--red); margin: 10px 0 0; text-shadow: 0 1px 3px #000; }
.menubox { display: flex; flex-direction: column; gap: 8px; padding: 18px 22px; min-width: 280px; }
.menubox h2 { text-align: center; font-size: 28px; margin-bottom: 6px; }
.menubox button { font-size: 17px; padding: 10px; }
.window { width: min(860px, 96vw); max-height: 88vh; display: flex; flex-direction: column; }
.window.small { width: min(480px, 94vw); }
.window header { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 8px; background: #1e1f17; }
.window header span { flex: 1; font: 15px var(--head); letter-spacing: 2px; }
#tabs button.on { background: #6a1b16; border-color: #a0352c; color: #fff; }
.x { padding: 3px 9px; }
#winBody, #dlgBody { padding: 10px; overflow: auto; }
.cols { display: grid; grid-template-columns: 1fr 250px; gap: 10px; } .cols.two { grid-template-columns: 1fr 1fr; }
.cols h3 { font-size: 13px; color: var(--dim); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.cols h3 button { font-size: 11px; padding: 2px 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 60px); gap: 5px; align-content: start; min-height: 130px; }
.cell { position: relative; width: 60px; height: 60px; background: #1c1d16; border: 1px solid #3a3a2c; display: grid; place-items: center; cursor: pointer; }
.cell:hover { border-color: #8a8862; background: #26271c; } .cell.sel { border-color: var(--gold); }
.cell img { width: 40px; height: 40px; image-rendering: pixelated; pointer-events: none; }
.cell small { position: absolute; right: 2px; bottom: 0; font-size: 11px; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.cell em { position: absolute; left: 2px; top: 0; font: 10px var(--head); color: var(--gold); font-style: normal; }
.detail { border: 1px solid #3a3a2c; padding: 8px; background: #16170f; min-height: 200px; }
.detail h3 { color: var(--text); font-size: 17px; display: block; } .detail p { margin: 4px 0; color: var(--dim); } .detail .st { background: none; color: var(--text); }
.detail .acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; } .detail .acts button { font-size: 12px; padding: 4px 8px; }
.empty { color: var(--dim); padding: 14px; text-align: center; grid-column: 1 / -1; }
.foot { margin-top: 8px; color: var(--dim); display: flex; justify-content: space-between; }
.rec { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-bottom: 1px solid #2a2a20; }
.rec img { width: 40px; height: 40px; image-rendering: pixelated; } .rec .tx { flex: 1; } .rec b { font: 14px var(--head); letter-spacing: 1px; font-weight: normal; }
.rec .need span { margin-right: 10px; color: #7aa84a; } .rec .need span.no { color: #d0655c; }
.rec.off { opacity: .55; }
.slot { display: flex; align-items: center; gap: 10px; padding: 7px; border: 1px solid #3a3a2c; margin-bottom: 6px; background: #16170f; } .slot .tx { flex: 1; } .slot b { font: 14px var(--head); letter-spacing: 1px; font-weight: normal; }
.opt { display: grid; grid-template-columns: 150px 1fr 50px; align-items: center; gap: 10px; margin-bottom: 9px; } .opt label { font: 13px var(--head); letter-spacing: 1px; }
.opt input[type=range] { width: 100%; accent-color: var(--red); } .opt select, .field input { font: 13px var(--mono); background: #1c1d16; color: var(--text); border: 1px solid var(--line); padding: 5px; width: 100%; }
.field { margin-bottom: 10px; } .field label { display: block; font: 12px var(--head); letter-spacing: 1px; color: var(--dim); margin-bottom: 3px; }
.help td { padding: 2px 10px 2px 0; vertical-align: top; } .help td:first-child { color: var(--gold); white-space: nowrap; } .help p { color: var(--dim); }
#overStats { text-align: center; margin: 4px 0 10px; color: var(--dim); } #overStats b { color: var(--text); }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .8s; } #fade.on { opacity: 1; }
@media (max-width: 720px) { .cols, .cols.two { grid-template-columns: 1fr; } #hint { display: none; } }
/* dialogs (new game, save/load, options, help) always sit above the menus that open them */
#dialog { z-index: 20; background: rgba(0, 0, 0, .55); }
#fade { z-index: 30; }
a { color: var(--gold); } a:hover { color: #fff; }
#credit { position: fixed; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 12px; color: var(--dim); text-shadow: 0 1px 2px #000; }
.about { text-align: center; } .about h2 { font-size: 34px; color: #c9c1a0; text-shadow: 2px 2px 0 var(--red); letter-spacing: 5px; }
.about h3 { font-size: 12px; color: var(--dim); margin-top: 16px; } .about p { margin: 8px 0; color: var(--text); }
.about .dev { font: 24px var(--head); letter-spacing: 3px; margin: 2px 0; } .about .ver { color: var(--dim); font-size: 12px; }
/* co-op */
#party { left: 12px; top: 150px; width: 210px; display: flex; flex-direction: column; gap: 4px; }
.mate { background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; font-size: 12px; } .mate.dead { opacity: .55; }
.mate > div { height: 5px; background: #000; margin-top: 2px; } .mate i { display: block; height: 100%; background: #6aa84a; }
#roomInfo { text-align: center; color: var(--dim); font-size: 12px; margin-bottom: 4px; } #roomInfo b { color: var(--text); }
.mp h3 { font-size: 13px; color: var(--dim); margin: 12px 0 6px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #2a2a20; padding-top: 10px; }
.mp h3 button { font-size: 11px; padding: 2px 8px; } .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .field select { font: 13px var(--mono); background: #1c1d16; color: var(--text); border: 1px solid var(--line); padding: 5px; width: 100%; }
.dimtx { color: var(--dim); margin: 6px 0; } .dimtx b { color: var(--text); }
