:root {
  color-scheme: dark;
  --ink: #141e1a;
  --paper: #eef0db;
  --muted: #aab8a5;
  --gold: #e6c680;
  --line: #84977a55;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--paper); background: #101916; }
button { cursor: pointer; color: inherit; font: inherit; }
button:focus-visible { outline: 2px solid #f7dc9b; outline-offset: 3px; }
button:disabled { opacity: .47; cursor: default; }
#game { position: relative; isolation: isolate; height: 100vh; height: 100dvh; overflow: hidden; }
#world, .title-screen, .overlay, #hud { position: absolute; inset: 0; width: 100%; height: 100%; }
#world { display: block; touch-action: none; }
#wake-veil { position: absolute; inset: 0; background: #090b08; opacity: 0; pointer-events: none; }
.title-screen { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(24px, 6vw, 108px); padding-block: clamp(22px, 6vh, 80px); background: linear-gradient(90deg, #0b1613fb, #0c1714e8 27%, #0b171483 60%, #101a1429); }
.title-screen header { display: flex; align-items: center; gap: 12px; color: #d6ddc2; font-size: 12px; text-transform: uppercase; letter-spacing: .16em; }
.title-screen header i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 15px #d7a958; }
.title-copy { max-width: 630px; }
h1 { font: normal clamp(72px, 11vw, 176px)/.78 Georgia, serif; letter-spacing: -.085em; margin: 0 0 clamp(24px, 4vh, 48px); }
.title-copy p { margin: 0 0 23px; max-width: 38ch; font-size: clamp(15px, 2vw, 20px); line-height: 1.5; color: #cfdbc3; }
.title-screen footer { width: fit-content; border-top: 1px solid var(--line); padding-top: 12px; color: #b6c2ab; font-size: 13px; }
.primary { border: 1px solid #edce93; padding: 11px 18px; color: #211d13; background: var(--gold); font-weight: 750; }
.primary:hover { background: #f2d69f; }
.quiet { margin-left: 7px; }
.quiet, #hud button, .panel button:not(.primary) { padding: 8px 11px; background: #131e1ae8; border: 1px solid var(--line); }
.quiet:hover, #hud button:hover, .panel button:not(.primary):hover { background: #2e3c2c; }
#hud { pointer-events: none; }
#hud button { pointer-events: auto; }
.status { position: absolute; top: 14px; left: 14px; padding: 10px 13px 12px; width: clamp(164px, 20vw, 218px); background: #131d18ed; border: 1px solid var(--line); }
.time { display: flex; justify-content: space-between; color: var(--gold); font-size: 13px; }
#place { margin: 4px 0 10px; font: 20px Georgia, serif; }
.gauge { display: grid; grid-template-columns: 48px 1fr 24px; align-items: center; gap: 5px; font-size: 10px; margin-top: 5px; color: #c7d1bc; }
.gauge meter { appearance: none; width: 100%; height: 6px; background: #26342c; border: 0; }
.gauge meter::-webkit-meter-bar { border: 0; border-radius: 0; background: #26342c; }
.gauge meter::-webkit-meter-optimum-value { background: var(--fill); }
.gauge meter::-moz-meter-bar { background: var(--fill); }
.gauge output { text-align: right; font-variant-numeric: tabular-nums; }
.tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 5px; }
kbd { font: 600 .75em system-ui, sans-serif; color: #d2bb85; }
#objective { position: absolute; top: 63px; right: 14px; text-align: right; max-width: 31ch; padding: 6px 0 6px 10px; color: #f4efcf; text-shadow: 0 2px 3px #000, 0 0 10px #000; font-size: 13px; }
#notification { position: absolute; bottom: 108px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 30px); width: max-content; text-align: center; padding: 7px 13px; color: #f2e3b7; background: #111b16ed; border-bottom: 1px solid #b8a77770; font-size: 13px; }
#notification:empty { display: none; }
#interaction { position: absolute; bottom: 63px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); border-color: #baaa74 !important; }
#belt { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 5px; width: max-content; }
#crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 4px; height: 4px; border-radius: 50%; background: #eee7ceba; box-shadow: 0 0 3px #000; }
.overlay { display: grid; place-items: center; padding: 13px; background: #09120dc9; }
.panel { width: min(660px, 100%); max-height: min(90vh, 760px); overflow: auto; background: #18231c; border: 1px solid #aab18a77; box-shadow: 0 16px 90px #000a; padding: clamp(16px, 4vw, 29px); }
.panel header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 13px; margin-bottom: 14px; }
.panel h2 { margin: 2px 0 0; font: 36px/.95 Georgia, serif; }
#panel-kicker { font-size: 12px; color: var(--gold); }
.panel h3 { font: 21px Georgia, serif; margin: 16px 0 5px; }
.panel p { color: #cbd3be; line-height: 1.5; margin: 6px 0 12px; }
.panel small { color: var(--muted); }
.panel .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.panel .row small { display: block; margin-top: 2px; }
.panel .row button { flex-shrink: 0; max-width: 48%; }
.panel .story { border-left: 2px solid var(--gold); padding-left: 10px; }
.inventory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 18px; }
.inventory span { border: 1px solid var(--line); padding: 6px 8px; font-size: 13px; }
#county-map { display: block; width: min(100%, 470px); height: auto; margin: 0 auto 8px; border: 1px solid var(--line); }
#touch { position: absolute; bottom: max(13px, env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: repeat(3, 43px); gap: 3px; }
#touch button { height: 42px; padding: 0; touch-action: none; }
#touch button:first-child { grid-column: 2; }
#touch button:nth-child(2) { grid-column: 1; }
@media (max-width: 560px) {
  .tools { right: 8px; top: 8px; gap: 3px; }
  .tools kbd, #belt kbd { display: none; }
  #hud button { padding: 6px 8px; font-size: 12px; }
  .status { top: 8px; left: 8px; }
  #objective { top: 48px; right: 8px; max-width: 24ch; font-size: 12px; }
  .title-screen p { max-width: 32ch; }
  .inventory { grid-template-columns: repeat(2, 1fr); }
  #interaction { bottom: 112px; }
  #notification { bottom: 153px; }
}
@media (pointer: coarse) {
  #belt { bottom: max(12px, env(safe-area-inset-bottom)); left: auto; right: 7px; transform: none; display: grid; grid-template-columns: 1fr 1fr; }
  #belt button { min-height: 40px; }
  #interaction { bottom: 155px; }
  #notification { bottom: 193px; }
}
@media (max-height: 460px) {
  .title-screen { padding-block: 9px; }
  h1 { font-size: 56px; margin-bottom: 9px; }
  .title-copy p { margin-bottom: 10px; }
  .title-screen footer { padding-top: 4px; }
}
