/* Space Grotesk and Source Serif 4, self-hosted. Generated by
   tools/fetch-fonts.js - do not edit by hand. Licensed under the SIL Open
   Font License 1.1; the licences ship beside the font files as OFL.txt and
   OFL-source-serif-4.txt. */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(/assets/fonts/source-serif-4-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(/assets/fonts/source-serif-4-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   SelectACard - brand stylesheet
   Palette and type are taken from logos/README.txt so the site and the
   logo pack stay in step. Do not introduce colors outside these tokens.

   November 2026 refresh: the logo's ink, ivory and crimson are unchanged,
   but the PAGE is white now, not bone. A whole site in cream-on-cream read
   as generated rather than designed, and nothing on it stood out. Bone and
   ivory stay for what they are in the logo - card faces - and sections take
   turns on white, a cool light gray (--band) and the practice tables' felt.
   ========================================================================== */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  /* Brand - light */
  --ink:        #12141A;  /* lettering, keylines, spades */
  --ivory:      #F7F3E8;  /* card faces, tiles */
  --bone:       #F2EFE6;  /* page background */
  --crimson:    #C0272D;  /* the A, pips, hearts/diamonds */
  --brass:      #8A6B22;  /* accents */

  /* Roles */
  --bg:         #FFFFFF;
  --surface:    #FFFFFF;
  --surface-2:  #F7F8F9;
  --band:       #F3F4F6;  /* every other section, so a long page has rhythm */
  --text:       var(--ink);
  --muted:      #50545D;
  --accent:     var(--crimson);
  /* Text drawn ON the accent. White clears 4.5:1 on crimson but only reaches
     3.10:1 on the lighter dark-mode accent, so the two themes need different
     answers and the buy button must not hard-code one. */
  --on-accent:  #FFFFFF;
  --line:       rgba(18, 20, 26, 0.14);
  --line-firm:  rgba(18, 20, 26, 0.28);
  --shadow:     0 1px 2px rgba(18, 20, 26, 0.05), 0 8px 24px -12px rgba(18, 20, 26, 0.18);

  /* Vertical accents - one per router tile (strategy.md section 4) */
  --v-playing:  var(--crimson);
  --v-business: #2F5D8C;
  --v-greeting: #B4722A;
  --v-credit:   #2E6B63;

  --radius:     14px;
  --radius-lg:  20px;
  --maxw:       1080px;
  --measure:    68ch;
}

/* Dark mode mirrors the `auto` logo files: crimson is too dark on near-black
   (drops to about 2:1), so it lifts to #E2555A. See logos/README.txt. */
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg:        #14161B;
    --surface:   #1C1F26;
    --surface-2: #22262F;
    --band:      #191C22;
    --text:      var(--ivory);
    --muted:     #A9AEB8;
    /* WCAG 2.1 AA (1.4.3) needs 4.5:1. The logo pack's #E2555A clears that on
       the logo's own dark tile (4.98:1) but only reaches 4.46:1 as text on a
       card surface, which is where the site uses it. Lifted just enough to
       clear 4.5 on every dark surface: bg 5.83, surface 5.32, surface-2 4.88.
       The logo files keep #E2555A - correct for their own background. */
    --accent:    #E86B70;
    /* Ink on #E86B70 is about 6:1; white would be 3.10:1 and fail 1.4.3. */
    --on-accent: var(--ink);
    --line:      rgba(247, 243, 232, 0.16);
    --line-firm: rgba(247, 243, 232, 0.30);
    --shadow:    0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.7);
    --brass:     #C9A44C;
    --v-business: #6FA3D8;
    --v-greeting: #E0A356;
    --v-credit:   #5FA69B;
  }
}
:root[data-theme="dark"] {
  --bg: #14161B; --surface: #1C1F26; --surface-2: #22262F; --band: #191C22;
  --text: var(--ivory); --muted: #A9AEB8; --accent: #E86B70; --on-accent: var(--ink);
  --line: rgba(247, 243, 232, 0.16); --line-firm: rgba(247, 243, 232, 0.30);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --brass: #C9A44C;
  --v-business: #6FA3D8; --v-greeting: #E0A356; --v-credit: #5FA69B;
}

*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

a { color: inherit; text-decoration-color: var(--line-firm); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

/* Headings in a book serif, text in Space Grotesk: the pairing a printed
   rulebook or a good magazine uses, and the quickest way to stop every line
   on the page looking the same. h3 stays in the text face - it is a label
   inside a section more often than a heading of one. */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5em; font-weight: 700; }
h1, h2 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(32px, 5.2vw, 52px); }
h2 { font-size: clamp(22px, 3.2vw, 30px); margin-top: 1.6em; }
h3 { font-size: clamp(18px, 2.2vw, 21px); margin-top: 1.4em; }
p  { margin: 0 0 1.1em; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.prose { max-width: var(--measure); min-width: 0; }
.prose li { margin-bottom: .45em; }
.section { padding: clamp(40px, 7vw, 76px) 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- article furniture ----------
   Every content page used to carry its own copy of these in a per-page
   <style> block - twenty copies of .article and .crumb, nineteen of .meta,
   thirteen of .callout and .red, all maintained by hand. One definition
   here; tools/build.js keeps the shared markup around them in step. */
.article { padding: clamp(30px, 5vw, 56px) 0; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumb a { text-decoration: none; }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 26px; }
/* A boxed note inside the text: tinted, so it stands out from the paragraphs around it. */
.callout { border-left: 4px solid var(--accent); background: var(--band); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 22px 0; }
.callout p { margin-bottom: .5em; }
/* A red suit in running text. On the felt the accent turns gold, so the felt sets --suit-red and a
   small ivory chip behind it: card red on ivory, like a tiny card, which plain red on green is too
   dark to read. */
.red, .suit--red { color: var(--suit-red, var(--accent)); background: var(--suit-red-bg, none);
  border-radius: 3px; padding: var(--suit-red-pad, 0); }

/* A heading straight after a .tag eyebrow sits tight against it. This was
   seventeen copies of style="margin-top:.25em" on an h1, and twenty of
   style="margin-top:.3em;font-size:22px" on a card's h2 - which had already
   drifted to two sizes, 22px on most pages and 21px on four rules pages.
   One size now. */
.tag + h1 { margin-top: .25em; }
.tag + h2 { margin-top: .3em; }
/* The smaller heading used by a card that closes or annotates a page, as
   opposed to a card that carries a section of its own. */
.card-title { font-size: 22px; }

/* A card that closes a page, set off from the prose above it. Was
   style="margin-top:34px" on sixteen pages and 30px on four more. */
.card--after { margin-top: 34px; }

/* ---------- section index (guides/, rules/) ---------- */
.idx { list-style: none; margin: 0; padding: 0; }
.idx li { border-bottom: 1px solid var(--line); }
.idx li:last-child { border-bottom: 0; }
.idx a { display: block; padding: 17px 0; text-decoration: none; }
.idx a:hover h2 { color: var(--accent); }
.idx h2 { margin: 0 0 3px; font-size: 18px; }
.idx p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- start-here list (playing home) ----------
   Targets h3, which is what the markup uses. It said h2 until now, left
   behind when the headings were demoted to fix the document outline
   (1.3.1), so every row in this list had been rendering at default h3
   size with a 1.4em top margin inside a baseline-aligned flex row. */
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list li:last-child { border-bottom: 0; }
.guide-list a { display: flex; gap: 14px; align-items: baseline; padding: 15px 0; text-decoration: none; }
.guide-list a:hover h3 { color: var(--accent); }
.guide-list h3 { margin: 0; font-size: 17.5px; flex: 1 1 auto; }
.guide-list .kind { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); flex: 0 0 auto; }

/* ---------- games grid (playing home) ----------
   One tile per game: its rules page, its practice game and, where there is
   one, the narrated game. The hidden words in each link name the game, so a
   screen reader's list of links does not read "Rules, Rules, Rules" (2.4.4). */
.games-lede { max-width: var(--measure); margin: 8px 0 0; }
.game-grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.game-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.game-tile h3 { margin: 0; font-size: 18px; }
.game-tile h3 a { color: inherit; text-decoration: none; }
.game-tile h3 a:hover { color: var(--accent); }
.game-players { margin: 2px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.game-blurb { margin: 0 0 12px; font-size: 15px; flex: 1 1 auto; }
.game-links, .games-more { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 15px; font-weight: 600; }
.games-more { margin-top: 16px; }

/* ---------- plain link list ----------
   The "Keep going" block that closes sixteen pages. It used to borrow
   class="guide-list", whose rules only ever existed on the home page, and
   then restate the layout it actually wanted in three inline styles. */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 6px 0; }

/* ---------- in-page contents ---------- */
.toc { font-size: 15px; }
.toc ul { margin: 8px 0 0; padding-left: 18px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 22px;
  min-height: 66px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand img { height: 30px; width: auto; display: block; }
.nav { display: flex; gap: 20px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav a { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ---------- card surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }

/* Router tiles: playing-card proportions, suit rail across the top */
.tile {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line-firm);
  border-radius: var(--radius-lg);
  padding: 26px 22px 22px;
  text-decoration: none;
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: var(--shadow);
}
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: var(--tile-accent, var(--accent));
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(18,20,26,.06), 0 18px 34px -16px rgba(18,20,26,.34); }
.tile[aria-disabled="true"] { opacity: .78; pointer-events: none; }
.tile .suit { font-size: 26px; line-height: 1; margin-bottom: 12px; }

/* Suits keep their real colors - a blue club or a red spade reads as a mistake
   to anyone who plays cards. The per-vertical accent lives in the top rail and
   the call to action instead. */
.suit--black { color: var(--text); }
/* .suit--red is with .red above */
.tile h2 { margin: 0 0 6px; font-size: 20px; }
.tile p { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.tile .cta { margin-top: auto; font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--tile-accent, var(--accent)); }

/* ---------- bits ---------- */
.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-firm); color: var(--muted);
}
.badge--soon { border-color: var(--brass); color: var(--brass); }
.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: var(--measure); }

.btn {
  display: inline-block; font: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--text); color: var(--text);
  background: transparent; text-decoration: none;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn--buy { border-color: var(--accent); color: var(--on-accent); background: var(--accent); }
.btn--buy:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- affiliate disclosure ----------
   FTC wants this clear, conspicuous and ABOVE the links it covers - never
   only in the footer. strategy.md section 8. */
.disclosure {
  border: 1px solid var(--line-firm);
  border-left: 4px solid var(--brass);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 28px;
}
.disclosure strong { color: var(--text); }

/* ---------- product pick ---------- */
.pick { display: grid; grid-template-columns: 54px 1fr; gap: 18px; align-items: start; }
.pick + .pick { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.pick .rank {
  display: grid; place-items: center;
  width: 54px; height: 76px; border-radius: 7px;
  border: 1.5px solid var(--line-firm); background: var(--surface-2);
  font-weight: 700; font-size: 20px; color: var(--accent);
}
.pick h3 { margin: 0 0 2px; font-size: 19px; }
.pick .who { color: var(--muted); font-size: 14px; margin: 0 0 8px; font-weight: 500; }
.pick ul { margin: 0 0 12px; padding-left: 18px; font-size: 15.5px; }
.pick .links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pick .note { font-size: 13.5px; color: var(--muted); }
/* Product photo, supplied by the maker. Floats beside the text so a pick
   without one looks exactly as before. White-background shots sit on a white
   tile so they read the same in dark mode. */
.pick .pick-img {
  float: right; width: 150px; height: auto; margin: 0 0 10px 16px;
  background: #fff; border-radius: 8px; border: 1px solid var(--line);
}
.pick > div::after { content: ""; display: block; clear: both; }
@media (max-width: 560px) { .pick .pick-img { width: 104px; margin-left: 12px; } }

/* ---------- inline glossary term ----------
   A real link, not a bare tooltip: hover and keyboard focus reveal the short
   definition, and following it lands on the full entry. That way it works on
   touch, where there is no hover, and in a screen reader, which reads the link
   text and the aria-describedby bubble. */
.term {
  position: relative;
  font-style: normal;
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: help;
}
.term:hover, .term:focus-visible { text-decoration-style: solid; color: var(--accent); }
/* The definition lives in data-def and is drawn by CSS, NOT as a child element.
   A <span> inside the link sits in the text flow, so anything reading linearly -
   screen readers, reader mode, text extraction, search snippets - splices the
   definition into the middle of the sentence. "Hearts is a trick-takingA game
   where each player plays one card... game for four" was the live result. */
.term::after {
  content: attr(data-def);
  /* visibility:hidden still contributes to scroll width, so a tooltip centered
     on a term near the right edge pushed the PAGE sideways at 320px (1.4.10).
     clip-path removes it from layout overflow entirely while hidden. */
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(3px);
  width: max-content; max-width: min(300px, 78vw);
  clip-path: inset(0);
  background: var(--ink); color: var(--ivory);
  font-size: 14px; font-style: normal; font-weight: 400; line-height: 1.45;
  text-align: left; text-decoration: none;
  padding: 10px 13px; border-radius: 9px;
  box-shadow: 0 10px 28px -10px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden;
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  z-index: 60; pointer-events: none;
}
.term::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%;
  margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity .14s ease, visibility .14s;
  z-index: 61;
}
.term:hover::after, .term:focus-visible::after {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
  clip-path: none;
}
.term:hover::before, .term:focus-visible::before { opacity: 1; visibility: visible; }
/* near the left or right edge, stop the bubble hanging off the page */
.term.term--l::after { left: 0; transform: translateX(0) translateY(3px); }
.term.term--l:hover::after, .term.term--l:focus-visible::after { transform: translateX(0) translateY(0); }
.term.term--r::after { left: auto; right: 0; transform: translateX(0) translateY(3px); }
.term.term--r:hover::after, .term.term--r:focus-visible::after { transform: translateX(0) translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .term::after, .term::before { transition: none; }
}

