@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/nunito-latin.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --bg: #fff8ee;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #676b78;
  --line: #eadfce;
  --accent: #5b5bd6;
  --accent-ink: #ffffff;
  --accent-soft: #e9e9ff;
  --good: #15803d;
  --good-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fff1d6;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --star: #f5a70a;
  --star-off: #e7dccb;
  --shade: #86b2ea;
  --shade-locked: #5b7fbf;
  --paper: #ffffff;
  --proto: rgba(91, 91, 214, 0.07);
  --d-purple: #7c3aed;
  --d-blue: #2563eb;
  --d-orange: #ea580c;
  --d-green: #059669;
  --d-pink: #db2777;
  --c-red: #ef4444;
  --c-blue: #3b82f6;
  --c-yellow: #facc15;
  --c-green: #22c55e;
  --c-purple: #a855f7;
  --c-orange: #f97316;
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.06), 0 4px 14px rgba(60, 40, 10, 0.06);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #16171d;
    --card: #20222b;
    --ink: #eceef3;
    --muted: #a3a7b3;
    --line: #343747;
    --accent: #9b9bff;
    --accent-ink: #14142b;
    --accent-soft: #2d2d57;
    --good: #4ade80;
    --good-soft: #173826;
    --warn: #fbbf24;
    --warn-soft: #3b2c10;
    --bad: #f87171;
    --bad-soft: #3f1d1d;
    --star: #fbbf24;
    --star-off: #3a3d4c;
    --shade: #4a7cc4;
    --shade-locked: #7ea6e8;
    --paper: #2a2d38;
    --proto: rgba(155, 155, 255, 0.08);
    --d-purple: #a78bfa;
    --d-blue: #60a5fa;
    --d-orange: #fb923c;
    --d-green: #34d399;
    --d-pink: #f472b6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.loading { color: var(--muted); text-align: center; margin-top: 30vh; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- Home */

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 22px;
}

.logo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}

.hero h1 { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.01em; }

.hero p { margin: 2px 0 0; color: var(--muted); font-size: 1rem; }

.star-total {
  margin-left: auto;
  text-align: center;
  background: var(--card);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
  white-space: nowrap;
}

.star-total .big { font-size: 1.4rem; color: var(--star); }

.star-total small { display: block; font-weight: 600; color: var(--muted); font-size: 0.75rem; }

.grade-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: -8px 0 18px;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.grade-switch a {
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
}

.grade-switch a[aria-current] { background: var(--accent); color: var(--accent-ink); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
  transition: transform 0.12s;
}

.feature, .skill-card, a.btn, a.small-btn { text-decoration: none; }

.skill-card { color: var(--ink); }

a.btn { display: inline-flex; align-items: center; }

a.small-btn { color: var(--ink); }

.feature.alt { background: var(--card); color: var(--ink); border: 2px solid var(--accent); }

@media (hover: hover) {
  .feature:hover { transform: translateY(-2px); }
}

.feature .ico { font-size: 2.2rem; line-height: 1; }

.feature b { display: block; font-size: 1.2rem; font-weight: 900; }

.feature span.sub { display: block; font-size: 0.92rem; line-height: 1.35; opacity: 0.85; }

.domain { margin: 26px 0 10px; }

.domain-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--dc);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.domain-head h2 { font-size: 1.35rem; font-weight: 900; color: var(--dc); }

.domain-head small { color: var(--muted); font-size: 0.85rem; }

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  transition: transform 0.12s, border-color 0.12s;
  min-height: 118px;
}

@media (hover: hover) {
  .skill-card:hover { transform: translateY(-2px); border-color: var(--dc); }
}

.skill-card .t { font-weight: 900; font-size: 1.08rem; color: var(--dc); }

.skill-card .d { font-size: 0.9rem; color: var(--muted); line-height: 1.35; }

.skill-card .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.stars { color: var(--star-off); letter-spacing: 1px; font-size: 1.1rem; white-space: nowrap; }

.stars .on { color: var(--star); }

.home-foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}

.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 700;
}

/* ---------------------------------------------------------------- Play screen */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.back {
  border: none;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 800;
}

