:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #2d504d;
  --muted: #6b817c;
  --paper: #fffdf7;
  --line: #ddd4b7;
  --green: #65b989;
  --green-dark: #35785e;
  --gold: #f2bd4d;
  --coral: #ef7468;
  --blue: #62acd6;
  --purple: #8b73bd;
  --shadow: 0 18px 44px rgba(62, 83, 75, .14);
  --soft-shadow: 0 9px 23px rgba(62, 83, 75, .11);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: #f4f9ed;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 9%, rgba(245, 195, 78, .2) 0 120px, transparent 122px),
    radial-gradient(circle at 94% 8%, rgba(98, 172, 214, .18) 0 154px, transparent 156px),
    linear-gradient(145deg, #f3f9ed 0%, #fffaf1 54%, #f2effc 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .15;
  background-image: radial-gradient(#6f9186 1px, transparent 1px);
  background-size: 26px 26px;
  content: '';
  pointer-events: none;
}

button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(240, 185, 68, .72); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 48px;
}

.loading-card {
  display: grid;
  width: min(410px, 100%);
  min-height: 250px;
  margin: 20vh auto 0;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 37px;
  box-shadow: var(--shadow);
}

.loading-card span { font-size: 60px; animation: float 1.4s ease-in-out infinite alternate; }
.loading-card p { margin: 0; font-size: 19px; font-weight: 900; }

.topbar,
.topbar-actions,
.brand,
.section-heading,
.level-top,
.level-footer,
.game-heading,
.mission-strip,
.question-row,
.board-actions,
.feedback-card,
.result-actions,
.result-stats {
  display: flex;
  align-items: center;
}

.topbar {
  position: relative;
  z-index: 30;
  min-height: 66px;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  gap: 12px;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
}

.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  padding-bottom: 2px;
  font-size: 28px;
  background: #fff8dc;
  border: 3px solid #dfd2aa;
  border-radius: 19px;
  box-shadow: 0 7px 16px rgba(67, 87, 78, .12);
  transform: rotate(-4deg);
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 25px; font-weight: 900; line-height: 1.04; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.topbar-actions { gap: 10px; }
.top-spark { color: var(--gold); font-size: 28px; animation: twinkle 2s ease-in-out infinite; }

.sound-button,
.back-button {
  min-height: 49px;
  color: var(--ink);
  font-weight: 900;
  background: rgba(255, 253, 247, .92);
  border: 2px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 7px 16px rgba(65, 83, 76, .08);
}

.sound-button { display: flex; align-items: center; gap: 9px; padding: 0 17px; font-size: 13px; }
.back-button { width: 49px; padding: 0 0 3px; font-size: 23px; }

