:root {
  color-scheme: light;
  --ink: #0d2857;
  --soft-ink: #536885;
  --cream: #fff8dd;
  --cream-2: #f7e9bd;
  --mint-pale: #dff8e8;
  --mint: #66d48e;
  --green: #62b94f;
  --green-dark: #23845a;
  --sky: #bfeeff;
  --blue: #4ea9ff;
  --blue-dark: #2475c7;
  --coral: #ff8c63;
  --pink: #ff6f9f;
  --yellow: #ffd84a;
  --violet: #8f79ff;
  --danger: #c53863;
  --white: #fffefa;
  --line: rgba(13, 40, 87, .18);
  --shadow-lg: 0 20px 44px rgba(13, 40, 87, .16);
  --shadow-sm: 0 8px 0 rgba(13, 40, 87, .12);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Avenir Next", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.4;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

:focus-visible {
  outline: 4px solid var(--violet);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 10px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 50% 50% 42% 58%;
  box-shadow: 0 4px 0 var(--ink);
  color: var(--white);
  font-size: 22px;
}

.nav-cluster,
.status-cluster,
.button-row,
.chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link,
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 var(--ink);
  text-decoration: none;
  font-weight: 920;
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}

.nav-link,
.button-secondary {
  color: var(--ink);
  background: var(--white);
}

.button-primary {
  color: var(--ink);
  background: var(--yellow);
}

.button-blue {
  color: var(--white);
  background: var(--blue-dark);
}

.nav-link:hover,
.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

.nav-link:active,
.button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 900;
}

.pill::before {
  width: 9px;
  height: 9px;
  content: "";
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.pill.mock::before {
  background: var(--yellow);
}

.pill.offline::before {
  background: var(--coral);
}

.hero {
  display: grid;
  max-width: 1180px;
  min-height: calc(100vh - 92px);
  align-items: center;
  margin: 0 auto;
  padding: 40px 24px 72px;
  grid-template-columns: minmax(0, .9fr) minmax(480px, 1.25fr);
  gap: 54px;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0 0 22px;
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 1000;
  letter-spacing: -.06em;
  line-height: .92;
}

.hero-copy h1 span {
  display: block;
  color: var(--blue-dark);
}

.hero-copy p {
  max-width: 600px;
  margin: 0 0 26px;
  color: var(--soft-ink);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 780;
}

.cause-strip {
  display: grid;
  margin: 28px 0;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cause-step {
  position: relative;
  min-height: 92px;
  padding: 14px 10px;
  text-align: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}

.cause-step strong {
  display: block;
  margin-bottom: 3px;
  font-size: 25px;
}

.hero-game-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: var(--mint-pale);
  border: 5px solid var(--ink);
  border-radius: 38px;
  box-shadow: var(--shadow-lg);
}

.mini-mission {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 18px;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 24px;
}

.mini-mission img {
  width: 72px;
  height: 58px;
  object-fit: contain;
}

.mini-mission strong {
  font-size: 38px;
  font-weight: 1000;
  letter-spacing: .02em;
}

.mini-lanes {
  position: relative;
  overflow: hidden;
  background: var(--green);
  border: 4px solid var(--ink);
  border-radius: 26px;
}

.mini-lane {
  height: 104px;
  background: linear-gradient(to bottom, var(--green) 0 28%, var(--cream-2) 28% 73%, var(--green) 73% 100%);
  border-bottom: 3px solid rgba(13, 40, 87, .48);
}

.mini-lane:last-child {
  border-bottom: 0;
}

.mini-robot {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 4px;
  width: 108px;
}

.mini-enemy {
  position: absolute;
  z-index: 3;
  right: 10px;
  width: 180px;
  height: 96px;
}

.mini-enemy.one { top: 8px; }
.mini-enemy.two { top: 112px; }
.mini-enemy.three { top: 216px; }

.mini-enemy .monster-art {
  position: absolute;
  right: 0;
  bottom: -5px;
  width: 130px;
}

.mini-enemy .word-image-slot {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 0;
  width: 105px;
  aspect-ratio: 4 / 3;
  padding: 5px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 16px;
}

.word-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mini-projectile {
  position: absolute;
  z-index: 5;
  top: 40px;
  left: 132px;
  padding: 8px 15px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 6px 0 0 var(--yellow);
  font-size: 18px;
  font-weight: 1000;
  transform: rotate(-4deg);
}

.panel-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 64px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 12px 0 28px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 1000;
  letter-spacing: -.045em;
  line-height: .95;
}

