/* Oftle · "field notebook" tokens and components
   Drop into app/css/base.css. Plain CSS, no build step.
   Fonts (one <link> in index.html):
   https://fonts.googleapis.com/css2?family=Instrument+Sans:wdth,wght@75..100,400..700&family=IBM+Plex+Mono:wght@400;500;600&family=Caveat:wght@600&display=swap
*/

/* ---------- Tokens: light (default) ---------- */
:root {
  --paper: #F6F3EA;      /* ground, graph paper */
  --card: #FFFDF7;       /* cards, inputs */
  --grid: #E4E6E2;       /* graph lines, decoration only */
  --rule: #D6D0C0;       /* borders, dividers */
  --ink: #1B1D24;        /* text, primary button (15.2:1 on paper) */
  --pencil: #565A63;     /* secondary text, labels (6.2:1) */
  --red: #B3301F;        /* tally strike, your mark, wrong (5.6:1; 4.9:1 on --red-soft) */
  --red-soft: #F8DED9;   /* your league row, chosen slot */
  --blue: #2A4A9A;       /* links, right marks (7.4:1) */
  --blue-soft: #E1E7F5;  /* "spot on" zone */
  --banner: #FF9A62;     /* test-build banner only */
  --banner-ink: #1B1D24; /* 8.1:1 on banner */
  --on-ink: #FFFDF7;     /* text on --ink */

  --font-sans: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-hand: 'Caveat', cursive; /* annotations only, never a figure or instruction */

  /* type scale (px / line-height) */
  --fs-score: 120px;  --lh-score: 0.85;
  --fs-display: 64px; --lh-display: 0.92;
  --fs-h1: 44px;      --lh-h1: 0.95;
  --fs-h2: 36px;      --lh-h2: 0.98;
  --fs-body: 16px;    --lh-body: 1.45;
  --fs-small: 14px;
  --fs-figure: 20px;
  --fs-label: 12px;
  --fs-note: 11px;
  --fs-hand: 24px;

  /* spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px;

  /* corners */
  --r-chip: 4px; --r-card: 6px; --r-button: 8px; --r-tap: 14px; --r-pill: 22px;

  /* sizes */
  --target: 44px; --button: 56px; --button-hero: 60px; --tap-target-h: 300px;
  --column: 560px;

  /* motion */
  --t-press: 60ms; --t-select: 120ms; --t-screen: 180ms; --t-row: 240ms; --t-toast: 160ms;
  --ease-out: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- Tokens: dark ---------- */
:root[data-theme="dark"] {
  --paper: #14161B; --card: #1C1F26; --grid: #1F232B; --rule: #343A45;
  --ink: #ECE7DA; --pencil: #A6AAB3; --red: #FF8073; --red-soft: #3A2321;
  --blue: #9DB6FF; --blue-soft: #1E2A45; --on-ink: #14161B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161B; --card: #1C1F26; --grid: #1F232B; --rule: #343A45;
    --ink: #ECE7DA; --pencil: #A6AAB3; --red: #FF8073; --red-soft: #3A2321;
    --blue: #9DB6FF; --blue-soft: #1E2A45; --on-ink: #14161B;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font: 400 var(--fs-body)/var(--lh-body) var(--font-sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.app { max-width: var(--column); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
a:hover { color: var(--ink); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display { font-stretch: 78%; font-weight: 700; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
.hand { font-family: var(--font-hand); font-weight: 600; font-size: var(--fs-hand); color: var(--red); }
.label { margin: 0; font: 600 var(--fs-label)/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); }
.muted { color: var(--pencil); }

/* ---------- Header and footer ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 6px 12px 6px 20px; }
.wordmark { display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-size: 30px; line-height: 1; }
.wordmark svg { color: var(--red); }
.nav { display: flex; gap: 4px; align-items: center; }
.icon-btn { width: var(--target); height: var(--target); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: none; border: 0; border-radius: var(--r-pill); }
.pill { height: var(--target); display: inline-flex; align-items: center; padding: 0 14px; font: 500 13px var(--font-mono); color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: var(--r-pill); background: var(--card); }
.pill[aria-current="page"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }
.site-footer { padding: 10px 24px 14px; font: 400 var(--fs-note)/1.4 var(--font-mono); color: var(--pencil); text-align: center; }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: 0 1px 0 var(--rule); }
.card--dashed { background: transparent; border: 1.5px dashed var(--ink); box-shadow: none; }
.chip { font: 400 13px var(--font-mono); padding: 7px 10px; border: 1px solid var(--ink); border-radius: var(--r-chip); background: var(--card); }
.banner { margin: 0; background: var(--banner); color: var(--banner-ink); font: 600 12px var(--font-mono); padding: 9px 12px; border-radius: var(--r-chip); }

/* ---------- Buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--target); border-radius: var(--r-button); font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color var(--t-select), color var(--t-select); }
.btn--primary { height: var(--button); background: var(--ink); color: var(--on-ink); border: 0; font-size: 17px; }
.btn--hero { height: var(--button-hero); font-size: 18px; }
.btn--secondary { height: 52px; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); font-size: 16px; }
.btn--quiet { height: var(--target); background: transparent; color: var(--ink); border: 1.5px solid var(--rule); font-size: 15px; }
.choice { height: 72px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); border-radius: var(--r-button); font-size: 17px; font-weight: 600; }
.choice[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* ---------- Round 1: tap target ---------- */
.clock { margin: 0; font: 500 52px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.ruler { position: relative; height: 14px; border-bottom: 1.5px solid var(--ink); }
.ruler::after { content: ""; position: absolute; inset: 0; opacity: .5;
  /* the first layer draws the end tick: the repeating ticks alone stop at 90% */
  background: linear-gradient(var(--ink), var(--ink)) right / 1.5px 100% no-repeat,
    linear-gradient(90deg, var(--ink) 1.5px, transparent 1.5px) left / 10% 100% repeat-x; }
.ruler__fill { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--red); } /* width set from JS, linear: no pace hint */
.tap-target {
  width: 100%; height: var(--tap-target-h); border-radius: var(--r-tap);
  background: var(--card); border: 2px dashed var(--ink); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 3px 0 var(--rule);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) ease-out, box-shadow var(--t-press) ease-out;
  cursor: pointer;
}
.tap-target[data-state="tapping"], .tap-target[data-state="done"] { border-style: solid; }
.tap-target.is-pressed { transform: scale(.975); box-shadow: 0 0 0 var(--rule); }
.tally { display: flex; flex-wrap: wrap; gap: 10px 12px; justify-content: center; max-width: 300px; }
.tally__group { position: relative; width: 34px; height: 40px; }
.tally__bar { position: absolute; top: 2px; width: 3px; height: 36px; background: var(--ink); border-radius: 2px; }
.tally__bar:nth-child(1) { left: 4px; transform: rotate(-2deg); }
.tally__bar:nth-child(2) { left: 12px; transform: rotate(1.5deg); }
.tally__bar:nth-child(3) { left: 20px; transform: rotate(-1deg); }
.tally__bar:nth-child(4) { left: 28px; transform: rotate(2deg); }
.tally__strike { position: absolute; left: -4px; top: 18px; width: 44px; height: 3px; background: var(--red); border-radius: 2px; transform: rotate(-28deg); }

/* ---------- Round 3: slots ---------- */
.scale { margin: 0 0 0 5px; padding: 0 0 0 18px; list-style: none; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--ink); }
.slot { width: 100%; height: var(--target); border-radius: var(--r-card); border: 2px dashed var(--pencil); background: transparent; color: var(--pencil); font-size: 15px; font-weight: 600; text-align: left; padding: 0 14px; }
.slot[aria-pressed="true"] { border-style: solid; border-color: var(--red); background: var(--red-soft); color: var(--red); }

/* ---------- Results ---------- */
.score { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.score__value { font-size: var(--fs-score); line-height: var(--lh-score); font-stretch: 78%; font-weight: 700; font-variant-numeric: tabular-nums; }
.score__max { font: 400 26px var(--font-mono); color: var(--pencil); }
.mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid var(--blue); color: var(--blue); }
.mark--near { border-style: dashed; }
.mark--wrong { border-color: var(--red); color: var(--red); }
.reveal-row { opacity: 0; transform: translateY(8px); transition: opacity var(--t-row) var(--ease-out), transform var(--t-row) var(--ease-out); }
.reveal-row.is-in { opacity: 1; transform: none; }
.answer__figure { margin: 0; font: 500 var(--fs-figure) var(--font-mono); }
.answer__year { margin: 0; font: 400 13px var(--font-mono); color: var(--pencil); }
.answer__source { min-height: var(--target); display: inline-flex; align-items: center; gap: 4px; font: 600 13px var(--font-mono); }
.answer__unverified { margin: 0; font: 600 12px var(--font-mono); color: var(--red); }

/* ---------- League ---------- */
.league-table { width: 100%; border-collapse: collapse; font: 400 14px var(--font-mono); }
.league-table th { padding: 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--pencil); text-align: right; border-bottom: 1.5px solid var(--ink); }
.league-table td { padding: 11px 6px; border-bottom: 1px solid var(--rule); text-align: right; }
.league-table th:nth-child(-n+2), .league-table td:nth-child(-n+2) { text-align: left; }
.league-table td:nth-child(2) { font-family: var(--font-sans); font-weight: 500; }
.league-table tr.is-you td { background: var(--red-soft); }
.league-table tr.is-you td:nth-child(2) { font-weight: 600; }
.field { height: 52px; width: 100%; border-radius: var(--r-card); border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font-size: 17px; padding: 0 14px; }
.field[aria-invalid="true"] { border: 2px solid var(--red); }
.field--code { height: 64px; font: 600 30px var(--font-mono); letter-spacing: .4em; text-transform: uppercase; }
.field-error { margin: 0; font: 600 13px var(--font-mono); color: var(--red); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 64px; transform: translate(-50%, 8px); opacity: 0; background: var(--ink); color: var(--on-ink); font: 500 14px var(--font-mono); padding: 12px 18px; border-radius: var(--r-card); white-space: nowrap; transition: opacity var(--t-toast), transform var(--t-toast); }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Loading tally ---------- */
@keyframes oftle-draw { 0% { transform: scaleY(0); opacity: .2; } 40%, 100% { transform: scaleY(1); opacity: 1; } }
.loader > span { transform-origin: bottom; animation: oftle-draw 1.8s ease-out infinite; }
.loader > span:nth-child(2) { animation-delay: .15s; }
.loader > span:nth-child(3) { animation-delay: .3s; }
.loader > span:nth-child(4) { animation-delay: .45s; }
.loader > span:nth-child(5) { animation-delay: .6s; }

