/* Ported from the prototype. Cozy adventure, readable at a glance between focus sessions:
   forest-night ground, tomato accent, wheat support, Rubik throughout.
   Laptop: map left, actions and hero card right, chronicle below. Phone: one column. */
@font-face {
  font-family: Rubik;
  src: url(fonts/rubik-latin.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #16201a;
  --panel: #1f2b23;
  --line: #34463a;
  --ink: #eef2e6;
  --mute: #a7b6a5;
  --tom: #ff5b3a;
  --wheat: #f3c34f;
  --bad: #ff8a7a;
  --warn: #ffb199;
  --btn: #26352b;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 Rubik, system-ui, sans-serif; overflow-x: clip; }
button { font: inherit; color: inherit; }
a { color: var(--wheat); }
[hidden] { display: none !important; }
.defs { position: absolute; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 14px max(16px, 3vw) 48px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; letter-spacing: -.02em; font-weight: 700; display: flex; align-items: center; gap: 10px; }
h1 svg { width: 1.05em; height: 1.05em; flex: none; }
h1 a { display: flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; }
.hb { display: flex; gap: 8px; }
h2 { margin: 0; font-size: 24px; line-height: 1.1; letter-spacing: -.01em; font-weight: 700; }
h3 { margin: 16px 0 2px; font-size: 18px; font-weight: 500; }
.mute { color: var(--mute); }
.warn { color: var(--warn); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* Stats */
#res { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; background: var(--bg); }
.r { display: flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r b { font-weight: 500; }
.mb { display: inline-block; width: 40px; height: 6px; border-radius: 3px; background: #46302b; overflow: hidden; margin-left: 2px; }
.mb i { display: block; height: 100%; background: var(--tom); }
.mb.xp { background: #423b22; }
.mb.xp i { background: var(--wheat); }

/* Layout */
.game { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .game { grid-template-columns: minmax(0, 1fr); } }
#mapbox { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: #232c35; box-shadow: 0 0 0 1px var(--line); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }
.zoom { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(22, 32, 26, .88); }
#info { margin: 10px 2px 0; color: var(--mute); font-size: 15px; min-height: 3em; }
#info b { color: var(--ink); font-weight: 500; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.panel + .panel { margin-top: 16px; }
.ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.welcome { max-width: 560px; margin: 32px auto 0; }
.welcome h2 { margin-bottom: 8px; }

/* Buttons */
.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.act { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 84px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--btn); cursor: pointer; }
.act:not(:disabled):hover, .row:not(:disabled):hover, .btn:not(:disabled):hover { filter: brightness(1.12); }
.act:focus-visible, .btn:focus-visible, .row:focus-visible { outline: 3px solid var(--wheat); outline-offset: 2px; }
.act:disabled { opacity: .5; cursor: default; }
.ai { width: 38px; height: 38px; flex: none; }
.act b { display: block; font-size: 18px; font-weight: 500; }
.act small { display: block; color: var(--mute); font-size: 13px; line-height: 1.3; }
.btn { min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--btn); cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.pri { background: var(--tom); border-color: var(--tom); color: #fff; font-weight: 500; }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.btn.on { border-color: var(--wheat); color: var(--wheat); }
a.btn { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.center { justify-content: center; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 460px; overflow: auto; }
.row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--btn); cursor: pointer; min-height: 56px; }
.row:disabled { opacity: .5; cursor: default; }
.rn b { font-weight: 500; }
.rn small { display: block; color: var(--mute); font-size: 13px; line-height: 1.3; }
.rc { white-space: nowrap; font-size: 15px; font-variant-numeric: tabular-nums; }

/* Confirming a turn */
.conf p { margin: 6px 0; }
.odds { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.odds b { font-size: 20px; }
.odds .mb { width: 120px; height: 8px; border-radius: 4px; }
.odds.low b { color: var(--bad); }
.extra { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.extra p { margin: 0 0 6px; }

/* Hero card */
.eq { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.eq dt { color: var(--mute); }
.eq dd { margin: 0; }
.shop { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.shop li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.notes { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.note { width: 100%; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--btn); cursor: pointer; }
.note small { display: block; color: var(--mute); font-size: 13px; }

/* Timer */
.timer { position: relative; width: 200px; height: 200px; margin: 4px auto 10px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.trk { fill: none; stroke: #2f4136; stroke-width: 10; }
.prg { fill: none; stroke: var(--tom); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; transition: stroke-dashoffset .5s linear; }
.tt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.tt b { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.tt small { color: var(--mute); font-size: 13px; margin-top: 6px; }
.pl { text-align: center; margin: 0; }
.ready { text-align: center; padding: 6px 0; }
.ready p { margin: 8px 0 0; }
.ready .btn { width: 100%; margin-top: 14px; min-height: 56px; font-size: 18px; }
.win { margin: 14px 0 0; color: var(--wheat); }

/* Chronicle */
.log { margin-top: 20px; }
.log h2 { margin-bottom: 10px; }
.log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.log li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.log li:first-child { border-left-color: var(--tom); }
.log h3 { margin: 0 0 2px; font-size: 15px; font-weight: 500; color: var(--wheat); }
.log p { margin: 2px 0; font-size: 15px; }

/* Dialogs and messages */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(8, 12, 10, .72); display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; max-width: 540px; width: 100%; max-height: calc(100% - 16px); overflow: auto; }
.card p, .card li { margin: 8px 0; }
.card ul { padding-left: 20px; }
.card .sub { color: var(--wheat); margin-top: 2px; }
#toast { position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translateX(-50%); max-width: min(520px, calc(100% - 32px)); margin: 0; padding: 10px 16px; border-radius: 12px; background: #3a2420; border: 1px solid #7a3a2c; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
@media (prefers-reduced-motion: reduce) { .prg { transition: none; } }

/* Footer and the privacy page */
footer { margin-top: 40px; text-align: center; font-size: 15px; }
.doc { max-width: 720px; margin: 24px auto 0; }
.doc h2 { font-size: 32px; margin-bottom: 4px; }
.doc h3 { margin: 28px 0 6px; font-size: 20px; font-weight: 700; }
.doc p, .doc li { margin: 8px 0; }
.doc ul { padding-left: 20px; }
.doc code { font-size: .92em; color: var(--wheat); }
