:root {
  --bg: #f4f2ec; --surface: #ffffff; --surface-2: #f8f7f3; --ink: #121a26; --muted: #5d6675; --line: #e4e1d8;
  --navy: #0e1a2b; --navy-2: #17283f; --gold: #f2b705; --gold-ink: #241a00;
  --brand: #1d6b45; --brand-2: #23845a; --brand-ink: #ffffff;
  --good: #198754; --good-bg: #e3f4ea; --bad: #c8372d; --bad-bg: #fbe8e6;
  --chip: #efede6; --ring-track: #e7e4dc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .12);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 24px 48px -16px rgba(16, 24, 40, .22);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b121c; --surface: #131c29; --surface-2: #182233; --ink: #e9edf3; --muted: #95a1b2; --line: #243246;
    --brand: #2f9e6a; --brand-2: #38b479; --brand-ink: #04150c;
    --good: #4cc98a; --good-bg: #12301f; --bad: #f0726a; --bad-bg: #3a1916;
    --chip: #1d293b; --ring-track: #233147;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0b121c; --surface: #131c29; --surface-2: #182233; --ink: #e9edf3; --muted: #95a1b2; --line: #243246;
  --brand: #2f9e6a; --brand-2: #38b479; --brand-ink: #04150c;
  --good: #4cc98a; --good-bg: #12301f; --bad: #f0726a; --bad-bg: #3a1916;
  --chip: #1d293b; --ring-track: #233147;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
button, select { font: inherit; color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 400px at 85% -10%, rgba(242,183,5,.22), transparent 60%),
              linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 22px 0 96px; }
.hero::after { /* road */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.25)),
    repeating-linear-gradient(90deg, var(--gold) 0 46px, transparent 46px 92px) center 26px / 100% 4px no-repeat;
  opacity: .9; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--gold); display: grid; place-items: center; color: var(--gold-ink); }
.brand { flex-shrink: 0; white-space: nowrap; }
.nav-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.prov-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; color: #fff;
  text-decoration: none; font-size: .88rem; font-weight: 700; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  min-width: 0; }
.prov-btn:hover { background: rgba(255,255,255,.16); }
.prov-btn svg { color: var(--gold); flex-shrink: 0; }
.prov-btn .prov-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov-btn .prov-code { display: none; }
/* Narrow phones: the full province name doesn't fit beside the brand, so show the two-letter code. */
@media (max-width: 480px) {
  .prov-btn .prov-name { display: none; }
  .prov-btn .prov-code { display: inline; }
}
.icon-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; width: 38px; height: 38px;
  border-radius: 12px; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.icon-btn:hover { background: rgba(255,255,255,.16); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; margin-top: 34px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold); background: rgba(242,183,5,.1); border: 1px solid rgba(242,183,5,.25);
  padding: 5px 12px; border-radius: 99px; }
.eyebrow .sep { display: inline-block; width: 1px; height: 14px; background: rgba(242,183,5,.55); margin: 0 4px; }
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.07; letter-spacing: -.03em; margin: 16px 0 12px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { color: rgba(255,255,255,.74); max-width: 540px; margin: 0 0 22px; font-size: 1.04rem; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.readiness { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 24px; padding: 22px;
  backdrop-filter: blur(6px); display: flex; gap: 18px; align-items: center; }
.readiness .lbl { font-size: .8rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.readiness .big { font-size: 1.35rem; font-weight: 800; margin: 2px 0 6px; }
.readiness .hint { font-size: .88rem; color: rgba(255,255,255,.7); margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; padding: 13px 20px;
  font-weight: 700; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .2s, background .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 8px 24px -10px rgba(242,183,5,.8); }
.btn-gold:hover { box-shadow: 0 12px 28px -10px rgba(242,183,5,.95); transform: translateY(-1px); }
.btn-ghost-dark { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.14); }
.btn-brand { background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px -10px rgba(29,107,69,.8); }
.btn-brand:hover { background: var(--brand-2); transform: translateY(-1px); }
.btn-soft { background: var(--chip); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 4px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout ---------- */
.lift { margin-top: -64px; position: relative; z-index: 2; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 14px; }
.section-title h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 0; }
.section-title p { margin: 0; color: var(--muted); font-size: .92rem; }
.muted { color: var(--muted); }

/* Part cards */
.part { display: flex; flex-direction: column; gap: 16px; transition: transform .2s, box-shadow .2s; }
.part:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.part-head { display: flex; gap: 16px; align-items: center; }
.part-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 auto; }
.part-icon.rules { background: linear-gradient(135deg, #1d6b45, #2f9e6a); color: #fff; }
.part-icon.signs { background: linear-gradient(135deg, #f2b705, #f7d04b); color: #241a00; }
.part h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.part .meta { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.part-body { display: flex; align-items: center; gap: 18px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.kpi b { display: block; font-size: 1.2rem; letter-spacing: -.02em; }
.kpi span { font-size: .76rem; color: var(--muted); }

.ring { --p: 0; --size: 92px; --stroke: 9px; width: var(--size); height: var(--size); position: relative; flex: 0 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); }
.ring .track { stroke: var(--ring-track); }
.ring .val { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring.gold .val { stroke: var(--gold); }
.ring.dark .track { stroke: rgba(255,255,255,.12); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .center b { font-size: 1.25rem; letter-spacing: -.02em; }
.ring .center small { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.ring.dark .center small { color: rgba(255,255,255,.6); }

/* Full test banner */
.banner { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--navy), var(--navy-2)); color: #fff; border: 0; }
.banner h3 { margin: 0 0 4px; font-size: 1.2rem; }
.banner p { margin: 0; color: rgba(255,255,255,.72); font-size: .94rem; }
.banner .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Topic tiles */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 44%), 1fr)); gap: 14px; }
.topic { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .2s, border-color .2s; }
.topic:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.topic .t-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topic .t-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--chip); display: grid; place-items: center; color: var(--brand); }
.topic b { font-size: 1rem; letter-spacing: -.01em; }
.topic .t-meta { font-size: .8rem; color: var(--muted); }
.mini-bar { height: 6px; border-radius: 99px; background: var(--ring-track); overflow: hidden; }
.mini-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.acc { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--chip); color: var(--muted); }
.acc.good { background: var(--good-bg); color: var(--good); }
.acc.bad { background: var(--bad-bg); color: var(--bad); }

