:root {
  color-scheme: light;
  --ink: #352d59;
  --ink-soft: #514a76;
  --muted: #817b9c;
  --paper: #fffdfd;
  --canvas: #fff8fb;
  --pink: #ff9fbd;
  --pink-deep: #e96f9c;
  --coral: #ff887f;
  --lilac: #c9c2fb;
  --lilac-deep: #7567bd;
  --mint: #d5f3e6;
  --mint-deep: #43856d;
  --butter: #ffe8a8;
  --line: #f0e7f1;
  --shadow-soft: 0 10px 30px rgba(72, 56, 108, .075);
  --shadow-card: 0 18px 45px rgba(72, 56, 108, .10);
  --shadow-lift: 0 18px 35px rgba(93, 67, 131, .15);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 15px;
  --font: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 2% 9%, rgba(255, 220, 189, .56) 0 8rem, transparent 8.1rem),
    radial-gradient(ellipse at 97% 36%, rgba(225, 218, 255, .42) 0 10rem, transparent 10.1rem),
    linear-gradient(180deg, #fff9ef 0, #fff8fc 45rem, #f9f7ff 100%);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(rgba(177, 145, 199, .42) .8px, transparent .9px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0, transparent 72%);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible {
  outline: 3px solid #8b7ce0;
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.app-shell {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: 18px 0 30px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 17px;
  background: linear-gradient(145deg, #ffe5a8, #ffc6c3);
  box-shadow: 0 5px 0 #edb7c2, 0 9px 19px rgba(228, 153, 162, .18);
  color: #93664e;
  font-size: 24px;
  transition: transform .25s ease;
}
.brand:hover .brand-mark { transform: rotate(-9deg) scale(1.06); }
.brand strong { display: block; font-size: 15px; font-weight: 1000; letter-spacing: -.3px; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.collection-meter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}
.meter-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 6px 18px rgba(69, 55, 106, .07);
  color: #886324;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}
.meter-chip:first-child span:first-child { color: #edae3f; font-size: 16px; }
.level-chip { border-color: #e8e3ff; background: #f1efff; color: #625b98; }
.level-chip > span:first-child { color: #9b8bdb; }

.welcome-banner {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 270px;
  grid-template-columns: minmax(0, 1fr) 265px;
  align-items: center;
  overflow: hidden;
  padding: 30px 42px;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 36px;
  background: linear-gradient(112deg, #fff0db 0%, #ffe3ec 52%, #ece7ff 100%);
  box-shadow: var(--shadow-card);
}
.welcome-banner::before, .welcome-banner::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}
.welcome-banner::before {
  inset: 0;
  opacity: .32;
  background-image: radial-gradient(rgba(255, 255, 255, .95) 1.2px, transparent 1.4px);
  background-size: 20px 20px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
}
.welcome-banner::after {
  top: -78px;
  right: 235px;
  width: 205px;
  height: 205px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, .1), 0 0 0 44px rgba(255, 255, 255, .08);
}
.banner-copy { position: relative; z-index: 1; max-width: 640px; }
.eyebrow {
  margin: 0 0 8px;
  color: #a36e91;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 1.25px;
}
.sparkle { color: #e5a738; font-size: 16px; }
.welcome-banner h1 {
  margin: 0 0 12px;
  color: #332e57;
  font-size: clamp(31px, 4.2vw, 47px);
  font-weight: 1000;
  letter-spacing: -1.6px;
  line-height: 1.06;
}
.welcome-banner .banner-copy > p:not(.eyebrow) {
  max-width: 565px;
  margin: 0;
  color: #696482;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}
.banner-progress { max-width: 400px; margin-top: 20px; }
.progress-label { display: block; margin-bottom: 7px; color: #706989; font-size: 11px; font-weight: 900; }
.progress-track {
  display: block;
  height: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8ca6, #ffbb70, #b49af4);
  box-shadow: 0 0 12px rgba(248, 139, 166, .4);
  transition: width .55s cubic-bezier(.2, .8, .2, 1);
}
.mascot-stage {
  position: relative;
  display: flex;
  min-height: 220px;
  align-self: stretch;
  align-items: flex-end;
  justify-content: center;
}
.mascot-glow {
  position: absolute;
  right: 22px;
  bottom: 9px;
  width: 188px;
  height: 188px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffe3be, #ffc7dd 65%, #e5d8ff);
  box-shadow: 0 0 0 13px rgba(255, 255, 255, .23), 0 17px 35px rgba(187, 124, 164, .12);
}
.mascot {
  position: relative;
  z-index: 1;
  width: auto;
  height: 235px;
  filter: drop-shadow(0 10px 3px rgba(56, 51, 81, .12));
  transform: translateY(11px);
  animation: mascot-bob 4s ease-in-out infinite;
}
.speech-bubble {
  position: absolute;
  z-index: 2;
  top: 17px;
  right: -1px;
  max-width: 174px;
  padding: 11px 14px;
  transform: rotate(2deg);
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 18px 18px 18px 7px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 9px 24px rgba(75, 61, 108, .12);
  color: #696583;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}
.speech-bubble::after {
  position: absolute;
  bottom: -8px;
  left: 21px;
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  background: white;
  content: "";
}
.speech-bubble strong { color: #d85f8a; font-size: 12px; }
.banner-deco { position: absolute; color: #f199ad; pointer-events: none; }
.deco-one { top: 23px; right: 298px; font-size: 34px; animation: twinkle 3.4s ease-in-out infinite; }
.deco-two { right: 29px; bottom: 23px; color: #e8ac43; font-size: 31px; animation: twinkle 2.8s ease-in-out infinite reverse; }

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(330px, .76fr);
  align-items: start;
  gap: 20px;
  margin-top: 21px;
}
.panel {
  border: 1px solid rgba(238, 229, 242, .94);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 253, .94);
  box-shadow: var(--shadow-soft);
  transition: box-shadow .22s ease, transform .22s ease;
}
.panel:hover { box-shadow: var(--shadow-card); }
.mission-panel { padding: 25px 26px 22px; }
.mission-head, .panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mission-head .eyebrow { color: #cd668c; }
.mission-panel h2, .path-panel h2, .collection-panel h2 { margin: 0; font-weight: 1000; letter-spacing: -.55px; line-height: 1.15; }
.mission-panel h2 { color: #38315e; font-size: 27px; }
.mission-stamp {
  display: grid;
  width: 49px;
  height: 49px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #f2ddec;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffe1ec, #efe4ff);
  box-shadow: 0 5px 0 #ead9f0;
  color: #9d5e9c;
  font-family: Georgia, serif;
  font-size: 28px;
}
.mission-intro { max-width: 670px; margin: 13px 0 15px; color: #6b6685; font-size: 14px; font-weight: 700; line-height: 1.55; }
.lesson-rule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e6e1ff;
  border-radius: 17px;
  background: linear-gradient(110deg, #f6f4ff, #fff4f8);
  color: #5c5880;
  font-size: 13px;
  font-weight: 700;
  animation: pop-in .22s ease both;
}
.lesson-rule[hidden] { display: none; }
.lesson-rule p { margin: 0; }
.rule-icon { font-size: 18px; }
.board-area { display: flex; flex-direction: column; align-items: center; }
.board-frame {
  width: min(100%, 540px);
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 19px;
  background: linear-gradient(145deg, #554c7f, #71649f 54%, #dd91b5);
  box-shadow: 0 7px 0 #443b6d, 0 15px 27px rgba(57, 48, 93, .17);
}
.board {
  display: grid;
  width: 100%;
  overflow: hidden;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 2px solid #443b6d;
  border-radius: 11px;
  background: #fff1dc;
}
.square {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: filter .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.square.light { background: #fff3dd; }
.square.dark { background: #b9b5dd; }
.square:hover { z-index: 1; filter: brightness(1.08) saturate(1.05); }
.square:focus-visible { z-index: 3; outline: 3px solid #ff719d; outline-offset: -4px; }
.square[aria-pressed="true"] { z-index: 1; box-shadow: inset 0 0 0 4px #ff82a6; }
.square.selected::after {
  position: absolute;
  z-index: 2;
  inset: 3px;
  border: 3px solid #ff789d;
  border-radius: 7px;
  content: "";
  pointer-events: none;
}
.square.target-hint { z-index: 2; }
.square.target-hint::before {
  position: absolute;
  width: 36%;
  height: 36%;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: #ffbd62;
  box-shadow: 0 0 0 5px rgba(255, 189, 98, .37), 0 4px 12px rgba(112, 75, 34, .2);
  content: "";
  animation: pulse 1.1s ease-in-out infinite;
}
.square.king-threatened { box-shadow: inset 0 0 0 4px rgba(239, 87, 122, .72); }
.check-mark { position: absolute; z-index: 3; top: 4px; right: 4px; padding: 1px 4px; border-radius: 7px; background: #e96f83; color: #fff; font-size: 8px; font-weight: 1000; line-height: 1.3; pointer-events: none; }
.piece {
  position: relative;
  z-index: 1;
  color: #fffdf7;
  font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2", serif;
  font-size: clamp(22px, 5vw, 43px);
  line-height: 1;
  pointer-events: none;
  text-shadow: -1px -1px 0 #302a53, 1px -1px 0 #302a53, -1px 1px 0 #302a53, 1px 1px 0 #302a53, 0 3px 4px rgba(42, 35, 78, .3);
}
.piece.black-piece {
  color: #342d57;
  text-shadow: -1px -1px 0 #fff2dd, 1px -1px 0 #fff2dd, -1px 1px 0 #fff2dd, 1px 1px 0 #fff2dd, 0 3px 4px rgba(42, 35, 78, .2);
}
.coord { position: absolute; z-index: 2; top: 3px; left: 4px; color: rgba(53, 45, 89, .65); font-size: 9px; font-weight: 1000; line-height: 1; pointer-events: none; }
.square.dark .coord { color: rgba(255, 255, 255, .95); }
.board-note { display: flex; align-items: center; gap: 9px; margin-top: 15px; color: #817b9c; font-size: 12px; font-weight: 800; text-align: center; }
.note-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #7bc9a8; box-shadow: 0 0 0 4px #e2f5ea; }
.answer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.answer-choice { display: flex; min-height: 58px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 9px 12px; border: 1.5px solid #e7e0f1; border-radius: 15px; background: linear-gradient(135deg, #fff, #f6f2ff); color: #504770; cursor: pointer; text-align: left; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.answer-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: #c9bdf1; box-shadow: 0 7px 15px rgba(72, 56, 108, .1); }
.answer-choice:disabled { cursor: default; opacity: .76; }
.answer-choice strong { font-size: 13px; font-weight: 1000; }
.answer-choice small { color: #817b9c; font-size: 10px; font-weight: 700; }
.game-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 1000;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 17px rgba(65, 51, 104, .12); filter: saturate(1.08); }
.button:active { transform: translateY(0) scale(.98); }
.button-soft { border-color: #ffe4b9; background: linear-gradient(135deg, #fff0ce, #ffebf0); color: #8f6429; }
.button-outline { border-color: #e7e2f1; background: #fff; color: #625d83; }
.button-primary { background: linear-gradient(105deg, #ed6f9d, #ff968d); box-shadow: 0 5px 0 #d85f89; color: white; }
.feedback {
  display: flex;
  min-height: 49px;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dfefe4;
  border-radius: 16px;
  background: linear-gradient(100deg, #eff9e9, #effaf3);
  color: #63765b;
  font-size: 13px;
  font-weight: 800;
  transition: background .2s ease, border-color .2s ease;
}
.feedback-face { font-size: 19px; line-height: 1; }
.feedback.is-wrong { border-color: #ffd9db; background: #fff0f2; color: #a4526c; }
.feedback.is-success { border-color: #ccebd9; background: #e9f8ee; color: #3f7657; }
.mission-complete-actions { margin-top: 14px; }
.mission-complete-actions[hidden] { display: none; }

.side-column { display: grid; gap: 16px; }
.path-panel, .collection-panel { padding: 20px 20px 18px; }
.path-panel h2, .collection-panel h2 { color: #3c355f; font-size: 19px; }
.step-count {
  display: inline-flex;
  min-width: 44px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #e7e0ff;
  border-radius: 13px;
  background: linear-gradient(145deg, #f4f0ff, #fbeaf5);
  color: #7866b0;
  font-size: 12px;
  font-weight: 1000;
}
.path-helper { margin: 9px 0 12px; color: #837d9b; font-size: 12px; font-weight: 700; }
.chapter-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 13px 0 7px; }
.chapter-tab { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 6px 9px; border: 1px solid #e7e1ef; border-radius: 13px; background: #fff; color: #70688a; cursor: pointer; font-size: 11px; font-weight: 1000; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.chapter-tab > span:first-of-type { display: inline-grid; min-width: 19px; height: 19px; place-items: center; border-radius: 7px; background: #f2effb; color: #8275b0; font-size: 9px; }
.chapter-tab.active, .chapter-tab[aria-pressed="true"] { border-color: #ead1e6; background: linear-gradient(105deg, #fff0f5, #f3efff); color: #a45178; }
.chapter-tab:disabled { cursor: not-allowed; opacity: .58; }
.chapter-tab .tab-lock { min-width: 0; height: auto; background: transparent; font-size: 10px; }
.mission-list { position: relative; margin: 0; padding: 0; list-style: none; }
.mission-list::before { position: absolute; top: 19px; bottom: 17px; left: 17px; width: 2px; background: linear-gradient(#ffc5d5, #dcd5f8); content: ""; }
.mission-list li { position: relative; margin: 0; }
.mission-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  gap: 10px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.mission-card:hover:not(:disabled) { transform: translateX(2px); background: #fff5f6; }
.mission-card.active { border-color: #ffe0e9; background: linear-gradient(100deg, #fff1f5, #fff8ed); }
.mission-card:disabled { cursor: not-allowed; opacity: .48; }
.mission-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid white;
  border-radius: 13px;
  background: #eae6ff;
  box-shadow: 0 0 0 1px #e0daf5;
  color: #615c95;
  font-family: "DejaVu Sans", "Segoe UI Symbol", serif;
  font-size: 18px;
}
.mission-card.done .mission-icon { background: #dff4e8; box-shadow: 0 0 0 1px #c9e8d4; color: #478765; }
.mission-card.active .mission-icon { background: #ffe0ac; box-shadow: 0 0 0 1px #f3ce83; color: #8b6133; }
.mission-card.locked .mission-icon { background: #f1edf2; box-shadow: 0 0 0 1px #e6e0e6; color: #9993a0; }
.mission-card-copy { min-width: 0; flex: 1; }
.mission-card-copy strong { display: block; overflow: hidden; color: #484266; font-size: 12px; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.mission-card-copy small { display: block; color: #918ba4; font-size: 10px; font-weight: 700; }
.mission-state { color: #aaa2bd; font-size: 13px; }
.mission-card.done .mission-state { color: #57a378; }
.next-chapter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px dashed #ded7e5;
  border-radius: 15px;
  background: #fbf9fc;
  color: #9991a3;
  font-size: 15px;
}
.next-chapter strong { display: block; color: #746d84; font-size: 11px; }
.next-chapter small { display: block; color: #9993a1; font-size: 10px; }
.next-chapter.chapter-open { border-color: #cde8d9; background: #f0faf3; }
.next-chapter.chapter-open strong { color: #4b8265; }
.collection-copy { margin: 10px 0 13px; color: #7e7895; font-size: 11px; font-weight: 700; line-height: 1.5; }
.sticker-spark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 13px; background: #fff2ca; color: #dfa938; font-size: 19px; }
.sticker-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.sticker {
  display: flex;
  min-width: 0;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px 6px;
  border: 1.5px dashed #cfc9df;
  border-radius: 17px;
  background: linear-gradient(155deg, #fff 8%, #f8f5ff 100%);
  color: #615b7d;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.sticker.earned { border: 1.5px solid #e9bc68; background: linear-gradient(145deg, #fff0c7, #fffaf0 76%); box-shadow: 0 5px 13px rgba(234, 185, 91, .17); color: #68491e; }
.sticker.earned:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 9px 18px rgba(234, 185, 91, .23); }
.sticker.locked .sticker-art { filter: saturate(.76); }
.sticker-art { display: block; width: 62px; height: 62px; flex: 0 0 auto; }
.sticker-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sticker.locked .sticker-art img { filter: grayscale(.8) saturate(.45); opacity: .58; }
.badge-art { display: block; width: 100%; height: 100%; overflow: visible; }
.sticker strong { display: block; max-width: 100%; font-size: 8.3px; font-weight: 1000; line-height: 1.12; overflow-wrap: anywhere; }
.sticker small { display: block; max-width: 100%; padding: 2px 5px; border-radius: 999px; background: rgba(84, 75, 119, .08); color: #615b7d; font-size: 6.8px; font-weight: 1000; line-height: 1.15; }
.sticker.earned small { background: #e8f3d8; color: #456a3d; }
.button-print { width: 100%; background: linear-gradient(110deg, #efedff, #fcecf6); color: #645d92; }
.small-print { display: flex; align-items: center; gap: 7px; padding: 0 5px; color: #8b869d; font-size: 10px; font-weight: 700; }
.small-print span { color: #e987a2; font-size: 15px; }
.reset-link {
  justify-self: start;
  margin: 0 5px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #9993a4;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #d7d1dd;
  text-underline-offset: 3px;
}
.reset-link:hover { color: #c35e88; }
.app-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 0 6px; color: #9993a4; font-size: 10px; font-weight: 800; }
.mobile-break { display: none; }
.print-sheet { display: none; }

@keyframes pulse { 0%, 100% { transform: scale(.88); opacity: .74; } 50% { transform: scale(1.13); opacity: 1; } }
@keyframes pop-in { from { transform: translateY(-5px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes mascot-bob { 0%, 100% { transform: translateY(11px) rotate(-1deg); } 50% { transform: translateY(5px) rotate(1deg); } }
@keyframes twinkle { 0%, 100% { transform: scale(.9) rotate(-7deg); opacity: .78; } 50% { transform: scale(1.12) rotate(8deg); opacity: 1; } }

@media (max-width: 920px) {
  .app-shell { width: min(100% - 30px, 720px); padding-top: 14px; }
  .welcome-banner { min-height: 240px; grid-template-columns: minmax(0, 1fr) 200px; padding: 25px 28px; }
  .mascot { height: 211px; }
  .mascot-glow { right: 9px; width: 163px; height: 163px; }
  .speech-bubble { top: 10px; right: -7px; max-width: 150px; }
  .deco-one { right: 210px; }
  .main-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side-column { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .path-panel { grid-row: span 2; }
  .collection-panel, .small-print, .reset-link { grid-column: 2; }
  .mission-panel { padding: 22px; }
  .board-frame { width: min(100%, 510px); }
}

@media (max-width: 600px) {
  body { font-size: 15px; background: linear-gradient(180deg, #fff8ef 0, #fff8fc 46rem, #f8f6ff 100%); }
  .app-shell { width: 100%; padding: 11px 12px 22px; }
  .topbar { align-items: flex-start; gap: 9px; margin-bottom: 13px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 14px; font-size: 20px; }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 9px; }
  .collection-meter { max-width: 164px; gap: 5px; }
  .meter-chip { min-height: 32px; gap: 4px; padding: 5px 8px; font-size: 9px; }
  .level-chip { max-width: 145px; white-space: normal; line-height: 1.1; }
  .welcome-banner { min-height: 205px; grid-template-columns: minmax(0, 1fr) 112px; padding: 21px 17px; border-radius: 27px; }
  .welcome-banner h1 { margin-bottom: 10px; font-size: clamp(24px, 7vw, 29px); letter-spacing: -.9px; }
  .welcome-banner .banner-copy > p:not(.eyebrow) { max-width: 290px; font-size: 11px; line-height: 1.42; }
  .welcome-banner .eyebrow { margin-bottom: 8px; font-size: 8px; letter-spacing: .9px; }
  .banner-progress { margin-top: 13px; }
  .progress-label { font-size: 9px; }
  .progress-track { height: 8px; }
  .mascot-stage { min-height: 166px; align-self: center; }
  .mascot { height: 158px; transform: translate(7px, 10px); }
  .mascot-glow { right: -7px; bottom: 0; width: 119px; height: 119px; box-shadow: 0 0 0 8px rgba(255, 255, 255, .24); }
  .speech-bubble { top: 0; right: -7px; max-width: 117px; padding: 7px 8px; border-width: 1.5px; border-radius: 14px 14px 14px 6px; font-size: 8px; }
  .speech-bubble strong { font-size: 9px; }
  .welcome-banner::after { top: -75px; right: 70px; width: 135px; height: 135px; }
  .deco-one { top: 11px; right: 116px; font-size: 20px; }
  .deco-two { right: 11px; bottom: 10px; font-size: 21px; }
  .main-grid { gap: 13px; margin-top: 14px; }
  .mission-panel { padding: 17px 14px 15px; border-radius: 22px; }
  .mission-panel h2 { font-size: 21px; }
  .mission-head .eyebrow { font-size: 9px; }
  .mission-stamp { width: 40px; height: 40px; border-radius: 15px; font-size: 24px; }
  .mission-intro { margin: 10px 0 12px; font-size: 12px; line-height: 1.48; }
  .lesson-rule { padding: 10px 11px; font-size: 11px; }
  .board-frame { width: min(100%, 430px); padding: 6px; border-radius: 14px; box-shadow: 0 6px 0 #443b6d, 0 11px 20px rgba(57, 48, 93, .16); }
  .board { border-width: 1px; border-radius: 8px; }
  .piece { font-size: clamp(23px, 8vw, 39px); }
  .square.selected::after { inset: 2px; border-width: 2px; }
  .coord { top: 2px; left: 2px; font-size: 7px; }
  .check-mark { top: 2px; right: 2px; padding: 1px 3px; font-size: 6px; }
  .square.king-threatened { box-shadow: inset 0 0 0 3px rgba(239, 87, 122, .72); }
  .board-note { margin-top: 12px; font-size: 10px; }
  .answer-options { gap: 7px; margin-top: 13px; }
  .answer-choice { min-height: 55px; padding: 8px 9px; border-radius: 12px; }
  .answer-choice strong { font-size: 12px; }
  .answer-choice small { font-size: 9px; }
  .game-controls { gap: 8px; margin-top: 13px; }
  .button { min-height: 42px; padding: 9px 12px; font-size: 11px; }
  .feedback { min-height: 44px; margin-top: 11px; padding: 10px 11px; font-size: 11px; }
  .feedback-face { font-size: 17px; }
  .side-column { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .path-panel, .collection-panel, .small-print, .reset-link { grid-column: auto; }
  .path-panel { grid-row: auto; }
  .path-panel, .collection-panel { padding: 16px; border-radius: 21px; }
  .path-panel h2, .collection-panel h2 { font-size: 18px; }
  .panel-title-row .eyebrow { font-size: 9px; }
  .path-helper { font-size: 11px; }
  .mission-card { min-height: 43px; gap: 9px; padding: 5px; }
  .mission-card-copy strong { font-size: 11px; }
  .mission-card-copy small { font-size: 9px; }
  .mission-icon { width: 32px; height: 32px; }
  .mission-list::before { left: 16px; }
  .chapter-tabs { gap: 6px; margin-top: 11px; }
  .chapter-tab { min-height: 36px; gap: 5px; padding: 5px 6px; font-size: 10px; }
  .collection-copy { margin: 9px 0 11px; font-size: 10px; }
  .sticker-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .sticker { min-height: 104px; border-radius: 14px; gap: 3px; padding: 5px 3px; }
  .sticker-art { width: 55px; height: 55px; }
  .sticker strong { font-size: 7.8px; }
  .sticker small { font-size: 6.4px; }
  .small-print { font-size: 9px; }
  .app-footer { margin-top: 15px; font-size: 9px; }
  .mobile-break { display: block; }
}

@media (max-width: 370px) {
  .app-shell { padding-inline: 9px; }
  .welcome-banner { grid-template-columns: minmax(0, 1fr) 96px; padding: 18px 13px; }
  .welcome-banner h1 { font-size: 23px; }
  .mascot { height: 139px; }
  .mascot-glow { width: 104px; height: 104px; }
  .speech-bubble { max-width: 103px; }
  .mission-panel { padding-inline: 11px; }
  .collection-meter { max-width: 138px; }
  .meter-chip { padding: 5px 6px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  @page { size: A4 portrait; margin: 8mm; }
  html, body { width: 100%; min-height: 0; margin: 0; background: white !important; color: #352d59 !important; }
  .app-shell { display: none !important; }
  .print-sheet { display: block !important; width: 100%; margin: 0; color: #352d59; font-family: var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-header { display: flex; min-height: 23mm; align-items: center; gap: 4mm; margin-bottom: 4mm; padding: 0 0 3mm; border-bottom: 1.2mm solid #f4dce8; }
  .print-emblem { display: grid; width: 19mm; height: 19mm; flex: 0 0 auto; place-items: center; border: 1mm solid #4a4167; border-radius: 6mm; background: #ffe3a5; box-shadow: 0 1.5mm 0 #e7b85d; color: #594473; font-size: 25pt; font-weight: 1000; }
  .print-header-copy { min-width: 0; flex: 1; }
  .print-header p { margin: 0; color: #8a4e73; font-size: 7pt; font-weight: 1000; letter-spacing: 1.2pt; }
  .print-header h1 { margin: 1mm 0 .8mm; color: #352d59; font-size: 19pt; line-height: 1.05; }
  .print-header span { color: #5d5674; font-size: 8pt; font-weight: 800; }
  .print-earned-count { flex: 0 0 auto; padding: 2mm 3mm; border: .5mm solid #b7d696; border-radius: 99px; background: #eff8e5; color: #3f6841; font-size: 7pt; font-weight: 1000; text-align: center; }
  .print-sticker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 54mm; gap: 4mm 5mm; }
  .print-sticker { display: grid; min-width: 0; grid-template-columns: 39mm minmax(0, 1fr); align-items: center; gap: 2mm; overflow: hidden; padding: 2.5mm 3mm; border: .7mm dashed #766a92; border-radius: 4mm; background: #fffaf0; color: #352d59; break-inside: avoid; }
  .print-sticker.is-locked { background: #f7f7ff; }
  .print-sticker-art { display: block; width: 38mm; height: 38mm; }
  .print-sticker-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .print-sticker.is-locked .print-sticker-art img { filter: grayscale(.85) saturate(.4); opacity: .58; }
  .print-sticker-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 1.1mm; }
  .print-sticker-kicker { color: #705879; font-size: 6pt; font-weight: 1000; letter-spacing: .45pt; }
  .print-sticker-copy strong { color: #342d55; font-size: 11pt; font-weight: 1000; line-height: 1.05; }
  .print-sticker-motto { color: #51466d; font-size: 6.2pt; font-weight: 800; line-height: 1.12; }
  .print-sticker-status { margin-top: 1mm; padding: 1mm 1.8mm; border: .35mm solid #8aae69; border-radius: 99px; background: #edf6e3; color: #385d3a; font-size: 5.7pt; font-weight: 1000; line-height: 1.05; }
  .print-sticker.is-locked .print-sticker-status { border-color: #9a8caf; background: #eeeafb; color: #4e4569; }
  .print-footer { display: flex; justify-content: center; align-items: center; gap: 2mm; margin-top: 4mm; padding-top: 2mm; border-top: .4mm solid #d9cde1; color: #504568; font-size: 7.5pt; font-weight: 900; text-align: center; }
  .print-footer span { color: #b44c71; font-size: 12pt; }
}
