:root {
  color-scheme: light;
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --paper: #fff8e8;
  --paper-deep: #f3e6c9;
  --ink: #302821;
  --forest: #315c50;
  --river: #3e8ca5;
  --sky: #9edbe5;
  --coral: #d76557;
  --sun: #e9b94f;
  --leaf: #65a06f;
  --wood: #9b704f;
  --rest-night: #183f49;
  --disabled: #b9b2a4;
  --frame: min(28px, 2.7vw);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  background: var(--paper);
}

body {
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 4px solid var(--river);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bgm-audio {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  padding: max(10px, env(safe-area-inset-top))
    max(var(--frame), env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(var(--frame), env(safe-area-inset-left));
}

.paper-texture {
  background:
    radial-gradient(ellipse at 14% 22%, rgba(233, 185, 79, 0.1), transparent 32%),
    radial-gradient(ellipse at 85% 75%, rgba(101, 160, 111, 0.08), transparent 35%),
    var(--paper);
}

.home {
  display: flex;
  align-items: center;
  padding-inline: max(clamp(22px, 5vw, 76px), env(safe-area-inset-left));
  background:
    linear-gradient(90deg, rgba(255, 248, 232, 0.99) 0%, rgba(255, 248, 232, 0.94) 34%, rgba(255, 248, 232, 0.58) 50%, rgba(255, 248, 232, 0.09) 66%, rgba(255, 248, 232, 0.02) 100%),
    url("./images/home-door-forest-v1.jpg") center 52% / cover no-repeat;
  isolation: isolate;
}

.home-copy {
  display: grid;
  justify-items: start;
  gap: clamp(16px, 3vh, 25px);
  width: min(48vw, 500px);
}

.eyebrow {
  margin: 0;
  color: var(--wood);
  font-size: clamp(14px, 2.4vh, 20px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand {
  margin: 0;
  color: var(--forest);
  font-size: clamp(54px, 7.2vw, 94px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.06em;
  text-shadow: 0 2px 0 rgba(255, 253, 247, 0.9);
}

.brand span {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 0.42em;
  letter-spacing: 0.06em;
}

.home-start-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  width: min(100%, 400px);
  min-height: 76px;
  padding: 10px 15px 10px 27px;
  border: 0;
  border-radius: 25px 30px 23px 28px;
  color: white;
  background: linear-gradient(135deg, #315c50, #367362);
  box-shadow: 0 7px 0 rgba(47, 86, 74, 0.2);
  text-align: left;
}

.home-start-button span {
  display: block;
}

.home-start-button strong {
  font-size: clamp(25px, 4.8vh, 34px);
  line-height: 1.05;
}

.home-start-button b {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: #fff8e8;
  font-size: 29px;
}

.home-utility-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 9px;
}

.home-utility-actions .secondary-button {
  min-width: 108px;
  min-height: 48px;
  padding: 0 15px;
  border: 1.5px solid rgba(49, 92, 80, 0.78);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(255, 253, 247, 0.84);
  box-shadow: 0 3px 0 rgba(49, 92, 80, 0.12);
  backdrop-filter: blur(3px);
  font-size: 14px;
}

.bgm-button.playing,
.bgm-text-button.playing {
  border-color: var(--river);
  color: var(--forest);
  background: #e8f7f4;
}

.bgm-button.muted,
.bgm-text-button.muted {
  color: var(--disabled);
  background: rgba(255, 255, 255, 0.72);
}

.bgm-button {
  font-size: clamp(22px, 5vh, 30px);
}

.bgm-text-button {
  min-width: 126px;
}

.home-utility-actions .fullscreen-button {
  background: rgba(235, 244, 226, 0.9);
}

.home-utility-actions .bgm-text-button.muted {
  color: var(--forest);
  background: rgba(255, 253, 247, 0.84);
}

.home-install-area {
  position: relative;
  width: auto;
}

.home-install-button {
  width: auto;
  min-height: 48px;
  white-space: nowrap;
}

.home-install-button.ready {
  border-color: var(--forest);
  background: #e5f1e4;
}

.install-help-card {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 10px;
  width: min(540px, 82vw);
  padding: 12px 12px 12px 16px;
  border: 2px solid var(--wood);
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: 0 7px 20px rgba(48, 40, 33, 0.18);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.install-help-card button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--wood);
  background: var(--paper-deep);
  font-size: 22px;
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  min-height: 56px;
  border-radius: 21px 25px 19px 23px;
  font-weight: 800;
}

.primary-button {
  min-width: 166px;
  padding: 0 24px;
  border: 0;
  color: white;
  background: var(--forest);
  box-shadow: 0 4px 0 rgba(47, 86, 74, 0.18);
  font-size: 20px;
}

.secondary-button {
  min-width: 136px;
  padding: 0 16px;
  border: 2px solid var(--wood);
  background: rgba(255, 248, 232, 0.85);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: clamp(58px, 16vh, 82px);
}

.topbar-start,
.topbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-shortcut {
  width: 46px;
  min-height: 46px;
  font-size: 24px;
}

.review-shortcut.review-approve {
  border-color: var(--forest);
  color: var(--forest);
}

.review-shortcut.review-rework {
  border-color: var(--coral);
  color: var(--coral);
}

.retry-button {
  color: var(--forest);
  font-size: 29px;
}

.icon-button {
  width: 58px;
  min-height: 54px;
  padding: 0;
  border: 2px solid rgba(155, 112, 79, 0.85);
  background: rgba(255, 248, 232, 0.88);
  font-size: 23px;
}

.menu-fullscreen-button,
.menu-install-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 2px solid var(--forest);
  border-radius: 18px 22px 17px 20px;
  color: white;
  background: var(--forest);
  box-shadow: 0 3px 0 rgba(48, 40, 33, 0.14);
  font-weight: 800;
  white-space: nowrap;
}

.menu-install-button {
  border-color: var(--river);
  color: var(--forest);
  background: rgba(255, 253, 247, 0.94);
}

.menu-install-button.ready {
  border-color: var(--forest);
  background: #e5f1e4;
}

.menu-fullscreen-button span,
.menu-install-button span { font-size: 23px; }
.menu-fullscreen-button small,
.menu-install-button small { font-size: 13px; }

.install-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(48, 40, 33, 0.28);
}

.install-help-dialog {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(680px, 88vw);
  padding: 18px 20px;
  border: 3px solid var(--river);
  border-radius: 24px 30px 22px 27px;
  background: #fffdf7;
  box-shadow: 0 10px 30px rgba(48, 40, 33, 0.22);
}

.install-help-dialog > span {
  color: var(--forest);
  font-size: 38px;
}

.install-help-dialog h2,
.install-help-dialog p { margin: 0; }
.install-help-dialog h2 { color: var(--forest); font-size: 20px; }
.install-help-dialog p { margin-top: 4px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.install-help-dialog button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--wood);
  background: var(--paper-deep);
  font-size: 26px;
}

.topbar-title {
  overflow: hidden;
  margin: 0;
  font-size: clamp(18px, 3.7vw, 29px);
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title.medium { font-size: clamp(17px, 3vw, 25px); }
.topbar-title.compact {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(14px, 2.25vw, 19px);
  line-height: 1.15;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.progress-dots {
  display: flex;
  gap: 7px;
}

.progress-dot {
  width: 13px;
  height: 13px;
  border: 1px solid var(--wood);
  border-radius: 50%;
}

.progress-dot.active {
  border-color: var(--forest);
  background: var(--forest);
}

.shelf {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(7px, 1.6vh, 16px);
}

.shelf > * {
  min-width: 0;
}

.shelf.reviewing {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: clamp(5px, 1.15vh, 11px);
}

.shelf-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 0 8px;
}

.shelf-main-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shelf-main-controls .workbook-completion { margin-left: auto; }

.workbook-picker {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shelf-heading h2 {
  margin: 0;
  font-size: clamp(17px, 4.6vh, 30px);
}

.domain-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.domain-tab {
  min-width: 72px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--wood);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.73);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.domain-tab.selected {
  border-color: var(--sun);
  color: var(--ink);
  background: var(--sun);
  box-shadow: 0 3px 0 rgba(155, 112, 79, 0.18);
}

.workbook-tabs {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px 4px 5px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-padding-inline: 20px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.workbook-step {
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--wood);
  border-radius: 17px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.73);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.workbook-completion {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 7px;
  min-width: 112px;
  padding: 4px 9px;
  border: 2px solid rgba(47, 86, 74, 0.55);
  border-radius: 15px 18px 14px 17px;
  color: var(--forest);
  background: rgba(236, 246, 232, 0.92);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.workbook-completion strong { font-size: 13px; }

.workbook-completion i {
  grid-column: 1 / -1;
  overflow: hidden;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(47, 86, 74, 0.15);
}

.workbook-completion i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
}

.test-mode-toggle {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 0 10px;
  border: 2px solid var(--wood);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.73);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.test-mode-toggle.selected {
  border-color: var(--river);
  color: white;
  background: var(--river);
}

.test-review-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1vw, 11px);
  min-width: 0;
}

.review-filter {
  min-height: 32px;
  padding: 0 10px;
  border: 2px solid rgba(155, 112, 79, 0.74);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.75);
  font-size: clamp(12px, 2.7vh, 15px);
  font-weight: 700;
  white-space: nowrap;
}

.review-filter.selected {
  border-color: var(--forest);
  color: white;
  background: var(--forest);
}

.review-filter.review-rework.selected {
  border-color: var(--coral);
  background: var(--coral);
}

.review-filter.review-passed.selected {
  border-color: var(--river);
  background: var(--river);
}

.workbook-tabs::-webkit-scrollbar {
  display: none;
}

.workbook-tab {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  min-width: 112px;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--wood);
  border-radius: 18px 21px 17px 20px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 15px;
  font-weight: 800;
  scroll-snap-align: center;
}

.workbook-tab small {
  padding: 2px 5px;
  border-radius: 9px;
  color: var(--wood);
  background: rgba(255, 255, 255, 0.76);
  font-size: 10px;
}

.workbook-tab.completed:not(.selected) {
  border-color: rgba(47, 86, 74, 0.7);
  background: rgba(232, 244, 229, 0.92);
}

.workbook-tab.selected small { color: var(--forest); }

.workbook-tab.selected {
  min-width: 128px;
  border-width: 3px;
  border-color: var(--forest);
  color: white;
  background: var(--forest);
}

.stage-grid {
  display: grid;
  grid-auto-columns: var(--stage-card-width, calc(33.3333% - 10px));
  grid-auto-flow: column;
  align-items: stretch;
  gap: clamp(10px, 2vw, 22px);
  min-height: 0;
  padding: 4px 4px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}

.stage-grid::-webkit-scrollbar { display: none; }

.stage-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 2px solid var(--wood);
  border-radius: 24px 29px 22px 27px;
  background: rgba(255, 255, 255, 0.73);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.stage-card.status-unstarted {
  border-style: dashed;
  border-color: rgba(155, 112, 79, 0.58);
  background: rgba(255, 255, 255, 0.62);
}

.stage-card.status-started {
  border-width: 3px;
  border-color: #e3ac38;
  background: rgba(255, 247, 211, 0.9);
}

