/* ============================================================
   Atlas — monochrome editorial system.
   One typeface (Hanken Grotesk), ink-on-paper, hairline borders,
   colour reserved strictly for answer feedback.
   ============================================================ */

:root {
  /* Light — warm paper & ink */
  --paper:     #f7f6f2;
  --surface:   #ffffff;
  --surface-2: #f1f0ea;
  --ink:       #1a1916;
  --ink-2:     #6e6c64;
  --ink-3:     #9b988e;
  --line:      #e7e4dc;
  --line-2:    #d8d4c8;
  --on-ink:    #f7f6f2;   /* text on an ink fill */

  --correct:    #2e7d52;
  --correct-bg: #eaf3ec;
  --correct-ln: #bfe0cb;
  --wrong:      #be3a2b;
  --wrong-bg:   #f8ebe8;
  --wrong-ln:   #f0cdc6;

  --shadow-1: 0 1px 2px rgba(26,25,22,.05);
  --shadow-2: 0 1px 2px rgba(26,25,22,.05), 0 12px 28px -10px rgba(26,25,22,.18);

  --r-lg: 20px;
  --r:    14px;
  --r-sm: 11px;
  --pill: 999px;
  --ease:    cubic-bezier(.2,.7,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper:     #0e0e10;
  --surface:   #161618;
  --surface-2: #1d1d20;
  --ink:       #f2f1ec;
  --ink-2:     #a3a19a;
  --ink-3:     #6f6e68;
  --line:      #262629;
  --line-2:    #33333a;
  --on-ink:    #131316;   /* text on the (light) ink fill */

  --correct:    #54c98c;
  --correct-bg: #142a20;
  --correct-ln: #265c41;
  --wrong:      #e2705f;
  --wrong-bg:   #2c1816;
  --wrong-ln:   #5a302a;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  transition: background-color .4s var(--ease), color .3s var(--ease);
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ── App shell ───────────────────────────────────────────── */
.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(18px, 5vw, 26px) clamp(18px, 5vw, 24px) clamp(20px, 5vw, 28px);
  display: flex; flex-direction: column;
}
.screen { display: none; flex-direction: column; flex: 1 0 auto; min-width: 0; }
.screen.is-active { display: flex; animation: screen-in .4s var(--ease-out); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Top bar / brand ─────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 6px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { color: var(--ink); }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: transform .18s var(--ease), border-color .2s, color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.93); }
.theme-toggle .ico-sun { color: var(--ink); }
.theme-toggle .ico-moon { color: var(--ink); display: none; }
[data-theme="dark"] .theme-toggle .ico-sun { display: none; }
[data-theme="dark"] .theme-toggle .ico-moon { display: block; }

/* ── Hero ────────────────────────────────────────────────── */
.hero { margin: clamp(26px, 8vw, 52px) 0 24px; }
.hero-title {
  font-weight: 800; font-size: clamp(32px, 8.4vw, 44px);
  line-height: 1.02; letter-spacing: -.035em; max-width: 13ch;
}
.hero-sub {
  margin-top: 16px; max-width: 42ch; color: var(--ink-2);
  font-size: clamp(15px, 3.7vw, 16.5px); line-height: 1.55;
}

/* ── Daily challenge card ────────────────────────────────── */
.daily-card {
  display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  padding: 15px 16px; margin-bottom: 14px; cursor: pointer; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .25s var(--ease);
}
.daily-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.daily-card:active { transform: translateY(0) scale(.995); }

