:root {
  --ink:#3D3653;
  --muted:#777184;
  --purple:#8064C6;
  --purple-dark:#684AAD;
  --purple-soft:#F0EBFA;
  --yellow:#FFD66D;
  --mint:#B9E5D8;
  --pink:#F7CCD5;
  --paper:#FAF8F2;
  --border:#EAE6ED;
  --shadow:0 5px 0 #E9E4EF;
  --round:24px;
  color-scheme:light;
  font-family:"Hiragino Maru Gothic ProN","BIZ UDPGothic","Yu Gothic",Meiryo,system-ui,sans-serif;
  color:var(--ink);
  background:var(--paper)
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background-image:radial-gradient(#DDD4E7 .8px,transparent .8px);
  background-size:24px 24px
}
button,input,select {
  font:inherit
}
button,a,input,select {
  -webkit-tap-highlight-color:transparent
}
button {
  cursor:pointer;
  color:inherit
}
button:disabled {
  cursor:default
}
a {
  color:inherit;
  text-decoration:none
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #AF86DF;
  outline-offset:4px
}
button {
  touch-action:manipulation
}
button:active:not(:disabled) {
  transform:translateY(2px)
}
[hidden] {
  display:none!important
}
h1,h2,h3,p {
  margin:0
}
fieldset {
  border:0;
  margin:0;
  padding:0
}
legend {
  padding:0
}
img {
  max-width:100%;
  display:block
}
.page {
  max-width:1120px;
  margin:0 auto;
  padding:0 40px
}
.topbar {
  min-height:100px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-bottom:1px solid var(--border)
}
.brand {
  display:flex;
  align-items:center;
  gap:9px;
  font-size:22px;
  font-weight:900;
  letter-spacing:.04em
}
.brand-icon {
  display:grid;
  place-items:center;
  width:37px;
  height:37px;
  border-radius:12px;
  background:var(--purple);
  color:var(--yellow);
  font-size:29px;
  transform:rotate(-6deg)
}
.brand-small {
  font-size:9px;
  letter-spacing:.15em;
  color:var(--muted);
  margin:4px 0 0 4px
}
.topbar nav {
  display:flex;
  align-items:center;
  gap:24px;
  font-size:12px;
  font-weight:700
}
.sound-button {
  background:white;
  border:1px solid var(--border);
  border-radius:20px;
  padding:8px 13px;
  color:var(--purple-dark);
  min-height:36px
}
.back-link {
  color:var(--muted)
}
.back-link span {
  margin-left:5px
}
.hero {
  display:grid;
  grid-template-columns:1.2fr 1fr;
  align-items:center;
  min-height:380px;
  padding:35px 0 39px;
  gap:15px
}
.eyebrow {
  font-size:11px;
  font-weight:800;
  letter-spacing:.13em;
  color:var(--purple);
  line-height:1.8
}
.hero .eyebrow {
  font-size:12px;
  letter-spacing:.05em;
  margin-bottom:15px
}
.hero .eyebrow span {
  font-size:20px;
  vertical-align:middle;
  margin-right:7px
}
.hero h1 {
  font-size:clamp(34px,4.1vw,48px);
  letter-spacing:.025em;
  line-height:1.5;
  font-weight:900
}
.hero h1>span {
  color:var(--purple)
}
.lead {
  font-size:14px;
  line-height:1.95;
  color:var(--muted);
  margin-top:15px
}
.hero-tags {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:19px
}
.hero-tags span {
  font-size:10px;
  font-weight:700;
  background:#FFFDF8;
  border:1px solid #E6DFD3;
  border-radius:20px;
  padding:5px 10px
}
.hero-art {
  position:relative;
  align-self:center
}
.hero-art>img {
  width:100%;
  animation:bob 5s ease-in-out infinite
}
.speech {
  position:absolute;
  top:4%;
  right:20%;
  background:white;
  border:1px solid #E2DBEC;
  border-radius:20px;
  padding:10px 14px;
  font-size:12px;
  font-weight:800;
  transform:rotate(4deg)
}
.speech:after {
  content:"";
  position:absolute;
  bottom:-8px;
  left:25px;
  width:14px;
  height:14px;
  background:white;
  border-right:1px solid #E2DBEC;
  border-bottom:1px solid #E2DBEC;
  transform:rotate(45deg)
}
.floating-equation {
  position:absolute;
  background:white;
  box-shadow:0 5px 16px #4C35570D;
  border-radius:12px;
  padding:12px 16px;
  font-size:17px;
  font-weight:800;
  white-space:nowrap
}
.floating-equation b {
  color:var(--purple)
}
.eq-one {
  left:0;
  top:30%;
  transform:rotate(-10deg)
}
.eq-two {
  right:-5px;
  bottom:8%;
  transform:rotate(8deg)
}
.home-grid {
  display:grid;
  grid-template-columns:minmax(0,1.8fr) minmax(0,1fr);
  gap:24px;
  align-items:start
}
.card {
  background:white;
  border:1px solid var(--border);
  border-radius:var(--round);
  box-shadow:var(--shadow)
}
.setup-card {
  padding:28px
}
.card-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px
}
.card-heading h2 {
  font-size:18px;
  line-height:1.6;
  font-weight:900
}
.mini-label {
  font-size:9px;
  letter-spacing:.12em;
  font-weight:800;
  color:#AAA0BA
}
.choice-field,.table-field {
  margin-top:23px
}
legend {
  font-size:13px;
  font-weight:800;
  margin-bottom:13px;
  display:flex;
  align-items:center;
  gap:9px
}
.step-number {
  display:inline-grid;
  place-items:center;
  min-width:24px;
  height:24px;
  background:var(--purple-soft);
  color:var(--purple);
  border-radius:8px;
  font-size:11px
}
.style-options,.mode-options {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px
}
.choice,.mode-choice {
  position:relative;
  cursor:pointer;
  display:block
}
.choice input,.mode-choice input {
  position:absolute;
  opacity:0;
  width:1px;
  height:1px
}
.choice>span {
  border:2px solid var(--border);
  border-radius:15px;
  padding:13px 8px 14px;
  display:flex;
  align-items:center;
  text-align:center;
  flex-direction:column;
  gap:6px;
  background:#FDFCFD;
  transition:border-color .15s,background .15s
}
.choice input:checked+span,.mode-choice input:checked+span {
  border-color:var(--purple);
  background:var(--purple-soft)
}
.choice input:focus-visible+span,.mode-choice input:focus-visible+span {
  outline:3px solid #B08ADA;
  outline-offset:3px
}
.choice input:checked+span:after,.mode-choice input:checked+span:after {
  content:"✓";
  position:absolute;
  right:9px;
  top:7px;
  font-size:11px;
  color:var(--purple);
  font-weight:900
}
.choice-icon {
  font-size:25px;
  line-height:1.3
}
.choice strong {
  font-size:13px
}
.choice small,.mode-choice small {
  font-size:10px;
  color:var(--muted);
  line-height:1.6
}
.mode-choice>span {
  border:2px solid var(--border);
  border-radius:12px;
  padding:11px 12px;
  display:flex;
  flex-direction:column;
  gap:5px
}
.mode-choice strong {
  font-size:13px
}
.table-buttons {
  display:grid;
  grid-template-columns:repeat(9,1fr);
  gap:5px
}
.table-buttons button {
  background:#FCFAFE;
  border:1.5px solid var(--border);
  border-radius:10px;
  min-height:56px;
  font-size:20px;
  font-weight:900;
  padding:6px 0
}
.table-buttons small {
  display:block;
  font-size:8px;
  font-weight:600;
  margin-top:3px
}
.table-buttons button[aria-pressed=true] {
  border-color:var(--purple);
  background:var(--purple);
  color:white;
  box-shadow:0 3px 0 #5F45A2
}
.table-buttons button.mastered:after {
  content:"★";
  font-size:8px;
  color:#D5A447;
  display:block
}
.table-buttons button.mastered[aria-pressed=true]:after {
  color:var(--yellow)
}
.start-meta {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-top:22px;
  border-top:1px dashed var(--border);
  padding-top:19px
}
.start-meta label {
  font-size:12px;
  font-weight:700;
  white-space:nowrap
}
.start-meta label span {
  color:var(--muted);
  font-size:10px
}
.start-meta input {
  min-width:0;
  width:160px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#FBFAFD;
  padding:9px 12px;
  font-size:12px;
  color:var(--ink)
}
.setup-note {
  font-size:11px;
  color:var(--purple-dark);
  text-align:center;
  margin:18px 0 12px;
  line-height:1.7
}
.primary-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:15px;
  border:0;
  border-radius:14px;
  background:var(--purple);
  color:white;
  font-size:15px;
  font-weight:800;
  padding:16px 23px;
  min-height:52px;
  box-shadow:0 4px 0 var(--purple-dark);
  transition:background .15s
}
.primary-button:hover:not(:disabled) {
  background:var(--purple-dark)
}
.primary-button:disabled {
  opacity:.55;
  box-shadow:none
}
.start-button {
  width:100%;
  font-size:18px;
  letter-spacing:.05em;
  min-height:60px
}
.start-button span {
  font-size:24px;
  position:absolute;
  right:28px
}
.start-button {
  position:relative
}
.input-note {
  text-align:center;
  font-size:10px;
  color:var(--muted);
  line-height:1.7;
  margin-top:15px
}
.side-stack {
  display:grid;
  gap:18px
}
.collection-card {
  padding:24px
}
.collection-card .card-heading>span {
  color:#D4A23F;
  font-size:25px
}
.star-total {
  display:flex;
  justify-content:center;
  align-items:baseline;
  gap:10px;
  margin:14px 0 8px
}
.star-total>span:first-child {
  font-size:32px;
  color:#E9B54F;
  align-self:center
}
.star-total strong {
  font:900 54px/1.2 system-ui,sans-serif;
  letter-spacing:-.03em
}
.star-total>span:last-child {
  font-size:13px;
  color:var(--muted)
}
.collection-card>p {
  font-size:11px;
  text-align:center;
  color:var(--muted);
  line-height:1.8
}
.collection-divider {
  height:1px;
  background:var(--border);
  margin:22px 0 17px
}
.collection-card h3 {
  font-size:12px;
  margin-bottom:13px
}
.mastered-rows {
  display:grid;
  grid-template-columns:repeat(9,1fr);
  gap:4px;
  margin-bottom:12px
}
.mastered-rows span {
  font:800 12px/1 system-ui,sans-serif;
  aspect-ratio:1;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#F1EEF5;
  color:#ACA4B9;
  border:1px dashed #D9D1E2
}
.mastered-rows span.earned {
  background:#FFE8A4;
  border:1px solid #EABD57;
  color:#886421
}
.small-note {
  font-size:10px;
  color:var(--muted);
  line-height:1.8
}
.tips-card {
  position:relative;
  border-radius:18px;
  background:#F5EDCF;
  padding:23px 20px;
  border:1px solid #EBE1B9
}
.tips-card h3 {
  font-size:13px;
  margin-bottom:10px
}
.tips-card p {
  font-size:11px;
  color:#81735A;
  line-height:1.9
}
.tips-star {
  position:absolute;
  right:14px;
  top:9px;
  font-size:30px;
  color:#C7A465
}
.rules {
  border-radius:16px;
  box-shadow:none
}
.rules summary {
  cursor:pointer;
  font-size:11px;
  font-weight:700;
  padding:17px 18px;
  list-style:none;
  display:flex;
  justify-content:space-between
}
.rules summary::-webkit-details-marker {
  display:none
}
.rules summary span {
  font-size:16px;
  color:var(--purple)
}
.rules[open] summary span {
  transform:rotate(45deg)
}
.rules>div {
  padding:0 18px 18px;
  font-size:11px;
  line-height:1.9;
  color:var(--muted)
}
.rules p+p {
  margin-top:12px
}
.ranking-card {
  padding:28px;
  margin-top:34px
}
.ranking-card .eyebrow,.badge-section .eyebrow {
  font-size:9px;
  margin-bottom:4px
}
.device-label {
  font-size:10px;
  color:var(--muted);
  background:#F4F1F7;
  border-radius:20px;
  padding:6px 10px;
  white-space:nowrap
}
.ranking-filters {
  display:flex;
  gap:12px;
  align-items:end;
  margin:22px 0 10px;
  flex-wrap:wrap
}
.ranking-filters label {
  font-size:10px;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  gap:6px
}
.ranking-filters select {
  border:1px solid #DFD8E7;
  border-radius:9px;
  padding:10px 30px 10px 11px;
  color:var(--ink);
  background:#FDFCFE;
  font-size:12px;
  min-height:40px
}
.ranking-empty {
  text-align:center;
  background:#FAF9FC;
  border-radius:16px;
  margin-top:18px;
  padding:26px 15px
}
.ranking-empty>span {
  color:#C5B5E3;
  font-size:32px
}
.ranking-empty p {
  font-weight:700;
  font-size:13px;
  margin:5px 0 8px
}
.ranking-empty small {
  font-size:11px;
  color:var(--muted)
}
.ranking-table-wrap {
  margin-top:15px
}
.ranking-table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
  font-variant-numeric:tabular-nums
}
.ranking-table th {
  text-align:left;
  font-size:10px;
  color:var(--muted);
  font-weight:600;
  padding:10px;
  border-bottom:1px solid var(--border)
}
.ranking-table td {
  padding:14px 10px;
  border-bottom:1px solid #F1EDF5
}
.ranking-table tr:last-child td {
  border:0
}
.ranking-table td:first-child {
  font-weight:800;
  color:var(--purple);
  width:65px
}
.ranking-table td:nth-child(2) {
  max-width:170px;
  overflow-wrap:anywhere
}
.ranking-table td:nth-child(3) {
  font-weight:700
}
.ranking-table td:last-child {
  font:12px system-ui,sans-serif;
  white-space:nowrap;
  color:var(--muted)
}
.ranking-table tr.new-record {
  background:#F8F4FF
}
.rank-score small {
  display:block;
  font-weight:500;
  color:var(--muted);
  font-size:10px;
  margin-top:4px
}
.badge-section {
  padding:33px 0 0
}
.badge-list {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin-top:18px
}
.badge {
  background:#F5F3F4;
  border:1px dashed #DFD9E4;
  border-radius:16px;
  text-align:center;
  padding:17px 8px;
  color:#918998
}
.badge>span {
  font-size:25px;
  display:inline-block;
  filter:grayscale(1);
  opacity:.5
}
.badge h3 {
  font-size:11px;
  margin:9px 0 5px
}
.badge p {
  font-size:9px;
  line-height:1.7
}
.badge.unlocked {
  background:#FFFCF4;
  border-style:solid;
  border-color:#EEDDAD;
  color:var(--ink)
}
.badge.unlocked>span {
  filter:none;
  opacity:1
}
.badge.unlocked h3:after {
  content:" ✓";
  color:#A5832B
}
footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:35px 0 25px;
  margin-top:26px;
  border-top:1px solid var(--border);
  font-size:9px;
  color:#89808E;
  line-height:1.9
}
footer>span {
  white-space:nowrap
}
footer>span>span {
  color:var(--purple);
  margin:0 5px
}
.storage-warning {
  background:#FFF0DA;
  border:1px solid #E9C994;
  color:#795524;
  border-radius:13px;
  padding:15px;
  margin-top:20px;
  font-size:12px;
  line-height:1.8
}
.play-screen {
  padding-top:28px
}
.play-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-bottom:23px
}
.play-heading h1 {
  font-size:19px;
  margin-top:3px
}
.quiet-button {
  background:white;
  border:1px solid #DCD4E7;
  border-radius:12px;
  font-size:12px;
  font-weight:700;
  padding:12px 16px;
  min-height:44px
}
.hud {
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  background:white;
  border:1px solid var(--border);
  border-radius:19px;
  padding:15px 20px;
  text-align:center
}
.hud>div+div {
  border-left:1px solid var(--border)
}
.hud>div>span {
  display:block;
  font-size:10px;
  color:var(--muted);
  margin-bottom:3px
}
.hud strong {
  font:900 34px/1.2 system-ui,sans-serif;
  letter-spacing:-.02em
}
.hud small {
  font-size:10px;
  margin-left:4px
}
.score-stat strong {
  color:var(--purple)
}
.streak-stat strong {
  color:#B99135
}
.time-stat.low strong {
  color:#CD587B
}
.time-track {
  height:7px;
  background:#E7DFEF;
  border-radius:20px;
  margin:10px 0 22px;
  overflow:hidden
}
.time-track>div {
  height:100%;
  background:var(--purple);
  border-radius:20px;
  transition:width .15s linear
}
.time-track.low>div {
  background:#D87591
}
.play-grid {
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);
  gap:28px;
  align-items:start
}
.question-card {
  padding:23px 30px 21px;
  text-align:center;
  position:relative
}
.question-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:11px;
  color:var(--muted);
  font-weight:700
}
.question-top>span:last-child {
  background:var(--purple-soft);
  color:var(--purple);
  padding:5px 10px;
  border-radius:20px;
  font-size:9px
}
.question-prompt {
  font-size:13px;
  font-weight:700;
  color:var(--muted);
  margin:20px 0 10px
}
.question {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  font:900 clamp(40px,5vw,64px)/1.35 system-ui,sans-serif;
  min-height:85px;
  white-space:nowrap
}
.question .operator {
  font-size:.65em;
  color:#9D93AD
}
.question-mark {
  color:var(--purple);
  background:var(--purple-soft);
  border-radius:16px;
  min-width:80px;
  text-align:center
}
.answer-row {
  display:flex;
  gap:12px;
  margin:18px auto 0;
  max-width:415px
}
.answer-row input {
  min-width:0;
  width:42%;
  border:2px solid #D6C9EC;
  border-radius:13px;
  background:#FDFCFF;
  font:800 30px system-ui,sans-serif;
  text-align:center;
  color:var(--ink);
  height:58px;
  caret-color:var(--purple)
}
.answer-row input::placeholder {
  font:600 15px "Yu Gothic",sans-serif;
  color:#ABA1B8
}
.answer-row .primary-button {
  flex:1;
  padding:12px;
  min-height:58px;
  font-size:15px;
  gap:8px
}
.answer-row .primary-button span {
  opacity:.6
}
.feedback {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  min-height:72px;
  margin:14px 0 12px;
  background:#F6F4F9;
  border-radius:12px;
  padding:9px;
  line-height:1.5
}
.feedback strong {
  font-size:12px;
  font-weight:700;
  color:var(--muted)
}
.feedback>span {
  font-size:11px;
  color:var(--muted)
}
.feedback.correct {
  background:#EAF7EF
}
.feedback.correct strong {
  color:#328667;
  font-size:18px
}
.feedback.wrong {
  background:#FFF0E7
}
.feedback.wrong strong {
  color:#9D6441;
  font-size:20px
}
.feedback.wrong>span {
  color:#AD7654
}
.keypad {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  max-width:415px;
  margin:auto
}
.keypad button {
  font:800 23px system-ui,sans-serif;
  border:1px solid #E0D9EB;
  border-bottom:3px solid #DAD2E5;
  background:#FAF8FD;
  border-radius:11px;
  min-height:49px;
  padding:7px;
  transition:background .1s
}
.keypad button:hover:not(:disabled) {
  background:var(--purple-soft)
}
.keypad button:disabled {
  opacity:.4
}
.keypad .key-clear {
  font:700 11px "Yu Gothic",sans-serif;
  background:#F4F0F7;
  color:var(--muted)
}
.keypad .key-delete {
  background:#F4F0F7;
  font-size:20px;
  color:var(--muted)
}
.play-companion {
  padding-top:15px;
  text-align:center
}
.companion-bubble {
  padding:20px 15px;
  position:relative;
  border:1px solid #DBD1EA;
  background:white;
  border-radius:20px;
  box-shadow:0 4px 0 #E9E3F0;
  display:flex;
  flex-direction:column;
  gap:8px
}
.companion-bubble strong {
  font-size:13px
}
.companion-bubble>span {
  font-size:10px;
  color:var(--muted);
  line-height:1.7
}
.companion-bubble:after {
  content:"";
  position:absolute;
  bottom:-8px;
  left:45%;
  width:15px;
  height:15px;
  background:white;
  border-bottom:1px solid #DBD1EA;
  border-right:1px solid #DBD1EA;
  transform:rotate(45deg)
}
.play-companion>img {
  margin:10px auto 0;
  animation:bob 5s ease-in-out infinite
}
.combo-card {
  background:#FFF5D6;
  border:1px solid #ECDEAE;
  border-radius:16px;
  padding:20px 12px
}
.combo-card p {
  font-size:11px;
  color:#8C7135;
  font-weight:700
}
.combo-stars {
  font-size:29px;
  letter-spacing:6px;
  color:#D5AA42;
  margin-top:9px
}
.elapsed-label {
  color:var(--muted);
  font-size:10px;
  margin-top:20px
}
.elapsed-label span {
  font:12px system-ui,sans-serif;
  margin-left:7px
}
.result-screen {
  max-width:800px;
  margin:40px auto 0;
  padding:35px;
  text-align:center
}
.result-star {
  font-size:64px;
  color:#E8B343;
  line-height:1.3;
  margin:12px 0
}
.result-screen h1 {
  font-size:25px;
  line-height:1.6
}
.result-screen>p:not(.eyebrow) {
  font-size:12px;
  line-height:1.9;
  color:var(--muted);
  margin-top:8px
}
.result-score {
  margin:13px 0 0;
  color:var(--purple)
}
.result-score strong {
  font:900 66px system-ui,sans-serif
}
.result-score span {
  font-size:14px;
  margin-left:7px
}
.result-screen .result-ranking {
  color:var(--purple-dark)!important;
  background:var(--purple-soft);
  border-radius:25px;
  display:inline-block;
  padding:5px 15px;
  font-weight:700
}
.result-stats {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  background:#F8F6FB;
  border-radius:16px;
  padding:18px 8px;
  margin:23px 0
}
.result-stats span {
  display:block;
  font-size:9px;
  color:var(--muted);
  margin-bottom:7px
}
.result-stats strong {
  font:800 18px system-ui,sans-serif
}
.earned-badges {
  display:flex;
  justify-content:center;
  gap:9px;
  flex-wrap:wrap
}
.earned-badges>span {
  font-size:11px;
  background:#FFF6D9;
  border:1px solid #ECDBA0;
  padding:10px 13px;
  border-radius:12px
}
.missed-section {
  margin-top:23px;
  padding-top:22px;
  border-top:1px dashed var(--border)
}
.missed-section h2 {
  font-size:14px;
  margin-bottom:13px
}
.missed-problems {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  margin-bottom:15px
}
.missed-problems>span {
  background:#FFF2E8;
  color:#8E624D;
  font:700 16px system-ui,sans-serif;
  padding:10px 14px;
  border-radius:10px
}
.secondary-button {
  border:1px solid #D4C5E9;
  background:var(--purple-soft);
  color:var(--purple-dark);
  font-size:12px;
  font-weight:700;
  border-radius:12px;
  padding:13px 18px;
  min-height:46px
}
.result-actions {
  display:flex;
  justify-content:center;
  gap:13px;
  flex-wrap:wrap;
  margin-top:25px
}
.pause-dialog {
  max-width:430px;
  width:calc(100% - 40px);
  border:1px solid #DCD2E8;
  border-radius:25px;
  background:#FFFEFC;
  color:var(--ink);
  text-align:center;
  padding:28px;
  box-shadow:0 20px 90px #35234530
}
.pause-dialog::backdrop {
  background:#39285266;
  backdrop-filter:blur(5px)
}
.pause-icon {
  font-size:52px;
  color:#BCABE0
}
.pause-dialog h2 {
  font-size:20px;
  margin:8px 0 12px
}
.pause-dialog>p {
  font-size:12px;
  line-height:1.9;
  color:var(--muted)
}
.pause-dialog button {
  display:block;
  width:100%;
  margin-top:16px
}
.pause-dialog>p.small-note {
  margin-top:17px;
  font-size:10px
}
.effects {
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:10;
  overflow:hidden
}
.particle {
  position:absolute;
  left:var(--x);
  top:var(--y);
  color:var(--color);
  font-size:var(--size);
  animation:spark 850ms ease-out forwards
}
.question-card.celebrate {
  animation:pop 360ms ease-out
}
.question-card.mistake {
  animation:nudge 300ms ease-out
}
.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}
@keyframes bob {
  0%,100% {
    transform:translateY(0)
  }
  50% {
    transform:translateY(-7px)
  }
}
@keyframes spark {
  0% {
    opacity:1;
    transform:translate(0,0) rotate(0) scale(.6)
  }
  100% {
    opacity:0;
    transform:translate(var(--dx),var(--dy)) rotate(var(--rotation)) scale(1.2)
  }
}
@keyframes pop {
  50% {
    transform:scale(1.012)
  }
}
@keyframes nudge {
  25% {
    transform:translateX(-4px)
  }
  75% {
    transform:translateX(4px)
  }
}
.practice .time-stat strong {
  font-size:25px
}
@media(min-width:1400px) {
  .page {
    max-width:1160px
  }
  .hero h1 {
    font-size:50px
  }
}
@media(max-width:900px) {
  .page {
    padding:0 24px
  }
  .brand-small {
    display:none
  }
  .hero {
    min-height:330px
  }
  .hero h1 {
    font-size:clamp(29px,4.4vw,37px)
  }
  .floating-equation {
    font-size:13px;
    padding:10px 12px
  }
  .home-grid {
    grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);
    gap:18px
  }
  .setup-card {
    padding:22px
  }
  .collection-card {
    padding:20px 15px
  }
  .choice strong {
    font-size:12px
  }
  .table-buttons {
    grid-template-columns:repeat(5,1fr);
    gap:7px
  }
  .table-buttons button {
    min-height:53px
  }
  .mastered-rows {
    grid-template-columns:repeat(5,1fr);
    max-width:180px;
    margin:0 auto 12px;
    gap:6px
  }
  .mastered-rows span {
    width:26px;
    height:26px
  }
  .tips-card h3 {
    font-size:12px
  }
  .tips-card p {
    font-size:10px
  }
  .play-grid {
    gap:20px;
    grid-template-columns:minmax(0,1.9fr) minmax(0,1fr)
  }
  .question-card {
    padding:20px
  }
  .question {
    gap:10px
  }
  .companion-bubble strong {
    font-size:11px
  }
  .combo-stars {
    font-size:23px;
    letter-spacing:3px
  }
}
@media(max-width:640px) {
  .page {
    padding:0 18px
  }
  .topbar {
    min-height:76px;
    gap:8px
  }
  .brand {
    font-size:18px;
    gap:7px
  }
  .brand-icon {
    width:31px;
    height:31px;
    font-size:25px;
    border-radius:10px
  }
  .topbar nav {
    gap:10px
  }
  .back-link {
    font-size:10px
  }
  .sound-button {
    padding:7px 10px;
    font-size:11px
  }
  .sound-button>span {
    font-size:0
  }
  .sound-button>span:after {
    content:"ON";
    font-size:9px;
    margin-left:3px
  }
  .sound-button[aria-pressed=false]>span:after {
    content:"OFF"
  }
  .hero {
    grid-template-columns:1fr .7fr;
    min-height:252px;
    gap:0;
    padding:25px 0 26px;
    position:relative
  }
  .hero .eyebrow {
    font-size:9px;
    margin-bottom:10px;
    white-space:nowrap;
    letter-spacing:0
  }
  .hero .eyebrow span {
    font-size:14px;
    margin-right:3px
  }
  .hero h1 {
    font-size:29px;
    line-height:1.55;
    position:relative;
    z-index:1
  }
  .hero h1>span {
    white-space:nowrap
  }
  .lead {
    font-size:11px;
    line-height:1.9;
    margin-top:12px
  }
  .hero-tags {
    margin-top:13px;
    gap:5px;
    flex-wrap:wrap;
    max-width:300px
  }
  .hero-tags span {
    font-size:8px;
    padding:4px 7px
  }
  .hero-art {
    position:absolute;
    width:42%;
    right:-9px;
    top:30px;
    z-index:0;
    opacity:.95
  }
  .hero-art>img {
    margin-top:12px
  }
  .speech {
    top:3px;
    right:4px;
    padding:6px 8px;
    font-size:8px
  }
  .speech:after {
    width:10px;
    height:10px;
    bottom:-5px
  }
  .floating-equation {
    display:none
  }
  .hero-copy {
    position:relative;
    z-index:1
  }
  .home-grid {
    grid-template-columns:1fr;
    gap:19px
  }
  .setup-card {
    padding:22px 19px
  }
  .card-heading h2 {
    font-size:16px
  }
  .mini-label {
    font-size:8px
  }
  .choice-field,.table-field {
    margin-top:20px
  }
  .choice strong {
    font-size:13px
  }
  .choice small {
    font-size:10px
  }
  .table-buttons {
    grid-template-columns:repeat(9,1fr);
    gap:4px
  }
  .table-buttons button {
    font-size:17px;
    min-height:52px;
    border-radius:8px
  }
  .table-buttons small {
    font-size:7px
  }
  .start-meta input {
    width:140px
  }
  .start-button {
    font-size:16px
  }
  .start-button span {
    right:17px
  }
  .side-stack {
    grid-template-columns:1fr
  }
  .collection-card {
    padding:20px
  }
  .collection-card .star-total {
    margin:10px 0
  }
  .star-total strong {
    font-size:46px
  }
  .collection-divider {
    margin:17px 0 14px
  }
  .mastered-rows {
    grid-template-columns:repeat(9,1fr);
    max-width:310px;
    gap:7px
  }
  .mastered-rows span {
    width:100%;
    height:auto;
    max-width:28px
  }
  .tips-card {
    padding:20px
  }
  .tips-card h3 {
    font-size:13px
  }
  .tips-card p {
    font-size:11px
  }
  .ranking-card {
    padding:21px 18px;
    margin-top:25px
  }
  .ranking-card>.card-heading {
    align-items:start
  }
  .ranking-card .card-heading h2 {
    font-size:15px
  }
  .device-label {
    font-size:8px;
    padding:6px 8px
  }
  .ranking-filters {
    gap:9px;
    margin-top:17px
  }
  .ranking-filters select {
    font-size:10px;
    max-width:150px;
    padding:9px 23px 9px 8px
  }
  .ranking-filters label {
    font-size:9px
  }
  .ranking-table {
    font-size:10px
  }
  .ranking-table th,.ranking-table td {
    padding:10px 5px
  }
  .ranking-table td:first-child {
    width:40px
  }
  .ranking-table td:nth-child(2) {
    max-width:90px
  }
  .ranking-table td:last-child {
    font-size:10px
  }
  .badge-section {
    padding-top:27px
  }
  .badge-list {
    grid-template-columns:repeat(2,1fr);
    gap:10px
  }
  .badge {
    padding:15px 7px
  }
  .badge h3 {
    font-size:11px
  }
  footer {
    flex-direction:column;
    align-items:start;
    font-size:8px;
    padding:22px 0
  }
  .play-screen {
    padding-top:22px
  }
  .play-heading {
    margin-bottom:17px;
    gap:7px
  }
  .play-heading h1 {
    font-size:14px
  }
  .play-heading .eyebrow {
    font-size:8px
  }
  .play-heading button {
    font-size:10px;
    padding:10px 12px
  }
  .hud {
    padding:12px 9px;
    border-radius:15px
  }
  .hud strong {
    font-size:28px
  }
  .hud>div>span {
    font-size:9px
  }
  .hud small {
    font-size:8px
  }
  .time-track {
    margin-bottom:17px
  }
  .play-grid {
    grid-template-columns:1fr;
    gap:16px
  }
  .question-card {
    padding:18px 20px 20px;
    border-radius:21px
  }
  .question-prompt {
    margin:15px 0 6px;
    font-size:12px
  }
  .question {
    font-size:54px;
    gap:10px;
    min-height:74px
  }
  .question-mark {
    min-width:66px;
    border-radius:13px
  }
  .answer-row {
    margin-top:14px;
    gap:10px
  }
  .answer-row input {
    height:53px;
    font-size:28px
  }
  .answer-row .primary-button {
    min-height:53px;
    font-size:13px;
    padding:11px
  }
  .feedback {
    min-height:66px;
    margin:13px 0 12px
  }
  .feedback strong {
    font-size:11px
  }
  .feedback.correct strong {
    font-size:17px
  }
  .feedback.wrong strong {
    font-size:19px
  }
  .keypad {
    gap:7px
  }
  .keypad button {
    min-height:47px;
    font-size:22px
  }
  .question-card>.input-note {
    font-size:9px;
    margin-top:13px
  }
  .play-companion {
    display:grid;
    grid-template-columns:1fr auto;
    align-items:center;
    padding:0;
    gap:10px
  }
  .companion-bubble {
    grid-column:1;
    padding:13px;
    box-shadow:none;
    min-height:60px
  }
  .companion-bubble strong {
    font-size:11px
  }
  .companion-bubble>span {
    font-size:9px
  }
  .companion-bubble:after {
    display:none
  }
  .play-companion>img {
    display:none
  }
  .combo-card {
    grid-column:2;
    padding:12px 10px;
    min-width:135px
  }
  .combo-card p {
    font-size:9px
  }
  .combo-stars {
    font-size:20px;
    letter-spacing:2px;
    margin-top:5px
  }
  .elapsed-label {
    grid-column:1/-1;
    margin-top:0;
    font-size:9px
  }
  .play-screen~.ranking-card {
    margin-top:24px
  }
  .result-screen {
    padding:25px 18px;
    margin-top:25px
  }
  .result-screen h1 {
    font-size:21px
  }
  .result-screen>p:not(.eyebrow) {
    font-size:11px
  }
  .result-score strong {
    font-size:58px
  }
  .result-stats {
    padding:14px 4px;
    gap:5px
  }
  .result-stats span {
    font-size:8px
  }
  .result-stats strong {
    font-size:14px
  }
  .result-actions {
    gap:10px
  }
  .result-actions .primary-button {
    font-size:13px;
    padding:15px 18px
  }
  .result-actions .quiet-button {
    font-size:10px
  }
  .missed-problems>span {
    font-size:14px;
    padding:8px 11px
  }
}
@media(max-width:640px) {
  .practice .time-stat strong {
    font-size:18px
  }
}
@media(max-width:370px) {
  .page {
    padding:0 13px
  }
  .hero h1 {
    font-size:26px
  }
  .hero .eyebrow {
    font-size:8px
  }
  .hero-tags span {
    font-size:7px
  }
  .hero-art {
    width:40%;
    top:36px
  }
  .setup-card {
    padding:20px 15px
  }
  .choice strong {
    font-size:12px
  }
  .mode-choice strong {
    font-size:12px
  }
  .mode-choice>span {
    padding:11px 8px
  }
  .table-buttons {
    gap:3px
  }
  .table-buttons button {
    font-size:16px
  }
  .start-meta label span {
    font-size:8px
  }
  .start-meta input {
    width:127px
  }
  .ranking-filters {
    gap:7px
  }
  .ranking-filters select {
    max-width:135px;
    font-size:9px
  }
  .question-card {
    padding:16px
  }
  .question {
    font-size:48px;
    gap:8px
  }
  .combo-card {
    min-width:120px
  }
  .play-companion {
    gap:8px
  }
  .companion-bubble {
    padding:10px
  }
  .companion-bubble strong {
    font-size:10px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important
  }
  .particle {
    display:none
  }
}
