/* ZEKE! pilot: one dark look (UI.md lets games commit to one). Placeholder, not art direction. */
:root {
  --bg: #121416;
  --panel: #1c1f22;
  --line: #33383d;
  --text: #e8e8e6;
  --muted: #a9adb1;
  --accent: #e0a458;
  --bad: #ff7b72;
  --focus: #ffd166;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 18px; margin: 0; flex: 1; line-height: 0; }
.wordmark { height: 40px; width: auto; }
.subtitle { font-size: 12px; font-weight: 400; color: var(--muted); }
.version, .seed { font: 12px ui-monospace, monospace; color: var(--muted); }

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.stat { display: flex; gap: 6px; align-items: baseline; }
.stat-icon { width: 18px; height: 18px; align-self: center; image-rendering: auto; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-weight: 700; font-variant-numeric: tabular-nums; }

.layout {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: flex-start;
}
.board-wrap { flex: 0 1 768px; min-width: 0; position: relative; }
canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.side { flex: 1 1 300px; min-width: 0; max-width: 420px; }

.message { min-height: 1.4em; margin: 0 0 8px; color: var(--accent); }
.message.is-bad { color: var(--bad); }

.panel h2 { font-size: 17px; margin: 0 0 4px; }
.panel h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.hint.party { margin-top: 6px; color: var(--text); }
.hint.warn { margin-top: 6px; color: var(--bad); font-weight: 600; }

.actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.grid-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.trip-row { display: grid; grid-template-columns: 1fr 108px; gap: 6px; }
/* A trip you choose someone for: the place on one line, then a button per person. */
.trip-who { grid-template-columns: 1fr; gap: 4px; }
.trip-head { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 2px; }
.trip-both { justify-content: center; }

.btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.btn-title { font-weight: 600; }
.btn-sub { font-size: 12px; color: var(--muted); }
.btn-small { padding: 6px 8px; }
.btn-primary { margin-top: 16px; background: var(--accent); border-color: var(--accent); color: #1a1208; align-items: center; }
.btn-primary .btn-sub { color: #3a2a12; }
.btn-ghost { width: auto; padding: 4px 10px; }
.btn-ghost[aria-pressed='true'] { border-color: var(--focus); color: var(--focus); }

.row { display: flex; gap: 6px; margin: 8px 0; }
.row .btn { flex: 1; }
.row .btn-primary { margin-top: 0; }

.defender {
  margin: 10px 0 0;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.defender legend { padding: 0 4px; font-weight: 700; }
.defender .btn { margin-top: 8px; }
.field { display: grid; gap: 3px; margin-top: 6px; }
.field label { font-size: 13px; color: var(--muted); }
select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.noise { align-items: center; }
.noise-bar {
  position: relative;
  display: inline-block;
  width: 140px;
  height: 10px;
  border-radius: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.noise-fill { position: absolute; inset: 0 auto 0 0; background: var(--muted); }
.noise-bar.is-loud .noise-fill { background: var(--bad); }
.noise-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }

.report { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0; }
.report dt { color: var(--muted); }
.report dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.pack-row { display: grid; grid-template-columns: 1fr auto 44px 44px; gap: 8px; align-items: center; margin-top: 8px; }
.pack-name { font-weight: 600; }
.pack-btn { align-items: center; justify-content: center; }

.rating { margin-top: 4px; }
.rate-row { display: flex; gap: 6px; margin-top: 6px; }
.rate { flex: 1; display: flex; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate span {
  flex: 1;
  padding: 6px 0;
  text-align: center;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}
.rate input:checked + span { background: var(--accent); border-color: var(--accent); color: #1a1208; }
.rate input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .board-wrap, .side { flex: none; width: 100%; max-width: none; }
  .top h1 .subtitle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Screens (Art Director, 2026-09-19): the title overlay and the dawn / game-over card. */
.title-screen { position: fixed; inset: 0; z-index: 10; background: #05070a; display: flex; align-items: center; justify-content: center; }
.title-screen[hidden], .dawn-card[hidden] { display: none; }
.title-screen img { width: 100%; height: 100%; object-fit: cover; }
.title-start { position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%); width: auto; min-width: 180px; padding: 12px 32px; font-size: 18px; }
.dawn-card { position: absolute; inset: 0; padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #05070a; cursor: pointer; }
.dawn-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dawn-words { position: absolute; left: 0; right: 0; top: 8%; display: grid; gap: 6px; text-align: center; color: #fff; text-shadow: 0 2px 8px #000, 0 0 2px #000; }
.dawn-words strong { font-size: clamp(22px, 5vw, 44px); letter-spacing: 0.04em; }
.dawn-words span { font-size: clamp(13px, 2vw, 18px); }
.dawn-card.is-lost .dawn-words strong { color: var(--bad); }

/* ---------- survivor stats (src/sim/stats.js) ---------- */

/* Folded away by default so the day screen stays a list of actions; open on day 1. */
.party-card { margin: 8px 0; }
.party-card > summary {
  cursor: pointer;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
}
.party-card > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.party-card .defender { margin-top: 8px; }
.defender.is-down { opacity: 0.55; }

.statbars { display: grid; gap: 3px; }
.statbar {
  display: grid;
  grid-template-columns: 82px 1fr 14px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.statbar-name { white-space: nowrap; }
.statbar-track { display: flex; gap: 3px; }
.statbar-pip {
  width: 100%;
  height: 8px;
  border-radius: 2px;
  background: var(--line);
}
/* The third pip is ordinary: a faint notch, so a strength or a weakness reads off it. */
.statbar-pip.is-mark { box-shadow: inset 0 0 0 1px var(--muted); }
.statbar-pip.is-on { background: var(--muted); }
.statbar.is-strong .statbar-pip.is-on { background: var(--accent); }
.statbar.is-strong .statbar-value { color: var(--accent); }
.statbar.is-weak .statbar-pip.is-on { background: #6d7378; }
.statbar.is-weak .statbar-value { color: var(--bad); }
.statbar.is-weak .statbar-name, .statbar.is-strong .statbar-name { color: var(--text); }
.statbar-value { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  .party-card[open] > summary { color: var(--text); }
}

/* The building preview card and menu on the map (lotmenu.js). Fixed to the page, placed at the
   pointer and kept on screen. */
.lot-card, .lot-menu { position: fixed; z-index: 20; max-width: 280px; padding: 8px 10px;
  background: var(--panel, #1b1f27); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); font-size: 13px; }
.lot-card { pointer-events: none; }
.lot-card p, .lot-menu p { margin: 0 0 3px; }
.lot-name { font-weight: 700; font-size: 14px; }
.lot-best { color: var(--accent); }
.lot-people, .lot-hint { color: var(--muted); }
.lot-menu { display: grid; gap: 6px; }
.lot-menu[hidden], .lot-card[hidden] { display: none; }
.lot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.gear-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0; }
.gear-pick { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }

/* The web demo's label on the title screen (src/build.js). */
.title-build { position: absolute; left: 50%; bottom: calc(8% + 64px); transform: translateX(-50%); margin: 0; /* just above Start */
  padding: 4px 12px; border-radius: 4px; background: rgba(14, 16, 20, 0.78); color: #f0d9a8;
  font: 600 14px/1.3 system-ui, sans-serif; letter-spacing: 0.04em; white-space: nowrap; }
.title-build[hidden] { display: none; }
/* A hidden button stays hidden: .btn's own display would otherwise win (the web demo hides Debug). */
.btn[hidden] { display: none; }
/* Credits at the foot of the page (every game has them: Platform Engineer's UI.md). */
.credits { max-width: 1240px; margin: 18px auto 24px; padding: 0 16px; color: var(--muted); font-size: 13px; }
.credits summary { cursor: pointer; color: var(--text, #e6e6e6); }
.credits p { margin: 6px 0; max-width: 72ch; }