.topbar h1 { font-size: 1.2rem; font-weight: 900; flex: 1; min-width: 0; }

.topbar h1 small { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 700; }

.streak {
  font-weight: 900;
  color: var(--d-orange);
  white-space: nowrap;
  font-size: 1.05rem;
}

.progress {
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
}

.progress span {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--star-off);
  transition: background 0.3s;
}

.progress span.now { background: var(--accent); opacity: 0.45; }

.progress span.good { background: var(--good); }

.progress span.ok { background: var(--warn); }

.progress span.miss { background: var(--bad); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card.pop { animation: pop 0.35s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.say {
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
}

.stem { font-size: 1.2rem; }

.stem p, .prompt p { margin: 0 0 0.6em; }

.stem ul, .prompt ul { margin: 0.2em 0 0.6em; padding-left: 1.3em; }

.figure {
  margin: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
}

.part {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
}

.part:first-of-type.nolabel { border-top: none; padding-top: 0; margin-top: 10px; }

.part-label {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  border-radius: 8px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.prompt { font-size: 1.15rem; margin-bottom: 12px; }

.select-note { font-size: 1rem; margin: 0 0 10px; }

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

table.tbl {
  border-collapse: collapse;
  margin: 10px auto;
  font-size: 1.05rem;
}

table.tbl th, table.tbl td {
  border: 2px solid var(--ink);
  padding: 6px 16px;
  text-align: center;
  min-width: 5em;
}

table.tbl th { background: var(--accent-soft); font-weight: 800; }

.body table.tbl, .stem table.tbl { display: block; max-width: 100%; overflow-x: auto; width: fit-content; }

.note { color: var(--muted); font-size: 0.95rem; font-style: italic; }

.hint { margin-top: 6px; }

/* Choices */

.choices { display: grid; gap: 10px; }

.choices.layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.choices.layout-row,
.choices.layout-symbols { display: flex; flex-wrap: wrap; gap: 12px; }

.choices.layout-figs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 54px;
  font-size: 1.1rem;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}

@media (hover: hover) {
  .choice:hover:not(:disabled) { border-color: var(--accent); }
}

.choice:active:not(:disabled) { transform: scale(0.98); }

.choice .letter {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--muted);
}

.choices.multi .choice .letter { border-radius: 8px; }

.choice .body { min-width: 0; }

.choice[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }

.choice[aria-pressed='true'] .letter { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.choice.correct { border-color: var(--good); background: var(--good-soft); }

.choice.correct .letter { background: var(--good); border-color: var(--good); color: var(--card); }

.choice.correct.missed { border-style: dashed; background: var(--card); }

.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }

.choice.wrong .letter { background: var(--bad); border-color: var(--bad); color: var(--card); }

.choice.tried { opacity: 0.45; text-decoration: line-through; }

.choice:disabled { cursor: default; }

.layout-figs .choice { flex-direction: column; align-items: center; padding: 10px; }

.layout-figs .choice .letter { align-self: flex-start; }

.layout-figs .choice .body { width: 100%; display: flex; justify-content: center; }

.layout-symbols .choice {
  justify-content: center;
  min-width: 76px;
  font-size: 1.9rem;
  font-weight: 900;
  padding: 4px 18px;
}

.layout-symbols .choice .letter,
.layout-row .choice .letter { display: none; }

.layout-row .choice { justify-content: center; min-width: 100px; font-weight: 800; }

/* Typed answers */

.answer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  font-size: 1.2rem;
}

.in {
  width: 8.5em;
  padding: 10px 12px;
  border: 2.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
}

.in:focus { border-color: var(--accent); outline: none; }

.in.small { width: 3.4em; padding: 6px 4px; }

.in.good { border-color: var(--good); background: var(--good-soft); }

.in.bad { border-color: var(--bad); background: var(--bad-soft); }

.frac-in { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; }

.frac-in .bar { width: 100%; min-width: 3.4em; height: 3px; border-radius: 2px; background: var(--ink); }

.frac-in .fixed { font-size: 1.3rem; font-weight: 800; line-height: 1.6; }

.mixed-in { display: inline-flex; align-items: center; gap: 8px; }

