:root {
  color-scheme: light;
  --ink: #20291f;
  --muted: #505e4e;
  --paper: #f5f6ee;
  --white: #fffefa;
  --green: #dceab1;
  --dark: #294a35;
  --line: #dbe1d2;
  --lilac: #ece7fa;
  font: 17px/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #6c4eae;
  outline-offset: 3px;
}
h1:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.6rem; letter-spacing: -.045em; line-height: 1.15; }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner, main, footer { width: min(100% - 36px, 1050px); margin: auto; }
.top-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -.055em; font-size: 1.28rem; white-space: nowrap; }
.brand span { display: inline-grid; place-items: center; width: 37px; height: 37px; background: var(--dark); color: white; border-radius: 13px; margin-right: 7px; font-size: 1.5rem; vertical-align: middle; }
.profile-chip, .secondary, .text-button { border: 1px solid var(--line); border-radius: 13px; background: var(--white); padding: 9px 13px; font-weight: 720; min-height: 44px; }
.profile-chip { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; text-align: left; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; padding: 6px 0; min-width: 0; }
.sound-toggle { font-size: .8rem; white-space: nowrap; }
.avatar { background: var(--lilac); color: #473779; display: inline-grid; place-items: center; border-radius: 50%; min-width: 32px; height: 32px; padding: 0 4px; font-size: .75rem; font-weight: 850; }
main { padding-top: 30px; }
.hero { background: var(--green); overflow: hidden; position: relative; min-height: 290px; padding: clamp(24px, 5vw, 52px); border-radius: 28px; display: grid; grid-template-columns: 1fr minmax(240px, .7fr); gap: 16px; align-items: center; }
.eyebrow, .progress-label { font-size: .72rem; font-weight: 850; letter-spacing: .13em; color: var(--dark); }
.eyebrow span { margin-right: 5px; }
.hero h1, .report-hero h1 { font-size: clamp(2.6rem, 6.9vw, 5rem); line-height: .96; letter-spacing: -.085em; margin: 13px 0 16px; }
.hero em, .equation em { font-style: normal; color: #42704e; }
.hero-art { position: relative; width: 100%; max-width: 335px; height: 185px; justify-self: center; }
.tile { position: absolute; top: 45px; width: 31%; height: 105px; border-radius: 23px; display: grid; place-items: center; font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 850; box-shadow: 0 6px 0 #382f2426; }
.tile.a { left: 4%; background: var(--white); transform: rotate(-13deg); }
.tile.b { left: 35%; background: #f9cc77; transform: translateY(-12px) rotate(9deg); z-index: 1; }
.tile.c { right: 3%; background: #e8dbff; transform: rotate(15deg); }
.spark { position: absolute; right: 16%; top: 0; color: var(--dark); font-size: 1.8rem; }
.spark.two { right: auto; left: 8%; top: auto; bottom: 0; font-size: 1.3rem; }
.dashboard { display: grid; grid-template-columns: 1.45fr 1fr; align-items: start; gap: 18px; margin-top: 18px; }
.mode-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.game-launcher { margin-top: 14px; }
.game-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 10px; margin-top: 12px; }
.game-choice { display: grid; gap: 4px; background: var(--paper); border: 1px solid var(--line);
  padding: 14px; border-radius: 13px; text-align: left; }
.game-choice:hover { background: var(--green); }
.game-choice strong { font-size: 1.16rem; }
.game-choice span { color: var(--muted); font-size: .9rem; }
.mode-nav [aria-current="page"] { background: var(--green); border-radius: 13px; font-weight: 800; padding: 10px 14px; }
.certifications, .certification-detail { max-width: 760px; }
.certifications h1, .certification-detail h1 { font-size: clamp(1.65rem, 4.5vw, 2.65rem); letter-spacing: -.055em; line-height: 1.1; }
.certifications p, .certification-detail p { margin-top: 7px; }
.certification-detail { margin-top: 12px; }
.certification-table { font-variant-numeric: tabular-nums; font-size: .92rem; }
.certification-table td, .certification-table th { padding: 2px 8px; vertical-align: middle; }
.certification-table thead th { padding-block: 8px; }
.certification-table tbody tr { cursor: pointer; }
.certification-table tbody tr:hover { background: var(--paper); }
.table-link { min-height: 44px; width: 100%; padding: 3px 6px; background: none; border: 0; text-align: left; font-weight: 800; white-space: nowrap; }
.table-link:hover { background: var(--green); border-radius: 9px; }
.table-link span { color: var(--muted); }
.badge-status { display: inline-block; border-radius: 10px; padding: 4px 8px; line-height: 1.15; font-weight: 720; }
.badge-status.earned { background: #dceab1; color: #294a35; }
.badge-status.practicing { background: #ffe8be; color: #51401e; }
.badge-status.untested { background: #eef0e9; color: #505e4e; }
.mobile-time { display: none; }
.missed-facts { display: grid; gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; }
.missed-facts li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; border-radius: 9px; background: var(--paper); }
.missed-facts li span { color: var(--muted); }
@media (max-width: 520px) {
  .certification-table td, .certification-table th { padding-inline: 4px; }
  .certification-table .desktop-time { display: none; }
  .certification-table .mobile-time { display: block; color: var(--muted); }
  .badge-status { font-size: .8rem; padding-inline: 6px; }
}
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: clamp(17px, 3vw, 28px); }
.panel .eyebrow { margin-bottom: 7px; }
.picker { margin-top: 18px; max-width: 640px; }
.profile-list { display: grid; gap: 8px; margin: 15px 0; }
.pick, .past { text-align: left; display: flex; align-items: center; gap: 10px; font-weight: 740; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 9px 12px; overflow-wrap: anywhere; }
.pick > :last-child, .past > :last-child { margin-left: auto; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.form-row input { flex: 1 1 180px; min-width: 0; }
input:not([type=checkbox]) { border: 1px solid #aab7a1; border-radius: 12px; padding: 10px 12px; background: white; color: var(--ink); }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: white; background: var(--dark); border: 1px solid var(--dark); border-radius: 13px; min-height: 48px; padding: 10px 16px; font-weight: 790; }
.primary:hover:not(:disabled) { background: #376346; }
.secondary:hover:not(:disabled), .pick:hover, .past:hover, .keypad button:hover:not(:disabled) { background: var(--green); }
.full { width: 100%; }
fieldset { border: 0; padding: 0; margin: 22px 0 18px; }
legend, label { font-weight: 740; }
.muted { color: var(--muted); font-size: .9rem; }
.tables { margin-top: 12px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.table { position: relative; }
.table input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.table span { display: grid; min-height: 46px; place-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.table input:checked + span { background: var(--green); border-color: #70904d; box-shadow: inset 0 -3px #a6bd72; }
.table input:focus-visible + span { outline: 3px solid #6c4eae; outline-offset: 2px; }
.round-settings { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 15px; }
#count { width: 77px; min-height: 44px; }
#history { display: grid; gap: 8px; margin-top: 15px; }
.history #resume, .history #learning-progress { margin-top: 12px; }
.past small { display: block; color: var(--muted); font-weight: 450; }
.empty { border: 1px dashed #aab7a1; border-radius: 12px; padding: 12px; color: var(--muted); }
.play-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.question, main:has(.question) .play-top { max-width: 520px; margin-left: auto; margin-right: auto; }
.progress-label { display: flex; justify-content: space-between; gap: 7px; }
progress { width: 100%; accent-color: #51723e; height: 11px; }
.equation { margin: 10px 0; font-size: clamp(3.5rem, 12vw, 5rem); font-weight: 850; letter-spacing: -.08em; text-align: center; line-height: 1.05; }
#answer-form { display: grid; max-width: 325px; margin: auto; gap: 7px; text-align: center; }
.flashcard { display: flex; justify-content: center; align-items: center; gap: clamp(6px, 2vw, 12px); min-height: 110px;
  margin: 6px 0; padding: 10px 6px; border: 1px solid #d7ddcf; border-radius: 15px; background: #fff;
  box-shadow: 0 3px 0 #e8ecdf; }
.flashcard .equation { font-size: clamp(1.85rem, 8.5vw, 3.5rem); white-space: nowrap; }
.answer-slot { position: relative; flex: 0 0 clamp(65px, 21vw, 101px); height: clamp(60px, 16vw, 77px); display: grid; place-items: center; perspective: 280px; }
#answer.sticky-answer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; transform-origin: left top;
  background: linear-gradient(145deg, #ffec9d 0 84%, #efcd65 85%); border-color: #dbb94c;
  box-shadow: 2px 3px 0 #d4b85b65; border-radius: 8px 8px 16px 8px; text-align: center;
  padding: 3px; font-size: clamp(1.8rem, 7vw, 2.75rem); font-weight: 850; }
#answer.sticky-answer::placeholder { color: #67521f; opacity: 1; }
#answer.peeled { pointer-events: none; animation: peel-note .24s ease-out both; }
@keyframes peel-note {
  45% { transform: translate(-3px, -5px) rotateY(-50deg) rotateZ(-5deg); }
  100% { transform: translate(-16px, -16px) rotateY(-100deg) rotateZ(-13deg); opacity: 0; }
}
.revealed-answer { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 8px; background: var(--paper);
  color: var(--dark); font-size: clamp(1.85rem, 8vw, 3rem); font-weight: 850; }
.flash-feedback { min-height: 33px; padding: 4px 8px; border-radius: 10px; font-size: .94rem; font-weight: 750; }
@media (prefers-reduced-motion: reduce) { #answer.peeled { animation: none; opacity: 0; } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button { min-height: clamp(48px, 7.4vw, 63px); background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; font-weight: 800; font-size: 1.16rem; }
.keypad button[data-key="Clear"] { font-size: .9rem; }
.keypad button[data-key="Clear"], .keypad button[data-key="⌫"] { background: #e9ebe8; border-color: #cdd1cc; color: #434a46; }
.keypad button[data-key="Clear"]:hover:not(:disabled), .keypad button[data-key="⌫"]:hover:not(:disabled) { background: #dce0dc; }
.good { background: #d3eddb; color: #17452e; border: 1px solid #57966d; position: relative; }
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkles i { position: absolute; font-style: normal; line-height: 1; animation: sparkle-pop .65s ease-out both; }
.sparkles i:nth-child(1) { left: 9%; top: 22%; color: #886015; --dx: -8px; --dy: -10px; }
.sparkles i:nth-child(2) { left: 16%; bottom: 13%; color: #614998; font-size: .72rem; --dx: -5px; --dy: 7px; }
.sparkles i:nth-child(3) { right: 10%; top: 16%; color: #614998; --dx: 8px; --dy: -10px; }
.sparkles i:nth-child(4) { right: 17%; bottom: 12%; color: #886015; font-size: .65rem; --dx: 5px; --dy: 7px; }
@keyframes sparkle-pop {
  0% { opacity: 0; transform: scale(.35); }
  45% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1.25) rotate(15deg); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .sparkles i { animation: none; } }
.try { background: #ffe8be; }
#hint { position: fixed; inset: 0 0 0 auto; margin: 0; border: 0; width: min(calc(100% - 28px), 510px); max-width: 100%; height: 100%; max-height: 100%; padding: clamp(14px, 4vw, 32px); background: var(--white); box-shadow: -10px 0 36px #20291f33; color: var(--ink); animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { #hint { animation: none; } }
#hint::backdrop { background: #1e271e7a; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hint-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.hint-card { background: var(--paper); border-radius: 15px; padding: clamp(7px, 2vw, 13px); }
.hint-card h3 { font-size: 1rem; text-align: center; }
.hint-card ol { list-style: none; padding: 0; margin: 7px 0 0; }
.hint-card li { display: flex; justify-content: space-between; gap: 4px; padding: 4px; font-variant-numeric: tabular-nums; font-size: .89rem; }
.hint-card .match { background: var(--green); font-weight: 850; border-radius: 7px; }
.report-hero { background: var(--green); padding: clamp(24px, 5vw, 45px); border-radius: 25px; overflow-wrap: anywhere; }
.report-hero h1 { font-size: clamp(2.1rem, 6vw, 4rem); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.metric { display: grid; align-content: start; padding: clamp(9px, 3vw, 20px); }
.metric strong { font-size: clamp(1.35rem, 5vw, 2.4rem); letter-spacing: -.06em; }
.metric span { font-size: .82rem; color: var(--muted); }
.report-context { padding: 13px 0; color: var(--muted); }
.table-times { margin-bottom: 12px; }
.table-times .muted { margin-top: 6px; }
.table-times ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.table-times li { display: grid; padding: 9px 12px; border-radius: 11px; background: var(--paper); }
.table-times li span { font-size: .85rem; color: var(--muted); }
.focus { background: var(--lilac); margin-top: 12px; }
.focus p:not(.eyebrow), .progress-panel > p { margin-top: 7px; }
.focus button { margin-top: 14px; }
.focus-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; }
.focus-header > div { flex: 1 1 280px; }
.focus-header button { margin-top: 0; }
.retry { margin-top: 16px; padding-top: 14px; border-top: 1px solid #cdc1e9; }
.retry-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.retry-facts details { min-width: 78px; padding: 8px 11px; background: var(--white); border-radius: 10px; }
.retry-facts summary { cursor: pointer; font-weight: 750; }
.progress-panel { margin-top: 12px; max-width: 720px; }
.progress-panel h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.055em; }
.progress-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
#progress-table { font: inherit; min-height: 44px; border: 1px solid #aab7a1; border-radius: 10px; padding: 0 8px; background: var(--white); color: var(--ink); }
.wizard-certificate { display: grid; grid-template-columns: minmax(0, 1fr) clamp(75px, 20vw, 153px);
  align-items: center; gap: 8px; padding: clamp(12px, 3vw, 26px); border: 4px double #b8a3d5; border-radius: 16px;
  background: #f6efff; color: #302343; }
.wizard-certificate .eyebrow { color: #5a4375; }
.wizard-certificate h2 { font-family: Georgia, serif; font-size: clamp(1.46rem, 5vw, 2.75rem); letter-spacing: -.045em; }
.wizard-certificate p:last-child { margin-top: 9px; font-size: .9rem; }
.wizard-certificate img { width: 100%; height: auto; display: block; }
.certificate-name { font-size: .9rem; font-weight: 730; margin-top: 5px; overflow-wrap: anywhere; }
.progress-takeaway { margin-top: 12px; }
.practice-history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.practice-history summary { cursor: pointer; font-weight: 750; }
.practice-history .recall-trend { margin-top: 12px; }
.progress-list { display: grid; gap: 6px; list-style: none; padding: 0; margin: 12px 0; }
.progress-list li { display: grid; gap: 4px; background: var(--paper); border-radius: 10px; padding: 9px 12px; }
.progress-list small { color: var(--muted); }
.progress-bar { height: 9px; border-radius: 8px; background: #dbe1d2; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: #51723e; }
.recall-trend { background: var(--lilac); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.recall-trend h2 { font-size: 1.08rem; margin-bottom: 4px; }
.recall-trend strong { font-size: 1.4rem; }
.quick-offer { margin-top: 12px; background: #fff1bd; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.quick-offer p { margin-top: 5px; }
.quick-results { margin-top: 12px; }
#practice-table { margin-top: 14px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.review summary { cursor: pointer; font-weight: 750; }
.review-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: 9px; text-align: left; font-size: .85rem; }
td, th { padding: 7px; border-bottom: 1px solid var(--line); }
#notice { position: fixed; bottom: 12px; right: 12px; max-width: min(390px, calc(100vw - 24px)); background: #fff5e2; border: 1px solid #b08543; border-radius: 12px; padding: 12px; box-shadow: 0 3px 14px #20291f30; z-index: 5; }
footer { padding: 24px 0; color: var(--muted); font-size: .8rem; }
footer span { margin: 0 4px; }
@media (max-width: 630px) {
  main { padding-top: 16px; }
  .hero { grid-template-columns: 1fr; gap: 0; min-height: 0; }
  .hero-art { width: 180px; height: 94px; justify-self: end; margin-top: 9px; }
  .tile { top: 22px; height: 59px; border-radius: 13px; }
  .spark { font-size: 1.05rem; }
  .spark.two { font-size: .85rem; }
  .dashboard { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
}
@media (max-width: 355px) {
  .tables { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top-inner, main, footer { width: calc(100% - 20px); }
}
.game-choice { color: inherit; text-decoration: none; }
.game-choice.complements { background: #fff1c6; }
.game-choice.graphs { background: #ede5fb; }
.certification-detail h2 { margin-top: 16px; }
.round-settings select, .mini-controls select { min-height: 44px; padding: 5px 9px; font: inherit; color: inherit; background: white; border: 1px solid var(--line); border-radius: 10px; }
.mini-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.mini-controls input { width: min(100%, 13rem); min-height: 44px; }
.mini-result { display: grid; gap: 8px; margin-top: 10px; }
.addition-stack { display: grid; justify-items: end; border-bottom: 2px solid var(--dark); font-weight: 850; font-size: 1.65rem; line-height: 1.2; padding: 4px 8px; }

.writing-toggle { justify-self: end; font-size: .84rem; }
.club-welcome { padding: clamp(20px, 5vw, 43px); background: #e9edda; border-radius: 22px; }
.club-welcome h1, .game-rules h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.1; letter-spacing: -.06em; }
.club-welcome p, .game-rules > p { margin-top: 8px; }
.game-hub { grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); }
.game-hub .game-choice { gap: 6px; padding: clamp(15px, 3vw, 23px); align-content: start; }
.game-hub .game-choice:hover { border-color: #697e60; }
.game-hub .game-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fffefa; color: var(--dark); font-size: 1.65rem; font-weight: 850; margin-bottom: 6px; }
.game-hub .game-entry { margin-top: 7px; color: var(--dark); font-weight: 760; }
.multiplication { background: #e4edce; }
.complements { background: #fff1c6; }
.graphs { background: #ede5fb; }
.game-rules { max-width: 730px; margin-top: 12px; }
.game-rules ol { padding-left: 1.35em; margin: 9px 0 0; }
.game-rules li + li { margin-top: 5px; }
.rule-example { background: #fffefa; border-radius: 12px; padding: 12px; margin: 14px 0; font-size: clamp(1.2rem, 4vw, 1.65rem); font-weight: 750; }
.rule-action { border-top: 1px solid #77765c44; margin-top: 17px; padding-top: 13px; }
.rule-action > button { margin-top: 10px; }
@media (max-width: 480px) {
  .game-hub .game-choice { grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; }
  .game-hub .game-icon { grid-row: span 3; }
  .game-hub .game-entry { margin-top: 2px; }
}
.welcome-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.account-panel > p { margin-top: 12px; }
.account-form { display: grid; gap: 12px; margin-top: 12px; }
.account-form p { display: grid; gap: 4px; }
.account-form input { width: 100%; }
.account-form .errorlist { margin: 0; padding-left: 1.2em; color: #852b22; }
@media (max-width: 650px) { .welcome-layout { grid-template-columns: minmax(0, 1fr); } }
.account-form .guardian-check { display: flex; align-items: flex-start; gap: 9px; margin-top: 8px; }
.account-form .guardian-check input { width: auto; margin-top: .35em; }
.account-form details summary { cursor: pointer; }
.account-form details p { margin-top: 7px; }
