/* Dungeon Chores. The page is the game's own stationery: parchment pieces with the app's
   pixel-stepped corners, laid on the navy of its window frames. Colors are the classic World's
   palette (WorldTheme.swift); "Insert it in this page" swaps them for another World's. */

@font-face {
  font-family: "Dungeon Pixel";
  src: url("fonts/dungeon-pixel.woff") format("woff");
  font-display: swap;
}

:root {
  --paper: #f4e9d0;        /* parchment */
  --paper-deep: #e8d8b0;   /* parchmentDeep */
  --navy: #1b2a4a;         /* navyFrame: the page's ground */
  --navy-deep: #0f1a30;    /* navyDeep */
  --ink: #241b12;
  --gold: #e89e3a;         /* accentGold: the action */
  --muted: #5b4a38;        /* softer ink on parchment */
  --muted-on-navy: #cfc4ab;
  --green: #3da35d;
  --blood: #c0392b;
  --sky: #4a90d9;
  --xp: #6c5ce7;

  --pixel: "Dungeon Pixel", ui-rounded, system-ui, sans-serif;
  --text: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Five sizes. The pixel face is crisp at multiples of 10 (its em is 10 font pixels). */
  --s-small: 15px;
  --s-body: 18px;
  --s-label: 20px;
  --s-head: 40px;
  --s-display: 80px;

  --m: 12px;               /* the page's one margin, and the gap between pieces */
  --pad: clamp(24px, 4vw, 64px);
  --c: 4px;                /* one step of a pixel corner */

  color-scheme: light;
}

