/* ==========================================================================
   OVERCLOCK — amber / magenta, high energy
   ========================================================================== */
.screen.oc {
  overflow: hidden;
  gap: 8px;
  padding-top: calc(var(--safe-t) + 8px);
  padding-bottom: calc(var(--safe-b) + 10px);
}
.screen.oc::before {   /* hot gradient wash behind the stage */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 40% at 100% 0%, rgba(255, 43, 214, 0.14), transparent 70%),
    radial-gradient(60% 40% at 0% 100%, rgba(255, 182, 39, 0.12), transparent 70%);
}
.oc > * { position: relative; }
.oc.is-final .oc-timer .timer-fill { background: linear-gradient(90deg, var(--magenta), var(--accent), #fff); }

.oc-head-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oc-title { font-family: var(--font-display); font-weight: 900; font-size: 14px; letter-spacing: 0.14em; color: var(--accent); font-style: italic; }
.oc-title b { color: var(--magenta); }
.oc-sub { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-score-wrap { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.oc-score-wrap small { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.24em; color: var(--text-dim); }
.oc-score { font-family: var(--font-num); font-weight: 700; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.oc-timer { flex: none; }

/* progress strip */
.oc-strip { flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.oc-strip::-webkit-scrollbar { display: none; }
.oc-pchip {
  flex: 1 0 40px;
  max-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 4px;
  background: rgba(10, 12, 30, 0.7);
  border: 1px solid var(--line);
  transition: border-color 0.2s, opacity 0.3s;
}
.oc-pchip.is-me { border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.oc-pchip .avatar svg { filter: none; }
.oc-pbar { position: relative; width: 100%; height: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.oc-pfill { position: absolute; inset: 0; background: var(--c); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.35s var(--ease); }
.oc-pchip.is-done { border-color: var(--accent); }
.oc-pchip.is-done .oc-pfill { background: var(--accent); }
.oc-pchip.is-lost { opacity: 0.4; }

/* stage */
.oc-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.ch { display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: 100%; margin-top: auto; }

/* challenge hero: fills the top of the stage, shows per-part progress */
.ch-hero {
  flex: none;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 14px;
  padding: 14px 14px 12px;
  background: linear-gradient(110deg, rgba(255, 182, 39, 0.12), rgba(255, 43, 214, 0.06) 60%, transparent);
  border: 1px solid rgba(255, 182, 39, 0.22);
  border-left: 3px solid var(--accent);
  animation: row-in 0.4s var(--ease) both;
}
.ch-hero.is-final { border-left-color: var(--magenta); background: linear-gradient(110deg, rgba(255, 43, 214, 0.18), rgba(255, 182, 39, 0.08) 60%, transparent); }
.ch-hero-glyph { grid-row: 1 / span 2; font-size: 40px; line-height: 1; color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.ch-hero-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-hero-text b { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 18px; letter-spacing: 0.06em; }
.ch-hero-text small { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; color: var(--text-dim); }
.ch-hero.is-final small { color: var(--magenta); }
.ch-pips { grid-column: 2; display: flex; gap: 5px; }
.ch-pips i { flex: 1; max-width: 34px; height: 4px; background: rgba(255, 255, 255, 0.1); transition: background-color 0.25s; }
.ch-pips i.ok { background: var(--green); box-shadow: 0 0 8px rgba(61, 255, 139, 0.5); }
.ch-pips i.miss { background: var(--red); }
.ch.q-in { animation: q-in 0.4s var(--ease) both; }
.ch-prompt { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; color: var(--accent); text-align: center; }
.ch-actions { display: flex; justify-content: center; gap: 10px; }
.oc-idle, .oc-sync, .oc-spectate { display: grid; place-items: center; gap: 8px; text-align: center; color: var(--text-dim); font-family: var(--font-mono); letter-spacing: 0.14em; }
.oc-idle-glyph { font-size: 120px; line-height: 1; color: rgba(255, 182, 39, 0.08); }
.oc-sync { animation: blink 0.8s steps(2) infinite; }
.oc-spectate b { font-family: var(--font-display); color: var(--accent); font-size: 18px; }

.oc-done { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto 0; animation: count-tick 0.45s var(--ease-back) both; }
.oc-done-mark { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: 0.12em; color: var(--text); }
.oc-done.is-perfect .oc-done-mark { color: var(--accent); text-shadow: 0 0 22px var(--accent-glow); }
.oc-done-score { font-family: var(--font-num); font-size: 22px; color: var(--text-dim); }
.oc-done-score b { color: var(--text); font-size: 34px; }
.oc-done-wait { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--text-faint); animation: blink 1.4s steps(2) infinite; }

/* unscramble */
.us-slots, .us-tiles { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.us-slot, .us-tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 6.5vw, 30px);
  text-transform: uppercase;
}
.us-slot { border: 2px dashed rgba(255, 182, 39, 0.35); color: var(--text); background: rgba(10, 12, 30, 0.5); }
.us-slot.is-full { border-style: solid; border-color: var(--accent); animation: pop 0.14s var(--ease-back); }
.us-slots.is-win .us-slot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); animation: win 0.6s var(--ease-back) both; }
.us-slots.shake { animation: shake 0.45s; }
.us-tile { background: linear-gradient(160deg, #2a1c4a, #1a1230); border: 1px solid rgba(255, 43, 214, 0.45); color: #fff; transition: opacity 0.15s, transform 0.1s; }
.us-tile:active { transform: scale(0.92); }
.us-tile.is-used { opacity: 0.15; }

/* memory */
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(100%, 300px); margin: 0 auto; }
.mem-node {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 182, 39, 0.35);
  background: radial-gradient(circle, rgba(255, 182, 39, 0.08), rgba(10, 12, 30, 0.8) 70%);
}
.mem-node i {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--accent) 45%, var(--magenta) 100%);
  box-shadow: 0 0 30px var(--accent), 0 0 60px rgba(255, 43, 214, 0.6);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.12s, transform 0.12s;
}
.mem-node.lit i { opacity: 1; transform: scale(1); }
.mem-node.miss { border-color: var(--red); animation: shake 0.45s; }
.mem-node.hint { border-color: var(--green); }
.mem-grid.is-input .mem-node { border-color: rgba(255, 182, 39, 0.7); }
.mem-node:active:not(:disabled) { transform: scale(0.95); }
.mem-count { text-align: center; font-family: var(--font-num); font-weight: 700; font-size: 18px; color: var(--text-dim); }

/* odd one out */
.odd-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 5px; width: min(100%, 380px); margin: 0 auto; }
.odd-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(18px, calc(70vw / var(--n) * 0.55), 34px);
  color: var(--text);
  background: rgba(10, 12, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.08s;
}
.odd-cell:active { transform: scale(0.9); }
.odd-cell.is-odd { background: var(--green); color: var(--bg-0); }
.odd-cell.is-miss { background: var(--red); color: #fff; }

/* numeric (math / pattern) */
.ch-num { gap: 10px; }
.num-prompt { min-height: 70px; display: grid; place-items: center; }
.num-prompt.q-in { animation: q-in 0.35s var(--ease) both; }
.num-q { font-family: var(--font-num); font-weight: 700; font-size: clamp(28px, 9vw, 40px); text-align: center; line-height: 1.15; }
.num-seq { font-size: clamp(22px, 7vw, 32px); }
.num-eq { color: var(--accent); }
.num-display {
  height: 58px;
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 32px;
  background: rgba(4, 6, 18, 0.8);
  border: 1px solid rgba(255, 182, 39, 0.4);
  border-bottom: 3px solid var(--accent);
}
.num-display.is-right { background: rgba(61, 255, 139, 0.18); border-color: var(--green); color: var(--green); }
.num-display.is-wrong { background: rgba(255, 51, 85, 0.15); border-color: var(--red); color: var(--red); font-size: 22px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kp {
  height: clamp(48px, 7dvh, 60px);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  background: #21173c;
  border-bottom: 2px solid rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}
.kp:active { transform: scale(0.94); background: #34245c; }
.kp-go { background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-size: 13px; letter-spacing: 0.1em; }
.kp-go:active { background: #ffd36e; }
.kp-del { font-size: 20px; color: var(--text-dim); }

/* trivia lightning */
.ch-trivia { gap: 12px; }
.tl-q { font-weight: 700; font-size: clamp(17px, 4.8vw, 20px); line-height: 1.28; text-align: left; min-height: 3.6em; }
.tl-opts { display: flex; flex-direction: column; gap: 7px; }
.tl-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px 8px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  background: rgba(16, 12, 34, 0.86);
  border: 1px solid rgba(255, 43, 214, 0.25);
}
.tl-key { flex: none; display: grid; place-items: center; width: 32px; height: 32px; font-family: var(--font-mono); font-weight: 700; color: var(--magenta); border: 1px solid rgba(255, 43, 214, 0.5); }
.tl-opt.is-correct { border-color: var(--green); background: rgba(61, 255, 139, 0.15); }
.tl-opt.is-wrong { border-color: var(--red); background: rgba(255, 51, 85, 0.15); }

/* overlays */
.oc-overlay { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.oc-overlay:empty { display: none; }
.oc-overlay > * { pointer-events: auto; }
.ov-ready { display: grid; place-items: center; padding: 0 var(--gutter); background: rgba(8, 4, 16, 0.9); animation: fade-in 0.25s both; }
.oc-ready { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; max-width: 360px; }
.oc-ready-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.26em; color: var(--magenta); }
.oc-glyph {
  font-size: 84px;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(255, 43, 214, 0.4);
  animation: glyph-in 0.6s var(--ease-back) both;
}
@keyframes glyph-in { from { opacity: 0; transform: scale(0.3) rotate(-30deg); } }
.oc-ready-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(26px, 8.5vw, 38px);
  letter-spacing: 0.06em;
  line-height: 1.05;
  animation: logo-in 0.7s var(--ease) both 0.1s;
}
.oc-rules { display: flex; flex-direction: column; gap: 8px; font-size: 16px; color: var(--text-dim); }
.oc-rules li { animation: rise 0.4s var(--ease) both 0.35s; }
.oc-rules li:nth-child(2) { animation-delay: 0.5s; }
.oc-ready.is-brief .oc-ready-name { color: var(--accent); }
.oc-count { min-height: 64px; font-family: var(--font-num); font-weight: 700; font-size: 60px; line-height: 1; color: #fff; text-shadow: 0 0 24px rgba(255, 43, 214, 0.7); }
.oc-count.tick { animation: count-tick 0.5s var(--ease) both; }

@media (max-height: 700px) {
  .ch-hero { padding: 8px 10px; }
  .ch-hero-glyph { font-size: 28px; }
  .mem-grid { width: min(100%, 240px); gap: 10px; }
  .kp { height: 44px; }
  .oc-pchip { padding: 3px; }
}
/* grids read best centered in the free space; keypads/answers stay low for thumbs */
.ch.ch-memory, .ch.ch-odd { margin: auto 0; }

/* ---- shared: buttons that flash right / wrong ---- */
.cc-opt.is-correct, .qc-opt.is-correct, .tf-btn.is-correct { border-color: var(--green); background: rgba(61, 255, 139, 0.16); }
.cc-opt.is-wrong, .qc-opt.is-wrong, .tf-btn.is-wrong { border-color: var(--red); background: rgba(255, 51, 85, 0.16); animation: shake 0.4s; }
.qc-opt.is-close { border-color: var(--yellow); background: rgba(255, 210, 61, 0.14); }

/* color clash */
.ch-stroop { gap: 18px; }
.cc-word {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 14vw, 64px);
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 0 0 26px color-mix(in srgb, var(--ink) 45%, transparent);
  padding: 22px 0 14px;
}
.cc-word.q-in { animation: q-in 0.3s var(--ease) both; }
.cc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-opt {
  position: relative;
  min-height: 64px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.1em;
  color: var(--text);
  background: rgba(16, 12, 34, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.cc-opt:active { transform: scale(0.96); }
.cc-key { position: absolute; top: 6px; left: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }

/* signal lock */
.ch-reflex { gap: 14px; margin: auto 0; }
.rx-pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: clamp(220px, 42dvh, 360px);
  border: 2px solid rgba(255, 182, 39, 0.35);
  background: radial-gradient(circle at 50% 45%, rgba(255, 182, 39, 0.08), rgba(8, 9, 24, 0.95) 70%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overflow: hidden;
}
.rx-pad::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, #fff 0%, var(--accent) 30%, var(--magenta) 85%);
  opacity: 0;
  transition: opacity 0.05s;
}
.rx-pad > * { position: relative; }
.rx-pad.is-wait { border-color: rgba(255, 51, 85, 0.6); }
.rx-pad.is-wait .rx-label { color: var(--red); animation: blink 1.1s steps(2) infinite; }
.rx-pad.is-go::before { opacity: 1; transition: none; }
.rx-pad.is-go .rx-label { color: #1a0e00; }
.rx-pad.is-go .rx-sub { color: rgba(26, 14, 0, 0.7); }
.rx-pad.is-hit { border-color: var(--green); }
.rx-pad.is-hit .rx-label { color: var(--green); }
.rx-pad.is-miss { border-color: var(--red); }
.rx-pad.is-miss .rx-label { color: var(--red); }
.rx-label { font-family: var(--font-display); font-weight: 900; font-size: clamp(32px, 10vw, 46px); letter-spacing: 0.08em; color: var(--text); font-variant-numeric: tabular-nums; }
.rx-sub { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; color: var(--text-dim); }
.rx-log { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rx-chip { display: grid; place-items: center; height: 34px; font-family: var(--font-num); font-weight: 700; font-size: 14px; color: var(--text-faint); border: 1px solid rgba(255, 255, 255, 0.1); }
.rx-chip.is-hit { color: var(--green); border-color: rgba(61, 255, 139, 0.5); }
.rx-chip.is-miss { color: var(--red); border-color: rgba(255, 51, 85, 0.5); }
.rx-chip.is-done { color: var(--text-dim); }

/* quick count */
.ch-count { gap: 16px; margin: auto 0; }
.qc-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(100%, 330px); margin: 0 auto; }
.qc-cell { display: grid; place-items: center; aspect-ratio: 1; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); }
.qc-shape { font-style: normal; font-size: clamp(22px, 7vw, 30px); line-height: 1; }
.qc-shape[data-s='tri'] { color: var(--cyan); }
.qc-shape[data-s='dot'] { color: var(--magenta); }
.qc-shape[data-s='sq'] { color: var(--accent); }
.qc-shape[data-s='dia'] { color: var(--green); }
.qc-ask { display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--font-display); font-weight: 900; font-size: 24px; letter-spacing: 0.08em; padding: 18px 0; }
.qc-ask .qc-shape { font-size: 40px; }
.qc-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qc-opt {
  min-height: 68px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 30px;
  color: var(--text);
  background: #21173c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  touch-action: manipulation;
}
.qc-opt:active { transform: scale(0.94); }

/* true or false */
.ch-tf { gap: 18px; }
.tf-q {
  display: grid;
  place-items: center;
  min-height: 6.2em;
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: clamp(22px, 6.4vw, 28px);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  background: rgba(16, 12, 34, 0.7);
  border: 1px solid rgba(255, 182, 39, 0.25);
}
.tf-q.q-in { animation: q-in 0.3s var(--ease) both; }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-btn {
  min-height: 84px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.12em;
  border: 2px solid;
  touch-action: manipulation;
  user-select: none;
}
.tf-true { color: var(--green); border-color: rgba(61, 255, 139, 0.55); background: rgba(61, 255, 139, 0.06); }
.tf-false { color: var(--red); border-color: rgba(255, 51, 85, 0.55); background: rgba(255, 51, 85, 0.06); }
.tf-btn:active { transform: scale(0.96); }
.ch-pips i.half { background: var(--yellow); }
@media (prefers-reduced-motion: reduce) {
  .cc-word.q-in, .tf-q.q-in, .cc-opt.is-wrong, .qc-opt.is-wrong, .tf-btn.is-wrong { animation: none; }
}
/* quick count: CSS-drawn shapes, identical size whatever the font (glyph dots render much smaller than triangles) */
.qc-shape { display: block; width: 52%; aspect-ratio: 1; font-size: 0; background: currentColor; }
.qc-shape[data-s='tri'] { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.qc-shape[data-s='dot'] { border-radius: 50%; transform: scale(0.9); }
.qc-shape[data-s='sq'] { transform: scale(0.84); }
.qc-shape[data-s='dia'] { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.qc-ask .qc-shape { display: inline-block; width: 40px; }

/* =========================================================================
   LEXICON / TIMELINE / CLOSEST CALL / REWIRE (+ their reveals)
   ========================================================================= */
/* lexicon */
.ch-lexicon { gap: 10px; }
.lx-meter { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-dim); }
.lx-meter b { font-family: var(--font-num); font-size: 15px; color: var(--accent); margin-left: 4px; }
.lx-word { display: flex; justify-content: center; gap: 5px; min-height: 50px; align-items: center; }
.lx-word.shake { animation: shake 0.45s; }
.lx-l { display: grid; place-items: center; width: clamp(30px, 8.6vw, 38px); height: 46px; font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--accent-ink); background: var(--accent); animation: pop 0.14s var(--ease-back); }
.lx-ph { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3em; color: var(--text-faint); }
.lx-hint { height: 16px; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-dim); opacity: 0; transition: opacity 0.2s; }
.lx-hint.is-on { opacity: 1; }
.lx-hint.is-good { color: var(--green); }
.lx-hint.is-warn { color: var(--red); }
.lx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 300px); margin: 0 auto; }
.lx-tile {
  aspect-ratio: 1.25;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 8vw, 34px);
  color: #fff;
  background: linear-gradient(160deg, #2a1c4a, #1a1230);
  border: 1px solid rgba(255, 43, 214, 0.45);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.15s, transform 0.1s;
}
.lx-tile:active { transform: scale(0.92); }
.lx-tile.is-used { opacity: 0.15; }
.lx-actions { display: grid; grid-template-columns: 1fr auto 1.4fr; gap: 8px; }
.lx-actions .btn { min-height: 44px; }
.lx-found { display: flex; flex-wrap: wrap; gap: 6px; max-height: 64px; overflow: hidden; }
.lx-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 8px; font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; color: var(--text-dim); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); animation: pop 0.2s var(--ease-back); }
.lx-chip small { font-family: var(--font-num); font-size: 10px; color: var(--text-faint); }
.lx-chip.is-best { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.lx-chip.is-best small { color: var(--accent-ink); }

/* timeline */
.ch-timeline { gap: 10px; }
.tm-head { display: flex; flex-direction: column; gap: 3px; }
.tm-cat { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: var(--magenta); }
.tm-ask { margin: 0; font-weight: 700; font-size: 18px; line-height: 1.25; color: var(--text); }
.tm-dir { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dim); background: rgba(255, 182, 39, 0.08); border: 1px solid rgba(255, 182, 39, 0.3); }
.tm-dir b { color: var(--accent); }
.tm-dir i { font-style: normal; color: var(--accent); }
.tm-list { display: flex; flex-direction: column; gap: 8px; }
.tm-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  min-height: 62px;
  padding: 8px 12px 8px 10px;
  text-align: left;
  color: var(--text);
  background: rgba(16, 12, 34, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s var(--ease), border-color 0.15s, background-color 0.15s;
}
.tm-item:active { transform: scale(0.98); }
.tm-badge { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; font-family: var(--font-num); font-weight: 700; font-size: 19px; color: var(--accent-ink); border: 2px dashed rgba(255, 182, 39, 0.35); }
.tm-label { font-weight: 700; font-size: 16px; line-height: 1.2; }
.tm-val { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-dim); }
.tm-val:empty { display: none; }
.tm-item.is-picked { border-color: var(--accent); background: rgba(255, 182, 39, 0.1); }
.tm-item.is-picked .tm-badge { background: var(--accent); border: 2px solid var(--accent); animation: pop 0.16s var(--ease-back); }
.tm-item.is-right { border-color: var(--green); background: rgba(61, 255, 139, 0.12); }
.tm-item.is-right .tm-val { color: var(--green); }
.tm-item.is-wrong { border-color: var(--red); background: rgba(255, 51, 85, 0.12); }
.tm-item.is-wrong .tm-val { color: #ff9aaa; }
.tl-submit { min-height: 52px; }

/* closest call */
.ch-closest { gap: 10px; }
.cl-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; background: linear-gradient(160deg, rgba(42, 28, 74, 0.9), rgba(16, 12, 34, 0.9)); border: 1px solid rgba(255, 43, 214, 0.4); border-left: 3px solid var(--magenta); }
.cl-cat { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: var(--magenta); }
.cl-q { margin: 0; font-weight: 700; font-size: clamp(18px, 5vw, 21px); line-height: 1.3; color: var(--text); }
.cl-display { display: flex; align-items: baseline; justify-content: center; gap: 10px; min-height: 58px; padding: 6px 12px; background: rgba(8, 9, 24, 0.9); border: 1px solid var(--accent); }
.cl-display.is-empty .cl-num { color: var(--text-faint); }
.cl-num { font-family: var(--font-num); font-weight: 700; font-size: clamp(30px, 9vw, 40px); color: #fff; font-variant-numeric: tabular-nums; }
.cl-unit { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--accent); }
.cl-lock { min-height: 52px; }

