/* The rule pages (rules.html, quick-reference.html, privacy.html): one stylesheet in the app's Frost look.
   The :root block is a copy of web/src/ui/frost.css :root (web/src/ui/rulesPages.test.ts keeps them equal);
   anything only these pages need is set on html below. No inline styles or scripts: the server's CSP. */
:root {
            --accent: #ff3366;
            --accent2: #18b88a;
            --bg: #eceef2;
            --bg2: #f5f6f9;
            --surface: #ffffff;
            --ink: #0d1018;
            --ink2: #2a2f3c;
            --muted: #6a7180;
            --line: #e4e7ee;
            --f6-disp: 'Space Grotesk', system-ui, sans-serif;
            --f6-body: 'Manrope', system-ui, sans-serif;
            --f6-zine: 'Bungee', system-ui, sans-serif;
            --f6-mark: 'Permanent Marker', cursive;
            --bg-primary: #eceef2;
            --bg-secondary: #f5f6f9;
            --bg-card: #ffffff;
            --bg-card-hover: #f5f6f9;
            --bg-elevated: #ffffff;
            --accent-red: #ff3366;
            --accent-green: #18b88a;
            --accent-gold: #ffc53d;
            --accent-blue: #38b6e6;
            --success: var(--accent-green);
            --warning: var(--accent-gold);
            --error: var(--accent-red);
            --text-primary: #0d1018;
            --text-secondary: #2a2f3c;
            --text-muted: #6a7180;
            --border: #e4e7ee;
            --space-xs: 4px;
            --space-sm: 8px;
            --space-md: 12px;
            --space-lg: 16px;
            --space-xl: 24px;
            --space-2xl: 32px;
            --text-xs: 0.75rem;
            --text-sm: 0.875rem;
            --text-base: 1rem;
            --text-lg: 1.125rem;
            --text-xl: 1.25rem;
            --leading-tight: 1.25;
            --leading-normal: 1.5;
            --radius-sm: 12px;
            --radius-md: 16px;
            --radius-lg: 22px;
            --shadow-card: 0 8px 28px rgba(15,20,35,0.06);
}

html {
  --f-mono: 'Space Mono', ui-monospace, monospace;
  --pg-max: 1180px;
  --pg-gutter: 16px;
  /* Type, by role. Running text is one of four sizes; a heading inside a card is one of two. */
  --pg-t-label: 0.8125rem;   /* 13: table heads, footnotes */
  --pg-t-small: 0.875rem;    /* 14: tables, dense lists, captions */
  --pg-t-body: 1rem;         /* 16 */
  --pg-t-lead: 1.125rem;     /* 18: the paragraph under a heading */
  --pg-h3: 1.25rem;          /* 20: a card's heading */
  --pg-h4: 1.0625rem;        /* 17: a heading inside a card (a step, a term, a question) */
  --tint-two: #fff0f4;
  --tint-all: #e8f8f2;
  --tint-team: #e9f6fc;
  --tint-gold: #fff7e0;
  --ink-two: #c4123f;
  --ink-all: #0b7a5a;
  --ink-team: #13729a;
  --ink-gold: #8a5a00;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Body copy is Manrope at its regular weight. It was set at 500, which in Manrope (a wide face with a big
   x-height) reads as semi-bold in a paragraph, and with near-black ink it looked heavy and dark. Its x-height
   also means it needs less leading than most faces: 1.55 for body, 1.45 for the larger intro paragraphs (at
   1.6 and up their lines floated apart). */
