/* Chance: the lots. A Galton board first, then a reading column of small live figures.
   Tokens only (tokens.css). Blue = the data and option A; lamp yellow = the change, the
   insight, what to expect (always with ink beside it); round only for data. */

/* ---------- Try it: the Galton board ---------- */
.gb {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  gap: var(--s5) var(--s7);
  align-items: stretch;
}
.gb-fig { min-width: 0; }
.gb-canvas { display: block; width: 100%; height: auto; aspect-ratio: 600 / 480; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gb-side { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; padding-top: var(--s2); }
.gb-controls { display: flex; flex-wrap: wrap; gap: var(--s3); }
.gb-count { margin: var(--s5) 0 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--s3); }
.gb-n { font-size: clamp(3.5rem, 1.5rem + 5.4vw, 7.5rem); font-weight: 860; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums lining-nums; }
.gb-unit { font-size: var(--fs-body); font-weight: 560; color: var(--ink-2); }
.gb-status { margin: 0; font-size: 1.25rem; line-height: 1.4; max-width: 27rem; min-height: 2.8em; }
/* Phrases that answer a click are swept with the highlighter (motion.js); each stays one box. */
.gb-answer, .hist-answer, .risk-people span:last-of-type { display: inline-block; }
.gb-law { margin-top: auto; padding-top: var(--s3); border-top: var(--bw-strong) solid var(--ink); }
.gb-law-text { margin: 0; font-size: clamp(1.625rem, 1rem + 1.7vw, 2.5rem); font-weight: 820; line-height: 1.08; letter-spacing: -0.025em; max-width: 15ch; }
.gb-key { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0 0; font-size: var(--fs-small); line-height: 1.35; color: var(--ink-2); }
.gb-key[hidden] { display: none; }
.gb-key-line { width: 40px; height: 12px; flex: none; overflow: visible; }
.gb-key-line path { fill: none; stroke: var(--yellow); stroke-width: 6; stroke-linecap: round; }
.gb-key-line path.core { stroke: var(--ink); stroke-width: 1.5; }

@media (max-width: 900px) {
  .gb { grid-template-columns: minmax(0, 1fr); }
  .gb-fig { max-width: 600px; }
  .gb-side { padding-top: 0; }
  .gb-count { margin-top: 0; }
  .gb-n { font-size: 3.5rem; }
  .gb-status { min-height: 0; }
}

/* ---------- What just happened: one narrow column with small live figures ---------- */
#happened .prose > h3 { font-size: clamp(1.5rem, 1.2rem + 0.9vw, 1.875rem); font-weight: 820; letter-spacing: -0.02em; margin: var(--s8) 0 var(--s3); scroll-margin-top: var(--s5); }
/* Figures run wider than the text column when there is room (the text stays at about 68 characters). */
#happened > .wrap { container-type: inline-size; }
.fig { width: min(56rem, 100cqi); margin: var(--s5) 0 var(--s6); }

/* Sliders use the shared .range look (base.css); this only lays them out. */
.sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s5); margin-top: var(--s4); }
.sliders-3 { grid-template-columns: minmax(0, 1fr); gap: var(--s1); margin: 0 0 var(--s4); }
.slide { display: block; min-width: 0; }
.slide-label { display: block; font-size: var(--fs-small); font-weight: 520; line-height: 1.3; }
.slide-label output { font-weight: 760; }
@media (min-width: 960px) {
  .sliders-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s5); align-items: end; }
}

/* 1. See it as 100 people. */
.risk-top { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: var(--s5) var(--s6); align-items: center; }
.risk-array { width: 100%; height: auto; }
.risk-array .p { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; transition: fill var(--t-fast) var(--ease); }
.risk-array .p-a { fill: var(--blue); stroke: var(--blue); }
.risk-array .p-b { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; }
.risk-array .p-x { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3.5; }
.risk-head { margin: 0 0 var(--s3); font-size: var(--fs-small); color: var(--ink-2); }
.risk-q { display: block; margin-top: var(--s1); font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 820; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); quotes: "“" "”"; }
.risk-people { margin: 0; font-size: 1.25rem; line-height: 1.4; }

