:root {
  --paper: #f3eee3;
  --card: #fbf8f1;
  --ink: #18171d;
  --ink-2: #45434d;
  --muted: #6c6a73;
  --line: #d9d2c3;
  --accent: #3446c9;
  --accent-2: #7b8cff;
  --accent-tint: #e3e6fb;
  --right: #2f7a4a;
  --right-tint: #dcefe2;
  --wrong: #a63a2b;
  --wrong-tint: #f5dcd6;
  --r: 12px;
  --r-lg: 18px;
  --display: 'Gambetta', Georgia, 'Times New Roman', serif;
  --body: 'Switzer', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --text-2xl: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--text-base)/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--line);
}
.wordmark { color: var(--ink); text-decoration: none; margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em; }
.amp { color: var(--accent); font-style: italic; font-weight: 500; }
.tag { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }

.wrap { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 20px 32px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: var(--text-base);
  transition: transform 120ms ease, background-color 160ms ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #2a2932; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-2); }
.btn--ghost:disabled { opacity: 0.5; cursor: default; }
.btn--big { min-height: 58px; padding: 0 30px; font-size: var(--text-lg); width: 100%; }

/* ---------- board ---------- */
.board { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.board__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.prompt { margin: 0; font-family: var(--display); font-size: var(--text-lg); font-weight: 500; line-height: 1.25; }
.worth { margin: 0; font-size: var(--text-xs); font-weight: 600; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }

.listen {
  width: 100%; display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 12px 20px 12px 12px; margin-bottom: 16px;
  border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent-tint); color: var(--ink); text-align: left;
  transition: transform 120ms ease;
}
.listen:active { transform: scale(0.99); }
.listen__icon { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.listen__play { width: 22px; height: 22px; margin-left: 2px; }
.listen__bars { display: none; gap: 3px; align-items: center; height: 20px; }
.listen__bars i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; animation: bar 900ms ease-in-out infinite; }
.listen__bars i:nth-child(2) { animation-delay: -200ms; }
.listen__bars i:nth-child(3) { animation-delay: -450ms; }
.listen__bars i:nth-child(4) { animation-delay: -650ms; }
.listen[data-playing='true'] .listen__play { display: none; }
.listen[data-playing='true'] .listen__bars { display: flex; }
@keyframes bar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .listen__bars i { animation: none; transform: scaleY(0.7); } }
.listen__label { flex: 1; font-weight: 600; font-size: var(--text-lg); }
.listen__cost { font-size: var(--text-sm); font-weight: 600; color: var(--wrong); font-variant-numeric: tabular-nums; }