.daily-glyph {
  width: 48px; height: 50px; flex: 0 0 auto; display: flex; flex-direction: column;
  overflow: hidden; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
}
.cal-month { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-align: center; padding: 3px 0; color: var(--on-ink); background: var(--ink); }
.cal-day { flex: 1; display: grid; place-items: center; font-weight: 800; font-size: 21px; font-variant-numeric: tabular-nums; }
.daily-card.is-done .daily-glyph { border-color: var(--correct-ln); }
.daily-card.is-done .cal-month { background: var(--correct); color: #fff; }

.daily-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.daily-kicker { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; }
.daily-date { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.daily-sub { font-size: 12.5px; color: var(--ink-2); }
.daily-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.daily-streak { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--ink); }
.daily-streak .ico-flame { width: 15px; height: 15px; }
.daily-cta {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 15px; border-radius: var(--pill);
  background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 13px; white-space: nowrap;
}
.daily-cta svg { fill: currentColor; }
.daily-card.is-done .daily-cta { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }

/* ── Stat strip ──────────────────────────────────────────── */
.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 15px 6px; margin-bottom: 28px; box-shadow: var(--shadow-1);
}
.stat { text-align: center; display: flex; flex-direction: column; gap: 3px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-num { font-weight: 800; font-size: 23px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }

/* ── Setup ───────────────────────────────────────────────── */
.setup { display: flex; flex-direction: column; gap: 24px; margin-bottom: 30px; }
.setup-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; margin-bottom: 12px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.segmented.single { grid-template-columns: 1fr; }
.seg {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: border-color .18s var(--ease), background-color .18s, color .18s, transform .15s var(--ease);
}
.seg-ico { width: 19px; height: 19px; flex: 0 0 auto; color: var(--ink-2); transition: color .18s; }
.seg-arrow { color: var(--ink-3); margin: 0 1px; font-weight: 500; }
.seg:hover { border-color: var(--line-2); }
.seg:active { transform: scale(.98); }
.seg.is-on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.seg.is-on .seg-ico, .seg.is-on .seg-arrow { color: var(--on-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.label-new { font-size: 9px; font-weight: 800; letter-spacing: .12em; padding: 2px 7px; border-radius: var(--pill); background: var(--correct-bg); color: var(--correct); vertical-align: middle; margin-left: 4px; }
.btn-play.loading { opacity: .65; pointer-events: none; }

/* ── Primary / ghost buttons ─────────────────────────────── */
.btn-play {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 17px 24px; border: none; border-radius: var(--r);
  background: var(--ink); color: var(--on-ink); font: inherit; font-weight: 700; font-size: 16.5px; letter-spacing: -.01em;
  cursor: pointer; box-shadow: var(--shadow-2); margin-top: auto;
  transition: transform .16s var(--ease), opacity .2s;
}
.btn-play svg { fill: currentColor; }
.btn-play:hover { transform: translateY(-1px); }
.btn-play:active { transform: translateY(0) scale(.99); }
.play-hint { text-align: center; color: var(--ink-3); font-size: 12.5px; margin-top: 12px; }

.btn-ghost {
  width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: all .18s var(--ease);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }

/* ── Game top bar ────────────────────────────────────────── */
.game-top { padding-bottom: 16px; }
.game-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-headings { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.game-kind { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; }
.counter { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 16px; letter-spacing: -.01em; }
.counter-sep { color: var(--ink-3); margin: 0 1px; font-weight: 600; }
.game-meta { display: flex; align-items: center; gap: 8px; }

.streak, .score {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
  padding: 7px 13px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface);
}
.streak { color: var(--ink); transition: transform .2s var(--ease); }
.streak-flame { width: 15px; height: 15px; color: var(--ink-3); transition: color .25s; }
.streak.hot .streak-flame { color: var(--ink); }
.streak.bump { animation: bump .4s var(--ease); }
@keyframes bump { 0%,100% { transform: scale(1); } 35% { transform: scale(1.16); } }
.score { color: var(--ink); }
.score-check { width: 15px; height: 15px; color: var(--correct); }

/* ── Progress ────────────────────────────────────────────── */
.progress { height: 4px; border-radius: var(--pill); background: var(--line); overflow: hidden; margin-bottom: clamp(18px, 5vw, 30px); }
.progress-fill { height: 100%; width: 0%; border-radius: inherit; background: var(--ink); transition: width .45s var(--ease-out); }

/* ── Quiz ────────────────────────────────────────────────── */
.quiz { display: flex; flex-direction: column; flex: 1; justify-content: center; min-height: 0; }
.prompt { text-align: center; color: var(--ink-2); font-size: clamp(15px, 4vw, 16.5px); font-weight: 600; margin-bottom: 22px; }
.stage { display: grid; place-items: center; margin-bottom: clamp(22px, 5vw, 32px); min-height: 150px; }

/* Flag */
.flag-frame {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-2);
  width: min(76vw, 300px); max-height: 40vh; aspect-ratio: 3 / 2; display: grid; place-items: center;
  animation: pop-in .45s var(--ease-out);
}
.flag-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }

/* Big name (capital / nameToFlag) */
.name-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop-in .45s var(--ease-out); }
.name-card .nc-kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; }
.name-card .nc-main { font-weight: 800; font-size: clamp(30px, 8vw, 44px); line-height: 1.05; letter-spacing: -.035em; max-width: 14ch; }