.page-heading p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--soft-ink);
  font-size: 17px;
}

.teacher-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}

.word-sidebar,
.editor-panel,
.results-card {
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.word-sidebar {
  align-self: start;
  padding: 16px;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.word-sidebar h2,
.editor-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 1000;
}

.word-list {
  display: grid;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  gap: 10px;
}

.word-tab {
  display: grid;
  width: 100%;
  min-height: 72px;
  align-items: center;
  padding: 8px 12px;
  text-align: left;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 17px;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
}

.word-tab[aria-selected="true"] {
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--ink);
  transform: translateY(-2px);
}

.word-tab img {
  width: 50px;
  height: 46px;
  object-fit: contain;
}

.word-tab strong,
.word-tab small {
  display: block;
}

.word-tab strong {
  font-size: 17px;
  font-weight: 1000;
}

.word-tab small {
  color: var(--soft-ink);
  font-size: 12px;
}

.review-dot {
  width: 13px;
  height: 13px;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.editor-panel {
  padding: 24px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr);
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  font-size: 14px;
  font-weight: 920;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 13px;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.threshold-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.threshold-grid .field input {
  padding-inline: 8px;
  text-align: center;
}

.asset-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.asset-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  padding: 16px;
  background: var(--sky);
  border: 4px solid var(--ink);
  border-radius: 24px;
}

.asset-preview::before {
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 3px 8px;
  content: "4:3 怪兽词图槽";
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-button {
  min-height: 44px;
  padding: 8px 10px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-weight: 900;
}

.structure-card {
  margin-top: 20px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--mint-pale);
}

.structure-card summary {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 950;
}

.structure-card pre {
  overflow: auto;
  max-height: 280px;
  margin: 0;
  padding: 16px;
  border-top: 2px solid var(--ink);
  font: 700 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--green-dark);
  font-size: 14px;
}

.form-message.error {
  color: var(--danger);
}

/* Game */
.game-page {
  min-height: 100vh;
  padding: 12px;
  background: var(--cream);
}

.game-frame {
  position: relative;
  display: grid;
  overflow: hidden;
  width: min(1480px, 100%);
  min-height: calc(100vh - 24px);
  margin: 0 auto;
  background: var(--mint-pale);
  border: 5px solid var(--ink);
  border-radius: 34px;
  box-shadow: var(--shadow-lg);
  grid-template-rows: auto minmax(420px, 1fr) auto;
}

.game-hud {
  display: grid;
  align-items: center;
  padding: 12px 16px;
  background: var(--cream);
  border-bottom: 4px solid var(--ink);
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 14px;
}

.mission-card {
  display: grid;
  max-width: 620px;
  min-height: 108px;
  align-items: center;
  padding: 10px 16px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 6px 0 var(--yellow);
  grid-template-columns: 106px 1fr auto;
  gap: 14px;
}

.mission-card img {
  width: 100px;
  height: 80px;
  object-fit: contain;
}

.mission-copy span,
.mission-copy strong {
  display: block;
}

.mission-copy span {
  color: var(--soft-ink);
  font-size: 13px;
}

.mission-copy strong {
  font-size: clamp(34px, 4.5vw, 62px);
  font-weight: 1000;
  letter-spacing: .015em;
  line-height: 1;
}

.listen-button {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0;
  background: var(--sky);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 24px;
}

.hud-stat {
  display: grid;
  min-width: 96px;
  min-height: 78px;
  align-content: center;
  justify-items: center;
  padding: 8px 14px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 20px;
}

.hud-stat span {
  color: var(--soft-ink);
  font-size: 12px;
}

.hud-stat strong {
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
}

.hud-stat.timer strong {
  font-variant-numeric: tabular-nums;
}

.battlefield {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 420px;
  background: var(--green);
}

.battlefield::before,
.battlefield::after {
  position: absolute;
  z-index: 0;
  content: "";
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #248f49;
}

