/* Smarts — a pocket quiz-show.
   Cobalt stage, paper cards that sit on a solid ledge and press down when tapped,
   a marigold fuse for the clock. Bagel Fat One only for the logo and big numbers. */

:root {
  --cobalt: #2a3bd1;
  --cobalt-deep: #1b2799;
  --cobalt-ink: #131c6e;
  --cobalt-soft: #3a4be0;
  --paper: #fbfbf8;
  --paper-2: #eef0f7;
  --ink: #141833;
  --ink-2: #555b7a;
  --line: #dfe2ee;
  --marigold: #ffc531;
  --marigold-deep: #d99a00;
  --mint: #17b877;
  --mint-deep: #0d8a57;
  --coral: #ff5446;
  --coral-deep: #c9342a;
  --on-cobalt: #ffffff;
  --on-cobalt-2: rgba(255, 255, 255, 0.72);

  --font-ui: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-show: 'Bagel Fat One', 'Schibsted Grotesk', ui-rounded, system-ui, sans-serif;
  --font-code: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

  --r-card: 24px;
  --r-btn: 16px;
  --ledge: 0 5px 0 var(--cobalt-deep);
  --ledge-pressed: 0 1px 0 var(--cobalt-deep);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Reading direction: Hebrew and Arabic flip these (see [dir="rtl"] below). */
  --start: left;
  --end: right;
  --flip: 1;
  --col: 480px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--cobalt);
  color: var(--on-cobalt);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
code { font-family: var(--font-code); font-size: 0.9em; }

:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 3px;
  border-radius: 8px;
}

.screen {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 18px calc(28px + var(--safe-b));
}
.has-tabbar { padding-bottom: calc(96px + var(--safe-b)); }

/* ── Type ─────────────────────────────────────────────────────── */

.logo {
  font-family: var(--font-show);
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.005em;
  color: var(--on-cobalt);
}
.logo-xl { font-size: clamp(64px, 20vw, 92px); margin: 0; }
a.logo { text-decoration: none; }

.greeting {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 26px 0 6px;
}
.sub { margin: 0; color: var(--on-cobalt-2); }

.section-title {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 30px 0 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.topbar-start { display: flex; align-items: center; gap: 4px; }
/* The Back arrow points the way the screen came from: left, or right in Hebrew and Arabic. */
.back-btn svg { width: 26px; height: 26px; transform: scaleX(var(--flip)); }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  --bg: var(--paper);
  --fg: var(--ink);
  --edge: var(--cobalt-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--fg);
  font-weight: 750;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--edge);
  transform: translateY(0);
  transition: transform 80ms ease, box-shadow 80ms ease;
  user-select: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.btn-block { display: flex; width: 100%; }
.btn-marigold { --bg: var(--marigold); --fg: var(--ink); --edge: var(--marigold-deep); }
.btn-coral { --bg: var(--coral); --fg: #fff; --edge: var(--coral-deep); }
.btn-paper { --bg: var(--paper); }
.btn-ghost {
  background: transparent;
  color: var(--on-cobalt);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.btn-ghost:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.btn-ghost-ink {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn-ghost-ink:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--line); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-start: -10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--on-cobalt);
}
.icon-btn:active { background: rgba(255, 255, 255, 0.12); }

/* ── Boot ────────────────────────────────────────────────────── */

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot .logo { font-size: 44px; opacity: 0.9; }

/* ── Sign in ─────────────────────────────────────────────────── */

.signin {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: max(20px, env(safe-area-inset-top));
}

/* Logo with a small tilted question card beside it, then one line on what this is.
   Kept short so the sign-in card below is on screen without scrolling. */
.signin-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 18px;
  margin-top: auto; /* with .signin-actions' margin-bottom, centres the content on tall screens */
}
.signin-head .logo-xl { font-size: clamp(46px, 14vw, 80px); }
.signin-head .lede { grid-column: 1 / -1; }
/* Short phones: drop the decoration so the sign-in button stays above the fold. */
@media (max-height: 640px) {
  .signin { gap: 16px; }
  .signin-head .demo-card { display: none; }
  .signin-head .lede { font-size: 16px; }
}

.demo-card {
  width: clamp(118px, 34vw, 150px);
  padding: 9px 9px 10px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--cobalt-deep);
  transform: rotate(6deg);
  animation: deal 700ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}
.demo-fuse {
  height: 6px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
  margin-bottom: 8px;
}
.demo-fuse span {
  display: block;
  height: 100%;
  width: 62%;
  border-radius: 8px;
  background: var(--marigold);
  transform-origin: var(--start);
  animation: burn 15s linear infinite;
}
.demo-pic {
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border-radius: 11px;
  padding: 10px 0;
}
.demo-pic svg { width: 46%; height: auto; }
.demo-options { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.demo-options li {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.demo-options li.is-correct { background: var(--mint); color: #fff; box-shadow: none; }

@keyframes deal {
  from { opacity: 0; transform: translateY(30px) rotate(14deg); }
  to { opacity: 1; transform: translateY(0) rotate(6deg); }
}
@keyframes burn { from { transform: scaleX(1); } to { transform: scaleX(0.05); } }

.lede { margin: 0; font-size: 18px; line-height: 1.5; color: var(--on-cobalt-2); max-width: 34ch; }

.signin-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: auto; padding-bottom: 8px; }

/* The one thing to do on this screen: a paper card that says so, with Google's button in it. */
.signin-card {
  display: grid;
  gap: 6px;
  padding: 22px 20px 20px;
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--cobalt-deep);
  text-align: center;
  animation: banner-in 400ms 150ms ease both;
}
.signin-card h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.signin-card p { margin: 0 0 12px; font-size: 16px; color: var(--ink-2); }
:root:lang(he) .signin-card h2, :root:lang(ar) .signin-card h2 { font-weight: 700; }

/* Inside WhatsApp, Instagram and the like: the way out to the phone's own browser. */
.inapp-card { gap: 10px; }
.inapp-card p { margin: 0 0 4px; }
.inapp-steps { margin: 0 0 4px; padding-inline-start: 22px; display: grid; gap: 6px; text-align: start; font-weight: 600; }
.inapp-card .btn svg { width: 20px; height: 20px; }
.inapp-card p.inapp-status { min-height: 1.2em; margin: 0; font-size: 14px; }
.inapp-card .inapp-try { justify-self: center; color: var(--ink-2); }
.google-btn[hidden] { display: none; }

.google-btn { position: relative; min-height: 44px; display: flex; justify-content: center; color-scheme: light; }
/* Until Google's script has drawn the button, hold its place with a soft pill. */
.google-btn:not(.is-ready)::before {
  content: '';
  width: min(100%, 400px);
  height: 44px;
  border-radius: 999px;
  background: var(--paper-2);
  animation: pulse 1.2s ease-in-out infinite alternate;
}
@keyframes pulse { to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .signin-card, .google-btn::before { animation: none; }
}

.note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--cobalt-ink);
  color: var(--on-cobalt-2);
  font-size: 15px;
}
.note code { color: #fff; }

.dev-login { display: grid; gap: 8px; }
.dev-login label { font-size: 14px; color: var(--on-cobalt-2); }
.dev-row { display: flex; gap: 10px; }
.dev-row input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--r-btn);
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 17px;
}
.dev-row input::placeholder { color: rgba(255, 255, 255, 0.55); }
.dev-row input:focus { outline: none; border-color: var(--marigold); }

.error-text { color: #ffd2cd; margin: 0; font-weight: 600; }
.center-screen { min-height: 100dvh; display: grid; place-items: center; text-align: center; }

/* ── Home ────────────────────────────────────────────────────── */

.avatar-link { border-radius: 50%; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.topbar .avatar { width: 36px; height: 36px; }
.avatar-initial {
  display: grid;
  place-items: center;
  background: var(--marigold);
  color: var(--ink);
  font-family: var(--font-show);
  font-size: 18px;
  box-shadow: none;
}

.quick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 120px;
  margin-top: 22px;
  padding: 24px 18px 24px 22px;
  border-radius: var(--r-card);
  background: var(--marigold);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 7px 0 var(--marigold-deep);
  transition: transform 80ms ease, box-shadow 80ms ease;
  -webkit-tap-highlight-color: transparent;
}
.quick:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--marigold-deep); }
.quick-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.quick-text strong { font-family: var(--font-show); font-weight: 400; font-size: clamp(30px, 9vw, 38px); line-height: 1.02; }
.quick-text span { font-weight: 650; opacity: 0.8; }
/* A real button inside the card, so it's obvious the card can be tapped. */
.quick-go {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 60px;
  padding: 0 18px 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--marigold);
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 0 rgba(20, 24, 51, 0.45);
}
.quick-go svg { width: 22px; height: 22px; }

/* ── Home: one big button, quieter rows ──────────────────────── */

/* The main action is shaped like a button, not a banner: a label that starts with a verb,
   a caption, and the ledge every button here has. Marigold is kept for this one thing. */
.play-cta {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 22px;
  padding: 20px 18px 18px;
  border-radius: var(--r-card);
  background: var(--marigold);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 7px 0 var(--marigold-deep);
  transition: transform 80ms ease, box-shadow 80ms ease;
  -webkit-tap-highlight-color: transparent;
}
.play-cta:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--marigold-deep); }
.play-cta-label { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.play-cta-label svg { flex: none; width: 26px; height: 26px; stroke-width: 2.6; transform: scaleX(var(--flip)); }
.play-cta-sub { font-size: 15px; font-weight: 600; color: rgba(20, 24, 51, 0.72); }
:root:lang(he) .play-cta-label, :root:lang(ar) .play-cta-label { font-weight: 700; }

/* "How it works", for players who haven't finished a round. */
.how { margin-top: 18px; padding: 16px 14px; border-radius: var(--r-card); background: var(--paper); color: var(--ink); }
.how-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--ink-2); text-align: center; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.how li { display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; font-size: 14px; font-weight: 650; line-height: 1.3; }
.how-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--cobalt); color: #fff; font-family: var(--font-show); font-size: 17px; line-height: 1; }
.challenge-card .how { width: 100%; margin: 4px 0; background: var(--paper-2); }