.stage-card.status-completed {
  border-width: 3px;
  border-color: var(--forest);
  background: rgba(229, 242, 225, 0.94);
  box-shadow: 0 5px 0 rgba(47, 86, 74, 0.14);
}

.stage-card.next-stage {
  border-style: solid;
  border-color: var(--sun);
  box-shadow: 0 0 0 4px rgba(239, 190, 70, 0.24), 0 5px 0 rgba(155, 112, 79, 0.12);
}

.stage-progress-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 12px 15px 11px 14px;
  font-size: clamp(10px, 2.35vh, 14px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.stage-progress-badge.unstarted {
  color: var(--wood);
  background: #f5ecdd;
}

.stage-progress-badge.started {
  color: var(--ink);
  background: var(--sun);
}

.stage-progress-badge.completed {
  color: white;
  background: var(--forest);
}

.stage-progress-badge.next {
  color: var(--ink);
  background: var(--sun);
  box-shadow: 0 2px 0 rgba(155, 112, 79, 0.18);
}

.stage-review-badge {
  position: absolute;
  top: 8px;
  right: 7px;
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
  font-size: clamp(11px, 2.5vh, 14px);
  font-weight: 800;
}

.stage-review-badge.passed { background: var(--forest); }
.stage-review-badge.rework { background: var(--coral); }

.stage-card.has-review-comment {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.stage-review-comment {
  overflow: hidden;
  width: 100%;
  color: var(--coral);
  font-size: clamp(10px, 2.2vh, 13px);
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-review-stages {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--wood);
  font-size: clamp(15px, 3.6vh, 21px);
  text-align: center;
}

.stage-number {
  display: grid;
  justify-self: start;
  width: 30px;
  min-height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.status-completed .stage-number {
  color: white;
  background: var(--forest);
}

.status-started .stage-number { background: #ffe59a; }

.stage-card img {
  width: min(100%, 96px, 18vh);
  max-height: 100%;
  object-fit: contain;
}

.stage-geometry-cover {
  color: var(--forest);
  font-size: clamp(19px, 5.7vh, 39px);
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
}

.stage-shape-cover {
  display: grid;
  place-items: center;
  min-height: 0;
}

.stage-title {
  overflow: hidden;
  width: 100%;
  font-size: clamp(13px, 2.8vh, 19px);
  font-weight: 700;
  line-height: 1.24;
  text-align: center;
}

.shelf-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.shelf-footer span {
  min-width: 88px;
  font-weight: 800;
  text-align: center;
}

.shelf-footer small {
  color: var(--wood);
  font-size: 12px;
  font-weight: 700;
}

.shelf-footer .icon-button {
  width: 50px;
  min-height: 42px;
}

.question {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.question-body {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 22px);
  min-height: 0;
}

.evidence-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 2px solid var(--wood);
  border-radius: 26px 32px 24px 28px;
  background: rgba(255, 253, 245, 0.64);
  transition: border-color 140ms, background-color 140ms;
}

.evidence-board.drop-ready {
  border-color: var(--sun);
  background: rgba(233, 185, 79, 0.14);
}

.board-label,
.answer-heading {
  margin: 0;
  font-size: clamp(17px, 4.5vh, 25px);
  font-weight: 700;
}

.board-footnote,
.hint {
  min-height: 21px;
  margin: 0;
  color: var(--wood);
  font-size: clamp(13px, 3.2vh, 19px);
  text-align: center;
}

.hint.active {
  color: var(--forest);
  font-weight: 700;
}

.evidence-content {
  display: grid;
  width: 100%;
  max-width: 100%;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.evidence-number {
  color: var(--forest);
  font-size: clamp(62px, 21vh, 112px);
  font-weight: 800;
  line-height: 1;
}

.evidence-number-label {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.evidence-sequence {
  color: var(--forest);
  font-size: clamp(25px, 7vw, 49px);
  font-weight: 800;
  white-space: nowrap;
}

.evidence-instruction {
  color: var(--forest);
  font-size: clamp(26px, 6.5vh, 48px);
  font-weight: 800;
  text-align: center;
}

.riddle-card {
  display: grid;
  width: min(100%, 430px);
  gap: clamp(8px, 2vh, 16px);
  justify-items: center;
}

.riddle-mark {
  display: grid;
  width: clamp(58px, 14vh, 92px);
  height: clamp(58px, 14vh, 92px);
  place-items: center;
  border: 3px solid var(--sun);
  border-radius: 50%;
  color: var(--forest);
  background: #fff3cf;
  font-size: clamp(39px, 10vh, 66px);
  font-weight: 800;
}

.riddle-card p {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: clamp(8px, 2vh, 14px);
  border-radius: 18px 22px 17px 20px;
  color: var(--ink);
  background: rgba(243, 230, 201, 0.76);
  font-size: clamp(17px, 4.3vh, 26px);
  font-weight: 700;
  line-height: 1.35;
}

.riddle-card p b {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--river);
  font-size: 17px;
}

.language-evidence {
  display: grid;
  justify-items: center;
  gap: clamp(4px, 1.5vh, 10px);
}

.language-evidence .asset-group img {
  width: clamp(61px, 16vh, 108px);
  height: clamp(61px, 16vh, 108px);
}

.language-word {
  color: var(--forest);
  font-size: clamp(25px, 7vh, 43px);
  letter-spacing: 0.07em;
}

.language-letter-focus {
  color: var(--coral);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.language-rhythm {
  color: var(--sun);
  font-size: clamp(16px, 4.3vh, 23px);
  letter-spacing: 0.2em;
}

.language-letter-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.language-letter-count i {
  display: grid;
  width: clamp(35px, 8vh, 51px);
  height: clamp(35px, 8vh, 51px);
  place-items: center;
  border: 3px solid var(--river);
  border-radius: 12px;
  color: var(--forest);
  background: white;
  font-size: clamp(20px, 5.2vh, 31px);
  font-style: normal;
  font-weight: 900;
}

.language-cue {
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.empty-evidence {
  display: grid;
  justify-items: center;
  gap: 13px;
  color: var(--forest);
  text-align: center;
}

.empty-tray {
  width: clamp(104px, 21vw, 178px);
  height: clamp(48px, 11vh, 77px);
  border: 3px dashed var(--wood);
  border-radius: 24px 24px 38px 38px;
  background: rgba(255, 255, 255, 0.46);
}

.five-frame-pair {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.workbook-geometry {
  display: block;
  width: clamp(40px, 11vh, 80px);
  height: clamp(40px, 11vh, 80px);
  flex: 0 0 auto;
  background: var(--geometry-color, var(--coral));
  transform: rotate(var(--geometry-rotation, 0deg));
}

.workbook-geometry.color-coral { --geometry-color: var(--coral); }
.workbook-geometry.color-river { --geometry-color: var(--river); }
.workbook-geometry.color-leaf { --geometry-color: var(--leaf); }
.workbook-geometry.color-sun { --geometry-color: var(--sun); }
.workbook-geometry.color-forest { --geometry-color: var(--forest); }
.workbook-geometry.color-wood { --geometry-color: var(--wood); }
.workbook-geometry.color-paper { --geometry-color: var(--paper-deep); }

.workbook-geometry.shape-circle { border-radius: 50%; }
.workbook-geometry.shape-square { border-radius: 9px; }
.workbook-geometry.shape-rectangle { width: clamp(57px, 17vh, 115px); height: clamp(35px, 8vh, 56px); border-radius: 8px; }
.workbook-geometry.shape-triangle { clip-path: polygon(50% 3%, 2% 97%, 98% 97%); }

.workbook-geometry.size-1 { scale: 0.63; }
.workbook-geometry.size-3 { scale: 1.25; }
.workbook-geometry.compact { width: clamp(27px, 6vh, 45px); height: clamp(27px, 6vh, 45px); }
.workbook-geometry.compact.shape-rectangle { width: clamp(38px, 8vh, 62px); height: clamp(24px, 4.9vh, 37px); }

.workbook-geometry.measure-length { width: clamp(40px, 11vh, 80px); height: clamp(18px, 4.2vh, 30px); scale: 1; }
.workbook-geometry.measure-length.size-1 { width: clamp(34px, 8vh, 52px); }
.workbook-geometry.measure-length.size-2 { width: clamp(55px, 12vh, 84px); }
.workbook-geometry.measure-length.size-3 { width: clamp(75px, 17vh, 120px); }
.workbook-geometry.measure-height {
  width: clamp(34px, 6.8vh, 52px);
  border-bottom: 3px solid rgba(155, 112, 79, 0.8);
  border-radius: 5px 5px 2px 2px;
  background-image: repeating-linear-gradient(to top, rgba(255, 248, 232, 0.8) 0 2px, transparent 2px 18px);
  scale: 1;
}
.workbook-geometry.measure-height.size-1 { height: clamp(38px, 9vh, 58px); }
.workbook-geometry.measure-height.size-2 { height: clamp(63px, 14vh, 90px); }
.workbook-geometry.measure-height.size-3 { height: clamp(84px, 20vh, 128px); }
.workbook-geometry.measure-thickness { height: clamp(66px, 15vh, 95px); scale: 1; }
.workbook-geometry.measure-thickness.size-1 { width: clamp(17px, 4vh, 26px); }
.workbook-geometry.measure-thickness.size-2 { width: clamp(33px, 7vh, 48px); }
.workbook-geometry.measure-thickness.size-3 { width: clamp(53px, 11vh, 76px); }

.sample-geometry,
.size-order-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1vw, 12px);
  min-height: clamp(80px, 21vh, 145px);
}

.sample-geometry .workbook-geometry { width: clamp(76px, 18vh, 136px); height: clamp(76px, 18vh, 136px); }
.sample-geometry .workbook-geometry.shape-rectangle { width: clamp(100px, 25vh, 174px); height: clamp(54px, 12vh, 85px); }
.size-order-arrow { color: var(--wood); font-size: clamp(15px, 3vh, 21px); font-weight: 700; }
.size-order-step { display: grid; justify-items: center; align-content: end; gap: 5px; align-self: end; }
.size-order-step > span:last-child { color: var(--forest); font-size: clamp(10px, 2.25vh, 15px); font-weight: 700; white-space: nowrap; }
.size-order-sample .workbook-geometry.measure-height.size-1 { height: clamp(26px, 7vh, 39px); }
.size-order-sample .workbook-geometry.measure-height.size-2 { height: clamp(39px, 10vh, 60px); }
.size-order-sample .workbook-geometry.measure-height.size-3 { height: clamp(53px, 14vh, 81px); }
.size-order-sample { min-height: 0; }

.position-example,
.visual-context-evidence {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(4px, 1.2vh, 10px);
  color: var(--forest);
}

.position-example strong,
.visual-context-evidence strong {
  font-size: clamp(17px, 4.4vh, 27px);
  font-weight: 800;
}

.position-scene {
  position: relative;
  display: block;
  width: clamp(76px, 11vw, 124px);
  height: clamp(72px, 18vh, 112px);
}

.position-scene.position-sample {
  width: clamp(112px, 17vw, 168px);
  height: clamp(94px, 23vh, 145px);
}

.position-reference {
  position: absolute;
  top: 35%;
  left: 35%;
  width: 31%;
  height: 34%;
  border: 3px solid var(--wood);
  border-radius: 9px;
  background: rgba(243, 230, 201, 0.52);
}

.position-marker {
  position: absolute;
  top: 43%;
  left: 43%;
  width: 18%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--position-color, var(--coral));
  box-shadow: 0 1px 4px rgba(49, 92, 80, 0.26);
}

.position-top .position-reference { top: 48%; }
.position-top .position-marker { top: 17%; }
.position-bottom .position-reference { top: 18%; }
.position-bottom .position-marker { top: 66%; }
.position-left .position-reference { left: 52%; }
.position-left .position-marker { left: 15%; }
.position-right .position-reference { left: 15%; }
.position-right .position-marker { left: 68%; }
.position-inside .position-reference { top: 15%; left: 16%; width: 70%; height: 70%; }
.position-outside .position-reference { top: 23%; left: 11%; width: 53%; height: 53%; }
.position-outside .position-marker { left: 73%; }
.position-near .position-reference { left: 23%; }
.position-near .position-marker { left: 57%; }
.position-far .position-reference { left: 6%; }
.position-far .position-marker { left: 77%; }
.position-middle .position-reference { left: 10%; width: 25%; }
.position-middle .position-reference::after {
  position: absolute;
  top: 0;
  left: 220%;
  width: 100%;
  height: 100%;
  border: 3px solid var(--wood);
  border-radius: 9px;
  background: rgba(243, 230, 201, 0.52);
  content: "";
}
.position-middle .position-marker { left: 38%; }
.position-front .position-reference,
.position-behind .position-reference {
  display: grid;
  top: 32%;
  left: 34%;
  width: 34%;
  height: 40%;
  place-items: center;
  color: var(--forest);
  font-size: clamp(19px, 5vh, 32px);
  font-weight: 800;
}
.position-front .position-marker { left: 75%; }
.position-behind .position-marker { left: 9%; }
.position-illustrated .position-reference {
  top: 22%;
  left: 19%;
  width: 64%;
  height: 61%;
  border: 0;
  background: transparent;
}
.position-illustrated .position-reference img { width: 100%; height: 100%; object-fit: contain; }
.position-illustrated.position-front .position-marker { left: 79%; }
.position-illustrated.position-behind .position-marker { left: 4%; }
.position-behind-label,
.position-front-label {
  position: absolute;
  top: 2%;
  color: var(--forest);
  font-size: clamp(10px, 2.35vh, 14px);
  font-weight: 900;
  white-space: nowrap;
}
.position-behind-label { left: 1%; }
.position-front-label { right: 2%; }

.use-scene-symbol {
  position: absolute;
  top: 0;
  right: -9px;
  display: grid;
  width: clamp(28px, 6.5vh, 41px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: rgba(233, 185, 79, 0.79);
  font-size: clamp(17px, 4.5vh, 26px);
  font-weight: 800;
}

.workbook-geometry-art {
  display: grid;
  place-items: center;
}

.workbook-geometry-art img {
  width: clamp(62px, 16vh, 105px);
  height: clamp(62px, 16vh, 105px);
  object-fit: contain;
}

.workbook-geometry-art.compact img {
  width: clamp(30px, 7vh, 51px);
  height: clamp(30px, 7vh, 51px);
}

.workbook-pattern-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.7vw, 8px);
  max-width: 100%;
}

.workbook-pattern-cell {
  display: grid;
  min-width: 0;
  min-height: clamp(42px, 10vh, 65px);
  place-items: center;
}

.workbook-pattern-blank {
  display: grid;
  width: clamp(34px, 7vh, 51px);
  height: clamp(34px, 7vh, 51px);
  place-items: center;
  border: 2px dashed var(--wood);
  border-radius: 13px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.69);
  font-size: clamp(20px, 4.8vh, 32px);
  font-weight: 800;
}

.shape-bin-list {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 16px);
  max-width: 100%;
}

.shape-drop-bin {
  display: grid;
  width: clamp(103px, 17vw, 151px);
  min-height: clamp(105px, 24vh, 166px);
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed var(--wood);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.69);
  font-size: clamp(13px, 2.8vh, 17px);
  font-weight: 700;
}

