:root {
  color-scheme: light;
  --paper: #f7f4eb;
  --surface: #fffcf4;
  --ink: #20362b;
  --muted: #56665b;
  --green: #315740;
  --hover: #234a32;
  --line: #dedfd1;
  --soft-green: #e5ecde;
  --yellow: #efc983;
  --edge: clamp(15px, 3.8vw, 48px);
  --page: 1280px;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", system-ui, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 2% 0%, #e9eddf 0%, transparent 37rem), var(--paper);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3, strong { font-weight: 800; }
:focus-visible { outline: 3px solid #905627; outline-offset: 3px; }
#main:focus { outline: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  z-index: 20;
  position: fixed;
  top: 8px;
  left: 8px;
  padding: 10px 15px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  transform: translateY(-150%);
}
.skip:focus { transform: translateY(0); }

.header {
  background: #f9f7ef;
  border-bottom: 1px solid #dfdfd2;
}
.header-inner {
  width: min(calc(100% - 2 * var(--edge)), var(--page));
  margin-inline: auto;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 7px;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -.065em;
  white-space: nowrap;
}
.brand-sub { font-size: 18px; color: #4a6352; }
.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  margin-right: 4px;
  border-radius: 13px;
  background: #365943;
  box-shadow: inset 0 0 0 1px #1d3e28;
}
.brand-mark i { position: absolute; width: 16px; height: 16px; border-radius: 50%; }
.brand-mark i:first-child {
  background: radial-gradient(at 34% 24%, #fbefd9, #dfcdb1 74%);
  top: 7px;
  left: 8px;
  box-shadow: 0 2px 2px #263d28;
}
.brand-mark i:last-child {
  background: radial-gradient(at 36% 28%, #5a5f51, #17261e 70%);
  bottom: 7px;
  right: 7px;
  border: 1px solid #85927c;
}
.header nav, .header-tools { display: flex; gap: 5px; align-items: center; }
.header nav {
  justify-content: center;
  padding: 3px;
  border: 1px solid #e6e6db;
  border-radius: 999px;
  background: #efefe6;
}
.header nav a, .quiet {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 9px 15px;
  min-height: 41px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}
.header nav a[aria-current] {
  color: #254334;
  background: #fdfdf5;
  box-shadow: 0 1px 4px #273a1d18;
}
.header nav a:hover, .quiet:hover { background: #e4ebde; }
.header-tools { justify-content: flex-end; }
.quiet { gap: 7px; border: 0; background: transparent; padding-inline: 10px; }
.quiet[aria-pressed="true"] { background: #e2ebdc; }
.record { border: 1px solid #d9ded1; padding-inline: 12px; }
.sound-icon {
  display: inline-block;
  width: 15px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(0 33%, 29% 33%, 56% 6%, 56% 94%, 29% 66%, 0 66%, 0 33%, 75% 33%, 75% 0, 87% 0, 87% 100%, 75% 100%, 75% 33%);
  opacity: .65;
}
#sound[aria-pressed="false"] .sound-icon { clip-path: polygon(0 33%, 29% 33%, 58% 6%, 58% 94%, 29% 66%, 0 66%); }

#main, .footer { width: min(calc(100% - 2 * var(--edge)), var(--page)); margin-inline: auto; }
#main { flex: 1 0 auto; }
.home { padding-block: 32px 30px; }
.home-top { display: grid; grid-template-columns: minmax(0, 2.12fr) minmax(290px, 1fr); gap: 18px; }
.surface { border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: 0 4px 15px #23352609; }
.hero {
  display: flex;
  align-items: center;
  min-height: 478px;
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  isolation: isolate;
  background:
    linear-gradient(90deg, #152c20f5, #152b1dcc 26%, #192e1e32 59%, transparent 82%),
    #304634 url("./assets/sol-forest.webp") center 53% / cover no-repeat;
  color: #fff8e7;
  box-shadow: 0 8px 21px #1b2d1d26;
}
.hero-copy { padding: 32px clamp(25px, 4.1vw, 66px); }
.hero h1 {
  font-size: clamp(41px, 5.3vw, 78px);
  line-height: 1.09;
  letter-spacing: -.075em;
  text-wrap: balance;
  text-shadow: 0 2px 12px #0b1e14c0;
}
.hero h1 em { color: #f8d58c; font-style: normal; }
.hero p { font-size: clamp(16px, 1.75vw, 21px); font-weight: 650; margin-top: 19px; color: #f8f3e5; }
.hero-actions { margin-top: 27px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 770;
  line-height: 1.3;
  background: transparent;
  text-align: center;
}
.button.small { min-height: 39px; padding: 7px 12px; }
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.button.primary:hover:not(:disabled) { background: var(--hover); }
.button.outline { border-color: #becaba; background: #fbfaf3; }
.button.outline:hover:not(:disabled), .button.flat:hover:not(:disabled) { background: #e8eee3; }
.button.flat { color: #456151; }
.hero .button { padding: 10px 17px; }
.button.light { color: #20372b; background: #f3d390; border-color: #f3d390; }
.button.light:hover { background: #ffe4ae; }
.button.clear { background: #142b20a8; border-color: #e9ead0ab; color: #fffbee; }
.button.clear:hover { background: #294f37; }
.hero :focus-visible { outline-color: #fff8dc; }

.demo { padding: clamp(17px, 2.15vw, 29px); display: flex; flex-direction: column; }
.demo-head { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-bottom: 13px; }
.eyebrow { display: block; font-size: 13px; font-weight: 790; color: #577460; letter-spacing: .015em; }
.demo h2 { font-size: clamp(22px, 2.35vw, 30px); letter-spacing: -.045em; line-height: 1.27; margin-top: 2px; }
.turn-dot, .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 750;
  color: #365143;
  background: #e8eee1;
}
.small-stone {
  display: inline-block;
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  vertical-align: -.15em;
}
.small-stone.black, .stone.black { background: radial-gradient(circle at 35% 26%, #666962 0%, #383f39 28%, #141b19 70%); }
.small-stone.white, .stone.white { background: radial-gradient(circle at 35% 24%, #fff 0%, #f5f0df 42%, #dfd1b5 82%); }
.small-stone.black { box-shadow: inset 0 0 0 1px #171d19, 0 1px 1px #28392949; }
.small-stone.white { box-shadow: inset 0 0 0 1px #b8af98, 0 1px 1px #413b2f36; }
.demo .board-shell { align-self: center; max-width: 302px; }
.demo-prompt { min-height: 45px; margin-top: 13px; font-size: 14px; color: #455c4e; font-weight: 650; }
.demo-actions { display: flex; gap: 4px; align-items: center; margin: auto 0 -1px; padding-top: 2px; }
.learning { margin-top: 31px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.section-head h2 { font-size: clamp(25px, 3vw, 33px); letter-spacing: -.055em; }
.section-head > span { color: var(--muted); font-size: 13.5px; font-weight: 730; }
.course-grid, .mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.course-card {
  --card-background: #e5eddd;
  --card-border: #d1decd;
  --card-ink: #325840;
  --icon-background: #d0dfca;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 17px;
  background: var(--card-background);
  border: 1px solid var(--card-border);
  padding: 17px 18px 15px;
  transition: transform 150ms, box-shadow 150ms;
}
.course-card:hover, .puzzle-card:hover, .unit:hover { transform: translateY(-2px); box-shadow: 0 7px 17px #26372615; }
.course-card.strategy { --card-background: #f5e8cd; --card-border: #e8dabc; --card-ink: #6a4e27; --icon-background: #ecdbb3; }
.course-card.advanced { --card-background: #e6e8dd; --card-border: #d7dbce; --card-ink: #4b5546; --icon-background: #d9dfce; }
.course-card-top, .course-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-icon {
  position: relative;
  display: inline-block;
  flex: none;
  width: 52px;
  aspect-ratio: 1;
  border-radius: 13px;
  background: var(--icon-background, #dbe6d7);
}
.course-icon i {
  position: absolute;
  width: 31%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(at 31% 25%, #6a7060, #25392a 74%);
  box-shadow: 0 2px 3px #1e362436;
}
.course-icon i:first-child { top: 23%; left: 21%; }
.course-icon i:nth-child(2) { bottom: 20%; left: 46%; background: radial-gradient(at 31% 25%, #fff4e1, #e0d4b7 74%); }
.course-icon i:nth-child(3) { display: none; }
.course-icon.strategy { --icon-background: #ebd8ad; }
.course-icon.strategy i:first-child { top: 19%; left: 20%; }
.course-icon.strategy i:nth-child(2) { bottom: 19%; left: 20%; }
.course-icon.strategy i:nth-child(3) { display: block; top: 19%; left: 54%; }
.course-icon.advanced { --icon-background: #d9dfce; }
.course-icon.advanced i:first-child { top: 19%; left: 19%; }
.course-icon.advanced i:nth-child(2) { bottom: 18%; left: 20%; }
.course-icon.advanced i:nth-child(3) { display: block; bottom: 18%; left: 53%; }
.course-icon.giant { width: clamp(67px, 10vw, 115px); border-radius: 22%; }
.course-count { color: var(--card-ink); font-size: 12.5px; font-weight: 760; white-space: nowrap; }
.course-title { font-size: clamp(16px, 1.56vw, 21px); font-weight: 690; letter-spacing: -.03em; }
.course-title strong { display: block; font-size: 13px; color: var(--card-ink); margin-bottom: 1px; letter-spacing: 0; }
.course-card-bottom { color: var(--card-ink); font-size: 13px; font-weight: 680; }
.arrow { display: inline-grid; place-items: center; flex: none; font-size: 25px; line-height: 1; width: 21px; }
.family-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 17px;
  border: 1px solid #dfdfd1;
  border-radius: 17px;
  background: #f3f0e5;
}
.family-banner > div { display: flex; align-items: center; gap: 11px; }
.family-banner strong { font-size: 17px; }
.family-banner p { color: var(--muted); font-size: 13px; }
.family-banner .button { flex-shrink: 0; }
.portrait {
  display: inline-block;
  flex: none;
  width: 45px;
  aspect-ratio: 1;
  border-radius: 13px;
  background: #536347 url("./assets/sol-forest.webp") 76% 36% / 340% auto no-repeat;
  box-shadow: inset 0 0 0 1px #786e5549;
}

.board-shell {
  --rim: clamp(9px, 1.55vw, 21px);
  position: relative;
  width: 100%;
  padding: var(--rim);
  border: 1px solid #b78951;
  border-radius: clamp(10px, 1.3vw, 16px);
  background:
    repeating-linear-gradient(2deg, #9e6d3310 0 1px, #f9e3b117 1px 3px, transparent 3px 7px, #f2cd8922 7px 8px, transparent 8px 11px),
    radial-gradient(ellipse at 35% 28%, #f4d6a6, #eabf85 70%, #d8a66a);
  box-shadow: 0 5px 0 #c29258, 0 6px 0 #997044, 0 11px 17px #7f572f30, inset 0 0 0 2px #ffebb668;
}
.board-shell.compact { --rim: clamp(8px, 1vw, 15px); }
.board { display: grid; touch-action: manipulation; user-select: none; }
.board-row { display: grid; grid-template-columns: repeat(var(--lines), minmax(0, 1fr)); }
.square { min-width: 0; aspect-ratio: 1; }
.point {
  --graticule: #694522c9;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.point:before, .point:after {
  position: absolute;
  z-index: -1;
  content: "";
  background: var(--graticule);
  pointer-events: none;
}
.point:before { height: 1px; top: calc(50% - .5px); left: 0; right: 0; }
.point:after { width: 1px; left: calc(50% - .5px); top: 0; bottom: 0; }
.point.left:before { left: 50%; }
.point.right:before { right: 50%; }
.point.top:after { top: 50%; }
.point.bottom:after { bottom: 50%; }
.point:focus-visible { outline: 2px solid #3f5d43; outline-offset: -1px; border-radius: 20%; z-index: 3; }
.point > span { grid-area: 1 / 1; pointer-events: none; }
.stone {
  z-index: 3;
  width: 85%;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 2px 4px #2b250d76, inset 0 0 0 .7px #1c231c91;
}
.stone.white { box-shadow: 0 2px 4px #50321e6f, inset 0 0 0 .75px #b99f7faa; }
.star-point { z-index: 0; width: 11%; min-width: 3px; aspect-ratio: 1; border-radius: 50%; background: #795332; }
.candidate { z-index: 1; width: 42%; aspect-ratio: 1; border: 2px dotted #5e714b; border-radius: 50%; background: #eeeacc86; }
.point-mark { display: none; z-index: 5; width: 69%; aspect-ratio: 1; border-radius: 50%; }
.point.last .point-mark, .point.marked .point-mark, .point.hinted .point-mark,
.point.look .point-mark, .point.ghost .point-mark, .point.missed .point-mark,
.point.dead .point-mark { display: block; }
.point.last .point-mark { width: 19%; min-width: 4px; background: #ffd487; }
.point.last:has(.stone.white) .point-mark { background: #694927; }
.point.look .point-mark { border: 2px dashed #476637; background: #f7f6b52b; }
.point.look.occupied .point-mark { width: 72%; border-color: #efa756; background: transparent; }
.point.marked .point-mark { border: 2px solid #405d37; background: #dfe8b7df; }
.point.marked .point-mark::after { content: "✓"; display: grid; place-items: center; height: 100%; color: #26462f; font-weight: 850; font-size: clamp(12px, 2vw, 22px); }
.point.hinted .point-mark { width: 78%; border: 3px solid #486d40; background: #dceab16b; box-shadow: 0 0 0 2px #f2f0c6; }
.point.ghost .point-mark { width: 83%; border: 2px dashed #fbebc7; background: #25362aa8; }
.white-turn .point.ghost .point-mark { border-color: #54745f; background: #fff8e1b8; }
.point.missed .point-mark { width: 69%; border: 2px solid #8b4128; border-radius: 15%; transform: rotate(45deg); background: #ebaa8252; }
.point.dead .stone { opacity: .38; }
.point.dead .point-mark { background: linear-gradient(45deg, transparent 46%, #743f2d 47% 54%, transparent 55%), linear-gradient(-45deg, transparent 46%, #743f2d 47% 54%, transparent 55%); }
.territory-mark { z-index: 1; width: 39%; aspect-ratio: 1; border-radius: 3px; }
.territory-black { background: #2b392b; box-shadow: inset 0 0 0 1px #442c1e81; }
.territory-white { background: #fff5d9; box-shadow: inset 0 0 0 1px #b38e63; }
.board.locked .point { cursor: default; }
.board.scoring .occupied { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .board:not(.locked) .point:not(.occupied, .hinted, .ghost, .missed, .marked):hover .point-mark {
    display: block;
    width: 78%;
    background: #35453261;
  }
  .board.white-turn:not(.locked) .point:not(.occupied, .hinted, .ghost, .missed, .marked):hover .point-mark { background: #fff7dfb8; }
}
.captured { pointer-events: none; animation: lift-stone 390ms ease-out both; }
@keyframes lift-stone { to { transform: scale(.67) translateY(-16%); opacity: 0; } }

.inner-page { width: min(100%, 1010px); margin-inline: auto; padding-block: 31px 35px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  color: #3e624c;
  font-size: 14px;
  font-weight: 780;
}
.back span { font-size: 22px; line-height: 1; }
.back:hover, .text-button:hover, .text-link:hover { text-decoration: underline; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 23px;
}
.page-head h1 { font-size: clamp(32px, 4.6vw, 55px); line-height: 1.13; letter-spacing: -.065em; }
.page-head .eyebrow { margin-bottom: 5px; }
.page-head p { margin-top: 9px; color: var(--muted); font-size: clamp(14px, 1.6vw, 17px); font-weight: 590; }
.compact-head { margin-top: 4px; margin-bottom: 16px; }
.compact-head h1 { font-size: clamp(28px, 4.2vw, 48px); }
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 5px 18px; }
.tabs a, .tabs button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid #cad3c4;
  border-radius: 999px;
  min-height: 40px;
  background: #faf9f0;
  font-size: 14px;
  font-weight: 720;
}
.tabs a:hover, .tabs button:hover { background: #e6eddf; }
.tabs [aria-current="page"], .tabs button[aria-pressed="true"] {
  background: #dfebda;
  color: #274333;
  border-color: #95aa91;
  box-shadow: inset 0 0 0 1px #95aa91;
}
.unit-list { display: grid; gap: 10px; }
.unit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(8px, 1.6vw, 17px);
  padding: 14px clamp(11px, 1.7vw, 20px);
  transition: transform 150ms, box-shadow 150ms;
}
.unit-index, .step {
  display: grid;
  place-items: center;
  width: 37px;
  aspect-ratio: 1;
  border-radius: 11px;
  color: #466752;
  background: #e8eee3;
  font-weight: 800;
}
.unit-index.finished, .step-done { background: #d7e8d4; }
.unit-copy { display: grid; gap: 1px; }
.unit-copy strong { font-size: 19px; letter-spacing: -.04em; }
.unit-copy > span, .unit-status { font-size: 13px; color: var(--muted); font-weight: 600; }
.unit-status { white-space: nowrap; }
.puzzle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.puzzle-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 17px; transition: transform 150ms, box-shadow 150ms; }
.puzzle-topic { font-size: 12px; color: #466c50; font-weight: 810; }
.puzzle-topic.strategy { color: #765420; }
.puzzle-topic.advanced { color: #495c5d; }
.puzzle-ask { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.puzzle-status { margin-top: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 740; }
.empty { padding: 19px; color: var(--muted); }
.check { font-weight: 850; color: #346145; }

.workspace-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.55fr) minmax(255px, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "board guide" "board tools";
  column-gap: clamp(14px, 2.1vw, 24px);
  row-gap: 12px;
}
.workspace-board { grid-area: board; }
.workspace-guide { grid-area: guide; padding: clamp(15px, 2.15vw, 24px); }
.workspace-tools { grid-area: tools; }
.lesson-progress { display: flex; gap: 6px; flex: none; }
.step { place-items: center; width: 36px; background: #f2f0e5; border: 1px solid #d9dfd3; }
.step[aria-current] { border-color: #587a5e; box-shadow: inset 0 0 0 1px #587a5e; }
.step.step-done { background: #dce9d9; }
.board-heading {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.guide-top { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.guide-top > span:nth-child(2) { display: grid; line-height: 1.25; }
.guide-top > span:nth-child(2) > span { font-size: 12px; color: var(--muted); }
.guide-top .count-badge { margin-left: auto; }
.workspace-guide h2 {
  font-size: clamp(19px, 2.45vw, 28px);
  letter-spacing: -.04em;
  line-height: 1.37;
  text-wrap: pretty;
}
.guide-text { margin-top: 8px; color: #526256; font-size: 15px; font-weight: 610; }
.feedback, .hint-note {
  margin-top: 12px;
  border-radius: 10px;
  padding: 10px 11px;
  background: #e8efe1;
  color: #36513f;
  font-size: 14px;
  font-weight: 640;
}
.feedback-warn { background: #f6eadb; color: #75462b; }
.hint-note { background: #f5ecd7; color: #634d2e; }
.hint-note strong { margin-right: 5px; }
.celebrate { border-color: #afc3a8; background: linear-gradient(132deg, #f5f9ec, #fffdf4 90%); }
.board-controls { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.text-button, .text-link {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  color: #3d614d;
  background: transparent;
  padding: 3px 0;
  font-size: 13px;
  font-weight: 750;
}
.study-progress { color: var(--muted); font-size: 13px; margin-top: 8px; }
.placement-note { margin-bottom: 7px; color: var(--green); font-size: 13px; font-weight: 750; }
.capture-pair { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 14px; }
.capture-pair span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; }
.score-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.score-side { border: 1px solid #dce3d9; border-radius: 11px; padding: 8px 9px; background: #f4f5eb; }
.score-side > span { display: block; font-weight: 770; }
.score-side strong { display: block; font-size: clamp(23px, 3vw, 35px); line-height: 1.25; }
.score-side strong small { margin-left: 2px; font-size: 12px; }
.score-side p { font-size: 12px; color: var(--muted); }

.play-setup .page-head .portrait { width: clamp(56px, 8vw, 96px); border-radius: 18%; }
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 15px;
  text-align: left;
}
.mode-card:hover { background: #f0f4e9; }
.mode-card[aria-pressed="true"] { border-color: #6f936f; box-shadow: inset 0 0 0 1px #6f936f; background: #eef4e7; }
.mode-card strong { font-size: 18px; letter-spacing: -.03em; }
.mode-card > span:last-child { color: var(--muted); font-size: 13.5px; font-weight: 570; }
.mode-symbol { display: flex; align-items: center; padding-inline: 1px; height: 42px; }
.mode-symbol .small-stone { width: 24px; height: 24px; }
.mode-symbol .small-stone + .small-stone { margin-left: -5px; margin-top: 11px; }
.mode-symbol .portrait { width: 37px; border-radius: 10px; }
.resume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 14px;
  background: #e5edde;
}
.resume-row > div { display: grid; }
.resume-row span { color: var(--muted); font-size: 13px; }
.setup-card { margin-top: 12px; padding: 18px; }
.setup-card fieldset { padding: 0; margin: 0 0 14px; border: 0; }
.setup-card legend { font-weight: 800; }
.setup-card .tabs { margin-bottom: 0; }
.setup-card fieldset p { font-size: 13px; color: var(--muted); margin-top: 5px; }
.setup-card > .actions { margin-top: 18px; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 63px;
  margin-top: 10px;
  border-top: 1px solid #dcded2;
  color: #5b685c;
  font-size: 13px;
  font-weight: 730;
}
.no-script { text-align: center; padding: 15px; }
dialog {
  color: var(--ink);
  width: min(calc(100vw - 28px), 480px);
  max-height: calc(100vh - 28px);
  border: 1px solid #cfdbce;
  border-radius: 19px;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 12px 55px #09181058;
}
dialog::backdrop { background: #172a20a6; }
.dialog-body { padding: clamp(15px, 5vw, 25px); }
.dialog-body h2 { margin-bottom: 8px; font-size: 24px; line-height: 1.25; letter-spacing: -.03em; }
.dialog-body p, .dialog-body li { color: #4a5e4f; font-size: 14.5px; }
.dialog-body .actions { justify-content: flex-end; margin-top: 13px; }
.rules-list { padding-inline-start: 20px; display: grid; gap: 7px; }
.records-list { padding: 0; list-style: none; display: grid; gap: 4px; }
.records-list li { display: flex; justify-content: space-between; padding: 7px 9px; background: #e8efe3; border-radius: 7px; }

@media (max-width: 880px) {
  .home-top { grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 12px; }
  .hero { min-height: 417px; background-position: 62% 50%; }
  .hero-copy { padding-inline: 25px; }
  .course-grid, .mode-grid { gap: 9px; }
  .course-card { padding-inline: 13px; }
}

@media (max-width: 690px) {
  .header-inner {
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 7px 8px;
    padding-block: 9px 7px;
  }
  .header nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .header nav a { flex: 1; padding: 6px; min-height: 36px; }
  .brand { font-size: 21px; }
  .brand-sub { font-size: 16px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; margin-right: 0; }
  .brand-mark i { width: 14px; height: 14px; }
  .brand-mark i:first-child { left: 6px; top: 6px; }
  .brand-mark i:last-child { bottom: 6px; right: 5px; }
  .quiet { padding-inline: 7px; min-height: 37px; }
  .header-tools { gap: 4px; }
  .home { padding-top: 15px; }
  .home-top { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: clamp(295px, 64vw, 405px); border-radius: 18px; background-position: 61% 50%; }
  .hero h1 { font-size: clamp(37px, 8.2vw, 57px); }
  .hero p { margin-top: 12px; }
  .hero-copy { padding: 20px; }
  .hero-actions { margin-top: 16px; }
  .hero .button { padding-inline: 11px; }
  .demo { padding: 15px; }
  .demo .board-shell { max-width: 272px; }
  .demo-prompt { min-height: 0; margin-bottom: 6px; }
  .learning { margin-top: 23px; }
  .course-grid, .mode-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
  .course-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
  .course-card-top, .course-card-bottom { display: contents; }
  .course-card-top .course-icon { grid-row: 1 / 3; }
  .course-title { grid-row: 1; grid-column: 2; }
  .course-card-bottom span:first-child { grid-row: 2; grid-column: 2; }
  .course-card-bottom .arrow { grid-row: 1; grid-column: 3; justify-self: end; }
  .course-count { grid-row: 2; grid-column: 3; justify-self: end; font-size: 12px; }
  .family-banner { padding: 10px; }
  .family-banner .portrait { width: 34px; border-radius: 9px; }
  .family-banner > div { gap: 8px; }
  .family-banner .button { padding-inline: 9px; }
  .inner-page { padding-top: 18px; }
  .page-head { margin-bottom: 13px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "guide" "board" "tools"; row-gap: 10px; }
  .game-workspace .workspace-grid { grid-template-areas: "board" "guide" "tools"; }
  .game-workspace .workspace-board { margin-bottom: 8px; }
  .workspace-guide { padding: 13px 14px; }
  .workspace-guide h2 { font-size: clamp(18px, 4.95vw, 24px); }
  .guide-top { margin-bottom: 6px; }
  .guide-top .portrait { width: 31px; border-radius: 9px; }
  .guide-top > span:nth-child(2) { display: flex; align-items: baseline; gap: 5px; }
  .guide-text { margin-top: 3px; font-size: 14px; }
  .feedback, .hint-note { margin-top: 7px; padding: 7px 9px; }
  .capture-pair { margin-top: 7px; }
  .workspace-tools { padding-top: 7px; }
  .board-heading { min-height: 27px; margin-bottom: 6px; }
  .puzzle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .puzzle-card { padding: 12px; }
  .mode-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; }
  .mode-card .mode-symbol { grid-row: 1 / 3; align-self: center; }
}

@media (max-width: 370px) {
  :root { --edge: 11px; }
  .hero-copy { padding-inline: 15px; }
  .hero h1 { font-size: 35px; }
  .course-card { padding-inline: 10px; }
  .family-banner .portrait { display: none; }
  .unit { gap: 6px; }
  .unit-index { width: 30px; }
  .puzzle-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
  .captured { animation: none; opacity: 0; }
}
