/* A session's result (js/ui/screens/result.js): the one big moment (a level, strand or streak seal pressed, or the
   ink drop growing with its seal beside it), then the workout — the bead strung (the day's first) or wearing its new
   thin ring (a later one), 'Workout 2 done · Goal met', the streak ticking on, every skill's level ('Reaction 8 → 9'),
   each round with its level's material bead and its new best, a material change ('Focus is now Wood'), "Earned today"
   (the seals stamped in a row), Keep training · 3 min and Done — or a Benchmark: each test against the start, its
   small line, the research range bar, the trend.
   Base result styles (.result, .result-actions, .highlight, .acc-btn) are in bead.css. Light and dark come from the
   bead.css tokens; the two extra tokens below carry both values in the same blocks bead.css uses. */

:root {
  --rs-card-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 1px 2px rgba(28, 27, 26, 0.05), 0 18px 36px -24px rgba(28, 27, 26, 0.35);
  --rs-bead-shadow: rgba(28, 27, 26, 0.28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --rs-card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 36px -22px rgba(0, 0, 0, 0.9);
    --rs-bead-shadow: rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme='dark'] {
  --rs-card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 36px -22px rgba(0, 0, 0, 0.9);
  --rs-bead-shadow: rgba(0, 0, 0, 0.6);
}

/* ================================================================ 1 · the seal press */

.result.sealed { align-items: center; text-align: center; gap: 0; padding-top: calc(var(--safe-top) + 34px); }
.result.sealed .result-actions { align-self: stretch; }
.rs-kick { margin: 0; font-size: 11px; line-height: 1.4; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-2); font-weight: 500; max-width: 330px; }
.rs-press { position: relative; width: 100%; height: 232px; margin-top: 6px; flex: none; display: flex; align-items: center; justify-content: center; }
.rs-press > svg { display: block; }
.rs-press.is-big { height: 268px; }
/* the ink: the Home drop growing into its new stage, its seal pressed at the lower right like a painter's mark */
.rs-ink-drop { position: relative; display: flex; align-items: center; justify-content: center; flex: none; }
.rs-ink-mark { position: absolute; left: calc(50% + 100px - 48px); top: calc(50% + 74px - 60px); width: 96px; height: 120px; pointer-events: none; }
.rs-title { margin: 6px 0 0; font-size: 42px; line-height: 1; letter-spacing: -0.4px; max-width: 342px; text-wrap: balance; }
.rs-title.long { font-size: 36px; line-height: 1.05; }
.rs-when { margin: 7px 0 0; font-size: 13px; color: var(--ink-2); }

/* 'Control is now Wood': clay, an arrow, the wood flowing in */
.rs-mat { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 7px 16px 7px 10px; border-radius: 28px; border: 1px solid var(--line); background: var(--paper-2); text-align: left; max-width: 100%; }
.rs-mat > svg { display: block; flex: none; filter: drop-shadow(0 1px 1.5px var(--rs-bead-shadow)); }
.rs-mat .dim { font-size: 12px; color: var(--ink-2); }
.rs-mat .rs-arrow { color: var(--ink-3); flex: none; }
.rs-mat-t { display: flex; flex-direction: column; margin-left: 4px; min-width: 0; }
.rs-mat-t b { font-weight: 500; font-size: 14px; line-height: 1.25; }
.rs-mat-t small { font-size: 11.5px; color: var(--ink-2); }
.mm { position: relative; width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 2px var(--rs-bead-shadow)); }
.mm-l { position: absolute; inset: 0; display: block; }
.mm-l svg { display: block; }
.mm-sweep { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; mix-blend-mode: soft-light; }
.mm-sweep i { position: absolute; top: -20%; bottom: -20%; left: 30%; width: 34%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0)); transform: translateX(-140%) rotate(22deg); }

.rs-story { margin: 14px 6px 0; font-size: 16.5px; line-height: 1.42; max-width: 342px; }

.rs-next { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-align: left;
  border-radius: 22px; border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--rs-card-shadow); }
.rs-next > svg { display: block; flex: none; }
.rs-next .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rs-next .t { font-size: 14.5px; line-height: 1.3; }
.rs-next .m { font-size: 12.5px; color: var(--ink-2); }

