/* =========================================================
   Noin. — styles
   Sleek, modern, fresh: neutral canvas + one colour per question shape.
   ========================================================= */

:root {
  /* shape palette (Finnish nature) */
  --c-kanta: #3EE6B0;      /* Jäkälä  */
  --c-virta: #2F7BFF;      /* Järvi   */
  --c-mahtuu: #FF8A3D;     /* Lakka   */
  --c-mittakaava: #C6F432; /* Koivu   */
  --c-kertyma: #6D5BFF;    /* Mustikka*/
  --c-kesto: #FF4D6D;      /* Puolukka*/
  --c-tieto: #22D3EE;      /* Revontuli */

  --bg: #F5F6F8;
  --surface: rgba(255, 255, 255, .80);
  --surface-solid: #FFFFFF;
  --surface-2: #EEF0F3;
  --ink: #0E1014;
  --ink-2: #4E5563;
  --ink-3: #8A909C;
  --line: #E1E4EA;
  --shadow: 0 24px 60px rgba(14, 16, 20, .10), 0 2px 8px rgba(14, 16, 20, .05);
  --shadow-sm: 0 6px 18px rgba(14, 16, 20, .08);
  --blob-opacity: .55;

  --q: var(--c-kesto);   /* current question colour (set by JS) */
  --on-q: #0E1014;

  --font: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D12;
    --surface: rgba(22, 26, 35, .82);
    --surface-solid: #151922;
    --surface-2: #1D222D;
    --ink: #F2F4F7;
    --ink-2: #AAB1BE;
    --ink-3: #737B8A;
    --line: #262C38;
    --shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
    --blob-opacity: .28;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0D12;
  --surface: rgba(22, 26, 35, .82);
  --surface-solid: #151922;
  --surface-2: #1D222D;
  --ink: #F2F4F7;
  --ink-2: #AAB1BE;
  --ink-3: #737B8A;
  --line: #262C38;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --blob-opacity: .28;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--q); outline-offset: 2px; border-radius: 10px; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- background mesh ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-opacity); transition: background-color 1.2s var(--ease), opacity .6s; will-change: transform; }
.b1 { width: 52vmax; height: 52vmax; left: -18vmax; top: -22vmax; background: var(--q); animation: drift1 22s ease-in-out infinite alternate; }
.b2 { width: 40vmax; height: 40vmax; right: -16vmax; top: 30vh; background: var(--b2, var(--c-mahtuu)); opacity: calc(var(--blob-opacity) * .7); animation: drift2 26s ease-in-out infinite alternate; }
.b3 { width: 36vmax; height: 36vmax; left: -10vmax; bottom: -18vmax; background: var(--b3, var(--c-kertyma)); opacity: calc(var(--blob-opacity) * .6); animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-10vmax, -4vmax) scale(.92); } }
@keyframes drift3 { to { transform: translate(12vmax, -6vmax) scale(1.1); } }

/* ---------- layout ---------- */
#app { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.screen { display: none; }
.screen.is-active { display: block; animation: screenIn .5s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  padding: 22px;
}