.shape-drop-bin.drop-ready,
.compose-drop-slot.drop-ready {
  border-color: var(--sun);
  outline-color: var(--sun);
  background: rgba(233, 185, 79, 0.2);
}

.shape-drop-bin.filled,
.compose-drop-slot.filled { border-color: var(--forest); outline-color: var(--forest); }

.use-drop-target {
  width: clamp(150px, 24vw, 234px);
  min-height: clamp(127px, 31vh, 196px);
  padding: 8px;
  text-align: center;
}
.use-drop-pair { position: relative; display: grid; place-items: center; }
.use-drop-delivered {
  position: absolute;
  right: -8px;
  bottom: 0;
  display: grid;
  width: 39px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(234, 241, 223, 0.96);
}
.use-drop-delivered .workbook-geometry-art,
.use-drop-delivered .workbook-geometry-art.compact,
.use-drop-delivered img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.use-drop-target > span:last-child { font-size: clamp(12px, 2.7vh, 17px); white-space: normal; }

.geometry-interaction-area {
  --compose-diameter: clamp(88px, 22vh, 124px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(8px, 2.2vh, 18px);
  min-width: 0;
}

.geometry-drag-direction,
.compose-sample-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--forest);
  font-weight: 700;
}

.geometry-piece-rack {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 20px);
}

.geometry-drag-piece {
  position: relative;
  z-index: 2;
  display: grid;
  width: clamp(92px, 14vw, 125px);
  height: clamp(88px, 22vh, 124px);
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--wood);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.79);
  touch-action: none;
}

.geometry-drag-piece.dragging {
  z-index: 10;
  border-color: var(--sun);
  box-shadow: 0 8px 23px rgba(49, 92, 80, 0.21);
  pointer-events: none;
}

.geometry-drag-piece.selected { border-color: var(--river); box-shadow: 0 0 0 3px rgba(62, 140, 165, 0.2); }
.geometry-drag-piece.already-fitted { visibility: hidden; }
.geometry-progress { color: var(--forest); font-size: clamp(14px, 3.3vh, 20px); }

.compose-target-board {
  --compose-diameter: clamp(88px, 22vh, 124px);
  position: relative;
  box-sizing: content-box;
  width: clamp(124px, 26vh, 204px);
  height: clamp(124px, 26vh, 204px);
  border: 3px dashed rgba(155, 112, 79, 0.6);
  background: rgba(243, 230, 201, 0.45);
}

.compose-target-board.shape-circle { width: var(--compose-diameter); height: var(--compose-diameter); border-radius: 50%; }
.compose-target-board.shape-square { border-radius: 12px; }
.compose-target-board.shape-rectangle { width: clamp(160px, 35vh, 262px); height: clamp(100px, 20vh, 150px); border-radius: 11px; }

.compose-drop-slot {
  position: absolute;
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  outline: 2px dashed rgba(155, 112, 79, 0.58);
  outline-offset: -2px;
  background: transparent;
}

.compose-drop-slot.slot-left { top: 0; bottom: 0; left: 0; width: 50%; }
.compose-drop-slot.slot-right { top: 0; right: 0; bottom: 0; width: 50%; }
.compose-drop-slot.slot-top { top: 0; right: 0; left: 0; height: 50%; }
.compose-drop-slot.slot-bottom { right: 0; bottom: 0; left: 0; height: 50%; }
.compose-drop-slot.slot-diagonal-a,
.compose-drop-slot.slot-diagonal-b { inset: 0; }
.compose-drop-slot.slot-diagonal-a { clip-path: polygon(0 0, 100% 0, 0 100%); }
.compose-drop-slot.slot-diagonal-b { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.compose-drop-slot .workbook-geometry { width: 100%; height: 100%; scale: 1; border-radius: 0; }
.compose-target-board.shape-circle .compose-drop-slot { overflow: hidden; }
.compose-target-board.shape-circle .slot-left .shape-circle,
.compose-target-board.shape-circle .slot-right .shape-circle { width: 200%; height: 100%; border-radius: 50%; }
.compose-target-board.shape-circle .slot-left .shape-circle { justify-self: start; }
.compose-target-board.shape-circle .slot-right .shape-circle { justify-self: end; }
.compose-target-board.shape-circle .slot-top .shape-circle,
.compose-target-board.shape-circle .slot-bottom .shape-circle { width: 100%; height: 200%; border-radius: 50%; }
.compose-target-board.shape-circle .slot-top .shape-circle { align-self: start; }
.compose-target-board.shape-circle .slot-bottom .shape-circle { align-self: end; }

.geometry-drag-piece .shape-circle[class*="part-"] { width: var(--compose-diameter); height: var(--compose-diameter); }
.geometry-drag-piece .part-left { clip-path: inset(0 50% 0 0); translate: 25% 0; }
.geometry-drag-piece .part-right { clip-path: inset(0 0 0 50%); translate: -25% 0; }
.geometry-drag-piece .part-top { clip-path: inset(0 0 50% 0); translate: 0 25%; }
.geometry-drag-piece .part-bottom { clip-path: inset(50% 0 0 0); translate: 0 -25%; }
.geometry-drag-piece .part-diagonal-a { clip-path: polygon(0 0, 100% 0, 0 100%); }
.geometry-drag-piece .part-diagonal-b { clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.shape-order-card {
  width: clamp(72px, 10vw, 104px);
  height: clamp(76px, 18vh, 104px);
  min-width: 0;
  max-width: 104px;
  flex: 0 1 104px;
  overflow: hidden;
}
.shape-order-card .workbook-geometry.size-3 { scale: 1; }
.shape-order-card .workbook-geometry.measure-area,
.shape-order-card .workbook-geometry.measure-size { scale: 1; }
.shape-order-card .workbook-geometry.measure-area.size-1,
.shape-order-card .workbook-geometry.measure-size.size-1 { width: clamp(34px, 8vh, 45px); height: clamp(34px, 8vh, 45px); }
.shape-order-card .workbook-geometry.measure-area.size-2,
.shape-order-card .workbook-geometry.measure-size.size-2 { width: clamp(47px, 11vh, 61px); height: clamp(47px, 11vh, 61px); }
.shape-order-card .workbook-geometry.measure-area.size-3,
.shape-order-card .workbook-geometry.measure-size.size-3 { width: clamp(59px, 14vh, 76px); height: clamp(59px, 14vh, 76px); }
.shape-order-card .workbook-geometry.measure-length { height: clamp(20px, 4vh, 27px); }
.shape-order-card .workbook-geometry.measure-length.size-1 { width: clamp(38px, 8vh, 49px); }
.shape-order-card .workbook-geometry.measure-length.size-2 { width: clamp(54px, 12vh, 69px); }
.shape-order-card .workbook-geometry.measure-length.size-3 { width: clamp(69px, 16vh, 89px); }
.shape-order-card .workbook-geometry.measure-height { width: clamp(19px, 4.4vh, 31px); max-height: calc(100% - 6px); scale: 1; }
.shape-order-card .workbook-geometry.measure-height.size-1 { height: clamp(20px, 5vh, 30px); }
.shape-order-card .workbook-geometry.measure-height.size-2 { height: clamp(30px, 8vh, 43px); }
.shape-order-card .workbook-geometry.measure-height.size-3 { height: clamp(40px, 11vh, 59px); }
.shape-order-card .workbook-geometry.measure-thickness { height: clamp(42px, 10vh, 61px); scale: 1; }
.shape-order-card .workbook-geometry.measure-thickness.size-1 { width: clamp(12px, 2.8vh, 19px); }
.shape-order-card .workbook-geometry.measure-thickness.size-2 { width: clamp(22px, 5vh, 34px); }
.shape-order-card .workbook-geometry.measure-thickness.size-3 { width: clamp(35px, 8vh, 51px); }

.distribution-count {
  color: var(--forest);
  font-size: clamp(15px, 3.8vh, 23px);
}

.recipient-pairs {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 1vw, 12px);
}

.recipient-pair {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.recipient-pair > img {
  width: clamp(32px, 8vh, 60px);
  height: clamp(32px, 8vh, 60px);
  object-fit: contain;
}

.recipient-pair-slot {
  display: grid;
  width: clamp(30px, 7vh, 46px);
  height: clamp(30px, 7vh, 46px);
  place-items: center;
  border: 2px dashed var(--wood);
  border-radius: 50%;
  color: var(--wood);
}

.recipient-pair-slot img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

.recipient-pair-slot.filled {
  border-color: var(--forest);
  border-style: solid;
}

.asset-group {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  justify-items: center;
  gap: clamp(3px, 0.7vw, 8px);
  max-width: 100%;
  max-height: 100%;
}

.asset-group img {
  width: clamp(38px, 9vh, 80px);
  height: clamp(38px, 9vh, 80px);
  object-fit: contain;
  pointer-events: none;
}

.asset-group.triangle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
}

.asset-group.triangle img:last-child {
  grid-column: 1 / 3;
}

.asset-group.line {
  grid-auto-flow: column;
}

.asset-group.grid-four,
.asset-group.grid-five,
.asset-group.grid-ten,
.asset-group.five-row {
  grid-auto-flow: row;
}

.asset-group.grid-four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-group.grid-five {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.asset-group.grid-ten,
.asset-group.five-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.asset-group.grid-ten img,
.asset-group.five-row img {
  width: clamp(27px, 7.7vh, 58px);
  height: clamp(27px, 7.7vh, 58px);
}

.asset-group.scattered > :nth-child(2n) {
  transform: translateY(8px);
}

.asset-group.scattered > :nth-child(3n) {
  transform: translateX(-4px);
}

.count-marker {
  position: relative;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
}

.count-marker.marked {
  border-color: var(--leaf);
  background: rgba(101, 160, 111, 0.13);
}

.count-marker.marked::after {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--forest);
  font-size: 13px;
  content: "✓";
}

.answer-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.riddle-think-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 0;
}