/* History */
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; padding-top: 0; }
.history .when { font-size: .85rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 800; padding: 4px 10px; border-radius: 99px; }
.badge.pass { background: var(--good-bg); color: var(--good); }
.badge.fail { background: var(--bad-bg); color: var(--bad); }

footer { color: var(--muted); font-size: .82rem; text-align: center; padding: 40px 16px 48px; }
footer a { color: inherit; }

/* ---------- Province guide (static text below the app, for readers and search engines) ---------- */
body[data-screen]:not([data-screen="home"]) .guide, body[data-screen]:not([data-screen="home"]) .site-footer { display: none; }
.guide { margin-top: 12px; }
.guide h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 40px 0 12px; }
.guide p, .guide li { color: var(--ink); }
.guide .lede { color: var(--muted); max-width: 760px; }
.guide .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.guide .facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.guide .facts b { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.guide .facts span { color: var(--muted); font-size: .88rem; }
.guide .qa { display: grid; gap: 10px; }
.guide details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.guide summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "+"; color: var(--muted); font-weight: 800; flex: 0 0 auto; }
.guide details[open] summary::after { content: "\2212"; }
.guide details p { margin: 10px 0 0; }
.guide .ans { font-weight: 700; color: var(--good); }
.guide ol, .guide ul.plain { padding-left: 20px; }
.guide a { color: var(--brand); }

/* ---------- Quiz ---------- */
.quiz-top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.quiz-top .wrap { max-width: 760px; display: flex; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.quiz-top .title { flex: 1; min-width: 0; }
.quiz-top .title b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-top .title span { font-size: .8rem; color: var(--muted); }
.close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.close:hover { color: var(--ink); }
.progress { height: 6px; background: var(--ring-track); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); transition: width .4s ease; }
.counter { font-weight: 800; font-size: .9rem; background: var(--chip); padding: 6px 12px; border-radius: 99px; white-space: nowrap; }
.live-score { font-size: .8rem; color: var(--muted); white-space: nowrap; }

.stage { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }
.qcard { animation: rise .35s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); color: var(--muted); border-radius: 99px;
  padding: 4px 12px; font-size: .78rem; font-weight: 700; }
.sign-stage { display: grid; place-items: center; margin: 18px 0 6px; padding: 22px; border-radius: 18px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 14%, transparent), transparent), var(--surface-2);
  border: 1px solid var(--line); }