/* Outline / silhouette */
.shape-frame { color: var(--ink); width: min(60vw, 230px); max-height: 38vh; aspect-ratio: 1 / 1; display: grid; place-items: center; animation: pop-in .45s var(--ease-out); }
.shape-frame svg { width: 100%; height: 100%; display: block; }
.shape-frame svg, .shape-frame svg * { fill: currentColor !important; stroke: none !important; }
.shape-frame .shape-img { width: 100%; height: 100%; object-fit: contain; }
[data-theme="dark"] .shape-frame .shape-img { filter: invert(1) brightness(1.4); }
.shape-frame.loading { width: 170px; height: 170px; border-radius: 18px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }
.shape-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.shape-frame.is-ctx { width: min(84vw, 340px); height: auto; aspect-ratio: 4 / 3; max-height: 42vh; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-1); }
.ctx-canvas { width: 100%; height: 100%; display: block; }
.hint-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-1); transition: color .18s var(--ease), border-color .18s, transform .15s var(--ease); }
.hint-btn:hover { color: var(--ink); border-color: var(--line-2); }
.hint-btn:active { transform: scale(.97); }
.hint-ico { width: 16px; height: 16px; flex: 0 0 auto; }
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }

/* Globe */
.globe-locate { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.globe-target { text-align: center; max-width: 16ch; }
.globe-wrap { position: relative; display: grid; place-items: center; width: 100%; touch-action: none; }
.globe-canvas { width: min(74vw, 320px); height: min(74vw, 320px); display: block; touch-action: none; cursor: grab; animation: pop-in .45s var(--ease-out); }
.globe-canvas:active { cursor: grabbing; }
.globe-hint { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .01em; }
.globe-zoom { position: absolute; right: 4px; bottom: 4px; display: flex; flex-direction: column; gap: 6px; }
.zoom-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-1); transition: transform .15s var(--ease), border-color .2s;
}
.zoom-btn svg { width: 18px; height: 18px; }
.zoom-btn:hover { border-color: var(--line-2); }
.zoom-btn:active { transform: scale(.92); }

/* ── Options ─────────────────────────────────────────────── */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; min-width: 0; }
.opt {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 15px 16px; min-height: 56px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); font: inherit; font-weight: 600; font-size: 14.5px; text-align: left; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform .14s var(--ease), border-color .18s, background-color .18s, opacity .25s;
  animation: opt-in .38s var(--ease-out) backwards;
}
.opt:nth-child(2) { animation-delay: .04s; }
.opt:nth-child(3) { animation-delay: .08s; }
.opt:nth-child(4) { animation-delay: .12s; }
@keyframes opt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.opt:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.opt:active:not(:disabled) { transform: scale(.985); }
.opt:disabled { cursor: default; }
.opt-label { flex: 1; min-width: 0; overflow-wrap: break-word; }

.opt-badge { position: absolute; right: 11px; top: 50%; transform: translateY(-50%) scale(.4); opacity: 0; width: 19px; height: 19px; transition: all .28s var(--ease-out); }
.opt-badge svg { width: 100%; height: 100%; }
.opt.correct { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); }
.opt.correct .opt-badge { opacity: 1; transform: translateY(-50%) scale(1); }
.opt.wrong { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); }
.opt.wrong .opt-badge { opacity: 1; transform: translateY(-50%) scale(1); }
.opt.dim { opacity: .4; }
.opt.shake { animation: shake .4s var(--ease); }
@keyframes shake { 10%,90% { transform: translateX(-2px); } 30%,70% { transform: translateX(3px); } 50% { transform: translateX(-5px); } }