.riddle-think-card {
  display: grid;
  width: min(84%, 340px);
  min-height: min(190px, 42vh);
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 2px dashed var(--wood);
  border-radius: 30px 24px 32px 26px;
  color: var(--forest);
  background: rgba(255, 253, 245, 0.72);
}

.riddle-think-card span {
  font-size: clamp(38px, 10vh, 70px);
  letter-spacing: 0.12em;
}

.riddle-think-card strong { font-size: clamp(21px, 5vh, 31px); }
.riddle-reveal-button { width: min(82%, 310px); }

.memory-study-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.memory-study-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.5vw, 16px);
  width: min(100%, 470px);
  min-height: clamp(76px, 19vh, 126px);
  padding: 12px;
  border: 2px dashed var(--wood);
  border-radius: 24px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.62);
  font-size: clamp(16px, 4vh, 25px);
  font-weight: 800;
}

.memory-study-card span {
  display: grid;
  min-width: clamp(57px, 10vw, 88px);
  min-height: clamp(48px, 11vh, 70px);
  place-items: center;
  border-radius: 18px;
  background: rgba(243, 230, 201, 0.76);
}

.memory-study-card b { color: var(--sun); }

.memory-ready-button {
  width: min(82%, 330px);
  font-size: clamp(19px, 4.8vh, 29px);
}

.memory-sample {
  display: grid;
  min-width: clamp(126px, 22vw, 195px);
  min-height: clamp(118px, 29vh, 185px);
  place-items: center;
  border: 3px solid var(--sun);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 0 rgba(233, 185, 79, 0.22);
}

.memory-sample .workbook-geometry-art img {
  width: clamp(82px, 20vh, 132px);
  height: clamp(82px, 20vh, 132px);
}

.memory-sample > .workbook-geometry:not(.workbook-geometry-art) {
  width: clamp(82px, 20vh, 132px);
  height: clamp(82px, 20vh, 132px);
}

.memory-sample > .workbook-geometry.shape-rectangle:not(.workbook-geometry-art) {
  width: clamp(112px, 27vh, 178px);
  height: clamp(64px, 14vh, 94px);
}

.memory-cover {
  display: grid;
  min-width: clamp(126px, 22vw, 195px);
  min-height: clamp(118px, 29vh, 185px);
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 3px dashed var(--wood);
  border-radius: 30px;
  color: var(--forest);
  background: repeating-linear-gradient(135deg, rgba(243, 230, 201, 0.75) 0 12px, rgba(255, 253, 245, 0.8) 12px 24px);
}

.memory-cover span { color: var(--sun); font-size: clamp(48px, 14vh, 86px); line-height: 1; }
.memory-cover strong { font-size: clamp(16px, 3.7vh, 23px); }

.maze-guide-card {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-items: center;
  gap: clamp(7px, 1.4vw, 15px);
  color: var(--forest);
}

.maze-guide-card > span {
  display: grid;
  width: clamp(64px, 15vh, 98px);
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid var(--wood);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  font-size: clamp(34px, 9vh, 56px);
}

.maze-guide-card .maze-guide-start { color: var(--river); }
.maze-guide-card .maze-guide-goal { color: var(--sun); }
.maze-guide-card .maze-guide-arrow { width: auto; border: 0; background: transparent; color: var(--wood); }
.maze-guide-card strong { grid-column: 1 / -1; font-size: clamp(15px, 3.5vh, 22px); text-align: center; }

.maze-interaction-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 0;
}

.learning-maze {
  --maze-pad: clamp(5px, 1.2vh, 10px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--maze-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--maze-rows), minmax(0, 1fr));
  gap: clamp(3px, 0.7vh, 6px);
  width: min(100%, 510px);
  max-height: 100%;
  padding: var(--maze-pad);
  border: 3px solid var(--wood);
  border-radius: 22px 27px 20px 25px;
  background: rgba(243, 230, 201, 0.73);
  touch-action: none;
  user-select: none;
}

.learning-maze-cell {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: clamp(31px, 7.1vh, 54px);
  padding: 0;
  place-items: center;
  border: 2px solid rgba(155, 112, 79, 0.46);
  border-radius: clamp(7px, 1.6vh, 12px);
  color: var(--forest);
  background: rgba(255, 255, 255, 0.88);
  font-size: clamp(17px, 4.5vh, 29px);
  font-weight: 800;
  line-height: 1;
}

.learning-maze-cell.wall {
  border-color: transparent;
  background: rgba(155, 112, 79, 0.24);
  box-shadow: inset 0 0 0 2px rgba(155, 112, 79, 0.08);
}

.learning-maze-cell.open { cursor: pointer; }
.learning-maze-cell.visited { border-color: var(--river); background: rgba(62, 140, 165, 0.24); }
.learning-maze-cell.current { border: 3px solid var(--forest); color: var(--river); background: white; }
.learning-maze-cell.goal { color: #b77b11; }
.learning-maze-cell.marker { color: var(--coral); }
.learning-maze.theme-color .learning-maze-cell.guided { border-color: var(--river); background: rgba(62, 140, 165, 0.2); }
.learning-maze.theme-mixed .learning-maze-cell.guided { border-color: var(--leaf); }
.learning-maze.theme-direction .learning-maze-cell { font-size: clamp(15px, 4vh, 25px); }

.trace-board {
  gap: 0;
  width: min(100%, calc(52vh * var(--maze-ratio)));
  aspect-ratio: var(--maze-columns) / var(--maze-rows);
  background: rgba(255, 255, 255, 0.7);
}

.trace-path {
  position: absolute;
  z-index: 0;
  inset: var(--maze-pad);
  width: calc(100% - (2 * var(--maze-pad)));
  height: calc(100% - (2 * var(--maze-pad)));
  overflow: visible;
  pointer-events: none;
}

.trace-path polyline {
  fill: none;
  stroke: rgba(62, 140, 165, 0.64);
  stroke-width: 11px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trace-board .learning-maze-cell.wall {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.trace-board .learning-maze-cell.open {
  min-height: 0;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
}

.trace-board .learning-maze-cell.guided {
  border-color: transparent;
  background: transparent;
}

.trace-guide-card .maze-guide-start { color: var(--coral); }
.trace-guide-card .maze-guide-goal { color: var(--forest); }

.maze-progress { color: var(--forest); font-size: clamp(13px, 3vh, 18px); }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(var(--choices), minmax(0, 1fr));
  align-items: center;
  gap: clamp(7px, 1vw, 12px);
  min-height: 0;
}

.riddle-answer-area .choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.riddle-choice-card {
  height: 100%;
  min-height: 76px;
}

.riddle-choice-card .choice-word {
  font-size: clamp(24px, 6.5vh, 43px);
}

.riddle-choice-card .choice-word.long {
  font-size: clamp(17px, 4.2vh, 27px);
}

.choice-card {
  display: grid;
  place-items: center;
  min-width: 0;
  height: min(162px, 45vh);
  padding: 7px;
  border: 2px solid var(--wood);
  border-radius: 23px 29px 21px 26px;
  background: rgba(255, 255, 255, 0.91);
}

.choice-card.correct {
  border: 4px solid var(--forest);
  background: #eaf1df;
}

.choice-card.retry {
  border: 4px solid var(--sun);
}

.measure-height-area .choice-card {
  align-items: end;
  padding-bottom: clamp(14px, 4vh, 23px);
}

.measure-length-area .choice-card {
  justify-content: center;
  padding-inline: clamp(8px, 2vw, 18px);
}

.choice-card .asset-group img {
  width: clamp(38px, 12vh, 60px);
  height: clamp(38px, 12vh, 60px);
  max-width: 100%;
}

.choice-card .asset-group[data-count="3"] {
  width: 100%;
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.choice-card .asset-group[data-count="4"] img,
.choice-card .asset-group[data-count="5"] img {
  width: clamp(31px, 9vh, 46px);
  height: clamp(31px, 9vh, 46px);
}

.choice-card .asset-group.grid-ten img {
  width: clamp(22px, 6.6vh, 35px);
  height: clamp(22px, 6.6vh, 35px);
}

.choice-card .asset-group.grid-ten {
  gap: clamp(2px, 0.45vw, 5px);
}

.scene-evidence-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
}

.scene-evidence-card {
  display: grid;
  max-width: min(100%, 250px);
  margin: 0;
  place-items: center;
  gap: 5px;
}

.scene-evidence-card img {
  width: min(100%, 230px);
  max-height: 190px;
  object-fit: contain;
  border: 2px solid rgba(155, 112, 79, 0.45);
  border-radius: 20px;
  background: white;
}

.scene-evidence-card figcaption {
  color: var(--forest);
  font-size: clamp(11px, 2.7vh, 16px);
  font-weight: 700;
  text-align: center;
}

.scene-choice-art,
.scene-choice-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.scene-choice-art img {
  object-fit: contain;
}

.choice-word {
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: clamp(37px, 9vh, 66px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.choice-word.long {
  font-size: clamp(19px, 4.8vh, 32px);
}

.category-drop-bin span:last-child {
  font-size: clamp(12px, 2.8vh, 16px);
  white-space: nowrap;
}

.order-area {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: clamp(4px, 1.4vh, 10px);
  min-width: 0;
  min-height: 0;
}

.order-instruction {
  margin: 0;
  color: var(--forest);
  font-size: clamp(14px, 3.3vh, 20px);
  font-weight: 700;
}

.number-order-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 11px);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 8px;
  border: 2px dashed var(--wood);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
}

.number-order-card {
  display: grid;
  width: clamp(37px, 7.5vw, 69px);
  height: clamp(48px, 14vh, 76px);
  place-items: center;
  padding: 0;
  border: 2px solid var(--wood);
  border-radius: 15px 19px 14px 18px;
  color: var(--forest);
  background: white;
  font-size: clamp(25px, 8vh, 46px);
  font-weight: 800;
  touch-action: none;
}

.number-order-card.shape-order-card {
  width: clamp(72px, 10vw, 104px);
  height: clamp(76px, 18vh, 104px);
}

.number-order-card.selected,
.number-order-track.solved .number-order-card {
  border-color: var(--forest);
  background: #eaf1df;
}

.number-order-ghost {
  opacity: 0.35;
}

.scene-order-track {
  width: 100%;
  max-width: 610px;
}

.scene-order-card {
  width: min(29vw, 185px);
  height: min(31vh, 150px);
  padding: 5px;
}

.scene-order-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.order-confirm {
  min-width: 118px;
  min-height: 44px;
}

.choice-number {
  color: var(--forest);
  font-size: clamp(50px, 16vh, 86px);
  font-weight: 800;
}

.place-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  min-height: 0;
}

.place-instruction {
  margin: 0;
  font-size: clamp(16px, 4.2vh, 25px);
  font-weight: 700;
}

.token-source {
  position: relative;
  z-index: 3;
  width: clamp(68px, 21vh, 110px);
  height: clamp(68px, 21vh, 110px);
  border: 3px solid var(--forest);
  border-radius: 25px;
  background: white;
  touch-action: none;
}

.token-source img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  pointer-events: none;
}

