/* odds.css: 확률 감각 테스트 on top of kit.css. Its own palette (cool paper, deep ink, violet spot, teal and
   coral for right and wrong, always with a glyph), and the quiz, result, explainer and simulation parts.
   Type and spacing read only the kit's tokens (--step-*, --fs-*, --sp-*, --m, --gap, --sec); tests/test_site.py
   fails on a raw value. */

:root {
  --paper: light-dark(#f4f5f9, #0d0f17);
  --surface: light-dark(#e7e9f2, #171a27);
  --surface-2: light-dark(#d6dae8, #252a3d);
  --ink: light-dark(#11142a, #e9ebf5);
  --muted: light-dark(#4a5070, #a3a9c2);
  --spot: light-dark(#5a3fd6, #a898ff);
  --spot-ink: light-dark(#ffffff, #130e2e);
  --cool: light-dark(#08695c, #4cd3bd);
  --band: light-dark(rgb(17 20 42 / 0.08), rgb(233 235 245 / 0.1));
  --field-ink: #10132a;
  --ok: light-dark(#08695c, #4cd3bd);
  --bad: light-dark(#b23c17, #ff8f66);
  --over: light-dark(#b23c17, #ff8f66);
  --under: light-dark(#1d5fae, #7fb2ff);
}

html:not(.js) .js-only { display: none !important; }
.wordmark:focus-visible { outline-offset: -3px; }  /* inside: at the viewport corner an outer ring is clipped */
p, .lead, dd { text-wrap: pretty; }
.mx-name, .display, .head, .title { text-wrap: balance; }
code { font-size: var(--step-small); background: var(--surface); padding: 0 var(--sp-1); }
.kicker { font-size: var(--step-small); font-weight: 650; color: var(--spot); margin: 0 0 var(--sp-2); line-height: 1.5; }
.tnum, .score-nums, .scale, .quiz-count { font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.foot { background: var(--surface); padding-block: var(--sp-6); row-gap: var(--sp-3); }
.foot-text { grid-column: 1 / span 8; min-width: 0; }
.foot-text p { font-size: var(--step-small); color: var(--muted); margin: 0; }
.foot-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: 0; font-size: var(--step-small); font-weight: 650; }
@media (max-width: 899px) { .foot-text { grid-column: 1 / -1; } }

/* ---------- the result matrix: accuracy band (rows) by calibration band (columns) ---------- */
.matrix { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: var(--sp-1); margin: var(--sp-3) 0 var(--sp-4); }
.mx-corner { display: block; }
.mx-col { display: flex; flex-direction: column; padding: 0 var(--sp-2) var(--sp-1); font-size: var(--step-small); font-weight: 700; line-height: 1.4; }
.mx-col small { font-size: var(--step-caption); font-weight: 500; color: var(--muted); }
.mx-row { display: flex; flex-direction: column; align-self: center; padding-right: var(--sp-2); font-size: var(--step-small); font-weight: 750; line-height: 1.35; white-space: nowrap; }
.mx-row small { font-size: var(--step-caption); font-weight: 500; color: var(--muted); }
.mx-cell { display: flex; flex-direction: column; justify-content: center; min-height: 72px; padding: var(--sp-2) var(--sp-3); background: var(--surface); color: var(--ink); text-decoration: none; }
a.mx-cell:hover { background: var(--surface-2); }
.mx-cell.on, a.mx-cell.on:hover { background: var(--spot); color: var(--spot-ink); }
.mx-name { font-weight: 700; line-height: 1.4; }
.mx-line { font-size: var(--step-small); color: var(--muted); line-height: 1.5; margin-top: var(--sp-1); }
.mx-rule { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }  /* spoken; shown on phones in the detailed matrix */
.mx-cell { position: relative; }
.matrix.detail .mx-cell { min-height: 120px; justify-content: flex-start; padding: var(--sp-3); }
@media (max-width: 599px) {
  .mx-cell { padding: var(--sp-2); }
  .mx-name { font-size: var(--step-small); }
  .matrix.detail { grid-template-columns: minmax(0, 1fr); }
  .matrix.detail .mx-corner, .matrix.detail .mx-col, .matrix.detail .mx-row { display: none; }
  .matrix.detail .mx-cell { min-height: 0; }
  .matrix.detail .mx-name { font-size: var(--step-body); }
  .matrix.detail .mx-rule { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; order: -1; font-size: var(--step-caption); color: var(--muted); font-weight: 650; }
}

/* ---------- 테스트: start ---------- */
.start { row-gap: var(--sp-6); align-items: start; }
.start-copy { grid-column: 1 / span 6; min-width: 0; }
.start-matrix { grid-column: 8 / -1; min-width: 0; }
.start .display { margin: 0 0 var(--sp-4); }
.start-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-5) 0 var(--sp-3); }
.start-actions .btn { min-width: 10em; }
.start-meta { margin: 0; }
.start-matrix .title { margin-bottom: var(--sp-1); }
@media (max-width: 899px) { .start-copy, .start-matrix { grid-column: 1 / -1; } .start { row-gap: var(--sp-5); } }

/* ---------- 테스트: one question per screen ---------- */
body.quiz-on .foot, body.quiz-on #start { display: none; }
body.quiz-on main > :last-child { padding-bottom: var(--sp-3); }
.quiz { width: 100%; max-width: 46rem; margin: 0 auto; padding: var(--sp-3) var(--m) var(--sp-3); }
.quiz-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.quiz-count { margin: 0; font-weight: 750; white-space: nowrap; }
.quiz-count span { color: var(--muted); font-weight: 600; }
.quiz-bar { position: relative; flex: 1; height: 6px; background: var(--surface-2); }
.quiz-bar i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--spot); }
.quiz-home { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: var(--step-small); font-weight: 650; min-height: 44px; padding: 0 var(--sp-2); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.quiz-home:hover { color: var(--ink); }
.quiz fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.quiz legend { padding: 0; }
.q-stem { display: block; font-size: var(--step-lead); font-weight: 650; line-height: 1.6; margin: 0 0 var(--sp-4); }
.q-stem:focus { outline: none; }
.choices { display: grid; gap: var(--sp-2); }
.choice { position: relative; display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2) var(--sp-3); background: var(--surface); cursor: pointer; line-height: 1.45; }
.choice:hover { background: var(--surface-2); }
.choice input, .scale input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choice .key { display: grid; place-items: center; flex: none; width: 28px; height: 28px; background: var(--paper); font-size: var(--step-small); font-weight: 750; }
.choice:has(input:checked) { background: var(--ink); color: var(--paper); }
.choice:has(input:checked) .key { background: var(--spot); color: var(--spot-ink); }
.choice:has(input:focus-visible), .scale label:has(input:focus-visible) { outline: 3px solid var(--spot); outline-offset: 2px; }
.quiz .conf { margin-top: var(--sp-4); }
.conf legend { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); width: 100%; margin-bottom: var(--sp-2); font-weight: 700; }
.conf legend small { font-size: var(--step-caption); font-weight: 500; color: var(--muted); }
.scale { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: var(--sp-1); }
.scale label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 0 var(--sp-1); background: var(--surface); cursor: pointer; line-height: 1.25; text-align: center; }
.scale label:hover { background: var(--surface-2); }
.scale .lv { font-size: var(--step-small); font-weight: 750; white-space: nowrap; }
.scale .pc { font-size: var(--step-caption); color: var(--muted); }
.scale label:has(input:checked) { background: var(--spot); color: var(--spot-ink); }
.scale label:has(input:checked) .pc { color: inherit; }
.q-nav { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.q-nav .btn { flex: 1; }
.q-nav .btn.ghost { flex: 0 0 auto; }
@media (min-width: 900px) {
  .quiz { padding-top: var(--sp-7); }
  .scale .lv { font-size: var(--step-body); }
}

/* ---------- 결과: a type page ---------- */
.result { row-gap: var(--sp-4); align-items: start; grid-template-rows: auto auto 1fr; }  /* the score panel spans all three rows; spare height goes below the matrix */
.result-head, .result-about, .result-matrix { grid-column: 1 / span 6; min-width: 0; }
.result-head { grid-row: 1; }
.result-about { grid-row: 2; }
.result-matrix { grid-row: 3; }
.result-score { grid-column: 8 / -1; grid-row: 1 / span 3; min-width: 0; }
.result .display { margin: 0 0 var(--sp-3); }
.result-head .lead { margin-bottom: 0; }
.result-about p:last-child { margin-bottom: 0; }
.result-matrix .matrix { margin: 0; }
@media (max-width: 899px) { .result { grid-template-rows: none; } .result-head, .result-score, .result-about, .result-matrix { grid-column: 1 / -1; grid-row: auto; } }
.score, .score-empty { background: var(--surface); padding: var(--sp-5); }
.score .title, .score-empty .title { margin-bottom: var(--sp-2); }
.score-from { margin: 0 0 var(--sp-3); }
.score-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-5); }
.score-nums dt { font-size: var(--step-small); color: var(--muted); font-weight: 650; }
.score-nums dd { margin: 0; font-size: var(--step-small); color: var(--muted); }
.score-nums b { display: block; font-size: var(--step-title); line-height: 1.2; color: var(--ink); font-weight: 800; letter-spacing: 0; }
.score-nums .over b { color: var(--over); }
.score-nums .under b { color: var(--under); }

/* the gauge: one 0-100% axis, the 보정됨 zone (accuracy ±band), the accuracy mark below and the confidence mark above */
.gauge { margin: 0 0 var(--sp-4); }
.g-track { position: relative; height: 96px; }
.g-track::before { content: ""; position: absolute; left: 0; right: 0; top: 42px; height: 12px; background: var(--surface-2); }
.g-zone { position: absolute; top: 42px; height: 12px; left: var(--l); width: calc(var(--r) - var(--l)); background: color-mix(in oklab, var(--ok) 45%, transparent); box-shadow: inset 0 0 0 2px var(--ok); }
.g-mark { position: absolute; left: var(--x); top: 34px; width: 4px; height: 28px; transform: translateX(-50%); background: var(--ink); }
.g-mark.conf { background: var(--spot); }
.gauge.over .g-mark.conf { background: var(--over); }
.gauge.under .g-mark.conf { background: var(--under); }
.g-mark i { position: absolute; left: 50%; font-style: normal; font-size: var(--step-small); font-weight: 750; white-space: nowrap; line-height: 1.3; transform: translateX(var(--shift, -50%)); }
.g-mark.acc i { top: 32px; }
.g-mark.conf i { bottom: 32px; color: var(--spot); }
.gauge.over .g-mark.conf i { color: var(--over); }
.gauge.under .g-mark.conf i { color: var(--under); }
.g-axis { display: flex; justify-content: space-between; font-size: var(--step-caption); color: var(--muted); }
.g-legend { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 0; }
.g-key { flex: none; width: 24px; height: 12px; background: color-mix(in oklab, var(--ok) 45%, transparent); box-shadow: inset 0 0 0 2px var(--ok); }

.review { list-style: none; padding: 0; margin: 0 0 var(--sp-4); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-1); }
.review a { display: flex; flex-direction: column; gap: 0; min-height: 56px; padding: var(--sp-1) var(--sp-2); background: var(--paper); text-decoration: none; line-height: 1.35; }
.review a:hover { background: var(--surface-2); }
.rv-top { display: flex; justify-content: space-between; font-weight: 750; font-variant-numeric: tabular-nums; }
.rv-m { font-weight: 800; }
.review .ok .rv-m { color: var(--ok); }
.review .bad .rv-m { color: var(--bad); }
.rv-name { font-size: var(--step-caption); color: var(--muted); }
.review-cap { margin: 0 0 var(--sp-2); }
.share-msg { margin: var(--sp-2) 0 0; }
.share-msg:empty { display: none; }
@media (min-width: 600px) { .review { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- 결과 유형 index ---------- */
.result-index { row-gap: var(--sp-5); align-items: start; }
.ri-copy { grid-column: 1 / span 5; min-width: 0; }
.ri-matrix { grid-column: 7 / -1; min-width: 0; }
.ri-matrix .matrix { margin-top: 0; }
@media (max-width: 899px) { .ri-copy, .ri-matrix { grid-column: 1 / -1; } }
.defs { margin: 0 0 var(--sp-4); }
.defs dt { font-weight: 750; margin-top: var(--sp-3); }
.defs dd { margin: 0; max-width: var(--measure); }

/* ---------- 개념 index ---------- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.cards li { min-width: 0; }
.card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-3); height: 100%; padding: var(--sp-3) var(--sp-4); background: var(--surface); text-decoration: none; }
.card:hover { background: var(--surface-2); }
.card-n { grid-row: span 2; font-weight: 800; color: var(--spot); line-height: 1.6; }
.card-name { font-weight: 750; line-height: 1.5; }
.card-teaser { font-size: var(--step-small); color: var(--muted); line-height: 1.55; }
@media (max-width: 1099px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .cards { grid-template-columns: minmax(0, 1fr); } .card { padding: var(--sp-3); } }

/* ---------- 개념: one explainer ---------- */
.learn { row-gap: var(--sp-5); align-items: start; }
.learn-q { grid-column: 1 / span 5; min-width: 0; }
.learn-body { grid-column: 7 / -1; min-width: 0; }
@media (max-width: 899px) { .learn-q, .learn-body { grid-column: 1 / -1; } }
.qcard { background: var(--surface); padding: var(--sp-4); }
.q-text { font-weight: 600; margin-bottom: var(--sp-3); }
.opts { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-1); }
.opts li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--paper); line-height: 1.45; }
.opts .key { flex: none; font-weight: 750; color: var(--muted); }
.opts li.right { box-shadow: inset 0 0 0 2px var(--ok); font-weight: 700; }
.opts li.right .key { color: var(--ok); }
.opts .mark { margin-left: auto; color: var(--ok); font-weight: 800; }
.verdict { margin: 0; font-weight: 700; }
.verdict-k { display: inline-block; margin-right: var(--sp-1); padding: 0 var(--sp-2); background: var(--ok); color: var(--paper); font-size: var(--step-small); font-weight: 750; }
.pager { display: flex; justify-content: space-between; gap: var(--sp-2); }
.pager a { display: flex; flex-direction: column; flex: 1 1 0; max-width: 24rem; min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--surface); text-decoration: none; font-weight: 700; line-height: 1.45; }
.pager a:hover { background: var(--surface-2); }
.pager .next { text-align: right; margin-left: auto; }
.pager .small { font-weight: 600; }

/* ---------- simulation ---------- */
.sim { margin-top: var(--sp-5); padding: var(--sp-4); background: var(--surface); }
.sim-h { font-size: var(--step-lead); line-height: var(--lh-head); margin: 0 0 var(--sp-2); }
.sim-h .small { display: block; font-weight: 600; }
.sim-legend { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); font-size: var(--step-small); }
.sim-legend li { display: flex; align-items: center; gap: var(--sp-2); }
.sim-legend .sw { width: 14px; height: 4px; background: var(--spot); }
.sim-legend .s1 .sw { background: var(--cool); }
.sim-legend .exact { color: var(--muted); }
.sim-legend .exact b { color: var(--ink); font-weight: 700; }
.sim-stage { min-height: 0; margin-bottom: var(--sp-2); }
.sim-chart { display: block; width: 100%; height: 180px; background: var(--paper); }
.sim-read { margin: var(--sp-2) 0 0; font-size: var(--step-small); min-height: 3.4em; }
.sim .row-btns { margin-top: var(--sp-2); }
.sim-sw { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.sw-ink { color: var(--ink); } .sw-muted { color: var(--muted); } .sw-spot { color: var(--spot); } .sw-cool { color: var(--cool); } .sw-band { color: var(--surface-2); } .sw-paper { color: var(--paper); }
/* the last trial, drawn by learn.js: a row of cells (coins, draws, doors, a calendar) */
.cells { display: flex; flex-wrap: wrap; gap: calc(var(--sp-1)/2); }
.cells i { display: block; width: 12px; height: 12px; background: var(--surface-2); }
.cells i.h, .cells i.on { background: var(--spot); }
.cells i.hit { background: var(--cool); }  /* after .h: the highlighted cell shows teal even when it is heads */
.cells.cal i { width: 8px; height: 8px; }
.cells.big i { width: 24px; height: 24px; }
.stage-cap { font-size: var(--step-caption); color: var(--muted); margin: var(--sp-1) 0 0; }

/* ---------- prose pages ---------- */
.prose .sub:first-child { margin-top: 0; }

/* the six result types: wrap on phones instead of scrolling past a cut-off name */
@media (max-width: 599px) { .types-nav .subnav { flex-wrap: wrap; overflow-x: visible; column-gap: var(--sp-4); } }