.home-rows { display: grid; gap: 12px; margin-top: 22px; }
.home-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: start;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--cobalt-deep);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.home-row:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cobalt-deep); }
.home-row-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--paper-2); color: var(--cobalt); }
.home-row-icon svg { width: 24px; height: 24px; }
.home-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.home-row-text strong { font-size: 17px; font-weight: 750; line-height: 1.25; }
.home-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-row-sub { font-size: 14px; color: var(--ink-2); }
.home-row-badge { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--cobalt); color: #fff; font-size: 13px; font-weight: 750; white-space: nowrap; }
.home-row-chevron { flex: none; color: var(--ink-2); }
.home-row-chevron svg { width: 20px; height: 20px; transform: scaleX(var(--flip)); }
.home-new .home-row { margin-top: 20px; }

.home-or { margin: 28px 0 10px; font-size: 15px; font-weight: 650; color: var(--on-cobalt-2); text-align: center; }
.topic-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.topic-tile { display: grid; gap: 6px; min-width: 0; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; }
.topic-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--hue); box-shadow: 0 4px 0 var(--cobalt-deep); }
.home-new .topics { margin-top: 18px; }
.topics[hidden] { display: none; }

/* After the first round: what the home screen just gained. Shown once. */
.unlocked { margin: 18px 0 0; padding: 12px 16px; border-radius: 16px; background: var(--cobalt-ink); font-size: 15px; font-weight: 650; text-align: center; }
.home .sub svg { display: inline-block; width: 18px; height: 18px; margin-inline-end: 4px; vertical-align: -3px; color: var(--marigold); }

/* The first question a new player sees says what to do. */
.first-hint { margin: 0 2px 12px; font-weight: 700; color: var(--marigold); }

/* A past mistake coming back in a Quick round. Sits over the card, so the layout doesn't move. */
.stage { position: relative; }
.retry-chip { position: absolute; z-index: 2; top: 10px; inset-inline-end: 10px; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--marigold); color: var(--ink); font-size: 13px; font-weight: 750; }


.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* Folded: only the first three topics (TOPIC_PREVIEW in app.js) show. */
.topics.is-folded > li:nth-child(n + 4) { display: none; }

/* "See all 26 topics": an outlined pill under the preview, plainly a button. */
.see-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 12px 18px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.see-all:hover { background: rgba(255, 255, 255, 0.16); }
.see-all:active { transform: scale(0.98); }
.see-all:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }
/* A chevron pointing down; turns up once the list is open. */
.see-all-arrow {
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.see-all[aria-expanded="true"] .see-all-arrow { transform: rotate(-135deg); margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .see-all, .see-all-arrow { transition: none; } }
.topic {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--ledge);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.topic:active { transform: translateY(4px); box-shadow: var(--ledge-pressed); }
.topic-photo { flex: none; position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--hue); }
.topic-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.topic-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(20, 24, 51, 0.12); }
.topic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-inline-end: 6px; }
.topic-text strong { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.2; }
.topic-blurb { min-width: 0; font-size: 14px; line-height: 1.25; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-meter { display: flex; align-items: center; gap: 10px; }
.topic-count { flex: none; font-weight: 750; font-variant-numeric: tabular-nums; font-size: 15px; }
.topic-meter .meter { flex: 1; width: auto; background: #d5d9e8; }
.topic-count small { font-size: 13px; color: var(--ink-2); font-weight: 600; }

.meter { display: block; width: 100%; height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--hue, var(--cobalt)); min-width: 0; }

/* ── Tab bar ─────────────────────────────────────────────────── */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 6px 24px rgba(10, 14, 60, 0.35);
  z-index: 10;
}
.tabbar a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 700;
}
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a.is-active { background: var(--paper); color: var(--ink); }

/* ── Play ────────────────────────────────────────────────────── */

.play {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(16px + var(--safe-b));
}