/* ================================================================ 2 · the workout */

/* a later workout: the day's bead, large, a thin ring for each later workout; the new one draws itself round */
.rs-today { position: relative; align-self: center; flex: none; display: flex; align-items: center; justify-content: center; }
.rs-rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rs-rings circle { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: 0.42; transform: rotate(-90deg); transform-box: fill-box; transform-origin: center; }
.rs-rings circle.is-new { opacity: 0.7; }
.rs-today-bead { position: relative; display: block; line-height: 0; }
.rs-today-bead svg { display: block; filter: drop-shadow(0 6px 10px var(--rs-bead-shadow)); }

/* every skill's level after the workout: the ones that went up as 8 → 9, in ink; the rest quiet */
.rs-levels { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rs-lv { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.rs-lv-name { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 10.5px; line-height: 1.2; letter-spacing: 1.1px; text-transform: uppercase; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.rs-lv-name svg { display: block; flex: none; }
.rs-lv-n { display: inline-flex; align-items: center; gap: 3px; font-size: 26px; line-height: 1; color: var(--ink-2); white-space: nowrap; }
.rs-lv.up .rs-lv-n { color: var(--ink); }
.rs-lv-n .was { font-size: 17px; color: var(--ink-3); }
.rs-lv-n .rs-arrow { color: var(--ink-3); flex: none; }

/* a round's new best: the loudest line of the page (v3 §3.6) */
.rs-row .right.best { color: var(--accent); font-weight: 500; }
.rs-new { margin: 0; font-size: 14px; color: var(--ink-2); }

/* Keep training · 3 min beside Done; from the fifth workout of the day a quiet link under Done */
.result-actions .btn-row .rs-done { min-width: 104px; }
.rs-alt { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }

.rs-row .rs-row-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.rs-step { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.rs-step svg { display: block; flex: none; align-self: center; filter: drop-shadow(0 1px 1px var(--rs-bead-shadow)); }
.rs-row .dim { color: var(--ink-2); font-size: 13px; }
.rs-mats { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rs-mats .rs-mat { margin-top: 0; }
.result .highlight { display: flex; align-items: center; gap: 8px; }
/* a level-up is told by its material bead; vermilion is kept for the step you're on and for seals */
.result .highlight.accent { color: var(--ink); font-weight: 500; }
.result .highlight svg { display: block; flex: none; filter: drop-shadow(0 1px 1px var(--rs-bead-shadow)); }

/* small wins: plain ink, a small tick each (ui/sealsvg.js winLine) */
.rs-wins { display: flex; flex-direction: column; gap: 5px; margin-top: -4px; font-size: 14px; line-height: 1.35; }
.rs-wins > * { margin: 0; }

/* "Also today": the other seals of the bead, stamped into the page one after another */
.rs-also { display: flex; flex-direction: column; gap: 10px; }
.rs-also-h { margin: 0; font-size: 11px; line-height: 1.3; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.rs-also-row { display: flex; flex-direction: column; gap: 8px; }
.rs-also-i { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rs-stamp { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 58px; }
.rs-stamp > svg, .rs-stamp > * { display: block; overflow: visible; }
.rs-also-t { font-size: 13.5px; line-height: 1.3; min-width: 0; text-wrap: pretty; }
.rs-also-i.is-big .rs-also-t { font-size: 15px; font-weight: 500; }

/* the streak under the headline: '12-day streak · 46 days trained'; the day's first result turns its number over */
.rs-streak-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -6px; }
.rs-streak { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 14px 0 6px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); font: inherit; font-size: 13.5px; }
button.rs-streak { cursor: pointer; touch-action: manipulation; }
.rs-streak-pill { display: inline-flex; align-items: center; gap: 0; height: 26px; padding: 0 10px 0 6px; border-radius: 13px; background: var(--paper-3); font-weight: 500; white-space: nowrap; }
.rs-streak-pill i { width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--accent); flex: none; }
.rs-streak-pill .num { display: inline-block; min-width: 1ch; text-align: right; font-variant-numeric: tabular-nums; }
.rs-streak-pill.ticked i { animation: rs-streak-dot 700ms cubic-bezier(.2, .8, .2, 1) both; }
.rs-streak-pill.ticked .num { animation: rs-streak-num 520ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rs-streak-dot { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(194, 64, 44, 0.45); } 45% { transform: scale(1.5); box-shadow: 0 0 0 7px rgba(194, 64, 44, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(194, 64, 44, 0); } }
@keyframes rs-streak-num { 0% { transform: translateY(5px); opacity: 0.3; } 100% { transform: none; opacity: 1; } }
.rs-streak-total { color: var(--ink-2); white-space: nowrap; }
.rs-streak-note { margin: 0; max-width: 320px; text-align: center; font-size: 13px; line-height: 1.45; color: var(--ink-2); }

/* a Benchmark: each test against the start (the mean of the first two), its small line, the research range */
.result.bench .rs-bm-head { gap: 4px; }
.rs-bm-head .rs-kick { margin-bottom: 4px; }
.rs-bm-list { display: flex; flex-direction: column; gap: 10px; }
.rs-bm { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 13px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--rs-card-shadow); }
.rs-bm-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rs-bm-name { display: flex; flex-direction: column; gap: 1px; font-size: 15px; min-width: 0; }
.rs-bm-name small { font-size: 11.5px; color: var(--ink-2); }
.rs-bm-word { flex: none; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.rs-bm.tone-better .rs-bm-word { color: var(--ink); }
.rs-bm.tone-better .rs-bm-word::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.rs-bm-mid { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rs-bm-mid > svg { display: block; flex: none; overflow: visible; }
.rs-bm-v { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.rs-bm-v .was { display: inline-flex; align-items: baseline; gap: 5px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-bm-v .was small { font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--ink-3); }
.rs-bm-v .rs-arrow { color: var(--ink-3); align-self: center; }
.rs-bm-v .now { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-bm-note { margin: -2px 2px 0; }

/* the research range for the player's age: a band, a dot for you, one line (never a percentile) */
.rs-range { display: flex; flex-direction: column; gap: 6px; padding-top: 9px; border-top: 1px dashed var(--line); }
.rs-range-bar { position: relative; height: 26px; margin: 0 8px; }
.rs-range-bar::before { content: ''; position: absolute; left: 0; right: 0; top: 4.5px; height: 1px; background: var(--line); }
.rs-range-band { position: absolute; top: 1px; height: 8px; min-width: 0; margin-left: -7px; padding: 0 7px; box-sizing: content-box; border-radius: 4px; background: var(--paper-3); box-shadow: inset 0 0 0 1px var(--ink-3); }
.rs-range-you { position: absolute; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper-2); }
.rs-range-l { position: absolute; top: 13px; transform: translateX(-50%); font-size: 10.5px; line-height: 1.2; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rs-range-t { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.rs-range-t .you { color: var(--ink); white-space: nowrap; }
.rs-range-n { margin: -3px 0 0; font-size: 11px; line-height: 1.4; color: var(--ink-3); }

/* the trend: the last three against the start, once there are three */
.rs-trend { display: flex; flex-direction: column; gap: 8px; }
.rs-trend-row { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.rs-trend-i { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.rs-trend-i b { font-weight: 500; color: var(--ink); }
.rs-trend-i.tone-better { border-color: var(--ink-3); color: var(--ink); }
.ci-trend { margin-top: -2px; }

@media (prefers-reduced-motion: reduce) {
  .rs-streak-pill.ticked i, .rs-streak-pill.ticked .num { animation: none; }
}

@media (max-width: 360px) {
  .rs-lv-name { letter-spacing: 0.6px; font-size: 10px; }
  .rs-lv-n { font-size: 23px; }
}

@media (max-height: 700px) {
  .rs-levels { padding: 9px 0; }
  .result.sealed { padding-top: calc(var(--safe-top) + 22px); }
  .rs-press { height: 196px; }
  .rs-press.is-big { height: 226px; }
  .rs-ink-mark { left: calc(50% + 84px - 48px); top: calc(50% + 62px - 60px); }
  .rs-title { font-size: 36px; }
}