.battlefield::before {
  width: 150px;
  height: 120px;
  top: -55px;
  left: -35px;
}

.battlefield::after {
  width: 190px;
  height: 150px;
  right: -50px;
  bottom: -78px;
}

.lane {
  position: relative;
  height: 33.333%;
  min-height: 140px;
  background: linear-gradient(to bottom, var(--green) 0 24%, var(--cream-2) 24% 78%, var(--green) 78% 100%);
  border-bottom: 3px solid rgba(13, 40, 87, .55);
}

.lane:last-child {
  border-bottom: 0;
}

.lane::after {
  position: absolute;
  top: 50%;
  right: 0;
  left: 14%;
  height: 3px;
  content: "";
  opacity: .3;
  background: repeating-linear-gradient(90deg, var(--ink) 0 12px, transparent 12px 26px);
}

.robot-station {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 1.5%;
  width: clamp(102px, 13vw, 190px);
  pointer-events: none;
  transform: translateY(-50%);
}

.robot-station img {
  display: block;
  width: 100%;
}

.launcher-port {
  position: absolute;
  z-index: 2;
  top: 42%;
  right: -2%;
  width: clamp(25px, 2.8vw, 39px);
  height: clamp(19px, 2vw, 28px);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 45% 55% 55% 45%;
  box-shadow: inset -7px 0 0 var(--coral);
  transform: translateY(-50%);
}

.launcher-muzzle {
  position: absolute;
  top: 50%;
  right: -8px;
  display: block;
  width: 15px;
  height: 15px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 216, 74, .75);
  transform: translateY(-50%);
}

.launcher-muzzle::after {
  position: absolute;
  content: "";
  inset: 2px;
  background: var(--blue);
  border-radius: inherit;
}

.battlefield[data-charging="true"] .launcher-muzzle {
  background: var(--yellow);
  animation: muzzle-charge 650ms var(--ease) infinite alternate;
}

.robot-wave {
  position: absolute;
  top: 42%;
  right: -22px;
  width: 42px;
  height: 42px;
  opacity: 0;
  border: 5px solid var(--blue);
  border-left-color: transparent;
  border-radius: 50%;
}

.battlefield[data-mic-state="listening"] .robot-wave {
  opacity: 1;
  animation: wave-ring 900ms var(--ease) infinite;
}

.enemy {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: calc(3% + var(--creep-offset, 0px));
  width: clamp(178px, 22vw, 300px);
  aspect-ratio: 1.65 / 1;
  transform: translateY(-50%);
  transition: right 900ms linear, opacity 220ms var(--ease), transform 280ms var(--ease), filter 220ms var(--ease);
}

.enemy[data-creep="1"] { --creep-offset: 8px; }
.enemy[data-creep="2"] { --creep-offset: 16px; }
.enemy[data-creep="3"] { --creep-offset: 24px; }
.enemy[data-creep="4"] { --creep-offset: 32px; }
.enemy[data-creep="5"] { --creep-offset: 40px; }
.enemy[data-creep="6"] { --creep-offset: 48px; }
.enemy[data-creep="7"] { --creep-offset: 56px; }
.enemy[data-creep="8"] { --creep-offset: 64px; }
.enemy[data-creep="9"] { --creep-offset: 72px; }
.enemy[data-creep="10"] { --creep-offset: 80px; }
.enemy[data-creep="11"] { --creep-offset: 88px; }
.enemy[data-creep="12"] { --creep-offset: 96px; }
.enemy[data-creep="13"] { --creep-offset: 104px; }
.enemy[data-creep="14"] { --creep-offset: 112px; }
.enemy[data-creep="15"] { --creep-offset: 120px; }
.enemy[data-creep="16"] { --creep-offset: 128px; }
.enemy[data-creep="17"] { --creep-offset: 136px; }
.enemy[data-creep="18"] { --creep-offset: 144px; }

.enemy:not(.active) {
  opacity: .62;
  filter: saturate(.72);
}

.enemy .monster-art {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 72%;
  height: 100%;
  object-fit: contain;
}

