/* Poker Master — ported from go-master so the Master series stays visually identical.
   Some blocks below style pages that do not exist yet and are kept deliberately, not by accident:
     .nav-play / .nav-badge      sidebar links for Play and Review        (Phases 4, 8)
     .review-*                   the review ladder page                   (Phase 8)
     .moves / .mv-*              the move list, reused by the hand replayer (Phase 8)
     .play-side / .caps / .score the play page's side rail                (Phase 4)
   Go's stone-specific move dots (.mvdot) were removed; nothing in poker uses them.
   Visual decisions live in tokens.css — comment there, not here. */
/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-2);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: var(--fs-4); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
h2 { font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-top: var(--s-7); margin-bottom: var(--s-3); }
h3 { font-size: var(--fs-2); font-weight: 600; margin-top: var(--s-6); margin-bottom: var(--s-2); }
p { margin: 0 0 var(--s-4); }
ul, ol { padding-left: 1.4em; margin: 0 0 var(--s-4); }
li { margin-bottom: var(--s-1); }
blockquote { margin: var(--s-5) 0; padding: 0 0 0 var(--s-4); border-left: 1px solid var(--line-2); color: var(--ink-2); }
blockquote p:last-child { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 0.93em; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
strong { font-weight: 600; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.small { font-size: var(--fs-1); color: var(--ink-2); }

/* ---------- buttons (metar-taf: filled black primary, outlined uppercase secondary) ---------- */
.btn {
  /* a centred box, so any extra height (the 40px touch target on phones) stays even above and below the text */
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 14px; border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  cursor: pointer; transition: border-color 150ms, background 150ms;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: 8px 22px; font-size: 12px; letter-spacing: 0.1em; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.quiet { border-color: var(--line-2); color: var(--ink-2); }
.btn.quiet:hover { color: var(--accent); border-color: var(--accent); }
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--ink-2); padding: 0;
  transition: border-color 150ms, color 150ms;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app > div { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); padding: var(--s-6) var(--s-5) var(--s-5);
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.brand .brand-text { color: inherit; text-decoration: none; }
.brand .logo-btn { display: block; padding: 0; border: 0; background: none; cursor: pointer; color: var(--accent); border-radius: var(--bubble-tile-radius); }
.brand .logo-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.brand .logo { width: 44px; height: 44px; margin: -6px 0 0 -6px; display: block; }
.topbar .brand { flex-direction: row; align-items: center; gap: var(--s-3); }
.topbar .brand .logo { width: 31px; height: 31px; margin: 0; }

/* the family bubble: liquid glass just below the logo, its left edge on the logo's own left grid line */
.brand .logo-wrap { position: relative; display: block; }
.family {
  position: absolute; left: 1px; top: calc(100% - 7px + var(--bubble-gap)); z-index: 30; width: 220px;   /* 1px / 7px: where the logo's grid sits inside its viewBox */
  padding: 8px; border-radius: var(--bubble-radius); overflow: hidden;
  background: var(--bubble-fallback);
  box-shadow: inset 0 0 0 1px var(--bubble-rim), 0 0 0 0.5px var(--bubble-edge), var(--bubble-shadow);
  transform-origin: 0 0; transform: scale(0.85) translateY(-8px); opacity: 0;
  transition: transform var(--bubble-anim) cubic-bezier(0.2, 0.8, 0.2, 1), opacity var(--bubble-anim);
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.family::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--bubble-sheen); pointer-events: none; }
.family > * { position: relative; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .family { background: var(--bubble-bg); -webkit-backdrop-filter: blur(var(--bubble-blur)) saturate(var(--bubble-saturate)); backdrop-filter: blur(var(--bubble-blur)) saturate(var(--bubble-saturate)); }
}
.family.open { transform: none; opacity: 1; }
.topbar .family { left: 5px; top: calc(100% - 5px + var(--bubble-gap)); }
.family-title { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); padding: 6px 12px; }
.family-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--bubble-row-radius);
  color: var(--ink); text-decoration: none; transition: background 120ms;
}
.family-item:hover, .family-item:focus-visible { background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 0.5px var(--bubble-rim); outline: none; }
.family-item.next { color: var(--ink-3); cursor: default; }
.family-item.next .family-tile { color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 0.5px var(--bubble-rim); }
.family-item.next:hover { background: transparent; box-shadow: none; }
.family-tile {
  flex: none; width: 40px; height: 40px; border-radius: var(--bubble-tile-radius); color: var(--app-accent);
  background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 0.5px var(--bubble-rim), 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex; align-items: center; justify-content: center;
}
.family-tile svg { width: 26px; height: 26px; display: block; }
.family-name { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.brand small { display: block; font-size: 10px; font-weight: 500; letter-spacing: 0.08em; color: var(--ink-3); margin-top: 4px; text-transform: none; }
.curriculum { flex: 1; padding: 0 var(--s-3) var(--s-4); }
.track { margin-bottom: var(--s-2); }
.track-head {
  display: flex; align-items: center; gap: var(--s-2); width: 100%;
  padding: var(--s-2) var(--s-2); border: 0; background: none; cursor: pointer; text-align: left;
}
.track-head:hover .name { color: var(--ink); }
.track-head .num { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); width: 1.4em; }
.track-head .name { flex: 1; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.track-head .bar { width: 36px; height: 2px; background: var(--line); overflow: hidden; }
.track-head .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 300ms; }
.track-head .chev { color: var(--ink-3); transition: transform 150ms; font-size: 8px; }
.track.open .track-head .chev { transform: rotate(90deg); }
.lessons { list-style: none; margin: 0; padding: 0 0 var(--s-2) calc(1.4em + var(--s-2) + var(--s-2)); display: none; }
.track.open .lessons { display: block; }
.lesson-link {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 5px var(--s-2); text-decoration: none; font-size: var(--fs-1); color: var(--ink-2);
}
.lesson-link:hover { color: var(--ink); }
.lesson-link.current { color: var(--accent); font-weight: 600; }
.lesson-link.planned { color: var(--ink-3); pointer-events: none; }
.lesson-link .tick { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line-2); flex: none; display: grid; place-items: center; }
.lesson-link.done .tick { background: var(--accent); border-color: var(--accent); }
.lesson-link.done .tick::after { content: ""; width: 4px; height: 7px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: translateY(-1px) rotate(45deg); }
.lesson-link.started .tick { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.lesson-link .soon { margin-left: auto; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.sidebar-footer { padding: var(--s-4) var(--s-5) var(--s-5); border-top: 1px solid var(--line); }
.sidebar-tools { display: flex; align-items: center; justify-content: flex-start; gap: var(--s-2); margin-top: var(--s-3); }

.main { padding: var(--s-8) var(--s-7); min-width: 0; }
.page { max-width: var(--page-w); margin: 0; }
.prose { max-width: var(--measure); }
/* lesson body: text keeps the reading measure, boards and game viewers may use the full page width; everything centred */
.lesson-body { max-width: none; }
.lesson-body > :not(figure):not(.blk) { max-width: var(--measure); }
.topbar { display: none; }
.scrim { display: none; }

/* ---------- home ---------- */
.hero { max-width: var(--measure); margin: 0 0 var(--s-7); }
.hero h1 { margin: var(--s-3) 0 var(--s-4); }
.hero p { font-size: var(--fs-2); color: var(--ink-2); }
.hero-cite { font-size: 11px; letter-spacing: 0.06em; color: var(--ink-3); margin: calc(-1 * var(--s-3)) 0 var(--s-4); }
.hero-cite cite { font-style: italic; }
.hero-cite a { color: inherit; }
.card { border: 1px solid var(--line); padding: var(--s-5); background: var(--surface); }
.continue { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.continue h3 { margin: var(--s-1) 0 0; }
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-4); }
.track-card { text-decoration: none; display: flex; flex-direction: column; gap: var(--s-2); min-height: 140px; transition: border-color 150ms; }
.track-card:hover { border-color: var(--accent); }
.track-card h3 { margin: 0; }
.track-card p { color: var(--ink-2); font-size: var(--fs-1); margin: 0; flex: 1; }
.track-card .meta { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.switch-row { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-6) 0 var(--s-4); font-size: var(--fs-1); color: var(--ink-2); }
.switch { position: relative; width: 34px; height: 18px; border-radius: 9px; background: var(--line-2); border: 0; cursor: pointer; padding: 0; transition: background 150ms; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 150ms; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* ---------- lesson ---------- */
.lesson-head { margin: 0 0 var(--s-6); max-width: var(--measure); padding-bottom: var(--s-5); border-bottom: 1px solid var(--line); }
.lesson-head h1 { margin: var(--s-3) 0 var(--s-3); }
.lesson-head .lede { font-size: var(--fs-2); color: var(--ink-2); margin: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--fs-1); }
.lesson-nav a { text-decoration: none; color: var(--ink-2); }
.lesson-nav a:hover { color: var(--ink); }
.lesson-nav .next { text-align: right; }
.lesson-nav .eyebrow { display: block; margin-bottom: 2px; }
.complete-row { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-7); padding: var(--s-4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: var(--fs-1); }
.complete-row .msg { color: var(--ink-2); }
.complete-row.done .msg { color: var(--accent); font-weight: 600; }
.complete-row .count { font-family: var(--font-mono); color: var(--ink-3); }
.sources { margin: var(--s-7) 0 0; padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--fs-0); color: var(--ink-2); max-width: var(--measure); }
.sources ul { padding-left: 1.2em; }
.sources li { margin-bottom: var(--s-2); overflow-wrap: anywhere; }
.callout { border-left: 1px solid var(--ink); padding: var(--s-2) var(--s-4); margin: var(--s-5) 0; max-width: var(--measure); }
.callout p:last-child { margin: 0; }
details.more { border-top: 1px solid var(--line); margin: var(--s-5) 0; }
details.more:last-of-type { border-bottom: 1px solid var(--line); }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) 0; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; width: 18px; height: 18px; border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 400; color: var(--ink-3); flex: none; font-size: 12px; }
details.more[open] > summary::before { content: "–"; border-color: var(--accent); color: var(--accent); }
details.more > summary:hover { color: var(--accent); }
details.more > .more-body { padding-bottom: var(--s-4); }
.puzzle-intro { font-size: var(--fs-1); color: var(--ink-2); margin: var(--s-6) 0 var(--s-3); }