.choices { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.choices[data-count='3'] { grid-template-columns: 1fr; }
.choice {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  min-height: 64px; padding: 12px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.choice:hover { border-color: var(--ink-2); }
.choice__key { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.choice__text { display: grid; gap: 2px; min-width: 0; }
.choice__label { font-weight: 600; line-height: 1.25; }
.choice__sub { font-size: var(--text-xs); color: var(--muted); line-height: 1.3; }
.choice__hear { display: none; position: absolute; right: 10px; top: 10px; font-size: 0.6875rem; font-weight: 600; color: var(--accent); }
.choices[data-answered='true'] .choice { padding-right: 56px; }
.choices[data-answered='true'] .choice__hear { display: block; }
.choice.is-right { background: var(--right-tint); border-color: var(--right); }
.choice.is-right .choice__key { background: var(--right); border-color: var(--right); color: #fff; }
.choice.is-wrong { background: var(--wrong-tint); border-color: var(--wrong); }
.choice.is-wrong .choice__key { background: var(--wrong); border-color: var(--wrong); color: #fff; }

.reveal { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.reveal__verdict { margin: 0 0 4px; font-family: var(--display); font-size: var(--text-xl); font-weight: 600; line-height: 1.1; white-space: pre; }
.reveal[data-result='right'] .reveal__verdict { color: var(--right); }
.reveal[data-result='wrong'] .reveal__verdict { color: var(--wrong); }
.reveal__detail { margin: 0 0 6px; color: var(--ink-2); }
.reveal__hint { margin: 0 0 14px; font-size: var(--text-xs); color: var(--muted); }
.reveal .btn { width: 100%; }

/* ---------- resume bar ---------- */
.resume {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 536px; margin: 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper); box-shadow: 0 10px 30px rgba(24, 23, 29, 0.25);
}
.resume .btn--primary { background: var(--paper); color: var(--ink); min-height: 44px; padding: 0 16px; font-size: var(--text-sm); }

/* ---------- footer ---------- */
.foot { padding: 18px 20px max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; font-size: var(--text-xs); color: var(--muted); }
.foot p { margin: 0 auto; max-width: 52ch; }
.foot a { color: var(--ink-2); text-underline-offset: 3px; }

.foot p + p { margin-top: 8px; }

/* ---------- shared ---------- */
.screen h1:focus, .screen h2:focus { outline: none; }
.eyebrow { margin: 0 0 8px; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.display { margin: 0 0 10px; font-family: var(--display); font-weight: 600; font-size: var(--text-2xl); line-height: 1.05; letter-spacing: -0.02em; }
.display--sm { font-size: var(--text-xl); }
.lede { margin: 0 0 22px; max-width: 40ch; color: var(--ink-2); }
.note { margin: 10px 0 0; font-size: var(--text-sm); color: var(--muted); }
.btn--wide { width: 100%; }
.back { margin: 0 0 14px; padding: 6px 0; border: 0; background: none; font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); min-height: 40px; }

/* ---------- home ---------- */
.home { padding-top: 4px; }
.staff { width: min(100%, 300px); height: auto; color: var(--ink); margin: 4px 0 18px; display: block; }
.staff__accent { fill: var(--accent); }
.daily-card { padding: 18px; margin-bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.daily-card__date { margin: 0 0 12px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
.daily-card__status { margin: 12px 0 0; font-size: var(--text-sm); color: var(--muted); }
.prefs { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.prefs__label { font-weight: 500; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.seg button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }

/* ---------- pick ---------- */
.cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cat { width: 100%; display: grid; gap: 4px; padding: 16px 18px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color 140ms ease; }
.cat:hover { border-color: var(--ink-2); }
.cat__name { font-family: var(--display); font-size: var(--text-lg); font-weight: 600; line-height: 1.2; }
.cat__blurb { color: var(--ink-2); font-size: var(--text-sm); }
.cat__meta { font-size: var(--text-xs); font-weight: 600; color: var(--accent); }

/* ---------- play ---------- */
.play__bar { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding-bottom: 12px; margin-bottom: 16px; }
.play__label { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.play__progress { font-weight: 600; }
.play__score { font-weight: 600; font-variant-numeric: tabular-nums; }
.play__track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.play__track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 300ms ease; }
.board__type { margin: 0 0 2px; font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.choice:disabled { cursor: default; opacity: 0.55; }
.choices[data-answered='true'] .choice:disabled { opacity: 1; }
.hint { margin: 10px 0 0; font-size: var(--text-xs); color: var(--muted); text-align: center; }
.reveal__answer { margin: 0 0 4px; font-weight: 600; }

/* ---------- results ---------- */
.score { margin: 4px 0 10px; font-family: var(--display); font-size: clamp(3rem, 2rem + 5vw, 4.5rem); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.score__of { font-family: var(--body); font-size: var(--text-lg); font-weight: 500; color: var(--muted); }
.sqs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; }
.sq { display: inline-block; width: 22px; height: 22px; border-radius: 5px; vertical-align: -5px; }
.key .sq { width: 13px; height: 13px; border-radius: 3px; vertical-align: -1px; margin-left: 8px; }
.key .sq:first-child { margin-left: 0; }
.sq--g { background: var(--right); }
.sq--y { background: #c99a1e; }
.sq--r { background: var(--wrong); }
.key { margin: -8px 0 20px; font-size: var(--text-xs); color: var(--muted); }
.results__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.results__actions .btn--primary { flex: 1 1 100%; }
.results__actions .btn--ghost { flex: 1 1 0; }
.share-status { min-height: 1.5em; margin: 8px 0 0; font-size: var(--text-sm); color: var(--ink-2); }
.share-fallback { width: 100%; margin-top: 6px; padding: 10px; font: 400 var(--text-sm)/1.4 var(--body); border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); }
.results__note { margin: 6px 0 0; font-size: var(--text-sm); color: var(--muted); }
.sponsor { margin: 14px 0 0; font-size: var(--text-sm); color: var(--ink-2); }
.sponsor__tag { display: block; color: var(--muted); }

.suite-card { margin: 26px 0 0; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.suite-card__title { margin: 0 0 12px; font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.suite-card__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.suite-card__game { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; color: inherit; text-decoration: none; border-radius: 8px; }
.suite-card__img { width: 112px; height: auto; aspect-ratio: 40 / 21; object-fit: cover; border-radius: 6px; background: var(--line); }
.suite-card__text { display: grid; gap: 2px; min-width: 0; }
.suite-card__name { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.suite-card__desc { font-size: var(--text-sm); color: var(--muted); line-height: 1.4; }
.suite-card__game:hover .suite-card__name, .suite-card__game:focus-visible .suite-card__name { text-decoration-color: currentColor; }
.suite-card__all { display: inline-block; margin-top: 14px; font-size: var(--text-sm); color: var(--ink-2); }

.rows { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row__n { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 0.75rem; font-weight: 600; color: #fff; }
.row--g .row__n { background: var(--right); }
.row--y .row__n { background: #94700a; }
.row--r .row__n { background: var(--wrong); }
.row__text { display: grid; gap: 2px; min-width: 0; }
.row__name { font-weight: 600; }
.row__meta { font-size: var(--text-xs); color: var(--muted); }
.row__pts { font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 400px) {
  .choices { grid-template-columns: 1fr; }
  .board { padding: 16px; }
  .prefs { flex-wrap: wrap; }
}

/* ---------- about ---------- */
.doc h2 { margin: 28px 0 8px; font-family: var(--display); font-size: var(--text-lg); font-weight: 600; }
.doc p, .doc li { color: var(--ink-2); }
.doc ul { padding-left: 20px; margin: 0 0 12px; }
.doc li { margin-bottom: 6px; }
.doc .lede { max-width: none; }

/* ---------- learn (reference pages) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0; font-size: var(--text-xs); color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; color: var(--muted); }
.crumbs a { color: var(--ink-2); text-underline-offset: 3px; }
.learn h2 a { color: inherit; text-underline-offset: 4px; }
.learn cite { font-style: italic; }
.plays { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.lplay { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; font-size: var(--text-sm); transition: transform 120ms ease; }
.lplay:active { transform: scale(0.97); }
.lplay:hover { background: #d6dafa; }
.lplay__icon { width: 14px; height: 14px; flex: none; }
.lplay[data-playing='true'] { background: var(--accent); color: #fff; }
.lplay--sm { min-height: 40px; min-width: 40px; padding: 0; justify-content: center; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
.facts div { padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.facts dt { font-size: var(--text-xs); color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ref { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.ref th, .ref td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ref thead th { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.ref tbody th { font-weight: 600; white-space: nowrap; }
.ref td:last-child, .ref th:last-child { width: 48px; text-align: right; padding-right: 0; }
.links { padding-left: 20px; }
.links a { color: var(--accent); text-underline-offset: 3px; }
.shape { display: flex; gap: 18px; align-items: flex-start; margin: 0 0 8px; }
.shape p { margin: 0 0 8px; }
.diagram { flex: none; width: 130px; height: auto; color: var(--ink); }
.diagram line { stroke: var(--ink-2); stroke-width: 1.2; }
.diagram .nut { fill: var(--ink); }
.diagram .dot { fill: var(--accent); }
.diagram .open { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.diagram text { font: 600 14px var(--body); fill: var(--ink); }
.diagram .str { font-size: 11px; font-weight: 500; fill: var(--muted); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.05em; }
.cards, .doc .cards { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cards a { display: grid; gap: 2px; height: 100%; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--ink-2); }
.cards__name { font-weight: 600; line-height: 1.25; }
.cards__meta { font-size: var(--text-xs); color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 0; }
.pager a { display: grid; gap: 2px; color: var(--ink); text-decoration: none; font-weight: 600; }
.pager a span { font-size: var(--text-xs); font-weight: 500; color: var(--muted); }
.pager__next { text-align: right; margin-left: auto; }
.cta { margin: 28px 0 0; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.cta p { margin: 0 0 12px; }
.cta__title { font-family: var(--display); font-size: var(--text-lg); font-weight: 600; color: var(--ink) !important; margin-bottom: 4px !important; }
.reveal__learn { display: inline-block; margin: 0 0 14px; font-size: var(--text-sm); font-weight: 600; color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 380px) { .facts { grid-template-columns: 1fr 1fr; } .shape { flex-direction: column; } }

/*ge-bar*/
.ge-bar { display: block; background: #16130f; color: #f4f0e8; text-decoration: none; font-size: 14px; line-height: 1; border-bottom: 1px solid #000; }
.ge-bar__in { display: flex; align-items: center; gap: 8px; min-height: 40px; max-width: var(--ge-max, none); margin: 0 auto; padding: 0 max(var(--ge-pad, 16px), env(safe-area-inset-right)) 0 max(var(--ge-pad, 16px), env(safe-area-inset-left)); }
.ge-bar__chev { width: 14px; height: 14px; flex: none; opacity: .75; }
.ge-bar__mark { width: 22px; height: 22px; flex: none; }
.ge-bar__name { font-weight: 700; letter-spacing: .01em; }
.ge-bar__more { margin-left: auto; color: #cbc2b2; font-weight: 500; }
.ge-bar:hover .ge-bar__name, .ge-bar:hover .ge-bar__more { text-decoration: underline; text-underline-offset: 3px; }
.ge-bar:focus-visible { outline: 2px solid #e8673c; outline-offset: -2px; }
@media (display-mode: standalone) { .ge-bar { display: none; } }
@media print { .ge-bar { display: none; } }
.ge-bar { --ge-pad: 20px; }
.ge-bar + .top { padding-top: 14px; }
/*/ge-bar*/

/* progression pages: a row of chord diagrams */
.shapes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.shapes figure { margin: 0; display: grid; justify-items: center; gap: 4px; padding: 8px 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.shapes .diagram { width: 100%; max-width: 120px; height: auto; }
.shapes figcaption { font-size: var(--text-xs); text-align: center; display: grid; gap: 2px; }
