:root {
  --ink: #17221f;
  --muted: #60716b;
  --paper: #f7f2df;
  --paper-deep: #ebe3ca;
  --panel: #fffdf4;
  --green-950: #0a2922;
  --green-800: #153f34;
  --green-650: #1f6651;
  --green-450: #3e9c72;
  --mint: #bde6c9;
  --lime: #d8f26a;
  --gold: #f0bd48;
  --red: #c94b43;
  --blue: #4e82a8;
  --shadow: 0 18px 48px rgba(20, 48, 40, 0.13);
  --small-shadow: 0 8px 20px rgba(20, 48, 40, 0.11);
  --radius: 22px;
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(21, 63, 52, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 63, 52, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
}

body.subject-english {
  --paper: #f4edf8;
  --paper-deep: #e3d5eb;
  --panel: #fffafd;
  --green-950: #24113f;
  --green-800: #3d1b67;
  --green-650: #7139a2;
  --green-450: #a367c7;
  --mint: #ead6f5;
  --lime: #ffe36c;
  --gold: #ffad32;
  --blue: #6657c7;
  --shadow: 0 18px 48px rgba(55, 24, 82, 0.15);
  --small-shadow: 0 8px 20px rgba(55, 24, 82, 0.12);
  background:
    linear-gradient(rgba(113, 57, 162, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 57, 162, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
}

button,
input,
label {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
label[for]:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(240, 189, 72, 0.55);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 14px;
}

.brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--paper);
  background: var(--green-800);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--gold);
  font-weight: 900;
  letter-spacing: -2px;
  transform: skew(-5deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.website-back-button {
  text-decoration: none;
}

.language-toggle {
  display: inline-flex;
  min-height: 44px;
  padding: 4px;
  border: 2px solid rgba(23, 34, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 253, 244, 0.82);
  box-shadow: var(--small-shadow);
}

.language-toggle button {
  min-width: 40px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
}

.language-toggle button.active {
  color: var(--paper);
  background: var(--green-800);
}

.rank-chip,
.icon-button {
  min-height: 44px;
  border-radius: 14px;
  border: 2px solid rgba(23, 34, 31, 0.12);
  background: rgba(255, 253, 244, 0.82);
  box-shadow: var(--small-shadow);
}

.rank-chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 14px;
  color: var(--green-800);
}

.rank-chip span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.icon-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--ink);
  cursor: pointer;
}

#app {
  flex: 1;
  padding: 20px 0 48px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.74fr);
  gap: 24px;
  align-items: stretch;
}

.hero-panel,
.side-panel,
.mission-card,
.question-card,
.summary-card {
  background: rgba(255, 253, 244, 0.94);
  border: 2px solid rgba(23, 34, 31, 0.11);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 34px 34px 80px 34px;
  background:
    radial-gradient(circle at 86% 16%, rgba(216, 242, 106, 0.38), transparent 22%),
    linear-gradient(135deg, rgba(255, 253, 244, 0.98), rgba(225, 240, 218, 0.98));
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -55px;
  bottom: -60px;
  border: 30px solid rgba(31, 102, 81, 0.1);
  transform: rotate(18deg);
}

.subject-english .hero-panel {
  background:
    radial-gradient(circle at 86% 16%, rgba(255, 227, 108, 0.42), transparent 23%),
    linear-gradient(135deg, rgba(255, 250, 253, 0.99), rgba(232, 213, 244, 0.98));
}

.subject-english .hero-panel::after {
  border-color: rgba(113, 57, 162, 0.13);
}

.subject-english .mission-button:hover,
.subject-english .route-step:hover {
  background: #f8effd;
}

.subject-english .mission-button.selected {
  background: #f0def9;
  box-shadow: inset 0 0 0 2px rgba(113, 57, 162, 0.11);
}

.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--green-650);
  font-weight: 900;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-panel h1 {
  max-width: 670px;
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.hero-panel h1 em {
  color: var(--green-650);
  font-style: normal;
}

.hero-copy {
  max-width: 590px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.58;
}

.hero-actions,
.question-actions,
.transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 50px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  padding: 13px 19px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button {
  color: #fffdf4;
  background: var(--green-650);
  box-shadow: 5px 5px 0 var(--ink);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--paper-deep);
}