/* ---------- buttons ---------- */
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow-sm); display: inline-grid; place-items: center; transition: transform .2s var(--ease), background .2s; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.big { width: 52px; height: 52px; background: var(--surface-2); box-shadow: none; }
.pill { height: 52px; border-radius: 999px; border: 0; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .01em; transition: transform .2s var(--ease), background .2s, opacity .2s; white-space: nowrap; }
.pill:active { transform: scale(.97); }
.pill.primary { background: var(--ink); color: var(--bg); }
.pill.primary:hover { transform: translateY(-1px); }
.pill.soft { background: var(--surface-2); color: var(--ink); }
.pill.wide { width: 100%; }
.pill[disabled] { opacity: .4; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.shape-chip { background: var(--q); color: var(--on-q); }

.pelts { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 700; font-size: 14px; }
.pelts .ic { width: 18px; height: 18px; color: var(--c-mahtuu); stroke-width: 1.6; }
.pelts.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* =========================================================
   HOME
   ========================================================= */
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.logo-dot { color: var(--c-kesto); display: inline-block; animation: dot 5s var(--ease) infinite; }
@keyframes dot { 0%, 100% { color: var(--c-kesto); } 16% { color: var(--c-mahtuu); } 33% { color: var(--c-mittakaava); } 50% { color: var(--c-kanta); } 66% { color: var(--c-virta); } 83% { color: var(--c-kertyma); } }
.top-actions { display: flex; align-items: center; gap: 8px; }

.hero { margin: 48px 0 28px; }
.tagline { margin: 0; font-size: clamp(40px, 7.2vw, 74px); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.tagline .t1, .tagline .t2 { display: block; text-wrap: balance; }
.tagline .t2 { padding-bottom: .06em; width: fit-content; }
.tagline .t2 { background: linear-gradient(100deg, var(--c-kesto), var(--c-mahtuu) 30%, var(--c-kertyma) 65%, var(--c-virta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin: 18px 0 0; font-size: 18px; color: var(--ink-2); max-width: 560px; text-wrap: pretty; }

.challenge { margin: 0 0 18px; padding: 16px 18px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow); }
.challenge b { font-size: 18px; }
.challenge .pill { height: 44px; background: var(--c-kesto); color: #0E1014; }

.rounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.round-card { position: relative; text-align: left; border: 0; border-radius: var(--r-lg); padding: 22px 20px 20px; min-height: 176px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; overflow: hidden; transition: transform .35s var(--spring), box-shadow .3s; isolation: isolate; }
.round-card::before { content: ""; position: absolute; inset: auto -30% -60% auto; width: 180px; height: 180px; border-radius: 50%; background: var(--rc, var(--c-virta)); opacity: .9; z-index: -1; filter: blur(2px); transition: transform .5s var(--spring); }
.round-card[data-n="3"] { --rc: var(--c-kanta); }
.round-card[data-n="10"] { --rc: var(--c-kesto); }
.round-card[data-n="20"] { --rc: var(--c-kertyma); }
.round-card:hover { transform: translateY(-4px); }
.round-card:hover::before { transform: scale(1.15); }
.round-card:active { transform: scale(.98); }
.rc-n { font-size: 64px; font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.rc-name { font-size: 18px; font-weight: 700; margin-top: 10px; }
.rc-meta { font-size: 13px; color: var(--ink-2); }
.rc-best { margin-top: auto; font-size: 12px; font-weight: 700; color: var(--ink-2); padding-top: 10px; }
.rc-best:empty { display: none; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.stat { flex: 1 1 140px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.stat span { font-size: 12.5px; color: var(--ink-2); }

.howto { margin-top: 44px; }
.howto h2, .history h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 14px; }
/* ---- how to play: three illustrated steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { display: flex; flex-direction: column; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; font-size: 14.5px; color: var(--ink-2); transition: transform .35s var(--spring), box-shadow .3s; }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.st-vis { height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 16px 22px;
  background: radial-gradient(130% 150% at 0% 0%, color-mix(in srgb, var(--c) 34%, transparent), transparent 62%), color-mix(in srgb, var(--c) 9%, var(--surface-2));
  border-bottom: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.st-head { display: flex; align-items: flex-end; gap: 10px; margin: -22px 18px 0; position: relative; }
.st-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--c); color: var(--on); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 45%, transparent); transition: transform .35s var(--spring); }
.st-ic .ic { width: 22px; height: 22px; stroke-width: 2.2; }
.step:hover .st-ic { transform: rotate(-8deg) scale(1.06); }
.st-n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-bottom: 3px; }
.step b { display: block; color: var(--ink); font-size: 19px; letter-spacing: -.01em; margin: 12px 18px 3px; }
.step p { margin: 0 18px 18px; }
/* 01 guess field */
.sv-field { display: flex; align-items: center; width: 100%; max-width: 250px; height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--ink); background: var(--surface-solid); font-weight: 800; font-size: 21px; letter-spacing: -.03em; color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.sv-caret { width: 2px; height: 24px; margin-left: 3px; border-radius: 1px; background: var(--c); animation: caret 1.05s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.sv-unit { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.sv-keys { display: flex; gap: 5px; }
.sv-keys span { display: grid; place-items: center; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.sv-keys .sv-calc { background: var(--c); border-color: transparent; color: var(--on); padding: 0 8px; }
.sv-calc .ic { width: 14px; height: 14px; }
/* 02 mini ruler */
.sv-ruler { width: 100%; max-width: 260px; height: auto; overflow: visible; }
.sv-ruler .ax { stroke: var(--ink-3); stroke-width: 1.5; }
.sv-ruler .tk { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
.sv-ruler rect { fill: var(--c); fill-opacity: .14; }
.sv-ruler .br { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.sv-ruler .pin-g { stroke: var(--ink); stroke-width: 2.2; fill: var(--ink); }
.sv-ruler .pin-a { stroke: var(--c); stroke-width: 2.6; fill: var(--c); }
.sv-ruler .pulse { fill: none; stroke: var(--c); stroke-width: 2; transform-origin: 130px 26px; animation: svPulse 1.8s var(--ease) infinite; }
@keyframes svPulse { from { transform: scale(1); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
.sv-ruler text { font-size: 10.5px; font-weight: 700; fill: var(--ink-2); }
.sv-ruler .badge rect { fill: var(--c); fill-opacity: 1; }
.sv-ruler .badge text { fill: var(--on); font-weight: 800; font-size: 11.5px; }
/* 03 laskukaava chips */
.sv-cap { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.sv-cap .ic { width: 13px; height: 13px; }
.sv-chips { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; }
.sv-chips span { padding: 4px 9px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); }
.sv-chips em { font-style: normal; font-weight: 800; color: var(--ink-2); }
.sv-chips .res { border: 2px solid var(--c); font-weight: 700; }
.sv-chips .src { border: 0; background: var(--c); color: var(--on); font-family: var(--font); font-weight: 800; font-size: 11px; }

/* ---- grade scale */
.grades { margin: 14px 0 0; padding: 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.gr-head { display: flex; gap: 14px; align-items: flex-start; }
.gr-ic { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #0E1014; background: conic-gradient(from 200deg, var(--c-kanta), var(--c-tieto), var(--c-virta), var(--c-kertyma), var(--c-mahtuu), var(--c-kesto), var(--c-kanta)); }
.gr-ic .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.gr-head h3 { margin: 0; font-size: 18px; }
.gr-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 14.5px; }
.gs-wrap { position: relative; margin-top: 18px; padding-top: 34px; }
.gs-scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.gs { display: flex; flex-direction: column; align-items: center; text-align: center; animation: gsIn .5s var(--spring) both; animation-delay: calc(var(--i) * 50ms); }
@keyframes gsIn { from { opacity: 0; transform: translateY(10px); } }
.gs b { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--c); color: var(--on); font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 35%, transparent); }
.gs-bar { display: block; width: 100%; height: 8px; margin: 12px 0 9px; background: var(--c); border-radius: 2px; }
.gs:first-child .gs-bar { border-radius: 6px 2px 2px 6px; }
.gs:last-child .gs-bar { border-radius: 2px 6px 6px 2px; }
.gs span { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.gs em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.gs-pin { position: absolute; top: 0; left: var(--x); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; z-index: 1; pointer-events: none; }
.gs-pin span { white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 800; }
.gs-pin::after { content: ""; width: 2px; height: 66px; background: var(--ink); opacity: .55; margin-top: 2px; border-radius: 1px; }
.gs-axis { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); }
.gr-notes { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.gr-notes .tag { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 11.5px; }

.history { margin-top: 36px; }
.history ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; }
.history li b { font-size: 18px; }
.history .muted { color: var(--ink-2); }

.foot { margin: 44px 0 8px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot p { margin: 0; }
.credit a { font-weight: 700; text-decoration: none; }

/* =========================================================
   PLAY
   ========================================================= */
#play, #summary { max-width: 640px; margin: 0 auto; }
.play-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress { flex: 1; display: flex; gap: 4px; align-items: center; min-width: 0; }
.progress i { height: 6px; flex: 1; border-radius: 3px; background: var(--line); transition: background .4s, transform .4s var(--spring); }
.progress i.done { background: var(--ink-3); }
.progress i.cur { background: var(--q); transform: scaleY(1.5); }
.progress i[data-g] { background: var(--g); }
.sum-label { flex: 1; font-weight: 700; color: var(--ink-2); font-size: 14px; }

.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-topic { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.q-topic .ic { width: 18px; height: 18px; }
.q-diff { margin-left: auto; display: inline-flex; gap: 3px; }
.q-diff i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.q-diff i.on { background: var(--ink-2); }
.q-text { font-size: clamp(25px, 5.4vw, 33px); line-height: 1.13; letter-spacing: -.025em; font-weight: 700; margin: 18px 0 22px; text-wrap: balance; hyphens: auto; }

.qcard { animation: cardIn .55s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.field { display: flex; align-items: center; gap: 12px; border-radius: 22px; background: var(--surface-solid); border: 2px solid var(--ink); padding: 8px 18px; transition: border-color .2s, box-shadow .2s; }
.field:focus-within { box-shadow: 0 0 0 5px color-mix(in srgb, var(--q) 35%, transparent); }
.field.err { border-color: var(--c-kesto); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.guess-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: clamp(34px, 9vw, 48px); font-weight: 800; letter-spacing: -.035em; padding: 6px 0; caret-color: var(--q); }
.guess-input::placeholder { color: var(--ink-3); font-weight: 600; opacity: .6; }
.unit { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink-2); text-transform: uppercase; text-align: right; max-width: 40%; }
.preview { min-height: 22px; margin: 8px 4px 0; font-size: 13.5px; color: var(--ink-2); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview.err { color: var(--c-kesto); font-family: var(--font); }
.suffixes { display: flex; gap: 6px; margin: 10px 0 0; overflow-x: auto; scrollbar-width: none; }
.suffixes::-webkit-scrollbar { display: none; }
.suffixes button { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.suffixes button:hover { color: var(--ink); border-color: var(--ink-3); }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.actions .primary { margin-left: auto; min-width: 140px; }
#hintBtn .cost { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--c-mahtuu); color: #0E1014; }

/* hints */
.hints { display: grid; gap: 8px; margin: -6px 0 18px; }
.hint { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-size: 14.5px; animation: cardIn .4s var(--ease) both; }
.hint .h-n { flex: none; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 3px; }
.hint .h-t { flex: 1; }
.hint .h-t b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.hint button { flex: none; height: 34px; border: 0; border-radius: 999px; padding: 0 12px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.hint button .ic { width: 15px; height: 15px; color: var(--c-mahtuu); }
.hint.locked .h-t { color: var(--ink-3); }

/* =========================================================
   REVEAL
   ========================================================= */
.rcard { animation: cardIn .55s var(--ease) both; }
.r-question { margin: 12px 0 18px; font-size: 16px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.r-nums { display: grid; gap: 10px; min-width: 0; }
.r-num { min-width: 0; }
.r-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.r-num b { display: block; font-size: clamp(26px, 7vw, 38px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; overflow-wrap: anywhere; }
.r-num.answer b { font-size: clamp(34px, 9.5vw, 54px); }
.r-num b.long { font-size: clamp(24px, 6.4vw, 34px) !important; }
.r-num small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.grade { position: relative; width: 112px; height: 112px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.grade-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.gr-track { fill: none; stroke: var(--line); stroke-width: 7; }
.gr-fill { fill: none; stroke: var(--q); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 276.46; transition: stroke-dashoffset 1.1s var(--ease); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--q) 60%, transparent)); }
.grade b { position: relative; font-size: 38px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 8px; }
.grade span { position: relative; font-size: 10px; font-weight: 700; color: var(--ink-2); margin-top: 3px; min-height: 13px; max-width: 80px; }
.r-miss { margin: 14px 0 0; font-size: 17px; font-weight: 700; }
.r-miss .dir { color: var(--ink-2); font-weight: 600; }
.r-miss .pen { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.r-badge { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 6px 14px; border-radius: 999px; background: var(--q); color: var(--on-q); font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; animation: pop .6s var(--spring) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.viz { margin: 22px -8px 0; }
.viz-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px; margin-bottom: 6px; }
.vz-range { margin-left: 6px; font-family: var(--mono); letter-spacing: 0; font-weight: 600; color: var(--ink-2); text-transform: none; }
.viz-title { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button { height: 30px; border: 0; padding: 0 12px; border-radius: 999px; background: transparent; font-size: 12.5px; font-weight: 700; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button.is-on { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-sm); }
.ruler { display: block; width: 100%; height: 236px; overflow: visible; }
.viz-cap { padding: 0 8px; font-size: 12.5px; color: var(--ink-3); min-height: 18px; }
.ruler text { font-family: var(--font); }
.ruler .t-num { font-size: 12px; font-weight: 700; fill: var(--ink); }
.ruler .t-word { font-size: 10.5px; fill: var(--ink-3); }
.ruler .grid { stroke: var(--line); }
.ruler .axis { stroke: var(--ink-3); stroke-width: 1.25; }
.ruler .ring-label { font-size: 10.5px; font-weight: 600; fill: var(--ink-3); }
.ruler .pin-label { font-size: 13px; font-weight: 700; fill: var(--ink); }
.ruler .pin-label.ans { font-weight: 800; }
.ruler .miss-label { font-size: 13px; font-weight: 800; fill: var(--ink); }

/* napkin */
.napkin { margin-top: 20px; padding: 18px; border-radius: 22px; background: var(--surface-2); }
.napkin h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.napkin h3 .ic { width: 16px; height: 16px; }
.napkin-lead { margin: 8px 0 14px; font-size: 14.5px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.nchip { position: relative; flex: 0 1 auto; display: flex; flex-direction: column; justify-content: center; min-width: 92px; max-width: 100%; padding: 9px 12px; border-radius: 14px; background: var(--surface-solid); border: 1.5px solid var(--line); }
.nchip .nl { font-size: 11px; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.nchip .nv { font-family: var(--mono); font-size: 15px; font-weight: 600; white-space: nowrap; }
.nchip.adj { width: 168px; border: 1.5px dashed var(--q); background: color-mix(in srgb, var(--q) 10%, var(--surface-solid)); }
.nchip.adj input[type=range] { width: 100%; margin: 6px 0 0; accent-color: var(--q); height: 18px; }
.nstep { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.nop { align-self: center; font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--ink-2); padding: 0 2px; }
.nchip.res { border: 2px solid var(--q); background: var(--surface-solid); }
.nchip.res .nv { font-size: 17px; font-weight: 700; }
.napkin-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.napkin-note b { color: var(--ink); }
.ntext { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ntext li { font-family: var(--mono); font-size: 13.5px; padding: 8px 12px; border-radius: 12px; background: var(--surface-solid); }

.fact { margin-top: 14px; padding: 16px 18px; border-radius: 22px; background: color-mix(in srgb, var(--q) 16%, var(--surface-solid)); font-size: 15px; line-height: 1.45; }
.fact b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; color: var(--ink-2); }

.calc-detail { margin-top: 14px; border-radius: 18px; background: var(--surface-2); padding: 0 16px; }
.calc-detail summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.calc-detail summary::-webkit-details-marker { display: none; }
.calc-detail summary::after { content: "+"; font-family: var(--mono); color: var(--ink-2); }
.calc-detail[open] summary::after { content: "–"; }
.calc-rows { margin: 0 0 12px; display: grid; gap: 1px; border-radius: 12px; overflow: hidden; }
.calc-rows div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 12px; background: var(--surface-solid); font-size: 13.5px; }
.calc-rows dt { color: var(--ink-2); }
.calc-rows dd { margin: 0; font-family: var(--mono); font-weight: 600; text-align: right; }
.sources { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 13px; }
.sources li::before { content: "↗ "; color: var(--ink-3); }
.sources a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.sources a:hover { text-decoration-color: var(--q); }
.r-actions { margin-top: 18px; position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); }
.r-actions .pill { box-shadow: var(--shadow); }

/* confetti */
.burst { position: fixed; pointer-events: none; z-index: 50; width: 8px; height: 8px; border-radius: 2px; }

/* =========================================================
   SUMMARY
   ========================================================= */
.scard { text-align: center; }
.s-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.s-avg { display: flex; flex-direction: column; align-items: center; }
.s-avg b { font-size: clamp(84px, 24vw, 132px); font-weight: 800; letter-spacing: -.06em; line-height: .95; }
.s-avg span { font-size: 18px; font-weight: 700; color: var(--ink-2); margin-top: 10px; min-height: 26px; }
.s-sub { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; }
.board-wrap { margin: 18px auto 0; max-width: 340px; }
.board { width: 100%; height: auto; display: block; overflow: visible; }
.board .ring { fill: none; stroke: var(--line); }
.board .band-a { fill: var(--surface-2); }
.board .band-b { fill: var(--surface-solid); }
.board .bull { fill: var(--q); fill-opacity: .22; }
.board .ring-fill { fill: var(--surface-2); }
.board .rl { font-size: 10px; font-weight: 700; fill: var(--ink-3); }
.board .dart-n { font-size: 10px; font-weight: 800; }
.board-legend { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.board-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.board-legend i.up { background: linear-gradient(var(--ink-2) 50%, transparent 50%); border: 1px solid var(--ink-2); }
.board-legend i.down { background: linear-gradient(transparent 50%, var(--ink-2) 50%); border: 1px solid var(--ink-2); }
.strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 20px 0 0; }
.strip span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 14px; animation: pop .5s var(--spring) both; }
.s-list { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; display: grid; gap: 6px; }
.s-list li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.s-list i { width: 10px; height: 10px; border-radius: 3px; }
.s-list .sq { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-list .sg { text-align: right; font-weight: 800; }
.s-list .sg small { display: block; font-weight: 600; font-size: 11.5px; color: var(--ink-3); }
.s-earn { margin: 16px 0 0; font-weight: 700; color: var(--ink-2); }
.s-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.s-actions .primary { grid-column: 1 / -1; }

/* =========================================================
   CALCULATOR SHEET
   ========================================================= */
.sheet-scrim, .modal-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(8, 10, 14, .38); backdrop-filter: blur(3px); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; z-index: 31; left: 50%; bottom: 0; transform: translateX(-50%); width: min(780px, 100%); max-height: 92dvh; overflow: auto; background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(28px) saturate(1.4); -webkit-backdrop-filter: blur(28px) saturate(1.4); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .25); padding: 10px 16px max(16px, env(safe-area-inset-bottom)); animation: sheetUp .35s var(--ease) both; }
@keyframes sheetUp { from { transform: translate(-50%, 40px); opacity: 0; } }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) {
  .sheet { bottom: 24px; border-radius: 28px; }
  @keyframes sheetUp { from { transform: translate(-50%, 30px); opacity: 0; } }
  .calc-grid { grid-template-columns: 1fr 1.15fr; }
}
.calc-side { display: flex; flex-direction: column; min-height: 0; order: 2; }
@media (min-width: 720px) { .calc-side { order: 0; } }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); margin-bottom: 8px; }
.tabs button { flex: 1; height: 32px; border: 0; border-radius: 999px; background: transparent; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.tabs button.is-on { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-sm); }
.tape, .consts { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 260px; min-height: 120px; display: grid; align-content: start; gap: 4px; }
.tape li, .consts li { font-family: var(--mono); font-size: 13px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; overflow-wrap: anywhere; }
.tape li:hover, .consts li:hover { background: color-mix(in srgb, var(--q) 18%, var(--surface-2)); }
.tape li.empty { font-family: var(--font); color: var(--ink-3); cursor: default; background: transparent; }
.tape li b { font-weight: 700; }
.consts li { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font); }
.consts li span:last-child { font-family: var(--mono); font-weight: 600; }
.notes { width: 100%; min-height: 200px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); padding: 12px; font-size: 14px; line-height: 1.5; }
.display { padding: 12px 16px; border-radius: 20px; background: var(--ink); color: var(--bg); }
.calc-expr { width: 100%; border: 0; outline: none; background: transparent; color: inherit; font-family: var(--mono); font-size: 17px; opacity: .8; caret-color: var(--q); }
.calc-result { font-size: 34px; font-weight: 800; letter-spacing: -.03em; text-align: right; line-height: 1.15; overflow-wrap: anywhere; }
.calc-words { font-size: 12.5px; text-align: right; opacity: .7; min-height: 18px; }
.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 10px; }
.keys button { height: 50px; border: 0; border-radius: 16px; background: var(--surface-2); font-size: 18px; font-weight: 600; transition: transform .1s, background .15s; }
.keys button:active { transform: scale(.94); }
.keys .k-dark { background: var(--ink); color: var(--bg); }
.keys .k-word { font-size: 14px; }
.keys .k-op { color: #0E1014; font-size: 21px; }
.keys .o1 { background: var(--c-kertyma); color: #fff; }
.keys .o2 { background: var(--c-kesto); }
.keys .o3 { background: var(--c-virta); color: #fff; }
.keys .o4 { background: var(--c-kanta); }
.keys .o5 { background: var(--c-mittakaava); }
.calc-foot { display: flex; gap: 8px; margin-top: 10px; }
.calc-foot .primary { flex: 1; }

/* modal + toast */
.modal-scrim { display: grid; place-items: center; padding: 16px; }
.modal { width: min(380px, 100%); background: var(--surface-solid); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); animation: pop .4s var(--spring) both; }
.modal h3 { margin: 0 0 6px; font-size: 20px; }
.modal p { margin: 0; color: var(--ink-2); }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .pill { flex: 1; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); transition: opacity .25s, transform .35s var(--spring); max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   themes (home)
   ========================================================= */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 14px; }
.sec-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.pick { margin: 0 0 26px; }
.theme-desc { font-size: 13.5px; color: var(--ink-2); }
.theme-desc b { color: var(--ink); font-weight: 700; }
.theme-desc.swap { animation: descIn .35s var(--ease) both; }
@keyframes descIn { from { opacity: 0; transform: translateY(6px); } }
.themes { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.tchip { --tc: var(--ink); --tc-on: var(--bg); position: relative; height: 46px; padding: 0 14px 0 6px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; transition: transform .25s var(--spring), background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s; }
.tchip:hover { transform: translateY(-2px); }
.tchip:active { transform: scale(.96); }
.tc-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 24%, transparent); transition: background-color .25s; }
.tc-ic .ic { width: 18px; height: 18px; }
.tchip.all .tc-ic { background: conic-gradient(from 200deg, var(--c-kesto), var(--c-mahtuu), var(--c-mittakaava), var(--c-kanta), var(--c-tieto), var(--c-virta), var(--c-kertyma), var(--c-kesto)); color: #0E1014; }
.tc-n { font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; transition: color .25s; }
.tchip.is-on { background: var(--tc); color: var(--tc-on); box-shadow: 0 10px 26px color-mix(in srgb, var(--tc) 40%, transparent); animation: chipOn .45s var(--spring); }
.tchip.is-on .tc-ic { background: color-mix(in srgb, var(--tc-on) 16%, transparent); }
.tchip.all.is-on { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.tchip.all.is-on .tc-ic { background: conic-gradient(from 200deg, var(--c-kesto), var(--c-mahtuu), var(--c-mittakaava), var(--c-kanta), var(--c-tieto), var(--c-virta), var(--c-kertyma), var(--c-kesto)); }
.tchip.is-on .tc-n { color: inherit; opacity: .7; }
@keyframes chipOn { 40% { transform: scale(1.07); } }
.round-card.is-off { opacity: .45; cursor: not-allowed; }
.round-card.is-off:hover { transform: none; }

/* =========================================================
   reveal: streak badge
   ========================================================= */
.r-badges { display: flex; flex-wrap: wrap; gap: 0 8px; }
.r-badge .ic { width: 16px; height: 16px; }
.r-badge.streak { background: linear-gradient(100deg, #FF4D6D, #FF8A3D 55%, #FFC23D); color: #0E1014; box-shadow: 0 8px 22px rgba(255, 110, 70, .35); }
.r-badge.streak .ic { animation: flick .9s ease-in-out infinite alternate; transform-origin: 50% 90%; }
@keyframes flick { to { transform: scale(1.15) rotate(-6deg); } }

/* =========================================================
   summary: record
   ========================================================= */
.s-record { display: flex; width: max-content; align-items: center; gap: 8px; margin: 12px auto 0; padding: 7px 15px 7px 11px; border-radius: 999px; background: linear-gradient(100deg, #FFC23D, #FF8A3D); color: #0E1014; font-weight: 800; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; box-shadow: 0 10px 26px rgba(255, 138, 61, .38); animation: pop .6s var(--spring) both; }
.s-record .ic { width: 17px; height: 17px; }
.confetti { position: fixed; pointer-events: none; z-index: 58; will-change: transform; }

/* =========================================================
   colour wipe between questions
   ========================================================= */
.wipe { position: fixed; inset: 0; z-index: 55; background: var(--w, var(--q)); color: var(--w-on, #0E1014); display: grid; place-items: center; overflow: hidden; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; will-change: clip-path, transform; }
.w-rings i { position: absolute; left: var(--ox, 50%); top: var(--oy, 50%); width: 0; height: 0; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--w-on, #000) 22%, transparent); transform: translate(-50%, -50%); }
.wipe.play .w-rings i { animation: wRing 1.5s cubic-bezier(.2, .7, .2, 1) .1s both; }
.wipe.play .w-rings i:nth-child(2) { animation-delay: .24s; }
.wipe.play .w-rings i:nth-child(3) { animation-delay: .38s; }
@keyframes wRing { from { width: 0; height: 0; opacity: 1; } to { width: 230vmax; height: 230vmax; opacity: 0; } }
.w-in { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px; max-width: 720px; }
.w-kicker { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .78; }
.w-num { margin-top: 4px; font-size: clamp(76px, 19vw, 150px); font-weight: 800; letter-spacing: -.065em; line-height: .88; font-variant-numeric: tabular-nums; }
.w-num small { font-size: .3em; letter-spacing: -.02em; opacity: .5; margin-left: .14em; font-weight: 700; }
.w-shape { margin-top: 10px; font-size: clamp(32px, 7vw, 54px); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.w-desc { margin-top: 8px; font-size: 16.5px; font-weight: 600; opacity: .72; }
.w-topic { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px 8px 12px; border-radius: 999px; background: color-mix(in srgb, var(--w-on, #000) 12%, transparent); font-weight: 700; font-size: 14px; }
.w-topic .ic { width: 18px; height: 18px; }
.wipe.play .w-kicker { animation: wUp .5s var(--ease) .14s both; }
.wipe.play .w-num { animation: wNum .65s var(--spring) .18s both; }
.wipe.play .w-shape { animation: wUp .5s var(--ease) .28s both; }
.wipe.play .w-desc { animation: wUp .5s var(--ease) .36s both; }
.wipe.play .w-topic { animation: wUp .5s var(--ease) .44s both; }
.wipe.play .w-dots { animation: fade .5s var(--ease) .3s both; }
@keyframes wUp { from { opacity: 0; transform: translateY(28px); } }
@keyframes wNum { from { opacity: 0; transform: translateY(24px) scale(.62); } }
.w-dots { position: absolute; left: 50%; bottom: max(50px, calc(env(safe-area-inset-bottom) + 34px)); transform: translateX(-50%); display: flex; gap: 6px; max-width: calc(100% - 32px); flex-wrap: wrap; justify-content: center; }
.w-dots i { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--w-on, #000) 20%, transparent); }
.w-dots i.on { background: var(--d); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--w-on, #000) 55%, transparent); }
.w-dots i.cur { background: var(--w-on, #000); animation: dotPulse .9s ease-in-out infinite alternate; }
@keyframes dotPulse { to { transform: scale(1.45); } }
.w-skip { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; opacity: .45; }

/* =========================================================
   milestone: Väliaika
   ========================================================= */
.interlude { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
.interlude.play { animation: fade .3s var(--ease) both; }
.il-card { width: min(440px, 100%); background: var(--surface-solid); border-radius: 30px; padding: 26px 22px 22px; box-shadow: var(--shadow); text-align: center; }
.interlude.play .il-card { animation: ilUp .65s var(--spring) both; }
@keyframes ilUp { from { opacity: 0; transform: translateY(44px) scale(.94); } }
.il-kicker { margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.il-title { margin: 6px 0 0; font-size: clamp(30px, 8vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.il-ring { position: relative; width: 210px; height: 210px; margin: 16px auto 4px; }
.il-ring svg { width: 100%; height: 100%; overflow: visible; }
.il-track { fill: none; stroke: none; }
.il-ring .seg { fill: none; stroke: var(--line); stroke-width: 16; stroke-linecap: butt; }
.il-ring .seg.on { animation: segIn .55s var(--ease) forwards; }
.il-ring .seg.nxt { stroke: var(--ink-3); animation: nxtPulse 1.1s ease-in-out infinite; }
@keyframes segIn { to { stroke-dashoffset: 0; } }
@keyframes nxtPulse { 50% { opacity: .3; } }
.il-avg { position: absolute; inset: 0; display: grid; place-content: center; }
.il-avg b { font-size: 62px; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.il-avg span { margin-top: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.il-msg { margin: 8px auto 0; max-width: 340px; color: var(--ink-2); font-size: 15px; }
.il-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 0; }
.il-stats div { background: var(--surface-2); border-radius: 16px; padding: 10px 6px; }
.il-stats b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.il-stats span { display: block; font-size: 11.5px; color: var(--ink-2); line-height: 1.25; }
.il-strip { margin: 14px 0 18px; }
.il-strip span { width: 30px; height: 30px; border-radius: 9px; font-size: 12.5px; }
.interlude.play .il-msg { animation: wUp .5s var(--ease) .5s both; }
.interlude.play .il-stats div { animation: pop .5s var(--spring) both; }
.interlude.play .il-stats div:nth-child(1) { animation-delay: .6s; }
.interlude.play .il-stats div:nth-child(2) { animation-delay: .68s; }
.interlude.play .il-stats div:nth-child(3) { animation-delay: .76s; }

/* =========================================================
   shared bits: avatar, link button, modal field
   ========================================================= */
a.pelts { text-decoration: none; color: inherit; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--c-kertyma); color: #fff; }
.avatar.me { background: var(--ink); color: var(--bg); }
.link-btn { display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0; padding: 8px 12px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.link-btn:hover { color: var(--ink); background: var(--surface-2); }
.link-btn .ic { width: 18px; height: 18px; }
.scard .link-btn { display: flex; }
.m-field { display: block; margin: 16px 0 0; }
.m-field span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.m-field input { width: 100%; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); padding: 0 14px; font-size: 17px; font-weight: 600; outline: none; }
.m-field input:focus { border-color: var(--ink); }
.m-cancel { display: flex; margin: 10px auto 0; }
.modal-actions .pill .ic { width: 18px; height: 18px; }

/* =========================================================
   home: stats as buttons, vinkit card
   ========================================================= */
button.stat { border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .25s var(--spring), box-shadow .25s; }
button.stat:hover { transform: translateY(-2px); }
.stat span u { text-decoration-color: color-mix(in srgb, var(--ink-2) 40%, transparent); text-underline-offset: 2px; }
.stat-cta { background: var(--ink) !important; color: var(--bg) !important; }
.stat-cta b { display: flex; align-items: center; gap: 8px; font-size: 19px; margin-top: 3px; }
.stat-cta b .ic { width: 22px; height: 22px; }
.stat-cta span { color: color-mix(in srgb, var(--bg) 70%, transparent) !important; }
.vinkit { margin: 14px 0 0; padding: 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); outline: none; scroll-margin: 90px; }
.vinkit.flash { animation: vkFlash 1.4s var(--ease); }
@keyframes vkFlash { 0%, 100% { box-shadow: var(--shadow-sm); } 25% { box-shadow: 0 0 0 3px var(--c-mahtuu), var(--shadow-sm); } }
.vk-head { display: flex; gap: 14px; align-items: flex-start; }
.vk-ic { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c-mahtuu) 20%, transparent); color: var(--c-mahtuu); }
.vk-ic .ic { width: 24px; height: 24px; }
.vk-head h3 { margin: 0; font-size: 18px; }
.vk-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 14.5px; }
.vk-head p b { color: var(--ink); }
.vk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.vk-col h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.vk-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vk-col li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.vk-col li > span small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-2); }
.vk-col li em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-right: 4px; }
.vk-col li > b { flex: none; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.vk-col li > b small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.vk-cost { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--c-mahtuu); color: #0E1014; font-size: 12.5px; font-weight: 800; }
.vk-cost .ic { width: 12px; height: 12px; }
.vk-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }

/* =========================================================
   challenge: banner, reveal duel row, summary comparison
   ========================================================= */
.ch-who { display: flex; gap: 12px; align-items: flex-start; }
.ch-who .avatar { width: 42px; height: 42px; font-size: 18px; margin-top: 2px; }
.ch-who small { display: block; margin-top: 4px; font-size: 13px; opacity: .72; max-width: 440px; }
.challenge .pill .ic { width: 18px; height: 18px; }
.duel-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; margin: 12px 0 0; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); animation: wUp .45s var(--ease) both; }
.dr-who { font-size: 14px; color: var(--ink-2); min-width: 0; }
.dr-who b { color: var(--ink); }
.dr-who small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.dr-verdict { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.dr-verdict.win { background: var(--c-kanta); color: #0E1014; }
.dr-verdict.lose { background: var(--c-kertyma); color: #fff; }
.dr-verdict.tie { background: var(--line); color: var(--ink); }
.dr-score { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ruler .pin-label.friend { font-weight: 600; fill: var(--ink-2); font-size: 12.5px; }

.duel { margin: 22px 0 0; padding: 18px 16px 14px; border-radius: 22px; background: var(--surface-2); text-align: center; }
.du-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.du-p { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.du-p b { font-size: 36px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.du-p.lead b { background: linear-gradient(100deg, var(--c-kanta), var(--c-tieto)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.du-vs b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.du-vs small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 700; max-width: 110px; line-height: 1.25; }
.du-verdict { margin: 10px 0 12px; font-weight: 800; font-size: 17px; }
.du-rows { display: grid; gap: 5px; }
.du-row { display: grid; grid-template-columns: 34px 1fr 26px 1fr 34px; align-items: center; gap: 6px; }
.du-g { font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.du-g.w { color: var(--ink); font-weight: 800; }
.du-bar { height: 14px; display: flex; }
.du-bar.l { justify-content: flex-end; }
.du-bar i { display: block; height: 100%; width: var(--w); border-radius: 4px; background: var(--line); transform: scaleX(0); transition: transform .7s var(--ease) calc(var(--i) * 45ms); }
.du-bar.l i { transform-origin: right; } .du-bar.r i { transform-origin: left; }
.du-bar.w i { background: var(--c); }
.duel.in .du-bar i { transform: scaleX(1); }
.du-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--c); color: var(--on); }
.du-cap { display: flex; justify-content: space-between; margin: 8px 40px 0; font-size: 12px; font-weight: 700; color: var(--ink-3); }

/* =========================================================
   profile
   ========================================================= */
#profile .card { margin-bottom: 14px; }
.pf-empty { text-align: center; padding: 34px 22px; }
.pf-empty-ic { width: 64px; height: 64px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); }
.pf-empty-ic .ic { width: 30px; height: 30px; }
.pf-empty h2 { margin: 14px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.pf-empty p { margin: 0 auto 18px; max-width: 420px; color: var(--ink-2); }
.pf-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.pf-type { margin: 6px 0 0; font-size: clamp(34px, 7vw, 54px); font-weight: 800; letter-spacing: -.045em; line-height: 1; background: linear-gradient(100deg, var(--c-kesto), var(--c-mahtuu) 35%, var(--c-kertyma) 70%, var(--c-virta)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; text-wrap: balance; width: fit-content; max-width: 100%; }
.pf-desc { margin: 10px 0 0; color: var(--ink-2); max-width: 620px; }
.pf-desc b { color: var(--ink); }
.pf-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0 0; }
.pf-tiles div { padding: 12px; border-radius: 14px; background: var(--surface-2); }
.pf-tiles b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pf-tiles span { font-size: 12px; color: var(--ink-2); }
.pf-ins { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.pf-ins li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.pf-ins li b { color: var(--ink); }
.pi { --c: var(--ink-3); width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px; background: color-mix(in srgb, var(--c) 26%, transparent); position: relative; }
.pi::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pi.up::after, .pi.down::after, .pi.arrow::after { border-radius: 0; width: 0; height: 0; background: none; border: 5px solid transparent; }
.pi.up::after { border-bottom: 7px solid var(--c); border-top: 0; }
.pi.down::after { border-top: 7px solid var(--c); border-bottom: 0; }
.pi.arrow::after { border-left: 7px solid var(--c); border-right: 0; }
.pf-card h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.pf-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }

.bias { margin-top: 16px; display: grid; gap: 10px; }
.bias-row, .bias-axis, .bias-cap { display: grid; grid-template-columns: 128px 1fr 44px; align-items: center; gap: 12px; }
.br-name { display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: center; }
.br-name i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); grid-row: 1 / 3; }
.br-name b { font-size: 14.5px; }
.br-name small { grid-column: 2; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.br-track { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); }
.br-mid { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--ink-3); opacity: .5; border-radius: 1px; }
.br-range { position: absolute; top: 9px; bottom: 9px; border-radius: 8px; background: color-mix(in srgb, var(--c) 26%, transparent); opacity: 0; transition: opacity .6s var(--ease) var(--d); }
.br-bar { position: absolute; top: 15px; height: 4px; border-radius: 2px; background: var(--c); transform: scaleX(0); transition: transform .8s var(--ease) var(--d); }
.br-dot { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface-solid); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); transition: left .8s var(--ease) var(--d); }
.br-val { position: absolute; top: 50%; transform: translateY(-50%); padding: 1px 5px; border-radius: 6px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; opacity: 0; transition: opacity .4s var(--ease) calc(var(--d) + .5s); }
.pf.in .br-range { opacity: 1; } .pf.in .br-bar { transform: scaleX(1); } .pf.in .br-dot { left: var(--x); } .pf.in .br-val { opacity: 1; }
.br-track em { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.br-g { text-align: right; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.bias-row.empty .br-name i { opacity: .35; } .bias-row.empty .br-name b { color: var(--ink-3); } .bias-row.empty .br-g { color: var(--ink-3); }
.bias-axis .ba-track, .bias-cap .ba-track { position: relative; height: 16px; }
.bias-axis .ba-track i { position: absolute; transform: translateX(-50%); font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.bias-axis .ba-g { text-align: right; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.bias-cap .ba-track { display: flex; justify-content: space-between; }
.bias-cap em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-3); }

.pf-themes { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pf-th { display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto 6px; align-items: center; column-gap: 10px; row-gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.pf-th .tc-ic { grid-row: 1; }
.pt-name { font-weight: 700; font-size: 14.5px; line-height: 1.15; }
.pt-name small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.pf-th b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pt-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pt-bar i { display: block; height: 100%; width: var(--w); background: var(--tc); border-radius: 3px; transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease) .2s; }
.pf.in .pt-bar i { transform: scaleX(1); }
.pf-th.empty { opacity: .55; }

.hist { margin-top: 16px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 180px; align-items: end; }
.hb { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: center; }
.hb-bar { height: calc(var(--h) * 124px + 3px); border-radius: 8px 8px 4px 4px; background: var(--c); transform: scaleY(0); transform-origin: bottom; transition: transform .7s var(--spring) var(--d); }
.pf.in .hb-bar { transform: scaleY(1); }
.hb-n { padding-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hb-g { padding-top: 6px; font-weight: 800; font-size: 14px; }

.trend { width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.trend .tg { stroke: var(--line); stroke-width: 1; }
.trend .tl { font-size: 11px; fill: var(--ink-3); font-family: var(--mono); }
.trend .tline { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease) .1s; }
.pf.in .trend .tline { stroke-dashoffset: 0; }
.trend .tdot { stroke: var(--surface-solid); stroke-width: 2.5; opacity: 0; transition: opacity .4s var(--ease) var(--d); }
.pf.in .trend .tdot { opacity: 1; }
.trend .tbest { font-size: 12px; font-weight: 800; fill: var(--ink); }
.trend-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.trend-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.pf-foot { text-align: center; padding: 6px 0 20px; color: var(--ink-3); font-size: 13px; }
.pf-foot p { margin: 0; }
.pf-foot .link-btn { margin-top: 6px; color: var(--c-kesto); }

/* =========================================================
   in-game help sheet
   ========================================================= */
button.pelts { border: 0; font: inherit; color: inherit; cursor: pointer; transition: transform .2s var(--ease); }
button.pelts:hover { transform: translateY(-1px); }
.help-sheet { max-height: 88dvh; padding-top: 0; overscroll-behavior: contain; }
.help-head { position: sticky; top: 0; z-index: 2; margin: 0 -16px; padding: 10px 16px 10px; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.help-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-bar h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; letter-spacing: -.01em; }
.help-bar h2 .ic { width: 24px; height: 24px; }
.help-tabs { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.help-tabs::-webkit-scrollbar { display: none; }
.help-tabs button { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 13.5px; transition: background-color .2s, color .2s; }
.help-tabs button.is-on { background: var(--ink); color: var(--bg); }
.help-body { padding: 16px 0 6px; display: grid; gap: 14px; }
.help-sec { scroll-margin-top: 120px; }
.help-sec > h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.help-body .grades, .help-body .vinkit { margin: 0; }
.help-body .steps { grid-template-columns: 1fr; gap: 8px; }
.help-body .step { padding: 14px; }
.help-body .step:hover { transform: none; }
.help-body .st-vis, .help-body .st-n { display: none; }
.help-body .st-head { margin: 0; flex: none; }
.help-body .step b { margin: 2px 0 2px; font-size: 17px; }
.help-body .step p { margin: 0; }
.help-body .step > b, .help-body .step > p { grid-column: 2; }
.help-body .step { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-content: start; }
.help-body .st-head { grid-row: 1 / 3; }
.hints .help-link { margin: 2px 0 0; padding: 6px 10px; font-size: 13.5px; justify-self: start; }

/* ---- profile header + credits under the screens */
.pf-top { justify-content: space-between; }
.pf-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.pf-title .ic { width: 22px; height: 22px; }
.pf-close { height: 44px; padding: 0 18px 0 14px; }
.pf-close .ic, .pf-foot .pill .ic { width: 18px; height: 18px; }
.pf-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pf-foot .pill { margin-bottom: 6px; }
.screen-credit { margin: 30px 0 10px; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.screen-credit a { color: var(--ink-2); font-weight: 800; text-decoration: none; }
.screen-credit a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   responsive
   ========================================================= */
@media (max-width: 720px) {
  .vk-cols { grid-template-columns: 1fr; }
  .pf-tiles { grid-template-columns: repeat(3, 1fr); }
  .pf-tiles b { font-size: 21px; }
  .bias { gap: 12px; }
  .bias-row { grid-template-columns: 1fr auto; grid-template-areas: "name g" "track track"; row-gap: 6px; }
  .bias-row .br-name { grid-area: name; grid-template-columns: 12px auto 1fr; }
  .bias-row .br-name small { grid-column: 3; grid-row: 1; margin-left: 6px; }
  .bias-row .br-name i { grid-row: 1; }
  .bias-row .br-g { grid-area: g; }
  .bias-row .br-track { grid-area: track; }
  .bias-axis, .bias-cap { grid-template-columns: 1fr; }
  .bias-axis > span:first-child, .bias-axis .ba-g, .bias-cap > span:first-child, .bias-cap > span:last-child { display: none; }
  .bias-axis .ba-track i:first-child { transform: none; } .bias-axis .ba-track i:last-child { transform: translateX(-100%); }
  .pf-th { grid-template-columns: 30px 1fr auto; padding: 10px; column-gap: 8px; }
  .pf-th .tc-ic { width: 30px; height: 30px; }
  .pf-th b { font-size: 19px; }
  .duel-row { grid-template-columns: auto 1fr auto; }
  .dr-score { grid-column: 3; grid-row: 1; }
  .dr-verdict { grid-column: 2 / 4; grid-row: 2; justify-self: start; }
  .themes { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 14px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent); }
  .themes::-webkit-scrollbar { display: none; }
  .tchip { flex: none; scroll-snap-align: start; scroll-margin-left: 16px; }
  .pick { margin-bottom: 14px; }
  .rounds { grid-template-columns: 1fr; }
  .round-card { min-height: 0; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 18px; row-gap: 0; align-items: center; }
  .rc-n { grid-row: 1 / 4; font-size: 54px; min-width: 64px; }
  .rc-name { margin-top: 0; }
  .rc-best { margin-top: 2px; padding-top: 0; }
  .steps { grid-template-columns: 1fr; }
  .st-vis { height: 108px; }
  .hero { margin: 34px 0 22px; }
}
@media (max-width: 560px) {
  .gs-wrap { padding-top: 0; }
  .gs-pin, .gs-axis { display: none; }
  .gs-scale { grid-template-columns: 1fr; gap: 6px; }
  .gs { display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 5px; align-items: center; text-align: left; }
  .gs b { grid-row: 1 / 3; width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
  .gs span { grid-column: 2; grid-row: 1; font-size: 14px; }
  .gs em { grid-column: 3; grid-row: 1; margin: 0; }
  .gs-bar { grid-column: 2 / 4; grid-row: 2; height: 6px; margin: 0; width: calc(100% - var(--i) * 13%); border-radius: 3px !important; }
}
@media (max-width: 420px) {
  .pf-tiles div { padding: 10px; }
  .du-p b { font-size: 30px; }
  .du-cap { margin: 8px 30px 0; }
  .il-card { padding: 22px 16px 18px; border-radius: 26px; }
  .il-ring { width: 180px; height: 180px; }
  .il-avg b { font-size: 52px; }
  .il-strip { gap: 5px; }
  .il-strip span { width: 26px; height: 26px; border-radius: 8px; font-size: 11.5px; }
  .card { padding: 18px; border-radius: 24px; }
  .grade { width: 96px; height: 96px; }
  .grade b { font-size: 32px; }
  .grade span { font-size: 9.5px; max-width: 70px; }
  .actions .primary { min-width: 0; flex: 1; }
  .s-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .blob { animation: none; }
  .il-ring .seg.on { stroke-dashoffset: 0 !important; }
}

/* tabular figures only where numbers line up or animate */
.guess-input, .preview, .r-num b, .grade b, .calc-result, .calc-words, .s-avg b, .stat b, .rc-n, .ruler text, .nv, .pelts b, .strip span, .s-list .sg, .history li b, .tape li, .consts li { font-variant-numeric: tabular-nums; }
