:root {
  color-scheme: light;
  --cream: #fff1cf;
  --paper: #fff8e5;
  --ink: #502414;
  --red: #ba361e;
  --green: #38603b;
  --forest: #264d35;
  --shadow: #522b1360;
  font-family: 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  background: var(--forest);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
img { display: block; width: 100%; }
button, input { font: inherit; }
button, .button { cursor: pointer; touch-action: manipulation; }
button { color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #1d4d77;
  outline-offset: 4px;
}
button svg, .logo svg, .count svg { display: block; height: 1em; width: 1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.pinyin {
  font-family: 'Arial Rounded MT Bold', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: .06em;
}
.scene {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  display: flow-root;
  overflow: hidden;
  background: #88ad4e url('assets/postal-map.png') center / cover no-repeat;
}
.hud {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: clamp(12px, 2.7vw, 27px);
  position: relative;
  z-index: 5;
}
.hud > .orb:first-child { justify-self: start; }
.hud-right { display: flex; justify-self: end; gap: 8px; }
.map-hud .logo { grid-column: 2; }
.map-hud .orb { grid-column: 3; justify-self: end; }
.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .42em;
  font-size: clamp(1.3rem, 4vw, 3.05rem);
  letter-spacing: .06em;
  padding: .35em .7em .42em;
  border-radius: 100px;
  white-space: nowrap;
  background: linear-gradient(#fff9e6, #f7d9a3) padding-box,
    repeating-linear-gradient(-53deg, #c24b2f 0 12px, #fff8de 12px 26px, #4e7450 26px 38px, #fff8de 38px 52px) border-box;
  border: .14em solid transparent;
  box-shadow: 0 6px 0 #88532c80, 0 8px 20px #233a3752;
  text-shadow: 0 1px #fff6e0;
}
.logo svg { color: var(--red); width: 1.25em; height: 1.25em; transform: rotate(-8deg); }
.orb {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  width: clamp(45px, 6.6vw, 66px);
  aspect-ratio: 1;
  border: 3px solid #fff0c7;
  background: linear-gradient(#fff6db,#ebcb8f);
  color: #743318;
  box-shadow: inset 0 0 0 2px #bd8047, 0 4px 0 #853f24, 0 5px 8px var(--shadow);
  font-size: clamp(21px, 3vw, 32px);
  transition: transform .13s, filter .13s;
}
.orb:hover:enabled, .station:hover { transform: translateY(-4px); filter: brightness(1.07); }
.orb:active:enabled { transform: translateY(3px); }
.orb:disabled { opacity: .56; }
.orb.red, .orb.listen, .game-hud > .orb, .hud-right .orb:first-child {
  color: var(--cream);
  background: linear-gradient(#e6613a,#a92619);
  box-shadow: inset 0 0 0 2px #a52d1d, 0 4px 0 #7f3d20, 0 7px 10px var(--shadow);
  text-shadow: 0 1px #733017;
}
.orb.mini { width: clamp(44px, 6vw, 51px); font-size: clamp(19px, 2.8vw, 24px); }

.map { min-height: max(580px, 100svh); }
.unit-switch { position: relative; z-index: 3; display: flex; justify-content: center; gap: clamp(7px, 1.5vw, 15px); }
.unit-button { min-height: 43px; border-radius: 100px; border: 2px solid #e1b16f; padding: 5px 13px 7px; color: #673921; background: #fff0ca; box-shadow: 0 3px 1px var(--shadow); font-weight: 850; }
.unit-button[aria-current] { border-color: #fff0ca; background: #a83420; color: #fff6d9; }
.unit-map-1 { background-position: 72% center; }
.unit-map-2 { background-position: 35% 67%; }
.stations {
  position: absolute;
  inset: 36% 6% 22%;
  display: grid;
  align-items: end;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  z-index: 2;
  gap: clamp(4px, 2vw, 28px);
}
.unit-map-0 .stations { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.station {
  justify-self: center;
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  border: none;
  background: none;
  padding: 0;
  transition: transform .18s, filter .18s;
  -webkit-tap-highlight-color: transparent;
}
.station-red { --box: #ba3d28; --bright: #e57348; --dark: #783216; }
.station-green { --box: #537d35; --bright: #86a54c; --dark: #314e22; align-self: center; }
.station-gold { --box: #be761b; --bright: #efb63d; --dark: #80450f; align-self: start; }
.station-blue { --box: #387a87; --bright: #6aa8ae; --dark: #265155; align-self: center; }
.station-rose { --box: #945371; --bright: #d17f95; --dark: #62344f; }
.station-review { --box: #965328; --bright: #e09e49; --dark: #6d3b20; align-self: center; }
.station-sign {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 8px);
  padding: .36em .55em .44em;
  border: 5px dotted #e8bd79;
  border-radius: 19px;
  background: linear-gradient(#fff9e5, #f9dfa9);
  box-shadow: 0 0 0 4px #fff2cd, 0 7px 0 #926434aa, 0 12px 13px var(--shadow);
  color: var(--ink);
  font-size: clamp(.88rem, 2.05vw, 2.05rem);
  line-height: 1;
  text-align: center;
}
.station .pinyin { letter-spacing: .025em; word-spacing: .1em; }
.mailbox {
  position: relative;
  display: grid;
  justify-items: center;
  place-content: center;
  width: clamp(59px, 9vw, 123px);
  aspect-ratio: 1.04;
  margin-top: clamp(13px, 2.2vw, 30px);
  border: 3px solid var(--dark);
  border-radius: 45% 45% 26% 26% / 31% 31% 15% 15%;
  background: linear-gradient(var(--bright) 0 28%, var(--dark) 29% 33%, var(--box) 34% 100%);
  box-shadow: inset 5px 0 #ffe4ab3a, inset -8px 0 #411c1e32, 0 7px 0 #3f361759, 0 10px 13px #283a2b78;
}
.mailbox > svg {
  height: 1.18em;
  width: 1.42em;
  font-size: clamp(23px, 4.2vw, 48px);
  border-radius: 6px;
  padding: .1em;
  margin-top: .37em;
  background: linear-gradient(#fff4ce,#edca83);
  color: var(--dark);
  filter: drop-shadow(0 2px 1px #4d2f166c);
}
.medallion {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -55%);
  display: grid;
  place-items: center;
  width: clamp(26px, 4vw, 43px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--box);
  background: var(--cream);
  box-shadow: 0 2px 0 var(--dark);
  font-size: clamp(.85rem, 2.1vw, 1.5rem);
  font-weight: 900;
}
.map-van {
  position: absolute;
  z-index: 1;
  width: clamp(77px, 13vw, 184px);
  bottom: 7%;
  left: 17%;
  pointer-events: none;
  filter: drop-shadow(2px 9px 5px #45331c60);
  animation: map-arrival 2s cubic-bezier(.19,.6,.36,1) both, idle 3s ease-in-out 2s infinite;
}
@keyframes map-arrival {
  0% { left: -14%; transform: translateY(8px) rotate(-5deg); }
  60% { transform: translateY(-5px) rotate(3deg); }
  100% { transform: translateY(0); }
}
@keyframes idle { 0%, 100% { transform: translateY(0); } 52% { transform: translateY(-4px) rotate(-1.5deg); } }

.gameplay { background-position: center 62%; display: flex; flex-direction: column; }
.gameplay::before, .finish::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(#234b2d18, transparent 35%, #41271915 78%, #193d2473); }
.progress {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 16px);
  position: relative;
}
.progress::before { content: ''; position: absolute; inset: 48% 4px auto; border-top: 4px dashed #fff3c9; filter: drop-shadow(0 1px 1px #65451c); }
.step-icon {
  width: clamp(31px, 5vw, 52px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  color: #866037;
  border: 3px dotted #be944e;
  border-radius: 10px;
  background: #f5ddb0;
  box-shadow: 0 0 0 2px #fff0cc, 0 3px 6px var(--shadow);
}
.step-icon svg { width: 59%; height: 59%; }
.step-icon[aria-current] { border-color: #a84227; background: #ffedce; color: #a33221; transform: rotate(-5deg) scale(1.1); }
.step-icon.passed { color: #316333; background: #e1ecc5; }
.playfield {
  z-index: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: min(94%, 980px);
  margin: auto;
  min-height: min(430px, 70vh);
  padding: 5px 0 18px;
}
.task-title {
  width: max-content;
  max-width: 100%;
  margin: 2px auto 13px;
  padding: .18em .63em .25em;
  border: 2px solid #f6d093;
  border-radius: 100px;
  color: #622f18;
  background: #fff1d1;
  box-shadow: 0 3px 0 #79533272;
  font-size: clamp(1.15rem, 3.2vw, 2rem);
  font-weight: 900;
  letter-spacing: .08em;
}
.row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.listen-row { margin: 0 0 13px; }
.listen {
  width: clamp(64px, 10.3vw, 96px);
  font-size: clamp(32px, 5.6vw, 49px);
  position: relative;
}
.listen::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid #fff4c6;
  opacity: 0;
  pointer-events: none;
}
.is-playing [data-action='listen']::after { animation: ripple 1s ease-out infinite; }
@keyframes ripple { from { opacity: .9; transform: scale(.92); } to { opacity: 0; transform: scale(1.35); } }
.options {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(9px, 2.8vw, 30px);
  margin: 6px auto 9px;
}
.answer, .read-card {
  border: 3px solid #e5bd7b;
  border-radius: 15px;
  min-width: clamp(65px, 13vw, 167px);
  background: linear-gradient(#fff9e6, #f9dcaa);
  box-shadow: 0 5px 0 #a46c35, 0 10px 13px var(--shadow);
  color: #562816;
  font-size: clamp(2rem, 7vw, 5.4rem);
  line-height: 1.05;
  transition: transform .15s, box-shadow .14s, filter .14s;
  padding: .22em .35em;
  min-height: 65px;
}
.answer:hover:enabled { transform: translateY(-4px); filter: brightness(1.07); }
.answer:active:enabled { transform: translateY(3px); }
.envelope {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(#fff9e6, #f8dba9) padding-box,
    repeating-linear-gradient(-52deg, #c04c31 0 11px, #fff5d6 11px 24px, #5b8056 24px 35px, #fff5d6 35px 48px) border-box;
  border: clamp(4px, .6vw, 8px) solid transparent;
  padding: .76em .28em .22em;
  min-height: clamp(86px, 16vh, 148px);
  min-width: clamp(71px, 15vw, 191px);
}
.envelope::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 42%;
  clip-path: polygon(0 0, 100% 0, 56% 95%, 44% 95%);
  background: linear-gradient(#fff8e4, #e9bf7d);
}
.seal {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 1;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(22px, 4.5vw, 43px);
  aspect-ratio: 1;
  font-size: clamp(12px, 2vw, 23px);
  color: #ffe8b9;
  border: 2px solid #a63320;
  border-radius: 42%;
  background: radial-gradient(circle at 32% 19%,#ec7948,#bb3725 68%);
  box-shadow: 0 2px 0 #802b18, 0 3px 6px #96573160;
}
.read-card { font-size: clamp(3rem, 12vw, 7.5rem); min-width: min(75vw, 330px); }
.parts {
  font-size: clamp(1.1rem, 4vw, 2rem);
  color: var(--ink);
  margin-top: 8px;
  border-radius: 100px;
  padding: 5px 15px;
  background: #ffedc7;
}
.stage-read .row { margin-top: 14px; }
.stage-read .listen { width: clamp(52px, 7.8vw, 71px); font-size: clamp(23px, 4.2vw, 34px); }
.chosen, .answer[aria-pressed='true'] { background: linear-gradient(#f6ffcf,#b5d58d); border-color: #598942; box-shadow: 0 4px 0 #497231, 0 6px 12px var(--shadow); }
.chosen .seal { background: #4f7b31; border-color: #395d27; }
.chosen { animation: pop .34s cubic-bezier(.21,.83,.45,1.2) both; }
.wrong { animation: wobble .37s ease-out both; border-color: #bd492c; }
@keyframes pop { 0% { transform: scale(.88); } 60% { transform: scale(1.10); } 100% { transform: scale(1); } }
@keyframes wobble { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px) rotate(-2deg); } 72% { transform: translateX(8px) rotate(2deg); } }
.tone {
  background: linear-gradient(#eff7ce,#bed991);
  width: clamp(69px, 15vw, 160px);
  min-width: 0;
  padding: 7px;
  border-color: #86a658;
}
.track, .drive-track { width: 100%; display: block; overflow: visible; }
.track { height: auto; }
.road-edge { fill: none; stroke: #765135; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.road-center { fill: none; stroke: #fff2ab; stroke-width: 4; stroke-dasharray: 4 5; stroke-linecap: round; stroke-linejoin: round; }
.drive-track { width: clamp(90px, 17vw, 150px); max-height: 110px; margin: -7px auto -12px; }
.blend-group {
  width: min(100%, 560px);
  margin: 15px 0 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 3px;
  align-items: start;
}
.blend-3 { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
.blend-3 .hitch { width: clamp(5px, 1.6vw, 17px); }
.blend-3 .pieces { gap: 4px; }
.blend-3 .pieces .answer { min-width: 37px; padding-inline: .21em; }
.hitch { margin-top: 40px; width: clamp(11px, 3vw, 27px); height: 6px; background: #6e3d20; border-radius: 10px; }
.slot {
  position: relative;
  width: 92%;
  min-height: 68px;
  margin-bottom: 15px;
  border-radius: 9px 9px 24px 24px;
  border: 3px dashed #fff0b9;
  background: #7c52288c;
  box-shadow: 0 4px 0 #5e3b20;
  color: #fff0c9;
  font-size: clamp(1.6rem, 6vw, 3.5rem);
}
.slot::before, .slot::after {
  content: '';
  position: absolute;
  bottom: -14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid #5a3523;
  background: #e9b463;
  box-shadow: 0 2px 2px #3c261948;
}
.slot::before { left: 12%; }
.slot::after { right: 12%; }
.slot.filled { border-style: solid; color: #fff4cf; background: linear-gradient(#dc6b40, #aa3220); animation: pop .3s ease-out both; }
.has-delivered .slot { animation: carriage .55s ease-out both; }
@keyframes carriage { 48% { transform: translate(15px,-5px) rotate(3deg); } }
.pieces { display: flex; gap: 8px; justify-content: center; }
.pieces .answer { min-width: 53px; min-height: 52px; font-size: clamp(1.5rem, 5vw, 2.6rem); padding: .13em .4em; }
.blend-tools { margin-top: 2px; }
.stamp-word {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: #fff3cf;
  border: 3px dashed #de9263;
  border-radius: 20px;
  padding: 12px 14px;
  font-size: clamp(2.35rem, 8vw, 5.4rem);
  box-shadow: 0 6px 10px var(--shadow);
  margin-bottom: 15px;
}
.stamp-word button { min-width: clamp(45px, 8vw, 112px); padding: 2px 6px 8px; min-height: 1.2em; font-size: inherit; }
.stamp-word .chosen { animation: stamp-impact .38s ease-out both; }
@keyframes stamp-impact { 0% { transform: scale(1.32) rotate(-7deg); } 55% { transform: scale(.88); } 100% { transform: scale(1); } }
.stamp-tool { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.stamp-tool .stamp-pad { min-width: 45px; min-height: 47px; width: clamp(46px, 8vw, 70px); padding: 3px 0; font-size: clamp(1.5rem, 4vw, 2.7rem); color: #ab3b24; border-radius: 50%; aspect-ratio: 1; border: 3px solid #936038; }
.stamp-pad[aria-pressed='true'] { background: #ffe3ac; transform: translateY(-5px) scale(1.06); border-color: #aa331d; }
.match-source, .bridge { padding: 8px 20px; border: 3px solid #e3bd86; border-radius: 18px; box-shadow: 0 5px 0 #855c38; background: var(--paper); font-size: clamp(2.2rem, 7vw, 4.4rem); }
.match-arrow { color: var(--cream); filter: drop-shadow(0 2px 1px var(--shadow)); transform: rotate(90deg); margin: 9px 0 0; }
.match-arrow svg { width: 31px; height: 31px; display: block; }
.bridge { display: flex; align-items: center; gap: .1em; }
.bridge-tools { margin-top: 13px; }
.dot-letter { font-size: inherit; min-width: 1.2em; border-radius: 12px; padding: .04em .17em .13em; }
.route-options .answer { border-color: #d5a059; }
.whole-label { font-size: .94rem; font-weight: 800; }
.feedback, .hint {
  font-size: clamp(.86rem, 2vw, 1.06rem);
  font-weight: 800;
  color: #573923;
  width: fit-content;
  margin: 9px auto 1px;
  padding: 4px 12px 6px;
  background: #fff1d2;
  border-radius: 100px;
  box-shadow: 0 2px 5px var(--shadow);
}
.feedback[data-result='wrong'] { color: #933526; }
.feedback[data-result='right'] { color: #29592f; }
.feedback.sr-only { margin: -1px; padding: 0; }
.cue-link { background: transparent; color: #86331e; padding: 3px 5px; border: 0; text-decoration: underline; text-underline-offset: .19em; }
.advance { width: 100%; margin-top: 10px; display: flex; justify-content: center; }
.advance .next { width: clamp(53px, 7vw, 72px); font-size: clamp(27px, 4vw, 40px); animation: pop .22s ease-out both; }
.roadway {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  width: 100%;
  height: clamp(21px, 4vw, 35px);
  bottom: 7%;
  background: repeating-linear-gradient(90deg,#68472b 0 5px,#a97741 5px 14px,transparent 14px 27px);
  border-top: 4px solid #644630;
  border-bottom: 4px solid #6a4931;
  box-shadow: 0 1px 0 #ffcb64, 0 4px 10px #4226135e;
  opacity: .82;
}
.gameplay::after { content: ''; display: block; min-height: clamp(52px, 12vh, 117px); }
.game-van {
  width: clamp(60px, 10vw, 145px);
  z-index: 1;
  position: absolute;
  pointer-events: none;
  bottom: calc(7% + 10px);
  left: 8%;
  filter: drop-shadow(1px 6px 4px #45331c65);
  animation: idle 3.2s ease-in-out infinite;
}
.game-van.van-won { left: 72%; animation: delivery .92s cubic-bezier(.27,.55,.48,1) both; }
@keyframes delivery {
  0% { left: 8%; transform: translateY(0) rotate(-4deg); }
  38% { transform: translateY(-5px) rotate(2deg); }
  68% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(0); }
}
.question-dots {
  position: absolute;
  bottom: 2.3%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.question-dots i { width: 9px; height: 9px; border: 1px solid #fff5ce; border-radius: 50%; background: #3a572bc0; }
.question-dots i.current { width: 12px; height: 12px; background: #ffe7a6; }
.question-dots i.passed { background: #c8e892; }
.recipient {
  width: min(24vw, 258px);
  min-width: 100px;
  z-index: 1;
  position: absolute;
  pointer-events: none;
  right: 3%;
  bottom: 13%;
  filter: drop-shadow(0 5px 5px #513814a0);
  animation: recipient .59s .44s cubic-bezier(.17,.71,.5,1.19) both;
}
.recipient-letter {
  position: absolute;
  right: 5%;
  top: -8%;
  padding: .15em .38em;
  border-radius: 11px;
  border: 2px dotted #c79557;
  background: var(--cream);
  font-size: clamp(1rem, 4vw, 2.35rem);
  transform: rotate(8deg);
}
@keyframes recipient {
  from { opacity: 0; transform: translate(22px,30px) scale(.65); }
  to { opacity: 1; transform: translate(0,0) scale(1); }
}
.burst { position: absolute; z-index: 3; pointer-events: none; left: 50%; top: 46%; }
.burst i {
  --distance: clamp(75px, 20vw, 278px);
  position: absolute;
  width: clamp(5px, 1.4vw, 15px);
  aspect-ratio: 1;
  background: #ffd463;
  clip-path: polygon(50% 0,66% 35%,100% 50%,66% 65%,50% 100%,34% 65%,0 50%,34% 35%);
  animation: sparkle .75s var(--delay) ease-out both;
}
.burst i:nth-child(2n) { background: #fff4bd; }
.burst i:nth-child(3n) { background: #fc6c43; }
@keyframes sparkle {
  0% { opacity: 0; transform: rotate(var(--angle)) translateX(20px) scale(.5); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--angle)) translateX(var(--distance)) scale(1.25); }
}
.paused {
  padding: 22px 34px;
  border: 4px solid #f3d292;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 7px 16px var(--shadow);
}
.paused h2 { margin-bottom: 16px; }
.frozen .game-van { animation-play-state: paused; }
.writing {
  margin: 4px auto 13px;
  position: relative;
  width: min(100%, 520px);
  border: 3px solid #e8c38d;
  background: #fff9e7;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px #986430, 0 7px 12px var(--shadow);
}
.writing svg { display: block; width: 100%; }
.writing canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.guide { fill: none; stroke: #95a389; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trace { fill: none; stroke: var(--red); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.writing.is-demonstrating .trace { visibility: visible; }
.stroke-start { fill: var(--red); stroke: none; opacity: 0; }
.writing.is-hidden .guide, .writing.is-hidden .trace { display: none; }
.finish { display: grid; align-content: center; justify-items: center; gap: 15px; padding: 22px; }
.finish-art { width: min(57vw, 350px); filter: drop-shadow(0 7px 6px var(--shadow)); animation: recipient .55s cubic-bezier(.17,.71,.5,1.19) both; }
.finish h1, .count { padding: 4px 19px 7px; border-radius: 100px; background: var(--cream); box-shadow: 0 3px 5px var(--shadow); }
.finish h1 { font-size: clamp(1.75rem, 6vw, 3.5rem); }
.count { display: flex; align-items: center; gap: 8px; font-weight: 850; }

dialog {
  width: min(93%, 670px);
  max-height: 88svh;
  padding: clamp(13px, 3vw, 24px);
  border: 3px solid #ce9e62;
  border-radius: 21px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 18px var(--shadow);
}
dialog::backdrop { background: #223d2eac; }
dialog .row { justify-content: flex-start; gap: 7px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
dialog h2 { font-size: 1.4rem; }
dialog p, dialog details { margin: 9px 0; line-height: 1.55; }
dialog details { background: #fff1d2; border: 1px solid #e5c68d; border-radius: 10px; padding: 8px 11px; }
dialog summary { cursor: pointer; font-weight: 800; }
.quiet, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 39px; padding: 5px 12px; border-radius: 9px;
  background: #fff5d9; border: 1px solid #d7ad74; font-weight: 700;
}
.quiet:hover:enabled { background: #f7dfb2; }
.quiet:disabled { opacity: .48; }
.primary { background: var(--red); color: #fff4da; border-color: #78341e; }
.small { font-size: .87rem; }
.dialog-options { display: grid; justify-items: start; gap: 8px; margin-top: 11px; }
#imports { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dialog-options:has(#imports:focus-visible) label[for='imports'] { outline: 3px solid #1d4d77; outline-offset: 3px; }
dialog a { color: #683321; }
.teacher-exercise { margin: 12px 0; }
.teacher-exercise strong { display: block; margin-bottom: 5px; }
.question-dots, .progress, .burst { user-select: none; }
.unit-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 10px; }
.unit h3 { font-size: .97rem; }
.unit ul { padding: 0; margin: 4px 0 0; list-style: none; }
.unit li { padding: 5px 0; border-bottom: 1px solid #e9cca2; font-size: .86rem; }
.unit li small { display: block; color: #785d42; }
.link-button { padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 2px; }
.shortcuts { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; }
.shortcuts .quiet { padding-inline: 6px; min-height: 31px; }
#cue-dialog { max-width: 430px; }
.teacher-cue { font-size: clamp(2rem, 7vw, 4rem); text-align: center; }

@media (max-width: 660px) {
  .map { min-height: max(570px, 100svh); }
  .map-hud { grid-template-columns: 1fr auto; }
  .map-hud .logo { grid-column: 1; justify-self: start; }
  .map-hud .orb { grid-column: 2; }
  .stations, .unit-map-0 .stations { inset: 24% 7% 13%; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .station { display: grid; align-self: center; }
  .unit-map-0 .station-review { grid-column: 1 / -1; }
  .mailbox { margin-top: 13px; width: clamp(45px, 11vw, 61px); }
  .station-sign { font-size: clamp(.98rem, 4.3vw, 1.4rem); }
  .map-van { left: 16%; bottom: 5%; }
  .game-hud { grid-template-columns: 47px 1fr auto; gap: 5px; padding: 11px 8px; }
  .game-hud .orb { width: 43px; font-size: 20px; }
  .hud-right { gap: 5px; }
  .progress { justify-self: center; }
  .step-icon { width: 29px; }
  .playfield { min-height: 0; }
  .gameplay::after { min-height: 88px; }
  .game-van { bottom: calc(7% + 4px); }
  .orb.listen { margin-bottom: 2px; }
  .writing { width: min(100%, 460px); }
  .unit-grid { grid-template-columns: 1fr; }
  .unit li small { display: inline; margin-left: 5px; }
}
@media (max-width: 390px) {
  .options { gap: 6px; }
  .options .envelope { min-width: 59px; }
  .game-hud { padding-inline: 6px; }
  .game-hud .orb { width: 40px; }
  .step-icon { width: 26px; }
}
@media (max-height: 570px) and (min-width: 661px) {
  .map { min-height: max(420px, 100svh); }
  .stations { inset-block: 33% 25%; }
  .hud { padding-block: 10px; }
  .orb { width: 50px; font-size: 25px; }
  .logo { font-size: clamp(1.4rem, 3.6vw, 2.1rem); }
  .playfield { min-height: 0; }
  .task-title { margin-bottom: 5px; font-size: 1.25rem; }
  .orb.listen { width: 58px; font-size: 29px; }
  .writing { max-width: 395px; }
  .gameplay::after { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