.token-source.dragging {
  z-index: 10;
  border-color: var(--sun);
  transition: none;
}

.return-basket {
  display: grid;
  width: clamp(101px, 23vh, 142px);
  height: clamp(74px, 18vh, 110px);
  align-content: center;
  justify-items: center;
  gap: 2px;
  border: 3px dashed var(--wood);
  border-radius: 18px 18px 31px 31px;
  color: var(--wood);
  background: rgba(243, 230, 201, 0.57);
}

.return-basket > span { color: var(--coral); font-size: 31px; line-height: 1; }
.return-basket > strong { font-size: clamp(13px, 3.3vh, 18px); }
.return-basket.drop-ready { border-color: var(--sun); background: rgba(233, 185, 79, 0.24); }

.placement-ready {
  display: grid;
  width: clamp(69px, 19vh, 104px);
  height: clamp(69px, 19vh, 104px);
  place-items: center;
  border: 3px solid var(--forest);
  border-radius: 50%;
  color: var(--forest);
  background: rgba(101, 160, 111, 0.11);
  font-size: clamp(44px, 12vh, 69px);
  font-weight: 800;
}

.slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.slots.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.slot {
  display: grid;
  place-items: center;
  width: clamp(59px, 16vh, 86px);
  height: clamp(59px, 16vh, 86px);
  border: 2px solid var(--wood);
  border-radius: 50%;
  color: var(--wood);
  background: var(--paper-deep);
  font-size: 30px;
}

.slot.filled {
  border-color: var(--forest);
  background: white;
}

.slots.compact .slot {
  width: clamp(36px, 10vh, 60px);
  height: clamp(36px, 10vh, 60px);
}

.slot.extra {
  border-color: var(--coral);
  background: #fff0ec;
}

.slot.return-token {
  position: relative;
  z-index: 3;
  padding: 0;
  touch-action: none;
}

.slot.return-token.dragging {
  z-index: 10;
  border-color: var(--sun);
  box-shadow: 0 6px 19px rgba(48, 40, 33, 0.18);
}

.slot img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  pointer-events: none;
}

.place-count {
  font-size: clamp(14px, 3.8vh, 21px);
  font-weight: 700;
}

.place-actions {
  display: flex;
  gap: 8px;
}

.place-actions .primary-button,
.place-actions .secondary-button {
  min-width: 116px;
  min-height: 49px;
  padding: 0 10px;
  font-size: 16px;
}

.question-success-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(48, 40, 33, 0.32);
  backdrop-filter: blur(2px);
}

.question-success-card {
  display: grid;
  justify-items: center;
  gap: clamp(5px, 1.5vh, 11px);
  width: min(440px, 88vw);
  max-height: calc(100vh - 24px);
  padding: clamp(14px, 4vh, 28px) clamp(22px, 5vw, 42px);
  border: 4px solid var(--sun);
  border-radius: 34px 28px 38px 30px;
  background:
    radial-gradient(circle at 15% 20%, rgba(233, 185, 79, 0.2), transparent 24%),
    radial-gradient(circle at 86% 76%, rgba(101, 160, 111, 0.18), transparent 28%),
    #fffdf7;
  box-shadow: 0 12px 36px rgba(48, 40, 33, 0.24);
  text-align: center;
  animation: success-pop 220ms ease-out both;
}

.question-success-stars {
  color: var(--sun);
  font-size: clamp(28px, 7vh, 48px);
  line-height: 1;
  letter-spacing: 0.15em;
}

.question-success-card h2 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(34px, 9vh, 62px);
  line-height: 1;
}

.question-success-card p {
  margin: 0;
  color: var(--wood);
  font-size: clamp(15px, 3.6vh, 21px);
  font-weight: 800;
}

.question-success-next {
  min-width: min(280px, 72vw);
  margin-top: 3px;
}

@keyframes success-pop {
  from { opacity: 0; transform: scale(0.84) rotate(-1deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.complete,
.rest,
.loading-screen,
.error-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 15px;
  width: 100%;
  height: 100%;
  text-align: center;
}

.complete-badge,
.loading-seed {
  color: var(--sun);
  font-size: clamp(72px, 24vh, 140px);
  line-height: 1;
}

.complete h1,
.rest h1 {
  margin: 0;
  font-size: clamp(32px, 8vh, 66px);
}

.complete p,
.rest p,
.error-screen p {
  margin: 0;
  font-size: clamp(16px, 4vh, 24px);
}

.complete .test-mode-note {
  color: var(--wood);
  font-size: clamp(13px, 2.8vh, 18px);
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.review-confirm-rework { border-color: var(--coral); color: var(--coral); }

.review-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(48, 40, 33, 0.46);
}

.review-comment-dialog {
  display: grid;
  gap: 10px;
  width: min(570px, 94vw);
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 19px 22px;
  border: 2px solid var(--wood);
  border-radius: 24px 28px 22px 26px;
  background: var(--paper);
}

.review-comment-dialog h2,
.review-dialog-stage {
  margin: 0;
}

.review-comment-dialog h2 {
  color: var(--coral);
  font-size: clamp(20px, 5vh, 27px);
}

.review-dialog-stage {
  color: var(--wood);
  font-size: clamp(13px, 3vh, 17px);
}

.review-comment-dialog label {
  font-size: clamp(13px, 3vh, 16px);
  font-weight: 700;
}

.review-comment-dialog textarea {
  width: 100%;
  min-height: 94px;
  padding: 10px 12px;
  resize: vertical;
  border: 2px solid rgba(155, 112, 79, 0.62);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 15px;
  user-select: text;
  -webkit-user-select: text;
}

.review-comment-dialog textarea:focus-visible {
  outline: 3px solid var(--river);
  outline-offset: 2px;
}

.review-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.primary-button.review-confirm-rework {
  color: white;
  background: var(--coral);
}

.rest {
  gap: clamp(5px, 1.5vh, 12px);
  color: #fff8e8;
  background: radial-gradient(ellipse at 52% 30%, #315c63, var(--rest-night));
}

.rest-moon {
  color: var(--sun);
  font-size: clamp(42px, 9vh, 68px);
}

.rest-clock {
  font-size: clamp(42px, 13vh, 82px);
  font-weight: 800;
}

.rest-ad-shell {
  display: grid;
  width: min(86vw, 728px);
  align-content: start;
  padding: 3px 7px 7px;
  border: 1px solid rgba(255, 248, 232, 0.42);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.rest-ad-shell[hidden] { display: none; }

.rest-ad-label {
  justify-self: center;
  color: #665f57;
  font-size: 10px;
  line-height: 1.2;
}

.rest-ad-slot {
  width: 100%;
  height: clamp(50px, 11vh, 90px);
}

.rest-ad-unit {
  width: 100%;
  height: 100%;
}

/* 2400-question expansion: five deterministic, sound-optional interactions. */
.tap-collect-area,
.adjust-area,
.connect-area,
.paint-area,
.gravity-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: clamp(4px, 1.2vh, 9px);
  min-width: 0;
  min-height: 0;
}

.tap-collect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(48px, 8vh, 66px), 1fr));
  align-content: center;
  width: 100%;
  max-width: 520px;
  gap: clamp(4px, 1vh, 9px);
}

.tap-collect-card {
  position: relative;
  display: grid;
  min-width: 48px;
  min-height: clamp(48px, 12vh, 76px);
  place-items: center;
  padding: 3px;
  border: 2px solid var(--wood);
  border-radius: 18px 22px 17px 20px;
  background: rgba(255, 255, 255, 0.76);
  touch-action: manipulation;
}

.tap-collect-card img { width: clamp(40px, 9vh, 64px); height: clamp(40px, 9vh, 64px); object-fit: contain; }
.tap-collect-grid:not(.compact) .tap-collect-card img { width: clamp(54px, 15vh, 72px); height: clamp(54px, 15vh, 72px); }
.tap-collect-card.collected { border-color: var(--forest); background: rgba(101, 160, 111, 0.18); opacity: 1; }
.tap-letter { color: var(--forest); font-size: clamp(30px, 9vh, 55px); font-weight: 800; line-height: 1; }
.tap-check { position: absolute; top: 2px; right: 5px; color: var(--forest); font-size: 19px; font-weight: 900; }
.tap-collect-progress,
.connect-progress,
.paint-progress { color: var(--forest); font-size: clamp(14px, 3.4vh, 20px); }

.adjust-sample-card,
.adjust-live-card {
  display: grid;
  min-width: min(88%, 300px);
  min-height: clamp(92px, 24vh, 150px);
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--forest);
}