/* flag-only options (nameToFlag) */
.options.is-flags { grid-template-columns: 1fr 1fr; }
.opt-flag-tile { justify-content: center; padding: 11px; min-height: 0; }
.opt-flag-lg { width: 100%; aspect-ratio: 3/2; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.opt-flag-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.options.is-flags .opt-flag-tile .opt-badge { top: 8px; right: 8px; left: auto; transform: scale(.4); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.options.is-flags .opt-flag-tile .opt-badge svg { width: 14px; height: 14px; }
.options.is-flags .opt-flag-tile.correct .opt-badge { background: var(--correct); opacity: 1; transform: scale(1); }
.options.is-flags .opt-flag-tile.wrong .opt-badge { background: var(--wrong); opacity: 1; transform: scale(1); }

/* ── Feedback / learn card ───────────────────────────────── */
.feedback { padding-top: 18px; min-height: 92px; }
.learn {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 13px; box-shadow: var(--shadow-2); animation: learn-in .35s var(--ease-out);
}
@keyframes learn-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.learn-flag { width: 54px; aspect-ratio: 3/2; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); flex: 0 0 auto; }
.learn-flag img { width: 100%; height: 100%; object-fit: cover; }
.learn-text { flex: 1; min-width: 0; }
.learn-verdict { font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.learn.ok .learn-verdict { color: var(--correct); }
.learn.no .learn-verdict { color: var(--wrong); }
.learn-name { font-weight: 800; font-size: 18px; line-height: 1.15; letter-spacing: -.02em; }
.learn-detail { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.learn-next {
  flex: 0 0 auto; align-self: stretch; display: flex; align-items: center; gap: 6px;
  padding: 0 16px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--ink); color: var(--on-ink); font: inherit; font-weight: 700; font-size: 14px;
  transition: transform .15s var(--ease);
}
.learn-next svg { fill: currentColor; }
.learn-next:hover { transform: translateX(2px); }
.learn-next:active { transform: scale(.96); }

/* ── Summary ─────────────────────────────────────────────── */
.summary { justify-content: center; }
.summary-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: clamp(26px, 7vw, 38px) clamp(22px, 6vw, 32px); text-align: center;
  animation: pop-in .45s var(--ease-out);
}
.summary-emoji { display: grid; place-items: center; }
.summary-emoji svg { width: 42px; height: 42px; color: var(--ink); }
.summary-title { font-weight: 800; font-size: clamp(25px, 7vw, 32px); margin-top: 14px; letter-spacing: -.03em; }
.summary-score { margin-top: 8px; font-size: 16px; color: var(--ink-2); }
.summary-score #summary-correct { font-weight: 800; font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.summary-of { color: var(--ink-3); }

.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 26px 0; }
.sstat { border: 1px solid var(--line); border-radius: var(--r); padding: 15px 6px; display: flex; flex-direction: column; gap: 4px; }
.sstat-num { font-weight: 800; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sstat-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }

.review { text-align: left; margin: 6px 0 24px; }
.review-title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; margin-bottom: 11px; }
.review-list { display: flex; flex-direction: column; gap: 7px; }
.review-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.review-item .ri-flag { width: 38px; aspect-ratio: 3/2; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); flex: 0 0 auto; }
.review-item .ri-flag img { width: 100%; height: 100%; object-fit: cover; }
.review-item .ri-name { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.review-item .ri-cap { font-size: 12px; color: var(--ink-3); }
.review-more { margin-top: 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }

.summary-actions { display: flex; flex-direction: column; gap: 9px; }
.summary-actions .btn-play { margin-top: 0; }

/* ── Share popup ─────────────────────────────────────────── */
.sheet-backdrop { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 12, .45); }
.sheet-backdrop.is-open { display: grid; place-items: end center; animation: fade .2s var(--ease); }
[data-theme="dark"] .sheet-backdrop { background: rgba(0, 0, 0, .6); }
@media (min-width: 540px) { .sheet-backdrop.is-open { place-items: center; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-2);
  padding: 20px clamp(16px, 5vw, 22px) calc(22px + env(safe-area-inset-bottom));
  animation: sheet-up .28s var(--ease-out);
}
@media (min-width: 540px) { .sheet { border-radius: var(--r-lg); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-title { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.sheet-sub { color: var(--ink-2); font-size: 13.5px; margin: 4px 0 16px; }
.share-link { display: flex; gap: 8px; }
.share-link input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; font: inherit; font-size: 13px;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.share-copy {
  flex: 0 0 auto; height: 46px; padding: 0 20px; border: none; border-radius: 12px;
  background: var(--ink); color: var(--on-ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: transform .15s var(--ease);
}
.share-copy:active { transform: scale(.96); }

/* ── Confetti (restrained, monochrome + accent) ──────────── */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ── Misc ────────────────────────────────────────────────── */
@media (max-width: 360px) { .options { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .08s !important; }
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
button:focus:not(:focus-visible) { outline: none; }