/* The one corner on the page: two 4px steps, like the app's pixel panels. */
.px, .cover, .quest-panel, .arena, .sheet, .worlds, .prices, .start, .button, .cell,
.doc, .week-shot img, .plate img, .prices-side img {
  clip-path: polygon(0 calc(var(--c) * 2), var(--c) calc(var(--c) * 2), var(--c) var(--c), calc(var(--c) * 2) var(--c), calc(var(--c) * 2) 0,
    calc(100% - var(--c) * 2) 0, calc(100% - var(--c) * 2) var(--c), calc(100% - var(--c)) var(--c), calc(100% - var(--c)) calc(var(--c) * 2), 100% calc(var(--c) * 2),
    100% calc(100% - var(--c) * 2), calc(100% - var(--c)) calc(100% - var(--c) * 2), calc(100% - var(--c)) calc(100% - var(--c)), calc(100% - var(--c) * 2) calc(100% - var(--c)), calc(100% - var(--c) * 2) 100%,
    calc(var(--c) * 2) 100%, calc(var(--c) * 2) calc(100% - var(--c)), var(--c) calc(100% - var(--c)), var(--c) calc(100% - var(--c) * 2), 0 calc(100% - var(--c) * 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--m); }
body {
  margin: 0;
  background: var(--navy);
  color: var(--paper);
  font: 400 var(--s-body)/1.5 var(--text);
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, figure { margin: 0; }
h1, h2 { font-family: var(--pixel); font-weight: 400; letter-spacing: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--ink); }

.page { position: relative; z-index: 1; background: var(--navy); padding-bottom: var(--m); }

/* The button: flat gold, pixel corners, the pixel face. Pressed sits 2px lower, as in the app. */
.button {
  display: inline-block;
  padding: 16px 28px 14px;
  background: var(--gold);
  color: var(--ink);
  font: 400 var(--s-label)/1 var(--pixel);
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease;
}
.button:hover { background: #f2ae4f; }
.button:active { transform: translateY(2px); }

/* The cartridge's grip ridges: the cover's one ornament, and the band above the footer. */
.ridges { display: flex; height: 56px; min-width: 0; overflow: hidden; }
.ridges i { flex: 0 0 28px; height: 100%; }
.ridges i:nth-child(odd) { background: var(--navy); }

/* ---------- Hero: the cover card beside the boss's arena ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--m);
  padding: var(--m);
  align-items: start;
}
.hero-col { display: flex; flex-direction: column; gap: var(--m); min-width: 0; }

.cover {
  min-height: calc(100svh - var(--m) * 2);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
}
.cover-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px var(--pad);
  text-align: center;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 400 var(--s-label)/1 var(--pixel);
  text-decoration: none;
}
.mark img { image-rendering: pixelated; }
.cover h1 {
  margin: 36px 0 32px;
  font-size: var(--s-display);
  line-height: 1;
  max-width: 7.6em;
}
.lede { max-width: 36ch; }
.actions { margin-top: 32px; }
.cover-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 0 var(--pad) 28px;
}

.quest-panel {
  padding: 48px var(--pad);
  background: var(--paper-deep);
  color: var(--ink);
}
.quest-panel h2 { font-size: var(--s-head); line-height: 1.1; }
.quest-panel > p { margin-top: 20px; max-width: 46ch; }
.board-tally { margin-top: 20px; color: var(--muted); }

/* The arena stays beside the cover and the board while they scroll. */
.arena {
  position: sticky;
  top: var(--m);
  height: calc(100svh - var(--m) * 2);
  min-height: 480px;
  overflow: hidden;
  background: #c7def0;
}

/* ---------- How a week goes: the slip ---------- */
.week {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--m) 24px;
  padding: 200px calc(var(--m) + var(--pad)) 0;
  align-items: start;
}
.week-text { grid-column: 1 / span 6; display: grid; gap: 24px; }
.week h2 { font-size: var(--s-head); line-height: 1.1; color: var(--paper); }
.week-text > p { max-width: 34ch; }
.week-shot { margin-top: 24px; width: min(100%, 320px); }
.week-shot video { display: block; width: 100%; height: auto; background: var(--navy-deep); }
.week-shot figcaption { margin-top: 12px; color: var(--muted-on-navy); font-size: var(--s-small); }

.slip {
  grid-column: 8 / span 5;
  max-width: 480px;
  width: 100%;
  justify-self: end;
  padding: 40px 36px 64px;
  background: var(--paper);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  /* Straight top, a stepped zigzag tear along the bottom. */
  clip-path: polygon(0 0, 100% 0, 100.00% calc(100% - 0px), 99.07% calc(100% - 0px), 99.07% calc(100% - 4px), 98.15% calc(100% - 4px), 98.15% calc(100% - 8px), 97.22% calc(100% - 8px), 97.22% calc(100% - 12px), 96.30% calc(100% - 12px), 96.30% calc(100% - 8px), 95.37% calc(100% - 8px), 95.37% calc(100% - 4px), 94.44% calc(100% - 4px), 94.44% calc(100% - 0px), 93.52% calc(100% - 0px), 93.52% calc(100% - 4px), 92.59% calc(100% - 4px), 92.59% calc(100% - 8px), 91.67% calc(100% - 8px), 91.67% calc(100% - 12px), 90.74% calc(100% - 12px), 90.74% calc(100% - 8px), 89.81% calc(100% - 8px), 89.81% calc(100% - 4px), 88.89% calc(100% - 4px), 88.89% calc(100% - 0px), 87.96% calc(100% - 0px), 87.96% calc(100% - 4px), 87.04% calc(100% - 4px), 87.04% calc(100% - 8px), 86.11% calc(100% - 8px), 86.11% calc(100% - 12px), 85.19% calc(100% - 12px), 85.19% calc(100% - 8px), 84.26% calc(100% - 8px), 84.26% calc(100% - 4px), 83.33% calc(100% - 4px), 83.33% calc(100% - 0px), 82.41% calc(100% - 0px), 82.41% calc(100% - 4px), 81.48% calc(100% - 4px), 81.48% calc(100% - 8px), 80.56% calc(100% - 8px), 80.56% calc(100% - 12px), 79.63% calc(100% - 12px), 79.63% calc(100% - 8px), 78.70% calc(100% - 8px), 78.70% calc(100% - 4px), 77.78% calc(100% - 4px), 77.78% calc(100% - 0px), 76.85% calc(100% - 0px), 76.85% calc(100% - 4px), 75.93% calc(100% - 4px), 75.93% calc(100% - 8px), 75.00% calc(100% - 8px), 75.00% calc(100% - 12px), 74.07% calc(100% - 12px), 74.07% calc(100% - 8px), 73.15% calc(100% - 8px), 73.15% calc(100% - 4px), 72.22% calc(100% - 4px), 72.22% calc(100% - 0px), 71.30% calc(100% - 0px), 71.30% calc(100% - 4px), 70.37% calc(100% - 4px), 70.37% calc(100% - 8px), 69.44% calc(100% - 8px), 69.44% calc(100% - 12px), 68.52% calc(100% - 12px), 68.52% calc(100% - 8px), 67.59% calc(100% - 8px), 67.59% calc(100% - 4px), 66.67% calc(100% - 4px), 66.67% calc(100% - 0px), 65.74% calc(100% - 0px), 65.74% calc(100% - 4px), 64.81% calc(100% - 4px), 64.81% calc(100% - 8px), 63.89% calc(100% - 8px), 63.89% calc(100% - 12px), 62.96% calc(100% - 12px), 62.96% calc(100% - 8px), 62.04% calc(100% - 8px), 62.04% calc(100% - 4px), 61.11% calc(100% - 4px), 61.11% calc(100% - 0px), 60.19% calc(100% - 0px), 60.19% calc(100% - 4px), 59.26% calc(100% - 4px), 59.26% calc(100% - 8px), 58.33% calc(100% - 8px), 58.33% calc(100% - 12px), 57.41% calc(100% - 12px), 57.41% calc(100% - 8px), 56.48% calc(100% - 8px), 56.48% calc(100% - 4px), 55.56% calc(100% - 4px), 55.56% calc(100% - 0px), 54.63% calc(100% - 0px), 54.63% calc(100% - 4px), 53.70% calc(100% - 4px), 53.70% calc(100% - 8px), 52.78% calc(100% - 8px), 52.78% calc(100% - 12px), 51.85% calc(100% - 12px), 51.85% calc(100% - 8px), 50.93% calc(100% - 8px), 50.93% calc(100% - 4px), 50.00% calc(100% - 4px), 50.00% calc(100% - 0px), 49.07% calc(100% - 0px), 49.07% calc(100% - 4px), 48.15% calc(100% - 4px), 48.15% calc(100% - 8px), 47.22% calc(100% - 8px), 47.22% calc(100% - 12px), 46.30% calc(100% - 12px), 46.30% calc(100% - 8px), 45.37% calc(100% - 8px), 45.37% calc(100% - 4px), 44.44% calc(100% - 4px), 44.44% calc(100% - 0px), 43.52% calc(100% - 0px), 43.52% calc(100% - 4px), 42.59% calc(100% - 4px), 42.59% calc(100% - 8px), 41.67% calc(100% - 8px), 41.67% calc(100% - 12px), 40.74% calc(100% - 12px), 40.74% calc(100% - 8px), 39.81% calc(100% - 8px), 39.81% calc(100% - 4px), 38.89% calc(100% - 4px), 38.89% calc(100% - 0px), 37.96% calc(100% - 0px), 37.96% calc(100% - 4px), 37.04% calc(100% - 4px), 37.04% calc(100% - 8px), 36.11% calc(100% - 8px), 36.11% calc(100% - 12px), 35.19% calc(100% - 12px), 35.19% calc(100% - 8px), 34.26% calc(100% - 8px), 34.26% calc(100% - 4px), 33.33% calc(100% - 4px), 33.33% calc(100% - 0px), 32.41% calc(100% - 0px), 32.41% calc(100% - 4px), 31.48% calc(100% - 4px), 31.48% calc(100% - 8px), 30.56% calc(100% - 8px), 30.56% calc(100% - 12px), 29.63% calc(100% - 12px), 29.63% calc(100% - 8px), 28.70% calc(100% - 8px), 28.70% calc(100% - 4px), 27.78% calc(100% - 4px), 27.78% calc(100% - 0px), 26.85% calc(100% - 0px), 26.85% calc(100% - 4px), 25.93% calc(100% - 4px), 25.93% calc(100% - 8px), 25.00% calc(100% - 8px), 25.00% calc(100% - 12px), 24.07% calc(100% - 12px), 24.07% calc(100% - 8px), 23.15% calc(100% - 8px), 23.15% calc(100% - 4px), 22.22% calc(100% - 4px), 22.22% calc(100% - 0px), 21.30% calc(100% - 0px), 21.30% calc(100% - 4px), 20.37% calc(100% - 4px), 20.37% calc(100% - 8px), 19.44% calc(100% - 8px), 19.44% calc(100% - 12px), 18.52% calc(100% - 12px), 18.52% calc(100% - 8px), 17.59% calc(100% - 8px), 17.59% calc(100% - 4px), 16.67% calc(100% - 4px), 16.67% calc(100% - 0px), 15.74% calc(100% - 0px), 15.74% calc(100% - 4px), 14.81% calc(100% - 4px), 14.81% calc(100% - 8px), 13.89% calc(100% - 8px), 13.89% calc(100% - 12px), 12.96% calc(100% - 12px), 12.96% calc(100% - 8px), 12.04% calc(100% - 8px), 12.04% calc(100% - 4px), 11.11% calc(100% - 4px), 11.11% calc(100% - 0px), 10.19% calc(100% - 0px), 10.19% calc(100% - 4px), 9.26% calc(100% - 4px), 9.26% calc(100% - 8px), 8.33% calc(100% - 8px), 8.33% calc(100% - 12px), 7.41% calc(100% - 12px), 7.41% calc(100% - 8px), 6.48% calc(100% - 8px), 6.48% calc(100% - 4px), 5.56% calc(100% - 4px), 5.56% calc(100% - 0px), 4.63% calc(100% - 0px), 4.63% calc(100% - 4px), 3.70% calc(100% - 4px), 3.70% calc(100% - 8px), 2.78% calc(100% - 8px), 2.78% calc(100% - 12px), 1.85% calc(100% - 12px), 1.85% calc(100% - 8px), 0.93% calc(100% - 8px), 0.93% calc(100% - 4px), 0.00% calc(100% - 4px));
}
.slip-title { font: 400 var(--s-label)/1.2 var(--pixel); }
.slip h3 { margin-top: 28px; font-size: var(--s-body); font-weight: 700; }
.slip ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.slip li, .slip-total { display: flex; align-items: baseline; gap: 8px; }
.slip li span { flex: 0 1 auto; }
.slip li b { flex: 0 0 auto; font-weight: 600; text-align: right; }
/* Leaders of round dots between what happens and what it's worth. */
.slip li::after {
  content: "";
  order: 1;
  flex: 1 1 24px;
  min-width: 24px;
  height: 4px;
  align-self: center;
  margin-top: 6px;
  background: url("dots.svg") 0 0 / 8px 4px repeat-x;
}
.slip li b { order: 2; }
.slip-total {
  justify-content: space-between;
  margin: 28px -36px 0;
  padding: 12px 36px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

/* ---------- More game than chore chart: stacking sheets ---------- */
.game { padding: 200px var(--m) 0; }
.game-head {
  padding: 0 var(--pad) 48px;
  font-size: var(--s-head);
  line-height: 1.1;
}
.sheet {
  --top: calc(var(--m) + var(--i, 0) * 72px);
  position: sticky;
  top: var(--top);
  height: calc(100svh - var(--top) - var(--m));
  min-height: 420px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 72px auto 1fr auto;
  column-gap: 24px;
  background: var(--sheet-bg);
  color: var(--sheet-ink);
}
.sheet + .sheet { margin-top: 24px; }
.sheet-a { --i: 0; --sheet-bg: var(--paper-deep); --sheet-ink: var(--ink); }
.sheet-b { --i: 1; --sheet-bg: var(--gold); --sheet-ink: var(--ink); }
.sheet-c { --i: 2; --sheet-bg: var(--navy-deep); --sheet-ink: var(--paper); }
.sheet-d { --i: 3; --sheet-bg: var(--paper); --sheet-ink: var(--ink); }
.sheet-e { --i: 4; --sheet-bg: var(--paper-deep); --sheet-ink: var(--ink); }
.sheet h3 {
  grid-column: 1 / span 6;
  grid-row: 1;
  align-self: center;
  padding-left: var(--pad);
  font: 400 var(--s-head)/1 var(--pixel);
}
.sheet p {
  grid-column: 1 / span 5;
  grid-row: 2;
  max-width: 40ch;
  padding: 24px 0 0 var(--pad);
}
.sheet .facts {
  grid-column: 1 / span 5;
  grid-row: 4;
  list-style: none;
  margin: 0;
  padding: 32px 0 var(--pad) var(--pad);
  display: grid;
  gap: 0;
  max-width: 44ch;
}
.sheet .facts li { padding: 12px 0; font-weight: 600; }
.sheet .facts li::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 14px;
  background: currentColor;
  vertical-align: 1px;
}
.sheet img {
  grid-column: 7 / span 6;
  grid-row: 2 / span 3;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: top center;
}
.sheet-d img { object-position: center bottom; }

/* ---------- Worlds: the cartridge shelf ---------- */
.worlds {
  margin: 200px var(--m) 0;
  min-height: 88svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-deep);
  color: var(--ink);
}
.plate { display: grid; place-items: center; padding: 40px; }
.plate img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity 600ms ease; }
.plate img.is-fading { opacity: 0; }
.worlds-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 40px 40px 0;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.tabs button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 400 var(--s-label)/1.3 var(--pixel);
  cursor: pointer;
  text-decoration: none;
}
.tabs button[aria-selected="true"] { color: var(--ink); text-decoration: underline 3px var(--gold); text-underline-offset: 6px; }
.tabs button:hover { color: var(--ink); }
.worlds-copy h2 { font-size: var(--s-head); line-height: 1.1; }
.worlds-copy > p { margin-top: 20px; max-width: 46ch; }
.worlds-copy h3 { margin-top: 40px; font: 400 var(--s-label)/1.2 var(--pixel); }
.worlds-copy [data-world-text] { margin-top: 12px; max-width: 46ch; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: var(--m); }
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px 20px;
  border: 0;
  font: 400 var(--s-label)/1.2 var(--pixel);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}