.adjust-live-card {
  width: min(92%, 390px);
  border: 2px dashed var(--wood);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.56);
}

.adjust-measure { display: block; border-radius: 999px; background: var(--river); }
.adjust-measure.sample { background: var(--wood); }
.adjust-length { width: calc(34px + var(--adjust-level) * 31px); height: 30px; }
.adjust-height { width: 42px; height: calc(30px + var(--adjust-level) * 20px); align-self: end; }
.adjust-thickness { width: 180px; height: calc(8px + var(--adjust-level) * 8px); }
.adjust-glass { position: relative; display: block; width: 92px; height: 116px; overflow: hidden; border: 4px solid var(--wood); border-top-width: 2px; border-radius: 9px 9px 24px 24px; background: white; }
.adjust-glass > span { position: absolute; right: 3px; bottom: 3px; left: 3px; height: calc(var(--adjust-level) * 18%); border-radius: 4px 4px 17px 17px; background: rgba(62, 140, 165, 0.72); }
.adjust-blocks { display: flex; flex-direction: column-reverse; gap: 2px; }
.adjust-blocks i { display: block; width: 60px; height: 18px; border: 2px solid var(--wood); border-radius: 5px; background: var(--sun); }
.adjust-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.adjust-button { width: clamp(52px, 11vh, 70px); min-height: clamp(48px, 11vh, 66px); border: 2px solid var(--wood); border-radius: 20px; color: var(--forest); background: white; font-size: clamp(29px, 7vh, 43px); font-weight: 900; }
.adjust-dots { display: flex; gap: 5px; }
.adjust-dots span { width: 12px; height: 12px; border: 2px solid var(--wood); border-radius: 50%; background: white; }
.adjust-dots span.on { border-color: var(--forest); background: var(--forest); }
.adjust-confirm { min-height: 44px; width: min(64%, 230px); }

.connect-guide-card { display: grid; grid-template-columns: repeat(var(--guide-columns, 5), auto); align-items: center; gap: 10px; color: var(--forest); }
.connect-guide-card strong { display: grid; width: 49px; height: 49px; place-items: center; border: 3px solid var(--river); border-radius: 50%; background: white; font-size: 24px; }
.connect-guide-card p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--wood); font-weight: 700; }
.connect-board { position: relative; width: min(100%, 270px, 55vh); aspect-ratio: 1; border: 2px solid var(--wood); border-radius: 22px; background: rgba(255, 255, 255, 0.56); }
.connect-board svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.connect-board line { stroke: var(--river); stroke-width: 17; stroke-linecap: round; }
.connect-point { position: absolute; left: var(--point-x); top: var(--point-y); z-index: 1; display: grid; width: clamp(43px, 9vh, 57px); height: clamp(43px, 9vh, 57px); place-items: center; transform: translate(-50%, -50%); border: 3px solid var(--wood); border-radius: 50%; color: var(--forest); background: white; font-size: clamp(18px, 4.6vh, 28px); font-weight: 900; }
.connect-point.next { border-color: var(--sun); box-shadow: 0 0 0 5px rgba(233, 185, 79, 0.2); }
.connect-point.selected { border-color: var(--river); color: white; background: var(--river); opacity: 1; }

.equal-pair-guide,
.equal-split-guide {
  display: grid;
  min-height: 120px;
  place-content: center;
  align-items: center;
  grid-template-columns: auto auto auto;
  gap: 10px;
  color: var(--forest);
  text-align: center;
}

.equal-pair-guide > span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid var(--river);
  border-radius: 50%;
  background: white;
  font-size: 22px;
}

.equal-pair-guide > i {
  width: 68px;
  height: 8px;
  border-radius: 99px;
  background: var(--river);
}

.equal-pair-guide > strong,
.equal-split-guide > strong { grid-column: 1 / -1; }

.equal-pair-area,
.equal-split-area,
.unpaired-area {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: clamp(5px, 1.2vh, 10px);
}

.equal-pair-board {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  height: min(48vh, 270px);
  min-height: 140px;
  grid-template-columns: 1fr 1fr;
  border: 2px solid rgba(155, 112, 79, 0.42);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
}

.equal-pair-board svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.equal-pair-board line {
  stroke: var(--river);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.equal-pair-column {
  z-index: 2;
  display: grid;
  min-height: 0;
  align-items: center;
  justify-items: center;
  grid-template-rows: repeat(var(--pair-rows), minmax(0, 1fr));
  gap: 2px;
  padding: 6px 12%;
}

.equal-pair-node {
  display: grid;
  width: min(100%, clamp(32px, 9.5vh, 64px));
  height: min(100%, clamp(32px, 9.5vh, 64px));
  aspect-ratio: 1;
  place-items: center;
  padding: 3px;
  border: 3px solid var(--wood);
  border-radius: 50%;
  background: white;
}

.equal-pair-node img { width: 100%; height: 100%; object-fit: contain; }
.equal-pair-node.selected { border-color: var(--sun); box-shadow: 0 0 0 5px rgba(233, 185, 79, 0.25); }
.equal-pair-node.linked { border-color: var(--river); opacity: 1; }
.equal-pair-node.extra-ready { border-color: var(--coral); box-shadow: 0 0 0 6px rgba(215, 101, 87, 0.18); }

.visual-progress { color: var(--forest); font-size: clamp(13px, 2.8vh, 18px); }

.equalize-board {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
}

.equalize-board > section { display: grid; min-width: 0; justify-items: center; gap: 7px; }
.equalize-board > section > strong { color: var(--forest); }
.equalize-board .asset-group { width: 100%; overflow: hidden; }
.equalize-board .asset-group.line[data-count="4"],
.equalize-board .asset-group.line[data-count="5"] { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.equalize-board .slots {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}
.equalize-board .slot {
  width: clamp(38px, 9vh, 56px);
  height: clamp(38px, 9vh, 56px);
}
.equal-sign { color: var(--forest); font-size: clamp(24px, 6vh, 38px); font-weight: 900; }

.unpaired-board {
  display: grid;
  width: min(100%, 360px);
  min-height: 0;
  gap: 3px;
}

.unpaired-row { display: grid; min-height: 48px; align-items: center; grid-template-columns: 62px minmax(30px, 1fr) 62px; }
.unpaired-model,
.unpaired-choice { display: grid; width: 58px; height: 48px; place-items: center; padding: 2px; border: 2px solid var(--wood); border-radius: 15px; background: white; }
.unpaired-model img,
.unpaired-choice img { width: 100%; height: 100%; object-fit: contain; }
.unpaired-model i { color: var(--coral); font-size: 28px; font-style: normal; font-weight: 900; }
.unpaired-link { height: 7px; border-radius: 99px; background: var(--river); }
.unpaired-row.extra .unpaired-link { border-top: 3px dashed var(--coral); background: transparent; }
.unpaired-choice { position: relative; }
.unpaired-choice > span { position: absolute; right: -4px; top: -6px; color: var(--forest); font-size: 21px; font-weight: 900; }
.unpaired-choice.collected { border-color: var(--forest); opacity: 1; }

.equal-split-guide .mini-basket {
  display: grid;
  min-width: 85px;
  min-height: 65px;
  place-items: center;
  border: 3px solid var(--wood);
  border-radius: 12px 12px 24px 24px;
  background: white;
  letter-spacing: 7px;
}

.equal-split-source {
  display: flex;
  width: min(100%, 460px);
  min-height: 64px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--wood);
  font-weight: 800;
}

.equal-split-bins {
  display: grid;
  width: min(100%, 500px);
  min-height: min(31vh, 170px);
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
}

.equal-split-bin {
  position: relative;
  display: flex;
  min-width: 0;
  align-content: center;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 8px 7px 28px;
  border: 3px dashed var(--wood);
  border-radius: 16px 16px 28px 28px;
  background: rgba(255, 255, 255, 0.72);
}

.equal-split-bin.left-bin { border-color: var(--river); }
.equal-split-bin.right-bin { border-color: var(--leaf); }
.equal-split-bin.drop-ready { border-style: solid; background: rgba(233, 185, 79, 0.19); }
.equal-split-bin > strong { position: absolute; align-self: flex-end; margin-bottom: -24px; color: var(--forest); font-size: 12px; }
.split-dots { width: 100%; color: var(--forest); font-size: 10px; letter-spacing: 2px; text-align: center; }

.equal-split-token {
  z-index: 2;
  display: grid;
  width: clamp(40px, 8vh, 55px);
  height: clamp(40px, 8vh, 55px);
  place-items: center;
  padding: 2px;
  border: 2px solid var(--wood);
  border-radius: 14px;
  background: white;
  touch-action: none;
}

.equal-split-token img { width: 100%; height: 100%; object-fit: contain; }
.equal-split-token.selected { border-color: var(--sun); box-shadow: 0 0 0 4px rgba(233, 185, 79, 0.22); }
.equal-split-token.dragging { z-index: 20; pointer-events: none; }

.memory-count-sample { display: grid; justify-items: center; gap: 8px; }
.memory-count-sample > strong { color: var(--forest); font-size: clamp(13px, 2.8vh, 18px); }

.paint-sample,
.paint-regions { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 18px); flex-wrap: wrap; }
.paint-sample .workbook-geometry { width: clamp(55px, 14vh, 92px); height: clamp(55px, 14vh, 92px); }
.paint-sample .workbook-geometry.shape-rectangle { width: clamp(74px, 18vh, 118px); height: clamp(48px, 10vh, 69px); }
.paint-region { width: clamp(64px, 17vh, 108px); height: clamp(64px, 17vh, 108px); border: 4px dashed var(--wood); background: var(--paint-color); }
.paint-region.shape-circle { border-radius: 50%; }
.paint-region.shape-square { border-radius: 12px; }
.paint-region.shape-rectangle { width: clamp(90px, 22vh, 142px); height: clamp(57px, 12vh, 82px); border-radius: 10px; }
.paint-region.shape-triangle {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}
.paint-region.shape-triangle::before {
  color: var(--wood);
  font-size: clamp(69px, 18vh, 112px);
  line-height: .82;
  content: "△";
}
.paint-region.shape-triangle.painted::before { color: var(--paint-color); content: "▲"; }
.paint-region.drop-ready { outline: 6px solid rgba(233, 185, 79, .42); outline-offset: 3px; }
.paint-region.size-1 { scale: 0.82; }
.paint-region.size-3 { scale: 1.1; }
.paint-region.painted { border-style: solid; border-color: var(--forest); opacity: 1; }
.paint-palette { display: flex; gap: 10px; }
.paint-swatch { position: relative; z-index: 3; width: clamp(48px, 10vh, 64px); height: clamp(48px, 10vh, 64px); border: 4px solid white; border-radius: 50%; box-shadow: 0 0 0 2px var(--wood); touch-action: none; }
.paint-swatch.color-coral { background: var(--coral); }
.paint-swatch.color-river { background: var(--river); }
.paint-swatch.color-leaf { background: var(--leaf); }
.paint-swatch.color-sun { background: var(--sun); }
.paint-swatch.selected { box-shadow: 0 0 0 5px var(--forest); }
.paint-swatch.dragging { z-index: 20; box-shadow: 0 5px 18px rgba(48, 40, 33, .25), 0 0 0 5px var(--sun); pointer-events: none; }