.enemy .word-image-slot {
  position: absolute;
  z-index: 2;
  top: 13%;
  left: 0;
  display: grid;
  width: 54%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  padding: 7px;
  background: var(--white);
  border: clamp(3px, .35vw, 6px) solid var(--ink);
  border-radius: clamp(13px, 2vw, 24px);
  box-shadow: inset 0 0 0 5px var(--sky), 5px 6px 0 rgba(13, 40, 87, .18);
}

.projectile-target {
  position: absolute;
  z-index: 7;
  top: 49%;
  left: 27%;
  width: 12px;
  height: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.enemy.active .word-image-slot {
  box-shadow: inset 0 0 0 5px var(--yellow), 6px 7px 0 rgba(13, 40, 87, .22);
}

.hp-bar {
  position: absolute;
  z-index: 4;
  bottom: 0;
  left: 2%;
  display: flex;
  width: 54%;
  justify-content: center;
  gap: 3px;
}

.hp-pip {
  width: clamp(13px, 1.8vw, 22px);
  aspect-ratio: 1;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 50% 50% 45% 45%;
}

.hp-pip.empty {
  background: var(--white);
}

.enemy-label {
  position: absolute;
  z-index: 5;
  top: 1%;
  left: 8%;
  padding: 2px 7px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
}

.enemy.hit {
  animation: enemy-hit 320ms var(--ease);
}

.enemy.critical {
  transform: translate(-28px, -50%) rotate(-3deg);
}

.enemy.defeated {
  opacity: 0;
  transform: translate(32px, -50%) scale(.65) rotate(7deg);
}

.shield-crack {
  position: absolute;
  z-index: 6;
  top: 34%;
  left: 25%;
  width: 46px;
  height: 46px;
  opacity: 0;
  background: var(--white);
  clip-path: polygon(45% 0, 59% 35%, 100% 21%, 71% 54%, 97% 78%, 61% 69%, 49% 100%, 38% 67%, 0 83%, 26% 53%, 4% 30%, 39% 36%);
  filter: drop-shadow(0 0 0 var(--ink));
}

.enemy.hit .shield-crack,
.enemy.critical .shield-crack {
  opacity: 1;
}

.projectile-layer {
  position: absolute;
  z-index: 9;
  inset: 0;
  pointer-events: none;
}

.projectile-flight-instance {
  z-index: 1;
  contain: layout style;
}

.projectile-flight-instance svg {
  z-index: 0;
}

.projectile-flight-instance .word-projectile {
  z-index: 1;
}

.projectile-flight-instance svg path {
  filter: drop-shadow(0 0 3px rgba(255, 254, 250, .95));
  animation: route-flow 380ms linear infinite;
}

.word-projectile {
  position: absolute;
  display: inline-flex;
  min-width: 108px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  color: var(--ink);
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: -8px 0 0 rgba(78, 169, 255, .45);
  font-size: clamp(17px, 2vw, 27px);
  font-weight: 1000;
  letter-spacing: .02em;
}

.word-projectile::before,
.word-projectile::after {
  position: absolute;
  right: 100%;
  height: 5px;
  content: "";
  background: currentColor;
  border-radius: 999px;
}

.word-projectile::before { width: 34px; top: 12px; }
.word-projectile::after { width: 52px; bottom: 10px; opacity: .45; }

.damage-lane-0 { top: 11.667%; }
.damage-lane-1 { top: 45%; }
.damage-lane-2 { top: 78.333%; }

.star-lane-0 { top: 6.667%; }
.star-lane-1 { top: 40%; }
.star-lane-2 { top: 73.333%; }

.word-projectile.tier-basic {
  background: var(--sky);
  box-shadow: -10px 0 0 var(--blue);
}

.word-projectile.tier-good {
  background: #ded7ff;
  box-shadow: -12px 0 0 var(--violet);
  font-size: clamp(20px, 2.3vw, 31px);
}

.word-projectile.tier-excellent {
  background: var(--yellow);
  box-shadow: -14px 0 0 var(--coral);
  font-size: clamp(22px, 2.6vw, 35px);
}

.damage-pop {
  position: absolute;
  z-index: 12;
  right: 24%;
  padding: 7px 12px;
  color: var(--white);
  background: var(--ink);
  border: 3px solid var(--white);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 21px;
  font-weight: 1000;
  transform: rotate(-5deg);
}

.damage-pop.excellent {
  color: var(--ink);
  background: var(--yellow);
}

.star-drop {
  position: absolute;
  z-index: 11;
  right: 20%;
  color: var(--yellow);
  font-size: 58px;
  filter: drop-shadow(0 4px 0 var(--ink));
  animation: star-drop 650ms var(--ease) both;
}

.game-controls {
  display: grid;
  align-items: center;
  padding: 10px 16px 14px;
  background: var(--cream);
  border-top: 4px solid var(--ink);
  grid-template-columns: minmax(220px, .7fr) minmax(340px, 1.3fr) minmax(180px, .6fr);
  gap: 14px;
}

.login-form-grid {
  margin-top: 22px;
  text-align: left;
}

.review-dot.approved { background: var(--mint); }
.review-dot.pending { background: var(--yellow); }

.results-actions {
  justify-content: center;
  margin-top: 24px;
}

.mic-control {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.mic-button {
  grid-row: 1 / 3;
}

.mic-copy {
  min-width: 0;
}

.mic-button {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 82px;
  height: 82px;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: var(--blue-dark);
  border: 5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 7px 0 var(--ink);
  font-size: 36px;
  transition: transform 140ms var(--ease), background 140ms linear;
}

.mic-button[data-state="listening"] {
  background: var(--coral);
  animation: mic-pulse 900ms var(--ease) infinite;
}

.mic-button[data-state="scoring"] {
  background: var(--violet);
}

.mic-copy strong,
.mic-copy span {
  display: block;
}

.mic-copy strong {
  font-size: 17px;
  font-weight: 1000;
}

.mic-copy span {
  color: var(--soft-ink);
  font-size: 13px;
}

.live-transcript {
  overflow: hidden;
  max-width: 34ch;
  margin-top: 3px;
  color: var(--blue-dark) !important;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.precision-button {
  justify-self: start;
  min-height: 34px;
  padding: 5px 10px;
  color: var(--ink);
  background: var(--sky);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 11px;
  font-weight: 1000;
}

.precision-button:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--ink);
  transform: translateY(2px);
}

.word-dock {
  display: flex;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  justify-content: center;
  padding-block: 5px;
  gap: 10px;
}

.dock-word {
  display: grid;
  flex: 0 0 auto;
  width: clamp(74px, 8vw, 112px);
  min-height: 78px;
  place-items: center;
  padding: 5px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 20px;
}

.dock-word.active {
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--ink);
  transform: translateY(-4px);
}