.text-button {
  color: var(--green-650);
  background: transparent;
  border-color: transparent;
  padding-inline: 8px;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translate(-1px, -1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.primary-button:active,
.secondary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.compact {
  min-height: 42px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.onboarding-active .topbar-actions,
.onboarding-active .footer {
  visibility: hidden;
}

.welcome-screen {
  min-height: min(720px, calc(100vh - 150px));
  display: grid;
  place-items: center;
}

.welcome-card {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(290px, 1fr);
  gap: clamp(24px, 6vw, 60px);
  align-items: center;
  padding: clamp(26px, 6vw, 58px);
  border: 3px solid var(--ink);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--gold), var(--shadow);
}

.welcome-character,
.summary-character {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.character-sprite {
  flex: 0 0 auto;
  width: 122px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: var(--sprite-x) var(--sprite-y);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--paper-deep);
  image-rendering: pixelated;
}

.sprite-izuku {
  aspect-ratio: 512 / 589;
  background-image: url("assets/Izuku.webp");
  background-size: 600% 300%;
}

.sprite-present-mic {
  aspect-ratio: 512 / 589;
  background-image: url("assets/present-mic.webp");
  background-size: 300% 300%;
}

.sprite-mha {
  aspect-ratio: 4096 / 6293;
  background-image: url("assets/mha-personagens.webp");
  background-size: 700% 400%;
}

.subject-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
  padding: 18px 21px;
  border: 2px solid rgba(23, 34, 31, 0.11);
  border-radius: 22px;
  background: rgba(255, 253, 244, 0.94);
  box-shadow: var(--small-shadow);
}

.subject-switcher h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.subject-switcher .eyebrow {
  margin-bottom: 4px;
}

.subject-tabs,
.report-subject-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subject-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 142px;
  min-height: 54px;
  border: 2px solid rgba(23, 34, 31, 0.16);
  border-radius: 15px;
  padding: 8px 13px;
  color: var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--paper-deep);
  cursor: pointer;
}

