:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  color: #2d4b46;
  background: #f6f0df;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 88% 2%, rgba(255, 251, 229, .95) 0 12%, transparent 37%),
    radial-gradient(circle at 7% 42%, rgba(233, 217, 178, .34) 0 8%, transparent 29%),
    #f6f0df;
}

button { font: inherit; }
button:focus-visible { outline: 4px solid #efb64c; outline-offset: 3px; }

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

.topbar {
  min-height: 66px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  width: 64px;
  height: 52px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 16px 16px 13px 13px;
  color: #fff;
  background: #3f9475;
  box-shadow: 0 6px 0 #2e6d56;
  transform: rotate(-2deg);
}

.brand-mark::before {
  content: "";
  width: 49px;
  height: 22px;
  position: absolute;
  margin-top: -61px;
  border-radius: 7px 7px 2px 2px;
  background: #df735d;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand-mark b { font-size: 16px; }
.brand-mark i { font-size: 13px; font-style: normal; opacity: .8; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small { margin-top: 2px; color: #6e7b75; font-size: 12px; }

.top-actions { display: flex; gap: 10px; }

.sound-button,
.quiet-button,
.hint-button,
.check-button,
.next-level-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #ded3bb;
  border-radius: 14px;
  color: #53655f;
  background: rgba(255, 255, 255, .76);
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.sound-button { display: flex; align-items: center; gap: 8px; }
.sound-button:hover, .quiet-button:hover, .hint-button:hover, .next-level-button:hover { background: #fff; transform: translateY(-1px); }
.sound-button:active, .quiet-button:active, .hint-button:active, .next-level-button:active { transform: translateY(1px); }

.hero {
  min-height: 470px;
  display: grid;
  grid-template-columns: 1.07fr .93fr;
  overflow: hidden;
  border: 1px solid #ded3bc;
  border-radius: 34px;
  background: #fffaf0;
  box-shadow: 0 22px 65px rgba(75, 67, 45, .12);
}

.hero-copy {
  padding: 64px 28px 58px 58px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 8px;
  color: #79877f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 620px;
  margin: 0;
  color: #2f4d46;
  font-family: Georgia, serif;
  font-size: clamp(48px, 5.1vw, 66px);
  line-height: .98;
  letter-spacing: -.045em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 570px;
  margin: 24px 0 30px;
  color: #65766f;
  font-size: 18px;
  line-height: 1.55;
}

.primary-button {
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 17px;
  color: white;
  background: #438f70;
  box-shadow: 0 6px 0 #2f7258;
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}

.primary-button span { margin-left: 8px; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #2f7258; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #2f7258; }

.hero-scene {
  min-width: 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 239, 159, .55) 0 7%, transparent 25%),
    linear-gradient(145deg, #d9ebe0, #9fcdb7);
}

.hero-scene::after {
  content: "";
  width: 450px;
  height: 160px;
  position: absolute;
  right: -35px;
  bottom: -78px;
  border-radius: 50%;
  background: #78aa75;
}

.hero-spark { position: absolute; z-index: 3; color: #f3bd4f; }
.spark-one { top: 52px; right: 70px; font-size: 28px; }
.spark-two { top: 112px; left: 55px; color: rgba(255, 255, 255, .8); font-size: 17px; }

.hero-house {
  width: 280px;
  height: 260px;
  position: absolute;
  z-index: 2;
  top: 86px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  filter: drop-shadow(0 16px 16px rgba(47, 83, 66, .17));
}

.house-roof {
  height: 112px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  color: #fff;
  background: #df735d;
}

.house-roof b { margin-top: 40px; font-family: Georgia, serif; font-size: 54px; }

.house-floor {
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
  border: 7px solid #fff3d2;
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: #f7d79b;
}

.house-floor i {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #375a50;
  background: #fffaf0;
  box-shadow: 0 5px 0 #d8b774;
  font-family: Georgia, serif;
  font-size: 35px;
  font-style: normal;
  font-weight: 900;
}

.house-floor em { color: #7c7157; font-size: 29px; font-style: normal; font-weight: 900; }

.hero-cards {
  position: absolute;
  z-index: 4;
  right: 22px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  transform: rotate(-2deg);
}

.hero-cards span {
  padding: 10px 12px;
  border: 3px solid #fff7e3;
  border-radius: 13px;
  color: #42645b;
  background: #fffaf0;
  box-shadow: 0 5px 0 rgba(68, 89, 70, .16);
  font-weight: 900;
}

.how { padding: 58px 8px 38px; }
.how > .eyebrow { text-align: center; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-grid article { padding: 18px; text-align: center; }
.how-grid article > span {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  background: #fffaf0;
  box-shadow: 0 7px 20px rgba(76, 73, 56, .09);
  font-size: 28px;
}
.how-grid strong { display: block; font-size: 17px; }
.how-grid p { margin: 7px 0 0; color: #71807a; font-size: 14px; line-height: 1.45; }

.levels {
  padding: 42px;
  border: 1px solid #dfd6c2;
  border-radius: 32px;
  background: rgba(255, 251, 241, .75);
}

.section-heading { margin-bottom: 26px; display: flex; align-items: end; justify-content: space-between; gap: 35px; }
.section-heading h2 { margin: 0; color: #2f4d46; font-family: Georgia, serif; font-size: 39px; }
.section-heading > p { max-width: 430px; margin: 0; color: #71807a; line-height: 1.45; }
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.level-card {
  min-width: 0;
  min-height: 340px;
  padding: 17px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #e3dbc8;
  border-radius: 25px;
  color: inherit;
  background: #fffdf7;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.level-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 15px 32px rgba(67, 70, 50, .12); }
.level-card:active { transform: translateY(-1px); }
.level-number {
  width: 38px;
  height: 38px;
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 65%, #253b35);
  font-weight: 900;
}

.level-preview {
  min-height: 150px;
  margin-bottom: 17px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 19px;
  background: color-mix(in srgb, var(--accent) 14%, #fff8e7);
}

.preview-equation, .preview-lab { display: grid; place-items: center; }
.preview-equation b, .preview-lab > b {
  width: 70px;
  height: 65px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  color: #fff;
  background: var(--accent);
  font-family: Georgia, serif;
  font-size: 27px;
}
.preview-equation i { padding: 10px 20px; border-radius: 0 0 12px 12px; background: #fff; font-size: 20px; font-style: normal; font-weight: 900; }
.preview-stack { display: grid; gap: 8px; transform: rotate(-3deg); }
.preview-stack i, .preview-lab i { padding: 10px 17px; border: 2px solid #fff; border-radius: 12px; background: #fffaf0; box-shadow: 0 4px 0 rgba(60, 82, 68, .12); font-size: 18px; font-style: normal; font-weight: 900; }
.preview-lab { grid-template-columns: auto auto; gap: 7px; }
.preview-lab > b { grid-column: 1 / 3; }
.level-copy { min-height: 105px; display: block; }
.level-copy small, .level-copy strong, .level-copy em { display: block; }
.level-copy small { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.level-copy strong { margin-top: 6px; color: #354f49; font-family: Georgia, serif; font-size: 23px; }
.level-copy em { margin-top: 8px; color: #75827d; font-size: 13px; font-style: normal; line-height: 1.4; }
.level-status { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #7a8580; font-size: 12px; font-weight: 800; }
.level-status > b { color: var(--accent); font-size: 24px; }
.mini-stars { color: #efb64c; font-size: 17px; letter-spacing: 1px; }

.adult-note { margin: 22px 0 0; padding: 20px 26px; display: flex; align-items: center; gap: 15px; border: 1px solid #ddd5bd; border-radius: 22px; background: rgba(255, 253, 246, .74); }
.adult-note > span { font-size: 27px; }
.adult-note p { margin: 0; color: #6b7c75; font-size: 13px; line-height: 1.45; }
.adult-note strong { margin-right: 8px; color: #3d5b53; }

.game-shell {
  padding: 34px 40px 40px;
  border: 1px solid #ded3bc;
  border-radius: 30px;
  background: #fffaf0;
  box-shadow: 0 18px 55px rgba(75, 67, 45, .1);
}

.game-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.game-head h1 { margin: 0; color: #2e4a43; font-family: Georgia, serif; font-size: clamp(28px, 3.4vw, 43px); line-height: 1.06; }
.round-count { min-width: 80px; display: flex; align-items: baseline; justify-content: flex-end; color: #728079; }
.round-count strong { color: var(--level-accent); font-size: 34px; }
.round-count span { font-weight: 800; }
.progress-track { margin: 24px 0 28px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.progress-track i { height: 7px; border-radius: 10px; background: #e6dfcd; }
.progress-track i.done { background: #69a386; }
.progress-track i.current { background: var(--level-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--level-accent) 20%, transparent); }

.task-stage {
  min-height: 510px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  border: 6px solid #fff;
  border-radius: 27px;
  background:
    radial-gradient(circle at 8% 13%, rgba(255,255,255,.48) 0 4%, transparent 18%),
    linear-gradient(150deg, #dcece1, #acd2bc);
  box-shadow: inset 0 0 0 1px #bad5c7, 0 8px 20px rgba(66, 87, 76, .1);
}

.task-stage::after {
  content: "";
  width: 430px;
  height: 160px;
  position: absolute;
  z-index: 0;
  right: -70px;
  bottom: -105px;
  border-radius: 50%;
  background: rgba(83, 148, 105, .42);
}

.target-badge {
  width: 116px;
  min-height: 104px;
  position: absolute;
  z-index: 5;
  top: 20px;
  left: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  clip-path: polygon(50% 0, 100% 37%, 91% 100%, 9% 100%, 0 37%);
  color: #fff;
  background: var(--level-accent);
  transform: translateX(-50%);
  filter: drop-shadow(0 7px 0 rgba(48, 75, 62, .17));
}
.target-badge small { margin-top: 9px; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.target-badge strong { margin-top: -2px; font-family: Georgia, serif; font-size: 47px; line-height: 1; }

.missing-stage { padding-top: 122px; display: grid; grid-template-columns: .88fr 1.12fr; align-items: center; gap: 26px; }
.number-house { position: relative; z-index: 2; filter: drop-shadow(0 14px 12px rgba(55, 79, 65, .16)); }
.house-sum {
  width: 240px;
  height: 116px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  color: #fff;
  background: var(--level-accent);
}
.house-sum small { margin-top: 37px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.house-sum strong { margin-top: -4px; font-family: Georgia, serif; font-size: 42px; }
.house-parts { min-height: 180px; padding: 25px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border: 7px solid #fff1cf; border-top: 0; border-radius: 0 0 26px 26px; background: #edc778; }
.house-parts > div { min-width: 0; min-height: 116px; padding: 12px 8px; display: grid; place-items: center; align-content: center; border-radius: 19px; background: #fffaf0; box-shadow: 0 5px 0 #ca9e56; }
.house-parts > b { color: #675f4d; font-size: 29px; }
.house-parts span { font-family: Georgia, serif; font-size: 42px; font-weight: 900; }
.house-parts small { color: #8a8068; font-size: 10px; font-weight: 800; }
.dot-group { max-width: 92px; margin-top: 7px; display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.dot-group i { width: 8px; height: 8px; border-radius: 50%; background: #6fa98c; }
.coral-dots i { background: #df735d; }
.unknown-part span { color: var(--level-accent); }

.answer-panel { position: relative; z-index: 2; padding: 24px; border: 4px solid rgba(255,255,255,.84); border-radius: 24px; background: rgba(255, 250, 239, .9); }
.answer-panel > p { margin: 0 0 17px; color: #49645c; text-align: center; font-weight: 900; }
.number-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.number-option { min-height: 116px; padding: 12px; display: grid; place-items: center; align-content: center; border: 3px solid #eee0c3; border-radius: 20px; color: #39564f; background: #fffdf7; cursor: pointer; transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.number-option:hover { transform: translateY(-3px); border-color: var(--level-accent); box-shadow: 0 8px 0 rgba(65, 91, 73, .12); }
.number-option:active { transform: translateY(1px); }
.number-option strong { font-family: Georgia, serif; font-size: 41px; }
.number-option.wrong { border-color: #df8b78; background: #fff0e9; animation: nudge .25s ease; }
.number-option.correct { border-color: #55a97d; background: #e7f5eb; }
.number-option:disabled { cursor: default; }

.ways-stage { padding-top: 128px; }
.ways-heading { position: relative; z-index: 2; text-align: center; }
.ways-heading h2, .lab-heading h2 { margin: 0; color: #38564e; font-family: Georgia, serif; font-size: 31px; }
.equation-grid { max-width: 760px; margin: 25px auto 18px; position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.equation-card { min-height: 115px; padding: 14px; border: 4px solid #fff7e5; border-radius: 21px; color: #3a5850; background: #fffaf0; box-shadow: 0 6px 0 rgba(57, 82, 67, .13); cursor: pointer; transition: transform .14s ease, border-color .14s ease, background .14s ease; }
.equation-card:hover { transform: translateY(-3px); border-color: #f0c266; }
.equation-card:active { transform: translateY(1px); }
.equation-card > span { display: flex; align-items: center; justify-content: center; gap: 17px; }
.equation-card strong { min-width: 50px; font-family: Georgia, serif; font-size: 39px; }
.equation-card i { color: #8d8064; font-size: 27px; font-style: normal; font-weight: 900; }
.equation-card small { margin-top: 6px; display: block; color: #8a948e; font-size: 10px; font-weight: 800; }
.equation-card.selected { border-color: var(--level-accent); background: color-mix(in srgb, var(--level-accent) 11%, #fffaf0); }
.equation-card.wrong { border-color: #df8b78; background: #fff0e9; animation: nudge .25s ease; }
.equation-card.hinted { border-color: #efb84d; box-shadow: 0 0 0 6px rgba(239, 184, 77, .2), 0 6px 0 rgba(57, 82, 67, .13); }
.selected-counter { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; color: #597069; font-size: 13px; }
.selection-dots { display: flex; gap: 5px; }
.selection-dots i { width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: #c8d3cb; }
.selection-dots i.filled { background: var(--level-accent); }

.lab-stage { padding-top: 128px; }
.lab-heading { position: relative; z-index: 2; text-align: center; }
.lab-equation { width: fit-content; min-width: 310px; margin: 18px auto; padding: 10px 20px; position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 13px; border: 3px solid #fff6df; border-radius: 18px; background: rgba(255,250,240,.9); box-shadow: 0 5px 0 rgba(54, 77, 63, .13); }
.lab-equation strong { min-width: 42px; color: #3b5d53; font-family: Georgia, serif; font-size: 34px; text-align: center; }
.lab-equation i { color: #837960; font-size: 22px; font-style: normal; font-weight: 900; }
.lab-equation b { min-width: 44px; color: var(--level-accent); font-family: Georgia, serif; font-size: 36px; text-align: center; }
.lab-layout { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 15px; }
.pickers { display: grid; gap: 10px; }
.number-picker { padding: 11px; display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 11px; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; background: rgba(255,250,240,.84); }
.picker-head { min-width: 0; text-align: center; }
.picker-head small { display: block; color: #728079; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.picker-head strong { display: block; color: var(--level-accent); font-family: Georgia, serif; font-size: 42px; line-height: 1; }
.number-pad { min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(42px, 1fr)); gap: 5px; }
.number-pad button { min-width: 0; min-height: 44px; padding: 0; border: 2px solid #e5dbc5; border-radius: 12px; color: #3e5b53; background: #fffdf7; font-weight: 900; cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.number-pad button:hover { transform: translateY(-2px); border-color: var(--level-accent); }
.number-pad button:active { transform: translateY(1px); }
.number-pad button.selected { border-color: var(--level-accent); color: #fff; background: var(--level-accent); box-shadow: 0 3px 0 color-mix(in srgb, var(--level-accent) 65%, #30463e); }
.found-book { padding: 17px; border: 5px solid #fff1d2; border-radius: 21px; background: #edc778; box-shadow: 0 7px 0 rgba(72, 78, 55, .16); }
.found-book > .eyebrow { color: #725b34; text-align: center; }
.found-list { display: grid; gap: 9px; }
.found-pair, .empty-pair { min-height: 55px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; border-radius: 14px; background: #fffaf0; }
.found-pair b, .empty-pair b { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: white; background: #4c9876; }
.found-pair strong { font-size: 15px; white-space: nowrap; }
.empty-pair { color: #8b7956; background: rgba(255,250,240,.62); }
.empty-pair b { color: #826d44; background: rgba(255,255,255,.7); }
.empty-pair i { font-size: 11px; font-style: normal; font-weight: 800; }

.game-tools { margin-top: 18px; display: flex; justify-content: center; gap: 10px; }
.hint-button:disabled, .check-button:disabled { opacity: .5; cursor: default; }
.check-button { min-width: 145px; color: #fff; border-color: #4c8e71; background: #4c9474; }
.check-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 5px 0 #367158; }
.check-button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #367158; }

.feedback-card { min-height: 88px; margin-top: 22px; padding: 15px 16px 15px 19px; display: flex; align-items: center; gap: 14px; border: 1px solid #d6e4d2; border-radius: 20px; background: #eef5ec; }
.feedback-icon { width: 49px; height: 49px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 16px; background: #fff; font-size: 24px; }
.feedback-card p { margin: 0; }
.feedback-card strong, .feedback-card small { display: block; }
.feedback-card small { margin-top: 4px; color: #6b7b74; line-height: 1.35; }
.feedback-card.correct { border-color: #b7dbc5; background: #e3f3e9; }
.feedback-card.wrong { border-color: #edc9bb; background: #fff0e9; }
.feedback-card.hint { border-color: #ead491; background: #fff7d9; }
.feedback-card.found { border-color: #abd8c0; background: #e8f5eb; }
.feedback-card .compact { min-height: 48px; margin-left: auto; }

.result-wrap { min-height: 650px; padding: 28px; display: grid; place-items: center; overflow: hidden; border: 1px solid #ded3bc; border-radius: 31px; background: linear-gradient(145deg, #dbece1, #a9d0b9); box-shadow: 0 18px 55px rgba(75, 67, 45, .1); }
.result-card { width: min(650px, 100%); padding: 44px; border: 7px solid #fff4d6; border-radius: 30px; background: #fffaf0; box-shadow: 0 15px 0 rgba(61, 82, 66, .14); text-align: center; }
.result-house { width: 120px; min-height: 102px; margin: 0 auto 20px; display: grid; place-items: center; align-content: center; clip-path: polygon(50% 0, 100% 38%, 92% 100%, 8% 100%, 0 38%); color: #fff; background: #df735d; filter: drop-shadow(0 7px 0 rgba(55, 77, 64, .16)); }
.result-house b { margin-top: 11px; font-family: Georgia, serif; font-size: 40px; }
.result-house span { font-size: 9px; font-weight: 800; }
.result-card h1 { margin: 0; color: #2e4b44; font-family: Georgia, serif; font-size: 48px; line-height: 1.05; }
.result-card > p:not(.eyebrow) { max-width: 500px; margin: 16px auto; color: #6c7b75; line-height: 1.5; }
.result-stars { margin: 22px 0; color: #efb64c; font-size: 49px; letter-spacing: 5px; }
.result-stats { margin: 22px 0 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.result-stats span { padding: 13px 7px; border-radius: 16px; background: #f4ecd8; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { color: #3e695b; font-size: 27px; }
.result-stats small { margin-top: 2px; color: #817a68; font-size: 11px; }
.result-actions { display: flex; justify-content: center; gap: 10px; }
.next-level-button { min-height: 54px; }

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

@media (max-width: 1000px) {
  .level-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 230px; display: grid; grid-template-columns: 205px 1fr; grid-template-rows: 1fr auto; column-gap: 20px; }
  .level-preview { grid-row: 1 / 3; margin: 0; }
  .level-copy { min-height: 0; align-self: center; }
  .level-status { align-self: end; }
  .lab-layout { grid-template-columns: 1fr; }
  .found-list { grid-template-columns: repeat(3, 1fr); }
  .found-pair, .empty-pair { min-width: 0; }
  .found-pair strong { white-space: normal; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 47px 44px; }
  .hero-scene { min-height: 390px; }
  .missing-stage { grid-template-columns: 1fr; }
  .number-house { width: min(390px, 100%); margin: 0 auto; }
  .answer-panel { width: min(620px, 100%); margin: 0 auto; }
}

@media (max-width: 700px) {
  .app { width: min(1120px, calc(100% - 20px)); padding-top: 12px; }
  .topbar { margin-bottom: 14px; }
  .brand small, .sound-button span:last-child, .quiet-button { display: none; }
  .sound-button { width: 46px; padding: 0; justify-content: center; }
  .hero { border-radius: 25px; }
  .hero-copy { padding: 36px 26px 31px; }
  .hero h1 { font-size: 44px; }
  .hero-copy > p:not(.eyebrow) { margin: 19px 0 25px; font-size: 16px; }
  .hero-scene { min-height: 342px; }
  .hero-house { top: 47px; transform: translateX(-50%) scale(.86); transform-origin: top center; }
  .hero-cards { right: 50%; bottom: 19px; transform: translateX(50%) rotate(-2deg); }
  .hero-cards span { padding: 8px; font-size: 12px; }
  .how { padding: 42px 0 26px; }
  .how-grid { grid-template-columns: 1fr; gap: 7px; }
  .how-grid article { display: grid; grid-template-columns: 64px 1fr; column-gap: 14px; text-align: left; }
  .how-grid article > span { grid-row: 1 / 3; margin: 0; }
  .levels { padding: 28px 16px; border-radius: 24px; }
  .section-heading { display: block; }
  .section-heading h2 { font-size: 32px; }
  .section-heading > p { margin-top: 12px; }
  .level-card { min-height: 322px; display: flex; }
  .level-preview { min-height: 128px; margin-bottom: 16px; }
  .level-copy { min-height: 103px; }
  .adult-note { align-items: flex-start; }
  .game-shell { padding: 24px 12px 28px; border-radius: 24px; }
  .game-head { align-items: flex-start; }
  .game-head h1 { font-size: 29px; }
  .round-count { min-width: 57px; }
  .round-count strong { font-size: 27px; }
  .progress-track { margin: 18px 0 22px; gap: 4px; }
  .task-stage { min-height: 520px; padding: 22px 10px; border-width: 4px; }
  .target-badge { top: 13px; transform: translateX(-50%) scale(.86); transform-origin: top center; }
  .missing-stage, .ways-stage, .lab-stage { padding-top: 105px; }
  .house-sum { width: 210px; }
  .house-parts { min-height: 160px; padding: 18px; }
  .number-options { gap: 8px; }
  .number-option { min-height: 102px; }
  .equation-grid { gap: 8px; }
  .equation-card { min-height: 104px; padding: 10px 5px; }
  .equation-card > span { gap: 8px; }
  .equation-card strong { min-width: 35px; font-size: 32px; }
  .ways-heading h2, .lab-heading h2 { font-size: 26px; }
  .lab-equation { min-width: 0; width: min(310px, 100%); }
  .number-picker { grid-template-columns: 1fr; }
  .picker-head { display: flex; align-items: center; justify-content: center; gap: 11px; }
  .picker-head strong { font-size: 33px; }
  .number-pad { grid-template-columns: repeat(7, minmax(38px, 1fr)); gap: 4px; }
  .number-pad button { min-height: 44px; }
  .found-list { grid-template-columns: 1fr; }
  .found-pair, .empty-pair { min-height: 48px; }
  .feedback-card { align-items: flex-start; }
  .feedback-card.correct { flex-wrap: wrap; }
  .feedback-card.correct p { flex: 1; }
  .feedback-card .compact { width: 100%; margin: 11px 0 0; }
  .result-wrap { min-height: 590px; padding: 13px; border-radius: 24px; }
  .result-card { padding: 30px 15px; }
  .result-card h1 { font-size: 40px; }
  .result-stars { font-size: 40px; }
  .result-stats small { font-size: 10px; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
  .quiet-button.large { display: inline-block; }
}

@media (max-width: 390px) {
  .app { width: min(1120px, calc(100% - 16px)); }
  .brand-mark { width: 58px; }
  .game-shell { padding-left: 9px; padding-right: 9px; }
  .task-stage { padding-left: 7px; padding-right: 7px; }
  .number-pad { grid-template-columns: repeat(7, minmax(36px, 1fr)); gap: 3px; }
  .number-picker { padding: 8px 6px; }
  .found-book { padding: 13px 10px; }
}

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