.cell:active { transform: translateY(2px); }
.cell-ink { background: var(--ink); color: var(--paper); }
.cell-ink:hover { background: var(--navy); }
.cell-tone { background: var(--paper); color: var(--ink); }
.cell-tone:hover { background: #fbf4e2; }

/* ---------- What it costs: a menu ---------- */
.prices {
  margin: var(--m) var(--m) 0;
  padding: var(--pad);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  background: var(--paper);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.prices-side { grid-column: 1 / span 3; display: grid; gap: 32px; align-content: start; }
.prices-side h2 { font-size: var(--s-head); line-height: 1.1; }
.prices-side img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.menu { grid-column: 5 / span 8; columns: 2; column-gap: 64px; }
.menu-group { break-inside: avoid; padding-top: 48px; }
.menu-group:first-child { padding-top: 0; }
.menu-group h3 { font: 400 var(--s-label)/1.3 var(--pixel); }
.menu dl { margin-top: 16px; display: grid; gap: 22px; }
.menu dl > div { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; }
.menu dt { font-weight: 600; }
.menu dd { margin: 0; font-weight: 600; }
.menu dl p { grid-column: 1 / -1; max-width: 36ch; color: var(--muted); font-size: var(--s-small); }
.menu-note { break-inside: avoid; margin-top: 48px; max-width: 40ch; }

/* ---------- Questions: index cards in a drawer ---------- */
.questions { padding: 200px var(--m) 0; }
.questions h2 {
  width: min(100%, 980px);
  margin: 0 auto 40px;
  padding: 0 var(--pad);
  font-size: var(--s-head);
  line-height: 1.1;
}
.cards { width: min(100%, 980px); margin: 0 auto; }
.card {
  --tab-w: 200px;
  --tab-x: min(calc(var(--n) * 150px), calc((100% - var(--tab-w)) * var(--n) / 5));
  position: relative;
  margin-top: -14px;
  padding-top: 40px;
  background: var(--card-bg);
  color: var(--ink);
  clip-path: polygon(0 40px, var(--tab-x) 40px, var(--tab-x) 0, calc(var(--tab-x) + var(--tab-w)) 0, calc(var(--tab-x) + var(--tab-w)) 40px, 100% 40px, 100% 100%, 0 100%);
}
.card:first-child { margin-top: 0; }
.card-1 { --n: 0; --card-bg: var(--paper); }
.card-2 { --n: 1; --card-bg: var(--paper-deep); }
.card-3 { --n: 2; --card-bg: var(--gold); }
.card-4 { --n: 3; --card-bg: var(--paper); }
.card-5 { --n: 4; --card-bg: var(--paper-deep); }
.card-6 { --n: 5; --card-bg: var(--gold); }
.card h3 { font: inherit; }
.card button {
  display: block;
  width: 100%;
  padding: 18px var(--pad) 26px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.card .tab {
  position: absolute;
  top: 0;
  left: var(--tab-x);
  width: var(--tab-w);
  height: 40px;
  display: grid;
  place-items: center;
  font: 400 var(--s-label)/1 var(--pixel);
}
.card-q { font: 600 var(--s-label)/1.3 var(--text); }
.card button:hover .card-q { text-decoration: underline 2px; text-underline-offset: 4px; }
.answer { padding: 0 var(--pad) 32px; }
.answer p { max-width: 54ch; }
.js .card:not(.is-open) .answer { display: none; }

/* ---------- Name your guild ---------- */
.start {
  margin: 200px var(--m) 0;
  min-height: 72svh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: end;
  padding: var(--pad);
  background: var(--gold);
  color: var(--ink);
}
.start-text { grid-column: 1 / span 6; padding-bottom: 8px; }
.start h2 { font-size: var(--s-display); line-height: 0.95; max-width: 6em; }
.start-text p { margin-top: 24px; max-width: 40ch; }
.start .setup { grid-column: 8 / span 5; align-self: center; justify-self: end; }

/* ---------- Footer: the back of the box ---------- */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 160px auto auto;
  background: var(--paper);
  color: var(--navy);
}
.foot-ridges { height: 8px; }
.foot-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
  padding: 40px calc(var(--m) + var(--pad)) 0;
  font-size: var(--s-small);
}
.foot-cols > * { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.foot-cols p:first-child { font-weight: 700; }
.foot-cols p:not(:first-child), .foot-cols a { color: var(--muted); }
.wordmark {
  grid-row: 4;
  padding: 0 var(--m);
  font: 400 9.4vw/1 var(--pixel);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}
.legal { grid-row: 5; padding: 20px calc(var(--m) + var(--pad)) 24px; font-size: var(--s-small); color: var(--muted); }

/* ---------- Interface fragments: the app's own panels (data-ui) ---------- */
/* The Bounty Board, as BountyBoardView draws it: parchment rows in navy pixel frames,
   chips in the app's colors, a gold Done! button with its pressed edge. */
.board {
  --ui-frame: 3px solid var(--navy);
  padding: 16px;
  margin-top: 28px;
  background: var(--paper);
  border: var(--ui-frame); /* taste-skill-ignore: the app's panel frame */
  font-family: var(--text);
}
.b-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 4px 14px; }
.b-title { font: 400 30px/1 var(--pixel); color: var(--navy); }
.b-guild { font-size: 14px; color: var(--muted); }
.b-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.q {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: var(--ui-frame); /* taste-skill-ignore: the app's quest row frame */
  transition: background-color 200ms ease, opacity 300ms ease;
}
.q-face { width: 48px; height: 60px; object-fit: contain; image-rendering: pixelated; background: var(--paper-deep); }
.q-main { display: grid; gap: 6px; min-width: 0; }
.q-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.q-chips span {
  padding: 3px 6px 2px;
  font: 400 11px/1 var(--pixel);
  text-transform: uppercase;
  color: #fff;
}
.c-cat { background: var(--sky); color: var(--ink) !important; }
.c-cat.is-weak { background: var(--blood); color: #fff !important; }
.c-xp { background: var(--xp); }
.c-gold { background: var(--gold); color: var(--ink) !important; }
.q-btn, .gm-btn {
  min-width: 92px;
  min-height: 44px;
  padding: 8px 12px;
  border: 3px solid var(--navy); /* taste-skill-ignore: the app's PixelButton */
  background: var(--gold);
  color: var(--ink);
  font: 400 var(--s-label)/1 var(--pixel);
  border-bottom-width: 6px;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.q-btn:active, .gm-btn:active { transform: translateY(3px); border-bottom-width: 3px; } /* taste-skill-ignore: the app's PixelButton edge, inside a data-ui fragment */
.q-btn[data-state="pending"] { background: var(--green); color: #fff; font: 700 16px/1 var(--text); }
.q-btn:disabled, .gm-btn:disabled { cursor: default; opacity: 0.55; border-bottom-width: 3px; }
.q[data-state="done"] { background: var(--paper-deep); }
.q[data-state="done"] .q-btn { opacity: 1; background: var(--paper-deep); color: var(--muted); border-color: var(--muted); }
.q-note { font-size: 13px; color: var(--muted); }
.b-gm {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--navy);
  color: var(--paper);
}
.b-gm img { width: 40px; height: 50px; image-rendering: pixelated; }
.b-gm p { display: grid; font-size: 14px; }
.b-gm p b { font: 400 var(--s-label)/1.2 var(--pixel); color: var(--gold); }
.gm-btn { border-color: var(--paper); }

/* The arena: the app's battle stage (PixelStage) rebuilt from its own layers. Positions come
   from site.js in whole art pixels; these are the fallbacks without script. */
.arena > * { position: absolute; }
.arena img, .a-sky, .a-far, .a-near, .a-ground { image-rendering: pixelated; }
.a-sky { inset: 0 0 45% 0; background-repeat: repeat-x; background-position: left bottom; }
.a-far, .a-near { left: 0; right: 0; background-repeat: repeat-x; background-position: left bottom; }
.a-far { bottom: 45%; height: 224px; }
.a-near { bottom: 43%; height: 192px; }
.a-ground { left: 0; right: 0; bottom: 0; top: 57%; background-repeat: repeat; }
.a-boss { left: 50%; bottom: 44%; width: 384px; height: 384px; margin-left: -192px; transform-origin: 50% 100%; }
.a-hero { width: 128px; height: 160px; bottom: 10%; }
.a-hero[data-hero="mia"] { left: calc(50% - 150px); }
.a-hero[data-hero="leo"] { left: calc(50% + 22px); }
.a-shadow, .a-sun, .a-cloud, .a-chest { display: none; }
.a-hud {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(86%, 420px);
  display: grid;
  gap: 8px;
  justify-items: center;
}
.a-banner {
  padding: 8px 12px 6px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--navy); /* taste-skill-ignore: the app's battle text box */
  font: 400 var(--s-label)/1.2 var(--pixel);
  text-align: center;
}
.a-name {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  color: var(--ink);
  font: 700 14px/1 var(--text);
}
.a-hp {
  position: relative;
  width: 100%;
  height: 16px;
  background: var(--navy-deep);
  border: 3px solid var(--navy-deep); /* taste-skill-ignore: the app's HP gauge frame */
}
.a-hp i { position: absolute; inset: 0; background: var(--green); transform-origin: left center; transition: transform 500ms steps(10, end), background-color 200ms; }
.a-hp i.is-warn { background: #e8a33a; }
.a-hp i.is-low { background: var(--blood); }
.a-info {
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 8px 12px 7px;
  background: var(--navy-deep);
  color: var(--paper);
  font-size: 15px;
}
.a-info b { color: var(--gold); font-weight: 600; }
.a-pops { inset: 0; pointer-events: none; }
.pop {
  position: absolute;
  font: 400 40px/1 var(--pixel);
  color: #fff;
  -webkit-text-stroke: 2px var(--navy-deep);
  paint-order: stroke fill;
  animation: pop-rise 1100ms steps(11, end) forwards;
}
.pop.is-weak { color: #ffd23f; }
.pop.is-gold { font-size: 20px; color: var(--gold); }
@keyframes pop-rise {
  0% { transform: translateY(8px); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}
.arena.is-ready .a-shadow, .arena.is-ready .a-sun, .arena.is-ready .a-cloud { display: block; }
.a-chest.is-shown { display: block; }
.a-boss.is-breathing { animation: breathe 2.4s steps(2, end) infinite; }
@keyframes breathe { 50% { transform: scaleY(1.03); } }
.a-boss.is-hit { animation: hit-shake 360ms steps(6, end); filter: brightness(2.4); }
@keyframes hit-shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.a-boss.is-fallen { animation: fall 1200ms steps(12, end) forwards; }
@keyframes fall { to { transform: translateY(24px) scaleY(0.2); opacity: 0; } }
.a-cloud { animation: drift 60s linear infinite; }
.a-cloud + .a-cloud { animation-duration: 84s; animation-delay: -30s; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
.a-hero.is-hop { animation: hop 600ms steps(6, end) 2; }
@keyframes hop { 50% { transform: translateY(-24px); } }

/* The guild setup sheet, as GuildSetupView draws it (true size, 440 wide). */
.setup {
  width: 440px;
  max-width: 100%;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--navy); /* taste-skill-ignore: the app's sheet frame */
  box-shadow: 6px 6px 0 var(--navy); /* taste-skill-ignore: the open sheet's hard pixel shadow */
  font-family: var(--text);
}
.s-top { font: 400 var(--s-label)/1 var(--pixel); color: var(--navy); text-align: center; text-transform: uppercase; }
.s-step { margin-top: 6px; font-size: 14px; color: var(--muted); text-align: center; }
.s-group { margin-top: 20px; display: grid; gap: 8px; }
.s-label { font: 400 var(--s-label)/1 var(--pixel); color: var(--navy); }
.s-help { font-size: 14px; color: var(--muted); }
.s-field {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--navy); /* taste-skill-ignore: a real text field */
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 400 17px/1.3 var(--text);
}
.s-field:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.s-note { margin-top: 20px; font-size: 14px; color: var(--muted); }
.s-go {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 20px;
  padding: 10px 16px;
  border: 3px solid var(--navy); /* taste-skill-ignore: the app's PixelButton */
  background: var(--gold);
  color: var(--ink);
  font: 400 var(--s-label)/1 var(--pixel);
  text-decoration: none;
  border-bottom-width: 7px;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.s-go:hover { background: #f2ae4f; }
.s-go:active { transform: translateY(4px); border-bottom-width: 3px; }

/* ---------- Entrances (site.js adds .rise and .is-in; nothing hides without script) ---------- */
.rise { opacity: 0; transform: translateY(24px); transition: opacity 600ms ease, transform 600ms cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.rise.is-in { opacity: 1; transform: none; }
/* A cartridge swap flashes the page like the app's power-on. */
.flash { position: fixed; inset: 0; z-index: 10; background: #fff; pointer-events: none; animation: flash 380ms steps(4, end) forwards; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }

/* ---------- Doc pages: support, privacy, 404 ---------- */
.page-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px calc(var(--m) + var(--pad)); }
.page-bar .mark { color: var(--paper); }
.page-bar nav { display: flex; gap: 24px; }
.doc {
  margin: 0 var(--m) var(--m);
  padding: var(--pad) max(var(--pad), (100% - 760px) / 2);
  background: var(--paper);
  color: var(--ink);
}
.doc h1 { font-size: var(--s-head); line-height: 1.1; }
.doc h2 { margin-top: 48px; font-size: var(--s-label); line-height: 1.3; }
.doc h3 { margin-top: 28px; font-size: var(--s-body); }
.doc p, .doc ul, .doc ol { margin-top: 14px; }
.doc ul, .doc ol { padding-left: 1.3em; display: grid; gap: 8px; }
.doc .doc-sub { color: var(--muted); }
.doc .lead { margin-top: 24px; font-size: var(--s-label); line-height: 1.45; }
.doc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 24px calc(var(--m) + var(--pad)) 40px; font-size: var(--s-small); color: var(--muted-on-navy); }
.doc-foot nav { display: flex; gap: 20px; }
.lost { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.lost .doc { align-self: center; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  :root { --s-display: 60px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .hero-col, .quest-panel { display: contents; }
  .quest-panel { background: none; }
  .cover { order: 1; min-height: 0; }
  .quest-panel > h2 { order: 2; padding: 64px var(--pad) 0; color: var(--paper); }
  .quest-panel > [data-boss-intro] { order: 3; margin: 16px 0 24px; padding: 0 var(--pad); color: var(--paper); }
  .arena { order: 4; top: 0; height: 46svh; min-height: 320px; z-index: 2; }
  .board { order: 5; margin-top: var(--m); }
  .board-tally { order: 6; padding: 0 var(--pad); color: var(--muted-on-navy); }
  .b-title { font-size: 20px; }
  .cover-body { padding: 48px var(--pad); }
  .start { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 48px; min-height: 0; }
  .start .setup { align-self: flex-end; }
  .slip { grid-column: 7 / span 6; }
  .week-text { grid-column: 1 / span 6; }
  .menu { grid-column: 1 / -1; margin-top: 40px; }
  .prices-side { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  :root { --s-display: 50px; --s-head: 30px; --s-body: 17px; --pad: 20px; }
  .arena { height: 50svh; min-height: 320px; }
  .a-info { display: none; }
  .quest-panel > h2 { padding-top: 48px; }
  .ridges { height: 40px; }
  .ridges i { flex-basis: 20px; }
  .foot-ridges { height: 8px; }
  .cover-body { padding: 32px var(--pad); }
  .cover h1 { margin: 24px 0 20px; }
  .cover-links { gap: 8px 20px; }
  .board { padding: 8px; }
  .q { grid-template-columns: 32px 1fr auto; gap: 8px; padding: 8px; }
  .q-face { width: 32px; height: 40px; }
  .q-title { font-size: 15px; line-height: 1.25; }
  .q-chips { gap: 4px; }
  .q-chips span { font-size: 10px; padding: 3px 4px 2px; }
  .q-btn { min-width: 0; padding: 6px 8px; }
  .q-btn[data-state="pending"] { font-size: 14px; }
  .b-title { font-size: 20px; }
  .b-gm { grid-template-columns: 40px 1fr; }
  .gm-btn { grid-column: 1 / -1; }

  .week { display: block; padding: 96px calc(var(--m) + 4px) 0; }
  .week-text { padding: 0 var(--pad); }
  .slip { margin-top: 40px; max-width: none; padding: 32px var(--pad) 56px; }
  .slip-total { margin: 24px calc(var(--pad) * -1) 0; padding: 12px var(--pad); }
  .slip li span { flex: 0 1 auto; min-width: 0; }
  .slip li b { max-width: 44%; }
  .slip li::after { min-width: 12px; flex-basis: 12px; }

  .game { padding-top: 96px; }
  .game-head { padding-bottom: 32px; }
  .sheet {
    --top: calc(var(--m) + var(--i, 0) * 52px);
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 52px auto auto;
  }
  .sheet h3 { grid-column: 1; font-size: 20px; }
  .sheet { grid-template-rows: 52px auto auto auto; }
  .sheet img { grid-column: 1; grid-row: 2; aspect-ratio: 4 / 3; height: auto; }
  .sheet p { grid-column: 1; grid-row: 3; padding: 20px 20px 0; }
  .sheet .facts { grid-column: 1; grid-row: 4; padding: 12px 20px 20px; }
  .sheet .facts li { padding: 6px 0; }

  .worlds { margin-top: 96px; grid-template-columns: 1fr; min-height: 0; }
  .plate { padding: 16px; }
  .worlds-text { padding: 0 20px 20px; gap: 32px; }
  .tabs { gap: 4px 16px; }
  .cells { grid-template-columns: 1fr; }
  .cell { min-height: 60px; }

  .prices { display: block; }
  .prices-side { display: grid; grid-template-columns: 1fr; }
  .prices-side img { width: 60%; }
  .menu { columns: 1; }
  .menu-group h3 { font-size: 20px; }
  .menu-group { padding-top: 40px; }
  .menu-group:first-child { padding-top: 0; }

  .questions { padding-top: 96px; }
  .questions h2 { margin-bottom: 28px; }
  .card { --tab-w: 120px; --tab-x: calc(var(--n) * 48px); }
  .card .tab { font-size: 15px; }
  .card-q { font-size: 18px; }
  .card button { padding: 14px 20px 22px; }
  .answer { padding: 0 20px 24px; }

  .start { margin-top: 96px; gap: 40px; }
  .start h2 { font-size: 50px; }
  .start .setup { width: 100%; align-self: stretch; }
  .s-go { min-height: 52px; }

  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 32px; }
  .wordmark { line-height: 0.95; white-space: normal; }
  .wordmark span { display: block; width: fit-content; margin-inline: auto; }
  .legal { font-size: 13px; }
  .page-bar nav { gap: 16px; }
}

/* On phones the entrance only rises: nothing is ever invisible while it waits to be scrolled to. */
@media (max-width: 760px) {
  .rise { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .a-cloud, .a-boss.is-breathing, .a-hero.is-hop { animation: none; }
  .plate img { transition: none; }
  .flash { display: none; }
}