.eyebrow {
  margin: 0 0 8px;
  color: #397b62;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.hint-button {
  display: inline-flex;
  min-height: 53px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 21px;
  font-weight: 900;
  border-radius: 17px;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.primary-button { color: white; background: #3e9875; border: 0; box-shadow: 0 8px 0 #2f785e, 0 16px 27px rgba(49, 122, 94, .2); }
.secondary-button { color: var(--ink); background: #fffdf6; border: 2px solid #d7d2b9; box-shadow: 0 6px 0 #ddd7c4; }
.hint-button { min-height: 46px; color: #715418; background: #fff3c5; border: 2px solid #e7bd50; box-shadow: 0 5px 0 #d8aa39; }
.primary-button.compact { min-height: 46px; padding-inline: 17px; box-shadow: 0 5px 0 #2f785e; }
.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.hint-button:not(:disabled):hover { transform: translateY(-2px); }
.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.hint-button:not(:disabled):active { transform: translateY(3px); box-shadow: none; }
.hint-button:disabled { opacity: .55; }

.hero {
  position: relative;
  display: grid;
  min-height: 400px;
  grid-template-columns: 1.03fr .97fr;
  overflow: hidden;
  background: linear-gradient(115deg, #fff9e9 0 47%, #eef8ed 47% 100%);
  border: 3px solid #ded4b6;
  border-radius: 38px;
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after { position: absolute; border-radius: 50%; content: ''; pointer-events: none; }
.hero::before { width: 170px; height: 170px; right: -48px; bottom: -75px; background: rgba(98, 172, 214, .16); }
.hero::after { width: 105px; height: 105px; left: 42%; top: -70px; background: rgba(242, 189, 77, .2); }
.hero-copy { z-index: 1; padding: 62px 28px 56px 52px; }
.hero h1 { max-width: 520px; margin-bottom: 20px; font-size: clamp(42px, 5.1vw, 70px); font-weight: 900; line-height: .95; letter-spacing: -.045em; }
.hero-copy > p:not(.eyebrow) { max-width: 510px; margin-bottom: 30px; color: #607772; font-size: 17px; font-weight: 700; line-height: 1.55; }

.hero-scene {
  position: relative;
  min-height: 400px;
  overflow: hidden;
  background:
    radial-gradient(circle at 56% 45%, rgba(255, 255, 255, .82) 0 118px, transparent 120px),
    linear-gradient(145deg, rgba(164, 220, 190, .2), rgba(102, 172, 214, .2));
}

.hero-scene::after { position: absolute; height: 4px; left: 39px; right: 36px; bottom: 54px; background: #8caf8f; border-radius: 99px; content: ''; }
.hero-ruler { position: absolute; width: 38px; height: 285px; left: 35px; bottom: 53px; border-left: 5px solid #e4ae43; }
.hero-ruler i { position: absolute; left: -5px; width: 25px; height: 4px; background: #e4ae43; border-radius: 99px; }
.hero-ruler i:nth-child(1) { top: 0; }
.hero-ruler i:nth-child(2) { top: 33%; }
.hero-ruler i:nth-child(3) { top: 66%; }
.hero-ruler i:nth-child(4) { bottom: 0; }
.hero-object { position: absolute; z-index: 2; display: block; width: 185px; height: 290px; bottom: 33px; filter: drop-shadow(0 10px 8px rgba(54, 91, 88, .13)); }
.hero-object.short { left: 58px; }
.hero-object.tall { right: 21px; }
.hero-object .object-svg { width: 100%; height: 100%; }
.hero-arrow { position: absolute; z-index: 4; left: calc(50% - 18px); top: 115px; color: #d69a2f; font-family: Georgia, serif; font-size: 52px; font-weight: 900; animation: point-vertical 1.1s ease-in-out infinite alternate; }
.hero-question { position: absolute; z-index: 5; right: 20px; bottom: 19px; padding: 10px 15px; color: #815719; font-size: 13px; font-weight: 900; background: #fff1ae; border: 2px solid #e7bf4d; border-radius: 14px; transform: rotate(-2deg); }

.how-section,
.levels-section { margin-top: 62px; }
.section-heading { justify-content: space-between; gap: 30px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4.5vw, 52px); font-weight: 900; line-height: 1; letter-spacing: -.035em; }
.section-heading > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.45; text-align: right; }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.step-card { display: flex; min-height: 122px; align-items: center; gap: 17px; padding: 20px; background: rgba(255, 253, 247, .93); border: 2px solid var(--line); border-radius: 27px; box-shadow: var(--soft-shadow); }
.step-number { display: grid; flex: 0 0 59px; height: 59px; place-items: center; padding-bottom: 4px; color: white; font-family: Georgia, serif; font-size: 26px; font-weight: 900; line-height: 1; background: #5db48a; border: 6px solid #dff4e7; border-radius: 50%; }
.step-card:nth-child(2) .step-number { background: #eeb640; border-color: #fff0bd; }
.step-card:nth-child(3) .step-number { background: #ec796d; border-color: #ffe0d9; }
.step-card strong,
.step-card small { display: block; }
.step-card strong { margin-bottom: 6px; font-size: 19px; font-weight: 900; }
.step-card small { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.42; }

.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.level-card { display: flex; min-width: 0; min-height: 410px; flex-direction: column; padding: 21px; overflow: hidden; text-align: left; background: rgba(255, 253, 247, .95); border: 3px solid color-mix(in srgb, var(--accent), white 62%); border-radius: 31px; box-shadow: var(--soft-shadow); transition: transform 180ms ease, box-shadow 180ms ease; }
.level-card:not(:disabled):hover { transform: translateY(-6px); box-shadow: 0 22px 34px rgba(62, 83, 75, .17); }
.level-card:nth-child(2) { background: linear-gradient(150deg, #fffdf7, #eff8fd); }
.level-card:nth-child(3) { background: linear-gradient(150deg, #fffdf7, #f4effd); }
.level-top { justify-content: space-between; }
.level-icon { display: grid; width: 54px; height: 54px; place-items: center; padding-bottom: 2px; font-size: 27px; background: color-mix(in srgb, var(--accent), white 76%); border-radius: 18px; }
.level-best { color: #bf8a26; font-size: 13px; font-weight: 900; letter-spacing: .03em; }
.level-preview { display: flex; height: 127px; align-items: end; justify-content: center; gap: 3px; margin: 12px -7px 17px; overflow: hidden; background: rgba(255, 255, 255, .62); border-radius: 24px; }
.level-preview > span { display: block; width: 104px; height: 126px; }
.level-preview .object-svg { width: 100%; height: 100%; }
.level-preview > b { align-self: center; color: var(--accent); font-family: Georgia, serif; font-size: 24px; }
.level-copy { display: block; flex: 1; }
.level-copy small,
.level-copy strong,
.level-copy span { display: block; }
.level-copy small { margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.level-copy strong { margin-bottom: 9px; font-size: 28px; font-weight: 900; line-height: 1.05; }
.level-copy span { color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.45; }
.level-footer { justify-content: space-between; margin-top: 18px; padding-top: 15px; border-top: 2px dashed color-mix(in srgb, var(--accent), white 60%); }
.level-footer span { color: var(--muted); font-size: 12px; font-weight: 900; }
.level-footer b { color: var(--accent); font-size: 13px; }
.parent-tip { display: flex; gap: 15px; margin-top: 22px; padding: 19px 24px; color: #526d67; background: rgba(225, 243, 229, .83); border: 2px solid #b9dac3; border-radius: 24px; }
.parent-tip > span { font-size: 25px; }
.parent-tip p { margin: 0; font-size: 14px; line-height: 1.55; }

.game-shell { display: grid; gap: 17px; }
.game-heading { justify-content: space-between; gap: 28px; padding: 28px 34px; background: linear-gradient(115deg, #fffaf0, color-mix(in srgb, var(--level-accent), white 85%)); border: 3px solid #ded4b6; border-radius: 33px; box-shadow: var(--soft-shadow); }
.game-heading h1 { margin-bottom: 7px; font-size: clamp(31px, 4.5vw, 51px); font-weight: 900; line-height: 1; letter-spacing: -.035em; }
.game-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; }
.round-badge { display: grid; flex: 0 0 80px; height: 80px; place-items: center; align-content: center; color: var(--ink); background: #fffdf6; border: 4px solid color-mix(in srgb, var(--level-accent), white 36%); border-radius: 25px; transform: rotate(2deg); }
.round-badge strong { padding-bottom: 2px; font-family: Georgia, serif; font-size: 30px; line-height: .9; }
.round-badge span { color: var(--muted); font-size: 11px; font-weight: 900; }
.mission-strip { min-height: 52px; justify-content: space-between; gap: 18px; padding: 11px 17px; background: rgba(255, 253, 247, .86); border: 2px solid var(--line); border-radius: 18px; }
.mission-strip > span { color: var(--muted); font-size: 12px; font-weight: 900; white-space: nowrap; }
.progress-dots { display: flex; flex: 1; gap: 7px; }
.progress-dot { flex: 1; height: 8px; background: #e7e3d8; border-radius: 99px; }
.progress-dot.done { background: #78bf94; }
.progress-dot.current { background: var(--level-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--level-accent), transparent 75%); }

.comparison-card { padding: 24px; background: rgba(255, 253, 247, .96); border: 3px solid var(--line); border-radius: 32px; box-shadow: var(--soft-shadow); }
.question-row { justify-content: space-between; gap: 22px; margin-bottom: 20px; padding-inline: 6px; }
.question-row h2 { margin: 0; font-size: clamp(30px, 4.5vw, 48px); font-weight: 900; line-height: 1.03; letter-spacing: -.035em; }
.measure-badge { flex: 0 0 auto; padding: 12px 17px; color: #3b7160; font-size: 13px; font-weight: 900; background: #e6f5e9; border: 2px solid #aad3b6; border-radius: 16px; }
.measure-badge.width { color: #3c6d87; background: #e7f5fd; border-color: #afd4e8; }
.measure-badge.length { color: #6b5593; background: #f1eafa; border-color: #cbbbdf; }

.comparison-board { position: relative; display: grid; min-height: 355px; gap: 17px; padding: 22px 22px 59px; overflow: hidden; background: linear-gradient(#f8fbf3, #eff6e8); border: 2px dashed #b8ceb5; border-radius: 27px; }
.comparison-board[data-option-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.comparison-board[data-option-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-lines { position: absolute; inset: 28px 18px 55px; pointer-events: none; }
.guide-lines i { position: absolute; left: 0; right: 0; height: 2px; background-image: repeating-linear-gradient(90deg, rgba(111, 145, 134, .21) 0 7px, transparent 7px 15px); }
.guide-lines i:nth-child(1) { top: 10%; }
.guide-lines i:nth-child(2) { top: 43%; }
.guide-lines i:nth-child(3) { top: 76%; }
.ground-line { position: absolute; z-index: 4; height: 5px; left: 20px; right: 20px; bottom: 106px; background: #86ad8c; border-radius: 99px; pointer-events: none; }
.ground-line span { position: absolute; right: 0; top: 9px; padding: 4px 9px; color: #68826f; font-size: 9px; font-weight: 900; background: #f5f9ef; border-radius: 7px; text-transform: uppercase; }

.object-option { position: relative; z-index: 3; display: grid; min-width: 0; min-height: 278px; place-items: center; padding: 10px 10px 22px; background: rgba(255, 253, 247, .82); border: 3px solid #ddd8c6; border-radius: 25px; box-shadow: 0 7px 0 #d7d2c0, 0 12px 19px rgba(61, 78, 72, .08); transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.object-option:not(:disabled):hover { border-color: #b9cfae; transform: translateY(-4px); box-shadow: 0 10px 0 #d7d2c0, 0 18px 26px rgba(61, 78, 72, .11); }
.object-option:disabled { cursor: default; opacity: 1; }
.object-stage { display: flex; width: 100%; height: 245px; align-items: flex-end; justify-content: center; }
.object-stage .object-svg { display: block; width: min(250px, 100%); height: 245px; overflow: visible; filter: drop-shadow(0 7px 5px rgba(54, 91, 88, .12)); }
.object-shadow { pointer-events: none; }
.option-number { position: absolute; z-index: 7; display: grid; width: 39px; height: 39px; left: 12px; top: 12px; place-items: center; padding-bottom: 3px; color: #667d77; font-family: Georgia, serif; font-size: 20px; font-weight: 900; line-height: 1; background: #fffdf7; border: 3px solid #d9d4c3; border-radius: 50%; box-shadow: 0 4px 8px rgba(60, 78, 71, .1); }
.choice-mark { position: absolute; z-index: 8; display: grid; width: 38px; height: 38px; right: 11px; top: 11px; place-items: center; color: white; font-size: 19px; background: #58af7f; border: 3px solid white; border-radius: 50%; opacity: 0; transform: scale(.5); transition: 160ms ease; }
.object-option.correct { border-color: #66b989; background: #f0fbf2; box-shadow: 0 7px 0 #58a777, 0 0 0 6px #d9f1df; }
.object-option.correct .choice-mark { opacity: 1; transform: scale(1); }
.object-option.wrong { border-color: #df746a; background: #fff3ef; animation: shake 330ms ease; }
.object-option.hinted::after { position: absolute; z-index: 9; inset: -7px; border: 6px solid #f1bc46; border-radius: 29px; box-shadow: 0 0 0 8px rgba(255, 226, 132, .5); content: ''; pointer-events: none; animation: hint-pulse 800ms ease-in-out infinite alternate; }
.board-actions { justify-content: space-between; gap: 14px; margin-top: 18px; }
.control-tip { padding: 9px 13px; color: #657d76; font-size: 11px; font-weight: 900; background: #eff5e9; border-radius: 12px; }

.feedback-card { min-height: 84px; gap: 14px; padding: 14px 18px; background: rgba(255, 253, 247, .97); border: 3px solid var(--line); border-radius: 24px; box-shadow: var(--soft-shadow); }
.feedback-card .feedback-icon { display: grid; flex: 0 0 51px; height: 51px; place-items: center; font-size: 25px; background: #f1f2e8; border-radius: 16px; }
.feedback-card p { flex: 1; margin: 0; }
.feedback-card strong,
.feedback-card small { display: block; }
.feedback-card strong { margin-bottom: 3px; font-size: 17px; font-weight: 900; }
.feedback-card small { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.4; }
.feedback-card.correct { border-color: #9acdad; background: #f0fbf2; }
.feedback-card.correct .feedback-icon { background: #d8f2df; }
.feedback-card.wrong { border-color: #efaaa2; background: #fff2ef; }
.feedback-card.wrong .feedback-icon { background: #ffe0db; }
.feedback-card.hint { border-color: #eac66a; background: #fff8dd; }
.feedback-card.hint .feedback-icon { background: #ffedaa; }

.result-card { position: relative; min-height: 690px; overflow: hidden; padding: 55px 50px 46px; text-align: center; background: linear-gradient(145deg, #fffaf0, color-mix(in srgb, var(--level-accent), white 88%)); border: 3px solid #ded4b6; border-radius: 39px; box-shadow: var(--shadow); }
.result-card::before,
.result-card::after { position: absolute; border-radius: 50%; content: ''; }
.result-card::before { width: 220px; height: 220px; left: -80px; bottom: -80px; background: rgba(98, 172, 214, .15); }
.result-card::after { width: 180px; height: 180px; right: -60px; top: -70px; background: rgba(242, 189, 77, .18); }
.result-icon { display: grid; width: 84px; height: 84px; margin: 0 auto 15px; place-items: center; padding-bottom: 2px; font-size: 43px; background: #fff7d4; border: 4px solid #e1ce8b; border-radius: 28px; box-shadow: 0 9px 18px rgba(64, 80, 73, .12); transform: rotate(-4deg); }
.result-card h1 { margin-bottom: 10px; font-size: clamp(44px, 6vw, 68px); font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.result-lead { margin-bottom: 10px; color: var(--muted); font-weight: 700; }
.result-stars { color: #f1b83f; font-size: 42px; letter-spacing: 7px; text-shadow: 0 4px 0 #cf9125; }
.result-stars span { color: #d8d5c8; text-shadow: none; }
.result-scene { position: relative; z-index: 2; display: flex; width: min(610px, 100%); height: 195px; align-items: end; justify-content: center; gap: 8px; margin: 11px auto 20px; overflow: hidden; background: rgba(255, 255, 255, .58); border: 2px solid #e2dcc6; border-radius: 25px; }
.result-object { display: block; width: 170px; height: 190px; }
.result-object .object-svg { width: 100%; height: 100%; }
.result-arrows { position: absolute; left: 0; right: 0; bottom: 8px; color: #7c6ca5; font-family: Georgia, serif; font-size: 18px; font-weight: 900; }
.result-stats { position: relative; z-index: 2; width: min(510px, 100%); justify-content: center; margin: 0 auto 28px; overflow: hidden; background: rgba(255, 255, 255, .7); border: 2px solid #ded7c0; border-radius: 22px; }
.result-stats span { flex: 1; padding: 13px 9px; border-right: 2px solid #e4dec9; }
.result-stats span:last-child { border-right: 0; }
.result-stats strong,
.result-stats small { display: block; }
.result-stats strong { padding-bottom: 2px; font-family: Georgia, serif; font-size: 25px; }
.result-stats small { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.result-actions { position: relative; z-index: 2; justify-content: center; gap: 14px; }
.result-confetti i { position: absolute; z-index: 3; color: var(--gold); font-style: normal; animation: float 1.4s ease-in-out infinite alternate; }
.result-confetti i:nth-child(1) { left: 12%; top: 16%; color: var(--coral); }
.result-confetti i:nth-child(2) { left: 22%; top: 38%; color: var(--blue); animation-delay: -.5s; }
.result-confetti i:nth-child(3) { right: 15%; top: 28%; color: var(--green); animation-delay: -.8s; }
.result-confetti i:nth-child(4) { right: 8%; bottom: 19%; color: var(--gold); animation-delay: -.2s; }
.result-confetti i:nth-child(5) { left: 9%; bottom: 15%; color: var(--purple); animation-delay: -.7s; }

@keyframes float { to { transform: translateY(-9px) rotate(4deg); } }
@keyframes twinkle { 50% { opacity: .45; transform: scale(.76) rotate(20deg); } }
@keyframes point-vertical { to { transform: translateY(9px); } }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-5px); } }
@keyframes hint-pulse { to { box-shadow: 0 0 0 13px rgba(255, 226, 132, .18); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 46px 40px 28px; }
  .hero-scene { min-height: 330px; }
  .hero-object { bottom: 19px; }
  .hero-object.short { left: calc(50% - 200px); }
  .hero-object.tall { right: calc(50% - 200px); }
  .hero-ruler { left: calc(50% - 235px); bottom: 39px; }
  .hero-scene::after { left: calc(50% - 235px); right: calc(50% - 235px); bottom: 40px; }
  .hero-arrow { left: calc(50% - 18px); top: 91px; }
  .hero-question { right: calc(50% - 220px); }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 98px; }
  .levels-grid { grid-template-columns: 1fr; }
  .level-card { display: grid; min-height: 255px; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; column-gap: 22px; }
  .level-top, .level-copy, .level-footer { grid-column: 1; }
  .level-preview { grid-column: 2; grid-row: 1 / 4; height: auto; margin: 0; }
  .comparison-board { padding-inline: 14px; }
}

@media (max-width: 680px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 12px; }
  .topbar { min-height: 58px; margin-bottom: 13px; }
  .brand-mark { width: 48px; height: 48px; font-size: 23px; border-radius: 16px; }
  .brand strong { font-size: 18px; }
  .brand small { display: none; }
  .sound-button { width: 49px; padding: 0; justify-content: center; }
  .sound-button span:last-child { display: none; }
  .back-button { width: 46px; min-height: 46px; }
  .hero { border-radius: 29px; }
  .hero-copy { padding: 37px 23px 24px; }
  .hero h1 { font-size: clamp(39px, 13vw, 58px); }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .hero-scene { min-height: 295px; transform: scale(.88); margin: -18px -24px -5px; }
  .how-section, .levels-section { margin-top: 45px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 11px; text-align: left; }
  .section-heading h2 { font-size: 38px; }
  .level-card { display: flex; min-height: 390px; }
  .level-preview { width: 100%; height: 126px; margin: 12px 0 17px; }
  .game-heading { padding: 23px 20px; border-radius: 27px; }
  .game-heading h1 { font-size: 34px; }
  .round-badge { flex-basis: 66px; height: 66px; border-radius: 20px; }
  .mission-strip { align-items: flex-start; flex-direction: column; }
  .mission-strip > span { align-self: flex-end; }
  .comparison-card { padding: 15px 12px 17px; border-radius: 26px; }
  .question-row { align-items: flex-start; }
  .question-row h2 { font-size: 31px; }
  .measure-badge { padding: 9px 10px; font-size: 10px; border-radius: 12px; }
  .comparison-board { min-height: 320px; gap: 7px; padding: 13px 7px 53px; border-radius: 22px; }
  .object-option { min-height: 250px; padding: 7px 3px 18px; border-radius: 20px; }
  .object-stage { height: 224px; }
  .object-stage .object-svg { height: 224px; }
  .option-number { width: 34px; height: 34px; left: 7px; top: 7px; padding-bottom: 3px; font-size: 17px; }
  .choice-mark { width: 34px; height: 34px; right: 6px; top: 6px; }
  .ground-line { left: 9px; right: 9px; bottom: 92px; }
  .guide-lines { inset-inline: 8px; }
  .feedback-card { align-items: flex-start; flex-wrap: wrap; }
  .feedback-card .primary-button { width: 100%; }
  .result-card { min-height: 650px; padding: 46px 18px 38px; border-radius: 30px; }
  .result-scene { height: 166px; }
  .result-object { width: 110px; height: 158px; }
  .result-actions { align-items: stretch; flex-direction: column-reverse; }
}

@media (max-width: 400px) {
  .brand strong { max-width: 155px; font-size: 16px; }
  .topbar-actions { gap: 5px; }
  .hero-copy { padding-inline: 18px; }
  .hero-scene { transform: scale(.79); margin: -28px -48px -15px; }
  .primary-button { width: 100%; }
  .question-row { gap: 8px; }
  .question-row h2 { font-size: 28px; }
  .comparison-board[data-option-count="2"],
  .comparison-board[data-option-count="3"] { gap: 5px; }
  .object-option { min-height: 232px; border-width: 2px; }
  .object-stage, .object-stage .object-svg { height: 210px; }
  .comparison-board[data-option-count="3"] .option-number { width: 31px; height: 31px; font-size: 15px; }
  .board-actions { align-items: stretch; flex-direction: column; }
  .control-tip { align-self: flex-start; }
  .hint-button { width: 100%; }
  .feedback-card { padding: 13px; }
  .feedback-card .feedback-icon { flex-basis: 43px; height: 43px; }
  .result-card h1 { font-size: 42px; }
  .result-scene { margin-inline: -5px; width: calc(100% + 10px); }
  .result-stats small { font-size: 9px; }
}

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