/* Page reset (the same small reset the Claude artifact wraps the page in) */
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; padding: 0; }
img { max-width: 100%; }
[hidden]:not([hidden=until-found i]) { display: none !important; }

/* Layout: one oak table in a dark room, as in Daniel 9 and Justice and Mercy. You sit on the near side,
   the computer players across; the clue card and the four dealt saint cards lie on the felt runner
   between you. Vellum panels, blackletter headings, rubric red and gold. One dark look on purpose. */
:root {
  color-scheme: dark;
  --room: #2d1f15;
  --bar: #1d130c;
  --oak: #5a412c;
  --oak-edge: #3b2716;
  --brass: #b8925a;
  --felt: #317567;
  --felt-2: #255c50;
  --vellum: #eee0bf;
  --vellum-2: #e4d2a8;
  --vellum-3: #cdb683;
  --parch: #fbf4e2;
  --plate: #fbf4e5;
  --plate-2: #efe0c3;
  --ink: #2a1a0f;
  --ink-soft: #5b4430;
  --ink-faint: #8c7253;
  --cream: #f4e6cc;
  --on-wood: #d9c39a;
  --rubric: #8e1c12;
  --rubric-2: #b3311d;
  --gold: #b3862b;
  --gold-2: #d6ae55;
  --gold-3: #f1d690;
  --cue: #3fb59a;
  --cue-ink: #c9f1e4;
  --wrong: #c8432c;
  --deck-b: #2f6b45;
  --deck-i: #2b4f86;
  --deck-a: #7e1a12;
  --font-display: "Grenze Gotisch", "UnifrakturMaguntia", "Old English Text MT", "Palatino Linotype", Georgia, serif;
  --font-body: "EB Garamond", Garamond, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --radius: 10px;
  --shadow: 0 2px 6px rgb(0 0 0 / 0.35);
  --vellum-bg:
    radial-gradient(ellipse 60% 50% at 18% 12%, rgb(255 255 255 / 0.38), transparent 70%),
    radial-gradient(ellipse 50% 40% at 88% 92%, rgb(139 100 40 / 0.2), transparent 70%),
    radial-gradient(circle at 72% 28%, rgb(150 110 50 / 0.07) 0 9%, transparent 10%),
    radial-gradient(circle at 30% 80%, rgb(150 110 50 / 0.06) 0 7%, transparent 8%);
  --vellum-shadow: inset 0 0 0 1px rgb(120 86 36 / 0.4), inset 0 0 34px rgb(130 92 38 / 0.3), 0 1px 1px rgb(0 0 0 / 0.35), 0 10px 26px rgb(0 0 0 / 0.45);
  --fly-ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

* { box-sizing: border-box; }
html, body { font-family: var(--font-body); font-size: 17px; line-height: 1.4; color: var(--cream); overflow-x: clip; }
body {
  min-height: 100vh;
  background-color: var(--room);
  background-image:
    radial-gradient(ellipse 65% 42% at 50% -4%, rgb(255 186 102 / 0.22), transparent 72%),
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 46%, rgb(0 0 0 / 0.46)),
    url(room.webp);
  background-size: auto, auto, 1440px 1024px;
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bar);
}
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; text-wrap: balance; }
p { margin: 0 0 8px; }
button:focus-visible, select:focus-visible, input:focus-visible, .card:focus-visible { outline: 3px solid var(--gold-3); outline-offset: 2px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, rgb(29 19 12 / 0.96), rgb(45 31 21 / 0.92));
  border-bottom: 1px solid rgb(214 174 85 / 0.45);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.6), 0 8px 18px rgb(0 0 0 / 0.35);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; color: var(--gold-3);
  text-shadow: 0 1px 0 #000, 0 0 18px rgb(255 190 100 / 0.25); white-space: nowrap;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.rules-link {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 0;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer;
  color: var(--bar); background: linear-gradient(180deg, var(--gold-3), var(--gold-2));
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.22), 0 0 0 1px rgb(0 0 0 / 0.45), 0 0 14px rgb(241 214 144 / 0.35);
}
.top-btn {
  min-height: 34px; padding: 6px 12px; font-size: 15px; font-family: var(--font-body);
  color: var(--gold-3); background: rgb(0 0 0 / 0.3); border: 1px solid rgb(214 174 85 / 0.5); box-shadow: none;
}
.fs-btn { display: inline-flex; align-items: center; gap: 6px; }
.fs-btn svg { width: 18px; height: 18px; flex: none; }
.fs-btn[hidden] { display: none; }
@media (max-width: 719px) { .fs-label { display: none; } .fs-btn { padding: 6px 9px; } }
html[data-layout="mobile"] .brand { font-size: 23px; }
html[data-layout="mobile"] .rules-link { min-height: 32px; padding: 5px 12px; font-size: 14px; }