/* 2. A positive test, counted through 1,000 people. */
.tree { margin: var(--s4) 0 var(--s5); font-size: var(--fs-small); line-height: 1.2; }
.t-node { padding: var(--s2) var(--s3); border: var(--bw-strong) solid var(--ink); background: var(--paper); text-align: center; }
.t-node b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums lining-nums; }
.t-root { width: 44%; margin-inline: auto; }
.t-split { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); padding-top: 28px; }
.t-split::before { content: ""; position: absolute; top: 0; left: calc(50% - 1px); height: 14px; border-left: var(--bw-strong) solid var(--ink); }
.t-split::after { content: ""; position: absolute; top: 14px; height: 14px; left: calc(25% - var(--s3) / 4 - 1px); right: calc(25% - var(--s3) / 4 - 1px); border: var(--bw-strong) solid var(--ink); border-bottom: 0; }
.t-branch { min-width: 0; }
.t-tp { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.t-fp { background: var(--yellow); color: var(--on-yellow); }
.t-quiet { border-color: var(--line); color: var(--ink-2); }
.pos-label { margin: 0 0 var(--s2); font-size: var(--fs-small); color: var(--ink-2); }
.pos-strip { width: 100%; height: auto; }
.pos-strip .d-tp { fill: var(--blue); }
.pos-strip .d-fp { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.4; }
.test-read { margin: var(--s4) 0 0; font-size: 1.25rem; line-height: 1.4; }

/* 3. Expected value: what you pay against what it pays back on average. */
.ev-bars { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.ev-row { display: grid; grid-template-columns: 12rem minmax(0, 1fr) 5.5rem; align-items: center; gap: var(--s3); }
.ev-name { font-size: var(--fs-small); font-weight: 560; line-height: 1.25; }
.ev-track { display: block; height: 30px; border-left: var(--bw-strong) solid var(--ink); }
.ev-bar { display: block; height: 100%; width: 0; transition: width var(--t-mid) var(--ease); }
.ev-pay { background: var(--blue); }
.ev-back { background: var(--yellow); border: 1.5px solid var(--ink); border-left: 0; }
.ev-back.is-zero { border: 0; }
.ev-val { font-size: 1.375rem; font-weight: 780; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.ev-read { margin: 0 0 var(--s2); font-size: 1.25rem; line-height: 1.4; }
.ev-ledger { margin: 0; font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); }
.ev-ledger b { color: var(--ink); font-weight: 700; }

/* 4. Streaks: coins are round because they are data. */
.coin-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s3); }
.coin-row { display: flex; flex-wrap: wrap; max-width: 640px; margin: var(--s4) 0 var(--s2); }
.coin-row:empty { display: none; }
.coin { display: grid; place-items: center; width: 32px; height: 38px; }
.coin.in-run { background: var(--yellow); }
.coin i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); font-style: normal; font-size: var(--fs-small); font-weight: 720; line-height: 1; }
.coin i.h { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.coin-read { margin: 0; font-size: 1.125rem; line-height: 1.45; }
.coin-read:empty { display: none; }

.guess { margin: var(--s6) 0 0; padding: var(--s4) 0 0; border: 0; border-top: var(--bw) solid var(--hair); min-width: 0; }
.guess legend { float: left; width: 100%; padding: 0; margin-bottom: var(--s3); font-weight: 650; line-height: 1.35; }
.guess-row { clear: both; display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 var(--s3); border: var(--bw-strong) solid var(--ink); border-radius: var(--r-control); font-size: var(--fs-small); font-weight: 650; font-variant-numeric: tabular-nums lining-nums; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.chip:hover span { background: var(--paper-2); }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }

.hist { max-width: 640px; margin-top: var(--s5); }
.hist[hidden] { display: none; }
.hist-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 4px; height: 200px; border-bottom: var(--bw-strong) solid var(--ink); }
.hb { position: relative; display: flex; flex-direction: column; justify-content: flex-end; }
.hb-bar { display: block; background: var(--blue); transition: height var(--t-mid) var(--ease); }
.hb-exp { position: absolute; left: -3px; right: -3px; height: 6px; margin-bottom: -3px; background: var(--yellow); border: 1.5px solid var(--ink); }
.hist-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 4px; margin-top: var(--s2); }
.hist-x span { display: block; text-align: center; font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; line-height: 1.6; white-space: nowrap; }
.hist-x span.is-guess { background: var(--ink); color: var(--paper); border-radius: var(--r-control); }
.hist-axis { margin: var(--s2) 0 0; font-size: var(--fs-small); color: var(--ink-2); }
.hist-read { margin: var(--s3) 0 0; font-size: 1.125rem; line-height: 1.45; }

@media (max-width: 600px) {
  .risk-top { grid-template-columns: minmax(0, 1fr); }
  .risk-array { max-width: 18rem; }
  .sliders { grid-template-columns: minmax(0, 1fr); }
  .t-root { width: 70%; }
  .t-branch .t-branch .t-node { padding: var(--s2) var(--s1); font-stretch: 85%; }
  .t-node b { font-size: 1.25rem; }
  .ev-row { grid-template-columns: minmax(0, 1fr) 4.75rem; row-gap: var(--s1); }
  .ev-name { grid-column: 1 / -1; }
  .hist-bars { height: 160px; column-gap: 2px; }
  .hist-x { column-gap: 2px; }
}

/* ---------- Where you'll meet this ---------- */
.meet-table tbody th { width: 32%; font-size: 1.0625rem; }
.meet-table td a { white-space: nowrap; }
@media (max-width: 640px) {
  .meet-table thead { display: none; }
  .meet-table, .meet-table tbody, .meet-table tr, .meet-table th, .meet-table td { display: block; width: auto; }
  .meet-table tbody th { width: auto; }
  .meet-table tr { padding: var(--s3) 0; border-bottom: var(--bw) solid var(--hair); }
  .meet-table th, .meet-table td { border: 0; padding: 0; }
  .meet-table td { margin-top: var(--s1); }
  .meet-table td a { white-space: normal; }
}

/* ---------- What Scripture says ---------- */
.scripture-words .verse:last-child { margin-bottom: 0; }

/* ---------- Watch ---------- */
/* One title here is long; at three across it pushed the play row out of the 16:9 frame.
   Scoped to this page until the shared facade allows for long titles. */
#watch .video-play .vt { font-size: clamp(1.125rem, 0.95rem + 0.4vw, 1.3125rem); }