.fields { display: grid; gap: 10px; }

.field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.field .lab { min-width: 7em; }

/* Interactive models */

.model {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.model svg { touch-action: none; user-select: none; -webkit-user-select: none; }

.model svg:focus { outline: none; }

.model svg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.model .count { font-weight: 800; color: var(--muted); font-size: 0.95rem; }

.model .tools { display: flex; gap: 10px; }

.small-btn {
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 0.9rem;
}

.model.locked svg { pointer-events: none; }

.side-by-side { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: flex-start; }

.side-by-side .cap { text-align: center; font-size: 0.85rem; color: var(--muted); font-weight: 800; }

/* Buttons + feedback */

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 26px;
  font-weight: 900;
  font-size: 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
  min-height: 50px;
}

.btn:disabled { opacity: 0.4; cursor: default; }

.btn.secondary { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; }

.btn.go { background: var(--good); color: var(--card); }

.feedback { margin-top: 14px; }

.fb {
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1.05rem;
}

.fb + .fb { margin-top: 10px; }

.fb.good { background: var(--good-soft); }

.fb.good .fb-title { color: var(--good); }

.fb.retry { background: var(--warn-soft); }

.fb.retry .fb-title { color: var(--warn); }

.fb.miss { background: var(--bad-soft); }

.fb.miss .fb-title { color: var(--bad); }

.fb.nudge { background: var(--bg); color: var(--muted); font-weight: 700; }

.fb-title { font-weight: 900; font-size: 1.15rem; }

.fb .ans { margin-top: 6px; font-weight: 700; }

details.how { margin-top: 8px; }

details.how summary { cursor: pointer; font-weight: 800; color: var(--accent); }

details.how .body { margin-top: 6px; }

details.how ol, details.how ul { margin: 4px 0; padding-left: 1.3em; }

.next-row { display: flex; justify-content: flex-end; margin-top: 16px; }

/* End screen */

.result { text-align: center; padding: 28px 20px; }

.result .big-stars { font-size: 3.2rem; letter-spacing: 6px; margin: 6px 0; }

.result .big-stars .on { color: var(--star); display: inline-block; animation: starIn 0.5s both; }

.result .big-stars .on:nth-child(2) { animation-delay: 0.15s; }

.result .big-stars .on:nth-child(3) { animation-delay: 0.3s; }

.result .big-stars span:not(.on) { color: var(--star-off); }

@keyframes starIn {
  0% { transform: scale(0) rotate(-40deg); }
  70% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.result h2 { font-size: 1.7rem; font-weight: 900; }

.result p { color: var(--muted); font-size: 1.1rem; }

.result .actions { justify-content: center; }

.review-list { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; display: grid; gap: 8px; }

.review-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.review-list .mark { font-weight: 900; width: 1.4em; text-align: center; }

.review-list .mark.good { color: var(--good); }

.review-list .mark.miss { color: var(--bad); }

.review-list .what { flex: 1; min-width: 12em; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }

.confetti i {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: fall 2.6s linear forwards;
}

@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); }
}

/* Intro + progress pages */

.intro h2 { font-size: 1.5rem; font-weight: 900; margin-bottom: 8px; }

.intro p { margin: 0 0 12px; }

.credit { color: var(--muted); font-size: 0.85rem; }

.table-wrap { overflow-x: auto; }

table.prog { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

table.prog th, table.prog td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

table.prog th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

table.prog td.num { text-align: right; font-variant-numeric: tabular-nums; }

table.prog tr.dom td { font-weight: 900; color: var(--dc); padding-top: 18px; }

/* ---------------------------------------------------------------- Math text */

.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.08;
  margin: 0 0.1em;
  font-size: 0.9em;
  font-weight: 700;
}

.frac > span { display: block; text-align: center; min-width: 0.8em; padding: 0 0.12em; }

.frac > span:first-child { border-bottom: 2px solid currentColor; }

.mixed { display: inline-flex; align-items: center; white-space: nowrap; }

.math { white-space: nowrap; }

.expr { text-align: center; font-size: 1.45em; font-weight: 800; margin: 0.5em 0; }