/* ---------- Screen change ---------- */
.view-enter { animation: oftle-in var(--t-screen) var(--ease-out) both; }
@keyframes oftle-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tap-target.is-pressed { transform: none; background: var(--blue-soft); }
  .reveal-row { transform: none; transition: opacity 150ms; }
  .toast, .toast.is-in { transform: translate(-50%, 0); }
  .loader > span { animation: none; }
  .view-enter { animation: oftle-fade 120ms both; }
  @keyframes oftle-fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ======================================================================
   App layout. Not part of the design handoff above: spacing and small
   layout pieces the screens need, built only from the tokens above.
   ====================================================================== */
.view { flex: 1; width: 100%; padding: var(--s-2) var(--s-4) var(--s-7); }
.screen { display: flex; flex-direction: column; gap: var(--s-4); }
.screen + .screen, .card + .card { margin-top: var(--s-4); }
.card { padding: var(--s-5); }
h1, h2 { margin: 0; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2 { font-size: 26px; line-height: 1; }
.display--hero { font-size: var(--fs-display); line-height: var(--lh-display); }
p { margin: 0; }
.q { font-size: 18px; line-height: 1.4; }
.center { text-align: center; }
.small { font-size: var(--fs-small); }
.row { display: flex; gap: var(--s-3); align-items: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.wordmark .display { font-stretch: 78%; }
.nav .icon-btn svg { display: block; }
.btn:disabled { opacity: .45; cursor: default; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.toast { z-index: 10; pointer-events: none; white-space: normal; width: max-content; max-width: calc(100% - 32px); text-align: center; }

/* Loading tally: five drawn bars */
.loader { display: flex; gap: 7px; justify-content: center; align-items: flex-end; height: 40px; margin: var(--s-8) 0 var(--s-3); }
.loader > span { width: 3px; height: 36px; background: var(--ink); border-radius: 2px; }

/* Round 1 */
.how-tap { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.clock-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.clock small { font-size: 20px; color: var(--pencil); }
.tap-target__label { font: 700 40px/1 var(--font-sans); font-stretch: 78%; }
.tap-target .muted { font-size: var(--fs-small); padding: 0 var(--s-5); text-align: center; }

/* Round 3 */
.scale .anchor { font-weight: 600; padding: 2px 0; }
.scale-end { margin-left: 5px; }

/* Results */
.score-head { display: flex; flex-direction: column; gap: var(--s-2); }
.rounds, .answers { list-style: none; margin: 0; padding: 0; }
.rounds li { display: grid; grid-template-columns: 28px 1fr auto; gap: 2px var(--s-3); align-items: center; padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.rounds li:last-child { border-bottom: 1px solid var(--rule); }
.rounds .pts { font: 500 17px var(--font-mono); font-variant-numeric: tabular-nums; }
.rounds .note { grid-column: 2 / -1; font-size: var(--fs-small); color: var(--pencil); }
.rounds .hand { font-size: 22px; line-height: 1; }
.dots { font: 500 13px var(--font-mono); letter-spacing: .1em; color: var(--ink); }
.share-preview { margin: 0; padding: var(--s-3) var(--s-4); font: 400 13px/1.6 var(--font-mono); white-space: pre-wrap; border-radius: var(--r-card); }
.answers li { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.answers li:first-child { border-top: 0; padding-top: 0; }
.answers .label { margin-top: var(--s-2); }
.answers b { font-weight: 600; }
.answer__source { align-self: flex-start; }

/* League */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--s-5) * -1); padding: 0 var(--s-5); }
.form { display: flex; flex-direction: column; gap: var(--s-2); }
.form .btn { margin-top: var(--s-3); }
.form label { display: flex; flex-direction: column; gap: var(--s-2); }
.form label + label { margin-top: var(--s-3); }

@media (max-width: 380px) {
  :root { --fs-score: 104px; --fs-h1: 38px; --fs-display: 54px; --tap-target-h: 260px; }
  .card { padding: var(--s-4); }
}
.tie { margin-top: var(--s-4); }
.two .btn--quiet { height: 52px; }
.practice { display: flex; flex-direction: column; gap: var(--s-2); }
.practice__pad { height: 140px; }
.how li p + p { margin-top: var(--s-2); }
.how .practice { margin-top: var(--s-4); }

/* ======================================================================
   Design update (Claude Design canvas, "Oftle", 29 Nov 2026): the full
   screen set. Built only from the tokens above.
   ====================================================================== */
.wordmark { gap: 6px; }
.wordmark .display { font-size: 30px; }
.screen--tall { min-height: calc(100vh - 56px - 72px); }
.grow { flex: 1; }
.hero-lede { font-size: 18px; line-height: 1.45; color: var(--pencil); max-width: 320px; }
.fine { margin: 0; font: 400 12px/1.4 var(--font-mono); color: var(--pencil); text-align: center; }
.back { align-self: flex-start; min-height: var(--target); display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--font-mono); color: var(--ink); text-decoration: none; }

/* Landing: today's event, sealed */
.sealed { position: relative; padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.sealed__lines { display: flex; flex-direction: column; gap: 8px; }
.sealed__lines div { display: flex; gap: 8px; }
.sealed__lines span { height: 16px; background: var(--ink); border-radius: 2px; }
.sealed .hand { position: absolute; right: 16px; bottom: 10px; transform: rotate(-4deg); }

/* How to play */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.steps li { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--s-3); align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.steps .hand { font-size: 32px; line-height: 1; }
.steps b { display: block; font-size: 18px; }
.steps .pts { font: 500 13px var(--font-mono); color: var(--pencil); }
.pace { margin: 0; padding: 8px 10px; text-align: center; font: 600 22px/1.35 var(--font-mono); background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-button); }
.pace b { display: block; font: 700 20px/1.25 var(--font-sans); }
.pace span { display: block; font-size: 15px; color: var(--pencil); }
/* Round 1's key: "1 tap = 10 tonnes of steel" over "10 seconds = 10 days", like a map's legend */
.tapkey { margin: 0; padding: 8px 14px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-button); display: grid; grid-template-columns: max-content 1fr; column-gap: 10px; row-gap: 2px; align-items: baseline; }
.tapkey div { display: contents; }
.tapkey dt { font: 600 16px/1.35 var(--font-mono); color: var(--pencil); text-align: right; white-space: nowrap; }
.tapkey dt::after { content: ' ='; }
.tapkey dd { margin: 0; font: 700 19px/1.3 var(--font-sans); }
.tapkey dd small { font: 500 14px var(--font-mono); color: var(--pencil); }
.pace-box { display: flex; flex-direction: column; gap: var(--s-2); text-align: center; }
.beat { display: flex; flex-direction: column; gap: var(--s-2); }

/* Short screens: a smaller tap area keeps all of it in view */
@media (max-height: 800px) { :root { --tap-target-h: 260px; } }
@media (max-height: 760px) { :root { --tap-target-h: 215px; } }
@media (max-height: 700px) { :root { --tap-target-h: 204px; } }

/* While a round is on screen, the footer's note about figures waits for the results */
.app:has(.screen--round) .site-footer { display: none; }
/* A round fills the screen the phone is showing (dvh allows for the browser's bars) */
.app:has(.screen--round) { min-height: 100vh; min-height: 100dvh; }
.app:has(.screen--round) .view { display: flex; flex-direction: column; padding-bottom: var(--s-4); }
.app:has(.screen--round) .screen--tall { flex: 1; min-height: 0; }
/* Round 1: the tap area takes any spare height, never less than --tap-target-h */
.screen--round > .tap-target { flex: 1 0 auto; height: auto; min-height: var(--tap-target-h); max-height: 520px; }
.screen--round > .tap-target[data-state="done"] { min-height: 140px; }   /* gives Next room without scrolling */

/* Round 1 */
.clock-row .count { margin: 0; font: 600 24px var(--font-mono); }
.ruler-ends { display: flex; justify-content: space-between; font: 600 13px var(--font-mono); color: var(--pencil); }
.timer { display: flex; flex-direction: column; gap: 6px; }
.tap-target__big { font: 700 96px/1 var(--font-sans); font-stretch: 78%; }
.tap-target__done { font: 700 48px/1 var(--font-sans); font-stretch: 78%; }
.tap-target .hand { font-size: 30px; }
.tap-target[data-state="done"] .hand { font-size: 24px; }
.btn.is-hidden { display: none; }
@keyframes oftle-fadein { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: oftle-fadein 160ms var(--ease-out) both; }

/* Round 2 */
.versus { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--s-3); }
.versus .choice { flex: 1 0 auto; height: auto; min-height: 104px; max-height: 200px; padding: var(--s-4); font-size: 22px; line-height: 1.25; text-align: center; }
.versus .hand { font-size: 30px; line-height: 1; }
.choice { display: flex; align-items: center; justify-content: center; gap: 8px; }
.next-slot { min-height: 64px; display: flex; flex-direction: column; justify-content: center; }