body {
  background: var(--bg);
  color: var(--ink2);
  font: 400 1rem/1.55 var(--f6-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
strong, b { color: var(--ink); font-weight: 700; }
em { font-style: italic; }
code { font-family: var(--f-mono); font-size: 0.88em; background: var(--bg2); padding: 1px 5px; border-radius: 6px; }

/* ---------- the top bar (all three pages) ---------- */
.pg-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.pg-bar-in {
  max-width: var(--pg-max);
  margin: 0 auto;
  padding: 10px var(--pg-gutter);
  display: flex; align-items: center; gap: var(--space-lg);
}
.pg-home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.pg-home img { width: 48px; height: 48px; object-fit: contain; }
.pg-brand {
  font-family: var(--f6-disp); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.03em;
  color: var(--ink); line-height: 1;
}
.pg-brand span { color: var(--accent); }
.pg-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pg-links a { color: var(--ink2); text-decoration: none; font-weight: 700; font-size: var(--text-sm); padding: 8px 10px; border-radius: 10px; }
.pg-links a:hover { background: var(--bg2); color: var(--ink); }
.pg-links a[aria-current="page"] { color: var(--ink); background: var(--bg2); }
.pg-links .pg-join { background: var(--accent); color: #fff; padding: 9px 16px; margin-left: 6px; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.pg-links .pg-join:hover { background: var(--ink); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: var(--radius-md);
  font: 700 var(--text-base)/1.2 var(--f6-body);
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 42%, transparent); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { color: var(--ink); background: var(--bg2); }
.btn img { width: 22px; height: 22px; }

/* ---------- the hero ---------- */
.pg-hero { max-width: var(--pg-max); margin: 0 auto; padding: 40px var(--pg-gutter) 8px; }
.pg-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2xl); align-items: center; }
.pg-title {
  font-family: var(--f6-disp); font-weight: 700; color: var(--ink);
  font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 0.98; letter-spacing: -0.035em;
}
.pg-lede { margin-top: var(--space-lg); max-width: 34em; font-size: var(--text-lg); line-height: 1.45; color: var(--ink2); }
.pg-note { margin-top: var(--space-md); font-family: var(--f6-mark); color: var(--accent); font-size: var(--pg-t-lead); transform: rotate(-1.5deg); transform-origin: left; display: inline-block; }
.pg-actions { margin-top: var(--space-xl); display: flex; flex-wrap: wrap; gap: var(--space-md); }
.pg-hero-art { width: 250px; }
.pg-hero-art img { width: 100%; height: auto; }
.pg-hero.slim .pg-hero-in { grid-template-columns: 1fr; }
.pg-hero.slim .pg-title { font-size: clamp(2.3rem, 6vw, 3.4rem); }

/* the night in steps (a real sequence, so the numbers mean something) */
.night { max-width: var(--pg-max); margin: 0 auto; padding: var(--space-xl) var(--pg-gutter) 0; }
.night-h { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h3); letter-spacing: -0.015em; margin-bottom: var(--space-md); }
.night ol { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.night li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 12px 14px; position: relative; box-shadow: var(--shadow-card);
  font-size: var(--text-sm); line-height: 1.4; color: var(--ink2);
}
.night li img { width: 46px; height: 46px; margin-bottom: 8px; }
.night li b { display: block; font-family: var(--f6-disp); font-size: 1rem; color: var(--ink); margin-bottom: 2px; letter-spacing: -0.01em; }
.night .n { position: absolute; top: 10px; right: 12px; font-family: var(--f6-zine); font-size: 0.8rem; color: var(--muted); }

/* ---------- page layout: contents + the rules ---------- */
.pg-wrap { max-width: var(--pg-max); margin: 0 auto; padding: var(--space-2xl) var(--pg-gutter) 56px; }
.pg-cols { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.pg-main { min-width: 0; max-width: 800px; }

.toc { position: sticky; top: 16px; }
.toc-title { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: 1rem; margin-bottom: 8px; padding-left: 10px; }
.toc ol { list-style: none; }
.toc a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 10px;
  color: var(--ink2); text-decoration: none; font-weight: 650; font-size: var(--text-sm); line-height: 1.25;
}
.toc a:hover { background: var(--surface); color: var(--ink); }
.toc a img { width: 22px; height: 22px; flex: none; }
.toc-print { margin-top: var(--space-lg); padding-left: 10px; font-size: var(--text-sm); }

/* sections */
.sec { margin-bottom: 56px; }
.sec > h2, .sec-head h2 {
  font-family: var(--f6-disp); font-weight: 700; color: var(--ink);
  font-size: clamp(1.6rem, 3.4vw, 2rem); line-height: 1.1; letter-spacing: -0.025em;
}
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--space-md); }
.sec-head img { width: 52px; height: 52px; flex: none; }
.sec-lede { font-size: var(--text-lg); line-height: 1.45; color: var(--ink2); margin-bottom: var(--space-xl); max-width: 36em; }
.sec p + p { margin-top: var(--space-md); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
}
.card > p + ul.ticks, .card > ul.ticks + p { margin-top: var(--space-md); }
.card + .card, .card + .split, .split + .card, .split + .split, .card + .table-box, .table-box + .card, .callout + .card, .card + .callout { margin-top: var(--space-lg); }
.card h3, .sub {
  font-family: var(--f6-disp); font-weight: 700; color: var(--ink);
  font-size: var(--pg-h3); line-height: 1.2; letter-spacing: -0.015em; margin-bottom: var(--space-sm);
}
.card h3 img { width: 30px; height: 30px; display: inline-block; vertical-align: -8px; margin-right: 6px; }
.card .quip { font-family: var(--f6-mark); color: var(--accent); margin: -4px 0 var(--space-sm); font-size: var(--pg-h4); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: start; }
.split > .card { margin: 0; }