.blank {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  border: 2px solid currentColor;
  border-radius: 5px;
  vertical-align: middle;
}

.qbox {
  display: inline-block;
  min-width: 1.15em;
  padding: 0 0.15em;
  border: 2px solid currentColor;
  border-radius: 4px;
  line-height: 1.25;
  text-align: center;
  font-weight: 800;
}

.tcap { text-align: center; font-weight: 800; margin: 6px 0 -4px; }

/* ---------------------------------------------------------------- Figures (see js/draw.js) */

.fig { max-width: 100%; height: auto; overflow: visible; }

.fig.pat { overflow: visible; }

.fig text { font-family: inherit; font-weight: 700; }

.fig .ink { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.fig .thin { stroke-width: 1.3; }

.fig .hair { stroke-width: 0.9; }

.fig .fracbar { stroke-width: 1.5; }

.fig .dash { stroke-dasharray: 7 6; }

.fig .shape { fill: var(--paper); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }

.fig .shade { fill: var(--shade); }

.fig .fill-paper { fill: var(--paper); }

.fig .fill-ink { fill: var(--ink); stroke: none; }

.fig .fill-acc { fill: var(--accent); stroke: none; }

.fig .fill-acc-soft { fill: var(--accent-soft); }

.fig .ink-edge { stroke: var(--ink); stroke-width: 1.2; }

.fig .txt { fill: var(--ink); stroke: none; }

.fig .acc-txt { fill: var(--accent); }

.fig .italic { font-style: italic; }

.fig .ray { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }

.fig .acc-ray { stroke: var(--accent); stroke-width: 3.2; }

.fig .good-ray { stroke: var(--good); stroke-width: 3.2; stroke-dasharray: 8 5; }

.fig .tap { fill: transparent; cursor: pointer; }

@media (hover: hover) {
  .fig .tap:hover { fill: var(--accent-soft); }
}

.fig .good-pt { fill: none; stroke: var(--good); stroke-width: 3; stroke-dasharray: 5 4; }

.fig .acc-stroke { stroke: var(--accent); }

.fig .proto-body { fill: var(--proto); stroke: var(--ink); stroke-width: 1.6; }

.fig .proto-num { font-weight: 600; }

.fig .handle { fill: var(--accent); stroke: var(--card); stroke-width: 3; cursor: grab; }

.fig .hand-h { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }

.fig .hand-m { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }

.fig .c-red, .fig .c-blue, .fig .c-yellow, .fig .c-green, .fig .c-purple, .fig .c-orange, .fig .c-white {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.fig .c-red { fill: var(--c-red); }
.fig .c-blue { fill: var(--c-blue); }
.fig .c-yellow { fill: var(--c-yellow); }
.fig .c-green { fill: var(--c-green); }
.fig .c-purple { fill: var(--c-purple); }
.fig .c-orange { fill: var(--c-orange); }
.fig .c-white { fill: var(--paper); }

.fig .cell { cursor: pointer; }

.fig .locked { fill: var(--shade-locked); }

.fig .cell-line { stroke: var(--line); stroke-width: 1; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 12px 12px 48px; }
  .card { padding: 16px 14px; }
  .hero h1 { font-size: 1.7rem; }
  .logo { width: 52px; height: 52px; }
  .choices.layout-grid { grid-template-columns: 1fr; }
  .choices.layout-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stem { font-size: 1.1rem; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  table.tbl { font-size: 0.9rem; }
  table.tbl th, table.tbl td { padding: 4px 6px; min-width: 0; }
  .math.long { white-space: normal; }
  .choice { font-size: 1rem; padding: 10px 12px; }
  .skill-card { padding: 12px 11px 10px; min-height: 0; }
  .skill-card .t { font-size: 1rem; }
  .skill-card .d { font-size: 0.82rem; }
  .skill-card .foot { flex-wrap: wrap; gap: 4px; }
  .hero p { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sync-state { font-weight: 700; }

.sync-state.offline,
.sync-state.nokey { color: var(--warn); }

[hidden] { display: none !important; }

.main-menu { margin: 4px 0 6px; }

.main-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.link-warning {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}

.link-warning a { color: inherit; }