/* Round 3 */
.placing { padding: var(--s-3) var(--s-4); font-size: 20px; font-weight: 600; line-height: 1.25; border: 2px solid var(--red); }
.scale-end { display: flex; align-items: center; gap: 6px; }
.slot { height: auto; min-height: var(--target); padding: 10px 14px; line-height: 1.25; }
.scale .anchor { display: flex; align-items: center; gap: 10px; }
.scale .anchor::before { content: ""; width: 10px; height: 10px; flex: none; margin-left: -24px; border-radius: 50%; background: var(--ink); }

/* Results */
.result-score { margin-top: calc(var(--s-2) * -1); }
.meter { position: relative; height: 30px; margin-top: var(--s-1); }
.meter__ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; border-bottom: 1.5px solid var(--ink);
  /* the first layer draws the end tick: the repeating ticks alone stop at 90% */
  background: linear-gradient(var(--ink), var(--ink)) right / 1.5px 100% no-repeat,
    linear-gradient(90deg, var(--ink) 1.5px, transparent 1.5px) left / calc(100% / 10) 100% repeat-x; opacity: .7; }
.meter__mark { position: absolute; bottom: 10px; transform: translateX(-50%); font-size: 26px; line-height: 1; }
.meter-ends { display: flex; justify-content: space-between; font: 500 12px var(--font-mono); color: var(--pencil); }
.rank { font: 500 13px var(--font-mono); color: var(--pencil); }
.round-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.round-list > li { padding: var(--s-4); }
.round-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.round-head p:first-child { font-size: 18px; font-weight: 600; }
.round-pts { font: 600 20px var(--font-mono); font-variant-numeric: tabular-nums; }
.round-pts span { font-size: 14px; font-weight: 400; color: var(--pencil); }
.round-row { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); align-items: start; }
.round-row .note { font-size: var(--fs-small); color: var(--pencil); margin-top: 2px; }
.rates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-3); }
.rates > div { min-width: 0; padding: var(--s-3) var(--s-2); border: 1px solid var(--rule); border-radius: var(--r-card); display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; container-type: inline-size; }
.rates > div:last-child { border: 1.5px solid var(--blue); }
.rates .about { font: 400 12px var(--font-mono); color: var(--pencil); }
/* the figures scale with their box (cqi), so they stay on one line on narrow phones */
.rates .num { font-size: 56px; font-size: min(72px, 52cqi); line-height: 1; font-stretch: 78%; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rates--long .num { font-size: 36px; font-size: min(56px, 42cqi); }
.rates--longer .num { font-size: 28px; font-size: min(40px, 29cqi); }
.rates .per { font-size: var(--fs-small); color: var(--pencil); }
.rates-src { margin-top: var(--s-2); font: 400 11px/1.4 var(--font-mono); color: var(--pencil); text-align: center; }
.gauge { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; height: 12px; margin-top: 40px; }
.gauge span { background: var(--rule); border-radius: 2px; }
.gauge span:nth-child(3) { background: var(--blue-soft); outline: 1.5px solid var(--blue); outline-offset: -1.5px; }
.gauge .you { position: absolute; bottom: 14px; transform: translateX(-50%); white-space: nowrap; font-size: 22px; line-height: 1; background: none; }
.gauge-ends { display: grid; grid-template-columns: 1fr 1fr 1fr; font: 500 12px var(--font-mono); color: var(--pencil); margin-top: 4px; }
.gauge-ends span:nth-child(2) { text-align: center; }
.gauge-ends span:nth-child(3) { text-align: right; }
.lean { margin-top: var(--s-2); font: 700 36px/1.1 var(--font-sans); font-stretch: 78%; text-align: center; }
.round-list .tap-hint { margin-top: var(--s-3); font-size: var(--fs-small); }
.tap-hint { color: var(--pencil); }
.share-block { display: flex; flex-direction: column; gap: var(--s-2); }
.week { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.week__head { display: flex; align-items: baseline; justify-content: space-between; }
.week__head p:first-child { font-size: 18px; font-weight: 600; }
.week__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week__days > span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border: 1px solid var(--rule); border-radius: var(--r-chip); background: var(--card); }
.week__days .d { font: 500 11px var(--font-mono); color: var(--pencil); }
.week__days .m { font-weight: 700; color: var(--blue); min-height: 1.2em; }
.week__days .is-miss .m { color: var(--pencil); }
.week__days .is-today { border-color: var(--ink); }
.answer-list { list-style: none; margin: 0; padding: 0; }
.answer-list li { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.answer-list li:first-child { border-top: 0; padding-top: 0; }
.answer-list .who { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.answer-list .who p:first-child { font-weight: 600; }
.answer-list .src-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.tomorrow { padding: var(--s-4); display: flex; flex-direction: column; gap: 6px; }
.tomorrow .hand { font-size: 28px; line-height: 1.1; }
.league-link { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4); color: var(--ink); text-decoration: none; }
.league-link b { display: block; font-size: 17px; }
.league-link span span { font: 400 13px var(--font-mono); color: var(--pencil); }

/* Coming back after playing */
.countdown { padding: var(--s-5); display: flex; flex-direction: column; gap: 4px; text-align: center; }
.countdown__time { font: 500 52px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.score-card { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) var(--s-5); color: var(--ink); text-decoration: none; }
.score-card .score__value { font-size: 72px; }
.score-card .score__max { font-size: 18px; }
.score-card .marks { display: flex; flex-direction: column; gap: 2px; font: 500 13px var(--font-mono); text-align: right; }

/* Share sheet */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: rgba(27, 29, 36, .45); display: flex; align-items: flex-end; justify-content: center; animation: oftle-fadein 160ms both; }
.sheet { width: 100%; max-width: var(--column); max-height: 100vh; overflow: auto; background: var(--paper); border-radius: 14px 14px 0 0; padding: var(--s-5) var(--s-5) var(--s-7); display: flex; flex-direction: column; gap: var(--s-4); box-shadow: 0 -2px 0 var(--rule); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet__head h2 { font-size: 32px; }
.sheet .share-preview { position: relative; }
.sheet .share-preview + .hand { align-self: flex-end; margin-top: -10px; font-size: 22px; transform: rotate(-3deg); }
@media (min-width: 600px) { .sheet-back { align-items: center; } .sheet { border-radius: 14px; } }

/* The shortest phones: tighter rounds */
@media (max-height: 700px) {
  .screen--round { gap: var(--s-3); }
  .screen--round h1 { font-size: 32px; }
  .screen--round .tapkey { padding: 6px 10px; }
  .screen--round .tapkey dd { font-size: 17px; }
  .screen--round .placing { padding: var(--s-2) var(--s-3); font-size: 17px; }
}

/* League */
.lg-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.lg-head .mono { font-size: 12px; color: var(--pencil); }
.field-hint { margin: 0; font: 400 12px var(--font-mono); color: var(--pencil); }
.label-opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
.invite-card { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.invite-card .code { font: 600 28px var(--font-mono); letter-spacing: .12em; }
.invite-card .facts { font: 400 13px/1.5 var(--font-mono); color: var(--pencil); text-align: right; }
.code-count { margin: 0; font: 400 12px var(--font-mono); color: var(--pencil); text-align: right; }

/* States */
.oops { font-size: 40px; transform: rotate(-4deg); align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
  .fade-in, .sheet-back { animation: none; }
}
.h-round { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.tie { margin-top: var(--s-6); }

/* How to play, punchy version: rules, the beat line, examples, practice */
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.rules li { display: grid; grid-template-columns: 28px 1fr; align-items: baseline; gap: var(--s-2); }
.rules .hand { font-size: 30px; line-height: 1; }
.beatline { position: relative; height: 44px; border-bottom: 1.5px solid var(--ink); margin-top: var(--s-2);
  background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 10% 100%; }
.beatline__ghost { position: absolute; bottom: 0; width: 10px; height: 30px; margin-left: -5px; border: 1.5px dashed var(--blue); border-bottom: 0; border-radius: 5px 5px 0 0; background: var(--blue-soft); }
.beatline__tap { position: absolute; bottom: 0; width: 3px; height: 38px; margin-left: -1.5px; background: var(--red); border-radius: 2px; transform-origin: bottom; animation: oftle-tap 160ms var(--ease-out) both; }
.beatline.is-live::after { content: ""; position: absolute; left: var(--now, 0); bottom: -4px; width: 2px; height: 50px; background: var(--ink); opacity: .35; }
@keyframes oftle-tap { from { transform: scaleY(.2); } to { transform: none; } }
.examples ul { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.examples .beatline { height: 30px; }
.examples .beatline__tap { height: 26px; animation: none; }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); font-weight: 600; }
.ex-head > span { display: flex; align-items: center; gap: var(--s-2); }
.ex-head .mark { width: 24px; height: 24px; font-size: 13px; }
.practice { display: flex; flex-direction: column; gap: var(--s-3); }
.practice__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.practice__top h2 { font-size: 30px; margin-top: 4px; }
.pulse { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--red); animation: oftle-pulse 2s infinite; }
@keyframes oftle-pulse { 0% { transform: scale(1); opacity: 1; } 12% { transform: scale(.55); opacity: .55; } 100% { transform: scale(.55); opacity: .25; } }
.practice__pad { height: 150px; }
.practice__pad .hand { font-size: 24px; }
.practice__pad .tap-target__label { font-size: 48px; }
.practice__out { display: flex; flex-direction: column; gap: var(--s-2); }
.practice__out:empty { display: none; }
.practice__score { display: flex; align-items: baseline; gap: 6px; }
.practice__score .display { font-size: 64px; line-height: .9; }
.practice__score .mono { font-size: 20px; color: var(--pencil); }
.meter-row { display: grid; grid-template-columns: 80px 1fr 56px; align-items: center; gap: var(--s-2); font-size: var(--fs-small); font-weight: 600; }
.meter-row b { text-align: right; font-size: 14px; }
.meter-bar { height: 12px; border: 1.5px solid var(--ink); border-radius: 3px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--blue); }
.tap-how { font-size: 18px; line-height: 1.4; }
.tap-how b { display: block; }  /* what to do on one line, how to do it on the next */
.ruler__taps i { position: absolute; bottom: 0; width: 2px; height: 14px; margin-left: -1px; background: var(--ink); }
.ruler { height: 18px; }
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; opacity: 1; }
  .beatline__tap { animation: none; }
}