.subject-tab > span {
  display: grid;
  place-items: center;
  width: 37px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  background: var(--green-650);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.subject-tab strong {
  font-size: 0.9rem;
}

.subject-tab:hover,
.subject-tab.selected {
  border-color: var(--green-650);
}

.subject-tab.selected {
  background: var(--mint);
  box-shadow: inset 0 0 0 2px rgba(113, 57, 162, 0.1), 3px 3px 0 var(--paper-deep);
}

.subject-tab.compact {
  min-width: 125px;
  min-height: 46px;
  padding: 6px 10px;
}

.subject-tab.compact > span {
  width: 32px;
  height: 28px;
}

.report-subject-tabs {
  margin: 0 0 16px;
}

.speech-bubble {
  position: relative;
  max-width: 260px;
  padding: 13px 15px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 var(--mint);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: 28px;
  top: -10px;
  width: 14px;
  height: 14px;
  border-left: 3px solid var(--ink);
  border-top: 3px solid var(--ink);
  background: #fff;
  transform: rotate(45deg);
}

.speech-bubble strong {
  display: block;
  margin-bottom: 5px;
  color: var(--green-650);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.speech-bubble p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.name-form {
  display: grid;
  gap: 13px;
}

.name-form label {
  font-weight: 900;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.1;
}

.name-form > input {
  width: 100%;
  min-height: 58px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 15px;
  color: var(--ink);
  background: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.identity-choice {
  min-width: 0;
  margin: 4px 0 1px;
  border: 0;
  padding: 0;
}

.identity-choice legend {
  margin-bottom: 9px;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 900;
}

.identity-choice > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.identity-option {
  position: relative;
  cursor: pointer;
}

.identity-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.identity-option span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  border: 2px solid rgba(23, 34, 31, 0.24);
  border-radius: 13px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.identity-option span::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid var(--green-650);
  border-radius: 5px;
  color: #fff;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1;
}

.identity-option input:checked + span {
  border-color: var(--green-650);
  background: var(--mint);
  box-shadow: 3px 3px 0 var(--paper-deep);
}

.identity-option input:checked + span::before {
  content: "✓";
  background: var(--green-650);
}

.identity-option input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.name-form > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.hero-character {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 245px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.hero-character .character-sprite {
  width: 90px;
}

.hero-character .speech-bubble {
  padding: 11px 12px;
}

.hero-panel > h1,
.hero-panel > .hero-copy,
.hero-panel > .next-level-card,
.hero-panel > .hero-actions {
  max-width: calc(100% - 230px);
}

.next-level-card {
  margin: -12px 0 22px;
  padding: 14px 16px;
  border-left: 5px solid var(--green-650);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.next-level-card span,
.next-level-card strong,
.next-level-card small { display: block; }
.next-level-card span { color: var(--muted); font-size: 0.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }
.next-level-card strong { margin-top: 4px; color: var(--green-800); }
.next-level-card small { margin-top: 4px; color: var(--muted); line-height: 1.4; }

.pixel-guide {
  --pixel: 12px;
  position: absolute;
  right: clamp(32px, 7vw, 88px);
  bottom: 38px;
  width: calc(var(--pixel) * 7);
  height: calc(var(--pixel) * 9);
  filter: drop-shadow(10px 12px 0 rgba(10, 41, 34, 0.12));
  image-rendering: pixelated;
}

.pixel-guide span {
  position: absolute;
  width: var(--pixel);
  height: var(--pixel);
  background: var(--ink);
  box-shadow:
    calc(var(--pixel) * 1) 0 var(--green-950),
    calc(var(--pixel) * 2) 0 var(--green-650),
    calc(var(--pixel) * 3) 0 var(--green-650),
    calc(var(--pixel) * 4) 0 var(--green-950),
    calc(var(--pixel) * 5) var(--pixel) var(--green-950),
    0 var(--pixel) var(--green-950),
    calc(var(--pixel) * 1) var(--pixel) #e8b99a,
    calc(var(--pixel) * 2) var(--pixel) #e8b99a,
    calc(var(--pixel) * 3) var(--pixel) #e8b99a,
    calc(var(--pixel) * 4) var(--pixel) #e8b99a,
    calc(var(--pixel) * 5) calc(var(--pixel) * 2) #e8b99a,
    0 calc(var(--pixel) * 2) #e8b99a,
    calc(var(--pixel) * 1) calc(var(--pixel) * 2) #17221f,
    calc(var(--pixel) * 2) calc(var(--pixel) * 2) #e8b99a,
    calc(var(--pixel) * 3) calc(var(--pixel) * 2) #17221f,
    calc(var(--pixel) * 4) calc(var(--pixel) * 2) #e8b99a,
    calc(var(--pixel) * 1) calc(var(--pixel) * 3) #e8b99a,
    calc(var(--pixel) * 2) calc(var(--pixel) * 3) #e8b99a,
    calc(var(--pixel) * 3) calc(var(--pixel) * 3) #e8b99a,
    calc(var(--pixel) * 4) calc(var(--pixel) * 3) #e8b99a,
    calc(var(--pixel) * 2) calc(var(--pixel) * 4) var(--green-650),
    calc(var(--pixel) * 3) calc(var(--pixel) * 4) var(--green-650),
    calc(var(--pixel) * 1) calc(var(--pixel) * 5) var(--green-950),
    calc(var(--pixel) * 2) calc(var(--pixel) * 5) var(--green-650),
    calc(var(--pixel) * 3) calc(var(--pixel) * 5) var(--green-650),
    calc(var(--pixel) * 4) calc(var(--pixel) * 5) var(--green-950),
    0 calc(var(--pixel) * 6) var(--green-950),
    calc(var(--pixel) * 1) calc(var(--pixel) * 6) var(--green-650),
    calc(var(--pixel) * 2) calc(var(--pixel) * 6) var(--gold),
    calc(var(--pixel) * 3) calc(var(--pixel) * 6) var(--green-650),
    calc(var(--pixel) * 4) calc(var(--pixel) * 6) var(--green-950),
    calc(var(--pixel) * 5) calc(var(--pixel) * 6) var(--green-950),
    calc(var(--pixel) * 1) calc(var(--pixel) * 7) var(--green-950),
    calc(var(--pixel) * 2) calc(var(--pixel) * 7) var(--green-950),
    calc(var(--pixel) * 3) calc(var(--pixel) * 7) var(--green-950),
    calc(var(--pixel) * 4) calc(var(--pixel) * 7) var(--green-950),
    calc(var(--pixel) * 1) calc(var(--pixel) * 8) var(--ink),
    calc(var(--pixel) * 4) calc(var(--pixel) * 8) var(--ink);
}

.side-panel {
  border-radius: 34px;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.side-panel h2 {
  margin-bottom: 20px;
  font-size: 1.35rem;
}

.mission-list {
  display: grid;
  gap: 12px;
}

.mission-button {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  border: 2px solid rgba(23, 34, 31, 0.1);
  border-radius: 17px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fffef8;
  text-align: left;
  cursor: pointer;
}

.mission-button:hover {
  border-color: var(--green-450);
  background: #f5faef;
}

.mission-button.selected {
  border-color: var(--green-650);
  background: #eaf6e8;
  box-shadow: inset 0 0 0 2px rgba(31, 102, 81, 0.1);
}

.mission-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--green-950);
  background: var(--mint);
  font-weight: 900;
}

.mission-button strong,
.mission-button small {
  display: block;
}

.mission-button small {
  margin-top: 4px;
  color: var(--muted);
}

.mission-status {
  color: var(--green-650);
  font-weight: 900;
  font-size: 0.76rem;
}

.weekly-card {
  margin-top: auto;
  padding-top: 24px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-650), var(--lime));
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.learning-route {
  margin-top: 24px;
  padding: 28px;
  border: 2px solid rgba(23, 34, 31, 0.11);
  border-radius: 28px;
  background: rgba(255, 253, 244, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.learning-route .eyebrow {
  color: var(--green-650);
}

.route-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.route-heading h2 { margin-bottom: 0; font-size: clamp(1.45rem, 4vw, 2rem); }
.route-heading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }

.route-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.route-steps.route-dynamic {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

.route-step {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 178px;
  border: 2px solid rgba(23, 34, 31, 0.13);
  padding: 17px;
  border-radius: 16px;
  color: var(--ink);
  background: #fffef8;
  text-align: left;
  cursor: pointer;
}

.route-step:hover {
  border-color: var(--green-450);
  background: #f4faef;
  transform: translateY(-2px);
}

.route-step strong,
.route-step small,
.route-step em {
  display: block;
}

.route-step strong {
  margin: 10px 0 7px;
  font-size: 1.02rem;
}

.route-step small {
  color: var(--muted);
  line-height: 1.4;
}

.route-level {
  align-self: flex-start;
  border-radius: 99px;
  padding: 5px 8px;
  color: var(--green-800);
  background: var(--mint);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.route-step em {
  margin-top: auto;
  padding-top: 12px;
  color: var(--green-650);
  font-size: 0.73rem;
  font-style: normal;
  font-weight: 900;
}

.route-step.practiced {
  border-color: rgba(62, 156, 114, 0.55);
}

.route-step.completed::after {
  content: "✓";
  position: absolute;
  right: 13px;
  top: 13px;
  color: var(--green-650);
  font-weight: 900;
}

.question-layout {
  width: min(880px, 100%);
  margin: 0 auto;
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.back-button {
  border: 0;
  color: var(--green-650);
  background: transparent;
  padding: 8px 0;
  font-weight: 900;
  cursor: pointer;
}

.question-progress {
  flex: 1;
  max-width: 430px;
}

.question-progress .bar-track {
  background: rgba(21, 63, 52, 0.12);
}

.question-card {
  border-radius: 30px;
  padding: clamp(24px, 5vw, 44px);
}

.question-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  border-radius: 99px;
  padding: 7px 11px;
  color: var(--green-800);
  background: var(--mint);
  font-size: 0.78rem;
  font-weight: 900;
}

.question-card h1 {
  margin-bottom: 13px;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.question-copy {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.55;
}

.math-panel {
  margin: 0;
  padding: 20px;
  border: 2px solid rgba(21, 63, 52, 0.13);
  border-radius: 18px;
  color: var(--green-950);
  background: #eff7e9;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(1.05rem, 3vw, 1.36rem);
  line-height: 1.7;
  text-align: center;
}

.math-content {
  min-width: 0;
  width: 100%;
}

.english-panel {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 22px;
  border: 2px solid rgba(61, 27, 103, 0.17);
  border-radius: 18px;
  color: var(--green-950);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 219, 248, 0.92)),
    #f6edfb;
  text-align: center;
}

.english-panel > span {
  color: var(--green-650);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.english-panel > strong {
  font-size: clamp(1.18rem, 3vw, 1.62rem);
  line-height: 1.35;
}

.english-panel > small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.english-work-panel {
  display: grid;
  align-content: stretch;
}

.english-work-panel .english-panel {
  height: 100%;
  align-content: center;
}

.math-expression {
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  font-weight: 900;
}

.math-given {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid rgba(21, 63, 52, 0.14);
}

.math-given > span {
  color: var(--muted);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.math-given strong {
  font-size: 1.12em;
}

.math-lines {
  display: grid;
  gap: 7px;
}

.math-lines > span,
.math-lines > strong {
  display: block;
}

.math-equation {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.math-signed-fraction {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.math-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: stretch;
  min-width: 1.35em;
  margin-inline: 0.1em;
  color: inherit;
  font: inherit;
  line-height: 1.05;
  text-align: center;
  vertical-align: middle;
}

.math-fraction-numerator {
  display: block;
  padding: 0 0.3em 0.16em;
  border-bottom: 2px solid currentColor;
  white-space: nowrap;
}

.math-fraction-denominator {
  display: block;
  padding: 0.16em 0.3em 0;
  white-space: nowrap;
}

.math-curiosity {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  margin: 18px 0 4px;
  padding: 15px 17px;
  border: 2px solid #9e7a22;
  border-radius: 16px;
  color: #4b3710;
  background: #fff8dc;
}

.math-curiosity-mentor {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.math-curiosity-mentor .character-sprite {
  width: 78px;
  border-width: 2px;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #d9bd70;
}

.math-curiosity-mentor small {
  color: #5f4713;
  font-size: 0.67rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.math-curiosity-label {
  display: inline-block;
  margin-bottom: 7px;
  border-radius: 7px;
  padding: 5px 7px;
  color: #fffdf4;
  background: #735718;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.math-curiosity-copy > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.math-curiosity-copy > p {
  margin: 0;
  line-height: 1.55;
}

.math-curiosity .math-curiosity-quote {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(75, 55, 16, 0.22);
  font-size: 0.84rem;
  font-weight: 750;
}

.math-curiosity code {
  display: inline-block;
  border: 1px solid rgba(75, 55, 16, 0.22);
  border-radius: 5px;
  padding: 1px 5px;
  color: #2f250d;
  background: #fff;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 850;
}

.angle-label .math-fraction {
  font-size: 0.82em;
}

.hint-card .math-fraction,
.explanation-step .math-fraction {
  font-size: 1.05em;
}

.system-equations {
  position: relative;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding-left: 25px;
  text-align: left;
}

.system-equations::before {
  content: "{";
  position: absolute;
  left: 0;
  top: 50%;
  color: var(--green-650);
  font-family: Georgia, serif;
  font-size: 3.4rem;
  line-height: 1;
  transform: translateY(-54%);
}

.system-equations > span { display: block; }

.learning-route:focus-visible {
  outline: 5px solid rgba(240, 189, 72, 0.65);
  outline-offset: 5px;
}

.stats-concept {
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  text-align: left;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  background: #fff;
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 0.9rem;
}

.stats-table caption {
  padding: 0 0 9px;
  color: var(--green-650);
  font-weight: 900;
}

.stats-table th,
.stats-table td {
  border: 2px solid rgba(23, 34, 31, 0.13);
  padding: 8px 10px;
  text-align: left;
}

.stats-table th { background: var(--mint); }
.stats-table th:last-child,
.stats-table td:last-child { text-align: center; }

.stats-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
}

.frequency-table {
  min-width: 430px;
}

.frequency-table th:not(:first-child),
.frequency-table td:not(:first-child) {
  text-align: center;
}

.frequency-table tfoot {
  background: #f4faef;
  font-weight: 900;
}

.stats-unknown {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 30px;
  padding: 2px 8px;
  border: 2px dashed var(--green-450);
  border-radius: 8px;
  background: #fff;
  color: var(--green-650);
  font-size: 1.05rem;
}

.stats-formula {
  margin-top: 12px;
  padding: 10px 12px;
  border: 2px solid rgba(23, 34, 31, 0.1);
  border-radius: 10px;
  background: var(--mint);
  color: var(--green-650);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-weight: 900;
}

.frequency-raw-data span {
  min-width: 68px;
  padding-inline: 10px;
  font-size: 0.86rem;
}

.stats-data-label {
  margin: 14px 0 9px;
  color: var(--green-650);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.stats-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 230px;
  padding: 10px 8px 0;
  border-bottom: 3px solid var(--ink);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
}

.stats-bar-column {
  display: grid;
  grid-template-rows: 24px 145px auto;
  align-items: end;
  height: 100%;
}

.stats-bar-column > span { color: var(--green-650); font-size: 0.78rem; font-weight: 900; }
.stats-bar-column small { min-height: 3.2em; padding-top: 7px; font-size: 0.65rem; line-height: 1.15; }

.stats-bar {
  width: min(52px, 80%);
  height: var(--bar-height);
  min-height: 10px;
  margin: 0 auto;
  border: 2px solid var(--green-950);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--lime), var(--green-450));
}

.stats-data-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.stats-data-row span {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 46px;
  border: 2px solid var(--green-650);
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
}

.question-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 1.08fr) minmax(260px, 0.92fr);
  gap: 16px;
  align-items: stretch;
  margin: 24px 0;
}

.problem-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.geometry-stage,
.coordinate-stage,
.area-stage {
  margin: 0;
  padding: 14px;
  border: 2px solid rgba(21, 63, 52, 0.14);
  border-radius: 18px;
  background: #fff;
}

.coordinate-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fbfcf6;
}

.area-stage-compact {
  width: min(420px, 100%);
  margin-top: 12px;
  background: #fff;
}

.area-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.area-fill {
  fill: #dff2e7;
  stroke: #163f34;
  stroke-width: 4;
  stroke-linejoin: round;
}

.area-copy-fill {
  fill: #e8effc;
  stroke: #163f34;
  stroke-width: 4;
  stroke-linejoin: round;
}

.area-cutout {
  fill: #fffdf4;
  stroke: #163f34;
  stroke-width: 3;
}

.area-measure {
  stroke: #294d7c;
  stroke-width: 2;
  stroke-linecap: round;
}

.area-measure.dashed {
  stroke-dasharray: 6 5;
}

.area-right-angle {
  fill: none;
  stroke: #294d7c;
  stroke-width: 2;
}

.area-label {
  fill: #142a28;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #fbfcf6;
  stroke-width: 4px;
  stroke-linejoin: round;
  dominant-baseline: central;
}

.area-label.center { text-anchor: middle; }
.area-label.end { text-anchor: end; }
.area-label.small { font-size: 12px; }

.area-stage figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.geometry-canvas {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(rgba(21, 63, 52, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 63, 52, 0.05) 1px, transparent 1px),
    #fbfcf6;
  background-size: 18px 18px;
}

.geometry-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 245px;
  overflow: visible;
}

.geometry-polygon {
  stroke: var(--green-950);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.geometry-angle-arc,
.geometry-external-arc {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.geometry-external-arc {
  stroke: #a13d32;
  stroke-width: 4;
}

.geometry-extension {
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
}

.geometry-vertex-name {
  fill: var(--green-950);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fbfcf6;
  stroke-width: 5px;
  text-anchor: middle;
  dominant-baseline: central;
}

.geometry-angle-label div,
.geometry-side-label div,
.geometry-external-label div {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: -2px -2px 0 #fbfcf6, 2px -2px 0 #fbfcf6, -2px 2px 0 #fbfcf6, 2px 2px 0 #fbfcf6;
}

.geometry-side-label div {
  color: var(--green-950);
}

.geometry-external-label div {
  color: #a13d32;
  font-size: 18px;
}

.geometry-angle-label .math-fraction,
.geometry-side-label .math-fraction {
  background: rgba(251, 252, 246, 0.82);
}

.geometry-stage figcaption,
.coordinate-stage figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  text-align: center;
}

.question-companion {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 10px;
  border: 2px solid rgba(23, 34, 31, 0.11);
  border-radius: 16px;
  background: #fff;
}

.question-companion .character-sprite {
  width: 68px;
  border-width: 2px;
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--paper-deep);
}

.question-companion .speech-bubble {
  flex: 1;
  padding: 9px 10px;
  border-width: 2px;
  box-shadow: 3px 3px 0 var(--mint);
}

.question-companion .speech-bubble::before {
  left: -8px;
  top: auto;
  bottom: 20px;
  border: 0;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

.question-workbench.no-diagram {
  grid-template-columns: minmax(0, 1fr);
}

.question-workbench.no-diagram .problem-side {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  align-items: stretch;
}

.question-workbench.no-diagram .math-panel,
.question-workbench.no-diagram .english-work-panel {
  display: grid;
  place-items: center;
}

.catalog-section {
  margin-top: 24px;
  padding: clamp(24px, 5vw, 38px);
  border: 2px solid rgba(23, 34, 31, 0.11);
  border-radius: 28px;
  background: rgba(255, 253, 244, 0.94);
  box-shadow: var(--shadow);
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.catalog-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.catalog-heading > p {
  max-width: 430px;
  margin-bottom: 2px;
  color: var(--muted);
  line-height: 1.45;
}

.topic-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 20px;
  border: 2px solid rgba(23, 34, 31, 0.11);
  border-radius: 18px;
  background: #fffef8;
}

.topic-card.current {
  border-color: var(--green-450);
  box-shadow: inset 0 0 0 3px rgba(62, 156, 114, 0.12);
}

.topic-year {
  color: var(--green-650);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-card h3 {
  margin: 8px 0;
  font-size: 1.2rem;
}

.topic-card > p {
  flex: 1;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.topic-card .secondary-button {
  width: 100%;
  margin-top: 16px;
}

.topic-quick-list {
  max-height: 430px;
  overflow-y: auto;
  padding-right: 3px;
}

.summary-character {
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: center;
  align-items: center;
  width: min(440px, 100%);
  margin: 0 auto 24px;
}

.summary-character .character-sprite {
  width: 105px;
}

.profile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 13px;
  background: #f0f5e9;
}

.subject-english .profile-line {
  background: #f1e7f7;
}

.progress-groups {
  display: grid;
  gap: 10px;
}

.progress-topic {
  border: 2px solid rgba(23, 34, 31, 0.1);
  border-radius: 15px;
  background: #fffef9;
}

.progress-topic summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.progress-topic summary strong {
  color: var(--green-650);
}

.progress-topic .skill-list {
  padding: 2px 16px 16px;
}

.fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  margin-inline: 3px;
  vertical-align: middle;
  line-height: 1.05;
}

.fraction > span:first-child {
  border-bottom: 2px solid currentColor;
  padding-inline: 4px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.option-button {
  min-height: 66px;
  border: 2px solid rgba(23, 34, 31, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  background: #fffef9;
  font-weight: 900;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border 120ms ease, background 120ms ease, transform 120ms ease;
}

.option-button:hover:not(:disabled) {
  border-color: var(--green-450);
  transform: translateY(-2px);
}

.option-button.wrong {
  border-color: var(--red);
  background: #fff0ec;
}

.option-button.correct {
  border-color: var(--green-650);
  background: #e4f5e7;
}

.feedback-panel {
  margin-top: 20px;
  padding: 19px;
  border-radius: 17px;
  border-left: 6px solid var(--gold);
  background: #fff7dc;
}

.feedback-panel.correct {
  border-left-color: var(--green-650);
  background: #e9f6e7;
}

.feedback-panel h2 {
  margin-bottom: 7px;
  font-size: 1.08rem;
}

.feedback-panel p {
  margin-bottom: 0;
  line-height: 1.5;
}

.hint-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.hint-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: #eef3ff;
  border-left: 5px solid var(--blue);
}

.hint-card strong {
  display: block;
  margin-bottom: 5px;
}

.hint-card p,
.hint-card .hint-body {
  margin-bottom: 0;
  line-height: 1.5;
}

.hint-card .math-display-formula {
  display: block;
  width: fit-content;
  margin: 12px auto 4px;
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
}

.formula-reminder {
  display: grid;
  justify-items: start;
  gap: 5px;
  margin-top: 10px;
  min-width: 0;
  max-width: 100%;
  font-weight: 800;
}

.formula-reminder > span {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.explanation-panel {
  margin-top: 20px;
  padding: 22px;
  border-radius: 20px;
  color: #f7f2df;
  background: var(--green-950);
}

.explanation-panel h2 {
  font-size: 1.15rem;
}

.explanation-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.explanation-step > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--green-950);
  background: var(--lime);
  font-weight: 900;
}

.explanation-step p {
  margin: 3px 0 0;
  line-height: 1.5;
}

.question-actions {
  margin-top: 22px;
  align-items: center;
}

.summary-card {
  width: min(760px, 100%);
  margin: 30px auto;
  padding: clamp(28px, 6vw, 58px);
  border-radius: 34px;
  text-align: center;
}

.summary-flow {
  width: min(860px, 100%);
  margin: 0 auto;
}

.summary-flow .summary-card {
  width: 100%;
  margin-bottom: 22px;
}

.sticker-machine-card {
  padding: clamp(24px, 5vw, 42px);
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: radial-gradient(circle at 12% 8%, rgba(216, 242, 106, 0.35), transparent 24%), var(--panel);
  box-shadow: 8px 8px 0 var(--gold), var(--shadow);
}

.sticker-machine-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.sticker-machine-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  letter-spacing: -0.035em;
}

.collection-counter {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  color: var(--paper);
  background: var(--green-800);
  text-align: center;
}

.collection-counter strong,
.collection-counter span { display: block; }
.collection-counter strong { color: var(--lime); font-size: 1.15rem; }
.collection-counter span { margin-top: 2px; font-size: 0.65rem; font-weight: 900; text-transform: uppercase; }

.sticker-machine-copy {
  margin: 13px 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.sticker-reel-frame {
  position: relative;
  overflow: hidden;
  padding: 18px 10px;
  border: 4px solid var(--ink);
  border-radius: 22px;
  background: linear-gradient(90deg, rgba(10, 41, 34, 0.28), transparent 18%, transparent 82%, rgba(10, 41, 34, 0.28)), #edf4e8;
  box-shadow: inset 0 0 26px rgba(10, 41, 34, 0.16);
}

.sticker-reel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(5px, 1.4vw, 14px);
  align-items: center;
}

.is-spinning .sticker-reel { animation: reel-rattle 110ms linear infinite alternate; }

.sticker-slot {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 5px;
  border: 2px solid rgba(23, 34, 31, 0.14);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  transition: opacity 140ms ease, transform 140ms ease;
}

.sticker-slot-1,
.sticker-slot-5 { opacity: 0.28; transform: scale(0.72); }
.sticker-slot-2,
.sticker-slot-4 { opacity: 0.58; transform: scale(0.86); }
.sticker-slot-3 { z-index: 2; border-color: var(--green-650); box-shadow: 0 8px 18px rgba(10, 41, 34, 0.16); transform: scale(1.04); }

.sticker-face,
.collection-sticker-face {
  aspect-ratio: 4096 / 6293;
  background-color: #fff;
  background-image: var(--sprite-sheet, url("assets/mha-personagens.webp"));
  background-repeat: no-repeat;
  background-position: var(--sprite-x) var(--sprite-y);
  background-size: 700% 400%;
  image-rendering: pixelated;
}

.sticker-face { width: 100%; border-radius: 9px; }

.sticker-slot span {
  display: block;
  overflow: hidden;
  min-height: 1.8em;
  margin-top: 4px;
  font-size: clamp(0.56rem, 1.6vw, 0.74rem);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.reel-marker {
  position: absolute;
  z-index: 4;
  left: 40%;
  top: 7px;
  width: 20%;
  height: calc(100% - 14px);
  border: 4px solid var(--gold);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--ink), 0 0 20px rgba(240, 189, 72, 0.55);
}

.sticker-prize-message {
  margin-top: 18px;
  padding: 17px 19px;
  border-left: 6px solid var(--green-650);
  border-radius: 16px;
  background: #e9f6e7;
}

.sticker-prize-message strong { display: block; margin-bottom: 6px; color: var(--green-650); font-size: 1.15rem; }
.sticker-prize-message p,
.collection-complete p { margin-bottom: 0; line-height: 1.5; }

.sticker-machine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.sticker-status { min-height: 1.4em; margin: 13px 0 0; color: var(--green-650); font-weight: 900; }

.collection-complete {
  margin-top: 22px;
  padding: 24px;
  border-radius: 18px;
  color: var(--paper);
  background: var(--green-950);
  text-align: center;
}

.collection-complete strong { display: block; margin-bottom: 7px; color: var(--lime); font-size: 1.5rem; }

@keyframes reel-rattle {
  from { transform: translateX(-6px); }
  to { transform: translateX(6px); }
}

.summary-emblem {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 20px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  color: var(--green-950);
  background: var(--lime);
  box-shadow: 7px 7px 0 var(--gold);
  font-size: 2rem;
  font-weight: 900;
}

.summary-card h1 {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.summary-stat {
  padding: 18px 12px;
  border-radius: 16px;
  background: #eef5e9;
}

.summary-stat strong,
.summary-stat span {
  display: block;
}

.summary-stat strong {
  color: var(--green-650);
  font-size: 1.7rem;
}

.summary-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.footer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.footer a {
  color: inherit;
  font-weight: 800;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--green-650);
}

.footer-wide,
.footer-legal {
  flex-basis: 100%;
}

.footer-wide {
  margin-top: 5px;
  color: var(--ink);
  font-weight: 800;
}

.footer-legal {
  max-width: 940px;
  font-size: 0.7rem;
  line-height: 1.45;
}

.progress-dialog,
.install-dialog {
  width: min(840px, calc(100% - 24px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 28px 100px rgba(8, 31, 25, 0.32);
  overflow-y: auto;
}

.progress-dialog::backdrop,
.install-dialog::backdrop {
  background: rgba(10, 41, 34, 0.72);
  backdrop-filter: blur(5px);
}

.install-dialog {
  width: min(700px, calc(100% - 24px));
}

.install-dialog-shell > p {
  color: var(--muted);
  line-height: 1.55;
}

.install-instructions {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.install-instructions h3 {
  margin-bottom: 0;
}

.install-instructions article {
  padding: 15px 17px;
  border: 2px solid rgba(23, 34, 31, 0.1);
  border-radius: 16px;
  background: #f5f7ef;
}

.install-instructions article p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.48;
}

.install-note {
  margin-bottom: 0;
  color: var(--green-650);
  font-size: 0.82rem;
  font-weight: 800;
}

.dialog-shell {
  padding: clamp(22px, 5vw, 38px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dialog-header h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.close-button {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(23, 34, 31, 0.14);
  border-radius: 13px;
  color: var(--ink);
  background: #fffef9;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.progress-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.progress-kpi {
  padding: 17px;
  border-radius: 16px;
  background: #edf4e8;
}

.progress-kpi strong,
.progress-kpi span {
  display: block;
}

.progress-kpi strong {
  color: var(--green-650);
  font-size: 1.55rem;
}

.progress-kpi span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sticker-collection-panel { margin-bottom: 18px; }

.sticker-collection-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 14px 16px;
}

.collection-sticker {
  min-width: 0;
  padding: 5px;
  border: 2px solid rgba(23, 34, 31, 0.1);
  border-radius: 10px;
  background: #fff;
  text-align: center;
}

.collection-sticker.locked {
  display: grid;
  min-height: 110px;
  place-content: center;
  color: rgba(21, 63, 52, 0.28);
  background: #e7ece4;
}

.collection-sticker.locked > span { font-size: 1.5rem; font-weight: 900; }
.collection-sticker-face { width: 100%; border-radius: 6px; }

.collection-sticker small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 0.52rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.skill-list {
  display: grid;
  gap: 13px;
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.6fr) 54px;
  gap: 14px;
  align-items: center;
}

.skill-row strong {
  font-size: 0.9rem;
}

.skill-row output {
  color: var(--green-650);
  font-weight: 900;
  text-align: right;
}

.transfer-card {
  margin-top: 26px;
  padding: 22px;
  border-radius: 20px;
  background: var(--green-950);
  color: #f7f2df;
}

.transfer-card .eyebrow {
  color: var(--lime);
}

.transfer-card h3 {
  margin-bottom: 8px;
}

.transfer-card p {
  color: rgba(247, 242, 223, 0.74);
  line-height: 1.5;
}

.status-message {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--lime) !important;
  font-weight: 800;
}

@media (max-width: 920px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .question-workbench {
    grid-template-columns: 1fr;
  }

  .route-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    padding-top: 12px;
  }

  .topbar-actions {
    max-width: 192px;
    gap: 6px;
  }

  .topbar-actions .icon-button,
  .topbar-actions .rank-chip {
    min-height: 40px;
    padding: 7px 10px;
  }

  .language-toggle {
    min-height: 40px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand small,
  .desktop-label {
    display: none;
  }

  #app {
    padding-top: 9px;
  }

  .subject-switcher {
    display: block;
    padding: 16px;
  }

  .subject-switcher .subject-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 13px;
  }

  .subject-tab {
    min-width: 0;
  }

  .report-subject-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .welcome-card {
    grid-template-columns: 1fr;
    box-shadow: 6px 6px 0 var(--gold), var(--shadow);
  }

  .welcome-character {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .welcome-character .character-sprite {
    width: 92px;
  }

  .hero-panel {
    min-height: 420px;
    padding: 28px 23px;
    border-radius: 27px 27px 60px 27px;
  }

  .hero-panel h1 {
    max-width: 92%;
  }

  .hero-panel > h1,
  .hero-panel > .hero-copy,
  .hero-panel > .next-level-card,
  .hero-panel > .hero-actions {
    max-width: 100%;
  }

  .hero-character {
    position: static;
    width: 100%;
    margin-top: 28px;
  }

  .hero-character .speech-bubble {
    max-width: none;
  }

  .geometry-canvas {
    min-height: 220px;
  }

  .question-workbench.no-diagram .problem-side {
    grid-template-columns: 1fr;
  }

  .catalog-heading {
    display: block;
  }

  .catalog-heading > p {
    margin-top: 10px;
  }

  .side-panel,
  .learning-route,
  .question-card {
    padding: 21px;
    border-radius: 24px;
  }

  .route-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .route-heading {
    display: block;
  }

  .route-heading > p {
    margin-top: 9px;
  }

  .route-steps.route-dynamic {
    grid-template-columns: 1fr;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .math-curiosity {
    grid-template-columns: 1fr;
  }

  .math-curiosity-mentor {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
  }

  .math-curiosity-mentor .character-sprite {
    width: 68px;
  }

  .math-curiosity-mentor small {
    text-align: left;
  }

  .summary-stats,
  .progress-overview {
    grid-template-columns: 1fr;
  }

  .sticker-machine-card {
    padding: 21px 14px;
    border-radius: 24px;
    box-shadow: 5px 5px 0 var(--gold), var(--shadow);
  }

  .sticker-machine-heading { gap: 10px; }
  .sticker-reel-frame { padding-inline: 4px; }
  .sticker-reel { gap: 3px; }
  .sticker-slot { padding: 2px; border-radius: 8px; }
  .reel-marker { border-width: 3px; border-radius: 10px; }

  .sticker-machine-actions .primary-button,
  .sticker-machine-actions .secondary-button { width: 100%; }

  .sticker-collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .summary-character {
    grid-template-columns: 1fr;
  }

  .skill-row {
    grid-template-columns: 1fr 52px;
  }

  .skill-row .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .footer {
    flex-direction: column;
  }

  .footer-dot {
    display: none;
  }
}

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

  .is-spinning .sticker-reel {
    animation: none !important;
  }
}