ul.ticks, ol.ticks { list-style: none; }
ul.ticks li, ol.ticks li { position: relative; padding-left: 22px; }
ul.ticks li + li, ol.ticks li + li { margin-top: 6px; }
ul.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
ul.ticks.green li::before { background: var(--accent2); }
ul.ticks ul { list-style: none; margin-top: 6px; }
ul.ticks ul li::before { background: var(--line); width: 6px; height: 6px; }

/* terms: a word the rules define */
dl.terms { display: grid; grid-template-columns: 1fr; gap: 0; }
dl.terms > div { padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: var(--space-lg); }
dl.terms > div:first-child { border-top: 0; padding-top: 0; }
dl.terms > div:last-child { padding-bottom: 0; }
dl.terms dt { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: flex-start; font-size: var(--pg-h4); line-height: 1.3; }
dl.terms dt img { width: 26px; height: 26px; flex: none; margin-top: -2px; }

/* the turn: numbered steps */
ol.steps { list-style: none; counter-reset: s; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 0 48px; }
ol.steps > li + li { margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--line); }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; width: 32px; height: 32px; border-radius: 10px;
  background: var(--ink); color: #fff; font: 400 0.9rem/32px var(--f6-zine); text-align: center;
}
ol.steps > li + li::before { top: var(--space-lg); }
ol.steps > li > b:first-child { display: block; font-family: var(--f6-disp); font-size: var(--pg-h4); color: var(--ink); margin-bottom: 2px; }
ol.steps ul { margin-top: 8px; }

/* who does what */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.who > div { border-radius: var(--radius-lg); padding: var(--space-xl); }
.who .room { background: var(--tint-all); }
.who .host { background: var(--tint-gold); }
.who h3 { font-family: var(--f6-disp); font-size: var(--pg-h3); color: var(--ink); margin-bottom: var(--space-sm); display: flex; align-items: center; gap: 8px; }
.who h3 img { width: 30px; height: 30px; }
.who .room ul.ticks li::before { background: var(--accent2); }
.who .host ul.ticks li::before { background: var(--accent-gold); }

/* a short fact that matters */
.callout { background: var(--tint-gold); border-radius: var(--radius-md); padding: 14px 18px; color: var(--ink); }
.callout b { color: var(--ink-gold); }

/* ---------- the games: the showpiece ---------- */
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); }
.game {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden; display: flex; flex-direction: column;
}
.game-art { height: 150px; display: grid; place-items: center; background: var(--bg2); position: relative; }
.game-art img { max-height: 120px; max-width: 72%; width: auto; height: auto; object-fit: contain; }
.game.two .game-art { background: var(--tint-two); }
.game.all .game-art { background: var(--tint-all); }
.game.team .game-art { background: var(--tint-team); }
.game-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game h3 { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h3); line-height: 1.2; letter-spacing: -0.015em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font: 400 0.68rem/1 var(--f6-zine); letter-spacing: 0.02em;
  padding: 6px 9px 5px; border-radius: 999px; background: var(--bg2); color: var(--ink2);
}
.tag.two { background: var(--tint-two); color: var(--ink-two); }
.tag.all { background: var(--tint-all); color: var(--ink-all); }
.tag.team { background: var(--tint-team); color: var(--ink-team); }
.tag.tv { background: var(--bg2); color: var(--muted); }
.game ul { list-style: none; font-size: var(--pg-t-small); line-height: 1.5; }
.game li { position: relative; padding-left: 16px; }
.game li + li { margin-top: 6px; }
.game li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.game.two li::before { background: var(--accent); }
.game.all li::before { background: var(--accent2); }
.game.team li::before { background: var(--accent-blue); }
.game .more { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); font-size: var(--pg-t-label); color: var(--muted); line-height: 1.45; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: var(--space-lg); font-size: var(--text-sm); color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.before { margin-top: var(--space-xl); }
.before .split .card h3 img { width: 28px; height: 28px; }