.play-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.pips { flex: 1; display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.pips li {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  transition: background-color 200ms ease;
}
.pips li.is-current { background: rgba(255, 255, 255, 0.85); }
.pips li.is-right { background: var(--mint); }
.pips li.is-wrong { background: var(--coral); }
.pips li.is-skipped { background: rgba(255, 255, 255, 0.45); }
.play-score {
  min-width: 52px;
  text-align: end;
  font-family: var(--font-show);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* The fuse: the clock for every question. */
.fuse-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
}
.fuse {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 12px;
  background: var(--cobalt-ink);
}
.fuse-fill {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--marigold);
  transform-origin: var(--start) center;
}
.fuse-spark {
  position: absolute;
  top: 50%;
  inset-inline-start: 100%;
  width: 22px;
  height: 22px;
  margin-block-start: -11px;
  margin-inline-start: -11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 22%, #fff3c4 36%, rgba(255, 197, 49, 0.55) 56%, rgba(255, 197, 49, 0) 72%);
  animation: flicker 160ms steps(2) infinite;
}
.fuse-secs {
  width: 34px;
  text-align: end;
  font-family: var(--font-show);
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fuse-row.is-low .fuse-fill { background: var(--coral); }
.fuse-row.is-low .fuse-spark { background: radial-gradient(circle, #fff 0 22%, #ffd0cb 36%, rgba(255, 84, 70, 0.6) 56%, rgba(255, 84, 70, 0) 72%); }
.fuse-row.is-low .fuse-secs { color: #ffd0cb; }
.fuse-row.is-done .fuse-spark,
.fuse-row.is-waiting .fuse-spark { display: none; }
.fuse-row.is-waiting .fuse-fill { background: rgba(255, 255, 255, 0.28); }

@keyframes flicker { 50% { transform: scale(0.82); } }

.stage { display: flex; flex-direction: column; flex: 1; }
.stage.enter .pic { animation: card-in 260ms cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.pic {
  position: relative;
  margin: 0;
  height: min(calc((100vw - 36px) * 0.7), 34dvh, 320px);
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: 0 6px 0 var(--cobalt-deep);
  overflow: hidden;
  color: var(--ink);
  container-type: size;
}
/* One grid cell exactly the size of the card. The fixed track size matters: Safari resolves a
   child's percentage height against an auto-sized row as the image's own size, so a large
   photo would overflow and sit below the card. Pictures that fill the card are also pinned
   with absolute positioning, which every browser sizes the same way. */
.vis { position: absolute; inset: 0; display: grid; grid-template: minmax(0, 100%) / minmax(0, 100%); place-items: center; }

.vis-flag { background: var(--paper-2); padding: 12%; }
.flag-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(20, 24, 51, 0.12), 0 6px 18px rgba(20, 24, 51, 0.16);
  background: #fff;
}

.vis-sign { background: var(--paper-2); }
.vis-sign svg { height: 74%; width: auto; filter: drop-shadow(0 4px 8px rgba(20, 24, 51, 0.18)); }
.vis-sign .sign-img { position: absolute; inset: 13%; width: 74%; height: 74%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(20, 24, 51, 0.18)); }

.vis-code { background: #0f1430; place-items: stretch; padding: 18px 20px; overflow: auto; direction: ltr; text-align: left; }
.vis-code pre {
  margin: auto 0;
  align-self: center;
  color: #e9ebff;
  font-family: var(--font-code);
  /* Fit the longest line to the card width (--cols is set per snippet). */
  font-size: clamp(11px, calc((100cqw - 40px) / (var(--cols, 32) * 0.62)), 16px);
  line-height: 1.6;
  white-space: pre;
  tab-size: 4;
}

.vis-map { background: #0b2340; overflow: hidden; }
.map-tiles { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.map-tiles img { position: absolute; width: 128px; height: 128px; max-width: none; user-select: none; }
.map-marker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.map-marker::before,
.map-marker span {
  content: '';
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.map-marker span { background: var(--marigold); box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px rgba(255, 255, 255, 0.9); }
.map-marker::before { border: 3px solid var(--marigold); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(3.4); opacity: 0; } }
.map-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ring);
  height: var(--ring);
  margin: calc(var(--ring) / -2) 0 0 calc(var(--ring) / -2);
  border-radius: 50%;
  border: 3px dashed var(--marigold);
  box-shadow: 0 0 0 2px rgba(20, 24, 51, 0.55), inset 0 0 0 2px rgba(20, 24, 51, 0.55);
}
.vis-element { background: var(--paper-2); }
.vis-element svg { height: 76%; width: auto; filter: drop-shadow(0 6px 10px rgba(20, 24, 51, 0.2)); }
.map-credit,
.photo-credit {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.vis-photo { background: var(--paper-2); }
.photo-backdrop {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.1) brightness(0.9);
}
.photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.vis-logo { background: #fff; }
.vis-logo .photo-img { inset: 16%; width: 68%; height: 68%; }
.vis-logo .photo-credit { color: var(--ink-2); text-shadow: none; }
.photo-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--paper-2) 30%, #fff 50%, var(--paper-2) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.photo-missing { display: grid; gap: 4px; padding: 24px; text-align: center; color: var(--ink-2); }
.photo-missing strong { color: var(--ink); }

.prompt {
  margin: 18px 2px 12px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.answers { display: grid; gap: 9px; padding-bottom: 92px; }
.answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  text-align: start;
  line-height: 1.25;
  box-shadow: var(--ledge);
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 160ms ease, opacity 160ms ease;
}
.answer:disabled { cursor: default; }
.answer:not(:disabled):active { transform: translateY(4px); box-shadow: var(--ledge-pressed); }
.answer kbd {
  display: none;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 700 13px var(--font-ui);
}
@media (hover: hover) and (pointer: fine) {
  .answer kbd { display: grid; }
  .answer:not(:disabled):hover { background: #fff; }
}
.answer.is-picked { box-shadow: 0 0 0 3px var(--marigold, #ffc53d), var(--ledge-pressed); transform: translateY(4px); }
.answer.is-correct { background: var(--mint); color: #fff; box-shadow: 0 5px 0 var(--mint-deep); animation: pop 260ms ease; }
.answer.is-wrong { background: var(--coral); color: #fff; box-shadow: 0 5px 0 var(--coral-deep); animation: shake 300ms ease; }
.answer.is-correct kbd, .answer.is-wrong kbd { background: rgba(255, 255, 255, 0.22); color: #fff; }
.answer.is-dim { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.78); box-shadow: none; }
.answer.is-dim kbd { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.7); }
@keyframes pop { 50% { transform: scale(1.025); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Result dock: sits at the bottom, under the thumb. */
.dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: var(--col);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px calc(14px + var(--safe-b));
  background: var(--ink);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 30px rgba(10, 14, 60, 0.3);
  animation: dock-up 220ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  z-index: 20;
}
.dock[hidden] { display: none; }
.dock .btn { flex: none; min-width: 120px; }
.dock-msg { flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; line-height: 1.3; }
.dock-msg svg { flex: none; width: 28px; height: 28px; padding: 4px; border-radius: 50%; }
.dock-msg.is-right svg { background: var(--mint); }
.dock-msg.is-wrong svg { background: var(--coral); }
.dock-msg { min-width: 0; }
.dock-msg b { font-weight: 800; white-space: nowrap; }
.dock-msg b.is-long { white-space: normal; }
.dock-msg > span { min-width: 0; overflow-wrap: anywhere; }
@keyframes dock-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

.sheet-scrim {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  background: rgba(10, 14, 50, 0.55);
  z-index: 30;
}
.sheet-scrim[hidden] { display: none; }
.sheet {
  width: 100%;
  max-width: var(--col);
  padding: 24px 20px calc(22px + var(--safe-b));
  background: var(--paper);
  color: var(--ink);
  border-radius: 28px 28px 0 0;
  animation: dock-up-plain 220ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.sheet p { margin: 0 0 20px; color: var(--ink-2); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.levelup-sheet { display: grid; justify-items: center; text-align: center; padding-top: 44px; }
.levelup-sheet .cover { margin-block-end: 34px; }
.levelup-sheet h2 { font-family: var(--font-show); font-weight: 400; font-size: 34px; color: var(--cobalt); }
.levelup-sheet p { margin-bottom: 10px; }
.levelup-new { margin: 6px 0 8px; font-size: 14px; font-weight: 750; color: var(--ink-2); }
.levelup-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-height: 40dvh; margin: 0 0 14px; padding: 0 0 6px; overflow-y: auto; list-style: none; }
.levelup-items li { display: grid; justify-items: center; gap: 4px; width: 84px; font-size: 14px; font-weight: 750; }
.levelup-sheet .sheet-actions { width: 100%; }
@keyframes dock-up-plain { from { transform: translateY(100%); } to { transform: none; } }

/* ── Results ─────────────────────────────────────────────────── */

.score-hero { text-align: center; padding: 26px 0 8px; }
.score-big {
  margin: 0;
  font-family: var(--font-show);
  font-size: clamp(88px, 30vw, 128px);
  line-height: 0.95;
  color: var(--marigold);
  text-shadow: 0 6px 0 var(--cobalt-deep);
  font-variant-numeric: tabular-nums;
  animation: deal-score 520ms cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}
@keyframes deal-score { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.score-line { margin: 14px 0 0; font-size: 18px; }
.score-hero .eyebrow { margin: 0 0 8px; }
.score-big small { font-size: 0.38em; color: var(--on-cobalt-2); text-shadow: none; }
.score-unit { margin: 6px 0 0; font-size: 16px; font-weight: 700; color: var(--on-cobalt-2); }
.score-squares { display: flex; justify-content: center; margin-top: 14px; }
.score-squares .squares { margin: 0; }
/* How the points add up: 1 per right answer, the rest from speed. */
.score-sum {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px 28px;
  margin: 16px 0 0;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--cobalt-ink);
  text-align: start;
}
.score-sum div { display: contents; }
.score-sum dt { color: var(--on-cobalt-2); }
.score-sum dd { margin: 0; font-weight: 800; text-align: end; }
.score-how { max-width: 34ch; margin: 10px auto 0; font-size: 14px; color: var(--on-cobalt-2); }
@media (prefers-reduced-motion: reduce) { .score-big { animation: none; } }

/* Right after a first round: the Daily it just unlocked. */
.unlocked-card { display: grid; justify-items: center; gap: 8px; margin-top: 22px; text-align: center; }
.unlocked-card h2 { margin: 4px 0 0; font-size: 20px; }
.unlocked-card p { margin: 0 0 6px; color: var(--ink-2); }
.unlocked-link { padding: 8px 12px; font-weight: 750; color: var(--cobalt); }

/* A row of the answers list: the picture with a right/wrong badge, what you said, the answer, the points. */
.review-thumb {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--hue, var(--cobalt));
  color: #fff;
}
.review-thumb > svg { width: 26px; height: 26px; }
.thumb-img, .thumb-svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; background: var(--paper-2); }
.thumb-img { object-fit: cover; }
.thumb-img.is-contain { object-fit: contain; padding: 5px; }
.thumb-svg { display: grid; place-items: center; padding: 7px; }
.thumb-svg svg { width: 100%; height: 100%; }
.review-thumb .review-mark { position: absolute; bottom: -5px; inset-inline-end: -5px; width: 22px; height: 22px; box-shadow: 0 0 0 2px var(--paper); }
.review-thumb .review-mark svg { width: 14px; height: 14px; }
.review-text .review-q { display: -webkit-box; overflow: hidden; font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } /* long text prompts: two lines */
.review-text .review-you { color: var(--coral-deep); font-weight: 650; }
.review-you bdi { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.review .pts-pill { flex: none; min-width: 40px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.save-state { min-height: 1.4em; margin: 16px 0 0; font-size: 14px; color: var(--on-cobalt-2); }
.save-state.is-error { color: #ffd2cd; }

.results-actions { display: grid; gap: 14px; margin-top: 18px; }

.review { list-style: none; margin: 0; padding: 0; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: var(--ledge); overflow: hidden; }
.review li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.review li + li { border-top: 1px solid var(--line); }
.review-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; }
.review-mark svg { width: 18px; height: 18px; }
.is-right .review-mark { background: var(--mint); }
.is-wrong .review-mark, .is-timeout .review-mark, .is-left .review-mark, .is-away .review-mark { background: var(--coral); }
.is-skipped .review-mark { background: var(--line); color: var(--ink-2); }
.review-text { flex: 1; min-width: 0; display: grid; }
.review-text strong { font-weight: 700; }
.review-text span { font-size: 14px; color: var(--ink-2); }

/* ── Progress ────────────────────────────────────────────────── */

.panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--ledge);
}
.panel-title { margin: 0 0 14px; font-size: 17px; font-weight: 750; }

.hero-panel { padding: 22px 20px 20px; }
.hero-num { margin: 0; font-family: var(--font-show); font-size: 72px; line-height: 0.95; color: var(--cobalt); }
.hero-label { margin: 8px 0 14px; color: var(--ink-2); font-size: 16px; }
.hero-label b { color: var(--ink); }
.acc-bar { height: 10px; border-radius: 10px; background: var(--paper-2); overflow: hidden; }
.acc-bar span { display: block; height: 100%; border-radius: 10px; background: var(--mint); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 0; }
.facts div { padding: 14px 16px; border-radius: 18px; background: var(--cobalt-ink); }
.facts dt { font-size: 13px; color: var(--on-cobalt-2); }
.facts dd { margin: 4px 0 0; font-family: var(--font-show); font-size: 30px; line-height: 1; }
.facts dd small { font-family: var(--font-ui); font-size: 14px; color: var(--on-cobalt-2); font-weight: 600; }

.days { display: flex; align-items: flex-end; gap: 5px; height: 96px; }
.day { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.day-bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  min-height: 4px;
  border-radius: 5px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.day-bar > span { display: block; width: 100%; background: var(--mint); }
.days-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.legend { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw-right { background: var(--mint); }
.sw-all { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); margin-inline-start: 10px; }

.cat-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cat-stats li { display: flex; gap: 12px; align-items: flex-start; }
.cat-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--hue); color: #fff; }
.cat-icon svg { width: 20px; height: 20px; }
.cat-body { flex: 1; display: grid; gap: 6px; }
.cat-head { display: flex; justify-content: space-between; gap: 8px; }
.cat-head strong { font-weight: 700; }
.cat-head span { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cat-acc { font-size: 13px; color: var(--ink-2); }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent-icon { color: var(--ink-2); }
.recent-text { flex: 1; display: grid; }
.recent-text strong { font-weight: 700; }
.recent-text span { font-size: 14px; color: var(--ink-2); }
.recent-score { font-family: var(--font-show); font-size: 22px; color: var(--cobalt); }

.empty p { margin: 0 0 16px; }

.account { display: grid; gap: 12px; margin-top: 28px; color: var(--on-cobalt-2); font-size: 15px; }
.account p { margin: 0; }
.account strong { color: #fff; }
.account-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.link-btn {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--on-cobalt-2);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:disabled { opacity: 0.5; cursor: default; }
.link-danger { color: #ffb4b4; }

/* ── Short phones (iPhone SE and similar) ───────────────────── */

@media (max-height: 740px) {
  .play-top { min-height: 40px; }
  .fuse-row { margin: 8px 0 10px; }
  .pic { height: min(calc((100vw - 36px) * 0.6), 27dvh); }
  .prompt { margin: 12px 2px 10px; font-size: 18px; }
  .answers { gap: 8px; }
  .answer { min-height: 46px; padding: 8px 16px; font-size: 16px; }
}

/* ── Larger screens ──────────────────────────────────────────── */

@media (min-width: 720px) {
  .screen { padding-left: 24px; padding-right: 24px; }
  .play { padding-top: 28px; }
  .pic { height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .fuse-spark { animation: none; }
  .map-marker::before { display: none; }
}

/* ── Auto next ───────────────────────────────────────────────── */

.auto-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px 0 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--on-cobalt);
  font-size: 14px;
  font-weight: 700;
}
.auto-switch {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background-color 150ms ease;
}
.auto-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}
.auto-toggle.is-on .auto-switch { background: var(--mint); }
.auto-toggle.is-on .auto-switch::after { transform: translateX(calc(12px * var(--flip))); }
.auto-toggle:not(.is-on) { color: var(--on-cobalt-2); }
.auto-label { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The Next button fills up while auto next counts down. */
.btn-next { position: relative; overflow: hidden; isolation: isolate; }
.btn-next > span { position: relative; z-index: 1; }
.btn-next::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 51, 0.16);
  transform: scaleX(0);
  transform-origin: var(--start) center;
  z-index: 0;
}
.btn-next.is-counting::before { animation: auto-fill var(--auto-ms, 1200ms) linear forwards; }
@keyframes auto-fill { to { transform: scaleX(1); } }

/* Settings on the progress page */
.setting { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.setting > span { flex: 1; display: grid; gap: 2px; }
.setting strong { font-weight: 700; }
.setting > span > span { font-size: 14px; color: var(--ink-2); }
.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 50px;
  height: 30px;
  margin: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background-color 150ms ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 51, 0.3);
  transition: transform 150ms ease;
}
.switch:checked { background: var(--mint); }
.switch:checked::after { transform: translateX(calc(20px * var(--flip))); }

.answer { scroll-margin-bottom: 110px; }

@media (max-width: 340px) {
  .auto-toggle .auto-label { display: none; }
}
.sheet .setting + .setting-range { margin-top: 16px; }
.sheet .setting { margin-top: 4px; }
.sheet-done { margin-top: 22px; }

/* ── Waiting, paused and hidden states ───────────────────────── */

/* Options appear with the picture, so nobody reads them early. */
.answers.is-waiting .answer { visibility: hidden; }
.stage.enter .answers:not(.is-waiting) { animation: fade-in 160ms ease both; }

.fuse-row.is-paused .fuse-spark { display: none; }
.fuse-row.is-paused .fuse-fill { background: rgba(255, 255, 255, 0.4); }

/* While the app is in the background the question is hidden. */
.play.is-hidden .stage,
.play.is-hidden .dock { display: none; }
.paused-note {
  margin: 40px auto 0;
  max-width: 28ch;
  text-align: center;
  color: var(--on-cobalt-2);
  font-weight: 600;
}
.paused-note[hidden] { display: none; }

/* No double-tap zoom on fast taps. */
button, a, .answer { touch-action: manipulation; }

/* The auto-next fill tells you what's about to happen, so it stays even with reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .btn-next.is-counting::before { animation-duration: var(--auto-ms, 1200ms) !important; }
}

/* ── Landscape phones: picture left, answers right ───────────── */

@media (orientation: landscape) and (max-height: 520px) {
  .screen.play { max-width: 900px; padding-top: max(8px, env(safe-area-inset-top)); }
  .fuse-row { margin: 6px 0 10px; }
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 18px;
    align-items: start;
  }
  .stage .pic { grid-row: 1 / span 2; height: calc(100dvh - 96px); }
  .stage .prompt { margin: 0 0 8px; font-size: 17px; }
  .answers { gap: 7px; padding-bottom: 80px; }
  .answer { min-height: 42px; padding: 6px 14px; font-size: 15px; }
  .dock { max-width: 900px; padding-top: 10px; padding-bottom: calc(10px + var(--safe-b)); }
}

/* Auto-next delay slider */
.setting-range { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); cursor: default; }
.setting-range label { display: grid; gap: 2px; }
.setting-range label > span { font-size: 14px; color: var(--ink-2); }
.setting-range.is-off { opacity: 0.45; }

/* A setting with a few named choices, as a row of pills (the Back button). */
.setting-choice { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); cursor: default; }
.choice { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); }
.choice label { flex: 1; position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: grid; place-items: center; min-height: 40px; padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--ink-2); text-align: center; }
.choice input:checked + span { background: var(--cobalt); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 2px; }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type='range'] { flex: 1; accent-color: var(--cobalt); height: 32px; margin: 0; }
.range-row output { min-width: 3ch; font-family: var(--font-show); font-size: 22px; color: var(--cobalt); text-align: end; font-variant-numeric: tabular-nums; }

/* Country silhouettes */
.vis-country { background: var(--paper-2); }
.vis-country svg, .country-img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(20, 24, 51, 0.18)); }
.country-img { position: absolute; inset: 9%; }
.vis-country svg path { fill: #1f2a5a; stroke: #1f2a5a; }

/* Shown on the picture card while a slow picture downloads (the clock hasn't started). */
.pic-loading {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(20, 24, 51, 0.82);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  z-index: 2;
}
.pic-loading[hidden] { display: none; }

/* Text-only questions: the question itself is the card. */
.qcard {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: min(calc((100vw - 36px) * 0.55), 26dvh, 240px);
  padding: 22px 22px 24px;
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--cobalt-deep);
  overflow: hidden;
}
.qcard::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 8px;
  background: var(--hue, var(--cobalt));
}
.qcard-source { margin: 0; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.qcard-text { margin: 0; font-size: clamp(20px, 5.6vw, 24px); line-height: 1.28; font-weight: 750; letter-spacing: -0.01em; text-wrap: pretty; }
.stage.enter .qcard { animation: card-in 260ms cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
.qcard + .answers { margin-top: 16px; }
@media (max-height: 740px) {
  .qcard { min-height: 0; padding: 16px 18px 18px; }
  .qcard-text { font-size: 19px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .stage .qcard { grid-row: 1 / span 2; min-height: calc(100dvh - 96px); }
}

/* ── More statistics ─────────────────────────────────────────── */

.facts div { display: grid; align-content: start; }
.facts dd small { font-family: var(--font-ui); }
.facts p { margin: 6px 0 0; font-size: 13px; color: var(--on-cobalt-2); }

.weeks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.weeks > div { display: grid; gap: 2px; }
.weeks span:last-child { font-size: 14px; color: var(--ink-2); }
.week-num { font-family: var(--font-show); font-size: 34px; line-height: 1; color: var(--mint-deep); }
.week-num.is-muted { color: var(--ink-2); }
.week-change { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 650; }

.extremes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.extremes li { display: flex; gap: 12px; align-items: center; }
.extremes li > span:last-child { display: grid; }
.extremes li > span:last-child span { font-size: 14px; color: var(--ink-2); }

.review-list { list-style: none; margin: 0 0 18px; padding: 0; }
.review-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.review-list li + li { border-top: 1px solid var(--line); }
.review-body { display: grid; gap: 2px; min-width: 0; }
.review-q { font-size: 14px; color: var(--ink-2); }
.review-count { font-size: 13px; color: var(--coral-deep); font-weight: 600; }

/* ── Reporting a question ────────────────────────────────────── */

.report-btn { flex: none; margin: 0; color: var(--on-cobalt-2); }
.report-btn svg { width: 20px; height: 20px; }
.report-btn.is-done, .review-report.is-done { color: var(--mint); opacity: 1; }

.review-report {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-block: -8px;
  margin-inline: -6px -10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  opacity: 0.6;
  cursor: pointer;
}
.review-report svg { width: 18px; height: 18px; }
.review-report:not(:disabled):hover { opacity: 1; background: var(--line); }

.report-sheet { max-height: 92dvh; overflow-y: auto; }
.sheet .report-q { margin: 6px 0 16px; font-size: 15px; }
.report-q strong { display: block; margin-top: 4px; color: var(--ink); }
.report-reasons { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
.report-reasons legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.report-reason {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--line);
  cursor: pointer;
}
.report-reason:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); background: #fff; }
.report-reason input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.report-note { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 700; }
.report-note small { font-weight: 500; color: var(--ink-2); }
.report-note textarea {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  resize: vertical;
}
.report-note textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.sheet .report-error { margin: -4px 0 14px; color: var(--coral-deep, #c0392b); font-weight: 600; }

/* ── Admin: question reports ─────────────────────────────────── */

.admin-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.admin-tab {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--on-cobalt-2);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.admin-tab.is-active { background: var(--paper); color: var(--ink); box-shadow: none; }
.admin .sub { margin-top: 14px; }
.admin .sub code, .admin-meta code { font-size: 13px; }
.admin-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--ink-2); }
.admin-meta svg { width: 18px; height: 18px; }
.admin-meta a { color: inherit; }
.admin-q { margin: 8px 0 6px; font-size: 17px; line-height: 1.35; }
.admin-answers { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); }
.admin-answers strong { color: var(--mint-deep, #0e8a58); }
.admin-reasons, .admin-notes { list-style: none; display: grid; gap: 6px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.admin-reasons b { display: inline-block; min-width: 2.2em; }
.admin-notes li { font-size: 15px; }
.admin-notes span { display: block; font-size: 13px; color: var(--ink-2); }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.signin-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 4px 0 0; font-size: 14px; }
.signin-legal a { color: var(--on-cobalt-2); text-underline-offset: 3px; }

/* ── Install the app (Progress page) ─────────────────────────── */

.install-panel { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.install-icon { border-radius: 14px; }
.install-text { display: grid; gap: 2px; }
.install-text strong { font-size: 17px; font-weight: 750; }
.install-text span { font-size: 14px; color: var(--ink-2); }
.install-panel .btn { grid-column: 1 / -1; }
.install-steps { margin: 12px 0 0; padding-inline-start: 22px; display: grid; gap: 10px; color: var(--ink); }

/* ── Admin: sections and the Players page ────────────────────── */

.admin-sections { display: flex; gap: 4px; margin-top: 18px; padding: 4px; border-radius: 999px; background: var(--cobalt-ink); }
.admin-section {
  flex: 1;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--on-cobalt-2);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.admin-section.is-active { background: var(--paper); color: var(--ink); }

.returns { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.returns li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: end; }
.returns-head { display: grid; }
.returns-head span { font-size: 14px; color: var(--ink-2); }
.returns-num { font-family: var(--font-show); font-size: 28px; line-height: 1; color: var(--cobalt); }
.returns-num.is-good { color: var(--mint-deep); }
.returns-meter { grid-column: 1 / -1; position: relative; height: 8px; overflow: visible; }
.returns-meter > span { background: var(--cobalt); }
.returns-meter i { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--ink); }

.admin .day-bar { background: var(--marigold); box-shadow: none; }
.admin .day-bar.is-empty { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.admin .day-bar > span { background: var(--cobalt); }
.sw-back { background: var(--cobalt); }
.sw-new { background: var(--marigold); margin-inline-start: 10px; }

.table-scroll { overflow-x: auto; margin: 0 -4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 8px 4px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.admin-table .is-muted { color: var(--ink-2); }

.months { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.months li { display: grid; grid-template-columns: 9em 1fr 3em; gap: 12px; align-items: center; font-size: 14px; }
.months strong { text-align: end; font-variant-numeric: tabular-nums; }
.months .meter > span { background: var(--cobalt); }
.admin-note { margin-top: 16px; font-size: 14px; }

/* ── Languages ─────────────────────────────────────────────────
   Hebrew and Arabic read right to left: <html dir="rtl"> flips the layout (flex, grid and
   the logical properties above), and these variables flip the rest. */

[dir="rtl"] { --start: right; --end: left; --flip: -1; }
/* File names and code inside right-to-left text keep their own order (".env", not "env."). */
code { unicode-bidi: isolate; direction: ltr; }

/* Fonts with Hebrew and Arabic letters (loaded only for those languages). The Smarts logo
   keeps its own Latin lettering in every language. */
:root:lang(he) {
  --font-ui: 'Rubik', 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-show: 'Fredoka', 'Rubik', ui-rounded, system-ui, sans-serif;
}
:root:lang(ar) {
  --font-ui: 'Cairo', 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-show: 'Baloo Bhaijaan 2', 'Cairo', ui-rounded, system-ui, sans-serif;
}
.logo { font-family: 'Bagel Fat One', var(--font-show); }
:root:lang(he) .greeting, :root:lang(ar) .greeting { font-weight: 700; }
/* Arabic letters join up: never space them apart (or squeeze them together). */
:root:lang(ar) * { letter-spacing: normal !important; }
:root:lang(ar) .quick-text strong { line-height: 1.25; }

/* Language row on the sign-in screen */
.lang-switch {
  display: flex;
  align-self: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.lang-switch button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-cobalt);
  font: 700 15px var(--font-ui);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.lang-switch button:lang(he) { font-family: 'Rubik', var(--font-ui); }
.lang-switch button:lang(ar) { font-family: 'Cairo', var(--font-ui); }

/* Language button on the home screen */
.topbar-end { display: flex; align-items: center; gap: 10px; }
.coin-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; text-decoration: none; }
.coin-pill svg { width: 20px; height: 20px; color: var(--marigold); }
.coins-earned { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0; font-family: var(--font-show); font-size: 20px; line-height: 1.1; color: var(--marigold-deep); }
.coins-earned svg { width: 20px; height: 20px; color: var(--marigold); }
.price-chip { background: var(--marigold); color: var(--ink); }
.price-chip svg { color: var(--marigold-deep); }
.avatar-choice.is-buyable[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--marigold-deep); }
.studio-short { margin: 0; font-size: 13px; font-weight: 650; }
.levelup-buy { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px; }
.levelup-buy svg { width: 16px; height: 16px; color: var(--marigold-deep); }
.levelup-hint { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--on-cobalt);
  font: 700 14px var(--font-ui);
  cursor: pointer;
}
.lang-btn svg { width: 18px; height: 18px; }
.lang-btn:active { background: rgba(255, 255, 255, 0.24); }

/* Language sheet */
.lang-options { display: grid; gap: 10px; }
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-btn);
  background: #fff;
  color: var(--ink);
  font: 700 18px var(--font-ui);
  box-shadow: inset 0 0 0 2px var(--line);
  cursor: pointer;
}
.lang-option[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.lang-option svg { width: 22px; height: 22px; color: var(--mint-deep); }
.lang-option:lang(he) { font-family: 'Rubik', var(--font-ui); }
.lang-option:lang(ar) { font-family: 'Cairo', var(--font-ui); }

/* ── People: avatars, flags, rows ────────────────────────────── */

.panel .avatar, .people .avatar, .board .avatar, .versus .avatar { box-shadow: 0 0 0 3px var(--paper), 0 2px 8px rgba(20, 24, 51, 0.18); }
.avatar-xl { box-shadow: 0 0 0 5px var(--paper), 0 10px 24px rgba(20, 24, 51, 0.25) !important; }
.flag { width: 20px; height: 15px; margin-inline-start: 6px; border-radius: 3px; object-fit: cover; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(20, 24, 51, 0.12); }
.name .flag { display: inline-block; }
.is-hidden { color: var(--ink-2); font-style: italic; }

/* The cover around an avatar: art that hangs over its edges, and the level on the plaque at the bottom. */
.cover { position: relative; flex: none; display: inline-block; width: var(--s); height: var(--s); margin-block-end: calc(var(--s) * 0.2); }
.cover .avatar { width: 100%; height: 100%; box-shadow: none !important; }
.cover-art { position: absolute; top: -25%; left: -25%; width: 150%; height: 150%; max-width: none; pointer-events: none; }
.cover-num { position: absolute; inset-inline: 0; top: 102%; transform: translateY(-50%); text-align: center; font-family: var(--font-show); font-size: calc(var(--s) * 0.3); line-height: 1; direction: ltr; color: #fff; text-shadow: 0 1px 1px rgba(20, 24, 51, 0.55); }
.cover.is-silver .cover-num, .cover.is-gold .cover-num, .cover.is-platinum .cover-num, .cover.is-diamond .cover-num { color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
.topbar .cover { margin-block-end: 0; }
.board .cover, .people .cover { margin-inline: 6px; }
.versus-side.is-winner .cover-art { filter: drop-shadow(0 0 7px var(--marigold)); }

/* The level bar. */
.level-bar { display: grid; gap: 5px; width: 100%; }
.level-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.level-bar-top strong { font-weight: 750; }
.level-bar-top span { font-size: 13px; font-weight: 700; opacity: 0.8; }
.level-bar .meter { height: 9px; background: rgba(255, 255, 255, 0.18); }
.level-bar .meter > span { background: var(--marigold); }
.xp-row { display: grid; gap: 6px; max-width: 320px; margin: 16px auto 0; text-align: start; }
.xp-earned { margin: 0; text-align: center; font-family: var(--font-show); font-size: 26px; line-height: 1.1; color: var(--marigold); }
.xp-earned-ink { font-size: 20px; color: var(--mint-deep); }

/* The returning player's header on the home screen. */
.player-hero { display: grid; gap: 8px; margin-top: 12px; padding: 12px 14px; border-radius: 22px; background: var(--cobalt-ink); box-shadow: 0 5px 0 rgba(10, 14, 60, 0.55); color: #fff; }
.player-hero-top { display: flex; align-items: center; gap: 12px; }
.player-hero-avatar { flex: none; display: block; border-radius: 50%; }
.player-hero-hello { min-width: 0; display: grid; gap: 2px; }
.player-hero .greeting { margin: 0; font-size: 28px; overflow-wrap: anywhere; }
.eyebrow { margin: 14px 0 0; font-size: 13px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow.on-cobalt { color: var(--marigold); }

.people { list-style: none; margin: 0; padding: 0; }
.people > li + li { border-top: 1px solid var(--line); }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: inherit; text-decoration: none; }
.person-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.person-text > :first-child { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-text small { font-size: 13px; color: var(--ink-2); }
.streak { display: inline-flex; align-items: center; gap: 3px; color: var(--coral-deep); font-weight: 700; }
.streak svg { width: 15px; height: 15px; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 15px; box-shadow: 0 3px 0 var(--edge); }
.btn-small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn-small svg { width: 18px; height: 18px; }
.icon-btn-ink { color: var(--ink-2); margin: 0; width: 36px; height: 36px; }
.icon-btn-ink svg { width: 18px; height: 18px; }
.duel-row { padding: 12px 0; }
.duel-row.is-yourTurn .person-text small, .duel-row.is-invited .person-text small { color: var(--coral-deep); font-weight: 700; }
.duel-score { font-family: var(--font-show); font-size: 22px; color: var(--cobalt); white-space: nowrap; direction: ltr; }
.duel-score small { margin: 0 3px; color: var(--ink-2); }

/* ── Home cards ──────────────────────────────────────────────── */

.duel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--r-card);
  color: var(--ink);
  text-decoration: none;
  transition: transform 80ms ease, box-shadow 80ms ease;
  -webkit-tap-highlight-color: transparent;
}
.duel-card:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cobalt-deep); }
.daily-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--cobalt);
  color: var(--marigold);
}
.daily-badge svg { width: 30px; height: 30px; }
.duel-card { background: var(--cobalt-ink); color: #fff; box-shadow: 0 6px 0 rgba(10, 14, 60, 0.6); margin-top: 18px; }
.duel-card .quick-text strong { font-size: 22px; }
.duel-card .quick-text span { font-size: 14px; opacity: 0.75; }
.duel-card-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--coral); }
.duel-card-icon svg { width: 26px; height: 26px; }
.quick .quick-go svg { width: 22px; height: 22px; }
button.quick, button.topic { width: 100%; border: 0; font: inherit; text-align: start; cursor: pointer; }