main {
  max-width: 1180px; margin: 0 auto;
  padding-block: 16px calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
html[data-layout="desktop"] main[data-screen="game"] { max-width: 1560px; }
html[data-layout="mobile"] main { max-width: 520px; }

/* ---------------------------------------------------------------- vellum and controls */
.panel, .step-card, .zoom-box, .sheet-box {
  position: relative; color: var(--ink);
  background-color: var(--vellum); background-image: var(--vellum-bg);
  border-radius: 5px 8px 6px 9px; box-shadow: var(--vellum-shadow);
}
.panel::before, .step-card::before, .zoom-box::before, .sheet-box::before {
  content: ""; position: absolute; inset: 7px; pointer-events: none; border-radius: 3px;
  border: 1px solid rgb(179 134 43 / 0.55); outline: 1px solid rgb(179 134 43 / 0.22); outline-offset: 2px;
}
.panel { padding: 20px 22px; margin-bottom: 16px; }
.panel h2, .sheet-box h2, .zoom-info h2, .results h2 {
  font-family: var(--font-display); font-weight: 700; color: var(--rubric); font-size: 31px; line-height: 1.05; letter-spacing: 0.01em;
}
.panel h2::after, .sheet-box h2::after {
  content: ""; display: block; width: 72px; height: 5px; margin-top: 6px;
  background:
    radial-gradient(circle, var(--gold) 0 2px, transparent 2.5px) center / 9px 5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left center / 100% 1px no-repeat;
}
.panel h3, .sheet-box h3 { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-caps: small-caps; letter-spacing: 0.03em; margin-top: 4px; }
.muted { color: var(--ink-faint); }
.small { font-size: 15px; }
.panel .muted, .step-card .muted, .sheet-box .muted, .zoom-box .muted { color: var(--ink-faint); }

label, .label-like { display: block; margin: 12px 0 5px; font-size: 16px; font-variant-caps: small-caps; letter-spacing: 0.03em; color: var(--ink-soft); font-weight: 600; }
input[type="text"], select {
  width: 100%; padding: 9px 12px; min-height: 44px;
  font-family: var(--font-body); font-size: 18px; color: var(--ink);
  background: var(--parch); border: 1px solid var(--vellum-3); border-bottom-color: var(--ink-faint); border-radius: 5px;
  box-shadow: inset 0 1px 3px rgb(90 60 20 / 0.15);
}
select option:disabled { color: var(--ink-faint); }

button {
  font-family: var(--font-body); font-size: 17px; font-weight: 600; letter-spacing: 0.02em;
  min-height: 44px; padding: 9px 16px; border-radius: 8px; cursor: pointer;
  color: var(--gold-3);
  background: linear-gradient(180deg, #a52a1a, var(--rubric) 55%, #6c140c);
  border: 1px solid #5b0f08;
  box-shadow: inset 0 1px 0 rgb(255 200 150 / 0.3), inset 0 0 0 1px rgb(214 174 85 / 0.35), 0 2px 5px rgb(60 10 4 / 0.35);
}
button:hover:not(:disabled) { border-color: var(--gold-2); }
button:disabled { opacity: 0.45; cursor: default; }
button.secondary { color: var(--ink); background: linear-gradient(180deg, #e3cba0, #c9ad86); border-color: #9a7a4e; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 2px 4px rgb(60 30 4 / 0.25); }
button.ghost { background: transparent; color: var(--ink-soft); border: 1px solid rgb(91 68 48 / 0.6); box-shadow: none; }
.status button.ghost { color: var(--gold-3); border-color: rgb(214 174 85 / 0.55); background: rgb(0 0 0 / 0.25); }
button.danger { background: linear-gradient(180deg, #c24a2f, #8e2a16); color: #fff4e2; }
button.big { font-size: 20px; min-height: 52px; padding: 10px 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px;
  background: var(--bar); color: var(--cream); box-shadow: var(--shadow); border: 1px solid rgb(214 174 85 / 0.45);
  animation: fade-in 0.3s ease-out both;
}

/* ---------------------------------------------------------------- the cards */
/* Saint cards follow a printed deck: vellum face, gold frame, deck ribbon along the top, the saint's
   emblem in a gold halo and the name in Garamond. Sizes come from --w; parts use cqw. */
.card {
  --w: 64px; --ratio: 1.4; --deck: var(--deck-b); --back-art: url(back-beginner.jpg);
  position: relative; flex: none; display: block;
  width: var(--w); height: calc(var(--w) * var(--ratio)); min-height: 0; margin: 0; padding: 0; border: 0;
  container-type: inline-size; overflow: hidden;
  border-radius: calc(var(--w) * 0.06);
  font-family: var(--font-body); font-weight: 400; color: var(--ink); letter-spacing: 0; text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.28s var(--fly-ease), box-shadow 0.28s ease, opacity 0.35s ease, filter 0.35s ease;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.deck-beginner { --deck: var(--deck-b); --back-art: url(back-beginner.jpg); }
.deck-intermediate { --deck: var(--deck-i); --back-art: url(back-intermediate.jpg); }
.deck-advanced { --deck: var(--deck-a); --back-art: url(back-advanced.jpg); }
button.card { cursor: pointer; }
button.card:disabled { opacity: 1; cursor: default; }

.card.saint {
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center;
  padding: calc(var(--w) * 0.1) calc(var(--w) * 0.08) calc(var(--w) * 0.09);
  background:
    radial-gradient(ellipse 80% 55% at 50% 42%, rgb(255 251 240 / 0.95), transparent 72%),
    linear-gradient(180deg, #f8efd9, #e8d6af);
}
.card.saint::before {
  content: ""; position: absolute; inset: 3.5cqw; pointer-events: none;
  border: 1px solid var(--gold); border-radius: 4cqw;
  box-shadow: inset 0 0 0 1.4cqw rgb(255 250 235 / 0.5), inset 0 0 0 calc(1.4cqw + 1px) rgb(179 134 43 / 0.35);
}
.card.saint::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3.6cqw; background: var(--deck); }
.c-feast { position: relative; font-size: 9.5cqw; line-height: 1; font-weight: 600; font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--ink-soft); min-height: 1em; }
.c-halo {
  position: relative; display: grid; place-items: center; width: 50cqw; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff7dc 0 40%, #f1d690 54%, #d6ae55 63%, rgb(214 174 85 / 0) 72%);
}
.c-halo::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1px dashed rgb(179 134 43 / 0.55); }
.c-emb { font-size: 25cqw; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.c-name { position: relative; font-size: 11.5cqw; line-height: 1.08; font-weight: 600; text-wrap: balance; max-height: 3.3em; overflow: hidden; }

/* Small cards: collected in front of a player. Emblem only; tap one to read about the saint. */
.card.small { --w: 40px; }
.card.small.saint { padding: 0; place-items: center; grid-template-rows: 1fr; }
.card.small .c-feast, .card.small .c-name { display: none; }
.card.small .c-halo { width: 78cqw; }
.card.small .c-emb { font-size: 40cqw; }
.card.small.saint::before { inset: 5cqw; border-radius: 6cqw; box-shadow: none; }
.card.small.saint::after { height: 7cqw; }

/* Card backs: each deck's painting of the saints (credits in How to play) in a deck-colored frame with
   a gold fillet, drawn on a pseudo-element so the cqw units measure the card itself */
.card.back { background: var(--deck); }
.card.back::before, .cover {
  background:
    radial-gradient(ellipse 80% 75% at 50% 45%, transparent 58%, rgb(28 14 6 / 0.4)),
    var(--back-art) 50% 50% / cover no-repeat,
    var(--deck);
  box-shadow: inset 0 0 0 4cqw var(--deck), inset 0 0 0 calc(4cqw + 1.5px) var(--gold-2), inset 0 0 0 calc(4cqw + 2.5px) rgb(0 0 0 / 0.35);
}
.card.back::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cover { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none; border-radius: inherit; }
.card.back.small::before { box-shadow: inset 0 0 0 6cqw var(--deck), inset 0 0 0 calc(6cqw + 1px) var(--gold-2); }
.card.plaque .cover { box-shadow: inset 0 0 0 4px var(--deck), inset 0 0 0 5.5px var(--gold-2); }

/* Study the decks: the deck's back beside the painting's credit */
.art-credit { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.art-credit .card { --w: 84px; }
.art-credit p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.art-credit cite { font-style: italic; color: var(--ink); }

/* A missed card: face down in front of the player, with a red mark */
.miss-tag {
  position: absolute; z-index: 2; right: 4cqw; bottom: 4cqw; width: 36cqw; height: 36cqw; border-radius: 50%;
  display: grid; place-items: center; font: 800 26cqw/1 var(--font-body); color: #fff4e2;
  background: radial-gradient(circle at 35% 30%, #d4553a, var(--rubric) 70%); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4);
}
.sd-tag {
  position: absolute; z-index: 2; left: 4cqw; top: 9cqw; padding: 1cqw 5cqw; border-radius: 99px;
  font: 800 20cqw/1.1 var(--font-body); color: #2b1a05; background: linear-gradient(180deg, #f1d690, #b3862b);
}

/* ---------------------------------------------------------------- home */
.hero { display: grid; gap: 6px 26px; grid-template-columns: minmax(0, 1fr); }
html[data-layout="desktop"] .hero { grid-template-columns: minmax(0, 1.25fr) auto; align-items: center; }
.game-head { display: flex; gap: 16px; align-items: center; }
.game-head .mark { width: 76px; height: 76px; flex: none; }
.game-head h2 { font-size: 46px; margin-bottom: 2px; }
.game-head > div { min-width: 0; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 46ch; }
.fan { display: flex; padding: 10px 0 16px 26px; justify-content: center; }
.fan .card { --w: 92px; margin-left: -26px; }
.fan .card:nth-child(1) { transform: rotate(-10deg) translateY(10px); }
.fan .card:nth-child(2) { transform: rotate(-3deg) translateY(1px); }
.fan .card:nth-child(3) { transform: rotate(4deg) translateY(1px); }
.fan .card:nth-child(4) { transform: rotate(11deg) translateY(10px); }
.fan button.card:hover { transform: translateY(-8px); z-index: 1; }
html[data-layout="mobile"] .fan .card { --w: 76px; }
html[data-layout="mobile"] .game-head h2 { font-size: 38px; }
html[data-layout="mobile"] .game-head .mark { width: 58px; height: 58px; }

.home-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
html[data-layout="desktop"] .home-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
.home-grid .panel { margin-bottom: 0; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; min-height: 42px; padding: 7px 12px; font-size: 16px;
  color: var(--ink); background: rgb(120 86 36 / 0.1); border: 1px solid rgb(120 86 36 / 0.32); box-shadow: none;
}
.seg button.on { color: var(--bar); background: linear-gradient(180deg, var(--gold-3), var(--gold-2)); border-color: var(--gold); box-shadow: 0 0 0 2px rgb(214 174 85 / 0.45); }

.deck-pick { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.deck-tile {
  display: flex; align-items: center; gap: 10px; min-height: 0; padding: 8px 10px; text-align: left;
  color: var(--ink); background: rgb(120 86 36 / 0.08); border: 1px solid rgb(120 86 36 / 0.3); box-shadow: none; font-weight: 400;
}
.deck-tile .card { --w: 34px; }
.deck-tile .dt-text { display: grid; min-width: 0; }
.deck-tile strong { font-size: 17px; }
.deck-tile .dt-count { font-size: 14px; color: var(--ink-faint); }
.deck-tile.on { background: rgb(214 174 85 / 0.22); border-color: var(--gold); box-shadow: 0 0 0 2px rgb(214 174 85 / 0.5); }
.mixed-stack { position: relative; width: 46px; height: calc(34px * 1.4); flex: none; }
.mixed-stack .card { position: absolute; top: 0; }
.mixed-stack .card:nth-child(2) { left: 6px; }
.mixed-stack .card:nth-child(3) { left: 12px; }
.deck-blurb { margin: 8px 0 0; font-size: 16px; color: var(--ink-soft); font-style: italic; }
.field-note { margin: 6px 0 0; font-size: 14px; color: var(--ink-faint); }
.label-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 12px 0 5px; }
.label-row .label-like, .label-row .field-note { margin: 0; }
.deal-opts { display: grid; gap: 0 10px; grid-template-columns: minmax(0, 1fr); }

/* Desktop home fits one screen: a slim hero band, then the deal panel with the four decks in a row and
   the game options side by side, so Deal me in shows without scrolling */
html[data-layout="desktop"] main[data-screen="home"] { padding-bottom: 16px; }
html[data-layout="desktop"] .hero { padding-block: 12px; grid-template-columns: minmax(0, 1fr) auto; }
html[data-layout="desktop"] .hero-main { display: flex; align-items: center; gap: 24px; }
html[data-layout="desktop"] .hero-main .game-head { flex: 1 1 auto; }
html[data-layout="desktop"] .hero-main .actions { flex: none; flex-direction: column; align-items: stretch; margin-top: 0; gap: 8px; }
html[data-layout="desktop"] .game-head .mark { width: 64px; height: 64px; }
html[data-layout="desktop"] .game-head h2 { font-size: 40px; }
html[data-layout="desktop"] .lede { font-size: 17px; max-width: 64ch; }
html[data-layout="desktop"] .fan { padding: 4px 0 10px 22px; }
html[data-layout="desktop"] .fan .card { --w: 72px; margin-left: -22px; }
html[data-layout="desktop"] .deal-panel label, html[data-layout="desktop"] .deal-panel .label-like { margin-top: 10px; }
html[data-layout="desktop"] .deal-panel .label-row { margin-top: 10px; }
html[data-layout="desktop"] .deal-panel .label-row .label-like { margin-top: 0; }
html[data-layout="desktop"] .deck-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
html[data-layout="desktop"] .deck-tile { gap: 7px; padding: 6px 7px; }
html[data-layout="desktop"] .deck-tile .card { --w: 30px; }
html[data-layout="desktop"] .deck-tile .mixed-stack { width: 42px; height: calc(30px * 1.4); }
html[data-layout="desktop"] .deck-tile strong { font-size: 15.5px; }
html[data-layout="desktop"] .deck-tile .dt-count { font-size: 13px; }
html[data-layout="desktop"] .deck-blurb { font-size: 15px; }
html[data-layout="desktop"] .deal-opts { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr); }
html[data-layout="desktop"] .deal-opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-layout="desktop"] .deal-opts select { font-size: 16px; padding-inline: 10px; }
html[data-layout="desktop"] .deal-panel .actions { margin-top: 12px; }
html[data-layout="desktop"] .char-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
html[data-layout="mobile"] .deck-tile { gap: 8px; padding-inline: 8px; }
html[data-layout="mobile"] .deck-tile strong { font-size: 16px; }
html[data-layout="mobile"] .deck-tile .card { --w: 30px; }
html[data-layout="mobile"] .deck-tile .mixed-stack { width: 42px; height: calc(30px * 1.4); }
@media (max-width: 1199px) {
  html[data-layout="desktop"] .deck-tile { flex-direction: column; justify-content: center; gap: 4px; text-align: center; }
  html[data-layout="desktop"] .deck-tile .dt-text { justify-items: center; }
}

.char-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 12px 0 6px; }
.char-head .label-like { margin: 0; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.char-btn {
  display: grid; justify-items: center; gap: 3px; min-height: 0; padding: 8px 4px 6px; font-weight: 400;
  color: var(--ink); background: rgb(120 86 36 / 0.07); border: 1px solid rgb(120 86 36 / 0.22); border-radius: 12px; box-shadow: none;
  transition: transform 0.25s var(--fly-ease), background 0.25s ease;
}
.char-btn:hover { transform: translateY(-2px); }
.char-btn .char-name { font-size: 13px; line-height: 1.1; }
.char-btn.on { background: rgb(214 174 85 / 0.2); border-color: var(--gold); box-shadow: 0 0 0 2px rgb(214 174 85 / 0.55); }

/* Character tokens: round, wood-burned medallions */
.ctoken {
  --t: 30px; flex: none; display: inline-grid; place-items: center; width: var(--t); height: var(--t); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6e2bd, #d9b47c 62%, #b98c50);
  box-shadow: inset 0 0 0 2px #8a5f2e, inset 0 0 0 4px #e9cf9f, 0 2px 4px rgb(0 0 0 / 0.35);
  vertical-align: middle;
}
.ctoken .cemoji { font-size: calc(var(--t) * 0.56); line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.char-btn .ctoken { --t: 42px; }

/* ---------------------------------------------------------------- study the decks */
.study-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; justify-content: flex-start; }
.study-grid .card { --w: 108px; }
.study-grid .card:hover { transform: translateY(-5px); }
html[data-layout="mobile"] .study-grid { gap: 8px; justify-content: center; }
html[data-layout="mobile"] .study-grid .card { --w: calc((100vw - 2 * max(16px, env(safe-area-inset-left, 0px)) - 44px - 16px) / 3); max-width: 120px; }

/* ---------------------------------------------------------------- game: status line */
.status { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.status-text { min-width: 0; }
.game-title { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1; color: var(--gold-3); text-shadow: 0 1px 0 #000, 0 0 16px rgb(255 190 100 / 0.2); }
.status-meta { color: var(--on-wood); font-size: 16px; }
.status-actions { display: flex; gap: 8px; align-items: center; }
.status-actions button { min-height: 38px; padding: 6px 12px; font-size: 15px; }
.timer {
  font-weight: 700; color: var(--gold-3); padding: 3px 12px; border-radius: 999px; font-variant-numeric: tabular-nums;
  border: 1px solid rgb(214 174 85 / 0.5); background: rgb(0 0 0 / 0.3); min-width: 3.4em; text-align: center;
}
.timer:empty { display: none; }
.timer.low { color: #ffb4a3; border-color: #e0705a; animation: blink 1s ease-in-out infinite; }

/* ---------------------------------------------------------------- game: the table */
.game-grid { display: block; }
html[data-layout="desktop"] .game-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(270px, 22vw, 340px); gap: 18px; align-items: start; }
.table-main { min-width: 0; }
.table-side { min-width: 0; }
html[data-layout="desktop"] .table-side { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 80px); }
html[data-layout="desktop"] .table-side .log-panel { display: flex; flex-direction: column; min-height: 200px; margin: 0; flex: 1 1 auto; }
html[data-layout="desktop"] .table-side .log { max-height: none; flex: 1 1 auto; }

.banquet {
  --row-w: 40px; --row-h: calc(var(--row-w) * 1.4 + 8px);
  display: grid; grid-template-areas: "far" "table" "near"; margin: 4px 0 18px;
}
.bq-far { grid-area: far; display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-bottom: calc(-1 * var(--row-h) - 16px); position: relative; z-index: 2; min-width: 0; }
.bq-near { grid-area: near; display: flex; justify-content: center; margin-top: calc(-1 * var(--row-h) - 16px); position: relative; z-index: 2; min-width: 0; }
.bq-table, .table-phone {
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgb(255 210 150 / 0.12), transparent 70%),
    url(planks.webp) 50% 0 / 1024px 256px repeat,
    var(--oak);
}
.bq-table {
  grid-area: table; position: relative; min-width: 0;
  padding: calc(var(--row-h) + 36px) 30px;
  border-radius: 28px;
  box-shadow: 0 0 0 7px var(--oak-edge), 0 0 0 9px var(--brass), 0 30px 60px rgb(0 0 0 / 0.42), inset 0 2px 30px rgb(0 0 0 / 0.3);
}
.bq-table::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--row-h) + 16px); bottom: calc(var(--row-h) + 16px);
  background: linear-gradient(180deg, var(--felt), var(--felt-2));
  border-top: 3px double var(--brass); border-bottom: 3px double var(--brass);
  box-shadow: 0 6px 12px rgb(0 0 0 / 0.28);
}
.banquet.solo .bq-table { padding-top: 36px; }
.banquet.solo .bq-table::before { top: 16px; }

/* Seats */
.seat { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.seat-far { flex: 0 1 340px; min-width: 0; }
.seat-near { width: min(100%, 560px); }
.seat-row {
  display: flex; justify-content: center; align-items: flex-start; flex-wrap: nowrap; min-width: 0;
  min-height: var(--row-h); padding: 4px 6px 4px calc(6px + var(--row-w) * 0.5);
}
.seat-row .card { --w: var(--row-w); margin-left: calc(var(--row-w) * -0.5); }
.seat-row.many .card { margin-left: calc(var(--row-w) * -0.66); }
.seat-row.many { padding-left: calc(6px + var(--row-w) * 0.66); }
.seat-row button.card:hover { transform: translateY(-6px); z-index: 2; }
.row-empty { align-self: center; font-size: 14px; font-style: italic; color: rgb(255 244 222 / 0.72); }
.plate {
  position: relative; color: var(--ink); padding: 7px 10px 8px; border-radius: 10px;
  background: linear-gradient(180deg, var(--plate), var(--plate-2));
  box-shadow: inset 0 0 0 1px rgb(120 86 36 / 0.42), 0 6px 14px rgb(0 0 0 / 0.32);
  transition: box-shadow 0.3s ease;
}
.plate-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.plate .pname { font-weight: 700; font-size: 17px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-total { margin-left: auto; font-weight: 700; font-size: 28px; line-height: 1; color: #6b3f22; font-variant-numeric: lining-nums tabular-nums; }
.plate-meta { font-size: 14px; color: var(--ink-faint); margin-top: 2px; }
.first-chip, .crown-chip, .wins-chip {
  flex: none; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: 0.04em;
}
.first-chip { color: #fff4e2; background: #6b5a48; text-transform: uppercase; }
.wins-chip { color: #8a6a2c; padding: 0 2px; font-size: 13px; }
.crown-chip { color: #3a2405; background: linear-gradient(180deg, #fbe7a0, #d6ae55 55%, #a77a22); box-shadow: inset 0 0 0 1px #7a5414, 0 0 10px rgb(241 214 144 / 0.7); }
.token-wrap { position: relative; flex: none; display: inline-flex; }
.status-dot { position: absolute; right: -2px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #7fc8a9; box-shadow: 0 0 0 2px var(--plate); }
.status-dot.thinking { background: var(--gold-2); animation: blink 1.2s ease-in-out infinite; }
.seat.deciding .plate { box-shadow: inset 0 0 0 1px rgb(120 86 36 / 0.42), 0 0 0 2px #e9b85c, 0 0 22px rgb(255 192 96 / 0.5), 0 6px 14px rgb(0 0 0 / 0.32); }
.seat.crowned .plate { box-shadow: inset 0 0 0 1px rgb(120 86 36 / 0.42), 0 0 0 3px var(--gold-2), 0 0 34px rgb(241 214 144 / 0.7), 0 6px 14px rgb(0 0 0 / 0.32); }
.seat.out .plate { opacity: 0.78; }

/* Pegs: one per question; gold for right, red for missed */
.pegs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.peg { width: 10px; height: 10px; border-radius: 50%; background: #cdb68a; box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.5); transition: background 0.4s ease, box-shadow 0.4s ease; }
.peg.ok { background: radial-gradient(circle at 35% 30%, #fbe7a0, #b3862b 70%); box-shadow: inset 0 0 0 1px #7a5414, 0 0 4px rgb(214 174 85 / 0.6); }
.peg.miss { background: radial-gradient(circle at 35% 30%, #d4553a, var(--rubric) 70%); box-shadow: inset 0 0 0 1px #4a0a05; }
.peg.now { box-shadow: 0 0 0 2px var(--gold-2); animation: blink 1.2s ease-in-out infinite; }
.peg:nth-child(5n) { margin-right: 4px; }

/* Bubbles: a reaction over a player's name */
.bubble {
  position: absolute; z-index: 6; right: -4px; bottom: calc(100% + 6px); max-width: 240px;
  padding: 5px 10px; border-radius: 12px; font-size: 15px; font-weight: 600; line-height: 1.25; white-space: normal;
  background: var(--vellum); color: var(--ink); border: 1px solid #d9b98a; box-shadow: 0 6px 14px rgb(0 0 0 / 0.3);
  animation: pop 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.bubble::after { content: ""; position: absolute; right: 22px; bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--vellum); }
.table-phone .tp-seats .bubble { right: auto; left: 0; max-width: min(200px, 44vw); }
.table-phone .tp-seats .bubble::after { right: auto; left: 18px; }
.talk-btn {
  position: absolute; right: -10px; bottom: -10px; z-index: 3; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%;
  background: var(--vellum); color: var(--ink); font-size: 17px; border: 0; box-shadow: 0 0 0 1px #c9a46d, 0 3px 8px rgb(0 0 0 / 0.35);
}
.talk-pop {
  position: absolute; z-index: 8; right: -8px; bottom: calc(100% + 10px); width: min(360px, 86vw);
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-radius: 14px;
  background: var(--vellum); color: var(--ink); box-shadow: 0 0 0 1px #c9a46d, 0 16px 34px rgb(0 0 0 / 0.45);
  animation: fade-in 0.3s ease-out both;
}
.talk-pop button {
  min-height: 34px; padding: 5px 10px; border-radius: 999px; font-size: 15px; font-weight: 600;
  color: var(--ink); background: #f3e3c4; border: 1px solid #d6b98a; box-shadow: none;
}

/* The middle of the table: the deck, the clue card, the four saint cards */
.table-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0; }
.tc-top { display: flex; align-items: center; justify-content: center; gap: 22px; width: 100%; min-width: 0; }
.deck-pile { flex: none; display: grid; justify-items: center; gap: 3px; color: #fff4de; text-shadow: 0 1px 0 rgb(0 0 0 / 0.5); }
.deck-stack { position: relative; }
.deck-stack .card { --w: 70px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4), 2px 2px 0 #efe3c8, 3px 3px 0 rgb(0 0 0 / 0.3), 4px 4px 0 #e6d7b8, 5px 5px 0 rgb(0 0 0 / 0.3), 6px 8px 12px rgb(0 0 0 / 0.38); }
.deck-stack.empty .card { opacity: 0.25; }
.deck-count { font-weight: 700; font-size: 22px; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.deck-label { font-size: 13px; font-variant-caps: small-caps; letter-spacing: 0.08em; opacity: 0.9; }

.step-card { flex: 1 1 360px; max-width: 620px; min-width: 0; padding: 16px 20px 16px; }
.step-card.your-move { box-shadow: var(--vellum-shadow), 0 0 0 3px var(--gold-2), 0 0 30px rgb(214 174 85 / 0.5); }
.step-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding-right: 96px; margin-bottom: 4px; }
.step-label { font-family: var(--font-display); font-weight: 700; color: var(--rubric); font-size: 27px; line-height: 1.05; }
.step-for { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--ink-soft); font-variant-caps: small-caps; letter-spacing: 0.03em; }
.step-for .ctoken { --t: 22px; }
.move-seal {
  position: absolute; top: -13px; right: 12px; transform: rotate(-4deg); z-index: 2;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; color: #ffe9cf;
  padding: 7px 14px 6px; border-radius: 48% 52% 50% 46% / 58% 54% 62% 56%;
  background: radial-gradient(circle at 35% 30%, #c6402b, var(--rubric) 60%, #5d0f08);
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.45), inset 0 0 0 2px rgb(255 255 255 / 0.12), inset 0 -2px 4px rgb(0 0 0 / 0.3);
  animation: seal-in 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.clue { font-size: 23px; line-height: 1.32; color: var(--ink); margin: 6px 0 2px; text-wrap: pretty; }
.clue::first-letter { font-family: var(--font-display); font-size: 1.55em; color: var(--rubric); line-height: 0.9; }
.clue.waiting { color: var(--ink-soft); font-style: italic; }
.result-line { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 18px; line-height: 1.35; animation: fade-in 0.35s ease-out both; }
.result-line.ok { background: rgb(214 174 85 / 0.22); box-shadow: inset 0 0 0 1px rgb(179 134 43 / 0.6); }
.result-line.miss { background: rgb(142 28 18 / 0.1); box-shadow: inset 0 0 0 1px rgb(142 28 18 / 0.45); }
.result-line strong { font-weight: 700; }
.recap {
  margin-top: 12px; padding: 8px 12px; border-radius: 8px; font-size: 16px; line-height: 1.4;
  background: rgb(255 250 235 / 0.5); border: 1px solid rgb(179 134 43 / 0.35); animation: fade-in 0.45s ease-out both;
}
.recap-title { font-size: 14px; font-variant-caps: small-caps; letter-spacing: 0.08em; color: var(--rubric); font-weight: 700; }
.recap .fact { display: block; margin-top: 3px; color: var(--ink-soft); font-style: italic; }

.answers { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; width: 100%; min-width: 0; }
.answers .card { --w: clamp(112px, 9.4vw, 140px); }
.answers .card.tappable { box-shadow: var(--shadow), 0 0 0 2px rgb(241 214 144 / 0.7), 0 0 18px rgb(241 214 144 / 0.45); }
.answers .card.tappable:hover { transform: translateY(-8px); }
.answers .card.picked { transform: translateY(-12px); box-shadow: var(--shadow), 0 0 0 3px #e8a33a; z-index: 2; }
.answers .card.right { transform: translateY(-12px) scale(1.04); box-shadow: var(--shadow), 0 0 0 3px var(--gold-2), 0 0 32px 6px rgb(241 214 144 / 0.75); z-index: 2; }
.answers .card.wrong { box-shadow: var(--shadow), 0 0 0 3px var(--wrong), 0 0 22px rgb(200 67 44 / 0.6); animation: shake 0.5s ease-in-out both; }
.answers .card.faded { opacity: 0.42; filter: grayscale(0.6); }
.answers .card .verdict {
  position: absolute; z-index: 4; right: 5cqw; top: 6cqw;
  width: 24cqw; height: 24cqw; border-radius: 50%; display: grid; place-items: center;
  font: 800 17cqw/1 var(--font-body); color: #fff; animation: pop 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.verdict.v-ok { background: radial-gradient(circle at 35% 30%, #f6d98a, #a77a22 75%); color: #3a2405; }
.verdict.v-miss { background: radial-gradient(circle at 35% 30%, #d4553a, var(--rubric) 70%); }
.answers .key-hint { position: absolute; z-index: 3; left: 6cqw; top: 7cqw; font: 700 9cqw/1 var(--font-body); color: var(--ink-faint); }
html[data-layout="mobile"] .key-hint { display: none; }

/* Your board: below the table */
.my-board {
  position: relative; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius);
  background: rgb(50 34 21 / 0.66); box-shadow: inset 0 0 0 1px rgb(214 174 85 / 0.22);
}
.my-board::before {
  content: ""; position: absolute; inset: -3px; border-radius: calc(var(--radius) + 3px); pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 3px var(--gold-3), 0 0 30px 6px rgb(243 199 122 / 0.5);
}
.my-board.cue::before { animation: breathe 2.6s ease-in-out infinite; }
.board-stats { display: flex; flex-wrap: wrap; gap: 6px 26px; align-items: baseline; }
.stat .muted { font-size: 13px; font-variant-caps: small-caps; letter-spacing: 0.06em; color: var(--on-wood); }
.stat .big { font-weight: 700; font-size: 27px; line-height: 1.05; color: var(--gold-3); font-variant-numeric: lining-nums tabular-nums; }
.hand-cue {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px;
  font-weight: 700; font-size: 17px; color: #ffe7b8;
  background: linear-gradient(90deg, rgb(243 199 122 / 0.22), rgb(243 199 122 / 0.06));
  animation: fade-in 0.45s ease-out both;
}
.cue-arrow { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold-3); color: var(--oak-edge); font-size: 15px; flex: none; animation: nudge 1.3s ease-in-out infinite; }

/* Table log */
.log-panel { padding: 16px 18px; }
.log-panel summary { cursor: pointer; font-family: var(--font-display); font-size: 24px; color: var(--rubric); font-weight: 700; }
.log-panel h3 { font-family: var(--font-display); font-variant-caps: normal; font-size: 26px; color: var(--rubric); margin: 0; }
.log { max-height: 280px; overflow-y: auto; font-size: 15px; margin-top: 8px; }
.log div { padding: 4px 0; border-bottom: 1px solid rgb(179 134 43 / 0.22); color: var(--ink); }
.log .ok::before { content: "✓ "; color: #8a6212; font-weight: 700; }
.log .miss::before { content: "✗ "; color: var(--rubric); font-weight: 700; }
.log .note { font-style: italic; color: var(--rubric); }

/* Results */
.results table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.results th, .results td { text-align: left; padding: 7px 6px; border-bottom: 1px solid rgb(0 0 0 / 0.1); }
.results th { font-size: 14px; font-variant-caps: small-caps; letter-spacing: 0.05em; color: var(--ink-soft); }
.results tr.you td { background: rgb(214 174 85 / 0.14); }
.results .num { text-align: right; }
.table-scroll { overflow-x: auto; }
.place-mark {
  display: inline-block; min-width: 2.6em; padding: 1px 8px; border-radius: 999px; text-align: center;
  font-weight: 700; font-size: 15px; color: var(--ink); box-shadow: inset 0 0 0 1px rgb(90 60 20 / 0.45);
}
.place-mark.p1 { background: linear-gradient(180deg, #fbe7a0, #d6ae55 55%, #a77a22); color: #3a2405; box-shadow: inset 0 0 0 1px #7a5414, 0 0 8px rgb(214 174 85 / 0.6); }
.place-mark.p2 { background: linear-gradient(180deg, #f4f4f2, #c6c8c9 55%, #8f9396); color: #2a2c2e; }
.place-mark.p3 { background: linear-gradient(180deg, #f1c79a, #c58b52 55%, #8c5627); color: #2e1606; }
.who-cell { display: inline-flex; align-items: center; gap: 8px; }
.who-cell .ctoken { --t: 26px; }
.big-score { font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--rubric); }
.best-note { font-size: 18px; color: var(--ink-soft); }
.best-note.new { color: #7a5414; font-weight: 700; }
.study-list { display: grid; gap: 8px; margin-top: 8px; }
.study-item {
  display: flex; align-items: center; gap: 12px; min-height: 0; padding: 8px 10px; text-align: left; font-weight: 400;
  color: var(--ink); background: rgb(255 250 235 / 0.5); border: 1px solid rgb(179 134 43 / 0.35); box-shadow: none;
}
.study-item .card { --w: 38px; }
.study-item .si-text { display: grid; min-width: 0; font-size: 16px; }
.study-item strong { font-size: 17px; }

/* ---------------------------------------------------------------- phone table */
.table-phone {
  --row-w: 24px; --row-h: calc(var(--row-w) * 1.4 + 6px);
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 10px; margin: 6px 0 16px; border-radius: 18px;
  box-shadow: 0 0 0 5px var(--oak-edge), 0 0 0 7px var(--brass), 0 16px 30px rgb(0 0 0 / 0.38);
}
.tp-seats { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; }
.table-phone .seat { width: auto; }
.table-phone .seat-row { justify-content: flex-start; min-height: var(--row-h); padding: 2px 2px 2px calc(2px + var(--row-w) * 0.5); }
.table-phone .seat-row.many .card { margin-left: calc(var(--row-w) * -0.62); }
.table-phone .seat-near { --row-w: 30px; }
.table-phone .seat-near .seat-row { justify-content: center; }
.table-phone .plate { padding: 6px 8px 7px; }
.table-phone .plate .pname { font-size: 15px; }
.table-phone .plate-total { font-size: 22px; }
.table-phone .plate .ctoken { --t: 24px; }
.table-phone .peg { width: 7px; height: 7px; }
.table-phone .plate-meta { font-size: 13px; }
.tp-seats[style*="--cols:3"] .plate-meta { display: none; }
.tp-seats .wins-chip, .tp-seats .cc-text, .tp-seats .first-chip { display: none; }
html[data-layout="mobile"] .game-title { display: none; }
html[data-layout="mobile"] .status { margin-top: 2px; }
.table-phone .table-center {
  gap: 10px; margin: 0 -10px; padding: 12px 10px;
  background: linear-gradient(180deg, var(--felt), var(--felt-2));
  border-top: 3px double var(--brass); border-bottom: 3px double var(--brass);
}
.table-phone .tc-top { flex-direction: column; gap: 8px; }
.table-phone .deck-pile { display: flex; align-items: center; gap: 8px; }
.table-phone .deck-stack .card { --w: 30px; }
.table-phone .deck-count { margin: 0; font-size: 17px; }
.table-phone .step-card { flex: none; width: 100%; max-width: none; padding: 12px 14px; }
.table-phone .step-head { padding-right: 84px; }
.table-phone .step-label { font-size: 22px; }
.table-phone .clue { font-size: 19px; }
.table-phone .move-seal { font-size: 14px; }

/* Phone answers: wide plaques in a 2 x 2 grid so names stay readable */
.answers.plaques { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card.plaque {
  --w: 100%; width: 100%; height: auto; min-height: 64px; container-type: normal;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: none; align-items: center; justify-items: start; gap: 8px;
  padding: 9px 10px 8px 12px; text-align: left; border-radius: 8px;
}
.card.plaque::before { inset: 3px; border-radius: 6px; box-shadow: none; }
.card.plaque::after { top: 0; bottom: 0; right: auto; width: 5px; height: auto; }
.card.plaque .c-feast { display: none; }
.card.plaque .c-halo { width: 40px; }
.card.plaque .c-emb { font-size: 21px; }
.card.plaque .c-name { font-size: 16px; max-height: none; }
.card.plaque .verdict { left: auto; right: 6px; top: 6px; transform: none; width: 24px; height: 24px; font-size: 16px; }
.card.plaque.right, .card.plaque.picked { transform: translateY(-3px); }
.card.plaque.right { transform: translateY(-3px) scale(1.02); }
.card.plaque.tappable:hover { transform: translateY(-3px); }

/* ---------------------------------------------------------------- overlays */
.zoom, .sheet {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; overflow-y: auto;
  background: rgb(15 10 6 / 0.8); animation: fade-in 0.3s ease-out both;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.zoom-box { display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: center; justify-content: center; max-width: 760px; width: 100%; padding: 22px; margin: auto; }
.zoom-box > .card { --w: min(58vw, 250px); animation: zoom-in 0.4s var(--fly-ease) both; }
.zoom-info { flex: 1 1 260px; min-width: 0; }
.zoom-meta { font-size: 16px; color: var(--ink-soft); font-variant-caps: small-caps; letter-spacing: 0.04em; }
.fact-label { display: block; margin-top: 12px; font-size: 14px; font-variant-caps: small-caps; letter-spacing: 0.06em; color: var(--rubric); font-weight: 700; }
.zoom-fact { font-size: 19px; line-height: 1.45; margin: 2px 0 0; }
.sheet { align-items: flex-start; }
.sheet-box { width: min(760px, 100%); padding: 24px 26px; margin: auto; }
.sheet-box ul, .sheet-box ol { padding-left: 22px; margin: 6px 0 12px; }
.sheet-box li { margin: 4px 0; }
.sheet-box p, .sheet-box li { font-size: 18px; max-width: 66ch; }

/* Sudden death and the crowning: full-screen moments */
.moment {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; overflow-y: auto; cursor: pointer;
  padding: max(18px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  opacity: 0; transition: opacity 0.3s ease;
}
.moment.sudden {
  background:
    radial-gradient(ellipse 85% 60% at 50% 30%, rgb(140 20 10 / 0.6), transparent 72%),
    radial-gradient(ellipse 120% 80% at 50% 110%, rgb(90 30 6 / 0.55), transparent 70%),
    rgb(10 5 3 / 0.92);
}
.moment.crown {
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgb(214 174 85 / 0.42), transparent 72%),
    radial-gradient(ellipse 120% 80% at 50% 110%, rgb(120 70 10 / 0.5), transparent 70%),
    rgb(12 8 4 / 0.9);
}
.moment.shown { opacity: 1; }
.moment.leaving { opacity: 0; pointer-events: none; }
.moment::before {
  content: ""; position: fixed; inset: -20% 0 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(2px 2px at 12% 70%, #ffc061, transparent 70%),
    radial-gradient(1.5px 1.5px at 38% 90%, #ff8a3a, transparent 70%),
    radial-gradient(2.5px 2.5px at 66% 78%, #ffd27a, transparent 70%),
    radial-gradient(1.5px 1.5px at 84% 95%, #ff6a2a, transparent 70%),
    radial-gradient(2px 2px at 52% 60%, #ffb347, transparent 70%);
  background-size: 340px 420px;
  animation: embers 7s linear infinite;
}
.moment.crown::before {
  background-image:
    radial-gradient(2px 2px at 12% 70%, #fff3c4, transparent 70%),
    radial-gradient(1.5px 1.5px at 38% 90%, #f1d690, transparent 70%),
    radial-gradient(2.5px 2.5px at 66% 78%, #fffbe6, transparent 70%),
    radial-gradient(1.5px 1.5px at 84% 95%, #d6ae55, transparent 70%),
    radial-gradient(2px 2px at 52% 60%, #fbe7a0, transparent 70%);
}
.m-stage { position: relative; width: min(780px, 100%); text-align: center; color: var(--vellum); }
.moment.shown .m-stage { animation: shake 0.55s 0.34s both; }
.moment.crown.shown .m-stage { animation: none; }
.m-title {
  display: inline-block; padding: 0 0.1em 0.06em;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(56px, 14vw, 128px); line-height: 0.95; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff6d2 0%, var(--gold-3) 28%, var(--gold-2) 55%, #9c5c16 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 2px #3a0a04) drop-shadow(0 0 16px rgb(220 50 20 / 0.7)) drop-shadow(0 4px 0 #5a1208);
}
.moment.crown .m-title { filter: drop-shadow(0 0 2px #3a2405) drop-shadow(0 0 22px rgb(241 214 144 / 0.7)) drop-shadow(0 4px 0 #5a3a08); }
.moment.shown .m-title { animation: slam 0.72s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
.m-sub { max-width: 600px; margin: 10px auto 0; font-size: 21px; line-height: 1.35; color: var(--vellum-2); animation: fade-in 0.6s 0.6s ease-out both; }
.m-lanes { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 18px; }
.m-lane {
  display: grid; justify-items: center; gap: 6px; width: 170px; padding: 12px 10px; border-radius: 12px;
  background: linear-gradient(180deg, rgb(64 22 12 / 0.9), rgb(30 12 8 / 0.94));
  box-shadow: inset 0 0 0 1px rgb(214 174 85 / 0.5), 0 10px 26px rgb(0 0 0 / 0.55);
  animation: lane-in 0.5s calc(500ms + var(--i, 0) * 120ms) ease-out both;
}
.moment.crown .m-lane { background: linear-gradient(180deg, rgb(70 48 14 / 0.9), rgb(30 20 8 / 0.94)); }
.m-lane .ctoken { --t: 54px; }
.m-lane strong { font-size: 19px; color: var(--gold-3); }
.m-lane span { font-size: 16px; color: var(--vellum-3); }
.m-lane.winner { box-shadow: inset 0 0 0 2px var(--gold-3), 0 0 36px rgb(241 214 144 / 0.75); transform: scale(1.06); }
.m-tap { margin-top: 20px; font-size: 16px; color: var(--vellum-3); animation: fade-in 0.6s 1.4s ease-out both; }
.m-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; animation: fade-in 0.6s 1.2s ease-out both; }

/* ---------------------------------------------------------------- motion */
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes seal-in { from { transform: rotate(-14deg) scale(1.6); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { translate: 0 0; } 15% { translate: -7px 0; } 30% { translate: 6px 0; } 45% { translate: -5px 0; } 60% { translate: 4px 0; } 75% { translate: -2px 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.85) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes slam {
  0% { transform: scale(3.2) rotate(-8deg); opacity: 0; }
  45% { opacity: 1; }
  62% { transform: scale(0.9) rotate(1.5deg); }
  80% { transform: scale(1.04) rotate(-0.5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes embers { to { background-position: 0 -420px; } }
@keyframes lane-in { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.answers .card.tappable { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: var(--shadow), 0 0 0 2px rgb(241 214 144 / 0.95), 0 0 26px rgb(241 214 144 / 0.7); } }
.fresh { animation: fade-in 0.45s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* ================================================================== one screen, no scrolling
   During a game (html[data-fit]) the page fits the screen, like Wolverine 42, Dragonfly 90 and Pono 28:
   the game's line (deck, question, timer, Leave) sits in the top bar beside the name, the table is
   scaled to the room it has (fitTable in app.js), your board sits under it, and the results open over
   the table. On a phone the table log opens from the Log button. */
.topbar-game { display: none; }
html[data-fit] .topbar-game { display: flex; flex: 1 1 auto; min-width: 0; }
html[data-fit] .topbar-game .status { flex: 1 1 auto; min-width: 0; margin: 0; flex-wrap: nowrap; }
html[data-fit] .topbar-game .status-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
html[data-fit] .topbar-game .status-actions { flex: none; gap: 6px; }
html[data-fit] .topbar-game .status-actions button { min-height: 32px; padding: 4px 11px; font-size: 15px; }
html[data-fit] .topbar-game button.ghost { color: var(--gold-3); border-color: rgb(214 174 85 / 0.55); background: rgb(0 0 0 / 0.25); }
html[data-fit] .topbar { flex-wrap: nowrap; padding-block: 7px; }
html[data-fit][data-layout="mobile"] .topbar-game .status-meta { display: none; }
html[data-fit][data-layout="mobile"] .brand { font-size: 20px; }
html[data-fit][data-layout="mobile"] .topbar { gap: 8px; }
html[data-fit][data-layout="mobile"] .topbar-right .rules-link { padding: 4px 10px; font-size: 13px; }

html[data-fit], html[data-fit] body { overflow: hidden; overscroll-behavior: none; }
html[data-fit] body { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
html[data-fit] .topbar { flex: none; position: relative; top: 0; z-index: 11; }
html[data-fit] main { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
html[data-fit] .banquet, html[data-fit] .table-phone { margin: 0; flex: none; }
html[data-fit] .my-board { flex: none; margin: 0; padding: 8px 12px; }

html[data-fit][data-layout="desktop"] .game-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
html[data-fit][data-layout="desktop"] .table-main { min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
html[data-fit][data-layout="desktop"] .table-side { position: static; max-height: none; min-height: 0; }
html[data-fit][data-layout="mobile"] main { justify-content: center; gap: 8px; }

/* The results, over the table */
.results-overlay {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow-y: auto;
  padding: calc(60px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgb(15 10 6 / 0.6); animation: fade-in 0.45s 0.9s ease-out both;
}
.results-wrap { position: relative; width: min(760px, 100%); }
.results-wrap > .panel.results { margin: 0; }
.results-wrap > .results-close { position: absolute; top: 14px; right: 14px; z-index: 2; min-height: 36px; padding: 6px 12px; font-size: 15px; color: var(--ink-soft); border-color: rgb(91 68 48 / 0.6); background: rgb(255 250 235 / 0.6); }
.results-wrap .panel.results h2 { padding-right: 140px; }
.results-wrap .panel.results > .actions { position: sticky; bottom: 0; z-index: 2; margin: 10px -18px -16px; padding: 10px 18px 14px; background: linear-gradient(180deg, rgb(238 224 191 / 0.9), var(--vellum, #eee0bf) 40%); }
html[data-layout="mobile"] .results-wrap > .results-close { position: relative; top: 0; right: 0; display: block; margin: 0 0 8px auto; }
html[data-layout="mobile"] .results-wrap .panel.results h2 { padding-right: 0; }

/* The table log on a phone: from the Log button, over the table */
.log-drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; display: flex; padding: 0 8px; animation: fade-in 0.3s ease-out both; }
.log-drawer .log-panel { flex: 1 1 auto; display: flex; flex-direction: column; max-height: 70dvh; margin: 0; border-radius: 12px 12px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.log-drawer .log { max-height: none; flex: 1 1 auto; overflow-y: auto; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.log-head h3 { margin: 0; }
.log-head button { min-height: 36px; padding: 6px 12px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* Room for the answers between clues, and for the last clue's recap, so the fitted table keeps its size */
html[data-fit] .answers-hold { min-height: calc(clamp(112px, 9.4vw, 140px) * 1.4); }
html[data-fit] .answers-hold.plaques { min-height: 116px; }
html[data-fit][data-layout="desktop"] .bq-table .step-card { min-height: 196px; }
html[data-fit][data-layout="mobile"] .table-phone .step-card { min-height: 176px; }
/* On a computer your board heads the column beside the table, above the log */
html[data-layout="desktop"] .table-side .my-board { flex: none; margin: 0; }
html[data-layout="desktop"] .table-side .my-board .hand-cue { font-size: 15px; }
html[data-layout="desktop"] .table-side .board-stats { gap: 4px 18px; }
/* A phone during a game: the name as its mark, and a compact board under the table */
html[data-fit][data-layout="mobile"] .brand { font-size: 0; gap: 0; }
html[data-fit][data-layout="mobile"] .brand svg { width: 28px; height: 28px; }
html[data-fit][data-layout="mobile"] .fs-btn { display: none; }
html[data-fit][data-layout="mobile"] .my-board { padding: 6px 10px; }
html[data-fit][data-layout="mobile"] .my-board .hand-cue { font-size: 14px; line-height: 1.25; margin-bottom: 4px; padding: 4px 8px; }
html[data-fit][data-layout="mobile"] .board-stats { flex-wrap: nowrap; justify-content: space-between; gap: 0 10px; }
html[data-fit][data-layout="mobile"] .board-stats .stat .muted { font-size: 11px; white-space: nowrap; }
html[data-fit][data-layout="mobile"] .board-stats .stat .big { font-size: 18px; }