.dock-word img {
  width: 52px;
  height: 46px;
  object-fit: contain;
}

.dock-word span {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-card {
  min-height: 62px;
  padding: 10px 12px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 17px;
  text-align: center;
}

.feedback-card strong,
.feedback-card span {
  display: block;
}

.feedback-card strong {
  font-size: 16px;
  font-weight: 1000;
}

.feedback-card span {
  color: var(--soft-ink);
  font-size: 12px;
}

.qa-panel {
  position: fixed;
  z-index: 100;
  top: 12px;
  right: 12px;
  display: grid;
  width: 188px;
  padding: 10px;
  background: var(--white);
  border: 3px solid var(--danger);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  gap: 6px;
}

.qa-panel strong {
  color: var(--danger);
  font-size: 12px;
}

.qa-panel button {
  min-height: 32px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
}

.start-overlay,
.paused-overlay {
  position: absolute;
  z-index: 50;
  display: grid;
  inset: 0;
  place-items: center;
  background: rgba(255, 248, 221, .92);
}

.start-overlay {
  z-index: 60;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(circle at 18% 25%, rgba(191, 238, 255, .92) 0 72px, transparent 73px),
    radial-gradient(circle at 84% 78%, rgba(102, 212, 142, .52) 0 106px, transparent 107px),
    rgba(255, 248, 221, .95);
}

.start-card {
  position: relative;
  overflow: auto;
  width: min(580px, 100%);
  max-height: 100%;
  padding: clamp(24px, 5vw, 46px);
  text-align: center;
  background: var(--white);
  border: 5px solid var(--ink);
  border-radius: 32px;
  box-shadow: 0 12px 0 var(--ink);
}

.start-card h2 {
  margin: 4px 0 12px;
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 1000;
  letter-spacing: -.035em;
  line-height: 1.04;
}

.start-card > p:not(.section-kicker) {
  max-width: 46ch;
  margin: 0 auto 22px;
  color: var(--soft-ink);
}

.start-card > p strong {
  color: var(--ink);
  white-space: nowrap;
}

.start-card .button {
  width: min(360px, 100%);
}

.start-card small {
  display: block;
  max-width: 52ch;
  margin: 16px auto 0;
  color: var(--soft-ink);
  font-size: 11px;
}

.start-orbit {
  position: static;
  display: inline-flex;
  margin: 0 auto 12px;
  padding: 8px 14px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 1000;
  transform: rotate(4deg);
}

.paused-card {
  max-width: 360px;
  padding: 24px;
  text-align: center;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
}

.paused-card h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.results-page {
  display: grid;
  min-height: calc(100vh - 90px);
  place-items: center;
  padding: 24px;
}

.results-card {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 54px);
  text-align: center;
}