/* rewire */
.ch-rewire { gap: 10px; margin: auto 0; }
.rw-frame { position: relative; width: min(100%, calc(100dvh - 330px), 340px); margin: 0 auto; padding: 0 22px; }
.rw-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; }
.rw-tile {
  aspect-ratio: 1;
  padding: 0;
  background: #120d26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.rw-tile svg { display: block; width: 100%; height: 100%; transition: transform 0.16s var(--ease); }
.rw-dim { fill: #3a2f5a; }
.rw-lit { fill: var(--accent); opacity: 0; transition: opacity 0.2s; filter: drop-shadow(0 0 5px rgba(255, 182, 39, 0.8)); }
.rw-tile.is-lit .rw-lit { opacity: 1; transition-delay: var(--d, 0ms); }
.rw-src, .rw-core { position: absolute; top: calc((var(--r) + 0.5) / var(--n) * 100%); width: 18px; height: 18px; transform: translateY(-50%); }
.rw-src { left: 0; }
.rw-core { right: 0; }
.rw-src i, .rw-core i { position: absolute; inset: 0; border-radius: 50%; background: #3a2f5a; }
.rw-src.is-on i { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.rw-core i { border-radius: 2px; transform: rotate(45deg); background: #2a1c4a; border: 2px solid var(--magenta); }
.rw-core span { position: absolute; right: -2px; top: 22px; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-faint); }
.rw-core.is-on i { background: var(--magenta); box-shadow: 0 0 18px var(--magenta); animation: core-on 0.6s var(--ease-back); }
.rw-core.is-on span { color: var(--magenta); }
@keyframes core-on { 0% { transform: rotate(45deg) scale(1); } 45% { transform: rotate(45deg) scale(1.8); } 100% { transform: rotate(45deg) scale(1); } }
.rw-hint { text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--text-faint); }
.ch-rewire.is-solved .rw-hint { color: var(--accent); }

/* ---- reveals (above the leaderboard) ---- */
.rv { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 4px; background: linear-gradient(160deg, rgba(42, 28, 74, 0.7), rgba(12, 10, 28, 0.85)); border: 1px solid rgba(255, 182, 39, 0.3); animation: q-in 0.35s var(--ease) both; }
.rv-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; line-height: 1.4; color: var(--accent); padding-right: 52px; min-height: 72px; }
.oc-standings > .rv:first-child { margin-top: 0; }
.rv-ask { display: block; margin-top: 6px; font-family: var(--font-ui); font-size: 16px; font-weight: 700; letter-spacing: 0; line-height: 1.3; color: var(--text); }
.rv-best { margin-top: 6px; letter-spacing: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.rv-best b { font-family: var(--font-display); font-weight: 900; font-size: 24px; letter-spacing: 0.08em; color: #fff; text-shadow: 0 0 18px rgba(255, 182, 39, 0.5); }
.rv-best small { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.rv-words { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.rv-word { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 6px; padding: 3px 0 3px 8px; border-left: 2px solid var(--c); animation: q-in 0.3s var(--ease) both; min-width: 0; }
.rv-name { font-size: 11px; font-weight: 700; color: var(--c); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-w { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: 0.04em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-word small { font-family: var(--font-num); font-size: 11px; color: var(--text-faint); }
.rv-word.is-max .rv-w { color: var(--accent); }
.rv-us .rv-kicker { min-height: 0; }
.rv-us-count { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-dim); }
.rv-us-count b { font-family: var(--font-num); font-size: 15px; color: var(--accent); }
.rv-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-order li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; background: rgba(255, 255, 255, 0.04); border-left: 2px solid var(--accent); animation: q-in 0.35s var(--ease) both; }
.rv-pos { font-family: var(--font-num); font-weight: 700; font-size: 18px; color: var(--accent); }
.rv-label { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.2; }
.rv-val { font-family: var(--font-num); font-size: 15px; color: #fff; white-space: nowrap; }

/* closest call: the number line */
.rv-cc .rv-kicker { color: var(--text); font-family: var(--font-ui); font-size: 15px; letter-spacing: 0; font-weight: 700; }
.nl { position: relative; height: 184px; margin: 4px 14px 0; }
.nl-track { position: absolute; left: 0; right: 0; top: 108px; height: 2px; background: linear-gradient(90deg, rgba(255, 182, 39, 0.2), rgba(255, 182, 39, 0.8), rgba(255, 43, 214, 0.8), rgba(255, 43, 214, 0.2)); }
.nl-lo, .nl-hi { position: absolute; top: 172px; font-family: var(--font-num); font-size: 10px; color: var(--text-faint); }
.nl-lo { left: 0; transform: translateX(-30%); }
.nl-hi { right: 0; transform: translateX(30%); }
.nl-mark { position: absolute; left: calc(var(--x) * 100%); top: 108px; width: 0; height: 0; z-index: 2; animation: nl-in 0.4s var(--ease-back) both; }
.nl-mark i { position: absolute; left: -7px; top: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); border: 2px solid #0a0818; }
.nl-tag { position: absolute; left: 0; transform: translateX(-50%); padding: 0 3px; background: rgba(16, 11, 32, 0.82); display: flex; flex-direction: column; align-items: center; white-space: nowrap; line-height: 1.1; }
.nl-tag b { font-size: 11px; font-weight: 700; color: var(--c); max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
.nl-tag small { font-family: var(--font-num); font-size: 11px; color: var(--text-dim); }
.lane-0 .nl-tag { bottom: 12px; }
.lane-1 .nl-tag { top: 12px; }
.lane-2 .nl-tag { bottom: 44px; }
.lane-3 .nl-tag { top: 44px; }
.lane-2 i::after, .lane-3 i::after { content: ''; position: absolute; left: 5px; width: 1px; height: 28px; background: var(--c); opacity: 0.5; }
.lane-2 i::after { bottom: 12px; }
.lane-3 i::after { top: 12px; }
.nl-mark.is-closest i { animation: nl-win 0.7s 2.2s var(--ease-back) both; }
.nl-mark.is-closest .nl-tag b { color: #fff; }
.nl-answer { position: absolute; z-index: 1; left: calc(var(--x) * 100%); top: 0; bottom: 14px; width: 0; animation: nl-drop 0.6s 1.4s var(--ease-back) both; }
.nl-answer i { position: absolute; left: -1px; top: 28px; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 10px #fff; }
.nl-answer span { position: absolute; left: 0; top: 0; z-index: 3; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; padding: 2px 8px; white-space: nowrap; background: #fff; color: #120a00; line-height: 1.1; }
.nl-answer small { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.2em; }
.nl-answer b { font-family: var(--font-num); font-size: 13px; }
.nl-win { text-align: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-dim); animation: q-in 0.4s var(--ease) both; }
.nl-win b { color: var(--accent); }
@keyframes nl-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes nl-drop { from { opacity: 0; transform: translateY(-34px); } }
@keyframes nl-win { 0% { transform: scale(1); } 50% { transform: scale(1.9); } 100% { transform: scale(1.35); } }

@media (prefers-reduced-motion: reduce) {
  .nl-mark, .nl-answer, .nl-win, .rv, .rv-word, .rv-order li { animation-duration: 0.01s !important; animation-delay: 0s !important; }
  .nl-mark.is-closest i { animation: none; transform: scale(1.35); }
  .rw-tile svg { transition: none; }
}

/* =========================================================================
   MISSING LINK / SPELLCHECK / MAKE 24 / COMPASS / SORT IT / HIGHER OR LOWER
   ========================================================================= */
/* missing link */
.ch-link { gap: 12px; margin: auto 0; }
.ch-link [hidden], .ch-m24 [hidden] { display: none !important; }
.ml-words { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ml-word {
  display: grid;
  place-items: center;
  min-height: 48px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(19px, 5.6vw, 24px);
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(160deg, rgba(42, 28, 74, 0.92), rgba(18, 12, 38, 0.92));
  border: 1px solid rgba(255, 43, 214, 0.35);
  animation: q-in 0.35s var(--ease) both;
}
.ml-field { position: relative; display: block; cursor: text; }
.ml-blanks { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 46px)); justify-content: center; gap: 5px; }
.ml-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 0.86;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 6vw, 28px);
  color: var(--text);
  background: rgba(8, 9, 24, 0.85);
  border-bottom: 3px solid rgba(255, 182, 39, 0.4);
}
.ml-cell.is-full { border-bottom-color: var(--accent); animation: pop 0.14s var(--ease-back); }
.ml-cell.is-extra { border-bottom-style: dashed; border-bottom-color: rgba(255, 255, 255, 0.25); color: var(--text-dim); }
.ml-cell.is-caret { box-shadow: inset 0 -3px 0 var(--magenta); }
.ml-cell.is-caret:not(.is-full)::after { content: ''; width: 2px; height: 50%; background: var(--magenta); animation: blink 1s steps(2) infinite; }
.ml-cell.is-win { background: var(--accent); color: var(--accent-ink); border-bottom-color: var(--accent); animation: win 0.6s var(--ease-back) both; }
.ml-field.is-focus .ml-cell:not(.is-full) { border-bottom-color: rgba(255, 43, 214, 0.6); }
.ml-field.shake { animation: shake 0.45s; }
/* the real input sits invisibly over the boxes: one tap raises the keyboard; 16px stops iOS zooming in */
.ml-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  border: 0;
  outline: none;
  cursor: text;
}
.ml-hint { min-height: 16px; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--text-dim); }
.ml-hint.is-good { color: var(--green); }
.ml-hint.is-warn { color: #ff8095; }
.ml-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.ml-actions .btn { min-height: 52px; }
.ml-actions .ml-skip[hidden] + .ml-go { grid-column: 1 / -1; }
.ch-link.is-solved .ml-word { border-color: var(--accent); }
/* keyboard up (iOS / Android): drop the strip and hero so the words, boxes and buttons stay above it */
.oc.kb-open { padding-bottom: calc(var(--kb, 0px) + 8px); }
.oc.kb-open .oc-strip, .oc.kb-open .ch-hero { display: none; }
.oc.kb-open .ch-link { gap: 8px; }
.oc.kb-open .ml-word { min-height: 38px; font-size: 18px; }

/* spellcheck */
.ch-spell { gap: 14px; }
.sp-opts { display: flex; flex-direction: column; gap: 8px; }
.sp-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 8px 14px 8px 10px;
  text-align: left;
  color: var(--text);
  background: rgba(16, 12, 34, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s, border-color 0.15s, background-color 0.15s;
}
.sp-opt:active { transform: scale(0.98); }
.sp-key { flex: none; display: grid; place-items: center; width: 30px; height: 30px; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--magenta); border: 1px solid rgba(255, 43, 214, 0.5); }
.sp-word { font-family: var(--font-mono); font-weight: 700; font-size: clamp(19px, 5.4vw, 23px); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.sp-opt.is-correct { border-color: var(--green); background: rgba(61, 255, 139, 0.15); }
.sp-opt.is-correct .sp-word { color: var(--green); }
.sp-opt.is-wrong { border-color: var(--red); background: rgba(255, 51, 85, 0.15); animation: shake 0.4s; }
.sp-opt.is-wrong .sp-word { text-decoration: line-through; text-decoration-color: var(--red); }
.sp-opt.is-dim { opacity: 0.35; }

/* make 24 */
.ch-m24 { gap: 12px; }
.m24-target { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.m24-target small { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.24em; color: var(--text-dim); }
.m24-target b { font-family: var(--font-num); font-weight: 700; font-size: 44px; line-height: 1; color: var(--accent); text-shadow: 0 0 22px var(--accent-glow); }
.m24-tiles { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 92px)); justify-content: center; gap: 10px; min-height: 96px; }
.m24-tiles.q-in { animation: q-in 0.35s var(--ease) both; }
.m24-tiles.shake, .m24-tiles.nudge { animation: shake 0.42s; }
.m24-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(30px, 9vw, 40px);
  color: #fff;
  background: linear-gradient(160deg, #2c1d4f, #170f2e);
  border: 2px solid rgba(255, 43, 214, 0.4);
  border-radius: 10px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.14s var(--ease), border-color 0.15s, background-color 0.15s;
}
.m24-tile:active { transform: scale(0.94); }
.m24-tile.is-sel { border-color: var(--accent); background: linear-gradient(160deg, #4a3210, #24160a); transform: translateY(-4px); }
.m24-tile.is-new { animation: pop 0.24s var(--ease-back); }
.m24-int { line-height: 1; }
.m24-frac { display: inline-grid; justify-items: center; gap: 3px; line-height: 1; font-size: 0.62em; }
.m24-frac i { width: 100%; min-width: 1.2em; height: 2px; background: currentColor; }
.m24-ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m24-op {
  min-height: 56px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 28px;
  color: var(--accent);
  background: #21173c;
  border: 1px solid rgba(255, 182, 39, 0.3);
  border-radius: 6px;
  touch-action: manipulation;
  transition: opacity 0.15s, background-color 0.15s;
}
.m24-op:active { transform: scale(0.94); }
.m24-op.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.ch-m24:not(.has-sel) .m24-op { opacity: 0.55; }
.m24-status { min-height: 18px; text-align: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-dim); }
.m24-status.is-good { color: var(--green); }
.m24-status.is-warn { color: #ff8095; }
.m24-actions .btn { min-height: 44px; }
.m24-actions .btn:disabled { opacity: 0.4; }
.ch-m24.is-solved .m24-tile { border-color: var(--green); background: rgba(61, 255, 139, 0.18); color: var(--green); animation: win 0.6s var(--ease-back) both; }

/* compass */
.ch-compass { gap: 10px; margin: auto 0; }
.cp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 84px;
  padding: 8px 12px;
  text-align: center;
  background: rgba(16, 12, 34, 0.8);
  border: 1px solid rgba(255, 182, 39, 0.3);
}
.cp-card small { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: var(--text-dim); }
.cp-card b { font-family: var(--font-display); font-weight: 900; font-size: clamp(24px, 7.4vw, 32px); letter-spacing: 0.08em; color: var(--text); }
.cp-card.is-start b { color: var(--accent); }
.cp-card.is-turn { flex-direction: row; gap: 14px; border-color: var(--magenta); background: rgba(255, 43, 214, 0.1); }
.cp-card.is-gap > * { opacity: 0; }
.cp-card.is-ask { border-color: var(--accent); }
.cp-card.is-ask b { font-size: clamp(20px, 6vw, 26px); color: var(--accent); }
.cp-card.is-right { border-color: var(--green); background: rgba(61, 255, 139, 0.12); }
.cp-card.is-right b { color: var(--green); }
.cp-card.is-miss { border-color: var(--red); background: rgba(255, 51, 85, 0.12); }
.cp-card.is-miss b { color: #ff8095; font-size: clamp(18px, 5.6vw, 24px); }
.cp-card.tick { animation: count-tick 0.3s var(--ease) both; }
.cp-ico svg { display: block; width: 46px; height: 46px; fill: none; stroke: var(--magenta); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.cp-dots { display: flex; justify-content: center; gap: 6px; min-height: 8px; }
.cp-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); transition: background-color 0.15s; }
.cp-dots i.on { background: var(--magenta); }
.cp-grid {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-areas: '. n .' 'w r e' '. s .';
  align-items: center;
  justify-items: center;
  gap: 6px;
  width: min(100%, 360px);
  margin: 0 auto;
}
.cp-n { grid-area: n; }
.cp-e { grid-area: e; }
.cp-s { grid-area: s; }
.cp-w { grid-area: w; }
.cp-rose { grid-area: r; position: relative; width: min(100%, calc(100dvh - 520px), 230px); min-width: 150px; aspect-ratio: 1; }
.cp-rose svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cp-rose .ring { fill: rgba(10, 8, 24, 0.85); stroke: rgba(255, 182, 39, 0.55); stroke-width: 2; }
.cp-rose .ring2 { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.cp-rose .tk { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.5; }
.cp-rose .tk-b { stroke: var(--accent); stroke-width: 3; }
.cp-rose .star { fill: rgba(255, 182, 39, 0.08); stroke: rgba(255, 182, 39, 0.35); stroke-width: 1; }
.cp-rose .star2 { fill: rgba(255, 43, 214, 0.06); stroke: rgba(255, 43, 214, 0.3); stroke-width: 1; }
.cp-needle { position: absolute; inset: 0; transition: transform 0.55s var(--ease-back), opacity 0.25s; }
.cp-needle.is-hidden { opacity: 0; }
.cp-needle .nd-n { fill: var(--magenta); }
.cp-needle .nd-s { fill: #e9e2ff; }
.cp-needle .nd-hub { fill: #0a0818; stroke: var(--accent); stroke-width: 3; }
.cp-dir {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--text-dim);
  background: rgba(16, 12, 34, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.14);
  touch-action: manipulation;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s, transform 0.12s;
}
.cp-dir:disabled { cursor: default; }
.ch-compass.is-asking .cp-dir { color: #fff; border-color: var(--accent); background: rgba(255, 182, 39, 0.12); }
.ch-compass.is-asking .cp-dir:active { transform: scale(0.92); }
.cp-dir.is-correct { color: var(--bg-0); border-color: var(--green); background: var(--green); }
.cp-dir.is-wrong { color: #fff; border-color: var(--red); background: rgba(255, 51, 85, 0.5); animation: shake 0.4s; }

/* sort it */
.ch-sort { gap: 10px; margin: auto 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.st-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-side { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(16, 12, 34, 0.8); transition: border-color 0.15s, background-color 0.15s, transform 0.15s var(--ease); }
.st-side b { font-family: var(--font-display); font-weight: 800; font-size: clamp(12px, 3.5vw, 14px); letter-spacing: 0.06em; line-height: 1.2; color: var(--text); }
.st-side i { font-style: normal; font-size: 22px; }
.st-left { border-left: 3px solid var(--cyan); }
.st-right { justify-content: flex-end; text-align: right; border-right: 3px solid var(--magenta); }
.st-left i { color: var(--cyan); }
.st-right i { color: var(--magenta); }
.st-left.is-hot { border-color: var(--cyan); background: rgba(0, 240, 255, 0.12); transform: translateX(-3px); }
.st-right.is-hot { border-color: var(--magenta); background: rgba(255, 43, 214, 0.12); transform: translateX(3px); }
.st-count { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-dim); }
.st-tally { display: flex; gap: 12px; }
.st-tally .is-ok { color: var(--green); }
.st-tally .is-bad { color: #ff8095; }
.st-table { position: relative; height: clamp(190px, 34dvh, 290px); }
.st-deck { position: absolute; inset: 0; display: grid; place-items: center; }
.st-card {
  position: absolute;
  width: min(78%, 300px);
  height: 82%;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  background: linear-gradient(165deg, #2f2152, #1a1131 70%);
  border: 2px solid rgba(255, 182, 39, 0.5);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.25);
  will-change: transform;
}
.st-card span { font-family: var(--font-display); font-weight: 900; font-size: clamp(22px, 6.6vw, 30px); letter-spacing: 0.04em; line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.st-card::after { content: ''; position: absolute; inset: -2px; border-radius: 14px; pointer-events: none; opacity: var(--lean, 0); border: 3px solid transparent; }
.st-card[data-lean='l']::after { border-color: var(--cyan); background: linear-gradient(90deg, rgba(0, 240, 255, 0.18), transparent 60%); }
.st-card[data-lean='r']::after { border-color: var(--magenta); background: linear-gradient(270deg, rgba(255, 43, 214, 0.18), transparent 60%); }
.st-card.is-drag { transition: none; }
.st-card.is-in { animation: st-in 0.26s var(--ease-back) both; }
.st-card.is-back { transform: translateY(12px) scale(0.92); opacity: 0.5; border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
.st-card.is-out { transition: transform 0.26s cubic-bezier(0.3, 0.6, 0.4, 1), opacity 0.26s; opacity: 0; }
.st-card.is-right { border-color: var(--green); }
.st-card.is-wrong { border-color: var(--red); }
@keyframes st-in { from { opacity: 0; transform: translateY(14px) scale(0.92); } }
.st-flash { position: absolute; top: 0; bottom: 0; width: 45%; opacity: 0; pointer-events: none; }
.st-flash-l { left: 0; background: linear-gradient(90deg, var(--fc, transparent), transparent); }
.st-flash-r { right: 0; background: linear-gradient(270deg, var(--fc, transparent), transparent); }
.st-flash.is-ok { --fc: rgba(61, 255, 139, 0.4); }
.st-flash.is-bad { --fc: rgba(255, 51, 85, 0.45); }
.st-flash.on { animation: flash 0.45s ease-out; }
.st-bar { height: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--magenta), var(--accent)); transform-origin: 0 50%; }
.st-hint { text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--text-faint); }
.st-hint.is-warn { color: #ff8095; }

/* higher or lower */
.ch-hl { gap: 12px; }
.ch-hl.q-in .hl-opts { animation: q-in 0.32s var(--ease) both; }
.hl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hl-stat { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; color: var(--magenta); }
.hl-streak { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-mono); color: var(--text-dim); }
.hl-streak small { font-size: 10px; letter-spacing: 0.2em; }
.hl-streak b { font-family: var(--font-num); font-size: 30px; line-height: 1; color: var(--accent); }
.hl-streak span { font-family: var(--font-num); font-size: 13px; }
.hl-streak.tick b { animation: count-tick 0.4s var(--ease) both; }
.hl-ask { margin: 0; text-align: center; font-family: var(--font-display); font-weight: 900; font-size: clamp(18px, 5.4vw, 23px); letter-spacing: 0.04em; color: var(--text); }
.hl-opts { position: relative; display: flex; flex-direction: column; gap: 10px; }
.hl-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: clamp(92px, 15dvh, 130px);
  padding: 10px 14px;
  text-align: center;
  color: var(--text);
  background: linear-gradient(160deg, rgba(42, 28, 74, 0.92), rgba(18, 12, 38, 0.92));
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  touch-action: manipulation;
  transition: border-color 0.15s, background-color 0.15s, opacity 0.2s, transform 0.12s;
}
.hl-opt:active { transform: scale(0.98); }
.hl-name { font-weight: 700; font-size: clamp(18px, 5.2vw, 22px); line-height: 1.2; }
.hl-val { font-family: var(--font-num); font-weight: 700; font-size: 22px; color: var(--text-dim); }
.hl-val:empty { display: none; }
.hl-opt.is-shown .hl-val { animation: count-tick 0.35s var(--ease) both; }
.hl-opt.is-correct { border-color: var(--green); background: rgba(61, 255, 139, 0.14); }
.hl-opt.is-correct .hl-val { color: var(--green); }
.hl-opt.is-wrong { border-color: var(--red); background: rgba(255, 51, 85, 0.14); animation: shake 0.4s; }
.hl-opt.is-wrong .hl-val { color: #ff8095; }
.hl-opt.is-dim { opacity: 0.55; }
.hl-vs { position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%); padding: 3px 10px; font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.16em; color: var(--accent-ink); background: var(--accent); border-radius: 10px; pointer-events: none; }

/* ---- reveals ---- */
.rv-ml-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 10px; background: rgba(255, 255, 255, 0.04); border-left: 2px solid var(--accent); animation: q-in 0.35s var(--ease) both; }
.rv-ml-words { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-dim); }
.rv-ml-row i { font-style: normal; color: var(--accent); }
.rv-ml-row b { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: 0.08em; color: #fff; }
.rv-sp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rv-sp-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 5px 10px; background: rgba(255, 255, 255, 0.04); border-left: 2px solid var(--green); animation: q-in 0.3s var(--ease) both; }
.rv-sp-list b { font-family: var(--font-mono); font-size: 16px; color: var(--green); }
.rv-sp-list s { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); text-decoration-color: rgba(255, 51, 85, 0.8); }
.rv-m24-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255, 255, 255, 0.04); border-left: 2px solid var(--accent); animation: q-in 0.35s var(--ease) both; }
.rv-m24-tiles { display: flex; gap: 3px; }
.rv-m24-tiles i { display: grid; place-items: center; width: 22px; height: 24px; font-style: normal; font-family: var(--font-num); font-weight: 700; font-size: 14px; color: #fff; background: #2a1c4a; border-radius: 4px; }
.rv-m24-sol { font-family: var(--font-num); font-size: 16px; color: #fff; }
.rv-m24-row small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-faint); }
.rv-cp-list { display: flex; flex-direction: column; gap: 5px; }
.rv-cp-row { display: grid; grid-template-columns: 20px 34px 1fr 26px; align-items: center; gap: 10px; padding: 4px 10px; background: rgba(255, 255, 255, 0.04); animation: q-in 0.3s var(--ease) both; }
.rv-cp-start { font-family: var(--font-display); font-weight: 900; font-size: 15px; color: var(--accent); text-align: center; }
.rv-cp-rose { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 182, 39, 0.5); background: rgba(10, 8, 24, 0.9); }
.rv-cp-needle { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 8px; margin-left: -4px; background: linear-gradient(var(--magenta) 50%, #e9e2ff 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transition: transform 0.36s var(--ease-back); }
.rv-cp-turns { display: flex; flex-wrap: wrap; gap: 3px; }
.rv-cp-turns span { padding: 1px 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--text-faint); border: 1px solid rgba(255, 255, 255, 0.12); transition: color 0.2s, border-color 0.2s; }
.rv-cp-turns span.on { color: #ff7ce6; border-color: rgba(255, 43, 214, 0.6); }
.rv-cp-out { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--text-faint); text-align: center; transition: color 0.2s; }
.rv-cp-out.on { color: var(--green); animation: count-tick 0.4s var(--ease) both; }
.rv-st-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rv-st-col { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.rv-st-label { width: 100%; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--cyan); margin-bottom: 2px; }
.rv-st-col + .rv-st-col .rv-st-label { color: #ff7ce6; }
.rv-st-chip { padding: 2px 7px; font-size: 12px; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); animation: q-in 0.3s var(--ease) both; }
.rv-st-chip.is-miss { color: #ffb3c0; border-color: rgba(255, 51, 85, 0.7); background: rgba(255, 51, 85, 0.15); }
.rv-st-note { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: #ff8095; }
.rv-hl-sub { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-dim); }
.rv-hl-pair { display: flex; flex-direction: column; gap: 5px; animation: q-in 0.35s var(--ease) both 0.3s; }
.rv-hl-ask { font-weight: 700; font-size: 14px; color: var(--text); }
.rv-hl-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: rgba(255, 255, 255, 0.04); border-left: 2px solid rgba(255, 255, 255, 0.2); }
.rv-hl-item span { font-weight: 700; font-size: 14px; color: var(--text-dim); }
.rv-hl-item b { font-family: var(--font-num); font-size: 15px; color: var(--text-dim); white-space: nowrap; }
.rv-hl-item.is-win { border-left-color: var(--green); }
.rv-hl-item.is-win span, .rv-hl-item.is-win b { color: var(--green); }

@media (max-height: 700px) {
  .ml-word { min-height: 40px; }
  .sp-opt { min-height: 54px; }
  .m24-tiles { min-height: 80px; }
  .cp-card { min-height: 66px; }
  .hl-opt { min-height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .ml-word, .ml-cell, .sp-opt.is-wrong, .m24-tile, .m24-tiles, .cp-card.tick, .cp-dir.is-wrong, .st-card.is-in, .hl-opt.is-wrong,
  .hl-opt.is-shown .hl-val, .rv-ml-row, .rv-sp-list li, .rv-m24-row, .rv-cp-row, .rv-st-chip, .rv-hl-pair, .rv-cp-out.on { animation: none !important; }
  .cp-needle, .rv-cp-needle, .st-card { transition-duration: 0.01s !important; }
}