.gravity-board { position: relative; width: min(100%, 470px); height: min(43vh, 238px); overflow: hidden; border: 2px solid var(--wood); border-radius: 22px; background: linear-gradient(#fffdf5, #f3e6c9); }
.gravity-lanes { position: absolute; inset: 0 0 54px; display: grid; grid-template-columns: repeat(var(--lane-count), 1fr); }
.gravity-lanes span { border-right: 1px dashed rgba(155, 112, 79, 0.42); }
.gravity-lanes span:last-child { border-right: 0; }
.gravity-route-layer { position: absolute; inset: 0 0 54px; }
.gravity-falling { position: absolute; z-index: 3; top: 10%; left: var(--start-left); width: clamp(48px, 11vh, 68px); height: clamp(48px, 11vh, 68px); transform: translate(-50%, -50%); }
.gravity-falling img { width: 100%; height: 100%; object-fit: contain; }
.gravity-falling.dropping { animation-duration: 650ms; animation-timing-function: linear; animation-fill-mode: forwards; }
.gravity-route-lines { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.gravity-route-lines line { stroke: var(--wood); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 3px 0 rgba(48, 40, 33, .14)); }
.gravity-baskets { position: absolute; right: 6px; bottom: 5px; left: 6px; display: grid; grid-template-columns: repeat(var(--lane-count), 1fr); gap: 7px; }
.gravity-lane-basket { min-width: 0; min-height: 49px; border: 3px solid var(--wood); border-radius: 10px 10px 22px 22px; color: var(--forest); background: rgba(255, 255, 255, 0.9); font-size: 19px; font-weight: 900; }
.gravity-lane-basket.selected { border-color: var(--sun); background: rgba(233, 185, 79, 0.24); }
.gravity-lane-basket.landing { border-color: var(--forest); background: rgba(101, 160, 111, 0.24); }

/* Recombination workbooks: all visuals are built from existing artwork/CSS. */
.number-condition-guide,
.number-pair-guide {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  text-align: center;
  color: var(--forest);
}
.number-condition-guide b { display: grid; width: 54px; height: 54px; place-items: center; border: 3px solid var(--river); border-radius: 15px; background: white; font-size: 31px; }
.number-condition-guide span { font-size: clamp(14px, 3.7vh, 21px); font-weight: 900; }
.pair-dots { display: flex; gap: 8px; align-items: center; font-size: 23px; letter-spacing: 2px; }
.pair-dots span { padding: 7px; border: 2px solid var(--river); border-radius: 13px; color: var(--river); background: white; }
.pair-dots i { color: var(--coral); font-style: normal; }
.number-pair-guide strong { width: 100%; font-size: 17px; }
.number-collect-grid { grid-template-columns: repeat(3, minmax(56px, 1fr)); }
.tap-number { display: grid; place-items: center; width: clamp(48px, 12vh, 70px); height: clamp(48px, 12vh, 70px); border: 2px solid rgba(75, 64, 51, 0.18); border-radius: 15px; color: var(--forest); background: white; font-size: clamp(29px, 8vh, 46px); font-weight: 950; }

.word-chain-board { display: flex; width: 100%; min-height: 128px; align-items: center; justify-content: center; gap: 2px; }
.word-chain-card { display: flex; min-width: 0; width: clamp(42px, calc(88% / var(--chain-count)), 66px); min-height: 112px; margin: 0; padding: 4px 2px; align-items: center; justify-content: center; flex-direction: column; border: 2px solid rgba(71, 111, 101, 0.32); border-radius: 13px; background: rgba(255, 255, 255, 0.88); }
.word-chain-card img { width: clamp(34px, 8vh, 50px); height: clamp(34px, 8vh, 50px); object-fit: contain; }
.word-chain-card figcaption { width: 100%; overflow: hidden; font-size: clamp(9px, 2.3vh, 13px); font-weight: 900; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.word-chain-card small,
.word-chain-choice small { display: flex; gap: 4px; color: var(--wood); font-size: 10px; }
.word-chain-card small i,
.word-chain-choice small i { color: var(--coral); font-size: 13px; font-style: normal; font-weight: 950; }
.word-chain-card.gap { border: 3px dashed var(--sun); background: rgba(233, 185, 79, 0.14); }
.word-chain-card.gap b { color: var(--coral); font-size: 38px; }
.word-chain-card.gap small { display: block; font-weight: 900; text-align: center; }
.word-chain-link { display: flex; min-width: 12px; align-items: center; color: var(--wood); font-size: 14px; font-weight: 950; }
.word-chain-link span { color: var(--coral); }
.word-chain-board.long-chain { gap: 0; }
.word-chain-board.long-chain .word-chain-card { width: clamp(38px, calc(78% / var(--chain-count)), 44px); min-height: 104px; }
.word-chain-board.long-chain .word-chain-card img { width: 31px; height: 31px; }
.word-chain-board.long-chain .word-chain-card figcaption { font-size: 9px; }
.word-chain-board.long-chain .word-chain-card small { font-size: 8px; }
.word-chain-board.long-chain .word-chain-card small i { font-size: 11px; }
.word-chain-board.long-chain .word-chain-link { min-width: 8px; justify-content: center; font-size: 10px; }
.word-chain-board.long-chain .word-chain-link span { display: none; }
@media (min-height: 600px) {
  .word-chain-board.long-chain .word-chain-card { width: 48px; min-height: 122px; }
  .word-chain-board.long-chain .word-chain-card img { width: 37px; height: 37px; }
  .word-chain-board.long-chain .word-chain-card figcaption { font-size: 10px; }
  .word-chain-board.long-chain .word-chain-card small { font-size: 9px; }
  .word-chain-board.long-chain .word-chain-card small i { font-size: 12px; }
}
.word-chain-board.layout-stair .word-chain-card:nth-of-type(even),
.word-chain-board.layout-zigzag .word-chain-card:nth-of-type(even) { translate: 0 7px; }
.word-chain-board.layout-arc .word-chain-card:nth-of-type(3),
.word-chain-board.layout-arc .word-chain-card:nth-of-type(4) { translate: 0 -7px; }
.word-chain-choice-card { padding: 5px; }
.word-chain-choice { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; flex-direction: column; }
.word-chain-choice img { width: clamp(48px, 13vh, 74px); height: clamp(48px, 13vh, 74px); object-fit: contain; }
.word-chain-choice strong { max-width: 100%; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

.silhouette-frame { position: relative; width: min(190px, 36vh); aspect-ratio: 1; overflow: hidden; border: 3px solid rgba(71, 111, 101, 0.28); border-radius: 24px; background: white; }
.silhouette-art { position: absolute; inset: 7%; display: grid; place-items: center; transform: translateX(calc(var(--shadow-offset) * 2.5%)) rotate(var(--shadow-rotation)) scaleX(var(--shadow-mirror-x)) scaleY(var(--shadow-mirror-y)) scale(calc(.62 + var(--shadow-scale) * .19)); }
.silhouette-art img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) saturate(100%); opacity: .88; }
.silhouette-mask {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(155, 112, 79, .72);
  color: var(--wood);
  background: repeating-linear-gradient(135deg, var(--paper-deep) 0 9px, var(--paper) 9px 18px);
}
.silhouette-mask::after { content: "？"; font-size: clamp(20px, 5vh, 32px); font-weight: 900; }
.silhouette-frame.mask-none .silhouette-mask { display: none; }
.silhouette-frame.mask-top .silhouette-mask,
.silhouette-frame.mask-bottom .silhouette-mask { right: 0; left: 0; height: calc(16% + var(--shadow-depth) * 10%); }
.silhouette-frame.mask-top .silhouette-mask { top: 0; }
.silhouette-frame.mask-bottom .silhouette-mask { bottom: 0; }
.silhouette-frame.mask-left .silhouette-mask,
.silhouette-frame.mask-right .silhouette-mask { top: 0; bottom: 0; width: calc(16% + var(--shadow-depth) * 10%); }
.silhouette-frame.mask-left .silhouette-mask { left: 0; }
.silhouette-frame.mask-right .silhouette-mask { right: 0; }

.overlap-stack-evidence { display: grid; justify-items: center; gap: 3px; width: 100%; }
.overlap-stack-board { position: relative; width: min(245px, 47vh); aspect-ratio: 1; border: 2px dashed rgba(71, 111, 101, .24); border-radius: 20px; background: rgba(255, 255, 255, .66); }
.overlap-layer { position: absolute; z-index: var(--layer-z); left: var(--layer-x); top: var(--layer-y); display: grid; width: var(--layer-scale); aspect-ratio: 1; place-items: center; transform: translate(-50%, -50%); }
.overlap-layer .workbook-geometry { width: 100%; height: 100%; scale: 1; opacity: .72; border: 3px solid rgba(48, 40, 33, .38); box-shadow: 0 2px 4px rgba(48, 40, 33, .12); }
.overlap-layer .workbook-geometry.shape-rectangle { width: 100%; height: 72%; }
.overlap-stack-evidence > strong { font-size: 15px; }

.count-order-guide,
.kana-order-guide { display: flex; min-height: 115px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: var(--forest); text-align: center; }
.count-order-guide img { width: 72px; height: 72px; object-fit: contain; }
.count-order-guide strong { font-size: 20px; }
.count-order-guide small { width: 100%; font-weight: 800; }
.kana-order-guide span { display: grid; width: 42px; height: 42px; place-items: center; border: 2px solid var(--river); border-radius: 12px; background: white; font-size: 24px; font-weight: 950; }
.kana-order-guide i { font-style: normal; font-weight: 900; }
.kana-order-guide strong { width: 100%; }

/* K14: ten everyday-number ideas share the stable select engine. */
.life-equation-evidence,
.life-compare-evidence,
.life-supply-evidence {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.2vw, 12px);
  color: var(--forest);
  text-align: center;
}
.life-equation-evidence > b,
.life-compare-evidence > b,
.life-supply-evidence > b { flex: 0 0 auto; font-size: clamp(19px, 4.8vh, 30px); }
.life-equation-evidence > span { align-self: end; font-size: clamp(12px, 2.7vh, 16px); font-weight: 900; }
.life-plate,
.life-compare-evidence figure,
.life-supply-evidence figure {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 7px;
  justify-items: center;
  gap: 3px;
  border: 2px solid rgba(155, 112, 79, 0.58);
  border-radius: 18px 18px 28px 28px;
  background: rgba(255, 255, 255, 0.72);
}
.life-plate .asset-group,
.life-compare-evidence .asset-group,
.life-supply-evidence .asset-group { width: min(100%, 150px); }
.life-plate img,
.life-compare-evidence img,
.life-supply-evidence img { width: clamp(25px, 6.4vh, 42px); height: clamp(25px, 6.4vh, 42px); }
.life-difference-board {
  display: grid;
  width: min(100%, 390px);
  justify-items: center;
  gap: clamp(6px, 1.5vh, 11px);
  color: var(--forest);
  text-align: center;
}
.life-difference-board > strong { font-size: clamp(13px, 3vh, 18px); }
.life-difference-board > div { display: flex; max-width: 100%; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.life-difference-pair { display: grid; min-width: clamp(82px, 16vh, 112px); grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2px; padding: 5px; border: 2px solid rgba(155, 112, 79, .52); border-radius: 16px; background: white; }
.life-difference-pair i { display: grid; min-width: 0; place-items: center; font-style: normal; }
.life-difference-pair img { width: clamp(31px, 7vh, 44px); height: clamp(31px, 7vh, 44px); object-fit: contain; }
.life-difference-pair b { color: var(--river); }
.life-difference-pair.extra { border-color: var(--coral); background: rgba(215, 101, 87, .1); }
.life-difference-pair.extra b { color: var(--coral); font-size: 22px; }
.life-difference-board > small { font-weight: 800; }
.life-remainder-evidence,
.life-goal-evidence,
.life-unit-evidence,
.life-ordinal-evidence {
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: center;
  gap: 7px;
  color: var(--forest);
  text-align: center;
}
.life-remainder-evidence > div,
.life-goal-evidence > div { display: flex; max-width: 100%; align-items: center; justify-content: center; gap: 5px; }
.life-story-item,
.life-goal-slot { position: relative; display: grid; width: clamp(36px, 8vh, 53px); height: clamp(36px, 8vh, 53px); place-items: center; border: 2px solid var(--wood); border-radius: 13px; background: white; }
.life-story-item img,
.life-goal-slot img { width: 90%; height: 90%; object-fit: contain; }
.life-story-item.used { opacity: 0.48; }
.life-story-item.used b { position: absolute; inset: -7px; display: grid; place-items: center; color: var(--coral); font-size: clamp(34px, 9vh, 55px); line-height: 1; opacity: 1; }
.life-goal-slot { color: var(--wood); font-size: clamp(22px, 5.4vh, 34px); font-weight: 900; }
.life-goal-slot:not(.filled) { border-style: dashed; }
.life-ticket-evidence,
.life-shopping-note {
  display: grid;
  min-width: min(100%, 250px);
  min-height: clamp(112px, 29vh, 175px);
  padding: 10px 18px;
  place-items: center;
  gap: 3px;
  border: 3px dashed var(--wood);
  border-radius: 19px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
}
.life-ticket-evidence strong { font-size: clamp(48px, 13vh, 78px); line-height: 1; }
.life-shopping-note img { width: clamp(45px, 11vh, 70px); height: clamp(45px, 11vh, 70px); object-fit: contain; }
.life-unit-evidence figure { display: grid; margin: 0; justify-items: center; }
.life-unit-evidence figure img { width: clamp(70px, 18vh, 120px); height: clamp(49px, 12vh, 78px); object-fit: contain; }
.life-unit-row { display: flex; gap: 2px; }
.life-unit-row i { display: block; width: clamp(22px, 5.6vh, 35px); aspect-ratio: 1; border: 2px solid var(--river); background: rgba(62, 140, 165, 0.17); }
.life-ordinal-evidence > div { display: flex; max-width: 100%; gap: clamp(3px, 0.7vw, 7px); }
.life-ordinal-evidence figure { display: grid; width: clamp(44px, 9vh, 62px); margin: 0; padding: 3px; place-items: center; border: 2px solid rgba(155, 112, 79, 0.58); border-radius: 12px; background: white; }
.life-ordinal-evidence img { width: clamp(32px, 7vh, 48px); height: clamp(32px, 7vh, 48px); object-fit: contain; }
.life-ordinal-evidence figcaption { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: white; background: var(--forest); font-weight: 900; }
.life-numbered-vehicle { position: relative; display: grid; min-width: 92px; min-height: 90px; place-items: center; }
.life-numbered-vehicle img { width: clamp(64px, 15vh, 96px); height: clamp(54px, 13vh, 82px); object-fit: contain; }
.life-numbered-vehicle b { position: absolute; display: grid; width: 39px; height: 39px; place-items: center; border: 3px solid var(--forest); border-radius: 50%; color: white; background: var(--river); font-size: 23px; }
.life-numbered-vehicle small { position: absolute; right: 2px; bottom: 0; color: var(--forest); font-weight: 900; }
.count-group-order-track,
.kana-order-track { gap: 5px; }
.count-group-order-card { width: clamp(58px, 8.5vw, 76px); height: clamp(64px, 18vh, 90px); min-width: 0; padding: 4px; }
.count-group-order-art { display: grid; width: 100%; height: 100%; align-content: center; justify-content: center; grid-template-columns: repeat(var(--group-columns), minmax(0, 1fr)); gap: 1px; }
.count-group-order-art img { width: 100%; min-width: 0; max-height: 34px; object-fit: contain; }
.kana-order-letter { display: grid; place-items: center; color: var(--forest); font-size: clamp(32px, 9vh, 54px); font-weight: 950; }
.kana-order-card { background: rgba(255, 255, 255, .96); }

@media (max-height: 420px) {
  .tap-collect-grid { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 3px; }
  .tap-collect-card { min-height: 48px; border-radius: 14px; }
  .tap-collect-grid.compact .tap-collect-card img { width: 40px; height: 40px; }
  .tap-number { width: 46px; height: 46px; font-size: 29px; }
  .word-chain-board { min-height: 98px; }
  .word-chain-card { min-height: 91px; width: clamp(40px, calc(88% / var(--chain-count)), 58px); }
  .word-chain-card img { width: 34px; height: 34px; }
  .word-chain-choice img { width: 45px; height: 45px; }
  .silhouette-frame { width: min(150px, 36vh); }
  .overlap-stack-board { width: min(165px, 43vh); }
  .count-group-order-art img { max-height: 24px; }
  .adjust-live-card { min-height: 75px; }
  .adjust-glass { width: 62px; height: 76px; }
  .connect-board { width: min(100%, 218px, 55vh); }
  .connect-point { width: 44px; height: 44px; }
  .paint-region { width: 63px; height: 63px; }
  .paint-swatch { width: 46px; height: 46px; }
  .gravity-board { height: min(43vh, 205px); }
}

#rotate-notice {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-content: center;
  justify-items: center;
  color: var(--forest);
  background: var(--paper);
  font-size: 24px;
  font-weight: 700;
}

.rotate-icon {
  font-size: 74px;
}

@media (max-height: 420px) {
  :root {
    --frame: 12px;
  }

  .screen {
    padding-top: 6px;
    padding-bottom: 8px;
  }

  .topbar {
    height: 58px;
  }

  .icon-button {
    width: 48px;
    min-height: 47px;
  }

  .menu-fullscreen-button,
  .menu-install-button { min-height: 47px; gap: 4px; padding: 0 8px; }
  .menu-fullscreen-button small,
  .menu-install-button small { display: inline; font-size: 11px; }
  .menu-fullscreen-button span,
  .menu-install-button span { font-size: 20px; }
  .install-help-dialog { gap: 9px; padding: 12px 14px; }
  .install-help-dialog > span { font-size: 30px; }
  .install-help-dialog h2 { font-size: 17px; }
  .install-help-dialog p { font-size: 12px; }

  .review-shortcut {
    width: 40px;
    min-height: 40px;
  }

  .retry-button { width: 40px; min-height: 40px; font-size: 25px; }
  .topbar-end { gap: 6px; }

  .home-copy {
    gap: 13px;
    width: min(55vw, 430px);
  }

  .home {
    padding-inline: max(28px, env(safe-area-inset-left));
  }
  .brand { font-size: clamp(48px, 6.5vw, 60px); }
  .home-start-button { width: min(100%, 350px); min-height: 62px; padding: 7px 11px 7px 22px; border-radius: 22px 26px 20px 24px; box-shadow: 0 5px 0 rgba(47, 86, 74, .2); }
  .home-start-button strong { font-size: 25px; }
  .home-start-button b { width: 40px; height: 40px; font-size: 24px; }
  .home-utility-actions { gap: 6px; }
  .home-utility-actions .secondary-button { min-width: 94px; min-height: 42px; padding: 0 11px; font-size: 12px; }
  .home-utility-actions .home-install-button { min-width: 116px; min-height: 42px; }

  .rest { gap: 6px; padding-top: 5px; padding-bottom: 5px; }
  .rest-moon { display: none; }
  .rest h1 { font-size: 28px; }
  .rest p { font-size: 14px; }
  .rest-clock { font-size: 38px; }
  .rest-ad-shell { width: min(82vw, 640px); padding: 2px 5px 5px; }
  .rest-ad-slot { height: 60px; }

  .primary-button {
    min-height: 50px;
  }

  .evidence-board {
    padding: 8px;
  }

  .shelf-heading { gap: 4px; padding-inline: 4px; }
  .shelf-main-controls { gap: 5px; }
  .workbook-picker { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 5px; }
  .workbook-step { width: 40px; min-width: 40px; height: 40px; font-size: 29px; }
  .workbook-tab { min-width: 96px; min-height: 40px; padding: 0 11px; font-size: 13px; }
  .workbook-tab.selected { min-width: 108px; }
  .workbook-tab small { font-size: 9px; }
  .domain-tabs { gap: 4px; }
  .domain-tab { min-width: 56px; min-height: 36px; padding: 0 10px; font-size: 13px; }
  .workbook-completion { min-width: 104px; padding: 2px 7px; }

  .test-mode-toggle {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .test-review-toolbar { gap: 5px; }
  .review-filter { min-height: 29px; padding: 0 8px; font-size: 12px; }
  .stage-review-badge { top: 5px; right: 5px; padding: 3px 6px; }
  .stage-review-comment { font-size: 10px; }

  .review-comment-dialog { gap: 7px; padding: 12px 16px; }
  .review-comment-dialog textarea { min-height: 68px; }
  .review-dialog-actions .primary-button,
  .review-dialog-actions .secondary-button { min-height: 43px; }

  .slot {
    width: 62px;
    height: 62px;
  }

  .place-actions .primary-button,
  .place-actions .secondary-button {
    min-height: 43px;
  }

  .geometry-interaction-area { gap: 6px; }
  .memory-study-area { gap: 5px; }
  .memory-study-card { min-height: 66px; padding: 7px; }
  .memory-ready-button { min-height: 46px; }
  .maze-interaction-area { gap: 3px; }
  .learning-maze { padding: 4px; }
  .learning-maze-cell { min-height: 29px; }
  .scene-order-card { height: min(29vh, 116px); }
  .scene-evidence-card img { max-height: 142px; }
  .geometry-drag-piece { height: 79px; }
  .shape-drop-bin { min-height: 98px; }
  .compose-target-board { width: 116px; height: 116px; }
  .compose-target-board.shape-rectangle { width: 150px; height: 92px; }
}

@media (min-height: 600px) and (min-width: 840px) {
  .screen {
    max-width: 1180px;
    margin: auto;
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .home {
    max-width: none;
    padding-left: max(8vw, env(safe-area-inset-left));
    padding-right: max(8vw, env(safe-area-inset-right));
  }

  .question-body {
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  }

  .choice-card {
    height: 205px;
  }

  .choice-card .asset-group img {
    width: 67px;
    height: 67px;
  }

  .stage-card img {
    width: 128px;
  }

  .place-area {
    gap: 13px;
  }
}

@media (orientation: portrait) and (max-width: 599px) {
  #rotate-notice {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