/* ---------- board: full square, no decoration ---------- */
.board-wrap { width: 100%; max-width: var(--board-max); aspect-ratio: 1; position: relative; min-width: 0; margin: 0; }
.board-wrap[style*="--board-size:9"], .board-wrap[style*="--board-size: 9"] { max-width: min(var(--board-max), 420px); }
.board-wrap[style*="--board-size:13"], .board-wrap[style*="--board-size: 13"] { max-width: min(var(--board-max), 480px); }
.board-figure { margin: var(--s-5) 0 var(--s-6); }
.board-figure.with-aside { display: grid; grid-template-columns: min(var(--board-max), 58%) minmax(0, 1fr); gap: var(--s-6); align-items: end; }
.board-figure.with-aside figcaption { grid-column: 1; }
.board-aside { grid-column: 2; grid-row: 1; align-self: end; }
.board-aside .photo { position: relative; max-width: 240px; background: #f3efe6; padding: 6px; border: 1px solid var(--line); overflow: hidden; }
/* old film: warm monochrome, lifted blacks, soft contrast, grain and a light vignette */
.board-aside img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) sepia(0.32) contrast(0.9) brightness(1.04); }
.board-aside .photo::before { content: ""; position: absolute; inset: 6px; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 52%, rgba(40,30,15,0.38) 100%); mix-blend-mode: multiply; }
.board-aside .photo::after { content: ""; position: absolute; inset: 6px; pointer-events: none; opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.9'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.board-aside .photo.faded img { filter: grayscale(1) sepia(0.32) contrast(1.35) brightness(0.98); }
.board-aside .photo.dark img { filter: grayscale(1) sepia(0.32) contrast(0.85) brightness(1.15); }
.board-aside .credit { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: var(--s-2); max-width: 260px; }
@media (max-width: 900px) { .board-figure.with-aside { grid-template-columns: minmax(0, 1fr); } .board-aside { grid-column: 1; grid-row: auto; } }
.board-figure figcaption { font-size: var(--fs-1); color: var(--ink-2); margin: var(--s-3) 0 0; max-width: var(--board-max); }



/* ---------- review ---------- */
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; background: var(--accent); color: var(--accent-ink); border-radius: 2px; padding: 1px 5px; }
.review-bar { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-5); }
.review-bar[hidden] { display: none; }   /* display:flex would otherwise beat the browser's [hidden] rule */
.review-count { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.review-progress { flex: 1; height: 2px; background: var(--line); }
.review-progress i { display: block; height: 100%; background: var(--accent); transition: width 200ms; }
.review-from { font-size: var(--fs-1); color: var(--ink-3); margin-bottom: var(--s-2); }
.review-from a { color: var(--ink-2); }
.review-next { margin-top: var(--s-4); }
.review-done { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.review-done h3 { margin: var(--s-1) 0; }

/* ---------- game viewer / exercise ---------- */
.game, .exercise {
  display: grid; grid-template-columns: min(var(--board-max), 58%) minmax(0, 1fr);
  gap: var(--s-5); margin: var(--s-5) 0 var(--s-7); outline: none;
}
.game > *, .exercise > * { min-width: 0; }
.game:focus-visible .board-wrap, .exercise:focus-visible .board-wrap { outline: 1px solid var(--accent); outline-offset: 2px; }
.game-controls { display: flex; gap: 0; margin-top: var(--s-3); }
.game-controls .icon-btn { width: 36px; margin-right: -1px; }
.game-controls .spacer { flex: 1; }
.game-side { min-width: 0; display: flex; flex-direction: column; }
.game-head { padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); margin-bottom: var(--s-3); }
.game-players { font-size: var(--fs-2); font-weight: 600; line-height: 1.3; }
.game-meta { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.game-note { font-size: var(--fs-1); color: var(--ink-2); min-height: 3.2em; margin-bottom: var(--s-3); line-height: 1.5; }
.moves {
  display: flex; flex-wrap: wrap; gap: 2px 0; align-content: flex-start;
  font-family: var(--font-mono); font-size: 12px; max-height: 420px; overflow-y: auto; padding-right: var(--s-2);
}
.moves .mv { border: 0; background: none; padding: 2px 6px; cursor: pointer; font: inherit; width: calc((100% - 3.2em) / 2); text-align: left; }
.moves .mv:hover { background: var(--surface-2); }
.moves .mv.current { background: var(--accent); color: #fff; }
.moves .mv { width: calc(100% / 3); }
.moves .mv-comment { width: 100%; font-family: var(--font-sans); font-size: var(--fs-1); color: var(--ink-2); padding: var(--s-2) 0 var(--s-2) 0.4em; line-height: 1.45; }
.moves .mv-break { width: 100%; height: 0; }
.moves .mv-result { width: 100%; color: var(--ink-3); padding: var(--s-2) 0 0 0.4em; }
.moves .mv-alt { padding-top: 0; padding-bottom: var(--s-1); color: var(--ink-3); }
.mv-vars .mv-var, .game-vars .mv-var { font: inherit; }
.moves .mv-var { border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.game-vars { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.game-vars-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-right: var(--s-1); }
.game-vars .mv-var.chosen { border-color: var(--accent); color: var(--accent); }

.exercise-side { display: flex; flex-direction: column; gap: var(--s-3); }
.exercise-side .turn { display: flex; align-items: center; gap: var(--s-2); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.turn-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; }
.turn-dot.b { background: var(--ink); }
.turn-dot { display: inline-block; vertical-align: -1px; }
.game-caps { display: flex; align-items: center; gap: 6px; font-size: 12px; font-family: var(--font-mono); color: var(--ink-2); }
.exercise-side .prompt { font-size: var(--fs-2); }
.exercise-side .status { min-height: 1.6em; font-size: var(--fs-1); color: var(--ink-2); }
.exercise-side .status.good { color: var(--good); }
.exercise-side .status.bad { color: var(--bad); }
.exercise-side .hint { font-size: var(--fs-1); color: var(--ink-2); font-style: italic; }
.exercise-side .actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: auto; }
.exercise.solved .board-wrap { outline: 2px solid var(--good); outline-offset: 0; }

/* ---------- prose tables ---------- */
.lesson-body table { border-collapse: collapse; margin: var(--s-4) 0; font-size: var(--fs-1); }
.lesson-body th, .lesson-body td { text-align: left; padding: 6px 18px 6px 0; border-bottom: 1px solid var(--line); }
.lesson-body th { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
/* set by js/lesson.js, per column, only where every cell in the column is a number */
.lesson-body td.num, .lesson-body th.num { font-family: var(--font-mono); text-align: right; padding-right: 22px; }
.lesson-body th.num { font-family: var(--font-sans); }
/* the first column is the row's label even when it holds a number, so it stays left and anchors the row */
.lesson-body tr > .num:first-child { text-align: left; }


/* ---------- play page ---------- */
.nav-play { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); margin-bottom: var(--s-3); text-decoration: none; border-bottom: 1px solid var(--line); }
.nav-play .num { font-size: 9px; color: var(--ink-3); width: 1.4em; }
.nav-play .name { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.nav-play:hover .name, .nav-play.current .name { color: var(--accent); }
.play { display: grid; grid-template-columns: min(var(--board-max), 58%) minmax(0, 1fr); align-items: start; gap: var(--s-6); margin: var(--s-5) 0 var(--s-7); }
.play > * { min-width: 0; }
.play-left { min-width: 0; }
.play-left .game-controls { max-width: var(--board-max); gap: var(--s-2); }
.play-side { display: flex; flex-direction: column; gap: var(--s-4); }
.play-side .turn { display: flex; align-items: center; gap: var(--s-2); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.seg { display: flex; }
.seg .btn { margin-right: -1px; }
.seg-wrap { flex-wrap: wrap; row-gap: 4px; }
.opp-note:empty { display: none; }
.opp-note { max-width: 34em; }
.seg .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.play .status { min-height: 1.6em; font-size: var(--fs-1); color: var(--ink-2); }
.play .status.good { color: var(--good); font-weight: 600; }
.play .status.bad { color: var(--bad); }
.play .moves { max-height: 300px; }
.play .moves .mv { cursor: default; display: inline-block; }
.score { display: flex; flex-direction: column; gap: 4px; padding: var(--s-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: var(--fs-1); }
.score[hidden] { display: none; }
.score-row { display: flex; align-items: center; gap: var(--s-2); }
.score-row b { font-family: var(--font-mono); font-size: 14px; }
.score-win { color: var(--accent); font-weight: 600; margin-top: 4px; }


/* ---------- activity grid ---------- */
.activity-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; width: 100%; }
.activity-grid i { aspect-ratio: 1; background: var(--act-0); display: block; }
.activity-grid i.l1 { background: var(--act-1); } .activity-grid i.l2 { background: var(--act-2); }
.activity-grid i.l3 { background: var(--act-3); } .activity-grid i.l4 { background: var(--act-4); }
.activity-grid i.today { outline: 1px solid var(--accent); outline-offset: -1px; }
.activity-stats { display: flex; justify-content: space-between; margin-top: var(--s-2); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.activity-stats b { color: var(--accent); font-weight: 600; }


/* ---------- responsive ---------- */
/* a drill with a poker table: the table at its full width beside the question, or the question under it
   when both will not fit — js/exercise.js decides, from the table's natural width */
@media (min-width: 901px) {
  .exercise.has-table { grid-template-columns: var(--ex-table-w) minmax(0, 1fr); }
  .exercise.has-table.table-below { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .game, .exercise, .play { grid-template-columns: minmax(0, 1fr); }
  .moves { max-height: 260px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); transition: transform 200ms; z-index: 20; box-shadow: 0 0 40px rgba(0,0,0,0.12); }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 15; display: none; }
  .scrim.open { display: block; }
  .topbar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
  .topbar .brand { padding: 0; }
  .main { padding: var(--s-5) var(--s-4) var(--s-8); }
  h1 { font-size: var(--fs-3); }

  /* phones: thumbs, not pointers — taller buttons, and the words above the board so that feedback is visible while tapping */
  .btn, .icon-btn { min-height: 40px; }
  .game-controls .icon-btn { width: 44px; height: 44px; }
  .exercise { gap: var(--s-3); }
  .exercise-side { display: contents; }
  .exercise-side .turn { order: -3; }
  .exercise-side .prompt { order: -2; }
  .exercise-side .status { order: -1; min-height: 1.6em; }
  .exercise-board { order: 0; margin-bottom: var(--s-2); }
  .exercise-side .hint { order: 1; }
  .exercise-side .actions { order: 2; }
  .play { gap: var(--s-4); }
  .play-side { display: contents; }
  .play-side .turn { order: -2; }
  .play-side .status { order: -1; }
  .play-left { order: 0; }
  .play-side .field, .play-side .caps, .play-side .score, .play-side .play-moves { order: 1; }
  .play-side .score { order: 0; }
  .moves .mv { width: calc(100% / 3); min-height: 32px; }
  .moves { max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-table .card.deal, .pk-table .chip.move { animation: none; }
  .family { transition: none; }
  .switch::after, .track-head .bar i { transition: none; }
}

/* the poker table — js/table.js draws it as SVG; everything visual is here, tokens in tokens.css */
.table-wrap { max-width: var(--table-max); margin: 0 0 var(--s-5); }
svg.pk-table { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pk-table .felt { fill: var(--tb-felt); }
.pk-table .rail { fill: none; stroke: var(--tb-rail); stroke-width: var(--tb-rail-w); }
.pk-table .pot { font-size: 17px; font-weight: 600; letter-spacing: var(--track); fill: var(--tb-pot-ink); opacity: 0.95; }
.pk-table .street { font-size: 15px; letter-spacing: var(--track); fill: var(--tb-pot-ink); opacity: 0.6; }

.pk-table .seat-name { font-size: 17px; font-weight: 600; letter-spacing: 0.06em; fill: var(--ink); }
.pk-table .seat-detail { font-size: 15px; letter-spacing: 0.04em; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.pk-table .hero .seat-name { fill: var(--accent); }
.pk-table .allin .seat-detail { fill: var(--bad); font-weight: 600; }
.pk-table .folded { opacity: 0.34; }
/* the position tag rides on the name line, set small and quiet */
.pk-table .seat-tag { font-weight: 700; letter-spacing: 0.08em; fill: var(--ink-3); }
.pk-table .act-ring { fill: none; stroke: var(--accent); stroke-width: 2.5; }
/* the hero is always ringed, quietly, so your own seat is found by shape and not by reading names */
.pk-table .hero-ring { fill: var(--tb-seat-hero); stroke: var(--accent); stroke-width: 1.5; opacity: 0.9; }

.pk-table .portrait .av-disc { fill: var(--av-disc); }
.pk-table .portrait .av-figure { fill: var(--av-tint); }
.pk-table .portrait.tint-0 { --av-tint: var(--av-0); }
.pk-table .portrait.tint-1 { --av-tint: var(--av-1); }
.pk-table .portrait.tint-2 { --av-tint: var(--av-2); }
.pk-table .portrait.tint-3 { --av-tint: var(--av-3); }
.pk-table .portrait.tint-4 { --av-tint: var(--av-4); }
.pk-table .portrait.tint-5 { --av-tint: var(--av-5); }
.pk-table .portrait.tint-6 { --av-tint: var(--av-6); }
.pk-table .portrait.tint-7 { --av-tint: var(--av-7); }
.pk-table .portrait.tint-8 { --av-tint: var(--av-8); }

.pk-table .bet-t { font-size: 14px; font-weight: 700; letter-spacing: 0.02em; fill: var(--tb-bet-ink); }
.pk-table .bet-rule { stroke: var(--tb-bet-rule); stroke-width: 1.5; }
.pk-table .dealer { fill: var(--tb-dealer); stroke: var(--ink-2); stroke-width: 1.2; }
.pk-table .dealer-t { font-size: 13px; font-weight: 700; fill: var(--ink); }

/* Cards are drawn by one function in js/table.js into more than one kind of picture — the table, and the
   hand comparison in showdown and ranking drills, and the hand rankings chart. EVERY picture that holds cards belongs in this list:
   SVG fills black by default, and the hand comparison shipped that way, a row of black rectangles, from
   the day it was added until someone looked. scripts/render-table.mjs checks the list. */
:is(.pk-table, .pk-hands, .pk-cards) .card rect { fill: var(--card-face); stroke: var(--card-edge); stroke-width: 1; rx: var(--card-radius); }
:is(.pk-table, .pk-hands, .pk-cards) .card.back rect { fill: var(--card-back); stroke: var(--card-back-edge); }
:is(.pk-table, .pk-hands, .pk-cards) .card .rank { font-weight: 600; }
:is(.pk-table, .pk-hands, .pk-cards) .card :is(.rank, .pip).red { fill: var(--suit-red); }
:is(.pk-table, .pk-hands, .pk-cards) .card :is(.rank, .pip).black { fill: var(--suit-black); }

.pk-table .card.deal { animation: card-deal var(--board-anim) ease-out; }
@keyframes card-deal { from { transform: scale(0.82); opacity: 0.3 } to { transform: scale(1); opacity: 1 } }

.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); max-width: var(--board-max); margin-bottom: var(--s-5); }
.raise-control { display: flex; align-items: center; gap: var(--s-2); flex: 1 1 260px; }
.raise-control input[type=range] { flex: 1; min-width: 110px; }
.raise-amount { font-size: var(--fs-1); font-variant-numeric: tabular-nums; min-width: 5.5em; color: var(--ink-2); }
@media (max-width: 560px) { .table-actions { gap: var(--s-1); } .raise-control { flex-basis: 100%; } }

/* ---------- lesson components: the `table` and `try` fences ---------- */
.table-figure { margin: var(--s-5) 0; }
.table-figure figcaption { font-size: var(--fs-1); color: var(--ink-2); margin-top: var(--s-2); }

.exercise { margin: var(--s-6) 0; padding: var(--s-4) 0 0; border-top: 1px solid var(--line); }
.exercise-table { margin-bottom: var(--s-3); }
.exercise .prompt { font-weight: 600; margin: 0 0 var(--s-3); }
/* Options are content, so they are set like content: a list of rows, sentence case, at reading size.
   The marker carries the letter that mountHands prints beside each hand. No boxes — a border that
   resizes itself around a sentence gives a ragged stack of rectangles, and eighteen of these labels run
   past forty characters. */
:is(.exercise, .gm-opts) .options { display: flex; flex-direction: column; margin-bottom: var(--s-3); border-top: 1px solid var(--line); }
:is(.exercise, .gm-opts) .opt {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: baseline; gap: var(--s-3);
  width: 100%; text-align: left; font: inherit; font-size: var(--fs-2); line-height: 1.45;
  padding: 10px var(--s-2) 10px 0; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); cursor: pointer; transition: color 140ms, background 140ms;
}
:is(.exercise, .gm-opts) .opt .mark {
  font-size: 11px; font-weight: 600; letter-spacing: var(--track); color: var(--ink-2);
  justify-self: center; transition: color 140ms;
}
:is(.exercise, .gm-opts) .opt:hover { background: var(--surface-2); color: var(--accent); }
:is(.exercise, .gm-opts) .opt:hover .mark { color: var(--accent); }
:is(.exercise, .gm-opts) .opt:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
:is(.exercise, .gm-opts) .opt.right { color: var(--good); font-weight: 600; }
:is(.exercise, .gm-opts) .opt.right .mark { color: var(--good); }
:is(.exercise, .gm-opts) .opt.wrong { color: var(--bad); }
:is(.exercise, .gm-opts) .opt.wrong .t { text-decoration: line-through; }
:is(.exercise, .gm-opts) .opt.wrong .mark { color: var(--bad); }
:is(.exercise, .gm-opts) .opt[disabled] { cursor: default; }
:is(.exercise, .gm-opts) .opt[disabled]:not(.right):not(.wrong) { color: var(--ink-3); }
:is(.exercise, .gm-opts) .opt[disabled]:hover { background: none; }

/* No picture, so no second column — the question takes the width instead of being crushed into 42% of
   it. The list is still held to a readable measure rather than stretched to 900px. */
.exercise.no-picture { grid-template-columns: minmax(0, 1fr); }
.exercise.no-picture .exercise-side { max-width: 620px; }
.exercise.no-picture .prompt { font-size: var(--fs-3); line-height: 1.45; }
.exercise .status { font-size: var(--fs-1); min-height: 1.4em; }
.exercise .status.good { color: var(--good); font-weight: 600; }
.exercise .status.bad { color: var(--bad); }
.exercise .why { font-size: var(--fs-1); color: var(--ink-2); border-left: 2px solid var(--line-2); padding-left: var(--s-3); margin: var(--s-2) 0; }
.exercise .why p { margin: 0 0 var(--s-2); }
.exercise .why p:last-child { margin: 0; }
.exercise .actions { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.exercise.solved { border-top-color: var(--good); }
.exercise.broken { border-top-color: var(--bad); }

/* Beginner mode keeps the arithmetic out of the way; Grinder mode lets it through. */
body[data-mode="beginner"] .grinder-only { display: none; }
body[data-mode="grinder"] .beginner-only { display: none; }

/* ---------- two parts, not a numbered ladder ---------- */
.part { margin-bottom: var(--s-5); }
.part-head { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding: var(--s-2) var(--s-2) var(--s-2); border-bottom: 1px solid var(--line); margin-bottom: var(--s-2); }
.lessons.flat { display: block; }
.part-card { display: block; margin-bottom: var(--s-4); }
.part-card p { margin: var(--s-2) 0 var(--s-3); color: var(--ink-2); font-size: var(--fs-1); }
.part-sections { list-style: none; padding: 0; margin: 0 0 var(--s-3); border-top: 1px solid var(--line); }
.part-sections li { border-bottom: 1px solid var(--line); padding: var(--s-3) 0; margin: 0; font-size: var(--fs-1); }
.part-sections b { font-weight: 600; }
.part-sections span { color: var(--ink-2); display: block; margin-top: 2px; }
.part-sections em { font-style: normal; color: var(--ink-3); font-size: var(--fs-0); letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-top: 4px; }
.part-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }

/* A quick trick: a shortcut worth knowing, set apart from the lesson's argument. Visible, not
   collapsed — unlike `+++ Read more`, which is for depth the reader can skip. */
.prose .trick { margin: var(--s-5) 0; padding: var(--s-4); background: var(--surface-2); border-left: 2px solid var(--accent); }
.prose .trick > b:first-child { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-2); }
.prose .trick p { margin: 0 0 var(--s-2); font-size: var(--fs-1); }
.prose .trick ul { margin: 0; font-size: var(--fs-1); }
.prose .trick li { margin-bottom: var(--s-2); }
.prose .trick li:last-child { margin-bottom: 0; }

/* a board-and-hands comparison — used by showdown and ranking drills, where a full table would be noise */
.hands-wrap { max-width: 420px; margin: 0 0 var(--s-3); }
svg.pk-hands { display: block; width: 100%; height: auto; }
.pk-hands .hand-label { font-size: 17px; font-weight: 700; letter-spacing: 0.06em; fill: var(--ink-2); }
.hands-caption { font-size: var(--fs-1); color: var(--ink-2); margin-top: var(--s-2); }

/* the hand rankings drawn as cards — a ```rankings fence. A list between hairlines: name and note on the
   left, the five cards on the right; on a phone the cards drop under the name. */
.rankings { margin: 0 0 var(--s-5); }
.rankings ol { list-style: none; margin: 0; padding: 0; counter-reset: rk; border-top: 1px solid var(--line); }
.rankings li {
  counter-increment: rk; margin: 0;
  display: grid; grid-template-columns: 1.75em 1fr auto; align-items: center; column-gap: var(--s-3);
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.rankings li::before { content: counter(rk); font-size: var(--fs-1); font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rk-name b { display: block; }
.rk-name span { display: block; font-size: var(--fs-1); color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
svg.pk-cards { display: block; }
.pk-cards .card.kicker { opacity: var(--card-kicker); }
.rk-legend { font-size: var(--fs-1); color: var(--ink-2); margin: var(--s-2) 0 0; }
@media (max-width: 560px) {
  .rankings li { grid-template-columns: 1.75em 1fr; row-gap: var(--s-2); align-items: baseline; }   /* number level with the name */
  .rankings li > svg { grid-column: 2; }
}

/* On a PHONE the table is scaled down hard, so the type inside the SVG must be larger in user units to
   survive it. 560px, not the layout's 760px breakpoint: at 700px the scale is already ~0.9 and this bump
   made the names bigger than the cards. */
/* The poker table needs no phone bump any more: it lays itself out in real pixels for the width it
   has (see js/table.js), so its type is the same size here as on a desktop. The hand comparison still
   scales, so it keeps its own. */
@media (max-width: 560px) {
  .pk-hands .hand-label { font-size: 22px; }
  .hands-wrap { max-width: 100%; }
}

/* ---------- bet sizing (```sizing, js/sizing-block.js) ---------- */
.sizingblock { margin: var(--s-5) 0 var(--s-6); max-width: 620px; }
.sz-table { border-collapse: collapse; width: 100%; font-size: var(--fs-2); }
.sz-table th { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 0 var(--s-3) var(--s-2) 0; border-bottom: 1px solid var(--line-2); }
.sz-table td { padding: 7px var(--s-3) 7px 0; border-bottom: 1px solid var(--line); }
.sz-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sz-try { margin: var(--s-4) 0 var(--s-2); padding: var(--s-3); background: var(--surface-2); }
.sz-try label { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-2); }
.sz-try input[type=range] { width: 100%; accent-color: var(--accent); }
.sz-live { font-size: var(--fs-1); color: var(--ink-2); margin: var(--s-2) 0; line-height: 1.5; }
.sz-live b { color: var(--ink); }
.sz-bars { display: grid; gap: 4px; }
.sz-bar { display: block; height: 8px; background: var(--line); }
.sz-bar i { display: block; height: 100%; transition: width 160ms ease; }
.sz-bar.call i { background: var(--accent); }
.sz-bar.bluff i { background: var(--rg-call); }
.sz-note { font-size: var(--fs-1); color: var(--ink-2); margin: var(--s-2) 0 0; line-height: 1.5; }
.sizingblock figcaption { font-size: var(--fs-1); color: var(--ink-2); margin-top: var(--s-2); }

/* ---------- the game (js/tools/game.js) ---------- */
.game-page .gm-formula { font-family: var(--font-mono); font-size: var(--fs-1); padding: var(--s-2) var(--s-3); background: var(--surface-2); margin: 0 0 var(--s-3); }
.game-page .gm-sources { font-size: var(--fs-1); color: var(--ink-2); padding-left: 1.1em; margin: 0 0 var(--s-3); }
.game-page .gm-sources li { margin-bottom: var(--s-2); }
.game-page .gm-sources b { color: var(--ink); }
.game-page .gm-when { color: var(--ink-3); font-size: 11px; }
.gm-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); }
.gm-running { font-size: var(--fs-1); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gm-table { margin-bottom: var(--s-2); }
.gm-prompt { font-size: var(--fs-3); line-height: 1.45; margin: 0 0 var(--s-2); max-width: 720px; }
.gm-facts { font-size: var(--fs-1); color: var(--ink-2); margin: 0 0 var(--s-4); padding-left: 1.1em; max-width: 720px; }
.gm-facts li { margin-bottom: var(--s-1); }
.gm-opts { max-width: 620px; margin-bottom: var(--s-3); }
.gm-opts .opt small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.gm-result .verdict { font-size: var(--fs-2); margin: 0 0 var(--s-3); padding-left: var(--s-3); border-left: 2px solid var(--line-2); }
.gm-result .verdict.good { border-left-color: var(--good); }
.gm-result .verdict.bad { border-left-color: var(--bad); }
.gm-score { border-top: 1px solid var(--line); padding-top: var(--s-4); margin-bottom: var(--s-6); }
.gm-big { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--accent); margin: var(--s-2) 0; font-variant-numeric: tabular-nums; }
.gm-h2 { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--s-3); }
.gm-review { list-style: none; padding: 0; margin: 0 0 var(--s-6); border-top: 1px solid var(--line); max-width: 760px; }
.gm-review > li { padding: var(--s-4) 0 var(--s-4) var(--s-3); border-bottom: 1px solid var(--line); border-left: 2px solid var(--line-2); margin: 0; }
.gm-review > li.good { border-left-color: var(--good); }
.gm-review > li.bad { border-left-color: var(--bad); }
.gm-review p { margin: 0 0 var(--s-2); font-size: var(--fs-2); line-height: 1.5; }
.gm-rhead { display: flex; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-2); }
.gm-pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.gm-review .gm-small, .gm-small { font-size: var(--fs-1); color: var(--ink-2); }
.gm-ev { border-collapse: collapse; font-size: var(--fs-1); margin: 0 0 var(--s-1); }
.gm-ev td { padding: 3px var(--s-4) 3px 0; border-bottom: 1px solid var(--line); }
.gm-ev td.num { font-family: var(--font-mono); text-align: right; }
.gm-ev tr.best td { color: var(--good); font-weight: 600; }
.gm-ev tr.mine td:first-child::after { content: " · yours"; color: var(--ink-3); font-weight: 400; }

/* the famous-hand replays: a choice that differs from the real one is not wrong, so it is marked in ink,
   not in the red a scored mistake gets */
.gm-hands { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.gm-hands > li { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.gm-hands > li > b { display: block; font-size: var(--fs-2); }
.gm-hands .gm-small { display: block; margin: 2px 0; }
.gm-hands .actions { margin-top: var(--s-2); }
.gm-story { list-style: none; padding: 0 0 0 var(--s-3); margin: 0 0 var(--s-3); border-left: 2px solid var(--line-2); font-size: var(--fs-1); color: var(--ink-2); max-width: 720px; }
.gm-story li { margin-bottom: 3px; }
.gm-story b { color: var(--ink); }
.gm-opts .opt.mine, .gm-opts .opt.mine[disabled] { color: var(--ink); font-weight: 600; }
.gm-opts .opt.mine .mark { color: var(--ink); }
.gm-explain { max-width: 720px; margin-bottom: var(--s-3); }
.gm-explain p { margin: 0 0 var(--s-2); font-size: var(--fs-2); line-height: 1.55; }
.gm-explain .gm-small { font-size: var(--fs-1); color: var(--ink-2); }
.gm-lesson { padding-left: var(--s-3); border-left: 2px solid var(--accent); }
.gm-review > li.other { border-left-color: var(--line-2); }
.gm-howknow { max-width: 760px; margin-bottom: var(--s-5); }
.gm-howknow li { font-size: var(--fs-1); margin-bottom: var(--s-1); }

/* ---------- tools: calculators, not lessons ---------- */
.lessons.tools { border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-2); }
.tool-link .tick { border-radius: 50%; }
.tool .panel { border-top: 1px solid var(--line); padding-top: var(--s-4); margin-bottom: var(--s-6); }
.tool .panel h2 { margin-top: 0; }
.tool .fields { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-bottom: var(--s-4); }
/* Seven inputs wrapping by content left the last one stranded alone on a second row. A fixed four-column
   grid keeps the rows even, and the one field that is about a DIFFERENT player takes the width below. */
.tool .fields.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tool .fields.four label { flex: none; }
.tool .fields.four label.wide { grid-column: 1 / -1; max-width: 320px; }
@media (max-width: 760px) { .tool .fields.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool .fields label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); flex: 1 1 160px; }
.tool .fields small { font-weight: 400; letter-spacing: 0.04em; text-transform: none; color: var(--ink-3); }
.tool .fields input, .tool .fields select { font: inherit; font-size: var(--fs-2); padding: 7px 9px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); border-radius: 0; }
.tool .fields input:focus, .tool .fields select:focus { outline: none; border-color: var(--accent); }
.tool .stats { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); margin-bottom: var(--s-3); }
.tool .stat { display: flex; flex-direction: column; min-width: 110px; }
.tool .stat .k { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.tool .stat .v { font-size: var(--fs-4); font-variant-numeric: tabular-nums; line-height: 1.3; }
.tool .stat .n { font-size: var(--fs-1); color: var(--ink-2); }
.tool .note { font-size: var(--fs-1); color: var(--ink-2); margin: 0 0 var(--s-2); }
.tool .verdict { font-size: var(--fs-2); font-weight: 600; margin: 0; padding-left: var(--s-3); border-left: 2px solid var(--line-2); }
.tool .verdict.good { border-left-color: var(--good); }
.tool .verdict.bad { border-left-color: var(--bad); }

/* ---------- the 169-hand grid, and the range trainer ---------- */
.grid169 { display: grid; grid-template-columns: repeat(13, 1fr); gap: 1px; background: var(--rg-line); border: 1px solid var(--rg-line); max-width: 560px; }
.grid169 .c { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-style: normal;
  font-size: 9px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; background: var(--rg-fold); color: var(--ink-3); }
.grid169 .c.on { background: var(--rg-call); color: #fff; }
.grid169 .c.on.pair { background: var(--rg-raise); }
.grid169 .c.here { outline: 2px solid var(--rg-hero); outline-offset: -2px; z-index: 1; color: #fff; font-weight: 700; }
.grid169 .c.off.here { background: var(--ink-3); }
.grid169 .c.mix { box-shadow: inset 0 0 0 1px var(--rg-mix); }
@media (max-width: 560px) { .grid169 .c { font-size: 0; } .grid169 .c.here { font-size: 8px; } }
@media (max-width: 560px) { .grid169.lesson-grid .c { font-size: 7px; letter-spacing: -0.04em; font-weight: 600; } }

/* the lesson grid — a ```grid fence (js/grid-block.js). Every square is a button: tap it for its hands.
   Labels stay on a phone here, unlike the trainers' grid: this grid is the thing being read. */
.gridblock { margin: var(--s-5) 0 var(--s-6); }
.lesson-grid .c { border: 0; padding: 0; margin: 0; cursor: pointer; font-family: var(--font-sans); font-size: 10px; font-weight: 600;
  min-width: 0; overflow: hidden; transition: background-color 260ms ease, color 260ms ease; }
.lesson-grid .c.pair { background: var(--gr-pair); color: #fff; }
.lesson-grid .c.suited { background: var(--gr-suited); color: var(--ink); }
.lesson-grid .c.offsuit { background: var(--gr-offsuit); color: var(--ink-2); }
.lesson-grid .c .ct { display: none; }
.gridblock.dealt .lesson-grid .c { background: color-mix(in srgb, var(--gr-dealt) calc(var(--share) * 100%), #fff); color: var(--ink); }
.gridblock.dealt .lesson-grid .c.offsuit { color: #fff; }
.gridblock.dealt .lesson-grid .c .nm { display: none; }
.gridblock.dealt .lesson-grid .c .ct { display: inline; }
.lesson-grid .c:hover { filter: brightness(0.94); }
.lesson-grid .c.picked { outline: 2px solid var(--rg-hero); outline-offset: -2px; z-index: 1; position: relative; }
.lesson-grid .c:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; position: relative; }

.gb-switch { display: flex; margin-bottom: var(--s-3); }
.gb-switch button { font: 600 10px var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; padding: 7px 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; margin-right: -1px; }
.gb-switch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.gb-key { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: var(--s-3) 0 0; font-size: var(--fs-1); color: var(--ink-2); }
.gb-k { display: inline-flex; align-items: center; gap: 6px; }
.gb-k i { width: 11px; height: 11px; display: inline-block; }
.gb-k.pair i { background: var(--gr-pair); }
.gb-k.suited i { background: var(--gr-suited); }
.gb-k.offsuit i { background: var(--gr-offsuit); box-shadow: inset 0 0 0 1px var(--line-2); }
.gb-k b { color: var(--ink); font-weight: 600; }

.gb-bar { margin: var(--s-3) 0 0; max-width: 560px; }
.gb-track { display: flex; height: 12px; gap: 2px; }
.gb-track span { flex-basis: 0; min-width: 2px; transition: flex-grow 420ms cubic-bezier(.2, .8, .2, 1); }
.gb-track .pair { background: var(--gr-pair); }
.gb-track .suited { background: var(--gr-suited); }
.gb-track .offsuit { background: var(--gr-offsuit); box-shadow: inset 0 0 0 1px var(--line-2); }
.gb-bar p { font-size: var(--fs-1); color: var(--ink-2); margin: 6px 0 0; }
/* as dealt, the key and the bar take the squares' own shading, so the key never contradicts the grid */
.gridblock.dealt :is(.gb-k i, .gb-track span) { background: color-mix(in srgb, var(--gr-dealt) calc(var(--share) * 100%), #fff); box-shadow: none; }
.gb-bar p b { color: var(--ink); font-weight: 600; }

.gb-detail { margin-top: var(--s-4); min-height: 3em; max-width: 640px; }
.gb-detail p { font-size: var(--fs-1); color: var(--ink-2); margin: 0 0 var(--s-2); line-height: 1.5; }
.gb-detail p b { color: var(--ink); }
.gb-prompt { font-style: italic; }
.gb-combos { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.gridblock figcaption { font-size: var(--fs-1); color: var(--ink-2); margin-top: var(--s-3); }
/* show: chart — the opening chart, one seat at a time */
.chart-grid .c { background: var(--gr-fold); color: var(--ink-3); }
.chart-grid .c.raise { background: var(--gr-open); color: #fff; }
.gb-k.raise i { background: var(--gr-open); }
.gb-k.fold i { background: var(--gr-fold); box-shadow: inset 0 0 0 1px var(--line-2); }
.gb-seats { display: flex; flex-wrap: wrap; margin: 0 0 var(--s-3); max-width: 560px; }
.gb-seats button { flex: 1 1 0; min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px;
  border: 1px solid var(--line-2); margin: 0 -1px -1px 0; background: var(--surface); color: var(--ink-2); cursor: pointer; font-family: var(--font-sans); }
.gb-seats button b { font-size: 10px; letter-spacing: 0.08em; font-weight: 600; }
.gb-seats button span { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.gb-seats button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; position: relative; z-index: 1; }
.gb-seats button[aria-pressed="true"] span { color: rgba(255, 255, 255, 0.8); }
.gb-seatline { font-size: var(--fs-1); color: var(--ink-2); margin: 0 0 var(--s-3); max-width: 560px; line-height: 1.5; }
.gb-seatline b { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .lesson-grid .c, .gb-track span { transition: none; } }

/* the push/fold trainer shows both sides of the same spot, so the two ranges sit side by side */
.two-grids { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-5); margin-bottom: var(--s-3); }
.two-grids h3 { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--s-2); }
.two-grids .grid169 { max-width: none; }

.trainer .spot-head { display: flex; flex-wrap: wrap; gap: var(--s-6); margin-bottom: var(--s-4); }
.trainer .spot-head > div { display: flex; flex-direction: column; gap: 2px; }
.trainer .spot-head .k { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.trainer .pos { font-size: var(--fs-5); font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; }
.trainer .posname, .trainer .spot-head .n { font-size: var(--fs-1); color: var(--ink-2); }
.trainer .hand { font-size: var(--fs-5); letter-spacing: 0.06em; line-height: 1.1; }
.trainer .hand .pc.red { color: var(--suit-red); }
.trainer .hand .pc.black { color: var(--suit-black); }
.trainer .hand .pc + .pc { margin-left: 0.35em; }
.trainer .actions { display: flex; gap: var(--s-2); margin-bottom: var(--s-3); }

/* the trainers, on the home page's part card — a grid so five of them stay scannable */
.part-tools { list-style: none; margin: var(--s-4) 0 0; padding: var(--s-4) 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3) var(--s-4); }
.part-tools a { display: block; text-decoration: none; color: inherit; }
.part-tools b { display: block; font-size: var(--fs-2); font-weight: 600; }
.part-tools span { display: block; font-size: var(--fs-1); color: var(--ink-2); margin-top: 2px; }
.part-tools a:hover b { text-decoration: underline; }

/* the weak-spot report: worst first, with the sample size always visible next to the percentage */
.report .wlist { list-style: none; margin: var(--s-3) 0 0; padding: 0; }
.report .wrow a { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label area" "bar bar" "pct n"; gap: 2px var(--s-3);
  align-items: center; padding: var(--s-3) 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.report .wlabel { grid-area: label; font-size: var(--fs-2); }
.report .warea { grid-area: area; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.report .wbar { grid-area: bar; display: block; height: 4px; background: var(--rg-fold); margin: 4px 0 2px; }
.report .wbar i { display: block; height: 100%; background: var(--accent); }
.report .wpct { grid-area: pct; font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.report .wn { grid-area: n; font-size: var(--fs-1); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.report .wrow a:hover .wlabel { text-decoration: underline; }

/* the play page: the table, then what just happened, then what to do next */
.play #say { min-height: 2.6em; margin-bottom: var(--s-3); }
.play #between { margin-bottom: var(--s-5); }
.play .part-sections li b { display: inline-block; min-width: 3.5em; }

/* the ICM lab's equity table */
.icm-table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); margin-bottom: var(--s-3); }
.icm-table th { text-align: left; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line-2); padding: 0 var(--s-3) var(--s-2) 0; }
.icm-table td { padding: var(--s-2) var(--s-3) var(--s-2) 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.icm-table td.n { text-align: right; }
.icm-table tr.leader td { font-weight: 600; }
.icm-table .gap { text-align: right; color: var(--ink-3); white-space: nowrap; }
.icm-table .gap.up { color: var(--good); }
.icm-table .gap.down { color: var(--bad); }


/* ---------- the cat in the box (js/mascot.js) ---------- */
/* Always in the corner, small. It meows when it has something and waits to be clicked; the bubble only
   opens on a click. Clicked with nothing to say, it answers with hearts. */
.mascot {
  position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end;
  pointer-events: none;
}
.mascot > * { pointer-events: auto; }
.mascot[hidden] { display: none; }
.mascot-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the bubble: only there when opened */
.mascot-bubble {
  position: relative; box-sizing: border-box;
  width: max-content; max-width: min(232px, calc(100vw - 28px));
  padding: 8px 24px 9px 11px;
  margin: 0 0 calc(var(--mascot-tail) * 1px + 3px) 0;
  transform-origin: 70% 100%; transform: scale(.6); opacity: 0; visibility: hidden;
  transition: transform 240ms cubic-bezier(.2, 1.4, .4, 1), opacity 140ms, visibility 0s 240ms;
}
.mascot[data-state="open"] .mascot-bubble { transform: scale(1); opacity: 1; visibility: visible; transition: transform 240ms cubic-bezier(.2, 1.4, .4, 1), opacity 140ms, visibility 0s; }
.mascot-outline { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.mascot-outline path {
  fill: var(--mascot-paper); stroke: var(--mascot-line); stroke-width: calc(var(--mascot-stroke) * 1px);
  stroke-linejoin: round; stroke-linecap: round;
}
.mascot-label, .mascot-text, .mascot-close { position: relative; }
.mascot-label { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 2px; color: var(--mascot-tip); }
.mascot[data-kind="hint"] .mascot-label { color: var(--mascot-hint); }
.mascot-text { margin: 0; font-size: 12.5px; line-height: 1.42; color: var(--ink); }
.mascot-text b { font-weight: 700; }
.mascot-close {
  position: absolute; top: 3px; right: 4px; width: 20px; height: 20px; padding: 0;
  border: 0; background: none; color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer;
}
.mascot-close:hover { color: var(--ink); }

/* the cat, its meow, its hearts */
.mascot-body { position: relative; }
.mascot-cat {
  display: block; width: var(--mascot-cat-w); padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%; transition: transform 160ms;
}
.mascot-cat:hover { transform: translateY(-2px); }
.mascot-cat:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.mascot-cat svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.10)); }
.mascot-cat.squish { animation: mascot-squish 260ms ease-out; }
.mascot-body.hop { animation: mascot-hop 700ms cubic-bezier(.3, 0, .3, 1); }

/* "meow" — a word and three sound lines beside the head, drawn in the artwork's black */
.mascot-meow {
  position: absolute; right: 64%; bottom: 72%;
  display: flex; align-items: flex-end; gap: 1px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; color: var(--mascot-ink);
  opacity: 0; transform: scale(.4) rotate(-8deg); transform-origin: 100% 100%;
  transition: opacity 160ms, transform 240ms cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none;
}
.mascot-meow span { transform: rotate(-8deg); }
.mascot-sound { width: 13px; height: 13px; order: 2; margin-bottom: 7px; }
.mascot-sound path { fill: none; stroke: var(--mascot-ink); stroke-width: 1.6; stroke-linecap: round; }
.mascot[data-state="meowing"] .mascot-meow { opacity: 1; transform: scale(1) rotate(-8deg); animation: mascot-meow 1.6s ease-in-out 400ms infinite; }

.mascot-hearts { position: absolute; left: 40%; top: 6%; width: 0; height: 0; pointer-events: none; }
.mascot-hearts .heart {
  position: absolute; left: calc(var(--size) / -2); top: 0; width: var(--size); height: var(--size);
  animation: mascot-heart 1.1s ease-out var(--delay) both;
}
.mascot-hearts svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mascot-hearts path { fill: var(--mascot-heart); stroke: var(--mascot-ink); stroke-width: 1.8; stroke-linejoin: round; }

@keyframes mascot-hop { 0%, 100% { transform: translateY(0) } 28% { transform: translateY(-9px) } 50% { transform: translateY(0) } 68% { transform: translateY(-3px) } }
@keyframes mascot-squish { 0% { transform: scale(1, 1) } 35% { transform: scale(1.07, .9) } 70% { transform: scale(.97, 1.04) } 100% { transform: scale(1, 1) } }
@keyframes mascot-meow { 0%, 100% { transform: scale(1) rotate(-8deg) } 50% { transform: scale(1.1) rotate(-5deg) } }
@keyframes mascot-heart {
  0% { transform: translate(0, 0) scale(.3); opacity: 0 }
  18% { transform: translate(calc(var(--dx) * .3), -8px) scale(1); opacity: 1 }
  100% { transform: translate(var(--dx), -58px) scale(.85); opacity: 0 }
}

@media (max-width: 560px) {
  .mascot { right: max(10px, env(safe-area-inset-right)); }
  .mascot-cat { width: var(--mascot-cat-w-phone); }
  .mascot-bubble { max-width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-bubble, .mascot[data-state="open"] .mascot-bubble { transform: none; transition: opacity 140ms, visibility 0s; }
  .mascot-cat.squish, .mascot-body.hop, .mascot[data-state="meowing"] .mascot-meow { animation: none; }
  .mascot-meow { transform: rotate(-8deg); }
  .mascot-hearts .heart { animation: mascot-heart-still 1.1s ease-out var(--delay) both; }
  @keyframes mascot-heart-still { 0% { opacity: 0 } 25% { opacity: 1 } 100% { opacity: 0; transform: translate(var(--dx), -20px) } }
}

/* a tip tucked into a lesson: a small cat and a label in the text; the cat in the corner delivers it */
.prose .tip { margin: var(--s-4) 0; }
.prose .tip-cue {
  display: inline-flex; align-items: center; gap: 9px; padding: 3px 12px 3px 4px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
.prose .tip-cue:hover { border-color: var(--accent); color: var(--accent); }
.prose .tip-cat { display: block; }
.prose .tip-text { margin: var(--s-2) 0 0; padding-left: var(--s-3); border-left: 2px solid var(--line-2); font-size: var(--fs-1); color: var(--ink-2); }

/* the switch for the cat, beside the mute button */
.icon-btn.cat-toggle { width: 32px; }
.icon-btn.cat-toggle .tip-cat { width: 24px; height: auto; }
.icon-btn.cat-toggle[aria-pressed="false"] { opacity: 0.4; }
.sidebar-footer .credit { margin-top: var(--s-3); font-size: 10px; line-height: 1.5; color: var(--ink-3); }
.sidebar-footer .credit b { font-weight: 600; color: var(--ink-2); }
.sidebar-footer .credit a { color: var(--ink-3); text-decoration: none; }
.sidebar-footer .credit a:hover { color: var(--accent); }
/* cmx-20260927-dec0fc469f71 */

/* The welcome's card (js/card-spin.js): hairlines in the welcome ink behind the word, on a corner, turning */
.wl-card { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: grid; place-items: center; perspective: 1600px; }
.wl-card-spin, .wl-card-tilt { transform-style: preserve-3d; }
.wl-card-tilt { position: relative; height: min(72vh, 80vw); aspect-ratio: 72 / 100; }
.wl-card-side { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.wl-card-side.back { transform: rotateY(180deg); }
.wl-card-edge { fill: none; stroke: var(--wl-ink); stroke-opacity: .4; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.wl-card-ink text { fill: none; stroke: var(--wl-ink); stroke-opacity: .4; stroke-width: 1px; vector-effect: non-scaling-stroke; text-anchor: middle; font-weight: 300; }
.wl-card-ink.red text { stroke: var(--suit-red); stroke-opacity: .9; }
#wl-card-lattice path { fill: none; stroke: var(--wl-ink); stroke-opacity: .28; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.wl-card-lattice { fill: url(#wl-card-lattice); stroke: var(--wl-ink); stroke-opacity: .28; stroke-width: 1px; vector-effect: non-scaling-stroke; }