/* ======================================================================
   Game feel and results upgrade (29 Nov 2026). Built only from the tokens above.
   ====================================================================== */
/* Round 1: a ring where each tap lands; the header can't be hit by a stray tap while the clock runs */
.tap-target { position: relative; overflow: hidden; }
.ripple { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; border: 3px solid var(--red); pointer-events: none; animation: oftle-ripple 400ms var(--ease-out) both; }
@keyframes oftle-ripple { from { transform: scale(.25); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.is-tapping .site-header { pointer-events: none; opacity: .35; transition: opacity var(--t-screen); }

/* Results: the verdict above the score */
.verdict { font-size: 40px; line-height: 1; transform: rotate(-3deg); transform-origin: left; margin-bottom: -4px; }
.verdict.reveal-row.is-in { transform: rotate(-3deg); }
.verdict-sm { display: block; font-size: 26px; line-height: 1; margin-bottom: 2px; }

/* Results, Tap it: your taps over the real beat */
.beat-compare { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s-4); }
.beat-compare__key { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; font: 500 12px var(--font-mono); color: var(--pencil); }
.beat-compare__key > span:not(.pulse) { display: inline-flex; align-items: center; gap: 6px; }
.beat-compare__key i { display: inline-block; width: 4px; height: 14px; border-radius: 2px; }
.beat-compare__key .k-you { background: var(--red); }
.beat-compare__key .k-real { width: 10px; background: var(--blue-soft); border: 1.5px dashed var(--blue); }
.pulse--real { width: 18px; height: 18px; margin-left: auto; background: var(--blue); }
.beat-compare .beatline__tap { animation: none; }

/* Results, Place it: the real order */
.ladder { list-style: none; margin: var(--s-2) 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--ink); display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-small); }
.ladder li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); }
.ladder .ladder__ev { font-weight: 700; color: var(--blue); }
.ladder .ladder__you { color: var(--red); font-family: var(--font-hand); font-size: 20px; line-height: 1.1; }
.ladder .label { color: inherit; font-size: 10px; }
.round-row .note b { color: var(--ink); }

