:root {
  color-scheme: light;
  --ink: #102d3c;
  --muted: #546976;
  --paper: #f3f5ef;
  --orange: #e8522c;
  --line: #d6dfdf;
  --cream: #fffdf1;
  --mint: #c8eddd;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #ed5c28;
  outline-offset: 4px;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.shell {
  max-width: 1450px;
  margin: auto;
  padding: 0 46px;
}
.topbar {
  height: 91px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1.1px;
}
.brand b {
  font-weight: 500;
  color: #527863;
}
.brand-mark {
  font-size: 32px;
  line-height: 1;
  background: #17394a;
  color: #fbf5de;
  border-radius: 13px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  position: relative;
}
.brand-mark > span {
  font-size: 18px;
  position: absolute;
  right: -1px;
  top: 0;
  color: #ffc661;
}
.lab-label {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #526d66;
}
.lab-label > span {
  background: #427e61;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.settings-button {
  border: 1px solid #c4cecb;
  background: transparent;
  border-radius: 30px;
  padding: 10px 15px;
  font-size: 11px;
  font-weight: 650;
}
.settings-button span {
  font-size: 15px;
  margin-left: 12px;
}
.choose-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 24px 0 15px;
}
.choose-heading h1 {
  font-size: 23px;
  letter-spacing: -0.8px;
  font-weight: 750;
  margin: 0;
}
.choose-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.world-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-bottom: 18px;
}
.world-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 12px 18px;
  border: 1.5px solid #cbd6d3;
  border-radius: 14px;
  background: #fffdf6;
  position: relative;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.world-card:hover {
  transform: translateY(-2px);
  border-color: #6b9994;
}
.world-card.active {
  background: #e4f0e8;
  border-color: #1e5e4c;
  box-shadow: 0 2px 0 #1e5e4c;
}
.world-icon {
  width: 69px;
  height: 50px;
  flex-shrink: 0;
  background: #d3eaf3;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.world-card[data-world='balloon'] .world-icon {
  background: #f2debc;
}
.world-card[data-world='space'] .world-icon {
  background: #172c50;
}
.world-icon svg {
  width: 68px;
  height: 48px;
}
.world-card small {
  font-size: 8px;
  letter-spacing: 1.3px;
  font-weight: 800;
  color: #576f71;
  display: block;
  margin-bottom: 6px;
}
.world-card strong {
  font-size: 17px;
  letter-spacing: -0.5px;
}
.select-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #afbdb8;
  margin-left: auto;
  flex-shrink: 0;
}
.active .select-dot {
  background: #276c56;
  border-color: #276c56;
  box-shadow: inset 0 0 0 3px #e4f0e8;
}
.settings {
  background: #fffef9;
  padding: 21px 25px;
  border: 1px solid #cedbd5;
  border-radius: 15px;
  margin: 20px 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.settings-grid > label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
}
.settings select {
  padding: 10px 8px;
  border: 1px solid #b5c6c0;
  border-radius: 6px;
  background: #f3f7f1;
  font-size: 12px;
  color: #183d3d;
}
.sound-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  border-top: 1px solid #e0e5dc;
  padding-top: 17px;
  margin-top: 18px;
}
.check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}
.check input {
  accent-color: #23684d;
  width: 17px;
  height: 17px;
}
.range-label {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  color: #435f64;
  min-height: 28px;
}
.range-label input {
  min-width: 60px;
  max-width: 145px;
  accent-color: #356f60;
  flex: 1;
}
.settings-note {
  font-size: 10px;
  margin: 15px 0 0;
  color: #596e6d;
}
.game {
  border-radius: 19px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 12px 34px #193d3d17;
  border: 1px solid #153544;
}
.stage {
  position: relative;
  height: clamp(360px, 33vw, 470px);
  isolation: isolate;
  overflow: hidden;
  background: #128fc2;
}
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.world-heading {
  position: absolute;
  top: 28px;
  left: 30px;
  max-width: 330px;
  z-index: 1;
  color: #073950;
  text-shadow: 0 1px 0 #c9f6f555;
  pointer-events: none;
}
.location {
  font-size: 9px;
  letter-spacing: 2.6px;
  font-weight: 900;
}
.world-heading h2 {
  font-size: 39px;
  letter-spacing: -1.8px;
  line-height: 1.03;
  margin: 8px 0 10px;
  font-weight: 850;
}
.world-heading p {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 650;
  margin: 0;
  max-width: 255px;
}
.hud {
  position: absolute;
  right: 26px;
  top: 23px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #073950;
  z-index: 2;
  padding: 12px 16px;
  border: 1px solid #d7f7ef80;
  background: #eefbf39e;
  border-radius: 12px;
  backdrop-filter: blur(9px);
}
.hud > div {
  min-width: 42px;
}
.hud > div > span {
  display: block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 4px;
}
.hud strong {
  font-size: 25px;
  line-height: 1;
  letter-spacing: -1px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.hud strong small {
  font-size: 12px;
  margin-left: 4px;
  font-weight: 650;
}
.stage-button {
  background: #f6f7eccc;
  border: 1px solid #94b7b4;
  padding: 9px;
  border-radius: 9px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stage-button > span {
  font-size: 10px;
}
.journey {
  position: absolute;
  left: 30px;
  bottom: 23px;
  display: flex;
  gap: 13px;
  align-items: center;
  background: #083745e6;
  color: #eafbf1;
  padding: 10px 14px;
  border: 1px solid #ffffff50;
  border-radius: 30px;
  z-index: 2;
}
.journey > span {
  font-size: 9px;
  font-weight: 600;
}
.journey > span:last-child {
  color: #bedbd5;
  font-size: 8px;
}
#progress-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
#progress-dots i {
  height: 7px;
  width: 7px;
  border: 1px solid #b4dfd2;
  border-radius: 50%;
  background: transparent;
}
#progress-dots i:nth-child(2n) {
  margin-right: 3px;
}
#progress-dots i.done {
  background: #ffc857;
  border-color: #ffc857;
}
#progress-dots i.current {
  background: #edfced;
  border-color: #edfced;
  box-shadow: 0 0 0 2px #eefbf333;
}
.world-status {
  position: absolute;
  right: 28px;
  bottom: 29px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #083745e6;
  color: #eafbf1;
  border-radius: 20px;
  padding: 9px 13px;
  z-index: 1;
}
.status-dot {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #ffd46a;
}
.stage-overlay {
  position: absolute;
  inset: 0;
  background: #0b2935ad;
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 5;
  color: #fffcf1;
}
.stage-overlay > span {
  color: #ffcd65;
  font-size: 43px;
}
.stage-overlay h3 {
  font-size: 31px;
  letter-spacing: -1px;
  margin: 12px 0 5px;
}
.stage-overlay p {
  font-size: 13px;
  margin: 0 20px 22px;
  text-align: center;
}
.checkpoint {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translateX(-50%);
  background: #173a3ae8;
  color: #fff8d6;
  border: 1px solid #f6d875;
  padding: 12px 24px;
  border-radius: 12px;
  z-index: 4;
  text-align: center;
  box-shadow: 0 8px 20px #16393d33;
  pointer-events: none;
  white-space: nowrap;
}
.checkpoint > span {
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}
.checkpoint > strong {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.word-dock {
  background: var(--cream);
  padding: 19px 30px 21px;
  position: relative;
  z-index: 2;
  border-top: 4px solid #f4c65e;
  min-height: 213px;
}
.dock-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 15px;
}
.mode-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
  background: #e8ece3;
  border: 1px solid #d6ddd0;
}
.mode-switch button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
  padding: 7px 13px;
  color: #49605f;
}
.mode-switch button[aria-pressed='true'] {
  background: #153f48;
  color: white;
  box-shadow: 0 2px 3px #18363d22;
}
.mode-switch button span {
  margin-right: 4px;
}
#word-step {
  font-size: 10px;
  color: #4f696c;
}
.timer {
  font-size: 10px;
  font-weight: 750;
  color: #496764;
  margin-left: auto;
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 105px;
}
.ready h3 {
  font-size: 27px;
  letter-spacing: -1px;
  margin: 0 0 8px;
}
.ready p {
  font-size: 12px;
  color: #49626b;
  margin: 0;
  line-height: 1.55;
}
.primary {
  background: #c94623;
  color: #fffdf4;
  border: 1px solid #ad3b20;
  box-shadow: 0 4px 0 #a5351f;
  padding: 15px 23px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  min-height: 48px;
  white-space: nowrap;
  transition:
    background 0.15s,
    transform 0.15s;
}
.primary:hover {
  background: #b83c1c;
  transform: translateY(-1px);
}
.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a5351f;
}
.primary span {
  margin-left: 30px;
}
.prompt-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 3px 0 12px;
  min-height: 58px;
}
.prompt-label {
  font-size: 8px;
  letter-spacing: 1.4px;
  font-weight: 800;
  display: block;
  color: #576d6b;
  margin-bottom: 6px;
}
.target {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 2px;
  min-height: 36px;
  color: #183a48;
  font-variant-ligatures: none;
}
.target .correct {
  color: #18704e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.target .wrong {
  background: #ffe0cb;
  color: #a73316;
  border-radius: 3px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.target.listen {
  letter-spacing: -0.6px;
  font-size: 26px;
}
.repeat {
  border: 1px solid #a2b5ac;
  border-radius: 8px;
  background: #edf3e8;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 10px 13px;
  margin-left: auto;
  color: #1e514b;
}
.repeat span {
  font-size: 16px;
}
.letter-progress {
  margin-left: auto;
  width: 125px;
  text-align: right;
  color: #58716f;
  font-size: 9px;
}
.letter-progress > div {
  height: 5px;
  background: #e1e7dc;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.letter-progress > div > span {
  height: 100%;
  background: #2b866b;
  display: block;
  width: 0;
  transition: width 0.13s;
}
#word-form {
  display: flex;
  gap: 10px;
}
#word-input {
  width: 100%;
  min-width: 0;
  height: 51px;
  border: 2px solid #789994;
  background: #fff;
  color: #153846;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 20px;
  letter-spacing: 1px;
  font-weight: 650;
  outline-offset: 2px;
}
#word-input::placeholder {
  color: #7a8988;
  letter-spacing: 0;
  font-size: 15px;
  font-weight: 450;
}
#word-input.error {
  border-color: #c75935;
  background: #fff7ef;
}
#word-input:disabled {
  background: #ecf1e8;
  opacity: 0.8;
}
.submit {
  border: 1px solid #173f45;
  border-radius: 9px;
  background: #1b5154;
  color: #fffef0;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 750;
  min-width: 102px;
}
.submit span {
  font-size: 19px;
  margin-left: 15px;
}
.input-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  min-height: 25px;
}
.input-bottom p {
  font-size: 10px;
  margin: 0;
  color: #496660;
  line-height: 1.5;
}
#feedback {
  font-weight: 650;
}
#feedback.error {
  color: #ae3c1e;
}
#feedback.success {
  color: #186344;
}
#input-hint {
  color: #65756f;
  font-size: 9px;
  text-align: right;
}
.under-game {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 17px 0 25px;
  font-size: 10px;
  color: #60746f;
}
.under-game strong {
  color: #325752;
  font-weight: 750;
}
.under-game > div {
  display: flex;
  gap: 17px;
  align-items: center;
}
.under-game button {
  background: none;
  border: 0;
  border-bottom: 1px solid #7e9890;
  padding: 4px 0;
  font-size: 10px;
  font-weight: 650;
  color: #3c655f;
}
footer {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 20px 0 26px;
  font-size: 9px;
  color: #536b60;
}
footer > span:first-child {
  font-size: 8px;
  letter-spacing: 1.3px;
  font-weight: 800;
}
footer b {
  margin: 0 7px;
}
footer a {
  font-size: 9px;
  color: #4d7367;
  text-underline-offset: 3px;
}
.speech-fallback {
  padding: 10px 0 16px;
}
.speech-fallback h3 {
  font-size: 20px;
  margin: 0 0 9px;
}
.speech-fallback p {
  font-size: 12px;
  color: #57716d;
  margin: 0 0 16px;
}
.secondary {
  background: #eef3e7;
  border: 1px solid #a5b9a9;
  border-radius: 8px;
  padding: 13px 18px;
  margin-left: 10px;
  font-size: 12px;
  font-weight: 700;
}
.results {
  display: flex;
  align-items: center;
  gap: 30px;
  justify-content: space-between;
  min-height: 120px;
}
.result-eyebrow {
  font-size: 8px;
  color: #36735d;
  letter-spacing: 1.5px;
  font-weight: 900;
}
.results h3 {
  font-size: 25px;
  letter-spacing: -1px;
  margin: 7px 0;
}
.results p {
  font-size: 11px;
  color: #59716c;
  margin: 0;
  line-height: 1.5;
}
.result-stats {
  display: flex;
  gap: 25px;
}
.result-stats strong {
  display: block;
  font-size: 24px;
  letter-spacing: -1px;
  white-space: nowrap;
}
.result-stats span {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #5b716c;
  display: block;
  margin-top: 5px;
}
.game[data-world='space'] .world-heading {
  color: #f0fbfa;
  text-shadow: none;
}
.game[data-world='space'] .world-heading p {
  color: #c0dbe6;
}
.game[data-world='space'] .hud {
  background: #12274ddb;
  border-color: #466491;
  color: #f1ffff;
}
.game[data-world='space'] .stage-button {
  color: #d6f6f7;
  background: #283e5b;
  border-color: #55728e;
}
.game[data-world='space'] .journey,
.game[data-world='space'] .world-status {
  background: #102646ed;
}
.game[data-world='balloon'] .world-heading {
  color: #48332d;
}
.game[data-world='balloon'] .hud {
  background: #fff4deba;
  border-color: #ffefc6;
}
.game[data-world='balloon'] .word-dock {
  border-top-color: #f08d5b;
}
.game[data-world='space'] .word-dock {
  border-top-color: #52cec7;
}
.skip {
  position: fixed;
  top: -100px;
  left: 15px;
  z-index: 100;
  background: #ffca69;
  padding: 12px 18px;
  border-radius: 8px;
}
.skip:focus {
  top: 15px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (min-width: 1600px) {
  .shell {
    max-width: 1500px;
  }
  .stage {
    height: 490px;
  }
}
@media (max-width: 1100px) {
  .shell {
    padding: 0 25px;
  }
  .world-card {
    padding: 10px 13px;
    gap: 8px;
  }
  .world-card strong {
    font-size: 15px;
  }
  .world-card small {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .world-icon {
    width: 56px;
  }
  .select-dot {
    width: 11px;
    height: 11px;
  }
  .world-heading {
    left: 24px;
    top: 25px;
  }
  .world-heading h2 {
    font-size: 35px;
  }
  .hud {
    right: 20px;
    gap: 16px;
  }
  .results {
    gap: 16px;
  }
  .results h3 {
    font-size: 21px;
  }
  .result-stats {
    gap: 14px;
  }
  .results .primary {
    font-size: 11px;
    padding: 13px;
  }
  .choose-heading > span {
    font-size: 10px;
  }
  .stage {
    height: 380px;
  }
}
@media (max-width: 760px) {
  .shell {
    padding: 0 16px;
  }
  .topbar {
    height: 73px;
  }
  .brand {
    font-size: 21px;
  }
  .lab-label {
    display: none;
  }
  .settings-button {
    font-size: 10px;
    padding: 8px 11px;
  }
  .choose-heading {
    margin: 21px 0 14px;
  }
  .choose-heading h1 {
    font-size: 21px;
    letter-spacing: -0.7px;
  }
  .choose-heading > span {
    display: none;
  }
  .world-picker {
    gap: 8px;
  }
  .world-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 6px;
  }
  .world-icon {
    width: 100%;
    height: 50px;
  }
  .world-card small {
    font-size: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.6px;
  }
  .world-card strong {
    font-size: 13px;
  }
  .select-dot {
    position: absolute;
    right: 9px;
    bottom: 13px;
    width: 8px;
    height: 8px;
  }
  .world-card.active {
    box-shadow: 0 2px 0 #1e5e4c;
  }
  .stage {
    height: 355px;
  }
  .world-heading {
    top: 20px;
    left: 19px;
    max-width: 210px;
  }
  .world-heading h2 {
    font-size: 29px;
    margin: 6px 0;
  }
  .world-heading p {
    font-size: 10px;
    max-width: 200px;
  }
  .location {
    font-size: 7px;
    letter-spacing: 1.9px;
  }
  .hud {
    top: 17px;
    right: 14px;
    padding: 9px;
    gap: 12px;
    border-radius: 9px;
  }
  .hud strong {
    font-size: 20px;
  }
  .hud > div {
    min-width: 31px;
  }
  .hud > div > span {
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  .stage-button {
    padding: 7px;
    font-size: 12px;
  }
  .stage-button > span {
    display: none;
  }
  .journey {
    left: 15px;
    bottom: 17px;
    padding: 9px 12px;
    gap: 8px;
  }
  .journey > span {
    font-size: 8px;
  }
  .journey > span:last-child {
    display: none;
  }
  .world-status {
    right: 13px;
    bottom: 19px;
    padding: 8px 10px;
    font-size: 8px;
    max-width: 165px;
  }
  .word-dock {
    padding: 15px 18px 18px;
    min-height: 222px;
  }
  .dock-top {
    gap: 8px;
    margin-bottom: 16px;
  }
  .mode-switch button {
    font-size: 10px;
    padding: 7px 10px;
  }
  #word-step {
    font-size: 9px;
    max-width: 100px;
    line-height: 1.4;
  }
  .timer {
    font-size: 9px;
  }
  .ready {
    gap: 15px;
    min-height: 122px;
  }
  .ready h3 {
    font-size: 23px;
  }
  .ready p {
    font-size: 11px;
  }
  .primary {
    padding: 13px 17px;
    font-size: 12px;
  }
  .primary span {
    margin-left: 14px;
  }
  .prompt-row {
    gap: 12px;
  }
  .target {
    font-size: 29px;
    letter-spacing: 1px;
  }
  .letter-progress {
    width: 86px;
  }
  .input-bottom {
    flex-direction: column;
    gap: 4px;
  }
  #input-hint {
    text-align: left;
    font-size: 8px;
  }
  .under-game {
    align-items: flex-start;
    font-size: 9px;
    line-height: 1.5;
  }
  .under-game strong {
    display: block;
  }
  .under-game > div {
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    white-space: nowrap;
  }
  footer {
    flex-wrap: wrap;
    gap: 10px;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sound-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .settings {
    padding: 16px;
  }
  .results {
    flex-wrap: wrap;
    gap: 14px;
  }
  .results > div:first-child {
    width: 100%;
  }
  .results h3 {
    font-size: 24px;
  }
  .result-stats {
    gap: 24px;
    margin-right: auto;
  }
  .results .primary {
    font-size: 11px;
  }
  .stage-overlay h3 {
    font-size: 26px;
  }
  .checkpoint {
    top: 40%;
  }
  .checkpoint strong {
    font-size: 18px;
  }
  .target.listen {
    font-size: 24px;
  }
}
@media (max-width: 440px) {
  .shell {
    padding: 0 10px;
  }
  .topbar {
    height: 68px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 28px;
  }
  .brand {
    font-size: 20px;
    gap: 7px;
  }
  .choose-heading h1 {
    font-size: 19px;
  }
  .world-card {
    padding: 8px;
  }
  .world-card strong {
    font-size: 11px;
  }
  .world-card small {
    font-size: 5.5px;
  }
  .select-dot {
    display: none;
  }
  .world-picker {
    gap: 6px;
    margin-bottom: 14px;
  }
  .stage {
    height: 320px;
  }
  .world-heading {
    top: 17px;
    left: 16px;
  }
  .world-heading h2 {
    font-size: 25px;
  }
  .world-heading p {
    max-width: 167px;
    font-size: 9px;
  }
  .hud {
    gap: 10px;
    right: 11px;
    top: 14px;
  }
  .hud strong {
    font-size: 18px;
  }
  .hud > div > span {
    font-size: 5.5px;
  }
  .hud strong small {
    font-size: 9px;
  }
  .hud > div {
    min-width: 25px;
  }
  .journey {
    left: 13px;
    padding: 8px 10px;
    gap: 7px;
  }
  .journey > span {
    font-size: 7px;
  }
  #progress-dots {
    gap: 4px;
  }
  #progress-dots i {
    height: 6px;
    width: 6px;
  }
  .world-status {
    max-width: 136px;
    font-size: 7px;
    right: 10px;
    bottom: 20px;
    gap: 5px;
  }
  .word-dock {
    padding: 14px 14px 16px;
  }
  .ready {
    flex-wrap: wrap;
    gap: 16px;
    min-height: 0;
    padding: 4px 0 10px;
  }
  .ready h3 {
    font-size: 22px;
  }
  .ready .primary {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  .mode-switch button {
    font-size: 9px;
    padding: 7px 8px;
  }
  .mode-switch button span {
    display: none;
  }
  #word-step {
    max-width: 80px;
    font-size: 8px;
  }
  .timer {
    font-size: 8px;
  }
  .letter-progress {
    width: 72px;
  }
  .submit {
    min-width: 75px;
    padding: 10px 13px;
  }
  .submit span {
    margin-left: 7px;
  }
  #word-input {
    height: 48px;
    font-size: 19px;
  }
  .target {
    font-size: 28px;
  }
  .prompt-label {
    font-size: 7px;
  }
  .repeat {
    font-size: 9px;
    padding: 8px;
  }
  .repeat span {
    font-size: 13px;
  }
  .result-stats {
    gap: 18px;
  }
  .result-stats strong {
    font-size: 22px;
  }
  .results .primary {
    width: 100%;
    margin-top: 4px;
  }
  .sound-grid {
    grid-template-columns: 1fr;
  }
  .sound-grid > div {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .sound-grid .range-label {
    flex: 1;
  }
  .settings-grid {
    gap: 12px;
  }
  .under-game {
    gap: 10px;
  }
  footer > span:first-child {
    font-size: 7px;
    letter-spacing: 0.8px;
  }
  footer a {
    font-size: 8px;
  }
  .speech-fallback .primary,
  .speech-fallback .secondary {
    display: block;
    width: 100%;
    margin: 10px 0 0;
  }
  .target.listen {
    font-size: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .world-card:hover,
  .primary:hover {
    transform: none;
  }
}
body.reduced-motion * {
  transition: none !important;
  scroll-behavior: auto !important;
}
body.reduced-motion .world-card:hover,
body.reduced-motion .primary:hover {
  transform: none;
}
/* Reading contrast stays stable even when moving scenery crosses behind it. */
.world-heading {
  background: #0a3549ed;
  border: 1px solid #cef4ec45;
  border-radius: 12px;
  padding: 14px 17px;
  color: #fff7dd;
  text-shadow: none;
  max-width: 320px;
}
.world-heading p {
  color: #e1f0ed;
}
.game[data-world='balloon'] .world-heading {
  background: #49313eed;
  color: #fff7dd;
  border-color: #ffedd94d;
}
.game[data-world='balloon'] .world-heading p {
  color: #ffeadb;
}
.game[data-world='space'] .world-heading {
  background: #0b1d3be8;
  border-color: #66839b60;
}
@media (max-width: 760px) {
  .world-heading {
    padding: 11px 13px;
    max-width: 225px;
  }
  .world-heading h2 {
    font-size: 27px;
  }
  .world-heading p {
    max-width: 190px;
  }
}
@media (max-width: 440px) {
  .world-heading {
    padding: 10px 12px;
    max-width: 194px;
    left: 13px;
    top: 14px;
  }
  .world-heading h2 {
    font-size: 24px;
  }
  .world-heading p {
    max-width: 166px;
    font-size: 8px;
  }
  .hud {
    right: 9px;
    gap: 8px;
    padding: 8px;
  }
  .stage-button {
    padding: 6px;
  }
}
.word-prompt {
  min-width: 0;
}
@media (max-width: 440px) {
  .target.long-word {
    font-size: 23px;
    letter-spacing: 0.4px;
  }
}
@media (max-width: 360px) {
  .world-heading {
    max-width: 166px;
  }
  .world-heading h2 {
    font-size: 21px;
  }
  .world-heading p {
    font-size: 7.5px;
    max-width: 144px;
  }
  .hud {
    gap: 6px;
  }
  .target.long-word {
    font-size: 21px;
  }
  .letter-progress {
    width: 60px;
  }
  .choose-heading h1 {
    font-size: 17px;
  }
  .brand {
    font-size: 18px;
  }
  .settings-button {
    font-size: 9px;
    padding: 8px;
  }
  .settings-button span {
    margin-left: 5px;
  }
}
/* Learning journeys: the reading surface stays still; character outcomes live above it. */
.stage {
  height: clamp(330px, 31vw, 430px);
}
.world-heading h2 {
  font-size: 34px;
}
.hud {
  gap: 16px;
}
.hud strong {
  font-size: 23px;
}
.world-progress {
  width: 100px;
  height: 5px;
  background: #ffffff33;
  border-radius: 4px;
  overflow: hidden;
}
.world-progress > span {
  height: 100%;
  display: block;
  width: 0;
  background: #ffcd62;
}
.route-panel {
  display: flex;
  align-items: center;
  gap: 30px;
  background: #103742;
  color: #e5f9eb;
  padding: 13px 30px;
  border-top: 1px solid #aed9c64d;
}
.route-eyebrow {
  display: block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: #b6ded3;
  margin-bottom: 5px;
}
.route-panel > div > strong {
  font-size: 23px;
  letter-spacing: -0.7px;
}
.route-panel small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}
.route-milestones {
  display: flex;
  flex: 1;
  justify-content: space-between;
  position: relative;
  gap: 12px;
}
.route-milestones:before {
  content: '';
  position: absolute;
  top: 5px;
  left: 4px;
  right: 4px;
  border-top: 1px dashed #779d97;
}
.route-stop {
  position: relative;
  padding-top: 15px;
  font-size: 10px;
  color: #bddbd2;
  z-index: 1;
}
.route-stop:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #7aa297;
  background: #103742;
}
.route-stop.reached {
  color: #ffe4a3;
}
.route-stop.reached:before {
  background: #ffcc64;
  border-color: #ffcc64;
}
.route-stop small {
  display: block;
  font-size: 8px;
  margin-top: 3px;
}
.route-speed {
  text-align: right;
}
.route-speed strong {
  display: block;
  font-size: 25px;
}
.route-speed span {
  font-size: 8px;
}
.level-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 10px;
  font-weight: 650;
  color: #4e6867;
}
.level-label select {
  background: #edf0e6;
  border: 1px solid #9aafa5;
  border-radius: 7px;
  padding: 8px 10px;
  color: #193e43;
  font-size: 11px;
  font-weight: 700;
}
.dock-top {
  gap: 12px;
}
.timer {
  margin-left: 10px;
}
.curriculum-track {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin: -3px 0 16px;
}
.curriculum-track span {
  font-size: 9px;
  border: 1px solid #d4ddcc;
  color: #546e63;
  padding: 5px 9px;
  border-radius: 20px;
  background: #f1f3e8;
}
.curriculum-track span.active {
  background: #d8eddf;
  border-color: #7aaa91;
  color: #194d3b;
  font-weight: 800;
}
.curriculum-track span.done {
  background: #2d7256;
  border-color: #2d7256;
  color: #fff;
}
.mode-note {
  font-size: 11px;
  background: #faebce;
  border: 1px solid #dcbf89;
  border-radius: 7px;
  padding: 9px 12px;
  color: #724512;
  margin: 0 0 14px;
}
.content-count {
  font-size: 10px !important;
  font-weight: 700;
  margin-top: 8px !important;
  color: #48725c !important;
}
.start-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}
.start-actions .secondary {
  margin: 0;
  font-size: 10px;
  min-height: 37px;
  padding: 10px 12px;
}
.prompt-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  color: #5b736c;
  margin-bottom: 11px;
}
.prompt-meta #case-note {
  font-weight: 750;
  color: #8a5426;
}
.prompt-meta #page-count {
  margin-left: auto;
}
.word-prompt {
  width: 100%;
  flex: 1;
  min-width: 0;
}
.prompt-row {
  margin: 0 0 15px;
}
.target {
  font-size: 27px;
  line-height: 1.55;
  letter-spacing: 0.6px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  min-height: 44px;
}
.target.single-character {
  font-size: 64px;
  line-height: 1.1;
  min-height: 70px;
}
.target.sentence {
  font-size: 23px;
  letter-spacing: 0.3px;
}
.target .pending {
  color: #385767;
}
.target .current {
  background: #ffdc89;
  border-bottom: 3px solid #a56a16;
  border-radius: 3px;
  color: #2e331c;
}
.target .wrong {
  background: #ffd1b6;
  color: #9b3019;
}
.target .space {
  color: #6b857b;
  font-size: 0.8em;
}
.manifest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  background: #edf2e6;
  border: 1px solid #c4d6c2;
  border-radius: 10px;
  padding: 9px 13px;
}
.cargo-preview {
  width: 44px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.cargo-preview svg {
  width: 44px;
  height: 42px;
}
.manifest-copy > span {
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: 750;
  display: block;
  color: #547465;
  margin-bottom: 4px;
}
.manifest-copy > strong {
  font-size: 12px;
  color: #254e44;
}
.next-character {
  background: #fffdf0;
  border: 1px solid #8faa95;
  border-bottom-width: 3px;
  border-radius: 7px;
  min-width: 40px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 3px 9px;
  font-size: 23px;
  font-weight: 800;
  margin-left: auto;
  white-space: nowrap;
}
.next-character.space-key {
  font-size: 12px;
}
.outcome {
  color: #397659;
  font-size: 10px;
  font-weight: 800;
  min-width: 84px;
  text-align: right;
}
.outcome.miss {
  color: #a34425;
}
.outcome.assisted {
  color: #855b19;
}
.word-dock {
  min-height: 260px;
}
.ready {
  min-height: 106px;
}
.ready h3 {
  font-size: 26px;
}
#word-input {
  font-size: 19px;
  height: 49px;
  letter-spacing: 0.2px;
}
#submit[hidden] {
  display: none !important;
}
.assisted-note {
  font-size: 10px;
  color: #80561b;
  background: #fff0cb;
  border-radius: 5px;
  margin-top: 9px;
  padding: 8px 10px;
}
.page-checkpoint {
  padding: 14px 0 8px;
}
.page-checkpoint h3 {
  font-size: 26px;
  margin: 8px 0;
}
.page-checkpoint p {
  font-size: 12px;
  color: #4f6b62;
  line-height: 1.6;
}
.page-checkpoint .fineprint {
  font-size: 10px;
  margin-top: 16px;
}
.journey-results {
  flex-wrap: wrap;
  gap: 18px;
}
.journey-results > div:first-child {
  width: 100%;
}
.journey-results .result-stats {
  flex: 1;
  justify-content: space-between;
  gap: 20px;
}
.journey-results .result-stats strong {
  font-size: 25px;
}
.journey-results .result-detail {
  width: 100%;
  font-size: 11px;
  line-height: 1.6;
  color: #47655d;
  margin: 0;
}
.journey-results .primary {
  margin-left: auto;
}
.scoring-guide {
  font-size: 11px;
  color: #4b675e;
  margin: 0 0 22px;
  max-width: 1000px;
}
.scoring-guide summary {
  font-weight: 750;
  cursor: pointer;
  color: #315c4d;
}
.scoring-guide p {
  line-height: 1.65;
  margin: 9px 0;
}
.under-game > div {
  flex-wrap: wrap;
}
.under-game #save-note {
  color: #557664;
  font-size: 9px;
}
.settings-grid {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.motion-label {
  align-self: center;
}
.settings-grid .check {
  flex-direction: row;
}
.result-eyebrow {
  font-size: 9px;
}
.word-prompt .listen {
  font-size: 24px;
}
@media (max-width: 1000px) {
  .route-panel {
    gap: 20px;
  }
  .world-heading {
    max-width: 280px;
  }
  .world-heading h2 {
    font-size: 30px;
  }
  .hud {
    gap: 12px;
  }
  .hud strong {
    font-size: 21px;
  }
}
@media (max-width: 760px) {
  .stage {
    height: 330px;
  }
  .world-heading {
    max-width: 220px;
  }
  .world-heading h2 {
    font-size: 26px;
  }
  .hud {
    gap: 9px;
  }
  .hud strong {
    font-size: 18px;
  }
  .hud > div {
    min-width: 30px;
  }
  .hud > div > span {
    font-size: 6px;
  }
  .route-panel {
    padding: 12px 18px;
    gap: 18px;
  }
  .route-panel > div > strong {
    font-size: 20px;
  }
  .route-eyebrow {
    font-size: 6px;
  }
  .route-speed strong {
    font-size: 20px;
  }
  .route-stop {
    font-size: 9px;
  }
  .route-stop small {
    font-size: 7px;
  }
  .route-milestones {
    gap: 9px;
  }
  .level-label {
    gap: 5px;
    font-size: 9px;
  }
  .level-label select {
    font-size: 10px;
    padding: 7px;
  }
  .dock-top {
    flex-wrap: wrap;
  }
  .timer {
    margin-left: 0;
    font-size: 10px;
  }
  .curriculum-track {
    margin-top: 0;
  }
  .curriculum-track span {
    font-size: 8px;
  }
  .target.sentence {
    font-size: 20px;
  }
  .target.single-character {
    font-size: 58px;
  }
  .prompt-meta {
    gap: 10px;
    font-size: 9px;
  }
  .manifest-row {
    gap: 9px;
    padding: 8px 10px;
  }
  .manifest-copy > strong {
    font-size: 11px;
  }
  .manifest-copy > span {
    font-size: 7px;
  }
  .outcome {
    font-size: 9px;
    min-width: 68px;
  }
  .next-character {
    font-size: 21px;
  }
  .ready h3 {
    font-size: 23px;
  }
  .start-actions {
    max-width: 180px;
  }
  .content-count {
    font-size: 9px !important;
  }
  .journey-results .result-stats {
    flex-wrap: wrap;
    gap: 14px;
  }
  .journey-results .result-stats > div {
    min-width: 40%;
  }
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .word-dock {
    padding-bottom: 18px;
  }
  .under-game {
    gap: 12px;
  }
}
@media (max-width: 440px) {
  .stage {
    height: 300px;
  }
  .world-heading {
    max-width: 174px;
    left: 12px;
    padding: 9px 10px;
  }
  .world-heading h2 {
    font-size: 21px;
  }
  .world-heading p {
    font-size: 7px;
    max-width: 149px;
  }
  .hud {
    right: 9px;
    padding: 8px 7px;
    gap: 7px;
  }
  .hud strong {
    font-size: 15px;
  }
  .hud > div {
    min-width: 21px;
  }
  .hud > div > span {
    font-size: 5px;
    letter-spacing: 0.35px;
  }
  .stage-button {
    padding: 5px;
    font-size: 10px;
  }
  .world-progress {
    width: 60px;
  }
  .world-status {
    font-size: 7px;
    max-width: 145px;
  }
  .journey > span {
    font-size: 7px;
  }
  .level-label > select {
    font-size: 9px;
    max-width: 147px;
  }
  .level-label {
    font-size: 0;
    margin-left: auto;
  }
  .mode-switch button {
    font-size: 9px;
    padding: 7px 8px;
  }
  .timer {
    width: 100%;
    text-align: left;
    margin-top: -3px;
    font-size: 8px;
  }
  .dock-top {
    gap: 7px;
    margin-bottom: 12px;
  }
  .ready {
    flex-direction: column;
    align-items: stretch;
  }
  .start-actions {
    max-width: none;
  }
  .target.sentence {
    font-size: 18px;
  }
  .target {
    font-size: 25px;
  }
  .target.single-character {
    font-size: 53px;
  }
  .prompt-meta {
    font-size: 8px;
    gap: 8px;
  }
  .prompt-meta #page-count {
    font-size: 7px;
  }
  .cargo-preview,
  .cargo-preview svg {
    width: 35px;
    height: 35px;
  }
  .manifest-copy > span {
    font-size: 6px;
    letter-spacing: 0.6px;
  }
  .manifest-copy > strong {
    font-size: 10px;
  }
  .next-character {
    font-size: 20px;
    min-width: 33px;
    padding: 2px 6px;
    min-height: 33px;
  }
  .outcome {
    font-size: 8px;
    min-width: 53px;
  }
  .manifest-row {
    gap: 7px;
    padding: 7px 8px;
  }
  .route-panel {
    gap: 10px;
    padding: 11px 13px;
    flex-wrap: wrap;
  }
  .route-panel > div > strong {
    font-size: 20px;
  }
  .route-milestones {
    order: 3;
    flex-basis: 100%;
    margin-top: 5px;
  }
  .route-speed {
    margin-left: auto;
  }
  .route-stop {
    font-size: 9px;
  }
  .route-stop small {
    font-size: 8px;
  }
  .route-eyebrow {
    font-size: 7px;
  }
  .journey-results .result-stats strong {
    font-size: 23px;
  }
  .journey-results .primary {
    width: 100%;
  }
  .curriculum-track span {
    font-size: 7px;
    padding: 4px 7px;
  }
  .page-checkpoint h3 {
    font-size: 23px;
  }
  .scoring-guide {
    font-size: 10px;
  }
  .brand {
    font-size: 18px;
  }
  .brand b {
    font-size: 16px;
  }
  .settings-button {
    font-size: 9px;
  }
  .under-game > div {
    max-width: 140px;
    white-space: normal;
    text-align: right;
  }
  #word-input {
    font-size: 18px;
  }
}
@media (max-width: 360px) {
  .world-heading {
    max-width: 154px;
  }
  .world-heading h2 {
    font-size: 19px;
  }
  .world-heading p {
    font-size: 6.5px;
  }
  .hud {
    gap: 5px;
  }
  .hud strong {
    font-size: 13px;
  }
  .hud > div {
    min-width: 18px;
  }
  .hud > div > span {
    font-size: 4.5px;
  }
  .manifest-copy > strong {
    font-size: 9px;
  }
  .outcome {
    min-width: 43px;
    font-size: 7px;
  }
}
@media (max-width: 440px) {
  .hud {
    display: grid;
    grid-template-columns: repeat(2, minmax(34px, auto));
    gap: 7px 12px;
    padding: 8px 10px;
  }
  .hud > div > span {
    font-size: 6px;
    letter-spacing: 0.4px;
  }
  .hud strong {
    font-size: 16px;
  }
  .hud .stage-button {
    justify-content: center;
    min-height: 28px;
  }
  .world-heading {
    max-width: 174px;
  }
}
@media (max-width: 360px) {
  .hud {
    grid-template-columns: repeat(2, minmax(30px, auto));
    gap: 6px 9px;
    padding: 7px 8px;
  }
  .hud strong {
    font-size: 15px;
  }
  .world-heading {
    max-width: 154px;
  }
}
/* Keep the animated subject and input visible together during long-text practice. */
body:not([data-phase='ready']) #mode-note {
  display: none;
}
body[data-level='advanced']:not([data-phase='ready']) #curriculum-track {
  display: none;
}
@media (min-width: 761px) {
  #play-area {
    display: grid;
    grid-template-columns: minmax(250px, 31%) minmax(0, 1fr);
    column-gap: 14px;
  }
  #play-area .prompt-meta,
  #play-area .prompt-row,
  #play-area .input-bottom,
  #play-area .assisted-note {
    grid-column: 1/-1;
  }
  #play-area .manifest-row {
    margin: 0;
    min-height: 54px;
    padding: 7px 10px;
    gap: 9px;
  }
  #play-area .manifest-copy {
    min-width: 0;
  }
  #play-area .manifest-copy > strong {
    display: none;
  }
  #play-area .manifest-copy > span {
    font-size: 8px;
    line-height: 1.4;
    margin-bottom: 0;
  }
  #play-area .cargo-preview,
  #play-area .cargo-preview svg {
    width: 34px;
    height: 34px;
  }
  #play-area .outcome {
    display: none;
  }
  #play-area #word-form {
    align-self: center;
  }
  #play-area .input-bottom {
    padding-top: 10px;
  }
  #play-area .next-character {
    min-height: 33px;
    font-size: 21px;
  }
  .route-panel {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* AlphaType appearance on the game shell; illustrated worlds keep their own art. */
:root { --paper: #f6f9ff; --ink: #19344d; --muted: #506578; --cream: #fff; --line: #cdd9e4; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.home-link { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; text-decoration: none; white-space: nowrap; }
.settings-button { min-height: 44px; border-radius: 10px; border-color: #75899c; background: #fff; color: #19344d; font-size: 14px; }
.appearance-toggle { white-space: nowrap; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline-color: #2456a6; }
.world-card, .settings { background: #fff; border-color: #cdd9e4; border-radius: 17px; }
.world-card.active { background: #e7f5ef; border-color: #096b62; box-shadow: 0 2px 0 #096b62; }
.world-card small, .lab-label, .settings-note, .choose-heading > span { color: #506578; font-size: max(12px, 0.75rem); }
.world-card strong { font-size: 18px; }
.brand-mark { background: #2456a6; color: #fff; }
.brand b { color: #096b62; }
.lab-label > span { background: #096b62; }
.word-dock { background: #fff; }
.mode-switch { background: #eef4fb; border-color: #cdd9e4; }
.mode-switch button { color: #506578; font-size: 14px; min-height: 42px; }
.mode-switch button[aria-pressed='true'], .primary, .submit { color: #fff; background: #2456a6; border-color: #2456a6; box-shadow: none; }
.primary:hover { background: #1e4789; }
.settings select, .level-label select, #word-input { background: #fff; color: #19344d; border-color: #75899c; }
.settings-grid > label, .check, .range-label, .ready p, .under-game, .scoring-guide { color: #506578; font-size: 14px; }
.target { color: #19344d; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.repeat { color: #096b62; background: #e7f5ef; border-color: #75899c; font-size: 14px; }
.manifest-row, .curriculum-track span { background: #eef4fb; border-color: #cdd9e4; color: #506578; }
.manifest-copy > :is(span, strong), .prompt-label, .input-bottom p, #input-hint, .under-game strong, .under-game button, .scoring-guide summary { color: #506578; }
.next-character { color: #19344d; background: #fff; border-color: #75899c; }
html[data-flowkeys-theme='dark'] { color-scheme: dark; --paper: #0b1420; --ink: #eff5fc; --muted: #b5c6d9; --cream: #172233; --line: #53667c; }
html[data-flowkeys-theme='dark'] .settings-button, html[data-flowkeys-theme='dark'] .world-card, html[data-flowkeys-theme='dark'] .settings { color: #eff5fc; background: #172233; border-color: #53667c; }
html[data-flowkeys-theme='dark'] .world-card.active { background: #213d38; border-color: #93d9c0; box-shadow: 0 2px 0 #93d9c0; }
html[data-flowkeys-theme='dark'] .world-card small, html[data-flowkeys-theme='dark'] .lab-label, html[data-flowkeys-theme='dark'] .settings-note, html[data-flowkeys-theme='dark'] .choose-heading > span { color: #b5c6d9; }
html[data-flowkeys-theme='dark'] .brand-mark { background: #b9ed8a; color: #14221a; }
html[data-flowkeys-theme='dark'] .brand b, html[data-flowkeys-theme='dark'] .lab-label { color: #93d9c0; }
html[data-flowkeys-theme='dark'] .word-dock { color: #eff5fc; background: #172233; }
html[data-flowkeys-theme='dark'] .mode-switch, html[data-flowkeys-theme='dark'] .manifest-row, html[data-flowkeys-theme='dark'] .curriculum-track span { background: #223248; border-color: #53667c; }
html[data-flowkeys-theme='dark'] .mode-switch button { color: #b5c6d9; }
html[data-flowkeys-theme='dark'] .mode-switch button[aria-pressed='true'], html[data-flowkeys-theme='dark'] .primary, html[data-flowkeys-theme='dark'] .submit { color: #14221a; background: #b9ed8a; border-color: #b9ed8a; }
html[data-flowkeys-theme='dark'] .settings select, html[data-flowkeys-theme='dark'] .level-label select, html[data-flowkeys-theme='dark'] #word-input, html[data-flowkeys-theme='dark'] .next-character { background: #223248; color: #eff5fc; border-color: #8296aa; }
html[data-flowkeys-theme='dark'] .target { color: #eff5fc; }
html[data-flowkeys-theme='dark'] .target .correct { color: #93d9c0; }
html[data-flowkeys-theme='dark'] .repeat { color: #c7f4dc; background: #213d38; border-color: #53667c; }
html[data-flowkeys-theme='dark'] .settings-grid > label, html[data-flowkeys-theme='dark'] .check, html[data-flowkeys-theme='dark'] .range-label, html[data-flowkeys-theme='dark'] .ready p, html[data-flowkeys-theme='dark'] .under-game, html[data-flowkeys-theme='dark'] .scoring-guide, html[data-flowkeys-theme='dark'] .manifest-copy > :is(span, strong), html[data-flowkeys-theme='dark'] .prompt-label, html[data-flowkeys-theme='dark'] .input-bottom p, html[data-flowkeys-theme='dark'] #input-hint, html[data-flowkeys-theme='dark'] .under-game strong, html[data-flowkeys-theme='dark'] .under-game button, html[data-flowkeys-theme='dark'] .scoring-guide summary { color: #b5c6d9; }
html[data-flowkeys-theme='dark'] .curriculum-track span.active { background: #213d38; color: #d9f4e4; border-color: #93d9c0; }
html[data-flowkeys-theme='dark'] .route-panel { background: #132936; }
html[data-flowkeys-theme='dark'] button:focus-visible, html[data-flowkeys-theme='dark'] a:focus-visible, html[data-flowkeys-theme='dark'] input:focus-visible, html[data-flowkeys-theme='dark'] select:focus-visible { outline-color: #b9ed8a; }
@media (max-width: 600px) { .topbar { height: auto; min-height: 80px; flex-wrap: wrap; padding-block: 12px; } .header-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; } .appearance-toggle { padding-inline: 8px; } }
/* Keep the secondary game instructions readable in both appearance modes. */
.level-label, #word-step, .timer, .curriculum-track span, .content-count, .under-game, .under-game #save-note, .settings-note, .input-bottom p, #input-hint { font-size: 12px !important; }
html[data-flowkeys-theme='dark'] :is(.level-label, #word-step, .timer, .curriculum-track span, .content-count, .under-game #save-note, .prompt-label, .manifest-copy > span, .manifest-copy > strong, .input-bottom p, #input-hint) { color: #b5c6d9 !important; }
html[data-flowkeys-theme='dark'] .curriculum-track span { background: #26364a; border-color: #71869a; }
html[data-flowkeys-theme='dark'] .content-count { color: #b5c6d9 !important; }
html[data-flowkeys-theme='dark'] .under-game a, html[data-flowkeys-theme='dark'] .under-game button { color: #b5c6d9; }
.prompt-meta, .prompt-meta #page-count { font-size: 12px; }
html[data-flowkeys-theme='dark'] .prompt-meta, html[data-flowkeys-theme='dark'] .prompt-meta #case-note, html[data-flowkeys-theme='dark'] .prompt-meta #page-count, html[data-flowkeys-theme='dark'] .target .pending { color: #b5c6d9; }
html[data-flowkeys-theme='dark'] #word-input::placeholder { color: #b5c6d9; }
html[data-flowkeys-theme='dark'] footer, html[data-flowkeys-theme='dark'] footer a { color: #b5c6d9; }
@media (max-width: 760px) { .prompt-meta, .prompt-meta #page-count { font-size: 12px; } }

.brand .brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
  background: transparent url('/alphatype-mark.png') center / contain no-repeat;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #2456a680;
}
html[data-flowkeys-theme='dark'] .brand .brand-mark {
  background: transparent url('/alphatype-mark.png') center / contain no-repeat;
  box-shadow: 0 0 0 1px #ffffffdf;
}
@media (max-width: 600px) { .brand .brand-mark { width: 36px; height: 36px; } }

/* Mission instruments remain ordinary readable text outside the moving scene. */
.mission-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(140px, 1.3fr);
  gap: 8px 16px;
  padding: 13px 30px;
  background: #132e41;
  color: #e9f7fc;
  border-top: 1px solid #658493;
}
.mission-panel span { display: block; font-size: 12px; color: #bdd7e2; }
.mission-panel strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.mission-panel p { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.5; }
.mission-mode-label { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.mission-mode-label select { min-height: 44px; max-width: 100%; min-width: 0; padding: 8px; border: 1px solid #75899c; border-radius: 8px; background: var(--cream); color: var(--ink); font: inherit; }
.mission-rules { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0 0 16px; }
.passage-panel { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.passage-panel summary { cursor: pointer; font-size: 14px; font-weight: 700; }
.passage-context {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 17rem;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.7;
  margin-top: 10px;
}
.target.sentence {
  max-height: 11rem;
  overflow-y: auto;
  position: relative;
  padding: 3px 5px;
  scrollbar-gutter: stable;
}
#word-input {
  resize: vertical;
  min-height: 62px;
  max-height: 180px;
  height: 62px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.5;
}
textarea:focus-visible { outline: 3px solid #2456a6; outline-offset: 2px; }
html[data-flowkeys-theme='dark'] textarea:focus-visible { outline-color: #b9ed8a; }
@media (max-width: 760px) {
  .mission-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 16px; gap: 9px; }
  .mission-panel strong { font-size: 18px; }
  .mission-panel > div:last-of-type { grid-column: span 2; }
  .mission-mode-label { flex-direction: column; align-items: stretch; gap: 6px; }
  .mission-mode-label select { width: 100%; font-size: 13px; }
  .target.sentence { max-height: 9rem; }
  .passage-context { max-height: 14rem; }
  .prompt-meta { flex-wrap: wrap; }
  .prompt-meta #page-count { overflow-wrap: anywhere; }
}

/* Legal links in the footer wrap on narrow screens and stay easy to tap. */
#footer-legal { display: flex; flex-wrap: wrap; gap: 6px 16px; }
#footer-legal a { display: inline-flex; align-items: center; min-height: 28px; }
