:root {
  color-scheme: light;
  --ink: #16233a;
  --muted: #4f5b6b;
  --paper: #f6f4ef;
  --white: #fffefa;
  --line: #d8d5ca;
  --navy: #1b3a6b;
  --accent: #ecb95e;
  font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 85% 12%, #f4ecdb, transparent 38rem); }
main { flex: 1; padding-block: 1.8rem 3rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #235da6; outline-offset: 4px; }
main:focus, h1:focus { outline: none; }
.sr-only, .symbols { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.access-link { position: fixed; top: .45rem; left: .45rem; z-index: 10; padding: .4rem .7rem; background: white; border: 1px solid var(--ink); transform: translateY(-150%); }
.access-link:focus { transform: none; }
.wrap { width: min(100% - 2.75rem, 68rem); margin-inline: auto; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 4.85rem); line-height: 1.12; letter-spacing: -.07em; overflow-wrap: anywhere; }
h2 { font-size: 1.46rem; line-height: 1.35; letter-spacing: -.045em; }
h3 { font-size: 1.06rem; line-height: 1.43; letter-spacing: -.03em; }
button, textarea, select { font: inherit; }
button { min-height: 44px; cursor: pointer; border-radius: .65rem; }
button:disabled { cursor: default; opacity: .52; }
.site-header { background: #fffcf4; border-bottom: 1px solid var(--line); box-shadow: inset 0 3px #f0bd60; }
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.4rem; }
.header-actions { display: flex; align-items: center; gap: .32rem; flex: none; }
.brand { display: inline-flex; gap: .65rem; align-items: center; border: 0; background: transparent; color: var(--ink); text-align: left; padding: .2rem .1rem; line-height: 1.22; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: .18rem; font-size: .75rem; color: var(--muted); font-weight: 600; }
.icon, .brand-mark svg { width: 1.13em; height: 1.13em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; background: #1b3a55; color: #f8d681; border-radius: .78rem; box-shadow: inset 0 -4px #132b43; font-size: 1.35rem; }
.tool-button, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; background: var(--white); color: var(--ink); border: 1px solid #bebab0; padding: .42rem .78rem; font-size: .91rem; font-weight: 800; }
.tool-button:hover, .secondary:hover { background: #efeae0; border-color: #827c70; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); background: #f1eee6; }
.footer-row { padding-block: .86rem; font-size: .82rem; }
.footer-row strong { font-size: .91rem; color: var(--ink); }
.primary { border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: .63rem 1.4rem; font-weight: 800; box-shadow: 0 3px #101f3a27; }
.primary:hover { background: #112c52; }
.intro-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin-top: 1.55rem; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.eyebrow { display: block; color: var(--role, var(--navy)); font-weight: 900; font-size: .88rem; letter-spacing: .025em; }
.display-title { margin-block: .55rem .8rem; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 25rem;
  min-width: 0;
  border: 1px solid #d6c9ad;
  border-radius: 1.48rem;
  overflow: hidden;
  background: linear-gradient(120deg, #fffdf6, #f8f2e2);
  box-shadow: 0 10px 28px #42312211;
}
.hero-body { align-self: center; padding: clamp(1.35rem, 4vw, 3.15rem); }
.hero-body .primary {
  width: min(100%, 11.5rem);
  min-height: 4rem;
  font-size: 1.5rem;
  line-height: 1.2;
}
.hero-body .lead { max-width: 27rem; color: #3e4b61; font-size: 1.05rem; word-break: keep-all; }
.due-pill { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .42rem; padding: .23rem .55rem .23rem .64rem; background: #faf1d8; border: 1px solid #e5ce9b; border-radius: .5rem; font-size: .87rem; color: #62450f; }
.due-pill strong { font-weight: 900; align-self: stretch; color: #49330a; background: #f0d38e; padding-inline: .34rem; border-radius: .26rem; margin-left: .19rem; }
.hero-body .due-pill { margin-block: .7rem .08rem; }
.hero-art { position: relative; display: grid; grid-template-rows: minmax(13rem, 1fr) auto; align-items: center; justify-items: center; min-height: 20rem; isolation: isolate; padding: .85rem .9rem; background: #dfe8e1; overflow: hidden; }
.hero-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(#66888352 .82px, transparent .83px) 0 0 / 13px 13px, radial-gradient(ellipse at 46% 54%, #fffad750, transparent 60%); }
.desk-scene { pointer-events: none; position: absolute; z-index: -1; inset: 2% 0 auto; width: 100%; height: 91%; }
.desk-main { display: grid; justify-items: center; margin-top: -.3rem; }
.desk-main .character { width: clamp(8rem, 17vw, 14.5rem); height: auto; transform: rotate(4deg); }
.hero-art .speech { margin-top: -.04rem; background: #fffdf6; border-color: #d3c4a4; box-shadow: 0 3px 0 #a596712b; text-align: center; }
.desk-stickers { display: flex; align-items: end; justify-content: center; gap: clamp(.36rem, 1vw, .62rem); padding-block: .18rem; }
.desk-sticker { display: block; width: clamp(2.75rem, 6vw, 4.2rem); border: 2px solid #fffaf0; border-radius: .68rem; background: var(--tint); box-shadow: 0 3px 6px #23394332; transform: rotate(-7deg); transition: transform .15s ease; }
.desk-sticker:nth-child(even) { transform: rotate(6deg); }
.desk-sticker:hover { transform: translateY(-5px) rotate(0); }
.desk-sticker .character { width: 100%; }
.quick-panel { margin-top: 1.38rem; }
.quick-panel h2 { font-size: 1.2rem; margin-bottom: .58rem; }
.quick-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.quick-tool { display: flex; align-items: center; text-align: left; min-height: 4.6rem; gap: .72rem; padding: .54rem .64rem; border: 1px solid var(--line); color: var(--ink); background: var(--white); box-shadow: 0 3px 0 #b7b0a127; }
.quick-tool:hover { border-color: #6b8a87; background: #edf5f0; }
.quick-tool strong, .quick-tool small { display: block; }
.quick-tool strong { line-height: 1.3; }
.quick-tool small { color: var(--muted); font-size: .81rem; margin-top: .16rem; }
.quick-icon { display: grid; place-items: center; height: 2.35rem; width: 2.35rem; flex: none; font-size: 1.17rem; border-radius: .65rem; background: #e1ebe8; color: #285c58; }
.quick-tool:nth-child(2) .quick-icon { background: #e4ebf7; color: #264773; }
.quick-tool:nth-child(3) .quick-icon { background: #f9e9d7; color: #994519; }
.character { display: block; max-width: 100%; }
.motion .character { animation: pop-in .28s ease-out; }
@keyframes pop-in { 0% { transform: translateY(3px); } 60% { transform: translateY(-4px); } 100% { transform: none; } }
.speech { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; padding: .48rem .76rem; background: #fffdfa; border: 1px solid #ded8cc; border-radius: .68rem; color: #37455a; font-size: .91rem; }
.speech strong { color: var(--ink); }
[data-role="base"], [data-role="finish"] { --role: #4f5b71; --tint: #e8ebf0; }
[data-role="homeroom"] { --role: #1b3a6b; --tint: #e1ebf8; }
[data-role="subject"] { --role: #17694a; --tint: #e2efe6; }
[data-role="club"] { --role: #7a3fa0; --tint: #f0e5f6; }
[data-role="sports"] { --role: #a6370c; --tint: #f8e9df; }
.page-heading { margin-bottom: 1.25rem; }
.page-heading h1, .mission-head h1, .completion h1 { font-size: clamp(1.9rem, 4.8vw, 3.25rem); }
.role-selection-note { color: var(--navy); font-size: clamp(1.12rem, 2.7vw, 1.42rem); font-weight: 800; line-height: 1.45; }
#header-bgm[aria-pressed="true"] { border-color: #498273; background: #e7f2e9; color: #225a4a; }
.grade-note { margin-top: .42rem; }
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.35rem; }
.role-option { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 1px solid #c6c0b5; border-radius: 1rem; background: var(--white); cursor: pointer; overflow: hidden; box-shadow: 0 4px 0 #92836c1b; transition: transform .16s ease, box-shadow .16s ease; }
.role-option:hover { transform: translateY(-3px); box-shadow: 0 6px 10px #52493f24; }
.role-option:has(:checked) { outline: 3px solid var(--role); outline-offset: -3px; box-shadow: 0 4px 0 color-mix(in srgb, var(--role) 25%, transparent); }
.role-option:focus-within { outline: 3px solid #235da6; outline-offset: 2px; }
.role-art { display: grid; place-items: center; background: radial-gradient(circle at 50% 51%, #fffaf4b5 0 32%, transparent 32.5%), radial-gradient(color-mix(in srgb, var(--role) 28%, transparent) .8px, transparent .9px) 0 0 / 10px 10px, var(--tint); aspect-ratio: 1.6; }
.role-art .character { width: min(73%, 9rem); transition: transform .16s ease; }
.role-option:hover .character, .role-option:has(:checked) .character { transform: rotate(-4deg) scale(1.06); }
.role-caption { display: flex; gap: .53rem; min-height: 3.3rem; padding: .6rem .7rem; align-items: center; font-weight: 800; font-size: .95rem; color: var(--role); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--role, var(--navy)); width: 1.14rem; height: 1.14rem; margin: 0; flex: none; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
legend { font-weight: 900; margin-bottom: .35rem; }
.grade-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.grade-row label { min-height: 44px; padding: .4rem .7rem; background: var(--white); border: 1px solid #c6c0b5; border-radius: .55rem; display: flex; align-items: center; gap: .42rem; cursor: pointer; }
.grade-row label:has(:checked) { border-color: var(--navy); font-weight: 800; }
.banner { display: flex; align-items: center; gap: .8rem; justify-content: space-between; flex-wrap: wrap; padding: .75rem .95rem; background: #ecefe8; border: 1px solid #d5dccf; border-radius: .7rem; margin-block: 1rem; }
.banner strong, .banner span { display: block; }
.banner span { color: #3e594c; font-size: .87rem; }
.map-top { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: start; }
.map-top .page-heading { margin-bottom: .5rem; }
.map-top .change-assignment {
  min-height:3.5rem; max-width:100%; padding:.65rem 1.2rem; gap:.5rem;
  font-size:1.2rem; color:white; background:#226050; border:2px solid #194b3f;
  box-shadow:0 3px 0 #143f34;
}
.map-top .change-assignment:hover { background:#194b3f; }
.map-context, .mission-kicker { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.context-chip { display: inline-block; border-radius: .38rem; padding: .22rem .5rem; background: var(--tint, #e6edf4); color: var(--role, var(--navy)); font-size: .85rem; font-weight: 800; }
.grade-chip { background: #253e58; color: #fffdf5; }
.progress-box { border: 1px solid #cfd9cf; border-radius: .9rem; padding: .67rem .9rem .86rem; background: #f2f7f1; margin: .7rem 0 1.22rem; }
.progress-label { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.progress-label strong { font-size: 1.35rem; line-height: 1.2; color: #19523d; }
.progress-caption, .progress-summary { color: #314f46; font-size: .88rem; }
.progress-summary { text-align: right; }
progress { width: 100%; height: .66rem; display: block; appearance: none; border: 0; overflow: hidden; background: #e2e7e8; border-radius: 1rem; margin-top: .4rem; }
progress::-webkit-progress-bar { background: #e2e7e8; }
progress::-webkit-progress-value { background: #277551; }
progress::-moz-progress-bar { background: #277551; }
.map-destination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .52rem; margin-block: -.55rem .9rem; padding: .52rem .58rem; background: var(--tint); border: 1px solid color-mix(in srgb, var(--role) 43%, #ecebdc); border-radius: .7rem; }
.map-destination-copy { display: flex; align-items: center; gap: .64rem; min-width: 0; }
.map-destination-copy > .icon { width: 1.72rem; height: 1.72rem; color: var(--role); }
.map-destination-copy strong { display: block; line-height: 1.38; overflow-wrap: anywhere; }
.map-award { background: #fff2cc; border-color: #d4b877; }
.map-award span { color: #63511f; }
.map-control-strip { display: grid; grid-template-columns: .78fr 1.22fr; align-items: stretch; gap: .72rem; margin: .75rem 0 .94rem; }
.map-control-strip > * { margin: 0; }
.map-board { padding: .34rem clamp(.6rem, 2.7vw, 1.4rem) .8rem; border: 1px solid #c8d7d0; border-radius: 1.2rem; background: radial-gradient(ellipse at 84% 16%, #e1ece2 0 9%, transparent 25%), radial-gradient(ellipse at 8% 85%, #f6ecd3 0 10%, transparent 32%), #eef4ed; box-shadow: inset 0 0 0 5px #fcfff852; }
.map-board {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 250'%3E%3Cg fill='none' stroke='%238eafa0' stroke-width='1.2' opacity='.52'%3E%3Cpath d='M392 28q-91-27-145 4-46 26-116 23Q53 52 20 92q-32 41 39 67 45 16 74 41 48 40 112 25 73-17 148 7'/%3E%3Cpath d='M391 49q-87-30-130 2-46 35-112 24-74-12-98 21-20 32 45 48 43 11 68 39 33 38 87 23 71-18 143 6'/%3E%3Cpath d='M391 77q-69-27-113-3-60 33-115 22-52-10-72 8-15 15 46 27 45 10 65 37 19 27 57 15 62-18 133 4'/%3E%3Cpath d='M392 106q-68-26-103-3-39 26-83 19-30-5-33 1-7 11 29 17 35 7 52 21 10 8 40-3 38-14 99 4'/%3E%3Cpath d='M392 130q-56-25-98-3-35 19-58 11'/%3E%3C/g%3E%3C/svg%3E"), radial-gradient(ellipse at 84% 16%, #e1ece2 0 9%, transparent 25%), radial-gradient(ellipse at 8% 85%, #f6ecd3 0 10%, transparent 32%);
  background-position: right top, center, center;
  background-repeat: no-repeat;
  background-size: min(43%, 25rem) auto, auto, auto;
}
.map-group { position: relative; padding: .65rem 0 .85rem 2.95rem; }
.map-group + .map-group::before { content: ""; position: absolute; top: -1.04rem; bottom: calc(100% - 2.25rem); left: 1.42rem; border-left: 3px dotted #8fa99e; }
.map-group:not(:last-child)::after { content: ""; position: absolute; top: 2.58rem; bottom: 0; left: 1.42rem; border-left: 3px dotted #8fa99e; }
.group-heading { position: relative; min-height: 3.2rem; display: flex; align-items: center; gap: .5rem; padding: .32rem 0 .37rem .4rem; }
.group-heading h2 { color: var(--role); font-size: 1.2rem; }
.group-character { position: absolute; z-index: 1; left: -2.86rem; display: grid; place-items: center; width: 2.67rem; height: 2.67rem; border: 2px solid var(--role); background: var(--tint); border-radius: .7rem; box-shadow: 0 3px #16233a24; }
.group-character .character { width: 95%; }
.mission-route { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .64rem 1.15rem; margin: 0; padding: .2rem .4rem 0; }
.route-stop { position: relative; grid-column: var(--column); grid-row: var(--row); min-width: 0; }
.route-stop::after { content: ""; position: absolute; z-index: 0; pointer-events: none; top: calc(50% - 1px); left: 1.21rem; }
.route-stop[data-route="right"]::after, .route-stop[data-route="left"]::after { width: calc(100% + 1.15rem); border-top: 3px dotted color-mix(in srgb, var(--role) 56%, #b1c6bc); }
.route-stop[data-route="left"]::after { left: auto; right: calc(100% - 1.21rem); }
.route-stop[data-route="bend"]::after { height: calc(100% + .64rem); border-left: 3px dotted color-mix(in srgb, var(--role) 56%, #b1c6bc); }
.mission-card { position: relative; z-index: 1; display: flex; align-items: center; gap: .45rem; width: 100%; min-height: 5rem; height: 100%; text-align: left; padding: .5rem .59rem .5rem .39rem; border: 1px solid color-mix(in srgb, var(--role) 28%, #d5e0d5); border-radius: .7rem; background: var(--white); color: var(--ink); box-shadow: 0 3px 0 #66796c1f; transition: background-color .15s ease, transform .15s ease; }
.mission-card:hover { background: var(--tint); border-color: var(--role); transform: translateY(-2px); }
.mission-card-body { display: grid; gap: .24rem; justify-items: start; min-width: 0; }
.mission-card strong { font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere; }
.route-marker { display: grid; place-items: center; width: 1.72rem; height: 1.72rem; border-radius: 50%; flex: none; border: 2px solid var(--role); background: var(--tint); color: var(--role); font-size: .87rem; font-weight: 900; line-height: 1; }
.route-marker.done { background: #23744d; color: white; border-color: #23744d; }
.route-marker.started { background: #f8dc91; color: #664512; border-color: #b18126; }
.route-next .mission-card { border: 2px solid var(--role); background: #fffaf0; box-shadow: 0 3px color-mix(in srgb, var(--role) 25%, transparent); }
.route-next .route-marker { outline: 2px solid #e5a742; outline-offset: 2px; background: #ffebbd; }
.status { display: inline-flex; align-items: center; gap: .2rem; padding: .04rem .33rem; border-radius: .29rem; background: #efeee9; color: #465264; font-size: .77rem; font-weight: 800; }
.status.done { color: #165537; background: #e0f1e5; }
.status.started { color: #73521b; background: #f8ebca; }
.mission-head { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: start; }
.mission-head h1 { margin-block: .25rem; }
.mission-shell { max-width: 52rem; margin-inline: auto; }
.talk { display: flex; align-items: center; gap: .68rem; margin-top: .7rem; }
.talk .character { width: 4.5rem; height: 4.2rem; flex: none; }
.talk .speech { border-left: 4px solid var(--role); }
.steps, .tool-tabs { display: grid; gap: .4rem; margin-block: .86rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps button, .tool-tabs button { display: inline-flex; justify-content: center; align-items: center; gap: .28rem; background: #faf8f1; color: #3e4a5b; border: 1px solid #cbc7ba; padding: .3rem .4rem; font-size: .88rem; }
.steps button[aria-current="step"], .tool-tabs button[aria-pressed="true"] { background: var(--role, var(--navy)); border-color: var(--role, var(--navy)); color: #fff; font-weight: 800; }
.step-panel { background: var(--white); border: 1px solid var(--line); border-radius: .85rem; padding: clamp(.85rem, 2.8vw, 1.35rem); }
#step-title:focus { outline: none; }
.step-panel > * + *, #tool-content > * + * { margin-top: .75rem; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.fact, .callout { padding: .62rem .75rem; border: 1px solid var(--line); border-radius: .58rem; background: #f6f4ec; }
.fact strong { display: block; color: var(--role, var(--navy)); font-size: .85rem; }
.callout { background: var(--tint, #e8edf3); border-color: transparent; }
.list { margin: .25rem 0 0; padding-left: 1.4rem; }
.list li + li { margin-top: .22rem; }
.errors-caption { color: #a6370c; }
.mistakes { border-left: 4px solid #c2410c; border-radius: .38rem; background: #fff0e8; padding: .57rem .76rem; }
.menu-row { display: flex; gap: .6rem; justify-content: space-between; align-items: center; border: 1px solid #d7dbe2; background: #eef1f6; border-radius: .58rem; padding: .55rem .66rem; }
.menu-row p { overflow-wrap: anywhere; font-weight: 700; }
.menu-row button { flex: none; }
.challenge-card { padding: .76rem .8rem; border: 1px solid #d6dbcd; border-radius: .7rem; background: #f8f8f1; }
.challenge-card h3 { font-size: 1.12rem; line-height: 1.5; }
.challenge-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .52rem; margin-top: .75rem; }
.challenge-option { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .56rem .65rem; text-align: left; line-height: 1.45; color: var(--ink); background: white; border: 1px solid #bdcfc0; }
.challenge-option:hover:not(:disabled) { border-color: var(--role); background: var(--tint); }
.challenge-option:disabled { opacity: 1; }
.answer-number { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; flex: none; border-radius: .42rem; color: var(--role); background: var(--tint); font-size: .88rem; font-weight: 800; }
.challenge-option.wrong-choice { border-color: #b26d49; background: #fff1e8; }
.challenge-option.correct-choice { border-color: #3d8058; background: #e5f4e8; }
.challenge-option.correct-choice .answer-number { color: white; background: #367550; }
.feedback { margin-top: .5rem; padding: .4rem .55rem; border-radius: .35rem; background: #fcece2; color: #703811; }
.feedback.correct { background: #e7f2e9; color: #154a34; }
.checks { display: grid; gap: .48rem; }
.check-row { display: flex; min-height: 44px; align-items: center; gap: .62rem; border: 1px solid #dedbd2; background: white; border-radius: .5rem; padding: .36rem .6rem; cursor: pointer; }
.check-row:has(:checked) { border-color: #9bbfa9; background: #edf6ef; }
.check-row:has(:disabled) { opacity: .65; cursor: default; }
.step-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .55rem; margin-top: .8rem; }
.step-nav div { display: flex; flex-wrap: wrap; gap: .42rem; }
.mission-celebration { display: grid; grid-template-columns: 5.15rem 1fr auto; align-items: center; gap: .64rem; padding: .48rem .72rem; min-height: 5.2rem; border: 1px solid #d7ba72; border-radius: .65rem; color: #3f310d; background: radial-gradient(ellipse at 7% 50%, #fff9e5 0 15%, transparent 49%), linear-gradient(125deg, #f5db99, #fff4ce 54%, #ecdfb2); overflow: hidden; }
.celebration-art { position: relative; display: grid; place-items: center; }
.celebration-art .character { width: 100%; }
.celebration-art .icon { position: absolute; color: #b5771d; fill: #f0bb5d; width: 1.05rem; height: 1.05rem; left: 4%; top: 14%; transform: rotate(10deg); }
.celebration-art .icon:last-child { left: auto; top: auto; right: 1%; bottom: 17%; transform: rotate(-14deg) scale(.75); }
.celebration-copy strong { display: block; font-size: 1.09rem; line-height: 1.35; letter-spacing: -.04em; }
.celebration-copy p { margin-top: .23rem; font-size: .87rem; }
.completion-stamp { display: inline-flex; align-items: center; gap: .18rem; padding: .25rem .42rem; border: 3px double #376e51; border-radius: .4rem; background: #fff9dd; color: #235542; transform: rotate(-8deg); font-weight: 900; white-space: nowrap; }
.celebrate-now .completion-stamp { animation: stamp-in .38s cubic-bezier(.22,.65,.36,1.4) both; }
.celebrate-now .celebration-art .icon { animation: spark-in .5s ease both; }
@keyframes stamp-in { from { transform: scale(1.5) rotate(-17deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
@keyframes spark-in { from { opacity: 0; scale: .4; } 55% { opacity: 1; scale: 1.25; } to { opacity: 1; scale: 1; } }
.completion { max-width: 46rem; margin-inline: auto; padding: clamp(.9rem, 4vw, 2rem); background: #fffaf0; border: 1px solid #e2d2ae; border-radius: 1rem; text-align: center; overflow: hidden; }
.completion .intro-actions { justify-content: center; }
.completion-art { display: flex; justify-content: center; position: relative; margin: .5rem auto; }
.completion-art .character { width: min(20%, 6rem); }
.completion-art .confetti { position: absolute; width: 9px; height: 16px; top: 30%; left: var(--x); background: var(--color); border-radius: 3px; opacity: 0; animation: confetti .75s var(--delay) ease-out both; }
@keyframes confetti { 0% { opacity: 0; transform: translateY(35px) rotate(0); } 25% { opacity: 1; } 100% { opacity: 1; transform: translateY(-12px) rotate(32deg); } }
.completion-card { position: relative; max-width: 33rem; margin: .8rem auto; padding: 1rem clamp(.8rem, 3vw, 1.6rem); border: 6px double #b89957; border-radius: .85rem; background: radial-gradient(ellipse at top, #fff0c9, transparent 55%), #fffdf7; box-shadow: 0 5px 0 #99682620; }
.certificate-medal { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; margin: -.14rem auto .55rem; border-radius: 50%; color: #2c5e45; background: #fff3c6; border: 4px double #aa853e; font-size: 1.45rem; }
.completion-card h2 { margin: .24rem 0 .62rem; }
.completion-card dl { display: grid; grid-template-columns: auto 1fr; text-align: left; gap: .22rem .7rem; margin: .45rem 0 .64rem; padding: .58rem; border-block: 1px solid #d8caa7; }
.completion-card dt { font-weight: 900; }
.completion-card dd { margin: 0; overflow-wrap: anywhere; }
dialog { color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 1.02rem; width: min(52rem, 100% - 1.3rem); max-height: calc(100% - 1.3rem); padding: 0; box-shadow: 0 16px 48px #1c2e3c52; }
dialog::backdrop { background: #16233aa8; }
.dialog-top { position: sticky; top: 0; z-index: 1; padding: .75rem .9rem .62rem; background: #f5f3e8; border-bottom: 1px solid var(--line); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.dialog-head h2 { display: inline-flex; align-items: center; gap: .35rem; }
.tool-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: .62rem 0 0; }
.tool-tabs button { background: #fffdf6; }
#tool-content { padding: .9rem; }
textarea { display: block; resize: vertical; min-height: 8rem; width: 100%; background: #fff; color: var(--ink); border: 1px solid #a7aba9; border-radius: .48rem; padding: .55rem; }
.byte-output { display: block; color: var(--navy); font-weight: 900; padding: .36rem .62rem; border: 1px solid #d2dfeb; background: #eef3fa; border-radius: .45rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: .61rem; }
table { border-collapse: collapse; width: 100%; table-layout: fixed; }
th, td { text-align: left; padding: .42rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { background: #eaf0f7; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f6f7f3; }
table:has(th:nth-child(3)) :is(th, td):nth-child(1) { width: 27%; }
table:has(th:nth-child(3)) :is(th, td):nth-child(2) { width: 19%; }
.pitfalls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding: 0; list-style: none; }
.pitfalls li { background: #fff1e8; border: 1px solid #efd9ca; border-radius: .5rem; padding: .45rem .62rem; overflow-wrap: anywhere; }
.pitfalls strong, .pitfalls span { display: block; }
.pitfalls strong { color: #803611; }
.inline-notice { border: 1px solid #efc98b; padding: .58rem .72rem; border-radius: .45rem; background: #fff0d7; margin-bottom: .65rem; color: #654610; }
@media (max-width: 52rem) {
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: 24rem; }
  .mission-route { gap: .58rem; }
  .route-stop[data-route="right"]::after, .route-stop[data-route="left"]::after { width: calc(100% + .58rem); }
  .route-stop[data-route="bend"]::after { height: calc(100% + .58rem); }
}
@media (max-width: 37rem) {
  .wrap { width: calc(100% - 1.45rem); }
  main { padding-block: 1.2rem 2rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 13.8rem; grid-template-rows: 1fr auto; }
  .desk-main .character { width: 8.3rem; }
  .hero-body { padding: 1.2rem; }
  .quick-tools { grid-template-columns: 1fr; }
  .quick-tool { min-height: 3.45rem; }
  .footer-row, .map-top, .mission-head { align-items: start; }
  .map-top, .mission-head { grid-template-columns: 1fr; }
  .map-control-strip { grid-template-columns: 1fr; gap: .5rem; }
  .map-top > button, .mission-head > button { justify-self: start; }
  .tool-button { padding-inline: .55rem; }
  .content-grid, .pitfalls, .challenge-options { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-route { grid-template-columns: 1fr; }
  .route-stop { grid-column: auto; grid-row: auto; }
  .route-stop:not([data-route="end"])::after { top: 50%; left: 1.21rem; right: auto; width: 0; height: calc(100% + .58rem); border-top: 0; border-left: 3px dotted color-mix(in srgb, var(--role) 56%, #b1c6bc); }
  .mission-card { min-height: 3.8rem; }
  .mission-celebration { grid-template-columns: 3.3rem 1fr auto; gap: .35rem; }
  .completion-stamp { font-size: .81rem; }
  .tool-tabs button { flex-direction: column; line-height: 1.25; font-size: .81rem; }
  .menu-row { flex-wrap: wrap; }
}
@media (max-width: 25rem) { .brand small { font-size: .68rem; } .footer-row { flex-wrap: wrap; } }
@media (max-width: 22rem) { .header-row { gap: .4rem; } .header-actions .tool-button { font-size: .8rem; padding-inline: .38rem; } .brand { gap: .4rem; } .brand-mark { width: 2.25rem; height: 2.25rem; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body:has(.completion) { background: #fff; }
  body:has(.completion) :is(.site-header, .site-footer, .completion .intro-actions) { display: none !important; }
  body:has(.completion) main { width: 100%; padding: 0; }
  .completion { margin: 0 auto; border: 0; break-inside: avoid; }
  .completion-card { print-color-adjust: exact; }
  .completion-art .confetti { animation: none; opacity: 1; }
}
/* The teacher's desk and the stamp trail share a paper and ink palette. */
:root {
  --desk-ink: #42322e;
  --wood: #ce9d72;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='490' height='126' viewBox='0 0 490 126'%3E%3Cg fill='none' stroke='%23905b38' opacity='.29' stroke-linecap='round'%3E%3Cpath d='M-6 19C58 9 89 30 163 18s121-8 172-5 105-9 164-2M-3 25c63-10 109 8 161-1m83 44c68-11 149 5 250-10M0 60q56-9 102-4m35 53c104-14 92 1 140-4m102 10c34-5 71-6 114-11'/%3E%3Cpath d='M49 82q41-13 76-8 28 6 60 0m-121 7q28-8 53-5m293-39q24-8 48-3-21 7-48 3Z'/%3E%3C/g%3E%3C/svg%3E");
}
body { background: radial-gradient(ellipse at 82% 2%,#f8e8c8,transparent 38rem),#f7f1e5; }
.site-header { border-bottom: 2px solid #cbbb9e; background: #fff9eb; }
.hero { border: 2px solid var(--desk-ink); background: #fff9e9; box-shadow: 0 6px 0 #bba27e; }
.hero-body { position: relative; }
.hero-body .display-title { color: #363337; }
.hero-art { display:block; min-height: 22rem; padding:0; background:#eae7d4; border-left:2px solid var(--desk-ink); }
.hero-art::before { display:none; }
.desk-scene { inset:0; width:100%; height:100%; }
.desk-scene use { pointer-events:none; }
.desk-main { position:absolute; inset:7% 4% 29%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:0; }
.desk-main .character { width: clamp(8rem,14vw,12.5rem); height:58%; transform:rotate(-4deg); }
.hero-art .speech { position:relative; width:fit-content; max-width:96%; border:2px solid #483831; border-radius:1rem 1rem 1rem .25rem; padding:.48rem .8rem; background:#fffae9; box-shadow:2px 3px #48383133; }
.hero-art .speech::after { content:""; position:absolute; bottom:-.48rem; left:36%; width:.75rem; height:.75rem; transform:rotate(45deg); border:solid #483831; border-width:0 2px 2px 0; background:#fffae9; }
.desk-stickers { position:absolute; bottom:4%; inset-inline:2%; gap:0; }
.desk-sticker, .desk-sticker:nth-child(even) { background:none; border:0; border-radius:0; box-shadow:none; transform:none; width:22%; }
.desk-sticker:nth-child(2n) { transform:translateY(-4%); }
.desk-sticker:hover { transform:translateY(-6px) rotate(-4deg); }
.setup-desk { background: #fffaf0; padding: clamp(1rem,3vw,2rem); border:2px solid #59483e; border-radius:1.2rem; box-shadow:4px 5px 0 #cfb696; }
.setup-desk .page-heading > .character { float:right; width:5.5rem; }
.setup-desk .page-heading::after { content:""; display:block; clear:both; }
.role-option { border:2px solid #4c3e38; border-radius:.9rem; box-shadow:0 4px #baa183; }
.role-art { position:relative; padding:.35rem .3rem 2.45rem; background:radial-gradient(ellipse at 50% 55%, #fff4d4 0%, var(--tint) 59%); border-bottom:2px solid #56483d; }
.role-art::before { content:""; position:absolute; inset:.35rem; border:1px dashed color-mix(in srgb,var(--role) 32%,transparent); border-radius:.55rem; pointer-events:none; }
.nameplate { position:absolute; bottom:.4rem; padding:.1rem .9rem; border-radius:1rem; background:var(--role); color:white; font-size:1.16rem; line-height:1.4; }
#restart-dialog { width:min(26rem,calc(100% - 1.5rem)); padding:1.35rem; border:2px solid #59483e; background:#fffaf0; word-break:keep-all; }
#restart-help { margin-top:.65rem; color:var(--muted); }
#restart-dialog .intro-actions { justify-content:flex-end; margin-top:1rem; }
.role-caption { background:#fffaf0; word-break:keep-all; }
.role-option:has(:checked) .role-caption { background:var(--tint); }
.map-board { position:relative; isolation:isolate; overflow:hidden; padding:.8rem clamp(.7rem,3vw,2.15rem) 1.2rem; border:3px solid #584131; border-radius:1.15rem; background:var(--grain) 0 0/490px 126px repeat,var(--wood); box-shadow:inset 0 0 0 4px #dfb58b,0 5px 0 #916b52; }
.map-group { position:relative; padding:.45rem 0 .65rem; }
.map-group + .map-group { border-top:1px solid #956a494a; }
.map-group + .map-group::before,.map-group:not(:last-child)::after { display:none; }
.group-heading { width:fit-content; max-width:100%; padding:.1rem .82rem .1rem .2rem; background:#ffedcc; border:2px solid #69523e; border-radius:1.5rem .6rem .6rem 1.5rem; min-height:2.25rem; box-shadow:1px 2px #9a714f; }
.group-heading h2 { font-size:1.05rem; overflow-wrap:anywhere; }
.group-character { position:static; width:2.1rem; height:2.1rem; border-radius:50%; box-shadow:none; }
.trail-field { position:relative; }
.map-trail { pointer-events:none; position:absolute; inset:0; width:100%; height:100%; }
.mission-route { position:relative; grid-auto-rows:minmax(9.2rem,auto); gap:0; padding:0; }
.route-stop, .route-stop:not([data-route="end"]) { display:flex; align-items:start; justify-content:center; padding:var(--offset) .12rem 0; }
.route-stop::after { display:none; }
.map-board .mission-card { display:flex; flex-direction:column; justify-content:flex-start; align-items:center; gap:.24rem; width:100%; height:auto; padding:.3rem .15rem; background:transparent; border:0; box-shadow:none; text-align:center; border-radius:.85rem; color:#372c28; }
.map-board .mission-card:hover { transform:translateY(-3px); }
.map-board .route-marker { position:relative; margin-top:.72rem; width:3.55rem; height:2.15rem; font-size:.98rem; border:2px solid #554235; border-radius:50%; background:#d6c3a7; color:#4e4137; box-shadow:inset 0 0 0 3px #e7d6bb,inset 0 0 0 5px #ae9c83,0 .26rem #a18a71,0 .39rem 0 1px #594638,0 .58rem .12rem #593d2835; }
.map-board .route-marker.done { color:#fff8e5; background:#bb5a47; box-shadow:inset 0 0 0 3px #e59a7b,inset 0 0 0 5px #ac503e,0 .26rem #a04b39,0 .39rem 0 1px #594638,0 .58rem .12rem #593d2835; }
.map-board .route-marker.done::before { content:""; position:absolute; width:.83rem; height:.72rem; left:50%; bottom:94%; transform:translateX(-50%); background:radial-gradient(at 35% 28%,#ed9679,#ae4c39 73%); border:2px solid #694235; border-radius:70% 70% 42% 42%; }
.map-board .route-next .route-marker { background:#ffeca6; color:#493629; outline:2px solid #fff0ad; outline-offset:3px; box-shadow:inset 0 0 0 3px #fff7d5,inset 0 0 0 5px #daaa52,0 .28rem #c29b58,0 .4rem 0 1px #654b30,0 0 1.1rem .4rem #fff4a8; }
.map-board .route-next .route-marker::before {
  content:""; position:absolute; left:50%; bottom:calc(100% + .3rem);
  width:1.85rem; height:1.85rem; transform:translateX(-50%); pointer-events:none;
  background:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11 3h10v11h7L16 29 4 14h7z' fill='%23c8322c' stroke='%23fff9e9' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter:drop-shadow(0 2px 1px #643525); animation:waypoint 1.7s ease-in-out infinite;
}
@keyframes waypoint { 0%,100% {transform:translate(-50%,0)} 50% {transform:translate(-50%,-3px)} }
.map-board .mission-card-body { justify-items:center; gap:.12rem; margin-top:.43rem; padding:.25rem .53rem; border:1px solid #866949; border-radius:.4rem; background:#fff3d9; box-shadow:0 2px #9d7757; max-width:95%; }
.map-board .mission-card strong { font-size:.9rem; line-height:1.35; word-break:keep-all; }
.map-board .status { background:transparent; color:#675846; font-size:.72rem; }
.map-board .route-next .status { color:#69481b; }
.map-board .status.done { color:#8d392b; }
.progress-box { background:#fff9e8; border-color:#b69c77; }
.map-control-strip { align-items:stretch; }
.map-control-strip > * { margin:0; }
.map-destination { background:#fff1d1; border-color:#c9ac79; }
@media (max-width:37rem) {
 .hero-art { min-height:16.5rem; border-left:0; border-top:2px solid var(--desk-ink); }
 .desk-main .character { width:7rem; }
 .desk-sticker { max-width:4.4rem; }
 .setup-desk .page-heading > .character { width:3.7rem; }
 .map-trail { display:none; }
 .mission-route { grid-template-columns:1fr; grid-auto-rows:auto; padding:.4rem 0; }
 .mission-route::before { content:""; position:absolute; left:2.05rem; top:2.3rem; bottom:2.4rem; width:.62rem; border-inline:1px solid #986e4a; background:#f9dfaa; }
 .route-stop, .route-stop:not([data-route="end"]) { padding:0; }
 .map-board .mission-card { flex-direction:row; text-align:left; min-height:4.55rem; gap:.73rem; padding:.35rem .26rem; }
 .map-board .route-marker { margin:0 .15rem; width:3.2rem; height:2rem; }
 .map-board .route-next .mission-card { padding-top:2rem; }
 .map-board .mission-card-body { margin:0; justify-items:start; max-width:calc(100% - 4.45rem); }
}
@font-face { font-family:"BM Jua"; src:url("BMJUA.ttf") format("truetype"); font-weight:400; font-display:swap; }
:root { font-family:"BM Jua","Malgun Gothic",sans-serif; font-synthesis:none; }
body { font-weight:400; }
.hero-body .lead,.step-panel,.speech,.challenge-option { line-height:1.65; }
.title-art { display:block; width:auto; max-width:100%; overflow:visible; }
.title-hero { height:auto; width:min(100%,26rem); }
.title-map { height:auto; width:min(100%,16rem); }
.title-tools { height:2.85rem; }
.title-setup { height:2.45rem; }
.title-drawer { height:2.6rem; }
.title-award { margin:auto; height:auto; width:min(100%,29rem); }
.hero-body .display-title { margin:.5rem 0 .2rem; }
.map-top .display-title { margin:.4rem 0; }
.quick-panel h2 { margin-bottom:.15rem; }
.hero-art .speech {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 83' preserveAspectRatio='none'%3E%3Cpath d='M38 6C71 2 241 2 278 5Q316 6 316 32Q317 58 286 61Q245 65 174 63Q167 71 155 77Q159 70 158 63Q73 67 35 62Q4 59 4 35Q3 11 38 6Z' fill='%23fffae9' stroke='%23483831' stroke-width='2.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  justify-content:center; min-width:min(98%,15rem); padding:.75rem 1.12rem 1.36rem; border:0; box-shadow:none; border-radius:0; gap:0 .35rem; font-size:.93rem; line-height:1.32; filter:drop-shadow(1px 2px 0 #64492e20);
}
.hero-art .speech::after { display:none; }
.desk-main { gap:.04rem; }
.desk-main .character { transform:none; }
.stamp-stage { position:relative; display:inline-grid; place-items:center; min-width:3.2rem; min-height:3.1rem; }
.completion-stamp { border:4px double #a34838; border-radius:45%; padding:.36rem .42rem; color:#9a3b2f; background:transparent; line-height:1.1; }
.stamp-handle { position:absolute; z-index:1; width:3.2rem; height:2.85rem; pointer-events:none; opacity:0; }
.celebrate-now .stamp-handle { animation:press-seal .8s ease-in-out both; }
.celebrate-now .completion-stamp { animation:ink-mark .8s both; }
@keyframes press-seal { 0% {opacity:0; transform:translate(12px,-42px) rotate(12deg)} 20% {opacity:1;transform:translate(4px,-21px) rotate(4deg)} 43%,55% {opacity:1;transform:translate(0,2px) rotate(-7deg)} 84%,100% {opacity:0;transform:translate(7px,-32px) rotate(2deg)} }
@keyframes ink-mark { 0%,42% {opacity:0;transform:scale(.87) rotate(-8deg)} 55% {opacity:1;transform:scale(1.1,.95) rotate(-8deg)} 100% {opacity:1;transform:scale(1) rotate(-8deg)} }
.step-panel { border:2px solid #9f8967; border-top:5px solid var(--role); background:#fffaf0; box-shadow:0 4px #d3c1a5; }
@media (prefers-reduced-motion:reduce) { .celebrate-now .stamp-handle { display:none; } }