/* ── Daily Challenge ─────────────────────────────────────────── */

.daily-hero { display: grid; justify-items: start; gap: 4px; margin-top: 18px; }
.daily-hero .eyebrow { color: var(--on-cobalt-2); }
.daily-hero .greeting { margin: 4px 0; }
.rules { list-style: none; display: grid; gap: 10px; margin: 22px 0; padding: 18px; border-radius: 22px; background: var(--cobalt-ink); }
.rules li { display: flex; gap: 12px; align-items: flex-start; }
.rules svg { flex: none; width: 22px; height: 22px; color: var(--marigold); }

.result-card { display: grid; justify-items: center; gap: 6px; text-align: center; padding-top: 22px; }
.result-score { margin: 6px 0 0; font-family: var(--font-show); font-size: 76px; line-height: 0.95; color: var(--cobalt); direction: ltr; }
.result-score small { font-size: 30px; color: var(--ink-2); }
.result-line { margin: 0; color: var(--ink-2); font-weight: 650; }
.squares { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 4px; direction: ltr; }
.sq { width: 24px; height: 24px; border-radius: 7px; }
.sq.is-fast { background: var(--mint); }
.sq.is-right { background: var(--marigold); }
.sq.is-wrong { background: var(--coral); }
.sq.is-none { background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.share-row .btn { min-height: 46px; padding: 0 16px; font-size: 15px; box-shadow: 0 4px 0 var(--edge); }
.share-row .btn-ghost-ink { box-shadow: inset 0 0 0 2px var(--line); }
.share-row svg { width: 19px; height: 19px; }
.share-status { min-height: 1.4em; margin: 2px 0 0; font-size: 14px; font-weight: 650; color: var(--mint-deep); }
.next-daily { margin: 14px 0 0; text-align: center; color: var(--on-cobalt-2); font-weight: 650; }

.seg { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 999px; background: var(--paper-2); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-weight: 750; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 6px rgba(20, 24, 51, 0.12); }

.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 14px; }
.board li + li { margin-top: 2px; }
.board li.is-me { background: var(--marigold); background: color-mix(in srgb, var(--marigold) 35%, var(--paper)); }
.board-rank { flex: none; min-width: 40px; text-align: center; font-family: var(--font-show); font-size: 20px; color: var(--ink-2); }
.board-rank.is-long { font-size: 15px; }
.board:first-of-type li:nth-child(1) .board-rank { color: #D99A00; }
.board-who { flex: 1; min-width: 0; display: grid; font-weight: 750; }
.board-who > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-who small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.board-pts { font-family: var(--font-show); font-size: 24px; color: var(--cobalt); }
.board-gap { margin: 2px 0; text-align: center; color: var(--ink-2); }
.board-note { margin: 10px 0 0; text-align: center; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.board-more { margin-top: 10px; }
.board-empty { margin: 8px 0; color: var(--ink-2); }
.board-empty a { color: var(--cobalt); font-weight: 700; }

.diff { justify-self: start; display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px !important; font-weight: 750; color: var(--ink) !important; background: var(--paper-2); }
.diff-easy { background: #D7F5E7; }
.diff-medium { background: #FFEFC2; }
.diff-hard { background: #FFDCD7; }

/* ── Duels ───────────────────────────────────────────────────── */

.challenge-card { display: grid; justify-items: center; gap: 10px; padding: 28px 20px 22px; text-align: center; margin-top: 30px; }
.challenge-card .btn { width: 100%; }
.challenge-title { margin: 8px 0 0; font-size: 24px; line-height: 1.2; }
.challenge-sub { margin: 0 0 8px; color: var(--ink-2); font-weight: 600; }

.versus { text-align: center; }
.versus.is-win { background: linear-gradient(180deg, color-mix(in srgb, var(--marigold) 30%, var(--paper)), var(--paper) 60%); }
.verdict { margin: 4px 0 14px; font-family: var(--font-show); font-size: 34px; color: var(--cobalt); }
.versus-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.versus-side { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.versus-side.is-winner .avatar { box-shadow: 0 0 0 4px var(--marigold), 0 6px 16px rgba(20, 24, 51, 0.2); }
.versus-name { font-weight: 750; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versus-score { font-family: var(--font-show); font-size: 44px; line-height: 1; color: var(--ink); }
.versus-side.is-winner .versus-score { color: var(--cobalt); }
.versus-vs { font-weight: 800; color: var(--ink-2); text-transform: uppercase; font-size: 14px; }

.compare { list-style: none; margin: 0; padding: 6px 16px; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: var(--ledge); }
.compare li { display: grid; grid-template-columns: 1fr 64px 64px; gap: 8px; align-items: center; padding: 10px 0; }
.compare li + li { border-top: 1px solid var(--line); }
.compare-head { font-size: 13px; font-weight: 750; color: var(--ink-2); }
.compare-head span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-q { display: grid; min-width: 0; }
.compare-q strong { font-weight: 700; }
.pts-pill { justify-self: center; min-width: 44px; padding: 4px 8px; border-radius: 999px; text-align: center; font-weight: 800; font-size: 14px; }
.pts-pill.is-fast { background: var(--mint); color: #fff; }
.pts-pill.is-right { background: var(--marigold); color: var(--ink); }
.pts-pill.is-wrong { background: #FFDCD7; color: var(--coral-deep); }
.pts-pill.is-none { background: var(--paper-2); color: var(--ink-2); }

/* ── Friends ─────────────────────────────────────────────────── */

.invite-hint { margin: -6px 0 12px; color: var(--ink-2); font-size: 15px; }
.friend-code { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 0; padding: 12px; border-radius: 16px; background: var(--paper-2); }
.friend-code span { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.friend-code strong { font-family: var(--font-code); font-size: 28px; letter-spacing: 0.18em; color: var(--cobalt); }
.add-friend { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.add-friend label { font-weight: 700; }
.add-friend .dev-row input { border-color: var(--line); background: #fff; color: var(--ink); font-family: var(--font-code); letter-spacing: 0.15em; text-transform: uppercase; }
.add-friend .dev-row input::placeholder { color: #b7bbd0; }
.form-msg { min-height: 1.3em; margin: 0; font-size: 14px; font-weight: 650; color: var(--cobalt); }

/* ── Profile ─────────────────────────────────────────────────── */

.profile-card { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.profile-card .person-text > :first-child { font-size: 19px; }
.profile-edit { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); color: var(--cobalt); }
.profile-edit svg { width: 20px; height: 20px; }
/* The avatar and the tabs stay in view while the list under them scrolls. Save stays above the tab bar. */
.studio-top { position: sticky; top: 0; z-index: 5; margin-inline: -18px; padding: max(4px, env(safe-area-inset-top)) 18px 10px; background: var(--cobalt); }
.studio-head { display: flex; align-items: center; gap: 28px; padding-block: 18px 24px; padding-inline-start: 18px; }
.studio-avatar { flex: none; }
.studio-avatar .cover { display: block; margin: 0; }
.studio-side { flex: 1; min-width: 0; display: grid; gap: 6px; }
.studio-title { margin: 0; font-size: 20px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.studio-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; }
.studio-status .btn-small { --edge: transparent; flex: none; min-height: 44px; padding-inline: 10px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.studio-lock { display: flex; align-items: center; gap: 5px; min-width: 0; max-height: 100%; margin: 0; overflow: hidden; font-size: 13px; line-height: 1.2; font-weight: 750; color: var(--marigold); }
.studio-lock svg { flex: none; width: 14px; height: 14px; }
.studio-tabs { margin: 0; overflow-x: auto; scrollbar-width: none; }
.studio-tabs::-webkit-scrollbar { display: none; }
.studio-tabs button { flex: 1 0 auto; min-height: 44px; padding: 0 7px; font-size: 14px; white-space: nowrap; }
.studio-panel { margin-top: 6px; }
.studio-progress { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.studio-progress strong { font-weight: 750; color: var(--ink); }
.studio-save { position: sticky; bottom: calc(84px + var(--safe-b)); z-index: 4; display: grid; gap: 6px; margin-top: 14px; }
.studio-save .form-msg { min-height: 0; text-align: center; color: var(--marigold); }
.studio-save .form-msg:empty { display: none; }
.studio-save .btn:disabled { --bg: var(--paper-2); --fg: var(--ink-2); --edge: var(--line); cursor: default; }
.studio.is-details .studio-top { position: static; }
@media (max-height: 640px) {
  .studio-avatar .cover { --s: 52px !important; }
  .studio-head { gap: 22px; padding-block: 12px 18px; padding-inline-start: 12px; }
}
@media (max-width: 350px) {
  .studio-tabs button { padding: 0 3px; font-size: 13px; }
  .studio-lock { font-size: 12px; line-height: 1.15; }
}
.level-how { max-width: 36ch; margin: 14px auto 0; text-align: center; font-size: 14px; color: var(--on-cobalt-2); }
.profile-details { display: grid; gap: 16px; margin-top: 6px; }
.profile-details[hidden] { display: none; }
.field { display: grid; gap: 6px; font-weight: 700; }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--cobalt); }
.country-row { display: flex; align-items: center; gap: 10px; }
.country-row .flag { width: 32px; height: 24px; margin: 0; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 10px; }
.avatar-choice {
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 100ms ease;
}
.avatar-choice { position: relative; }
.avatar-choice .avatar { width: 100%; height: auto; aspect-ratio: 1; box-shadow: none; }
.avatar-choice.is-locked .avatar, .avatar-choice.is-locked .swatch { filter: saturate(0.6) brightness(0.72); }
.lock-chip { position: absolute; inset-block-end: -1px; inset-inline-end: -1px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px 1px 3px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; line-height: 1.35; }
.lock-chip svg { width: 11px; height: 11px; }
.avatar-choice[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--cobalt); }
.avatar-choice.is-locked[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--marigold-deep); }
.avatar-choice:active { transform: scale(0.94); }
.swatch { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(20, 24, 51, 0.1); }

/* ── Settings: reminders ─────────────────────────────────────── */

.setting-group { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; }
.setting-group svg { width: 20px; height: 20px; color: var(--cobalt); }
.setting-group ~ .setting + .setting { margin-top: 14px; }
.remind-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #FFF4D4; font-size: 14px; font-weight: 600; }

/* ── Leveling ────────────────────────────────────────────────── */

.stage-progress { margin: 12px 0 0; font-weight: 750; color: var(--marigold); }
.stage-path { position: relative; list-style: none; display: grid; gap: 12px; margin: 16px 0 0; padding: 0; }
.stage-path::before { content: ""; position: absolute; inset-block: 30px; inset-inline-start: 37px; width: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); }
.stage-node { position: relative; }
.stage-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  padding: 14px 16px;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--ledge);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.stage-card:not(:disabled):active { transform: translateY(3px); box-shadow: 0 2px 0 var(--cobalt-deep); }
.stage-card:disabled { background: var(--cobalt-ink); color: var(--on-cobalt-2); box-shadow: none; cursor: default; }
.stage-mark { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--marigold); color: var(--ink); font-family: var(--font-show); font-size: 22px; }
.stage-mark svg { width: 24px; height: 24px; }
.is-cleared .stage-mark { background: var(--mint); color: #fff; }
.is-locked .stage-mark { background: rgba(255, 255, 255, 0.14); color: var(--on-cobalt-2); }
.stage-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.stage-text small { font-size: 12px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.stage-text strong { font-size: 18px; font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
.stage-text span { font-size: 14px; color: var(--ink-2); }
.is-locked .stage-text small, .is-locked .stage-text span { color: var(--on-cobalt-2); }
.stage-xp { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--cobalt); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; }
.stage-again { flex: none; font-size: 13px; font-weight: 750; color: var(--cobalt); }

.stage-result { display: grid; justify-items: center; gap: 6px; margin-top: 22px; padding: 22px 20px; text-align: center; }
.stage-result .btn { width: 100%; }
.stage-verdict { margin: 4px 0 0; font-family: var(--font-show); font-size: 34px; font-weight: 400; line-height: 1.1; color: var(--coral-deep); }
.stage-result.is-cleared .stage-verdict { color: var(--mint-deep); }
.stage-xp-sum { display: grid; gap: 6px; width: 100%; max-width: 280px; margin: 12px 0 10px; padding: 12px 14px; border-radius: 14px; background: var(--paper-2); }
.stage-xp-sum div { display: flex; justify-content: space-between; gap: 12px; font-weight: 650; }
.stage-xp-sum dd { margin: 0; font-weight: 800; }
.stage-xp-sum .is-bonus { color: var(--mint-deep); font-weight: 800; }

/* Leveling on the admin dashboard. */
.stage-empty { display: grid; justify-items: center; gap: 8px; text-align: center; }
.stage-empty h2 { margin: 4px 0 0; font-size: 20px; }
.stage-empty p { margin: 0; color: var(--ink-2); }
.stage-admin-list, .stage-q-list { list-style: none; margin: 0; padding: 0; }
.stage-admin-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.stage-admin-row + .stage-admin-row, .stage-q-row + .stage-q-row { border-top: 1px solid var(--line); }
.stage-admin-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); font-size: 14px; font-weight: 800; }
.stage-admin-link { flex: 1; min-width: 0; display: grid; gap: 2px; min-height: 44px; align-content: center; color: inherit; text-decoration: none; }
.stage-admin-link strong { font-weight: 750; overflow-wrap: anywhere; }
.stage-admin-link > span { font-size: 13px; color: var(--ink-2); }
.stage-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: 12px; font-weight: 750; }
.stage-chip.is-live { background: #D7F5E7; color: var(--mint-deep); }
.stage-move { flex: none; width: 44px; height: 44px; }
.stage-move.is-up svg { transform: rotate(-90deg); }
.stage-move.is-down svg { transform: rotate(90deg); }
.stage-move:disabled { opacity: 0.3; cursor: default; }
.stage-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 10px; color: #fff; font-weight: 700; text-decoration: none; }
.stage-back svg { width: 20px; height: 20px; transform: scaleX(var(--flip)); }
.stage-count { font-weight: 650; color: var(--ink-2); }
.stage-form { display: grid; gap: 12px; }
.stage-form [hidden] { display: none; }
.stage-form .panel-title { margin: 0; }
.stage-form .btn:disabled { opacity: 0.5; cursor: default; }
.admin-section { display: grid; place-items: center; }
.field textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--cobalt); }
.stage-form .form-msg.is-error { min-height: 0; color: var(--coral-deep); }
.stage-form-actions { display: flex; gap: 10px; }
.stage-form-actions .btn { flex: 1; }
.stage-hint { margin: 0; font-size: 14px; color: var(--ink-2); }
.stage-pic { max-width: 100%; max-height: 180px; border-radius: 12px; object-fit: contain; }
.stage-q-row { padding: 12px 0; }
.stage-q-top { display: flex; align-items: flex-start; gap: 10px; }
.stage-q-text { flex: 1; min-width: 0; }
.stage-q-text .admin-q { margin: 2px 0 4px; overflow-wrap: anywhere; }
.stage-q-text .admin-answers { margin: 0; overflow-wrap: anywhere; }
.stage-thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.stage-q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.stage-q-actions .btn-small { --edge: transparent; }
.stage-delete { margin-top: 20px; }

/* ── Sign in from a shared link ──────────────────────────────── */

.link-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--cobalt-deep);
  animation: banner-in 300ms ease both;
}
.link-banner[hidden] { display: none; }
.link-banner > span:last-child { display: grid; gap: 2px; }
.link-banner strong { font-size: 17px; line-height: 1.25; }
.link-banner > span:last-child > span { font-size: 14px; color: var(--ink-2); }
.link-banner .daily-badge { width: 48px; height: 48px; }
@keyframes banner-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .link-banner { animation: none; } }

/* Three tabs: keep them snug on small phones. */
.tabbar a { padding-inline: 16px; }
@media (max-width: 360px) { .tabbar a span { font-size: 13px; } .tabbar a { padding-inline: 12px; } }

/* ── Marketing Studio ────────────────────────────────────────── */

.mk { max-width: 1560px; margin: 0 auto; padding: 16px 22px 40px; }
.mk-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mk-top h1 { margin: 0; font-size: 24px; font-weight: 800; }
.mk-back { font-size: 26px; line-height: 1; color: #fff; text-decoration: none; }
.mk-save { color: var(--on-cobalt-2); font-size: 14px; font-weight: 650; }
.mk-record { margin-inline-start: auto; min-height: 48px; padding: 0 22px; }
.mk-warn { margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--coral); font-weight: 700; }
.mk-grid { display: grid; grid-template-columns: 310px minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.mk-col, .mk-stage { display: grid; gap: 14px; min-width: 0; }
.mk-panel { padding: 16px; color: var(--ink); }
.mk-panel h2 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.mk-panel h2 small { font-weight: 600; color: var(--ink-2); margin-inline-start: 6px; }
.mk-note { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.mk-option { display: grid; gap: 1px; width: 100%; margin-bottom: 6px; padding: 9px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-align: start; font: inherit; cursor: pointer; }
.mk-option span { font-size: 13px; color: var(--ink-2); }
.mk-option[aria-pressed="true"] { border-color: var(--cobalt); background: #eef0ff; }
.mk-scenes { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mk-scenes li { display: grid; grid-template-columns: 1fr 62px 22px; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 10px; }
.mk-scenes li.is-selected { background: #eef0ff; }
.mk-scenes li.is-off .mk-scene { opacity: 0.45; }
.mk-scene { display: flex; justify-content: space-between; gap: 8px; min-height: 38px; align-items: center; padding: 0 6px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: start; cursor: pointer; }
.mk-scene small { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.mk-scene em, .mk-field em { color: var(--coral-deep); font-style: normal; font-weight: 800; }
.mk-dur { width: 100%; min-height: 34px; padding: 0 4px; border: 2px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 14px; }
.mk-input { width: 100%; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; resize: vertical; }
.mk-input:focus, .mk-dur:focus { outline: none; border-color: var(--cobalt); }
.mk-input:lang(he) { font-family: 'Rubik', var(--font-ui); }
.mk-input:lang(ar) { font-family: 'Cairo', var(--font-ui); }
.mk-field { display: grid; gap: 3px; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.mk-reset { padding: 0; color: var(--cobalt); }
.mk-view { display: grid; place-items: center; min-height: 60vh; }
.mk-canvas-wrap { position: relative; line-height: 0; }
.mk-canvas-wrap[hidden], .mk-compare[hidden] { display: none; }
.mk-canvas-wrap canvas { display: block; max-width: 100%; height: min(70vh, 900px); width: auto; border-radius: 14px; box-shadow: 0 12px 34px rgba(8, 12, 60, 0.5); }
.mk-view[data-shape="wide"] .mk-canvas-wrap canvas { height: auto; width: 100%; }
.mk-safe { position: absolute; border: 2px dashed var(--marigold); border-radius: 8px; pointer-events: none; }
.mk-compare { display: flex; justify-content: center; gap: 12px; width: 100%; }
.mk-compare figure { flex: 1 1 0; min-width: 0; max-width: 300px; margin: 0; text-align: center; font-weight: 700; }
.mk-view[data-shape="wide"] .mk-compare figure { max-width: none; }
.mk-compare canvas { width: 100%; height: auto; border-radius: 10px; }
.mk-compare figcaption { margin-top: 6px; line-height: 1.3; }
.mk-transport { padding: 12px 16px; color: var(--ink); }
.mk-track { position: relative; }
.mk-track input { width: 100%; accent-color: var(--cobalt); }
.mk-ticks { position: relative; height: 8px; }
.mk-ticks i { position: absolute; top: 0; width: 2px; height: 8px; background: var(--ink-2); }
.mk-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.mk-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-langs { flex: 0 1 380px; margin: 0; }
.mk-langs button { min-height: 34px; padding: 0 8px; font-size: 14px; }
.mk-check { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 650; }
.mk-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.mk-lower table { width: 100%; margin-bottom: 10px; border-collapse: collapse; font-size: 14px; }
.mk-lower th { text-align: start; color: var(--ink-2); font-size: 12px; }
.mk-lower td, .mk-lower th { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mk-lower td small { color: var(--ink-2); }
.mk-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mk-cues { max-height: 300px; overflow-y: auto; }
.mk-good { color: var(--mint-deep); font-weight: 750; }
.mk-bad { color: var(--coral-deep); font-weight: 750; }
.mk-row-buttons { white-space: nowrap; }
.mk-row-buttons .link-btn { color: var(--cobalt); padding: 0 6px; }
.mk-player { display: block; max-width: 100%; max-height: 60vh; margin: 10px auto 0; border-radius: 10px; }
.mk-player[hidden] { display: none; }
.mk-recording { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8, 12, 60, 0.82); }
.mk-recording[hidden] { display: none; }
.mk-recording-box { display: flex; align-items: center; gap: 22px; padding: 22px; color: var(--ink); max-width: min(760px, 94vw); }
.mk-recording-box canvas { height: min(62vh, 620px); max-width: 52vw; width: auto; border-radius: 12px; }
.mk-recording-box h2 { margin: 0 0 8px; font-size: 22px; }
.mk-recording-box p { margin: 0 0 14px; color: var(--ink-2); }
.mk-recording-box .meter { margin-bottom: 14px; height: 10px; }
@media (max-width: 1180px) { .mk-grid { grid-template-columns: 1fr; } .mk-lower { grid-template-columns: 1fr; } }

/* ── Live duels ──────────────────────────────────────────────── */

.lobby-faces { display: flex; align-items: center; justify-content: center; gap: 18px; }
.lobby-empty {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 400 40px var(--font-show);
  box-shadow: inset 0 0 0 2px var(--line);
}
.lobby-dots { display: inline-flex; gap: 6px; }
.lobby-dots span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.3; animation: lobby-dot 1.2s ease-in-out infinite; }
.lobby-dots span:nth-child(2) { animation-delay: 160ms; }
.lobby-dots span:nth-child(3) { animation-delay: 320ms; }
@keyframes lobby-dot { 30% { opacity: 1; transform: translateY(-3px); } 60% { opacity: 0.3; transform: none; } }
.challenge-card .lobby-dots { color: var(--cobalt); }

.live-play .answers { padding-bottom: 170px; }
.live-them { position: relative; flex: none; display: grid; place-items: center; transition: opacity 200ms ease, filter 200ms ease; }
.live-them.is-away { opacity: 0.45; filter: grayscale(1); }
.live-them-check {
  position: absolute;
  inset-block-end: -4px;
  inset-inline-end: -4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  box-shadow: 0 0 0 2px var(--cobalt);
  transform: scale(0);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1.5);
}
.live-them-check svg { width: 11px; height: 11px; }
.live-them.is-answered .live-them-check { transform: scale(1); }

.live-banner {
  margin: 0 0 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--cobalt-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.live-banner[hidden] { display: none; }

.live-waiting {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(10, 14, 60, 0.35);
  z-index: 15;
  animation: fade-in 180ms ease both;
}
.live-waiting[hidden] { display: none; }

.live-count {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: var(--cobalt);
  color: #fff;
  text-align: center;
  z-index: 25;
}
.live-count[hidden] { display: none; }
.live-count .versus-vs { color: var(--on-cobalt-2); }
.live-count-topic { margin: 6px 0 0; font-weight: 700; color: var(--on-cobalt-2); }
.live-count-num { font-family: var(--font-show); font-size: clamp(110px, 40vw, 180px); line-height: 1; color: var(--marigold); text-shadow: 0 8px 0 var(--cobalt-deep); }
.live-count-num.is-tick { animation: count-tick 700ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.live-count-hint { margin: 0; font-size: 20px; font-weight: 750; }
@keyframes count-tick { from { opacity: 0; transform: scale(1.7); } 45% { opacity: 1; transform: scale(0.95); } to { transform: none; } }

.play-score.is-bump { animation: score-bump 420ms cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes score-bump { 40% { transform: scale(1.45); color: var(--marigold); } }

/* How a question went: right or wrong, how fast, and the points flying to the score. */
.lr { flex: 1; min-width: 0; display: grid; gap: 12px; }
.lr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lr-verdict { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-show); font-size: 24px; line-height: 1.1; animation: lr-stamp 380ms cubic-bezier(0.2, 0.9, 0.3, 1.5) both; }
.lr-verdict svg { flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 50%; }
.lr.is-right .lr-verdict { color: #7dedbf; }
.lr.is-right .lr-verdict svg { background: var(--mint); color: #fff; }
.lr.is-wrong .lr-verdict { color: #ffb1aa; animation-name: lr-stamp, shake; animation-duration: 380ms, 340ms; }
.lr.is-wrong .lr-verdict svg { background: var(--coral); color: #fff; }
@keyframes lr-stamp { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: none; } }
.lr-answer { margin: 0; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.lr-answer b { font-weight: 800; }
.lr-chips { display: flex; gap: 6px; flex: none; }
.lr-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-show);
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1.6);
}
.lr-chip.is-speed { background: var(--marigold); }
.lr.is-wrong .lr-chip { background: rgba(255, 255, 255, 0.16); color: #fff; }
.lr-chip.is-in { opacity: 1; transform: none; }
.lr-chip.is-flying { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.5); transition: transform 430ms cubic-bezier(0.5, 0, 0.8, 0.6), opacity 430ms ease-in; }

.lr-speed { padding-block-start: 26px; }
.lr-track { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.lr-zone {
  display: grid;
  place-items: center;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease, transform 240ms cubic-bezier(0.2, 0.9, 0.3, 1.8);
}
.lr-zone:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.lr-zone:nth-child(3) { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.lr-zone.is-hit { background: var(--marigold); color: var(--ink); transform: scaleY(1.2); }
.lr-marker {
  position: absolute;
  inset-block-start: -7px;
  inset-block-end: -7px;
  inset-inline-start: 0;
  width: 3px;
  margin-inline-start: -1.5px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: inset-inline-start 650ms cubic-bezier(0.25, 0.8, 0.3, 1), opacity 120ms ease;
}
.lr-marker b { position: absolute; inset-block-end: 100%; left: 50%; transform: translateX(-50%); margin-block-end: 3px; font: 800 13px var(--font-ui); white-space: nowrap; font-style: normal; }
.lr-speed.is-go .lr-marker { opacity: 1; inset-inline-start: calc(var(--mark) * 100%); }
.lr.is-instant .lr-verdict { animation: none; }
.lr.is-instant .lr-chip, .lr.is-instant .lr-marker, .lr.is-instant .lr-zone { transition: none; }
.btn.is-offer { animation: pulse 700ms ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  .lobby-dots span, .btn.is-offer { animation: none; opacity: 1; }
  .play-score.is-bump, .lr-verdict { animation: none; }
}
