:root {
  color-scheme: light;
  --ink: #203d35;
  --green: #194b3e;
  --green-light: #e4efda;
  --muted: #567267;
  --paper: #fff8e9;
  --cream: #fffcf3;
  --orange: #cb672f;
  --sand: #f4b97a;
  --line: #dce7d4;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 3px solid #b95726;
  outline-offset: 3px;
}
button:disabled { cursor: default; }
h1, h2, p { margin: 0; }
.app {
  width: min(100%, 690px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px max(18px, env(safe-area-inset-right)) 32px max(18px, env(safe-area-inset-left));
}
.map-header, .quiz-header, .map-route-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.map-header { margin-bottom: 17px; }
.map-header h1 { font-size: clamp(23px, 6vw, 37px); font-weight: 860; letter-spacing: -.055em; }
.secondary, .primary {
  min-height: 45px;
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 760;
}
.secondary { background: var(--green-light); color: var(--green); }
.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 3px 0 #11372d;
}
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #11372d; }
.primary:disabled { opacity: .65; }
.map-hero {
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: clamp(181px, 44vw, 272px);
  border: 2px solid #c0d3b2;
  border-radius: 24px;
  background: #d7e9be url("./campus.jpg") center / cover no-repeat;
  box-shadow: 0 4px 0 #d4d8bc;
}
.map-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(92deg, #eaf1cd 2%, rgba(239,246,221,.9) 26%, rgba(238,246,211,0) 76%);
}
.hero-copy { position: relative; padding: 19px; max-width: 68%; }
.hero-destination { color: #3a6452; font-size: 13px; font-weight: 750; }
.hero-copy h2 {
  max-width: 8em;
  margin: 4px 0 14px;
  font-size: clamp(23px, 6vw, 38px);
  line-height: 1.16;
  letter-spacing: -.05em;
}
.hero-action { min-height: 43px; font-size: 14px; white-space: nowrap; }
.map-route-title { margin: 24px 0 12px; }
.map-route-title h2 { font-size: 20px; }
.collection { color: var(--green); background: #f1ebc8; border-radius: 99px; padding: 7px 12px; font-weight: 760; font-size: 13px; }
.route { padding: 0; list-style: none; margin: 0; }
.route-stop {
  position: relative;
  padding-left: 17px;
  margin-bottom: 10px;
  --surface: #edf3e1;
}
.route-stop:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 52%;
  height: calc(50% + 13px);
  border-left: 3px dotted #abc2a2;
  z-index: 0;
}
.route-stop.peach { --surface: #fbe8d8; }
.route-stop.lavender { --surface: #ede9f6; }
.route-stop.gold { --surface: #faeed0; }
.area-button {
  width: 100%;
  min-height: 74px;
  display: flex;
  position: relative;
  align-items: center;
  color: var(--ink);
  text-align: left;
  padding: 6px 7px 6px 31px;
  background: var(--surface);
  border-radius: 16px;
  border: 2px solid transparent;
  z-index: 1;
}
.current .area-button { border-color: #e5a76c; background: #fff1d6; }
.locked .area-button { background: #edf0df; }
.locked .area-art { opacity: .72; }
.stop-number {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 2;
  left: -17px;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #e1e7cc;
  color: #365c50;
  border: 2px solid var(--paper);
  font-size: 13px;
  font-weight: 850;
}
.current .stop-number { background: var(--orange); color: white; }
.passed .stop-number { background: var(--green); color: white; }
.stop-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; padding-block: 4px; }
.stop-copy strong { font-size: clamp(16px, 4vw, 22px); }
.stop-copy small { color: var(--muted); font-weight: 650; font-size: 12px; }
.area-art {
  overflow: hidden;
  flex: 0 0 clamp(58px, 22%, 116px);
  height: 55px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #ffffff72;
  font-size: 30px;
}
.area-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.area-art .area-icon { width: 33px; height: 33px; object-fit: contain; }
.quiz-header { justify-content: flex-start; margin-bottom: 12px; }
.quiz-header h1 { font-size: clamp(22px, 5vw, 33px); letter-spacing: -.055em; }
.quiz-header .secondary { flex-shrink: 0; padding-inline: 13px; }
.teacher-row {
  display: grid;
  grid-template-columns: clamp(60px, 18vw, 107px) 1fr;
  gap: 11px;
  align-items: center;
  margin: 13px 0 15px;
}
.teacher {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 17px;
  background: var(--green-light);
  object-fit: cover;
}
.teacher-line {
  background: var(--green-light);
  border: 1px solid #c8d9bd;
  border-radius: 15px 15px 15px 3px;
  padding: 9px 11px;
  font-weight: 700;
  font-size: 14px;
}
.round-progress { display: flex; gap: 11px; align-items: center; margin: 9px 0 0; }
.progress-steps { display: flex; flex: 1; gap: 4px; }
.progress-steps span { background: #e2ead7; height: 8px; flex: 1; border-radius: 8px; }
.progress-steps .active { background: #efae68; }
.progress-steps .done { background: #588567; }
.progress-label { flex-shrink: 0; font-size: 13px; font-weight: 760; }
.sentence-card {
  background: var(--cream);
  border: 1.5px solid #ecd9b9;
  box-shadow: 0 3px 0 #f0e2c7;
  border-radius: 20px;
  padding: 14px 13px;
  margin-bottom: 16px;
}
.sentence { text-align: center; font-size: clamp(21px, 5.8vw, 30px); line-height: 1.55; font-weight: 780; }
.word-button {
  background: #fce0b1;
  color: #84391a;
  padding: 2px 7px;
  font-weight: 820;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.word-button.cue { box-shadow: 0 0 0 3px #dd7a3d; }
.word-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #ebdbbf;
}
.hint-meaning { font-weight: 760; }
.audio-status { font-size: 13px; color: var(--muted); }
.picture-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.picture-choice {
  position: relative;
  width: calc((100% - 10px) / 2);
  min-height: clamp(100px, 27vw, 170px);
  padding: 5px;
  border: 2px solid #d2dfc5;
  background: #edf3df;
  box-shadow: 0 3px 0 #dce6cc;
  border-radius: 17px;
  color: var(--ink);
}
.picture-choice:nth-child(2) { background: #faedda; }
.picture-choice:nth-child(3) { background: #eaeef4; }
.picture-choice.correct { border-color: #438457; box-shadow: 0 3px 0 #438457; }
.picture-choice.wrong { border-color: #ce773f; box-shadow: 0 3px 0 #ce773f; }
.picture-letter {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 7px;
  border: 1px solid #d9e4ce;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--cream);
  font-weight: 850;
}
.picture-art {
  min-height: 88px;
  width: 100%;
  height: 100%;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  font-size: clamp(24px, 8vw, 53px);
}
.scene-picture { width: 100%; height: clamp(93px, 26vw, 157px); object-fit: cover; border-radius: 11px; }
.picture-symbol { width: 30%; max-width: 65px; object-fit: contain; }
.picture-symbol:only-child { width: 52%; max-width: 89px; }
.quiz-bottom { display: grid; justify-items: center; gap: 9px; margin-top: 14px; }
.answer-message { font-weight: 700; text-align: center; }
.answer-message:empty { display: none; }
.victory-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 12px 28px;
  background: #fff1d8;
  border: 1px solid #edd4a8;
  border-radius: 25px;
}
.book-art { border-radius: 30px; width: min(48%, 210px); aspect-ratio: 1; object-fit: cover; }
.victory-card h1 { font-size: clamp(28px, 7vw, 42px); }
.victory-region { margin-bottom: 6px; }
.notice {
  position: fixed;
  left: 50%;
  bottom: max(env(safe-area-inset-bottom), 14px);
  transform: translateX(-50%);
  width: min(calc(100% - 25px), 530px);
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 10;
  color: white;
  background: #1d463b;
  padding: 9px 12px;
  border-radius: 15px;
  box-shadow: 0 4px 20px #203d3540;
}
.notice span { flex: 1; }
.notice button { background: transparent; color: white; border: 0; min-height: 38px; font-weight: 760; }
dialog {
  width: min(calc(100% - 28px), 440px);
  max-height: min(94vh, 680px);
  max-height: min(94dvh, 680px);
  color: var(--ink);
  border: 2px solid #d6dec1;
  border-radius: 23px;
  padding: 23px;
  background: var(--cream);
}
dialog::backdrop { background: #193e36a6; }
dialog h2 { padding-right: 36px; margin-bottom: 7px; }
#parent-summary { color: var(--muted); margin-bottom: 14px; }
#parent-form { display: grid; gap: 8px; }
#origin-field { display: grid; gap: 8px; }
#parent-form label { font-weight: 750; font-size: 14px; }
#parent-form input {
  width: 100%;
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid #b9c8b5;
  border-radius: 9px;
  background: white;
  color: var(--ink);
}
#parent-submit { margin-top: 8px; }
.form-error { color: #963d28; font-size: 14px; }
.icon-button {
  min-width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-weight: 760;
}
.dialog-close { position: absolute; top: 12px; right: 12px; }
@media (min-width: 560px) {
  .app { padding: 29px 24px; }
  .picture-choice { width: calc((100% - 20px) / 3); }
  .map-hero { background-position: center 56%; }
  .area-button { min-height: 83px; }
  .area-art { height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}