/* ---------- glossary page ---------- */
.gl-jump { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 30px; }
.gl-jump a {
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-firm); color: var(--muted); text-decoration: none;
}
.gl-jump a:hover { border-color: var(--accent); color: var(--accent); }
.gl-entry { padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.gl-entry:last-child { border-bottom: 0; }
.gl-entry h2 { margin: 0 0 3px; font-size: 20px; margin-top: 0; }
.gl-entry .short { color: var(--muted); font-size: 15px; margin: 0 0 9px; font-weight: 500; }
.gl-entry p.long { margin: 0 0 10px; }
.gl-entry .also { font-size: 14px; color: var(--muted); }
.gl-entry .also a { color: var(--accent); text-decoration: none; }
.gl-entry .also a:hover { text-decoration: underline; }

/* ---------- comparison table ---------- */
/* 1.4.10 Reflow: a wide table may scroll inside its own box, but it must not
   make the PAGE scroll sideways. Without max-width the container grows to the
   table's 520px intrinsic width and pushes the document out - measured at 61px
   of horizontal page scroll at a 320px viewport. max-width pins it to the
   column; -webkit-overflow-scrolling keeps the inner scroll smooth on iOS. */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 24px;
  -webkit-overflow-scrolling: touch;
}
/* 1.4.10: nothing may make the document scroll sideways. Setting overflow-x
   on html alone propagates to the viewport without clipping, so it must be on
   both. Inner scroll containers (.table-scroll) still scroll normally.

   clip, not hidden. `overflow: hidden` makes the element a scroll container,
   and a sticky child sticks to its nearest scrolling ancestor - so putting
   hidden on body, as the 1.4.10 fix did, quietly stopped .site-header from
   sticking on every page. `clip` clips without creating a scroll container,
   which keeps both the reflow fix and the sticky header. Chrome 90+, Firefox
   81+, Safari 16+; older browsers ignore it, which only restores the
   behaviour that shipped before the reflow fix. */
html, body { overflow-x: clip; max-width: 100%; }
/* min-width belongs ONLY to tables inside a scroll container. Applying it to
   every table pushed the trainer layouts and the cribbage breakdown past the
   viewport too, and a bare `table` selector also caught tables that have no
   business being 520px wide. 1.4.10 allows a data table to scroll inside its
   own box; it does not allow the page to scroll. */
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
.table-scroll > table { min-width: 520px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px));
  font-size: 14.5px; color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 10px; color: var(--text); font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer .fine { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13.5px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-firm);
}
.skip:focus { left: 16px; top: 16px; z-index: 100; }

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