.sign-stage svg { width: 168px; height: 168px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.18)); }
.q { font-size: clamp(1.15rem, 2.6vw, 1.38rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.35; margin: 18px 0 18px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; display: flex; gap: 14px; align-items: center; width: 100%; padding: 15px 16px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; transition: border-color .15s, background .15s, transform .15s, box-shadow .2s; }
.opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow); }
.opt .k { flex: 0 0 32px; height: 32px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; font-size: .85rem; font-weight: 800; color: var(--muted); transition: background .15s, color .15s; }
.opt:disabled { cursor: default; }
.opt.dim { opacity: .55; }
.opt.correct { border-color: var(--good); background: var(--good-bg); animation: pop .35s ease; }
.opt.correct .k { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .4s ease; }
.opt.wrong .k { background: var(--bad); color: #fff; }
@keyframes pop { 50% { transform: scale(1.015); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.exp { margin-top: 16px; padding: 16px 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; gap: 12px; animation: rise .3s ease; }
.exp .dot { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.exp .dot.ok { background: var(--good); } .exp .dot.no { background: var(--bad); }
.exp p { margin: 0; }
.exp b.ok { color: var(--good); } .exp b.no { color: var(--bad); }
.next-row { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.next-row .btn { flex: 1; }
.kbd-hint { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 14px; }
kbd { font: inherit; font-size: .74rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }

/* ---------- Results ---------- */
.result-hero { text-align: center; padding: 34px 22px; }
.result-hero .ring { --size: 168px; --stroke: 12px; margin: 6px auto 16px; }
.result-hero .ring .center b { font-size: 2.2rem; }
.result-hero h2 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -.02em; }
.result-hero .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.partscores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; text-align: left; }
.partscore { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.partscore b { display: block; }
.partscore .big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.review-item { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.review-item:first-child { border-top: 0; padding-top: 4px; }
.review-item .thumb { width: 64px; height: 64px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.review-item .thumb svg { width: 50px; height: 50px; }
.review-item.nosign { grid-template-columns: 1fr; }
.review-item p { margin: 4px 0; }
.ans { display: flex; gap: 8px; align-items: flex-start; font-size: .94rem; }
.ans .tag { flex: 0 0 auto; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; margin-top: 2px; }
.ans .tag.no { background: var(--bad-bg); color: var(--bad); }
.ans .tag.ok { background: var(--good-bg); color: var(--good); }

/* Streak + tools */
.streak { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  background: rgba(255,255,255,.1); color: #fff; }
.pill svg { color: var(--gold); }
.kpi b small.of { font-size: .75rem; color: var(--muted); font-weight: 600; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .2s; }
.tool:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tool:disabled { cursor: default; opacity: .7; }
.tool b { font-size: 1.05rem; margin-top: 6px; }
.tool span:last-child { font-size: .86rem; color: var(--muted); }
.tool-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.tool-ico.t1 { background: linear-gradient(135deg, #f2b705, #f7d04b); color: #241a00; }
.tool-ico.t2 { background: linear-gradient(135deg, #0050a0, #2f7fd0); color: #fff; }
.tool-ico.t3 { background: linear-gradient(135deg, #1d6b45, #2f9e6a); color: #fff; }

/* Trend */
.trend { margin-bottom: 14px; }
.trend svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; font-weight: 600; margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Question head */
.qhead { display: flex; align-items: center; gap: 8px; }
.chip.mastered { background: var(--good-bg); color: var(--good); }
.star { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.star:hover { color: var(--gold); }
.star.on { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.star.on svg { fill: currentColor; }
.star:active { transform: scale(.92); }

/* Sign library */
.stage.wide { max-width: 1040px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 14px; box-shadow: var(--shadow); color: var(--muted); margin-bottom: 18px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 14px 0; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.flip { border: 0; padding: 0; background: none; cursor: pointer; perspective: 900px; height: 210px; text-align: left; }
.flip .inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flip.on .inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); display: grid; place-items: center; padding: 14px; overflow: hidden; }
.face.front svg { width: 120px; height: 120px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }
.face.back { transform: rotateY(180deg); align-content: start; justify-items: start; gap: 6px; background: var(--surface-2); color: var(--ink); }
.face.back b { font-size: .92rem; line-height: 1.3; }
.face.back span { font-size: .78rem; color: var(--muted); line-height: 1.4; }
.face.front { grid-template-rows: 1fr auto; }
.face .tap { font-size: .72rem; color: var(--muted); font-weight: 600; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (max-width: 760px) {
  .tools { grid-template-columns: 1fr; }
  .lib { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .flip { height: 190px; }
  .hero { padding-bottom: 84px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; margin-top: 22px; }
  .grid-2, .partscores { grid-template-columns: 1fr; }
  .part-body { flex-direction: row; }
  .ring { --size: 72px; --stroke: 8px; }
  .part-body { gap: 12px; }
  .kpi { padding: 8px 10px; }
  .kpi b { font-size: 1.05rem; }
  .topic { padding: 14px; }
  .topics { gap: 10px; }
  .section-title { flex-direction: column; align-items: flex-start; gap: 2px; }
  .live-score { display: none; }
  .sign-stage svg { width: 140px; height: 140px; }
  .kbd-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