/* ---------- tables ---------- */
.table-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--pg-t-small); }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-top: 1px solid var(--line); }
thead th { border-top: 0; font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-t-label); background: var(--bg2); }
tbody th { font-weight: 700; color: var(--ink); }
td.num, th.num { text-align: center; font-family: var(--f6-disp); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.cost { max-width: 420px; box-shadow: none; }
.cost th, .cost td { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; }
.cost tbody th { font-family: var(--f6-disp); font-size: var(--pg-h4); }
.cost td.num { font-size: var(--pg-t-lead); }
.cost td.num span { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 50%; background: var(--tint-gold); color: var(--ink-gold); }
.formula { font-family: var(--f6-disp); font-weight: 700; font-size: clamp(1.125rem, 2.6vw, 1.5rem); color: var(--ink); letter-spacing: -0.01em; margin-bottom: var(--space-lg); }
.formula span { color: var(--accent); }
.settings { min-width: 640px; }
.settings td:first-child { white-space: nowrap; }
.settings code { white-space: nowrap; }
.settings .lbl { font-weight: 700; color: var(--ink); display: block; }
.settings .key { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); }
.settings td.def { white-space: nowrap; color: var(--ink); font-weight: 700; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative;
  font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h4); line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font: 400 1.3rem/1 var(--f6-zine); color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 16px; }
.faq.card { padding-top: 8px; padding-bottom: 8px; }

/* ---------- the quick-reference card ---------- */
.qr { columns: 3; column-gap: var(--space-lg); }
.qr .card { display: block; width: 100%; break-inside: avoid; margin: 0 0 var(--space-lg); padding: 18px 20px; }
.qr .card h2 { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h3); letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-md); }
.qr .card h2 img { width: 30px; height: 30px; }
.qr .card h2 { line-height: 1.2; }
.qr table + p, .qr .before { margin-top: var(--space-md); }   /* one gap inside a card, whatever follows what */
.qr p + table { margin-top: var(--space-sm); }
.qr .card { font-size: var(--pg-t-body); line-height: 1.5; }
.qr .wide { column-span: all; margin: var(--space-lg) 0 0; }   /* a column's last margin is cut off before a spanning card: the card brings its own */
.qr table { font-size: var(--pg-t-small); }
.qr th, .qr td { padding: 7px 8px; }
.qr thead th { background: transparent; border-bottom: 1px solid var(--line); }
.qr .card ol.steps > li { padding-left: 36px; }
.qr .card ol.steps > li::before { width: 24px; height: 24px; line-height: 24px; font-size: 0.75rem; border-radius: 8px; }
.qr .card ol.steps > li + li { margin-top: 6px; padding-top: 6px; }
.qr .card ol.steps > li + li::before { top: 6px; }
.qr .chips { display: flex; gap: 10px; }
.qr .chips div { flex: 1; background: var(--bg2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.qr .chips b { display: block; font-family: var(--f6-disp); font-size: 1.7rem; line-height: 1.1; }
.qr .chips span { font-size: var(--pg-t-label); color: var(--muted); }

/* ---------- privacy ---------- */
.narrow { max-width: 760px; }
.narrow .card + .card { margin-top: var(--space-lg); }
.narrow .card h2 { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h3); letter-spacing: -0.02em; margin-bottom: 10px; }
.short { background: var(--tint-all); border-color: transparent; box-shadow: none; }

/* ---------- play anywhere (play-anywhere.html) ---------- */
/* the hero's three ways in: where are you playing? */
.pa-hero-pick { display: flex; flex-direction: column; gap: 10px; width: 300px; }
.pa-hero-pick a {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; align-items: center;
  padding: 12px 16px 12px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink2);
}
.pa-hero-pick a:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink2); }
.pa-hero-pick img { width: 44px; height: 44px; grid-row: span 2; }
.pa-hero-pick b { font-family: var(--f6-disp); font-size: var(--pg-h4); letter-spacing: -0.01em; line-height: 1.2; }
.pa-hero-pick span { font-size: var(--text-sm); color: var(--muted); line-height: 1.3; }