/* ---------- gin rummy trainer ---------- */
.gin-wrap { margin: 30px 0; }
.gin-board {
  background: var(--surface); border: 1px solid var(--line-firm);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
/* Label and number on one line, so a board with a few counters is not a third taller:
   the whole board has to fit one screen without scrolling (see the .h-stats note below). */
.g-stats {
  display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: baseline;
  padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.g-stat { font-size: 13px; color: var(--muted); }
.g-stat b { font-size: 19px; font-weight: 700; color: var(--text); display: inline; margin: 0 4px 0 6px; line-height: 1.1; }
.g-dw { font-size: 26px !important; }
.g-dw--ok { color: var(--brass) !important; }
.g-dw--gin { color: var(--accent) !important; }
.g-knockable { font-size: 13px; font-weight: 700; color: var(--brass); margin-left: auto; }

.g-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.g-lbl { font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
         color: var(--muted); margin: 0 0 8px; }
.g-hand { display: flex; flex-wrap: wrap; gap: 7px; }

.gcard {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 46px; height: 64px; padding: 0; flex: 0 0 auto;
  background: var(--surface-2); color: var(--ink);
  border: 1.5px solid var(--line-firm); border-radius: 7px;
  font-family: inherit; line-height: 1.05; cursor: default;
  transition: transform .12s ease, border-color .12s ease;
}
button.gcard { cursor: pointer; }
button.gcard:hover { transform: translateY(-4px); border-color: var(--ink); }
button.gcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gcard .gr { font-size: 16px; font-weight: 700; }
.gcard .gs { font-size: 15px; }
.gcard--red { color: #C0272D; }
/* A card in a group: a bright gold ring, a glow and a warm face. The pages call it "a gold outline",
   so it has to read as gold at a glance, not as a slightly darker edge. */
.gcard--meld { border-color: var(--brass); border-width: 3px; background: #FFF3C4; box-shadow: 0 0 0 3px #E8B931, 0 0 12px 3px rgba(232,185,49,.55); }
.gcard--dead { opacity: .72; }
.gcard--empty { border-style: dashed; opacity: .5; }

.g-controls { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.g-controls .btn { font-size: 14px; padding: 9px 17px; }
.g-controls .btn:disabled { opacity: .38; cursor: not-allowed; }
.g-controls .btn:disabled:hover { background: transparent; color: var(--text); }

.g-melds { font-size: 14.5px; margin-bottom: 12px; }
.g-muted { color: var(--muted); }
.g-msg {
  font-size: 15px; padding: 12px 15px; border-radius: 9px;
  background: var(--surface-2); border-left: 4px solid var(--line-firm);
  min-height: 1.5em;
}
.g-msg--done { border-left-color: var(--accent); }
.g-legend { font-size: 13.5px; color: var(--muted); margin-top: 14px; }

@media (max-width: 560px) {
  .gcard { width: 40px; height: 57px; }
  .gcard .gr { font-size: 14px; }
  .g-stats { gap: 8px 18px; }
  .g-knockable { margin-left: 0; width: 100%; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gcard { background: #EFEBE0; color: #12141A; }
  :root:not([data-theme="light"]) .gcard--red { color: #C0272D; }
  :root:not([data-theme="light"]) .gcard--meld { border-color: var(--brass); border-width: 3px; background: #FFF3C4; box-shadow: 0 0 0 3px #E8B931, 0 0 12px 3px rgba(232,185,49,.55); }
}
:root[data-theme="dark"] .gcard { background: #EFEBE0; color: #12141A; }
:root[data-theme="dark"] .gcard--red { color: #C0272D; }
:root[data-theme="dark"] .gcard--meld { border-color: var(--brass); border-width: 3px; background: #FFF3C4; box-shadow: 0 0 0 3px #E8B931, 0 0 12px 3px rgba(232,185,49,.55); }

/* ---------- trick-taking trainers ---------- */
/* An illegal card stays readable: a hatch says "not now", and the card can
   still be focused or tapped to hear WHY (design-07, access-14). At .3 opacity
   the rank was unreadable and nothing said what rule was in play. */
.gcard--illegal {
  opacity: .55; cursor: not-allowed;
  background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(18,20,26,.5) 5px 8px);
}
/* The dark-theme card face rules set `background` and outrank the hatch above, so in dark mode an
   unplayable card was only faded and the stripes the pages talk about never showed. */
:root:not([data-theme="light"]) .gcard.gcard--illegal,
:root[data-theme="dark"] .gcard.gcard--illegal {
  background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(18,20,26,.5) 5px 8px);
}
button.gcard--illegal:hover { transform: none; border-color: var(--line-firm); }
/* Face-down cards show the SelectACard logo card (logos/svg/selectacard-card-back.svg,
   the logo tile drawn at playing-card proportions). */
.gcard--back {
  background: #F7F3E8 url(/assets/card-back.svg) center / 100% 100% no-repeat;
  border-color: #12141A;
}
/* The table is laid out the way it is sat at: North across from you, West
   on your left, East on your right. A row of four columns read as a list,
   and "West" meant nothing on it. */
.h-table {
  display: grid; gap: 4px 10px;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: ". n ." "w c e" ". s .";
  align-items: center; justify-items: center;
  margin: 4px 0 14px; padding: 10px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
}
/* Seat cards are shown, never clicked - they can afford to be smaller than
   the hand's own cards (which need to stay a comfortable tap target), and
   shrinking them is most of this table's height (design-19, "too tall"). */
.h-table .gcard, .h-table .gcard--empty { width: 36px; height: 50px; }
.h-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.h-seat--s { grid-area: s; } .h-seat--w { grid-area: w; }
.h-seat--n { grid-area: n; } .h-seat--e { grid-area: e; }
.h-center { grid-area: c; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 150px; margin: 0; }
.h-seat--active .h-seatlbl { color: var(--accent); font-weight: 700; }
.h-seatlbl { font-size: 12px; color: var(--muted); margin: 0; text-align: center; }
.h-count { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 4px;
           border-radius: 999px; border: 1px solid var(--line-firm); color: var(--muted); }
/* Label and number on one line: the board has to fit on one screen, so the
   hand and the buttons are not left below the fold. */
.h-stats { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: baseline;
           padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.h-stats .g-stat b { display: inline; font-size: 18px; margin-left: 6px; }
.h-hand { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
/* Whist's table: North and You each sit on one line (name beside the card, the card still centered),
   and the dealer's face-up card has its note beside it, so the table is three short rows rather than
   five and the whole board fits one screen. */
.h-up { display: flex; align-items: center; gap: 8px; }
.h-up .h-seatlbl { text-align: left; }
.h-table--inline { margin-bottom: 10px; grid-template-areas: "n n n" "w c e" "s s s"; }
/* The hand-size pill says "13 cards" where the seat columns are wide enough; on a phone it is the bare number. */
@media (min-width: 561px) {
  .h-table--inline .h-count .skip-vis { position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: nowrap; }
}
.g-controls .g-note { margin-left: auto; align-self: center; font-size: 13px; color: var(--muted); }
.h-table--inline .h-seat--n, .h-table--inline .h-seat--s {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 8px; width: 100%;
}
.h-table--inline .h-seat--n > .h-seatlbl:first-child,
.h-table--inline .h-seat--s > .h-seatlbl:first-child { justify-self: end; text-align: right; }
.h-table--inline .h-seat--n .h-up, .h-table--inline .h-seat--s .h-up { display: contents; }
.h-table--inline .h-seat--n .h-up .h-seatlbl, .h-table--inline .h-seat--s .h-up .h-seatlbl { justify-self: start; }
@media (max-width: 560px) {
  .h-up { flex-direction: column; gap: 4px; }
  .h-up .h-seatlbl { text-align: center; }
  .h-table { gap: 4px 6px; padding: 8px 6px; }
  .h-seatlbl { font-size: 11px; }
  /* The side seats are narrow here; a hand-count pill would wrap them onto
     three lines. */
  .h-count { display: none; }
}

/* ---------- cribbage counting drill ---------- */
.c-deal { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.c-hand, .c-starter { display: flex; gap: 7px; }
.c-answer { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.c-input {
  font: inherit; font-size: 17px; font-weight: 700; width: 92px;
  padding: 9px 13px; border-radius: 9px;
  border: 1.5px solid var(--line-firm); background: var(--surface-2); color: var(--text);
}
.c-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The points breakdown the Coach prints after each count. The shared table
   styles are made for short cells. Here each line is a name, a plain-words
   explanation under it, and its points on the right. */
.c-break { width: 100%; min-width: 0; margin-top: 12px; font-size: 14.5px; }
.c-break th, .c-break td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.c-break thead th { padding-top: 0; }
.c-break th[scope="row"] { padding-right: 14px; font-size: 14.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text); }
.c-break .c-how { display: block; margin-top: 2px; font-weight: 400; color: var(--muted); }
.c-break .c-pts { text-align: right; white-space: nowrap; }
.c-break td.c-note { text-align: left; white-space: normal; }
.c-break .c-tot th, .c-break .c-tot td { padding-top: 9px; border-top: 1px solid var(--line-firm); border-bottom: 0; }
.c-break .c-grp { white-space: nowrap; }
/* The note under the table after a wrong count. */
.c-miss { display: block; margin-top: 10px; }
.c-which { margin: 0 0 12px; }
.c-which--crib { color: var(--brass); }

/* ---------- bid-calibration drill ---------- */
.s-hand { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.s-shape { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.s-answer { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.s-input {
  font: inherit; font-size: 17px; font-weight: 700; width: 86px;
  padding: 9px 13px; border-radius: 9px;
  border: 1.5px solid var(--line-firm); background: var(--surface-2); color: var(--text);
}
.s-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- euchre order-it-up drill ---------- */
.e-row { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.e-hand, .e-up { display: flex; gap: 7px; }
.e-shape { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }

/* Promoted headings keep their card-sized appearance. Level is semantics
   (1.3.1 Info and Relationships); size is presentation. */
.cat h2 { margin: 8px 0 4px; font-size: 18px; }
.idx h2 { margin: 0 0 3px; font-size: 18px; }
.guide-list h2 { margin: 0; font-size: 17.5px; flex: 1 1 auto; }

/* ---------- 2.4.7 Focus Visible (AA) ----------
   Card buttons and the number inputs had focus rings; buttons, links, tiles
   and the glossary pills relied on the browser default, which is a thin dotted
   ring that disappears against the dark theme. One explicit indicator for
   everything focusable, in the accent color, which clears 3:1 against every
   surface in both themes (1.4.11 applies to focus indicators too).
   :focus-visible so it appears for keyboard users without ringing on click. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tile:focus-visible,
.nav a:focus-visible,
.gl-jump a:focus-visible,
.cat:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
/* The skip link is positioned off-screen until focused; keep its ring tight. */
.skip:focus-visible { outline-offset: 0; }

/* ==========================================================================
   Practice pages: the board and the Coach side by side
   The trainers used to sit halfway down a long rules article, with their
   instructions in the prose above and only a one-line message on the board.
   A practice page puts the board and everything a beginner needs to read
   while playing next to each other, and keeps the Coach in view (sticky)
   while the board changes.
   ========================================================================== */
.skip-vis {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pr-head { max-width: var(--measure); margin-bottom: 22px; }
.pr-head h1 { font-size: clamp(28px, 4.4vw, 42px); }
.pr-head .lede { margin-bottom: .6em; }
.pr-links { font-size: 15px; color: var(--muted); margin: 0; }

.pr-layout {
  display: grid; gap: 24px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.pr-main { min-width: 0; }
.pr-main > h2 { margin-top: 0; }
#board-heading { scroll-margin-top: 90px; }
#board-heading:focus { outline: none; }
.pr-board { min-height: 420px; }
.pr-board .gin-wrap { margin: 0; }
.pr-fail { padding: 18px 20px; }

/* What to do now - always on the board, always one line or two. */
.pr-status {
  font-size: 16px; line-height: 1.5; font-weight: 700; margin: 0 0 16px; padding: 10px 14px;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
}
/* The newest Coach tip, mirrored onto the board when the Coach is below it. */
.pr-tip { display: none; font-size: 14.5px; margin: 14px 0 0; padding: 10px 14px;
          border-radius: 9px; background: var(--surface-2); border-left: 4px solid var(--line-firm); }

.coach {
  position: sticky; top: 82px;
  max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line-firm);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px 18px 14px; font-size: 15px; scroll-margin-top: 82px;
}
.coach-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
               margin: 12px 0 2px; font-size: 19px; }
.coach-goal { margin: 0 0 6px; color: var(--muted); font-size: 14.5px; }
.coach-sec { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.coach-sec > summary, .coach-sec > h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; cursor: pointer; list-style-position: outside;
}
.coach-sec > h3 { cursor: default; }
.coach-sec[open] > summary { color: var(--text); }
.coach-sec ul, .coach-sec ol { margin: 0 0 8px; padding-left: 20px; }
.coach-sec li { margin-bottom: .45em; line-height: 1.5; }
.coach-sec p { margin: 0 0 .6em; }
.coach-feed { list-style: none; padding: 0 !important; margin: 0 0 6px !important; }
.coach-msg { padding: 8px 10px; border-radius: 8px; background: var(--surface-2);
             border-left: 3px solid var(--line-firm); margin-bottom: 7px !important; font-size: 14.5px; }
.coach-msg:first-child { border-left-width: 4px; }
.coach-msg:not(:first-child) { opacity: .82; }
.coach-kind { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-right: 3px; }
.coach-msg--good, .pr-tip--good { border-left-color: var(--brass); }
.coach-msg--good .coach-kind, .pr-tip--good .coach-kind { color: var(--brass); }
.coach-msg--warn, .pr-tip--warn { border-left-color: var(--accent); }
.coach-msg--warn .coach-kind, .pr-tip--warn .coach-kind { color: var(--accent); }
.coach-msg--lesson, .pr-tip--lesson { border-left-color: var(--text); }
.coach-empty { color: var(--muted); font-size: 14px; }
.coach-stats { font-size: 14px; margin: 0 0 10px; }
.coach-stats th, .coach-stats td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.coach-stats tr:first-child th { font-size: 11px; }
.coach-stats th[scope="row"] { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 500; }
.coach-prog-note { font-size: 13px; color: var(--muted); margin: 0 0 10px !important; }
.coach-remember-row { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 0 0 4px; }
.coach-remember-row input { margin-top: 4px; accent-color: var(--accent); }
.coach-remember-why { font-size: 13px; color: var(--muted); margin: 0 0 10px !important; }
.coach .btn { font-size: 13.5px; padding: 7px 15px; }
/* Options tab: who you play against (Coach or Master). */
.pr-opts-set { border: 0; margin: 0 0 8px; padding: 0; }
.pr-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; margin: 0 0 8px; border: 1px solid var(--line);
          border-radius: 9px; background: var(--surface-2); cursor: pointer; font-size: 14.5px; line-height: 1.45; }
.pr-opt:has(input:checked) { border-color: var(--accent); }
.pr-opt input { margin-top: 4px; accent-color: var(--accent); }
.pr-opt-note { display: block; color: var(--muted); font-size: 13.5px; }
.pr-opts-now { font-size: 13.5px; color: var(--muted); margin: 0 0 6px !important; }
.coach .term::after { max-width: min(260px, 70vw); }

/* Phone and narrow tablet: the Coach drops under the board. A pill jumps to
   it, and the newest tip is mirrored onto the board so nothing is missed. */
.coach-jump { display: none; }
@media (max-width: 899px) {
  .pr-layout { grid-template-columns: minmax(0, 1fr); }
  .coach { position: static; max-height: none; overflow: visible; }
  .pr-tip:not([hidden]) { display: block; }
  .coach-jump {
    display: inline-block; position: fixed; z-index: 40;
    right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
    background: var(--text); color: var(--bg); text-decoration: none; box-shadow: var(--shadow);
    transition: opacity .15s ease;
  }
  .coach-jump--away { opacity: 0; pointer-events: none; }
  .pr-board { min-height: 0; }
}
@media (max-width: 560px) {
  .gin-board { padding: 16px 12px; }
  /* Thirteen cards in two or three ragged rows is hard to read; overlap them
     so a Spades hand fits on one or two even rows. */
  .s-hand, .h-hand { gap: 0; padding-left: 12px; }
  .s-hand .gcard, .h-hand .gcard { margin-left: -12px; box-shadow: -2px 0 3px rgba(18,20,26,.12); }
  .h-hand { row-gap: 8px; }
}

/* ---------- the fixed-board layout (.pr-layout.pr-fixed) ----------
   Like a chess site: the board fills the screen under the sticky header and never moves, and the Coach is a rail
   beside it. The rail has three tabs (Coach, Rules, Gear) that scroll on their own, and the board's buttons sit at
   its foot (#<board>-dock, see practice.js), with the narrated deal's controls in the same place
   (#<watch panel>-dock, see watch.js). On a phone the rail is a sheet under the board: closed, it shows the newest
   tip and the buttons; "More coaching" opens it. A page opts in with the class; the others are unchanged. */
.pr-fixed {
  --pr-gap: 16px;
  height: calc(100dvh - var(--pr-top, 67px) - var(--pr-title, 40px) - 10px - var(--pr-gap));
  min-height: 420px; max-height: 1000px;
  grid-template-columns: minmax(0, 1fr) 360px; align-items: stretch; gap: 20px;
  margin-bottom: 0;
}
/* A fixed window, like a chess site: the page itself never scrolls. Header, one slim title line and the game fill
   the window; only the Coach tabs scroll inside. The introduction and links live in the Rules tab, and the site
   footer stays in the page for search engines but out of the window (its legal links are repeated in Rules). */
html:has(.pr-fixed), body:has(.pr-fixed) { height: 100%; overflow: hidden; }
body:has(.pr-fixed) .site-footer { display: none; }
.article:has(.pr-fixed) { padding: 10px 0 0; }
.pr-about .lede { font-size: 15px; margin: 0 0 10px; }
.pr-about .link-list { font-size: 14.5px; }
.pr-legal { font-size: 13px; color: var(--muted); }
.pr-titlebar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; height: var(--pr-title, 40px); overflow: hidden; }
.pr-titlebar h1 { font-size: 20px; margin: 0; line-height: 1.6; }
.pr-titlebar .pr-links { font-size: 14px; }
.pr-intro { margin: 0 0 22px; }
.pr-intro .crumb { margin-bottom: 8px; }
.pr-fixed .pr-main { display: flex; flex-direction: column; min-height: 0; }
.pr-fixed .pr-mode { margin-bottom: 10px; }
.pr-fixed .pr-board:not([hidden]) { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.pr-fixed .pr-tip, .pr-fixed ~ .coach-jump { display: none !important; }
.pr-fixed .pr-status { margin-bottom: 10px; }
/* the table takes whatever height is left, with the seats centered in it, and the hand sits on the bottom edge */
/* The board is a size container: its cards are sized from the room it actually has, so the table and the hand
   fit any window without the board scrolling. --tc is a table card's height, --hw a hand card's width (the hand
   always fits 13 cards on one row, overlapping by a quarter), both capped at comfortable sizes. */
.pr-fixed .pr-board:not([hidden]) { container: board / size; overflow: hidden; }
.pr-fixed .pr-board > * { flex-shrink: 0; }
.pr-fixed .pr-board > .h-table { container: table / size; flex: 1 1 0; min-height: 0; overflow: hidden; align-content: space-evenly; margin-bottom: 1.5cqh; padding: 1cqh 10px; row-gap: 0; }
/* the hand is sized from the board, the table's cards from the table's own leftover height (three rows of a name
   and a card), so whatever the status line and the hand take, the table fills the rest */
.pr-fixed .h-hand { --hw: min(calc((100cqw - 30px) / 10), 62px, 11cqh); }
.pr-fixed .h-seat { --tc: clamp(22px, calc((100cqh - 84px) / 3), 76px); }
/* A short board (a small laptop window, a phone) seats the table in one row - West, North, East, You - so the
   cards keep a readable size; the status line above already says what the middle would. */
@container board (max-height: 470px) {
  .pr-fixed .h-hand { --hw: min(calc((100cqw - 30px) / 10), 62px, 13cqh); }
  /* (cq units here measure the table, the nearest container: one row of a name and a card) */
  .pr-fixed .h-seat { --tc: clamp(22px, min(calc(100cqh - 48px), calc((25cqw - 10px) / .71)), 70px); }
  .pr-fixed .pr-board > .h-table { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "w n e s"; align-content: center; column-gap: 4px; }
  .pr-fixed .h-table .h-center { display: none; }
  .pr-fixed .h-table .h-seatlbl { white-space: normal; font-size: 11.5px; line-height: 1.25; text-align: center; }
  .pr-fixed .h-table .h-count { display: none; }
}
@container board (max-width: 520px) {
  .pr-fixed .h-table .h-seatlbl { white-space: normal; }
}
/* A narrow board with height to spare (most phones): the hand takes two rows of bigger cards, easier to tap. */
@container board (max-width: 520px) and (min-height: 471px) {
  .pr-fixed .pr-board .h-hand { flex-wrap: wrap; row-gap: 6px; --hw: min(calc((100cqw - 30px) / 5.6), 60px, 10cqh); }
}
.pr-fixed .h-table .gcard, .pr-fixed .h-table .gcard--empty { height: var(--tc); width: calc(var(--tc) * .71); }
.pr-fixed .h-table .gcard .gr { font-size: max(12px, calc(var(--tc) * .28)); }
.pr-fixed .h-table .gcard .gs { font-size: max(11px, calc(var(--tc) * .26)); }
.pr-fixed .h-seat { gap: 2px; }
.pr-fixed .h-seatlbl { white-space: nowrap; }
.pr-fixed .h-handlbl { margin: 0 0 6px; }
.pr-fixed .h-hand { margin: 0; flex-wrap: nowrap; gap: 0; padding-left: calc(var(--hw) * .25); }
.pr-fixed .h-hand .gcard { width: var(--hw); height: calc(var(--hw) * 1.4); margin-left: calc(var(--hw) * -.25); box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.pr-fixed .h-hand .gcard .gr { font-size: max(13px, calc(var(--hw) * .33)); }
.pr-fixed .h-hand .gcard .gs { font-size: max(12px, calc(var(--hw) * .3)); }
.pr-fixed .wv-stage { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: safe center; margin: 0; }
/* a narrow board overlaps the narrated table's spread-out hands, so a full hand fits the width */
@container board (max-width: 520px) {
  .pr-fixed .wv-cards { flex-wrap: nowrap; }
  .pr-fixed .wv-cards--loose .gcard + .gcard { margin-left: -9px; box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
}
/* a short board drops the narrated table's small print (the narration in the rail says the same) */
@container board (max-height: 470px) {
  .pr-fixed .wv-legend, .pr-fixed .wv-caption + .wv-caption { display: none; }
  .pr-fixed .wv-stage { padding: 2px 4px; }
  .pr-fixed .wv-table4 { row-gap: 1px; }
}

.pr-fixed .coach {
  position: static; max-height: none; height: 100%; overflow: hidden; padding: 0;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.pr-grip { display: none; }
/* fixed rows, so a part that is hidden (the phone's grip, the closed tabs) never shifts the others */
.pr-fixed .pr-grip { grid-row: 1; }
.pr-fixed .pr-tabs { grid-row: 2; }
.pr-fixed .pr-panel { grid-row: 3; }
.pr-fixed .pr-dock { grid-row: 4; }
.pr-tabs { display: flex; border-bottom: 1px solid var(--line); }
.pr-tabs [role="tab"] {
  flex: 1; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); padding: 12px 6px 9px;
}
.pr-tabs [role="tab"]:hover { color: var(--text); }
.pr-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.pr-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.pr-panel { position: relative; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 4px 18px 12px; }
.pr-panel > .coach-goal { margin-top: 10px; }
.pr-more { font-size: 14px; font-weight: 700; margin: 10px 0 4px; }
.pr-dock { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--surface); }
.pr-dock .g-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
/* two to a row (a lone last button takes the row); a short set of buttons stays on one line on a phone, below */
.pr-dock .g-controls .btn { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 9px 10px; font-size: 14.5px; line-height: 1.25; }
.pr-dock .g-controls .btn--buy:not([hidden]) { flex-basis: 100%; font-size: 16px; padding: 11px; }
.pr-dock .g-controls [hidden] { display: none; }
.pr-dock .g-controls .g-note { flex-basis: 100%; margin: 0; }

/* Watching: the narration takes the top of the Coach tab, its controls stay at the foot of the rail
   (sticky, as .wv-controls already is), and the game's buttons and live tips step aside. */
.pr-wdock { display: none; }
.pr-fixed.pr-watching .pr-wdock { display: block; padding-top: 10px; }
.pr-fixed.pr-watching .pr-dock, .pr-fixed.pr-watching .coach-goal { display: none; }
.pr-wdock .wv-say { min-height: 0; }
.pr-wdock .wv-controls { margin: 0 -18px; padding: 10px 18px 12px; border-top: 1px solid var(--line); box-shadow: none; }
.pr-wdock .wv-head { margin-bottom: 10px; }

/* Gear: product picks, never inside the coaching itself */
.pr-gear-title { font-size: 17px; margin: 12px 0 4px; }
.pr-gear-lede { font-size: 14.5px; color: var(--muted); }
.pr-pick { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }
.pr-pick h4 { margin: 0 0 4px; font-size: 15.5px; }
.pr-pick p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.pr-pick .btn { font-size: 14px; padding: 8px 16px; }
.pr-gear .disclosure { font-size: 12.5px; margin: 0 0 12px; }

/* Watching: the narration fills the Coach tab with its controls at the foot; the progress table is about the game. */
.pr-fixed.pr-watching section[aria-labelledby="coach-prog"] { display: none; }
.pr-fixed.pr-watching #pr-p-coach:not([hidden]) { display: flex; flex-direction: column; }
.pr-fixed.pr-watching .pr-wdock { flex: 1 0 auto; display: flex; flex-direction: column; }
.pr-wdock .wv-controls { margin-top: auto; }

/* A short screen (a laptop with its toolbars) gives the board its own scroll rather than squashing the hand. */
@media (min-width: 900px) and (max-height: 760px) {
  .pr-fixed { min-height: 420px; }
  .pr-fixed .pr-status { font-size: 15px; padding: 7px 12px; margin-bottom: 6px; }
  .pr-fixed .h-stats { margin-bottom: 6px; padding-bottom: 6px; }
}

/* Phone and narrow tablet: board on top, the rail as a sheet below it. */
@media (max-width: 899px) {
  .pr-fixed {
    --pr-gap: 8px;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px;
    min-height: 460px; max-height: none;
  }
  .pr-fixed .gin-board { padding: 12px 10px; }
  .pr-fixed .pr-mode { margin-bottom: 6px; }
  /* two buttons share one line; a third (Bridge's bidding practice) wraps, never cut short */
  .pr-fixed .pr-mode { gap: 6px; }
  .pr-fixed .pr-mode .btn { padding: 6px 11px; font-size: 13px; }
  /* with Play with friends beside them, three buttons still fit one line on a phone */
  .pr-fixed .pr-mode:has(.pr-mode-friends) { gap: 5px; }
  .pr-fixed .pr-mode:has(.pr-mode-friends) .btn { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
  .pr-fixed .pr-status { font-size: 13.5px; line-height: 1.4; padding: 7px 10px; margin-bottom: 6px; }
  .pr-fixed .h-handlbl { margin-bottom: 4px; }
  .pr-fixed .h-stats { margin-bottom: 6px; padding-bottom: 6px; }
  .pr-fixed { position: relative; }
  .article:has(.pr-fixed) { --pr-title: 0px; padding-top: 8px; }
  /* the Play / Watch buttons say what the page is; the title stays for screen readers */
  .pr-titlebar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* the header's links on one line, so the board gets the height */
  body:has(.pr-fixed) .site-header .bar { min-height: 0; padding-top: 8px; padding-bottom: 6px; row-gap: 4px; }
  body:has(.pr-fixed) .site-header .nav { flex-wrap: nowrap; overflow-x: auto; gap: 14px; margin-left: 0; width: 100%; }
  body:has(.pr-fixed) .site-header .nav a { font-size: 14px; }
  .pr-fixed .coach {
    height: auto; border-radius: 14px 14px var(--radius) var(--radius);
    grid-template-rows: auto auto auto auto;
  }
  /* closed: the newest tip (or the current narration, scrollable) and the buttons */
  .pr-fixed .coach:not(.pr-open) .pr-panel { max-height: 70px; }
  .pr-fixed.pr-watching .coach:not(.pr-open) .pr-panel { max-height: 190px; }
  /* open: the sheet rises over the board, which keeps its size underneath */
  .pr-fixed .coach.pr-open {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: min(78dvh, 100%);
    grid-template-rows: auto auto minmax(0, 1fr) auto; box-shadow: 0 -10px 24px rgba(18, 20, 26, .3);
  }
  .pr-fixed .pr-grip {
    display: block; width: 100%; border: 0; background: none; cursor: pointer; color: var(--muted);
    font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 0 2px;
  }
  .pr-fixed .pr-grip::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-firm); margin: 0 auto 3px; }
  .pr-fixed .pr-panel { padding: 2px 14px 8px; }
  .pr-fixed .pr-dock { padding: 8px 12px 10px; }
  /* phone: three to a row, the main button too, so the sheet stays short */
  .pr-fixed .pr-dock .g-controls { gap: 6px; }
  .pr-fixed .pr-dock .g-controls .btn, .pr-fixed .pr-dock .g-controls .btn--buy:not([hidden]) { flex: 1 1 calc(33.3% - 4px); padding: 7px 5px; font-size: 13px; line-height: 1.2; }
  .pr-fixed .coach:not(.pr-open) .pr-tabs,
  .pr-fixed .coach:not(.pr-open) .coach-goal,
  .pr-fixed .coach:not(.pr-open) #coach-live,
  .pr-fixed .coach:not(.pr-open) .coach-msg:not(:first-child),
  .pr-fixed .coach:not(.pr-open) section[aria-labelledby="coach-prog"],
  .pr-fixed .coach:not(.pr-open) .wv-head,
  .pr-fixed .coach:not(.pr-open) .wv-why,
  .pr-fixed .coach:not(.pr-open) .wv-speech,
  .pr-fixed .coach:not(.pr-open) .wv-speed-lbl,
  .pr-fixed .coach:not(.pr-open) .wv-jump-lbl { display: none; }
  .pr-fixed .coach:not(.pr-open) .coach-sec { border-top: 0; padding-top: 4px; }
  .pr-fixed .coach:not(.pr-open) .coach-msg { margin: 0 !important; }
  .pr-wdock .wv-controls { margin: 0 -14px; padding: 8px 14px 10px; }
  .pr-wdock .wv-controls .btn { flex: 1 1 auto; }
  .pr-wdock .wv-say { padding: 6px 10px; }
  .pr-wdock .wv-text { font-size: 14.5px; }
}

/* A short phone: the closed sheet is only the buttons (the status line on the board says what to do now); the
   newest tip is one tap away, under "More coaching". */
@media (max-width: 899px) and (max-height: 700px) {
  .pr-fixed:not(.pr-watching) .coach:not(.pr-open) .pr-panel { display: none; }
  .pr-fixed.pr-watching .coach:not(.pr-open) .pr-panel { max-height: 124px; }
}

/* Per-game fixed-board rules for pages without their own *-practice.css, one block per game (docs/fixed-board-rollout.md). */

/* fixed: whist */
/* The dock's note about the gold outline spans the row (phones drop it; the hand's own label says it). */
.pr-dock .g-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; line-height: 1.3; }
.pr-fixed .h-table--inline { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
/* A short or narrow board packs the scoreboard into two columns of small print so the table keeps its height. */
@container board (max-height: 470px) {
  .pr-fixed .h-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; padding-bottom: 4px; margin-bottom: 4px; }
  .pr-fixed .h-stats .g-stat { font-size: 12px; line-height: 1.25; }
  .pr-fixed .h-stats .g-stat b { font-size: 14px; margin-left: 3px; }
  /* one row of four seats: the inline North and You seats become ordinary stacked seats, and the note goes */
  .pr-fixed .h-table--inline { grid-template-areas: "w n e s"; }
  .pr-fixed .h-table--inline .h-seat--n, .pr-fixed .h-table--inline .h-seat--s { display: flex; flex-direction: column; width: auto; }
  .pr-fixed .h-table--inline .h-seat--n > .h-seatlbl:first-child,
  .pr-fixed .h-table--inline .h-seat--s > .h-seatlbl:first-child { text-align: center; }
  .pr-fixed .h-table--inline .h-up { display: flex; flex-direction: column; gap: 0; }
  .pr-fixed .h-table--inline .h-up .h-seatlbl { display: none; }
}
@container board (max-width: 520px) {
  .pr-fixed .h-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; }
  .pr-fixed .h-stats .g-stat { font-size: 12px; line-height: 1.25; }
  .pr-fixed .h-stats .g-stat b { font-size: 14px; margin-left: 3px; }
}
@media (max-width: 899px) {
  .pr-dock .g-note { display: none; }
}
/* The narrated table on a very short board (a small phone): smaller, more overlapped cards so West and East fit on one row each. */
@container board (max-height: 400px) {
  #whist-watch .wv-table4 { row-gap: 0; }
  #whist-watch .wv-info { font-size: 11px; line-height: 1.2; }
  #whist-watch .wv-info-h { font-size: 9.5px; white-space: nowrap; }
  #whist-watch .wv-info--tally .wv-info-v { display: inline; margin-left: 6px; }
  #whist-watch .wv-info--tally .wv-info-v:first-of-type { margin-left: 0; }
  #whist-watch .wv-center { gap: 0 8px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  #whist-watch .wv-center .wv-caption { font-size: 11px; line-height: 1.2; }
  #whist-watch .wv-seat { gap: 0; }
  #whist-watch .wv-name { font-size: 10.5px; line-height: 1.15; }
  #whist-watch .wv-stage { padding-top: 0; padding-bottom: 0; }
  #whist-watch .wv-cards { min-height: 0; }
  #whist-watch .wv-cards .gcard { width: 20px; height: 27px; }
  #whist-watch .wv-cards .gcard .gr { font-size: 11px; }
  #whist-watch .wv-cards .gcard .gs { font-size: 10px; }
  #whist-watch .wv-cards:not(.wv-cards--loose) .gcard + .gcard { margin-left: -11px; }
  #whist-watch .wv-cards--loose .gcard + .gcard { margin-left: 3px; }
  #whist-watch .wv-cards:not(.wv-cards--loose) .gcard.wv-after-ten { margin-left: -11px; }
}
/* end fixed: whist */

/* fixed: spades */
/* One hand of 13 cards, the guess box under it. The hand's cards are sized from the board's width and overlap by a
   quarter, so all 13 always show on one row; the hand, its note and the guess box sit in the middle of the board. */
.pr-fixed #spades-bid .g-stats { margin-bottom: 10px; }
.pr-fixed #spades-bid > .g-lbl { margin-top: auto; }
.pr-fixed #spades-bid .s-answer { margin: 0 0 auto; padding-top: 4px; }
.pr-fixed #spades-bid .s-shape { margin: 0 0 12px; }
.pr-fixed #spades-bid .s-hand { --hw: min(calc((100cqw - 30px) / 10), 84px, 15cqh); flex-wrap: nowrap; gap: 0; margin: 0 0 8px; padding-left: calc(var(--hw) * .25); }
.pr-fixed #spades-bid .s-hand .gcard { width: var(--hw); height: calc(var(--hw) * 1.4); margin-left: calc(var(--hw) * -.25); box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.pr-fixed #spades-bid .s-hand .gcard .gr { font-size: max(13px, calc(var(--hw) * .33)); }
.pr-fixed #spades-bid .s-hand .gcard .gs { font-size: max(12px, calc(var(--hw) * .3)); }
@container board (max-height: 470px) {
  .pr-fixed #spades-bid .s-hand { --hw: min(calc((100cqw - 30px) / 10), 84px, 17cqh); }
  .pr-fixed #spades-bid .s-shape { display: none; }
  .pr-fixed #spades-bid .g-stats { padding-bottom: 4px; margin-bottom: 6px; }
}
/* A narrow board with height to spare (most phones): two rows of bigger cards, easier to tap. */
@container board (max-width: 520px) and (min-height: 471px) {
  .pr-fixed #spades-bid .s-hand { flex-wrap: wrap; row-gap: 6px; --hw: min(calc((100cqw - 30px) / 5.6), 60px, 10cqh); }
}
@container board (max-width: 520px) {
  .pr-fixed #spades-bid .s-answer { gap: 6px; }
  .pr-fixed #spades-bid .s-answer .g-lbl { flex-basis: 100%; }
}
/* end fixed: spades */

/* fixed: euchre */
/* Five cards and the face-up card side by side, sized from the board's width (and its height), so they never wrap.
   The explanation of trump above them gives way on a short board (the Coach's "How Euchre works" says the same). */
.pr-fixed #euchre-bid .g-stats { margin-bottom: 10px; }
.pr-fixed #euchre-bid .e-seat { margin: 0 0 10px; font-size: 14px; }
.pr-fixed #euchre-bid .e-row { --ew: min(calc((100cqw - 90px) / 6.3), 96px, 15cqh); flex-wrap: nowrap; gap: 20px; margin: auto 0 0; align-items: flex-end; }
.pr-fixed #euchre-bid .e-row > div { min-width: 0; flex: 0 0 auto; }
/* the hand never shrinks; the face-up card's column takes what is left, and its label wraps inside it */
.pr-fixed #euchre-bid .e-row > div:last-child { flex: 1 1 0; }
.pr-fixed #euchre-bid .e-hand, .pr-fixed #euchre-bid .e-up { gap: calc(var(--ew) * .1); }
.pr-fixed #euchre-bid .e-row .gcard { width: var(--ew); height: calc(var(--ew) * 1.4); }
.pr-fixed #euchre-bid .e-row .gcard .gr { font-size: max(13px, calc(var(--ew) * .33)); }
.pr-fixed #euchre-bid .e-row .gcard .gs { font-size: max(12px, calc(var(--ew) * .3)); }
.pr-fixed #euchre-bid .e-row .g-lbl { font-size: 10.5px; letter-spacing: .08em; }
.pr-fixed #euchre-bid .e-shape { margin: 8px 0 auto; }
@container board (max-height: 600px) {
  .pr-fixed #euchre-bid .e-seat { display: none; }
  .pr-fixed #euchre-bid .e-row { --ew: min(calc((100cqw - 90px) / 6.3), 96px, 19cqh); }
}
@container board (max-height: 480px) {
  .pr-fixed #euchre-bid .e-shape { display: none; }
}
@container board (max-height: 440px) {
  .pr-fixed #euchre-bid .e-shape { display: none; }
  .pr-fixed #euchre-bid .g-stats { padding-bottom: 4px; margin-bottom: 6px; }
  .pr-fixed #euchre-bid .e-row .g-lbl { margin-bottom: 4px; }
  /* the question above the cards is long: on a very short board it keeps its place and scrolls inside itself */
  .pr-fixed #euchre-bid .pr-status { font-size: 12.5px; line-height: 1.3; padding: 6px 9px; max-height: 8.4em; overflow-y: auto; }
  .pr-fixed #euchre-bid .g-stats { gap: 0 12px; }
  .pr-fixed #euchre-bid .g-stat { font-size: 12px; }
  .pr-fixed #euchre-bid .g-stat b { font-size: 16px; margin: 0 2px 0 4px; }
  .pr-fixed #euchre-bid .e-row { --ew: min(calc((100cqw - 50px) / 6.3), 96px, 14cqh); }
}
@container board (max-width: 520px) {
  .pr-fixed #euchre-bid .e-row { gap: 10px; --ew: min(calc((100cqw - 50px) / 6.3), 96px, 19cqh); }
  .pr-fixed #euchre-bid .e-row .g-lbl { text-transform: none; letter-spacing: 0; font-size: 11px; }
  .pr-fixed #euchre-bid .e-shape { font-size: 12.5px; margin-top: 4px; }
  .pr-fixed #euchre-bid .e-seat { display: none; }
}
/* end fixed: euchre */

/* fixed: rummy-500 */
/* Cards are sized from the board (--rw, a hand card's width, for thirteen cards overlapping a little). The groups on
   the table take the flexible middle; the discard pile, which grows long in this game, sits under them. Each scrolls
   inside its own box only when crowded, and a big hand (after taking much of the pile) wraps onto a second row. */
.pr-fixed #rummy500-trainer > * { --rw: min(calc((100cqw - 40px) / 11.5), 64px, 9.5cqh); }
.pr-fixed #rummy500-trainer .pr-status { margin-bottom: 8px; }
.pr-fixed #rummy500-trainer .g-stats { margin-bottom: 8px; }
.pr-fixed #rummy500-trainer .r-opprow { margin-bottom: 6px; }
.pr-fixed #rummy500-trainer .r-table { flex: 1 1 0; min-height: 0; overflow-y: auto; align-content: flex-start; margin-bottom: 6px; }
.pr-fixed #rummy500-trainer .r-pile { flex: 0 1 auto; max-height: 22cqh; overflow-y: auto; margin-bottom: 6px; gap: 0; padding-left: calc(var(--rw) * .3); }
.pr-fixed #rummy500-trainer .r-pile .gcard { width: calc(var(--rw) * .8); height: calc(var(--rw) * 1.12); margin-left: calc(var(--rw) * -.3); box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.pr-fixed #rummy500-trainer .r-handhead { margin: auto 0 4px; }
.pr-fixed #rummy500-trainer .r-hand { gap: 6px 0; padding-left: calc(var(--rw) * .15); margin: 0; }
.pr-fixed #rummy500-trainer .r-hand .gcard { width: var(--rw); height: calc(var(--rw) * 1.4); margin-left: calc(var(--rw) * -.15); box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.pr-fixed #rummy500-trainer .r-hand .gcard .gr { font-size: max(12px, calc(var(--rw) * .32)); }
.pr-fixed #rummy500-trainer .r-hand .gcard .gs { font-size: max(11px, calc(var(--rw) * .3)); }
.pr-fixed #rummy500-trainer > .g-lbl { margin-bottom: 4px; }
.pr-fixed #rummy500-trainer .r-meldgrp { padding: 4px; gap: 0; padding-left: calc(var(--rw) * .22); }
.pr-fixed #rummy500-trainer .r-meldgrp .gcard { width: max(22px, calc(var(--rw) * .72)); height: max(31px, calc(var(--rw) * 1.01)); margin-left: calc(var(--rw) * -.18); box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.pr-fixed #rummy500-trainer .r-table { gap: 6px; }
@container board (max-width: 520px) {
  .pr-fixed #rummy500-trainer .g-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .pr-fixed #rummy500-trainer .g-stat { font-size: 11.5px; }
  .pr-fixed #rummy500-trainer .g-stat b { font-size: 16px; }
  .pr-fixed #rummy500-trainer .g-stat--row { grid-column: 1 / -1; }
  .pr-fixed #rummy500-trainer > .g-lbl, .pr-fixed #rummy500-trainer .r-handhead .g-lbl { font-size: 10px; line-height: 1.3; }
}
@container board (max-height: 470px) {
  .pr-fixed #rummy500-trainer .g-sub { display: none; }
  .pr-fixed #rummy500-trainer > .g-lbl { font-size: 10px; line-height: 1.25; }
}
/* a small phone: the long labels stay for screen readers only (the status line says what to do now) */
@container board (max-height: 470px) and (max-width: 520px) {
  .pr-fixed #rummy500-trainer > .g-lbl, .pr-fixed #rummy500-trainer .r-handhead .g-lbl, .pr-fixed #rummy500-trainer .r-opprow .g-lbl {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
  }
  .pr-fixed #rummy500-trainer .r-handhead { margin: auto 0 0; }
}
/* end fixed: rummy-500 */

/* fixed: gin-rummy */
/* Cards are sized from the board's width (eleven fit on a row once you have drawn) and capped by its height; the
   opponent's backs overlap; the hand and your groups sit on the bottom edge, the spare height above them. */
.pr-fixed #gin-trainer > * { --gw: min(calc((100cqw - 40px) / 9.9), 72px, 11cqh); }
.pr-fixed #gin-trainer .gcard { width: var(--gw); height: calc(var(--gw) * 1.4); border-radius: calc(var(--gw) * .14); }
.pr-fixed #gin-trainer .gcard .gr { font-size: max(12px, calc(var(--gw) * .32)); }
.pr-fixed #gin-trainer .gcard .gs { font-size: max(11px, calc(var(--gw) * .3)); }
.pr-fixed #gin-trainer .g-mine { flex-wrap: nowrap; gap: 0; padding-left: calc(var(--gw) * .15); margin-bottom: 6px; }
.pr-fixed #gin-trainer .g-mine .gcard { margin-left: calc(var(--gw) * -.15); box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.pr-fixed #gin-trainer .g-opp { flex-wrap: nowrap; gap: 0; padding-left: calc(var(--gw) * .32); }
.pr-fixed #gin-trainer .g-opp .gcard { width: calc(var(--gw) * .62); height: calc(var(--gw) * .87); margin-left: calc(var(--gw) * -.32); }
.pr-fixed #gin-trainer .r-opprow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 1.5cqh; }
.pr-fixed #gin-trainer .r-opprow .g-lbl { margin: 0; }
.pr-fixed #gin-trainer .g-piles { flex-wrap: nowrap; gap: 4px 24px; margin-bottom: 1cqh; }
.pr-fixed #gin-trainer .g-piles .g-lbl { margin-bottom: 4px; }
.pr-fixed #gin-trainer .g-handlbl { margin-top: auto; margin-bottom: 6px; }
.pr-fixed #gin-trainer .g-melds { margin: 0; font-size: 14px; min-height: 1.4em; }
@container board (max-width: 520px) {
  .pr-fixed #gin-trainer .g-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; }
  .pr-fixed #gin-trainer .g-stat { font-size: 11.5px; line-height: 1.3; }
  .pr-fixed #gin-trainer .g-stat b { font-size: 16px; }
  .pr-fixed #gin-trainer .g-knockable { grid-column: 1 / -1; font-size: 12px; }
  .pr-fixed #gin-trainer .g-melds { font-size: 13px; }
}
@container board (max-height: 430px) {
  .pr-fixed #gin-trainer > * { --gw: min(calc((100cqw - 40px) / 9.9), 72px, 7.4cqh); }
  .pr-fixed #gin-trainer .g-melds { font-size: 11.5px; line-height: 1.3; }
  .pr-fixed #gin-trainer .g-stats { margin-bottom: 6px; padding-bottom: 4px; }
  /* (kept for screen readers; on a short board the piles and the hand explain themselves) */
  .pr-fixed #gin-trainer .g-piles .g-lbl, .pr-fixed #gin-trainer .g-handlbl {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
  }
  .pr-fixed #gin-trainer .g-mine { margin-top: auto; }
}
/* end fixed: gin-rummy */

/* fixed: cribbage */
/* Five cards (the hand and the starter) on one row, sized from the board: big on a desktop, which has the room, and
   still five across a phone. The answer box sits under them; the note that says "this is the crib" uses body size. */
.pr-fixed #crib-trainer > * { --kw: min(calc((100cqw - 70px) / 5.4), 84px, 14cqh); }
.pr-fixed #crib-trainer .c-deal { flex-wrap: nowrap; gap: clamp(12px, 4cqw, 28px); margin-bottom: 2cqh; }
.pr-fixed #crib-trainer .c-hand, .pr-fixed #crib-trainer .c-starter { gap: max(4px, calc(var(--kw) * .1)); }
.pr-fixed #crib-trainer .c-deal .gcard { width: var(--kw); height: calc(var(--kw) * 1.4); }
.pr-fixed #crib-trainer .c-deal .gcard .gr { font-size: max(13px, calc(var(--kw) * .32)); }
.pr-fixed #crib-trainer .c-deal .gcard .gs { font-size: max(12px, calc(var(--kw) * .3)); }
.pr-fixed #crib-trainer .c-which { font-size: 15px; line-height: 1.45; }
@container board (max-width: 520px) {
  .pr-fixed #crib-trainer > * { --kw: min(calc((100cqw - 70px) / 5.4), 84px, 10cqh); }
  /* the crib note takes a few lines: smaller cards then, so the note keeps its full wording */
  .pr-fixed #crib-trainer:has(.c-which--crib) > * { --kw: min(calc((100cqw - 70px) / 5.4), 84px, 7.5cqh); }
  .pr-fixed #crib-trainer .c-which { font-size: 12.5px; line-height: 1.35; margin-bottom: 6px; }
  .pr-fixed #crib-trainer .g-stats { gap: 2px 14px; }
  .pr-fixed #crib-trainer .c-deal .g-lbl { font-size: 10px; letter-spacing: .06em; }
}
/* end fixed: cribbage */

/* ---------- cardistry diagrams (tools/figures/, docs/cardistry-figures.md) ----------
   Drawn by tools/build.js from the figure modules, in these marks: a card or a packet (tinted so it can be followed
   from panel to panel), a finger dot with its letter, an arrow, a dashed area for a hand, a pivot. */
.cd-fig { margin: 22px 0; }
.cd-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.cd-panels svg { display: block; width: 100%; max-width: 270px; height: auto; }
.cd-fig figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 62ch; }
.cd-key { display: block; margin-top: 3px; font-size: 13px; }
.cd-key b { color: var(--text); }
.cd-panel { fill: var(--surface); stroke: var(--line-firm); stroke-width: 1; }
.cd-card { fill: var(--surface-2); stroke: var(--line-firm); stroke-width: 1.5; }
.cd-p1 { fill: color-mix(in srgb, var(--accent) 24%, var(--surface-2)); stroke: var(--accent); }
.cd-p2 { fill: color-mix(in srgb, var(--brass) 30%, var(--surface-2)); stroke: var(--brass); }
.cd-p3 { fill: color-mix(in srgb, var(--text) 14%, var(--surface-2)); stroke: var(--text); }
.cd-top { stroke-width: 2.4; }
.cd-dot { fill: var(--text); stroke: var(--surface); stroke-width: 1.5; }
.cd-dot-t { fill: var(--surface); font: 700 10px/1 system-ui, sans-serif; text-anchor: middle; }
.cd-pivot { fill: var(--text); }
.cd-arrow { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.cd-head { fill: var(--accent); }
.cd-label { fill: var(--muted); font: 500 11px/1.2 system-ui, sans-serif; }
.cd-zone { fill: none; stroke: var(--line-firm); stroke-width: 1.5; stroke-dasharray: 5 4; }
.cd-zone-t { fill: var(--muted); font: 600 10.5px/1.2 system-ui, sans-serif; letter-spacing: .04em; }
.cd-num-bg { fill: var(--text); }
.cd-num { fill: var(--surface); font: 700 12px/1 system-ui, sans-serif; }
.cd-ptitle { fill: var(--text); font: 700 11.5px/1.2 system-ui, sans-serif; }

/* Old #trainer anchors on the rules pages now land on a short section that
   sends you to the practice page. */
#trainer { scroll-margin-top: 90px; }
.practice-cta {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  border: 1.5px solid var(--line-firm); border-left: 5px solid var(--accent);
  border-radius: var(--radius); background: var(--surface); padding: 18px 20px; margin: 22px 0;
}
.practice-cta p { margin: 0; flex: 1 1 260px; }
.practice-cta .btn { flex: 0 0 auto; }

/* Practice hub: one slim bar per game. A grid of tiles ran far past the bottom of a screen once each
   tile held a paragraph of rules. The game's name is a link stretched over the whole bar, so a click
   anywhere on the bar opens the game; "How it works" opens the longer explanation downward inside the
   same bar and nothing else moves. */
.pr-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.pr-item {
  background: var(--surface); border: 1.5px solid var(--line-firm);
  border-left: 5px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow);
}
.pr-bar {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 0 14px; align-items: center; padding: 14px 18px 4px 16px; border-radius: 10px 10px 0 0;
}
.pr-bar:hover { background: var(--surface-2); }
.pr-suit { font-size: 26px; line-height: 1; text-align: center; align-self: start; padding-top: 1px; }
.pr-bar h3 {
  margin: 0 0 4px; font-size: 21px; line-height: 1.2;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
}
.pr-bar h3 a { text-decoration: none; }
.pr-bar h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 10px 10px 0 0; }
.pr-bar h3 a:focus-visible { outline: none; }
.pr-bar h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.pr-skill { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); }
.pr-blurb { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.pr-go { font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
         color: var(--accent); white-space: nowrap; }
.pr-bar:hover .pr-go { text-decoration: underline; text-underline-offset: 4px; }
.pr-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 2px 20px; padding: 0 18px 8px 60px; }
.pr-meta { order: 3; flex: 0 0 auto; margin: 0; padding-top: 5px; font-size: 13px; line-height: 1.4; color: var(--muted); text-align: right; }
.pr-watch { order: 2; flex: 0 0 auto; margin: 0; padding-top: 5px; font-size: 13px; line-height: 1.4; font-weight: 700; }
.pr-foot .pr-how { order: 1; flex: 1 1 auto; min-width: 0; }
.pr-how > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 0; font-size: 14px; font-weight: 700;
}
.pr-how > summary::-webkit-details-marker { display: none; }
.pr-how > summary::before {
  content: ""; width: 7px; height: 7px; margin: 0 2px 2px 1px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease;
}
.pr-how[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.pr-how > summary:hover { color: var(--accent); }
.pr-how > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.pr-how-body { padding: 4px 0 8px; max-width: 68ch; font-size: 15.5px; }
.pr-how-body p { margin: 0 0 .8em; }
.prose > .pr-how { margin: 0 0 1.1em; }
@media (max-width: 720px) {
  .pr-foot { display: block; padding: 0 14px 8px 12px; }
  .pr-meta { padding: 0 0 2px; text-align: left; }
  .pr-watch { padding: 0 0 2px; }
}
@media (max-width: 560px) {
  .pr-bar { grid-template-columns: 26px minmax(0, 1fr); gap: 0 10px; padding: 12px 14px 4px 12px; }
  .pr-bar h3 { font-size: 20px; }
  .pr-go { grid-column: 2; margin-top: 6px; }
}
.tile--soon { opacity: 1; }
.tile--soon .cta { color: var(--muted); }

/* Windows High Contrast / forced colors (access-13): card backs and states
   are drawn with background images and colors the system replaces. */
@media (forced-colors: active) {
  .gcard { border: 2px solid CanvasText; forced-color-adjust: none; background: Canvas; color: CanvasText; }
  .gcard--back { background: repeating-linear-gradient(45deg, CanvasText 0 2px, Canvas 2px 7px); }
  .gcard--meld { border: 3px double Highlight; }
  .gcard--illegal { opacity: 1; border-style: dashed; color: GrayText; }
  .pr-status, .coach-msg, .pr-tip { border: 1px solid CanvasText; }
}
/* An empty seat is a dashed outline, not a gray card - in dark mode the
   faded ivory face read as a face-down card someone had played. */
.h-table .gcard--empty { background: transparent !important; opacity: 1; border-color: var(--line-firm); }
.h-hand { gap: 4px; }
/* Thirteen cards fit on one row of the board (13 x 44 + 12 x 4 = 620px). */
@media (min-width: 561px) {
  .h-hand .gcard { width: 44px; height: 62px; }
}
.pr-head h1 { font-size: clamp(26px, 3.6vw, 36px); }
.pr-head .lede { font-size: 17.5px; }
.e-seat { font-size: 14.5px; color: var(--muted); margin: 0 0 14px; }
.g-piles { margin-top: 6px; }
.g-opp .gcard--back { width: 34px; height: 48px; }
.g-opp { gap: 4px; margin-bottom: 14px; }
.g-mine { margin-bottom: 10px; }
/* The dark-theme .gcard face rules outrank .gcard--back on their own, which
   turned every face-down card into a blank ivory one. */
.gin-board .gcard.gcard--back {
  background: #F7F3E8 url(/assets/card-back.svg) center / 100% 100% no-repeat;
  border-color: #12141A;
}

/* Rummy 500: melds on the table and the spread discard pile */
.r-table { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; min-height: 40px; }
.r-meldgrp { display: flex; gap: 3px; padding: 6px; border: 1px dashed var(--line-firm); border-radius: 9px; }
.r-meldgrp .gcard { width: 36px; height: 50px; }
.r-meldgrp .gcard .gr { font-size: 13px; }
.r-pile { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; }
.r-hand { margin-bottom: 14px; }
/* Thirteen cards fit on one row of the board (13 x 44 + 12 x 4 = 620px). */
@media (min-width: 561px) {
  .r-hand { gap: 4px; }
  .r-hand .gcard { width: 44px; height: 62px; }
}
/* Rummy 500 is the busiest board, so it is packed tighter: the opponent's name and fanned cards share a
   line, Hint and New deal share the line above the hand, and the four action buttons fit on one row. */
.g-stat--row { flex-basis: 100%; }
.g-sub { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.r-opprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 10px; }
.r-opprow .g-lbl { margin: 0; flex: 0 0 auto; max-width: 100%; }
.r-opprow .g-opp { margin: 0; gap: 4px; min-width: 0; flex: 1 1 auto; }
.r-opprow .g-opp .gcard--back { width: 26px; height: 37px; }
.r-opprow .g-opp .gcard--back + .gcard--back { margin-left: -15px; }
.r-handhead { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.r-handhead .g-lbl { margin: 0; }
.r-tools { display: flex; gap: 8px; }
.r-tools .btn { font-size: 13px; padding: 4px 13px; }
.r-tools .btn:disabled { opacity: .38; cursor: not-allowed; }
.r-tools .btn:disabled:hover { background: transparent; color: var(--text); }
/* More than 13 cards (after a draw, or a long take from the discard pile): narrower cards keep them on one row. */
@media (min-width: 561px) {
  .r-hand.r-hand--tight { gap: 3px; }
  .r-hand.r-hand--tight .gcard { width: 35px; }
}
/* On a phone or tablet the tip appears under the buttons, so Hint and New deal sit under them too, not 300px away. */
@media (max-width: 899px) {
  #rummy500-trainer { display: flex; flex-direction: column; }
  #rummy500-trainer .r-handhead { display: contents; }
  #rummy500-trainer .r-handhead .g-lbl { margin: 0 0 8px; }
  #rummy500-trainer .r-tools { order: 5; margin: 0 0 12px; }
  #rummy500-trainer .pr-tip { order: 6; }
}
.nw { white-space: nowrap; }
#rummy500-trainer .pr-status { margin-bottom: 12px; }
#rummy500-trainer .g-stats { padding-bottom: 6px; margin-bottom: 10px; }
#rummy500-trainer .r-table { min-height: 28px; margin-bottom: 10px; }
#rummy500-trainer .r-pile .gcard { width: 40px; height: 56px; }
#rummy500-trainer .r-pile { margin-bottom: 12px; }
.gcard.r-must { box-shadow: 0 0 0 3px var(--accent); }
.gcard[aria-pressed="true"] { transform: translateY(-6px); }

/* ---------- narrated "watch a game" mode (watch.js) ----------
   Every hand is face up, so the cards are small and overlap; the narration and the
   controls sit under the table so the whole panel stays about one screen tall. */
.pr-mode { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pr-mode .btn { font-size: 14px; padding: 7px 16px; }
.pr-mode .btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.wv-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; margin: 0 0 8px; }
.wv-title { margin: 0; font-size: 16px; font-weight: 700; }
.wv-progress { order: 3; flex-basis: 100%; margin: 0; font-size: 13px; color: var(--muted); }
.wv-head-links { display: flex; gap: 12px; }
.wv-link { border: 0; background: none; padding: 2px 0; font-size: 13.5px; font-weight: 600; color: var(--text);
           text-decoration: underline; text-decoration-color: var(--line-firm); text-underline-offset: 3px; border-radius: 0; }
.wv-link:hover { background: none; color: var(--accent); text-decoration-color: var(--accent); }
.wv-stage { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 8px 8px 6px; margin: 0 0 10px; min-height: 150px; }
.wv-seat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.wv-name { margin: 0; font-size: 12px; line-height: 1.25; color: var(--muted); text-align: center; }
.wv-seat--active .wv-name { color: var(--accent); font-weight: 700; }
.wv-name b { color: var(--text); font-weight: 700; }
.wv-cards { display: flex; align-items: center; justify-content: center; min-height: 42px; }
.wv-cards .gcard { width: 30px; height: 42px; border-radius: 5px; border-width: 1.2px; }
.wv-cards .gcard .gr { font-size: 12px; }
.wv-cards .gcard .gs { font-size: 11px; }
.wv-cards .gcard + .gcard { margin-left: -10px; box-shadow: -2px 0 3px rgba(18, 20, 26, .14); }
.wv-cards--loose .gcard + .gcard { margin-left: 4px; box-shadow: none; }
/* A 10 is wider than the other ranks, so the card laid over it is moved over a little and both digits stay readable. */
.wv-cards:not(.wv-cards--loose) .gcard.wv-after-ten { margin-left: -8px; }
.wv-cards .gcard.wv-fresh { outline: 2px solid var(--accent); outline-offset: 1px; position: relative; z-index: 2; }
.wv-cards .gcard.wv-chosen { outline: 2px solid var(--brass); outline-offset: 1px; position: relative; z-index: 2; transform: translateY(-4px); }
.wv-cards .gcard.wv-dim { opacity: .45; }
.wv-none { font-size: 12px; color: var(--muted); }
.wv-cards-block { display: flex; flex-direction: column; gap: 2px; align-items: center; }
/* A four-seat table: North across the top, West and East at the sides, South at the bottom; the middle holds
   the cards played this round, in the order they were played. */
.wv-table4 { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: ". n ." "w c e" ". s ."; gap: 4px 8px; align-items: center; justify-items: center; }
.wv-seat--n { grid-area: n; } .wv-seat--w { grid-area: w; } .wv-seat--e { grid-area: e; } .wv-seat--s { grid-area: s; }
.wv-center { grid-area: c; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 150px; }
.wv-caption { margin: 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.3; }
.wv-played { display: flex; gap: 6px; justify-content: center; align-items: flex-end; min-height: 58px; }
.wv-play { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.wv-play .gcard { width: 34px; height: 48px; }
.wv-play--win .wv-name { color: var(--brass); font-weight: 700; }
.wv-played .gcard.wv-fresh { outline: 2px solid var(--accent); outline-offset: 1px; position: relative; z-index: 1; }
.wv-played .gcard.wv-chosen { outline: 2px solid var(--brass); outline-offset: 1px; position: relative; z-index: 1; }
/* A two-seat table (Gin Rummy, Rummy 500): the opponent on top, you at the bottom, shared piles between. */
.wv-table2 { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wv-mid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 6px 18px; min-height: 60px; }
/* Keep the transport controls in one place as the narration changes. Most steps
   use four to seven lines; reserving that space avoids making Back/Play/Next
   jump after every click. Longer explanations can still grow normally. */
.wv-say { border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 9px; padding: 8px 14px 9px; margin: 0 0 6px; min-height: 10.25em; }
.wv-kicker { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wv-text { margin: 0; font-size: 15.5px; line-height: 1.5; }
/* Beats (watch.js): a step is told a sentence at a time. The sentence being told is at full strength, the rest faded;
   the cards it is about wear a white spotlight, on top of any other mark. */
.wv-text .wv-beat { opacity: .45; transition: opacity .2s; }
.wv-text .wv-beat.wv-now { opacity: 1; }
.wv-stage .gcard.wv-focus { box-shadow: 0 0 0 3px #FFFFFF, 0 0 14px 5px rgba(255, 255, 255, .7); scale: 1.07; z-index: 4; }
@media (prefers-reduced-motion: reduce) { .wv-text .wv-beat { transition: none; } }
@media (forced-colors: active) { .wv-stage .gcard.wv-focus { outline: 3px solid Highlight; } }
.wv-why { margin: 0 0 6px; }
.wv-why > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; padding: 2px 0; }
.wv-why:not([open]) > summary::after { content: " (click to open)"; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.wv-options { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 1px; }
.wv-opt { display: grid; grid-template-columns: minmax(34px, auto) 74px 1fr; gap: 0 8px; align-items: baseline; font-size: 14px; line-height: 1.3; }
.wv-opt-label { font-weight: 700; white-space: nowrap; }
.wv-opt-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wv-opt--chosen .wv-opt-tag { color: var(--brass); }
.wv-opt-note { color: var(--muted); }
.wv-opt--chosen .wv-opt-note { color: var(--text); }
/* The controls stay at the bottom edge of the screen when the panel is taller than the screen (a step with its list of
   choices open, or a phone), so Back, Play and Next never fall below the fold. */
.wv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; position: sticky; bottom: 0; z-index: 4;
               background: var(--surface); padding: 8px 0 2px; box-shadow: 0 -8px 8px -8px rgba(18, 20, 26, .28); }
.wv-controls .btn { font-size: 14px; padding: 7px 14px; }
.wv-controls .btn:disabled { opacity: .38; cursor: not-allowed; }
.wv-controls .btn:disabled:hover { background: transparent; color: var(--text); }
.wv-controls label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.wv-controls select { font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface-2);
                      border: 1.5px solid var(--line-firm); border-radius: 8px; padding: 5px 8px; }
.wv-jump-lbl { margin-left: auto; }
@media (max-width: 560px) {
  .wv-opt { grid-template-columns: minmax(30px, auto) 1fr; }
  .wv-opt-tag { display: none; }
  .wv-jump-lbl { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wv-cards .gcard.wv-chosen { transform: none; }
}
.pr-watching #coach section[aria-labelledby="coach-live"] { display: none; }
@media (forced-colors: active) {
  .wv-cards .gcard.gcard--meld { border-width: 3px; }
  .wv-cards .gcard.wv-fresh, .wv-cards .gcard.wv-chosen, .wv-played .gcard.wv-fresh, .wv-played .gcard.wv-chosen { outline-color: Highlight; }
}

/* Game-specific watch styles go between these markers, one block per game, so that games built in
   parallel never touch the same lines. Use the shared .wv-* classes first; add rules only for what is new. */

/* watch: hearts */
/* The Hearts table is the shared four-seat table with three additions: the three cards each player passes
   travel in the four corners (.wv-xfer, one group per sender), the side hands keep one height so the controls
   under the table do not jump as the hands empty, and a phone gets two side hands in a row. */
#hearts-watch .wv-seat--w, #hearts-watch .wv-seat--e { min-height: 99px; justify-content: flex-start; }
#hearts-watch .wv-caption--round { font-weight: 700; color: var(--text); }
#hearts-watch .wv-legend { margin: 5px 0 0; font-size: 12px; line-height: 1.3; color: var(--muted); text-align: center; }
/* In the middle the card just played has the accent outline, and the card that is winning so far (or picks up the pile)
   is raised and outlined in brass, as in the hands. */
#hearts-watch .wv-played .gcard.wv-fresh { outline: 2px solid var(--accent); outline-offset: 1px; }
#hearts-watch .wv-played .gcard.wv-chosen { outline: 2px solid var(--brass); outline-offset: 1px; transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { #hearts-watch .wv-played .gcard.wv-chosen { transform: none; } }
#hearts-watch .wv-xfer { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
#hearts-watch .wv-xfer--tl { grid-column: 1; grid-row: 1; }
#hearts-watch .wv-xfer--tr { grid-column: 3; grid-row: 1; }
#hearts-watch .wv-xfer--bl { grid-column: 1; grid-row: 3; }
#hearts-watch .wv-xfer--br { grid-column: 3; grid-row: 3; }
@media (max-width: 560px) {
  #hearts-watch .wv-table4 { grid-template-columns: 1fr 1fr; grid-template-areas: "n n" "tl tr" "w e" "bl br" "c c" "s s"; gap: 4px 6px; }
  #hearts-watch .wv-xfer--tl { grid-area: tl; } #hearts-watch .wv-xfer--tr { grid-area: tr; }
  #hearts-watch .wv-xfer--bl { grid-area: bl; } #hearts-watch .wv-xfer--br { grid-area: br; }
  #hearts-watch .wv-cards .gcard { width: 28px; height: 40px; }
  #hearts-watch .wv-cards .gcard + .gcard { margin-left: -12px; }
  #hearts-watch .wv-cards--loose .gcard + .gcard { margin-left: 4px; }
  #hearts-watch .wv-cards:not(.wv-cards--loose) .gcard.wv-after-ten { margin-left: -10px; }
}
/* end watch: hearts */

/* watch: whist */
/* The corners beside North and South would be empty, so they hold the trump suit (and the dealer's face-up card)
   and the rounds each team has won: nothing here makes the table taller. */
.wv-whist { grid-template-areas: "tl n tr" "w c e" ". s ."; }
.wv-info { align-self: start; justify-self: stretch; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.wv-info p { margin: 0; }
.wv-info--trump { grid-area: tl; display: flex; align-items: center; gap: 8px; text-align: left; }
.wv-info--tally { grid-area: tr; text-align: right; }
.wv-info-h { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.wv-info-v { font-size: 14px; color: var(--text); }
.wv-info-v b { margin-left: 4px; font-size: 16px; }
.wv-info-note { font-size: 12px; }
.wv-info--trump .wv-cards { min-height: 0; flex: 0 0 auto; }
/* after the last round there are no hands to show: the middle says how the deal ended */
.wv-whist--over .wv-center { min-width: 0; gap: 6px; }
.wv-info--points { text-align: center; justify-self: center; }
/* a gold edge marks a trump, as it does in the playable game; the plain wv-cards border is too thin to see on a small card */
.wv-whist .gcard--meld { border-width: 2px; }
/* in the middle, the card that was just played has the accent outline, and the card that won the round the brass one */
.wv-whist .wv-play .gcard.wv-fresh { outline: 2px solid var(--accent); outline-offset: 1px; }
.wv-whist .wv-play .gcard.wv-chosen { outline: 2px solid var(--brass); outline-offset: 1px; }
/* The table needs about 575px. When the board is narrower (a phone, a small window, the Coach beside the board on a
   screen under about 1040px wide) North, the middle and South stack, and West and East sit side by side. The container
   query asks the question directly; the media queries say the same thing for browsers that do not have it. */
#whist-watch .wv-stage { container: wvstage / inline-size; }
@container wvstage (max-width: 580px) {
  .wv-whist { grid-template-columns: 1fr 1fr; grid-template-areas: "tl tr" "n n" "c c" "w e" "s s"; }
}
@media (max-width: 699px) {
  .wv-whist { grid-template-columns: 1fr 1fr; grid-template-areas: "tl tr" "n n" "c c" "w e" "s s"; }
}
@media (min-width: 900px) and (max-width: 1039px) {
  .wv-whist { grid-template-columns: 1fr 1fr; grid-template-areas: "tl tr" "n n" "c c" "w e" "s s"; }
}
/* end watch: whist */

/* watch: gin rummy */
/* Each hand is its groups side by side (gold), then the cards in no group; the draw and discard piles sit between. */
.gw-hand { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; }
.gw-hand .wv-cards { min-height: 0; }
.gw-hand .wv-cards .gcard.gcard--meld { border-width: 2px; }
.gw-mid { min-height: 0; align-items: center; gap: 4px 28px; }
.gw-pile { display: flex; align-items: center; gap: 8px; }
.gw-pile .wv-cards { min-height: 42px; }
.gw-pile .wv-caption { text-align: left; line-height: 1.25; }
.gw-pile-name, .gw-pile-count { display: block; }
.gw-pile-count { font-weight: 700; color: var(--text); }
/* The controls fit on one row at laptop width, and the gaps are a little tighter, so the whole panel stays about
   one screen tall even with the list of choices open. */
#gin-watch .wv-controls { gap: 6px 8px; }
#gin-watch .wv-controls .btn { padding: 7px 14px; }
#gin-watch .wv-head { margin-bottom: 4px; }
#gin-watch .wv-stage { margin-bottom: 6px; padding-top: 6px; }
#gin-watch .wv-say { margin-bottom: 6px; }
#gin-watch .wv-why { margin-bottom: 6px; }
#gin-watch .wv-options { gap: 1px; }
#gin-watch .wv-opt { line-height: 1.3; }
/* On a phone the groups sit closer together so a hand of eleven stays on one row, and the list is a little smaller. */
@media (max-width: 420px) {
  .gw-hand { gap: 4px 8px; }
  .gw-mid { column-gap: 14px; }
  #gin-watch .wv-opt { font-size: 13px; }
}
@media (forced-colors: active) {
  .gw-hand .wv-cards .gcard.gcard--meld { border-width: 3px; }
}
/* end watch: gin rummy */

/* watch: rummy 500 */
/* North on top, South at the bottom. In the middle: the draw pile and the discard pile (spread out, oldest card first) side by
   side, and below them every group on the table. A group is a small dashed box; cards South laid have a gold outline. */
.r5-empty .wv-cards { min-height: 0; }
/* On a wide screen a hand has its name on its left instead of above it, which saves a line of height per hand. */
@media (min-width: 640px) {
  .r5-table > .wv-seat { flex-direction: row; justify-content: center; align-items: center; gap: 4px 12px; width: 100%; }
  .r5-table > .wv-seat .wv-name { flex: 0 1 190px; text-align: right; }
  /* A hand of more than 14 cards comes in two parts (so a phone can show it in two rows); here the parts run on in one
     row when there is room and wrap when there is not. */
  .r5-table > .wv-seat .wv-cards-block { flex: 1 1 0; min-width: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 2px 0; padding-left: 10px; }
  .r5-table > .wv-seat .wv-cards-block .wv-cards { margin-left: -10px; }
}
/* The lists of choices here are denser than in the other games, so their rows are a little smaller. */
#rummy500-watch .wv-opt { font-size: 13px; line-height: 1.3; }
#rummy500-watch .wv-options { gap: 2px; }
.r5-mid { width: 100%; align-items: flex-start; gap: 4px 16px; min-height: 0; }
.r5-lbl { margin: 0 0 2px; font-size: 11.5px; line-height: 1.25; color: var(--muted); text-align: center; }
.r5-draw { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.r5-pile { flex: 1 1 170px; min-width: 0; }
.r5-pile .r5-lbl { text-align: left; }
.r5-pile .wv-cards { flex-wrap: wrap; justify-content: flex-start; padding-left: 9px; row-gap: 3px; min-height: 0; }
.r5-pile .wv-cards .gcard, .r5-pile .wv-cards .gcard + .gcard { margin-left: -9px; }
.r5-groups { flex: 1 0 100%; display: flex; flex-direction: column; align-items: center; }
.r5-grouprow { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.r5-group { border: 1px dashed var(--line-firm); border-radius: 8px; padding: 3px 4px; }
.r5-group .wv-cards { min-height: 0; }
.r5-group .wv-cards .gcard.gcard--meld { border-width: 2px; }
/* the piles and groups use slightly smaller cards than the hands, so a long pile and several groups stay on few lines */
.r5-pile .wv-cards .gcard, .r5-group .wv-cards .gcard { width: 27px; height: 38px; }
.r5-pile .wv-cards .gcard .gr, .r5-group .wv-cards .gcard .gr { font-size: 11.5px; }
.r5-pile .wv-cards .gcard .gs, .r5-group .wv-cards .gcard .gs { font-size: 10.5px; }
.r5-group .wv-cards .gcard + .gcard { margin-left: -9px; }
/* end watch: rummy 500 */

/* ---------- table look (opt-in: add .tbl to a game page's .pr-main, .felt to its table) ----------
   The card room from the animated Hearts explainer: ivory cards with a corner index, a big
   middle suit and an upside-down corner, on green felt with a wooden rail. A game opts in, so
   each one can be laid out and checked on its own. Small cards (under 40px inside) keep the
   plain centred rank and suit, which is what still reads at that size. */
.tbl .gcard {
  background-color: #F7F3E8; color: #12141A;
  border: 1px solid rgba(18, 20, 26, .38); border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .28);
  position: relative; container-type: size;
}
.tbl .gcard--red { color: #C0272D; }
.tbl .gcard--back { background: #F7F3E8 url(/assets/card-back.svg) center / 100% 100% no-repeat; border-color: #12141A; }
.tbl .gcard.gcard--meld { background-color: #FFF3C4; border: 3px solid var(--brass); box-shadow: 0 0 0 3px #E8B931, 0 0 12px 3px rgba(232, 185, 49, .55); }
.tbl .gcard--empty { background: transparent; box-shadow: none; border: 2px dashed rgba(245, 239, 225, .45); }
.tbl .gcard .gpip, .tbl .gcard .gidx2 { display: none; }
@container (min-width: 40px) {
  .tbl .gcard .gr { position: absolute; top: 4cqw; left: 7cqw; font-size: 26cqw; font-weight: 700; line-height: 1; }
  .tbl .gcard .gs { position: absolute; top: 31cqw; left: 7cqw; font-size: 21cqw; line-height: 1; }
  .tbl .gcard .gpip { display: grid; place-items: center; position: absolute; inset: 0; font-size: 50cqw; line-height: 1; }
  .tbl .gcard .gpip::before { content: attr(data-s); }
  .tbl .gcard .gidx2 { display: flex; flex-direction: column; align-items: flex-start; position: absolute; bottom: 4cqw; right: 7cqw; transform: rotate(180deg); line-height: 1; }
  .tbl .gcard .gidx2::before { content: attr(data-r); font-size: 26cqw; font-weight: 700; }
  .tbl .gcard .gidx2::after { content: attr(data-s); font-size: 21cqw; margin-top: 2cqw; }
}
/* A card in a row of cards shows only its top corner, as in a fanned hand; the upside-down corner of a
   covered card would peek out as stray bits. A card on its own (played, on a pile) keeps both. */
.tbl .gcard:has(+ .gcard) .gidx2, .tbl .gcard + .gcard .gidx2 { display: none; }
.tbl button.gcard:not([disabled]):hover { transform: translateY(-8px); }

/* The felt, as tokens, so each game's own stylesheet can lay it on its own table:
   background: var(--felt-bg); box-shadow: var(--felt-rail); text on it is --felt-ink / --felt-muted,
   a panel on it --felt-panel with a --felt-line border, and gold (whose turn, chosen) --felt-gold. */
:root {
  --felt-bg: radial-gradient(ellipse 75% 70% at 50% 45%, #2A6A4F, #1F4D3A 55%, #163A2B);
  --felt-rail: inset 0 0 0 7px #3A2A1C, inset 0 0 0 9px #4D3826, inset 0 0 40px rgba(0, 0, 0, .5);
  --felt-ink: #EBE6D7; --felt-muted: #C9D8CF; --felt-gold: #E8B931;
  --felt-panel: rgba(10, 30, 22, .45); --felt-line: rgba(235, 230, 215, .3);
}
/* The tables on the felt. Inside one, the site's own colour tokens are redefined for the felt, so
   every game's labels, panels and borders turn light without a rule of their own; the cards keep
   their ivory because .tbl .gcard sets its colours outright. A game joins by adding its table here
   (or the .felt class in its markup, where no test pins it). */
.felt,
.tbl .ce-table, .tbl .om-table, .tbl .ru-mid, .tbl .pn-table, .tbl .br-table,
.tbl #canasta-trainer .c-table, .tbl #hand-and-foot-trainer .hf-table,
.tbl #whist-trainer .h-table, .tbl #rummy500-trainer .r-table, .tbl #gin-trainer .g-piles {
  background: var(--felt-bg); box-shadow: var(--felt-rail); border: 0; border-radius: 18px;
  color: var(--felt-ink); padding: 14px 16px;
  --text: var(--felt-ink); --ink: var(--felt-ink); --muted: var(--felt-muted); --accent: var(--felt-gold);
  --surface: var(--felt-panel); --surface-2: var(--felt-panel); --line: var(--felt-line); --line-firm: var(--felt-line);
  --suit-red: #C0272D; --suit-red-bg: #F5EFE1; --suit-red-pad: 0 .2em;
}

/* The narrated deals: the same felt under every watch table (watch.js draws each game's table in
   .wv-stage). Each game's stage keeps its own padding, which is sized so a step fits one screen, so
   the rail is drawn thinner here to sit inside that padding rather than add to it. */
.tbl .wv-stage {
  background: var(--felt-bg); border: 0; border-radius: 14px; color: var(--felt-ink);
  box-shadow: inset 0 0 0 3px #3A2A1C, inset 0 0 0 4px #4D3826, inset 0 0 30px rgba(0, 0, 0, .45);
  --text: var(--felt-ink); --ink: var(--felt-ink); --muted: var(--felt-muted); --accent: var(--felt-gold);
  --surface: var(--felt-panel); --surface-2: var(--felt-panel); --line: var(--felt-line); --line-firm: var(--felt-line);
  --suit-red: #C0272D; --suit-red-bg: #F5EFE1; --suit-red-pad: 0 .2em;
}
/* Every key says "Red outline: the card that just moved", but on the felt the accent is gold, which the
   keys use for other marks. So a card that just moved keeps a red outline here, bright enough to read on
   green, whatever colour a game's own rule gives it. */
.tbl .wv-stage .gcard.wv-fresh { outline-color: #FF5148 !important; }

/* Hearts, the pilot: a bigger table on the felt, and the hand as an overlapping fan. */
.tbl .h-table { padding: 16px 18px; gap: 4px 18px; margin-bottom: 10px; }
.tbl .h-table .gcard, .tbl .h-table .gcard--empty { width: 50px; height: 70px; }
.felt .h-seatlbl { color: #C9D8CF; font-size: 13px; }
.felt .h-seat--active .h-seatlbl { color: #E8B931; }
.felt .h-count { color: #EBE6D7; border-color: rgba(235, 230, 215, .4); }
.felt .h-center { color: #EBE6D7; font-size: 14px; max-width: 190px; }
@media (min-width: 561px) {
  .tbl .h-hand { gap: 0; padding-top: 10px; }
  .tbl .h-hand .gcard { width: 54px; height: 76px; }
  .tbl .h-hand .gcard + .gcard { margin-left: -10px; }
  /* In a fanned hand only the top corner shows, as in a real one; the bottom corner of a covered card
     would peek out as stray bits. */
  .tbl .h-hand .gcard:not(:last-child) .gidx2 { display: none; }
}

/* Cribbage: hands counted out loud (cribbage-watch.js). The hand and the starter side by side, what has been counted
   so far as tags under them, and the running total. */
.cw-table { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100%; }
.cw-row { display: flex; gap: 28px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.cw-lines { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: 14px; color: var(--text); }
.cw-lines li { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.cw-total { margin: 2px 0 0; font-weight: 700; font-size: 16px; color: var(--accent); }
.cw-intro { margin: 0; font-size: 16px; color: var(--muted); text-align: center; }

/* Quick quiz at the foot of a rules page (assets/quiz.js). Without the script the
   choices are a lettered list and each answer opens from its own "Show the answer". */
.quiz-list { margin: 0; padding-left: 1.4em; }
.quiz-q { margin: 0 0 26px; }
.quiz-ask { font-weight: 700; margin: 0 0 8px; }
.quiz-opts { list-style: upper-alpha; margin: 0 0 8px; padding-left: 1.4em; }
.quiz--live .quiz-opts { list-style: none; padding-left: 0; }
.quiz-opt { display: block; width: 100%; text-align: left; font: inherit; line-height: 1.4; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-firm); border-radius: 10px; padding: 10px 14px; margin: 0 0 8px; cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-opt:disabled { cursor: default; color: var(--muted); }
.quiz-right .quiz-opt { border: 2px solid var(--brass); color: var(--text); }
.quiz-right .quiz-opt::after { content: " \2713  right answer"; font-weight: 700; color: var(--brass); white-space: nowrap; }
.quiz-wrong .quiz-opt { border: 2px solid var(--accent); color: var(--text); }
.quiz-wrong .quiz-opt::after { content: " \2717  your answer"; font-weight: 700; color: var(--accent); white-space: nowrap; }
.quiz-verdict { font-weight: 700; margin: 4px 0 2px; }
.quiz-verdict--right { color: var(--brass); }
.quiz-verdict--wrong { color: var(--accent); }
.quiz-why > summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.quiz--live .quiz-why > summary { display: none; }
.quiz-why p { margin: 6px 0 0; }
.quiz-score { font-weight: 700; margin: 8px 0 0; }
.quiz-again { font: inherit; font-weight: 700; color: var(--on-accent); background: var(--accent); border: 0; border-radius: 999px; padding: 6px 16px; margin-left: 6px; cursor: pointer; }
.quiz-again:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ==========================================================================
   November 2026 refresh: page furniture
   Long pages read as a wall of text because every section looked the same.
   These give a page rhythm (bands), a place for the answer (.answer), real
   pictures of what we recommend (.pick-card), and drawn cards where a rule
   talks about cards (.pc). Used first on the playing home page, the poker
   guide and the Hearts rules page.
   ========================================================================== */

/* The footer's column headings are labels, not section headings. */
.site-footer h2 { font-family: inherit; }
.site-footer { background: var(--band); border-top: 0; margin-top: 0; }

/* ---------- section bands ---------- */
.band { background: var(--band); }
.band--felt {
  background: var(--felt-bg); color: var(--felt-ink);
  --text: var(--felt-ink); --ink: var(--felt-ink); --muted: var(--felt-muted); --accent: var(--felt-gold);
  --line: var(--felt-line); --line-firm: var(--felt-line);
  --suit-red: #B3262C; --suit-red-bg: #F7F3E8; --suit-red-pad: 0 3px;
}
.band--felt a { text-decoration-color: rgba(235, 230, 215, .45); }
.band--felt a:hover { text-decoration-color: var(--felt-gold); }
.band--felt .btn { border-color: var(--felt-ink); color: var(--felt-ink); }
.band--felt .btn:hover { background: var(--felt-ink); color: #163A2B; }
/* Cards on the felt are ivory card faces with ink text, like real cards. */
.band--felt .game-tile {
  background: #FFFDF7; border-color: transparent; color: #12141A;
  --text: #12141A; --muted: #50545D; --accent: #C0272D;
  box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 10px 22px -12px rgba(0,0,0,.6);
}
.band--felt .game-tile a { color: #12141A; text-decoration-color: rgba(18,20,26,.3); }
.band--felt .game-tile h3 a:hover { color: #C0272D; }
.section-head { max-width: 760px; margin-bottom: 26px; }
.section-head h2 { margin-top: .2em; }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- buttons ---------- */
.btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }

/* ---------- the short answer ----------
   The first thing on a guide: what we would buy, and why, in two lines. */
.answer {
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  padding: 22px 24px; margin: 24px 0 30px;
}
.answer .tag { color: var(--accent); }
.answer h2 { font-size: clamp(20px, 2.6vw, 25px); margin: .25em 0 .4em; }
.answer p { margin: 0 0 .7em; }
.answer p:last-child { margin-bottom: 0; }

/* ---------- top pick: picture, verdict, button ---------- */
.top-pick {
  display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 26px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow); padding: 24px; margin: 0 0 34px;
}
.top-pick .tag { color: var(--accent); }
.top-pick h2 { margin: .2em 0 .3em; font-size: clamp(22px, 3vw, 28px); }
.top-pick p { margin: 0 0 .8em; }
@media (max-width: 620px) { .top-pick { grid-template-columns: 1fr; } .top-pick .art { max-width: 220px; } }

/* A product picture. Drawn until the maker allows its photo; the caption says which. */
.art { margin: 0; background: var(--band); border-radius: var(--radius); padding: 14px; text-align: center; }
.art img { display: block; width: 100%; height: auto; max-height: 230px; object-fit: contain; margin: 0 auto; }
/* A maker's own photo sits on white in both themes, like the product photos elsewhere. */
.art--photo { background: #FFFFFF; }
.art figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- product picks as cards ---------- */
.pick-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin: 0 0 34px; }
@media (min-width: 720px) { .pick-grid { grid-template-columns: 1fr 1fr; } }
/* A group with one pick: the card takes the full row instead of half of it. */
.pick-grid > .pick-card:only-child { grid-column: 1 / -1; }
/* Exactly three picks: one row of three on a wide screen, so none sits alone. The
   rules pages keep two columns, since their text column is narrower. */
@media (min-width: 1000px) {
  .pick-grid:has(> .pick-card:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
  .rules-main .pick-grid:has(> .pick-card:nth-child(3):last-child) { grid-template-columns: 1fr 1fr; }
}
.pick-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
}
.pick-card .art { border-radius: 0; padding: 18px 18px 10px; }
.pick-card .art img { max-height: 170px; }
.pick-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1 1 auto; }
.pick-card .rank-label {
  display: inline-block; align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.pick-card h3 { margin: 0 0 4px; font-size: 19px; }
.pick-card .who { margin: 0 0 10px; font-weight: 600; font-size: 15px; }
.pick-card ul { margin: 0 0 10px; padding-left: 18px; font-size: 15px; }
.pick-card li { margin-bottom: .3em; }
.pick-card .note { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.pick-card .links { margin: auto 0 0; }
.pick-card .btn { width: 100%; text-align: center; }

/* ---------- questions that fold ---------- */
.faq { border-top: 1px solid var(--line); margin: 10px 0 30px; max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 34px 16px 0; position: relative;
  font-weight: 700; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 12px; font-size: 24px; font-weight: 400; color: var(--muted);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > :not(summary) { margin: 0 0 16px; }

/* ---------- three short reasons, side by side ---------- */
.choose { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 6px 0 30px; }
.choose > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.choose h3 { margin: 0 0 6px; font-size: 17px; }
.choose p { margin: 0; font-size: 15.5px; }

/* ---------- a game at a glance: four big facts ---------- */
.glance {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  margin: 26px 0 10px; overflow: hidden;
}
.glance > div { padding: 16px 18px; border-left: 1px solid var(--line); }
.glance > div:first-child { border-left: 0; }
.glance b { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 26px; line-height: 1.1; }
.glance span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
@media (max-width: 640px) {
  .glance { grid-template-columns: 1fr 1fr; }
  .glance > div:nth-child(3) { border-left: 0; }
  .glance > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- a drawn playing card, in a line of text or a row ----------
   <span class="pc">7<i>&clubs;</i></span>, or .pc--red for hearts and diamonds.
   Ivory face, ink or crimson index: the logo's own card. */
.pc {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 1.9em; height: 2.6em; vertical-align: -0.8em; margin: 0 .12em;
  background: #FFFDF7; color: #12141A; border: 1px solid rgba(18,20,26,.28); border-radius: .28em;
  font-weight: 700; font-size: .92em; line-height: 1; box-shadow: 0 1px 2px rgba(18,20,26,.12);
}
.pc i { font-style: normal; font-size: 1em; margin-top: .1em; }
.pc--red { color: #C0272D; }
.pc-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 16px; }
.pc-row .pc { font-size: 19px; margin: 0; vertical-align: 0; }
.pc-row .eq { font-weight: 700; margin: 0 6px; }

/* ---------- numbered steps as cards ---------- */
.steps { list-style: none; counter-reset: step; margin: 14px 0 24px; padding: 0; display: grid; gap: 12px; }
.steps > li {
  counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 16px 62px; margin: 0;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%; background: var(--text); color: var(--bg);
  font-weight: 700; font-size: 15px;
}
.steps > li p:last-child { margin-bottom: 0; }

/* ---------- the passing rotation: four small tables ---------- */
.pass-cycle { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 20px; }
.pass-cycle figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px 10px; text-align: center; }
.pass-cycle img { width: 100%; max-width: 120px; height: auto; display: block; margin: 0 auto; }
.pass-cycle figcaption { font-size: 14px; margin-top: 6px; }
.pass-cycle figcaption b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 560px) { .pass-cycle { grid-template-columns: 1fr 1fr; } }

/* ---------- rules page: text column beside a sticky contents list ---------- */
.rules-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
.rules-layout > .prose { max-width: var(--measure); }
.side-toc { position: sticky; top: 92px; font-size: 14.5px; border-left: 2px solid var(--line); padding-left: 16px; }
.side-toc .tag { margin-bottom: 8px; }
.side-toc ol { list-style: none; margin: 0; padding: 0; }
.side-toc li { margin: 0 0 8px; }
.side-toc a { text-decoration: none; color: var(--muted); }
.side-toc a:hover { color: var(--text); }
@media (max-width: 960px) { .rules-layout { grid-template-columns: 1fr; } .side-toc { display: none; } }
.rules-layout h2 { scroll-margin-top: 90px; }
/* A grid item will not shrink below its widest child unless told to; without this a
   wide table or card row pushed the whole rules column off a phone screen. */
.rules-main { min-width: 0; }

/* ---------- gear row (home): a guide with a picture ---------- */
.gear-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.gear {
  display: flex; flex-direction: column; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gear:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(18,20,26,.06), 0 16px 30px -16px rgba(18,20,26,.32); }
.gear .art { border-radius: 0; padding: 16px; }
.gear .art img { max-height: 130px; }
.gear .body { padding: 14px 18px 18px; }
.gear h3 { margin: 0 0 4px; font-size: 18px; }
.gear p { margin: 0; font-size: 14.5px; color: var(--muted); }
.gear .pickline { margin-top: 10px; font-size: 14px; color: var(--text); }
.gear .pickline b { color: var(--accent); }

/* A drawn card inside a table cell sits on the text line, not below it. */
td .pc { vertical-align: middle; margin: 0 8px 0 0; font-size: 15px; }

/* .section sets vertical padding only, so a .section.wrap lost the side gutter .wrap gives. */
.section.wrap { padding-left: 20px; padding-right: 20px; }

/* ---------- phone menu ----------
   Below 760px the links fold behind a Menu button (assets/menu.js adds
   .has-menu only once it is running, so without it the links still show). */
.menu-btn {
  display: none; margin-left: auto; font: inherit; font-weight: 700; font-size: 15px;
  padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--line-firm);
  background: transparent; color: var(--text); cursor: pointer;
}
@media (max-width: 760px) {
  .has-menu .menu-btn { display: inline-block; }
  .has-menu .nav { display: none; }
  .has-menu.menu-open .nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    width: 100%; margin: 0 0 10px; border-top: 1px solid var(--line);
  }
  .has-menu.menu-open .nav a { padding: 13px 2px; font-size: 17px; border-bottom: 1px solid var(--line); color: var(--text); }
  .site-header .bar { min-height: 58px; }
}

/* No picture without the maker's permission (docs/style-guide.md). A top
   pick or gear card with no photo is all text: one column, and the gear card
   shows its suit, the way the router tiles do. */
.top-pick:not(:has(.art)) { grid-template-columns: 1fr; border-left: 4px solid var(--accent); }
.top-pick .who, .pick-card .who { font-weight: 600; }
.pick-card { border-top: 3px solid var(--line-firm); }
.gear-suit { display: block; font-size: 30px; line-height: 1; padding: 20px 18px 0; color: var(--text); }
.gear-suit.suit--red { color: var(--accent); }

/* ---------- a game's cartoon, top of its rules page ----------
   Drawn from the game's name or story (tools/game-art.js). The small (i)
   opens the one-line story behind the picture; it is a <details>, so it
   works with a tap, a click or the keyboard, and needs no script. */
.game-art { float: right; position: relative; width: 150px; margin: 0 0 12px 22px; }
.game-art img { display: block; width: 100%; height: auto; }
.art-why { position: absolute; right: 2px; bottom: 2px; }
.art-why summary {
  list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--text);
  border: 1.5px solid var(--line-firm); font: italic 700 16px/1 "Source Serif 4", Georgia, serif;
  box-shadow: var(--shadow);
}
.art-why summary::-webkit-details-marker { display: none; }
.art-why[open] summary { background: var(--text); color: var(--bg); }
.art-why p {
  position: absolute; right: 0; top: 38px; z-index: 20; width: min(280px, 80vw); margin: 0;
  background: var(--ink); color: var(--ivory); font-size: 14.5px; line-height: 1.45;
  padding: 12px 14px; border-radius: 10px; box-shadow: 0 10px 28px -10px rgba(0,0,0,.55);
}
@media (max-width: 600px) { .game-art { width: 104px; margin-left: 14px; } }
