:root {
  --bg: #0c0a08;
  --surface: #1a1410;
  --elevated: #261e18;
  --fg: #e8e0d0;
  --muted: #8a7a6a;
  --accent: #d4a574;
  --accent-fg: #1a1410;
  --danger: #c45b4a;
  --border: #5a4a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: Tahoma, "Segoe UI", system-ui, sans-serif; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
button { font: inherit; color: inherit; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; margin: 0; }
h1 { font-size: 2.4rem; color: var(--accent); letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; }
#boot, #over, #inv, #pause { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: color-mix(in srgb, var(--bg) 75%, transparent); }
#boot { z-index: 30; }
#boot[hidden], #over[hidden], #inv[hidden], #pause[hidden], #play[hidden], #talk[hidden], #lock[hidden], #touch[hidden], #cont-btn[hidden], #ammo[hidden], #shop[hidden], #shop-hint[hidden], #shop-btn[hidden] { display: none !important; }
.card { width: 100%; max-width: 28rem; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 24px; text-align: center; }
.kicker { margin: 0; font-size: 12px; letter-spacing: 0.28em; color: var(--muted); font-weight: 600; }
.lead { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.hint { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.hint.r { text-align: right; }
.card button { display: block; width: 100%; height: 48px; margin-top: 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.card button.ghost { margin-top: 8px; background: var(--elevated); color: var(--fg); border: 1px solid var(--border); }
.card button.text { width: auto; height: auto; margin: 0; background: none; color: var(--muted); font-weight: 400; }
#bar-prog-wrap { position: absolute; left: 32px; right: 32px; top: 8px; height: 4px; background: var(--elevated); border-radius: 99px; overflow: hidden; pointer-events: none; }
#bar-prog { height: 100%; width: 0; background: var(--accent); }
#district { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); pointer-events: none; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 4px 12px; font-size: 12px; letter-spacing: 0.04em; color: var(--accent); border-radius: 4px; }
.panel { position: absolute; top: 40px; pointer-events: none; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent); border-radius: 8px; padding: 12px; font-size: 13px; }
.panel.left { left: 12px; width: 192px; }
.panel.right { right: 12px; text-align: right; min-width: 160px; }
.row { display: flex; align-items: center; gap: 8px; }
.row + .row { margin-top: 8px; }
.row.between { justify-content: space-between; text-align: left; }
.lab { width: 18px; font-size: 11px; }
.lab.hp { color: var(--danger); }
.lab.ar { color: var(--accent); }
.bar { flex: 1; height: 8px; background: var(--elevated); border-radius: 2px; overflow: hidden; }
.bar.thin { height: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--danger); }
#bar-armor { background: var(--accent); }
#bar-st { background: color-mix(in srgb, var(--fg) 70%, transparent); }
#hp-n { width: 32px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.acc { color: var(--accent); margin-top: 8px; }
#wname { font-size: 14px; font-weight: 600; }
#cross { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; transform: translate(-50%, -50%); pointer-events: none; }
#cross::before, #cross::after { content: ""; position: absolute; background: color-mix(in srgb, var(--fg) 70%, transparent); }
#cross::before { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
#cross::after { top: 50%; left: 0; height: 1px; width: 100%; transform: translateY(-50%); }
#cross.hit::before, #cross.hit::after { background: var(--danger); }
#hurt { position: absolute; inset: 0; pointer-events: none; background: var(--danger); opacity: 0; }
#hotbar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 4px; pointer-events: none; }
.slot { min-width: 64px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); padding: 4px 8px; font-size: 12px; text-align: center; border-radius: 4px; }
.slot.on { border-color: var(--accent); background: var(--elevated); color: var(--fg); }
.slot.off { opacity: 0.4; }
.icon { position: absolute; right: 12px; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 10px; z-index: 20; }
#mute { top: 160px; }
#pause-btn { top: 212px; }
#flash-btn { top: 264px; color: var(--muted); }
#flash-btn.on { color: var(--accent); }
#lock { position: absolute; inset: 0; z-index: 20; border: 0; background: color-mix(in srgb, var(--bg) 50%, transparent); display: flex; align-items: center; justify-content: center; }
#lock span { border: 1px solid var(--border); background: var(--surface); padding: 12px 20px; border-radius: 8px; }
#talk { position: absolute; left: 16px; right: 16px; bottom: 32px; z-index: 30; max-width: 36rem; margin: 0 auto; display: block; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 16px; }
#talk-name { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
#talk-text { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
#inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 16px; }
#inv-grid button { aspect-ratio: 1; margin: 0; height: auto; background: var(--elevated); border: 1px solid var(--border); color: var(--fg); font-size: 12px; font-weight: 400; padding: 4px; }
#pause .card, #inv .card { text-align: left; }
#pause input { width: 100%; margin-top: 8px; accent-color: var(--accent); }
#touch { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
#stick { pointer-events: auto; position: absolute; left: 16px; bottom: 96px; width: 110px; height: 110px; border-radius: 99px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 40%, transparent); }
#lookpad { pointer-events: auto; position: absolute; right: 16px; top: 25%; width: 128px; height: 160px; }
#acts { pointer-events: auto; position: absolute; right: 16px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; }
#acts button { width: 96px; height: 48px; border: 0; border-radius: 8px; background: var(--elevated); font-size: 12px; }
#fire { background: var(--fg); color: var(--bg); font-weight: 600; }
#shop-hint { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); pointer-events: none; border: 1px solid var(--border); background: var(--surface); padding: 8px 16px; border-radius: 8px; z-index: 20; }
#shop { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: color-mix(in srgb, var(--bg) 75%, transparent); }
#shop-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
#shop-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin: 0; height: auto; padding: 10px 12px; background: var(--elevated); color: var(--fg); border: 1px solid var(--border); font-weight: 400; text-align: left; }
#shop-list button:disabled { opacity: 0.4; }
#shop-list small { display: block; color: var(--muted); font-size: 12px; }
#over-title.win { color: var(--accent); }
#over-title.lose { color: var(--danger); }