/* Results: a figure held back for its own day */
.answer__held { margin: 0; font: 400 13px/1.4 var(--font-mono); color: var(--pencil); }

/* Played today: points by round */
.score-card .marks > span { display: flex; justify-content: space-between; gap: var(--s-3); }
.score-card .marks b { font-weight: 600; font-variant-numeric: tabular-nums; }
.score-card .marks small { color: var(--pencil); font-weight: 400; }
.countdown__time--long { font-size: 34px; }

@media (prefers-reduced-motion: reduce) {
  .ripple { display: none; }
  .verdict, .verdict.reveal-row.is-in { transform: rotate(-3deg); }
}
/* A fast real beat: thinner ghosts so each one stays readable */
.beatline--dense .beatline__ghost { width: 4px; margin-left: -2px; border-width: 1px; border-radius: 2px 2px 0 0; }
.beatline--dense .beatline__tap { width: 2px; margin-left: -1px; }

/* Sound, vibration and the share image (29 Nov 2026) */
.sound-btn .sound-on { display: none; }
.sound-btn.is-on .sound-on { display: inline; }
.sound-btn.is-on .sound-off { display: none; }
.sound-btn:not(.is-on) { color: var(--pencil); }
.hear { align-self: flex-start; width: auto; padding: 0 14px; height: 40px; min-height: 40px; font-size: 14px; margin: 2px 0 4px; }
.beatline__ghost.is-lit { background: var(--blue); }
.feel-set { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--target); font-weight: 600; }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 15px; border: 1.5px solid var(--ink); background: var(--card); position: relative; cursor: pointer; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: var(--pencil); transition: transform var(--t-select), background-color var(--t-select); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(22px); background: var(--on-ink); }
.share-img { padding: 0; overflow: hidden; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.share-img img { display: block; width: 100%; height: auto; }
.sheet .share-preview { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .switch input::after { transition: none; } }
