@charset "UTF-8";

:root {
  color-scheme: light;
  --bg: #fbf7ee;
  --surface: #fffdf7;
  --ink: #3c2a21;
  --muted: #6b574a;
  --line: #e6d6c3;
  --accent: #a74632;
  --accent-hover: #883722;
  --sage: #e6ecdc;
  --green: #3c6047;
  --shadow: 0 3px 0 #e9ddcd;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; background: var(--bg); }
body { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.62; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.4; }
ul, ol { padding: 0; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select { font: inherit; color: inherit; }
button, summary, label.set-option, select { cursor: pointer; }
button:disabled { cursor: default; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #326f71;
  outline-offset: 3px;
}
h1:focus, h2:focus { outline: none; }
svg { width: 22px; height: 22px; flex: none; }
ruby { ruby-position: over; }
rt { font-size: .53em; font-weight: 650; letter-spacing: 0; }
section[id] { scroll-margin-top: 24px; }
[lang="th"] { font-family: "Noto Sans Thai", "Leelawadee UI", "Tahoma", "Thonburi", system-ui, sans-serif; }
.tr-ja, .tr-id, .tr-th { display: block; overflow-wrap: anywhere; }
.tr-ja { font-weight: 750; line-height: 1.55; }
.tr-id, .tr-th { color: var(--muted); font-size: .9rem; font-weight: 500; line-height: 1.55; }
.tr-th { line-height: 1.72; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.muted { color: var(--muted); font-size: .9rem; }

.topbar { background: #fffaf0; border-bottom: 1px solid var(--line); }
.top-inner {
  width: min(1160px, calc(100% - 72px));
  min-height: 70px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 8px;
}
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; font-weight: 850; }
.brand img { width: 37px; padding: 2px; background: #f4e4d0; border: 1px solid #ebd9c1; border-radius: 10px; }
.top-actions { flex: none; }
.sound, .top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #e6d5c0;
  background: #fffdf7;
  border-radius: 12px;
  color: var(--ink);
  padding: 5px 12px;
  text-decoration: none;
  text-align: left;
  font-weight: 750;
  font-size: .87rem;
}
.sound .tr-id, .sound .tr-th { font-size: .78rem; line-height: 1.36; }
.sound svg { color: var(--accent); width: 19px; }
.sound:hover, .top-link:hover { background: #f7eadb; }
body[data-screen="game"] .top-inner { width: min(680px, calc(100% - 32px)); min-height: 58px; }

.landing { width: min(1160px, calc(100% - 72px)); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.83fr) minmax(0, 1.17fr);
  align-items: center;
  gap: clamp(24px, 4vw, 62px);
  padding-block: 45px 42px;
  border-bottom: 1px solid var(--line);
}
.hero-copy { min-width: 0; }
.course { border-left: 3px solid #b96349; padding-left: 12px; margin-bottom: 27px; }
.course .tr-ja { color: var(--accent); font-size: .92rem; font-weight: 800; }
.course .tr-id, .course .tr-th { font-size: .85rem; }
.hero h1 .tr-ja {
  font-size: clamp(2.4rem, 4.1vw, 3.8rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -.07em;
  color: #42291e;
}
.hero h1 .tr-id { margin-top: 13px; font-size: clamp(1rem, 1.55vw, 1.22rem); font-weight: 690; color: #744b3c; }
.hero h1 .tr-th { font-size: clamp(1rem, 1.55vw, 1.22rem); color: #744b3c; }
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin-top: 23px;
  padding: 8px 13px 8px 16px;
  background: #f5e7d8;
  border: 1px solid #e7d2b9;
  border-radius: 13px;
  color: var(--accent);
  text-decoration: none;
}
.hero-cta:hover { background: #f0dac5; }
.hero-cta .tr-id, .hero-cta .tr-th { font-size: .85rem; }
.hero-art {
  min-width: 0;
  border: 1px solid #dcbfa9;
  border-radius: 25px;
  background: #f2ded0;
  overflow: hidden;
  box-shadow: 0 4px 0 #e8d9c8;
}
.hero-art img { width: 100%; aspect-ratio: 720 / 505; object-fit: contain; }

.learning {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  column-gap: 30px;
  align-items: start;
  padding-top: 29px;
}
.section-nav {
  display: grid;
  gap: 3px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  position: sticky;
  top: 16px;
}
.section-nav a {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 11px;
}
.section-nav a:first-child { background: #f6e9da; }
.section-nav a:hover, .section-nav a:focus-visible { background: #f4e4d0; }
.section-nav svg { color: var(--accent); width: 18px; height: 18px; margin-top: 3px; }
.section-nav .tr-ja { font-size: .92rem; }
.section-nav .tr-id, .section-nav .tr-th { font-size: .83rem; }
.learning-body { display: grid; gap: 22px; }
.panel {
  padding: clamp(19px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
}
.section-title { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 17px; }
.section-title .tr-ja { font-size: clamp(1.28rem, 2.5vw, 1.6rem); line-height: 1.45; }
.section-title .tr-id, .section-title .tr-th { font-size: .94rem; }
.section-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f7e4d1;
  color: var(--accent);
  flex-shrink: 0;
}
.goal-panel { background: #fbefdc; }
.goal-copy { border-top: 1px solid #e8d7bd; padding-top: 17px; }
.goal-copy .tr-ja { font-size: clamp(1.05rem, 2.35vw, 1.3rem); line-height: 1.65; }
.goal-copy .tr-id { margin-top: 4px; }
.goal-copy .tr-id, .goal-copy .tr-th { font-size: .96rem; }
.scenario { margin-bottom: 14px; }
.scenario .tr-ja { margin-bottom: 4px; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  border: 1px solid #ecdecb;
  background: #fcf8ee;
  border-radius: 14px;
  padding: 13px;
}
.step-art { border-radius: 11px; position: relative; margin-top: 3px; }
.step-art::before {
  content: counter(step);
  position: absolute;
  top: -6px;
  left: -6px;
  background: #fffdfa;
  color: var(--accent);
  border: 1px solid #e2c5ab;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 900;
}
.step-art img { width: 100%; height: 63px; object-fit: contain; padding: 5px; }
.peach { background: #f4ded1; }
.sage { background: #e5ebda; }
.sand { background: #f4e6d2; }
.gold { background: #f6e6be; }
.steps .tr-ja { margin-bottom: 4px; }
.example-panel { background: #fcf7ee; }
.dialogue { list-style: none; display: grid; gap: 12px; }
.utterance { display: flex; gap: 10px; align-items: flex-start; }
.utterance.learner { flex-direction: row-reverse; }
.avatar { flex: 0 0 42px; }
.bubble { border-radius: 16px; padding: 11px 14px; background: #e8edde; color: #26372a; min-width: 0; }
.learner .bubble { background: #f6e3d9; color: var(--ink); border-top-right-radius: 4px; }
.agent .bubble { border-top-left-radius: 4px; }
.role { padding-bottom: 3px; margin-bottom: 5px; border-bottom: 1px solid #725d4729; }
.role .tr-ja, .role .tr-id, .role .tr-th { font-size: .8rem; }
.role .tr-ja { color: var(--green); }
.learner .role .tr-ja { color: var(--accent); }
.word-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.word-card { padding: 10px 6px 12px; text-align: center; border-radius: 13px; border: 1px solid #ebddc9; background: #fbf5e9; }
.word-card:nth-child(3n + 2) { background: #edf0e4; }
.word-card:nth-child(3n + 3) { background: #f7e8df; }
.word-card img { width: min(89px, 85%); aspect-ratio: 1.12; margin: 0 auto 5px; }
.word-card .tr-ja { font-size: clamp(.85rem, 2.4vw, 1rem); }
.prepare-panel { background: #fff9ee; }
.field-help { margin: 3px 0 9px; }
.field-help .tr-ja { font-size: .9rem; font-weight: 600; }
input[type="text"], input[type="url"], select {
  min-height: 47px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid #ccb39a;
  border-radius: 9px;
  background: #fffdf8;
}
#player-name { width: 100%; }
.set-field { margin: 19px 0 22px; padding: 0; border: 0; min-width: 0; }
.set-field legend { padding: 0; }
.set-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.set-option { display: block; position: relative; }
.set-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.set-option span {
  min-height: 47px;
  display: grid;
  place-items: center;
  background: #fffdf8;
  border: 1px solid #d9c4ac;
  border-radius: 10px;
  font-size: 1.16rem;
  font-weight: 850;
}
.set-option:hover span { background: #f4e5d6; }
.set-option input:checked + span { color: #fffaf1; background: var(--accent); border-color: var(--accent); }
.set-option input:focus-visible + span { outline: 3px solid #326f71; outline-offset: 2px; }
.field-error { margin-top: 8px; color: #903c2a; }
.field-error .tr-id, .field-error .tr-th { color: #903c2a; }
.primary, .secondary {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}
.primary {
  background: var(--accent);
  color: #fffaf3;
  border: 1px solid #8d3b2b;
  box-shadow: 0 3px 0 #743021;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #743021; }
.primary:disabled { background: #e9ddcc; color: #725f52; border-color: #ddcbb3; box-shadow: 0 3px 0 #d9c8b1; }
.secondary { background: #fcf6eb; color: var(--accent); border: 1px solid #d9c0a9; }
.secondary:hover { background: #f3e3d0; }
.tr-button { width: 100%; }
.tr-button .tr-id, .tr-button .tr-th { color: inherit; }
.tr-button .tr-ja { font-size: 1.15rem; font-weight: 850; }
.teacher-entry {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: fit-content;
  margin: 17px auto 0;
  text-align: center;
  padding: 7px 20px 3px;
}
.teacher-entry .tr-ja { text-decoration: underline; }
.teacher-entry { text-decoration: none; }

.play, .finish { width: min(680px, calc(100% - 32px)); margin: 22px auto 36px; }
.play { display: grid; gap: 16px; }
.progress { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.progress h1 { font-size: clamp(1.125rem, 3.8vw, 1.55rem); }
.progress h1 span { white-space: nowrap; }
.progress small { color: var(--muted); font-size: .75em; }
.set-label { color: var(--accent); font-size: .88rem; font-weight: 820; letter-spacing: .05em; }
.key-track { display: flex; gap: 5px; }
.key-token {
  width: clamp(31px, 8vw, 48px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px dashed #c2a98e;
  color: #8a6d53;
  background: #f4ebdc;
}
.key-token.earned { border: 1px solid #d3a96e; background: #ffedc4; }
.key-token svg { width: 53%; height: auto; }
.key-token img { width: 85%; }
.needed-panel { background: #faecd8; padding: 15px 17px 17px; }
.needed-panel h2, .choose-panel h2 { font-size: clamp(1.08rem, 3vw, 1.32rem); }
.needed-panel h2 { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.needed-panel h2 svg { color: var(--accent); }
.item-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; }
.item-cards li {
  background: #fffaf0;
  border: 1px solid #e8d9c4;
  border-radius: 11px;
  text-align: center;
  padding: 4px 3px 6px;
  font-size: .88rem;
  font-weight: 780;
  overflow-wrap: anywhere;
}
.item-cards img { width: min(92px, 100%); height: clamp(54px, 13vw, 78px); object-fit: contain; margin-inline: auto; }
.choose-panel h2 { margin-bottom: 3px; }
.choose-hint { color: var(--muted); font-size: .88rem; margin-bottom: 9px; }
.rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.room {
  display: grid;
  place-items: center;
  min-width: 0;
  gap: 2px;
  padding: 6px 3px 8px;
  background: #fffaf0;
  border: 2px solid #e4d1ba;
  border-radius: 14px;
  box-shadow: 0 2px 0 #e9ddcd;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.room img { width: min(100%, 110px); height: clamp(64px, 16vw, 88px); object-fit: contain; }
.room span { font-weight: 750; }
.room strong { font-size: 1.1em; }
.room:hover { background: #f8e8d5; }
.room[aria-pressed="true"] { border-color: var(--accent); background: #f6e0d1; box-shadow: 0 2px 0 #cd967e; transform: translateY(-2px); }
.memo-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.memo-toggle {
  width: 100%;
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 780;
  padding: 7px 11px;
  background: none;
  border: 0;
  text-align: left;
  border-radius: 11px;
}
.memo-toggle svg { width: 19px; height: 19px; color: var(--accent); }
.memo-toggle svg:last-child { margin-left: auto; transition: transform .18s; }
.memo-toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.memo-toggle:disabled { color: var(--muted); }
#memo-body { padding: 0 11px 10px; }
#memo-body p { font-size: .84rem; color: var(--muted); margin-bottom: 4px; }
.memo-legend { display: flex; flex-wrap: wrap; gap: 2px 11px; }
.memo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px; border-top: 1px solid #ecdfd0; }
.note {
  width: 48px;
  min-height: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #d6bfa6;
  background: #f9f1e4;
  font-size: 1.35rem;
  font-weight: 900;
}
.note[data-state="has"] { background: #e6eddd; color: var(--green); border-color: #a1b399; }
.note[data-state="missing"] { background: #f7e5dd; color: #943d30; border-color: #d4aa9a; }
.feedback { border-radius: 10px; padding: 9px 12px; background: #f8e8df; font-size: .9rem; font-weight: 750; color: #893c2c; }
.feedback:empty { display: none; }
.confirm-room { width: 100%; min-height: 52px; font-size: 1.07rem; }
.correct-panel { background: #f3f2df; }
.success-head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-bottom: 13px; }
.success-head h2 { font-size: clamp(1.5rem, 5vw, 2.3rem); color: var(--green); }
.success-head p:last-child { font-weight: 750; }
.opening-door { position: relative; width: clamp(63px, 15vw, 118px); aspect-ratio: 1; }
.opening-door img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.closed-art { transform-origin: left; opacity: 0; animation: swing .48s ease-in forwards; }
.won-key { width: clamp(48px, 12vw, 82px); margin-left: auto; animation: reward .5s ease-out both; }
.earned-now { animation: reward .46s ease-out both; }
.correct-panel h3 { font-size: 1rem; margin-bottom: 7px; }
.correct-panel .item-cards .needed { background: #e6edda; border-color: #c4d2b2; }
.correct-panel .confirm-room { margin-top: 17px; }
.enter { animation: enter .27s ease-out both; }
@keyframes enter { from { opacity: .6; transform: translateY(6px); } }
@keyframes reward { from { transform: scale(.65) rotate(-14deg); opacity: .35; } 66% { transform: scale(1.14) rotate(8deg); } }
@keyframes swing { 0% { opacity: 1; transform: perspective(200px) rotateY(0deg); } 100% { opacity: 0; transform: perspective(200px) rotateY(-76deg); } }

.finish { display: grid; gap: 17px; }
.finish-banner { background: #fff1d9; text-align: center; position: relative; overflow: hidden; }
.finish-banner .key-track { justify-content: center; gap: 8px; margin-bottom: 15px; }
.finish-banner h1 .tr-ja { font-size: clamp(1.75rem, 6vw, 2.9rem); color: var(--accent); }
.finish-banner h1 .tr-id, .finish-banner h1 .tr-th { font-size: 1.05rem; }
.finish-banner > p { margin-top: 13px; }
.score {
  position: relative;
  margin-top: 19px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) minmax(0, 1.3fr);
  border: 1px solid #e9d4b5;
  border-radius: 12px;
  background: #fff9eb;
}
.score > div { padding: 10px 4px; min-width: 0; }
.score > div + div { border-left: 1px solid #e9d4b5; }
.score dt .tr-ja, .score dt .tr-id, .score dt .tr-th { font-size: .84rem; }
.score dd { font-weight: 850; font-size: 1.15rem; overflow-wrap: anywhere; }
.review ul { list-style: none; display: grid; gap: 10px; }
.review li { border-left: 3px solid #b9c5a5; padding-left: 10px; }
.self-evaluation h2 { font-size: 1.05rem; }
.self-evaluation > p { margin-block: 7px 11px; }
.self-evaluation > p .tr-ja { font-size: .88rem; }
.ratings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.ratings button {
  border: 1px solid #decaac;
  border-radius: 11px;
  background: #fcf6ea;
  padding: 8px 4px;
  min-width: 0;
}
.ratings button:hover { background: #f4e5cd; }
.ratings button[aria-pressed="true"] { background: #f6e0b6; border-color: #9c571c; box-shadow: inset 0 0 0 1px #9c571c; }
.ratings .stars { display: block; color: #88501e; font-size: clamp(.98rem, 4vw, 1.25rem); letter-spacing: .04em; }
.ratings .tr-ja, .ratings .tr-id, .ratings .tr-th { font-size: .87rem; }
.finish-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-bottom: 2px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  left: var(--x);
  top: -12px;
  width: 7px;
  height: 11px;
  background: #bb604a;
  border-radius: 2px;
  animation: confetti 1.25s ease-in var(--delay) both;
}
.confetti i:nth-child(3n) { background: #788f65; }
.confetti i:nth-child(3n + 1) { background: #db9d44; width: 6px; height: 6px; }
@keyframes confetti {
  0% { opacity: 0; }
  24% { opacity: .9; }
  80% { opacity: .8; }
  100% { opacity: 0; transform: translate(18px, 230px) rotate(var(--twist)); }
}

.teacher-wrap { width: min(820px, calc(100% - 32px)); margin: 30px auto; }
.teacher-wrap h2 { margin-bottom: 10px; font-size: 1.25rem; }
.gate { max-width: 450px; margin: 0 auto; }
.gate h1 { margin-bottom: 7px; }
.gate-key { width: 65px; margin-left: -5px; }
#unlock, #change-code { display: grid; gap: 7px; align-items: start; margin: 15px 0; }
#unlock-status, #code-status, #copy-status { color: var(--accent); font-size: .9rem; }
#unlock-status:empty, #code-status:empty, #copy-status:empty { display: none; }
#teacher-content { display: grid; gap: 16px; }
.teacher-intro { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.teacher-intro h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
.teacher-intro button { padding-inline: 10px; }
.teacher-notes details { margin-top: 11px; }
.teacher-notes details ol { padding-left: 1.45em; margin: 9px 0; }
details summary { font-weight: 800; color: var(--accent); padding: 8px 0; }
.teacher-notes li { margin-bottom: 4px; }
.teacher-dialogue { list-style: none; padding: 9px; background: #f5ecdc; border-radius: 9px; margin: 7px 0; font-size: .94rem; }
.teacher-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.teacher-selects select { display: block; width: 100%; }
.teacher-selects label, #change-code label, #unlock label, .share-grid label { font-weight: 750; }
.teacher-mission-label {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 5px 10px;
  margin: 15px 0 9px;
}
.answer-chip { padding: 4px 9px; border-radius: 8px; background: var(--sage); color: var(--green); font-weight: 820; }
.inventory { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .94rem; }
.inventory th, .inventory td { border: 1px solid #e3d4c0; padding: 4px 3px; text-align: center; }
.inventory th:first-child { width: 43%; }
.inventory thead th { background: #f2e6d4; }
.inventory tbody th { text-align: left; }
.inventory tbody th img { width: 33px; height: 33px; margin-inline: 2px 4px; display: inline-block; vertical-align: middle; }
.inventory tbody th span { vertical-align: middle; overflow-wrap: anywhere; }
.inventory tr:nth-child(even) { background: #fbf6ed; }
.inventory tr.needed-row { background: #f7ead0; }
.inventory td { font-size: 1.23rem; font-weight: 850; }
.table-yes { color: var(--green); }
.table-no { color: #974332; }
.required-mark { display: inline-block; margin-left: 5px; color: #7f4d2e; font-size: .73em; }
.table-legend { margin-top: 7px; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 14px; align-items: start; }
.share-grid input { display: block; width: 100%; margin: 4px 0 8px; }
.share-grid .muted { margin-top: 9px; }
.qr-column { display: grid; justify-items: center; gap: 7px; }
#qr { width: min(156px, 45vw); background: white; border: 1px solid #ebddc9; }
#qr svg { display: block; width: 100%; height: auto; }
.code-panel summary { min-height: 44px; }

.site-foot {
  width: min(1160px, calc(100% - 72px));
  margin: 32px auto 0;
  padding: 20px 0 29px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: .83rem;
}
.site-foot p { margin-bottom: 4px; }

@media (max-width: 960px) {
  .learning { grid-template-columns: 170px minmax(0, 1fr); gap: 20px; }
  .hero h1 .tr-ja { font-size: clamp(2rem, 4.6vw, 3.4rem); }
  .steps li { grid-template-columns: 51px minmax(0, 1fr); padding: 10px; }
  .step-art img { height: 51px; }
}
@media (max-width: 720px) {
  .top-inner, .landing, .site-foot { width: calc(100% - 32px); }
  .hero { grid-template-columns: 1fr; gap: 17px; padding: 24px 0; }
  .hero-copy { position: relative; }
  .course { margin-bottom: 15px; }
  .hero h1 .tr-ja { font-size: clamp(2.03rem, 9.7vw, 3.25rem); }
  .hero h1 .tr-id { margin-top: 4px; }
  .hero-cta { margin-top: 12px; }
  .hero-art { border-radius: 17px; }
  .hero-art img { max-height: 335px; }
  .learning { display: block; padding-top: 18px; }
  .section-nav { display: none; }
  .learning-body { gap: 15px; }
  .top-inner { min-height: 64px; }
}
@media (max-width: 460px) {
  .top-inner { gap: 7px; }
  .brand { gap: 6px; font-size: .94rem; }
  .brand img { width: 32px; }
  .sound { gap: 6px; padding-inline: 8px; }
  .panel { padding: 15px; border-radius: 16px; }
  .section-title { gap: 10px; margin-bottom: 13px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .steps li { grid-template-columns: 54px minmax(0, 1fr); gap: 12px; }
  .word-grid { gap: 6px; }
  .word-card .tr-id, .word-card .tr-th { font-size: .81rem; }
  .utterance { gap: 6px; }
  .avatar { flex-basis: 35px; }
  .bubble { padding: 10px 11px; }
  .share-grid { grid-template-columns: 1fr; }
  .inventory th:first-child { width: 45%; }
  .inventory tbody th img { width: 22px; height: 23px; margin-inline: 0 3px; }
  .required-mark { margin-left: 3px; }
  .play { gap: 13px; margin-top: 15px; }
}
@media (max-width: 350px) {
  .top-inner, .landing, .site-foot, .play, .finish, .teacher-wrap { width: calc(100% - 24px); }
  .inventory tbody th img { display: none; }
  .progress h1 { font-size: .99rem; }
  .key-track { gap: 3px; }
  .key-token { width: 29px; }
  .score { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) minmax(0, 1.25fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition: none !important; }
  .confetti { display: none; }
}