.results-card .result-star {
  display: block;
  margin-bottom: 8px;
  color: var(--yellow);
  font-size: 72px;
  line-height: 1;
  text-shadow: 0 5px 0 var(--ink);
}

.results-card h1 {
  margin: 0 0 10px;
  font-size: clamp(40px, 7vw, 70px);
  font-weight: 1000;
  letter-spacing: -.045em;
}

.results-grid {
  display: grid;
  margin: 28px 0;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.result-stat {
  padding: 14px 8px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
}

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

.result-stat strong {
  font-size: 32px;
  font-weight: 1000;
}

.result-stat span {
  color: var(--soft-ink);
  font-size: 12px;
}

.error-page {
  display: grid;
  min-height: 70vh;
  place-items: center;
  padding: 24px;
  text-align: center;
}

@keyframes wave-ring {
  0% { transform: scale(.5); opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes mic-pulse {
  50% { transform: scale(1.06); }
}

@keyframes muzzle-charge {
  to { box-shadow: 0 0 0 13px rgba(255, 216, 74, 0); transform: translateY(-50%) scale(1.16); }
}

@keyframes route-flow {
  to { stroke-dashoffset: -38; }
}

@keyframes enemy-hit {
  35% { filter: brightness(1.7); transform: translate(-10px, -50%) scale(1.03); }
}

@keyframes star-drop {
  0% { transform: translateY(-28px) scale(.4) rotate(-25deg); opacity: 0; }
  65% { opacity: 1; }
  100% { transform: translateY(48px) scale(1) rotate(8deg); opacity: 0; }
}

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

  .hero-game-card {
    max-width: 720px;
  }

  .teacher-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

  .game-frame {
    min-height: calc(100vh - 24px);
    grid-template-rows: auto minmax(390px, 1fr) auto;
  }

  .game-hud {
    grid-template-columns: minmax(0, 1fr) 82px 82px;
  }

  .mission-card {
    min-height: 90px;
    grid-template-columns: 76px 1fr 44px;
  }

  .mission-card img {
    width: 72px;
    height: 62px;
  }

  .game-controls {
    grid-template-columns: minmax(300px, 1fr) minmax(260px, 1.2fr);
  }

  .feedback-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 12px 14px;
  }

  .site-header .nav-link.secondary-nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 22px 16px 48px;
    gap: 32px;
  }

  .hero-copy h1 {
    font-size: clamp(46px, 16vw, 68px);
  }

  .cause-strip {
    grid-template-columns: 1fr 1fr;
  }

  .hero-game-card {
    padding: 10px;
    border-width: 4px;
    border-radius: 28px;
  }

  .mini-lane {
    height: 84px;
  }

  .mini-robot {
    width: 82px;
  }

  .mini-enemy {
    width: 145px;
    height: 76px;
  }

  .mini-enemy.two { top: 92px; }
  .mini-enemy.three { top: 176px; }
  .mini-enemy .word-image-slot { width: 82px; }
  .mini-enemy .monster-art { width: 105px; }
  .mini-projectile { left: 100px; top: 32px; font-size: 13px; }

  .panel-page {
    padding: 8px 14px 40px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .status-cluster {
    margin-top: 14px;
  }

  .teacher-layout {
    grid-template-columns: 1fr;
  }

  .word-sidebar {
    overflow-x: auto;
  }

  .word-list {
    display: flex;
  }

  .word-list li {
    flex: 0 0 188px;
  }

  .form-grid,
  .threshold-grid {
    grid-template-columns: 1fr 1fr;
  }

  .game-page {
    padding: 0;
  }

  .game-frame {
    min-height: 100svh;
    border-width: 0;
    border-radius: 0;
    grid-template-rows: auto minmax(360px, 1fr) auto;
  }

  .game-hud {
    padding: 8px;
    border-bottom-width: 3px;
    grid-template-columns: minmax(0, 1fr) 62px 62px;
    gap: 6px;
  }

  .mission-card {
    min-width: 0;
    min-height: 72px;
    padding: 6px 8px;
    border-width: 3px;
    border-radius: 17px;
    grid-template-columns: 58px minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .mission-card img {
    width: 56px;
    height: 46px;
  }

  .mission-copy span {
    font-size: 10px;
  }

  .mission-copy strong {
    overflow: hidden;
    font-size: clamp(25px, 8vw, 36px);
    text-overflow: ellipsis;
  }

  .listen-button {
    width: 38px;
    height: 38px;
    border-width: 2px;
    font-size: 17px;
  }

  .hud-stat {
    min-width: 0;
    min-height: 62px;
    padding: 5px;
    border-width: 2px;
    border-radius: 14px;
  }

  .hud-stat strong {
    font-size: 20px;
  }

  .hud-stat.timer strong {
    font-size: 16px;
  }

  .hud-stat span {
    font-size: 9px;
  }

  .battlefield,
  .lane {
    min-height: 120px;
  }

  .robot-station {
    top: 50%;
    left: -3%;
    width: 92px;
  }

  .launcher-port {
    right: -5%;
    border-width: 2px;
  }

  .launcher-muzzle {
    right: -7px;
    width: 13px;
    height: 13px;
    border-width: 2px;
  }

  .enemy {
    right: var(--creep-offset, 0px);
    width: 176px;
  }

  .enemy-label {
    top: -2%;
    font-size: 9px;
  }

  .hp-bar {
    gap: 2px;
  }

  .hp-pip {
    width: 13px;
  }

  .word-projectile {
    min-width: 82px;
    min-height: 36px;
    padding: 5px 10px;
    border-width: 3px;
    font-size: 14px;
  }

  .damage-pop {
    right: 18%;
    font-size: 14px;
  }

  .game-controls {
    padding: 8px max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top-width: 3px;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .mic-button {
    width: 62px;
    height: 62px;
    border-width: 4px;
    font-size: 28px;
  }

  .mic-copy strong {
    font-size: 14px;
  }

  .mic-copy span {
    font-size: 10px;
  }

  .precision-button {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 9px;
  }

  .start-overlay {
    padding: 12px;
  }

  .start-card {
    padding: 28px 18px 24px;
    border-width: 4px;
    border-radius: 24px;
    box-shadow: 0 8px 0 var(--ink);
  }

  .start-card h2 {
    font-size: clamp(28px, 9vw, 40px);
  }

  .start-orbit {
    top: -14px;
    right: 14px;
    padding: 5px 10px;
    border-width: 2px;
    font-size: 12px;
  }

  .word-dock {
    gap: 5px;
  }

  .dock-word {
    width: 54px;
    min-height: 58px;
    border-width: 2px;
    border-radius: 13px;
  }

  .dock-word img {
    width: 38px;
    height: 32px;
  }

  .dock-word span {
    font-size: 8px;
  }

  .feedback-card {
    min-height: 44px;
    padding: 5px 8px;
    grid-column: 1 / -1;
  }

  .feedback-card strong { font-size: 13px; }
  .feedback-card span { font-size: 10px; }

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

  .qa-panel {
    top: auto;
    right: 6px;
    bottom: 6px;
    width: 154px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .battlefield[data-charging="true"] .launcher-muzzle {
    animation: none;
    box-shadow: 0 0 0 5px rgba(255, 216, 74, .42);
  }

  .projectile-flight-instance svg path {
    filter: none;
  }
}