/* the diagrams: flat shapes in the page's tokens (no pictures to load) */
.pa-fig { margin: 0 0 var(--space-lg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 14px; }
.pa-svg { display: block; width: 100%; height: auto; }
.pa-svg text { font-family: var(--f6-body); }
.d-wall { fill: var(--bg2); }
.d-frame { fill: var(--ink); }
.d-glass { fill: #fff; }
.d-screen { fill: var(--bg2); stroke: var(--line); stroke-width: 1.5; }
.d-stand { fill: var(--ink2); }
.d-pink { fill: var(--accent); }
.d-mint { fill: var(--accent2); }
.d-gold { fill: var(--accent-gold); }
.d-tile { fill: var(--tint-team); }
.d-bar { fill: var(--line); }
.d-bar.mint { fill: var(--accent2); }
.d-code { fill: #fff; font-weight: 800; font-size: 20px; letter-spacing: 1px; }
.d-cable { fill: none; stroke: var(--ink2); stroke-width: 4; stroke-linecap: round; }
.d-phone { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }
.d-label { fill: var(--muted); font-size: 14px; font-weight: 700; }
.d-label.sm { font-size: 12px; }
.d-hub { fill: var(--accent); }
.d-hub-t { fill: #fff; font-size: 13px; font-weight: 800; }
.d-live { stroke: var(--accent2); stroke-width: 3.5; stroke-linecap: round; fill: none; }
.d-home path { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.d-home .d-glass { fill: var(--tint-all); stroke: var(--accent2); stroke-width: 1.5; }
.d-call { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 3 4; stroke-linecap: round; }
.d-share { stroke: var(--ink2); stroke-width: 3; stroke-dasharray: 6 5; fill: none; }
.d-arrow { fill: none; stroke: var(--ink2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.d-callbox { fill: var(--ink2); }
.d-face { fill: color-mix(in srgb, #fff 22%, var(--ink2)); }
.d-late { fill: var(--tint-gold); stroke: var(--accent-gold); stroke-width: 1.5; }
.d-late-t { fill: var(--ink-gold); font-size: 11px; font-weight: 800; }

/* ways to do one thing: a grid of small cards */
.pa-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pa-way { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px 16px; font-size: var(--pg-t-small); line-height: 1.5; }
.pa-way h3 { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h4); line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 4px; }
.pa-ways + .card, .pa-ways + .callout { margin-top: var(--space-lg); }
.pa-checks h3 { margin-bottom: 10px; }

/* the two ways for a call, side by side: the best one is marked by its colour, not a badge */
.pa-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: stretch; }
.pa-plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.pa-plan.best { border-color: color-mix(in srgb, var(--accent2) 45%, var(--line)); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent2) 14%, transparent); }
.pa-plan-top { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pa-plan h3 { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--pg-h3); line-height: 1.2; letter-spacing: -0.015em; }
.pa-plan .pa-svg { background: var(--bg2); border-radius: var(--radius-sm); }
.pa-plan ul.ticks { font-size: var(--pg-t-body); }
.pa-pair + .callout { margin-top: var(--space-lg); }

.pa-code { margin-top: var(--space-md); font: 700 clamp(2.4rem, 6vw, 3.2rem)/1 var(--f6-disp); letter-spacing: 0.12em; color: var(--accent); }
.pa-duels li { line-height: 1.45; }
.pa-duels + p { margin-top: var(--space-md); font-size: var(--pg-t-small); color: var(--muted); }

.pa-table th[scope="row"] { min-width: 210px; }
.pa-table .why { display: block; margin-top: 2px; font: 500 0.82rem/1.4 var(--f6-body); color: var(--muted); }
.pa-table td { vertical-align: middle; font-weight: 700; }
.pa-table td.yes { color: var(--ink-all); }
.pa-table td.yes::before { content: ""; display: inline-block; width: 8px; height: 14px; margin: 0 10px -1px 2px; border: solid var(--accent2); border-width: 0 3px 3px 0; rotate: 45deg; translate: 0 -3px; }
.pa-table td.meh { color: var(--ink-gold); }
.pa-table td.meh::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--accent-gold); }
.pa-after { margin-top: var(--space-md); font-size: var(--pg-t-small); color: var(--muted); }

@media (max-width: 1100px) {
  .pa-ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .pa-hero-pick { width: 250px; }
  .pa-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pa-hero-pick { width: auto; margin-top: var(--space-sm); }
  .pg-hero-in .pa-hero-pick { display: flex; }
  .pa-ways, .pa-ways.three { grid-template-columns: minmax(0, 1fr); }
  .pa-fig { padding: 8px; }
  /* the games table: one row per game, the two answers under its name */
  .pa-table thead { display: none; }
  .pa-table tr { display: block; padding: 12px 14px; border-top: 1px solid var(--line); }
  .pa-table tbody tr:first-child { border-top: 0; }
  .pa-table th, .pa-table td { display: block; padding: 0; border: 0; }
  .pa-table th[scope="row"] { min-width: 0; margin-bottom: 6px; }
  .pa-table td[data-label] { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; font-size: var(--pg-t-small); }
  .pa-table td[data-label]::before { content: attr(data-label); display: block; width: auto; height: auto; margin: 0; border: 0; border-radius: 0; background: none; rotate: none; translate: none; color: var(--muted); font-weight: 600; }
  .pa-table td[data-label] + td { margin-top: 2px; }
}
/* The contact page's form (web/contact.html) */
.cf { display: grid; gap: var(--space-lg); margin-top: var(--space-md); }
.cf[hidden], .cf-done[hidden] { display: none; }
.cf-kinds { border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cf-kinds legend, .cf-field { font-family: var(--f6-disp); font-weight: 700; color: var(--ink); font-size: var(--text-base); }
.cf-kinds legend { margin-bottom: 8px; padding: 0; }
.cf-kinds label { position: relative; cursor: pointer; }
.cf-kinds input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cf-kinds span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg2); color: var(--ink2); font-weight: 700; font-size: var(--text-sm); }
.cf-kinds input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.cf-kinds input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.cf-field { display: block; }
.cf-field textarea, .cf-field input { display: block; margin-top: 8px; }
.cf-field small { font-family: var(--f6-body); font-weight: 500; color: var(--muted); font-size: var(--text-sm); margin-left: 6px; }
.cf textarea, .cf input[type="email"] {
  width: 100%; font: 500 1rem/1.5 var(--f6-body); color: var(--ink); background: var(--bg2);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
}
.cf textarea { resize: vertical; min-height: 9em; }
.cf textarea:focus, .cf input[type="email"]:focus { outline: 3px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-send { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md) var(--space-lg); }
.cf-send .btn { border: 0; cursor: pointer; font-family: inherit; }
.cf-send .btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.cf-note { font-weight: 700; color: var(--ink2); min-height: 1.5em; }
.cf-note.bad { color: #c2163f; }
.cf-small { font-size: var(--text-sm); color: var(--muted); }
.cf-done { text-align: center; padding: var(--space-lg) 0; display: grid; justify-items: center; gap: var(--space-md); }
.cf-done img { width: 96px; height: 96px; }
.cf-done h3 { font-size: 1.5rem; margin: 0; }
.cf-mail { font-family: var(--f6-disp); font-weight: 700; font-size: clamp(1.25rem, 5.4vw, 1.6rem); overflow-wrap: anywhere; }
.cf-mail + p, p:has(> .cf-mail) + p { margin-top: var(--space-md); }

@media print {
  .pa-hero-pick { display: none; }
}

/* ---------- footer ---------- */
.pg-foot { border-top: 1px solid var(--line); background: var(--surface); }
.pg-foot-in { max-width: var(--pg-max); margin: 0 auto; padding: 10px var(--pg-gutter); display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: var(--text-sm); color: var(--muted); }
.pg-foot-in img { width: 28px; height: 28px; }
.pg-foot-in nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin-left: auto; }
/* (each link a full-height target: they were 22 px tall) */
.pg-foot-in a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink2); font-weight: 700; text-decoration: none; }
.pg-foot-in a:hover { color: var(--accent); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .night ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr { columns: 2; }
}
@media (max-width: 860px) {
  .pg-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* the contents become one row of chips that stays at the top */
  .toc {
    top: 0; z-index: 5; margin: 0 calc(-1 * var(--pg-gutter)) var(--space-xl);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--pg-gutter);
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc-title, .toc-print { display: none; }
  .toc ol { display: flex; gap: 6px; width: max-content; }
  .toc a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; white-space: nowrap; }
  .toc a img { width: 20px; height: 20px; }
  html { scroll-padding-top: 64px; }
  .pg-hero-in { grid-template-columns: minmax(0, 1fr) 150px; gap: var(--space-lg); }
  .pg-hero-art { width: 150px; }
}
@media (max-width: 640px) {
  .pg-links a:not(.pg-join) { display: none; }
  .pg-hero { padding-top: 28px; }
  .pg-hero-in { grid-template-columns: minmax(0, 1fr); }
  .pg-hero-art { display: none; }
  .night ol { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .night li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; align-items: center; padding: 10px 40px 10px 12px; }
  .night li img { width: 40px; height: 40px; margin: 0; grid-row: span 2; }
  .night .n { top: 50%; transform: translateY(-50%); }
  .games, .split, .who { grid-template-columns: minmax(0, 1fr); }
  .qr { columns: 1; }
  .card { padding: 18px; }
  dl.terms > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  ol.steps > li { padding-left: 42px; }
  .sec { margin-bottom: 44px; }
  .sec-head img { width: 44px; height: 44px; }
  .pg-foot-in nav { margin-left: 0; }
  /* the settings table: one small card per setting */
  .settings { min-width: 0; }
  .settings thead { display: none; }
  .settings tr { display: block; padding: 14px 16px; border-top: 1px solid var(--line); }
  .settings tbody tr:first-child { border-top: 0; }
  .settings td { display: block; padding: 0; border: 0; }
  .settings td:first-child { white-space: normal; margin-bottom: 6px; }
  .settings td[data-label] { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; font-size: var(--pg-t-small); }
  .settings td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 600; }
  .settings td.def { white-space: normal; }
  .settings td:last-child { margin-top: 6px; color: var(--ink2); }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 10pt; line-height: 1.4; }
  .pg-bar, .pg-foot, .toc, .pg-actions, .pg-hero-art, .no-print { display: none !important; }
  .pg-hero { padding: 0 0 6mm; }
  .pg-title { font-size: 22pt; }
  .pg-lede { font-size: 10pt; margin-top: 2mm; }
  .pg-note { display: none; }
  .pg-wrap { padding: 0; max-width: none; }
  .pg-cols { display: block; }
  .pg-main { max-width: none; }
  .card, .table-box, .game { box-shadow: none; border-color: #cfd3db; break-inside: avoid; }
  .sec { margin-bottom: 8mm; break-inside: auto; }
  .sec-head { break-after: avoid; }
  .night ol { grid-template-columns: repeat(4, 1fr); }
  .night li { box-shadow: none; }
  .games { grid-template-columns: repeat(3, 1fr); }
  .game-art { height: 70px; }
  .game-art img { max-height: 56px; }
  .faq details > p { display: block; }
  .table-box { overflow: visible; }
  .settings { min-width: 0; }
  .qr { columns: 3; column-gap: 3mm; }
  .qr .card { margin: 0 0 3mm; }
  .qr .wide { column-span: all; margin-top: 3mm; }
  .qr thead th { font-size: inherit; }
  .qr-page .pg-hero { padding-bottom: 3mm; }
  .qr-page .pg-title { font-size: 17pt; }
  .qr-page .pg-lede { display: none; }
  .qr .card { font-size: 8pt; }
  .qr .chips div { padding: 1.5mm; }
  .qr .chips b { font-size: 12pt; }
  .qr .chips span { font-size: 7pt; }
  .qr .card p.before { margin-top: 1.5mm; }
  .qr .card ol.steps > li + li { border-top: 0; margin-top: 1mm; padding-top: 0; }
  .qr .card ol.steps > li + li::before { top: 0; }
  .qr .card { padding: 2.5mm 3.5mm; line-height: 1.32; border-radius: 10px; }
  .qr .card h2 { font-size: 10.5pt; margin-bottom: 1.5mm; }
  .qr .card h2 img { width: 18px; height: 18px; }
  .qr table { font-size: 8pt; }
  .qr th, .qr td { padding: 1mm 1.5mm; }
  .qr .chips b { font-size: 14pt; }
  .qr .card ol.steps > li { padding-left: 24px; }
  .qr .card ol.steps > li::before { width: 16px; height: 16px; line-height: 16px; font-size: 7pt; border-radius: 5px; }
  ul.ticks li + li { margin-top: 1mm; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
