:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #2d504d;
  --muted: #6b817d;
  --paper: #fffdf7;
  --cream: #fff5d8;
  --line: #ddd5b9;
  --green: #62b486;
  --green-dark: #35785e;
  --gold: #f0b944;
  --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,
.choice-heading,
.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;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
}

.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  font-size: 29px;
  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; 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 { color: #715418; background: #fff3c5; border: 2px solid #e7bd50; box-shadow: 0 6px 0 #d8aa39; }
.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: .52; box-shadow: none; }
.primary-button.compact { min-height: 46px; margin-left: auto; padding-inline: 17px; border-radius: 14px; font-size: 14px; box-shadow: 0 6px 0 #2f785e; }

/* Главная */
.hero {
  position: relative;
  display: grid;
  min-height: 510px;
  align-items: center;
  grid-template-columns: minmax(0, 1.03fr) minmax(390px, .97fr);
  gap: clamp(30px, 5vw, 64px);
  overflow: hidden;
  padding: clamp(42px, 6vw, 72px);
  background: linear-gradient(120deg, rgba(255, 253, 247, .98), rgba(247, 244, 255, .97));
  border: 3px solid #ddd4b7;
  border-radius: 46px;
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after { position: absolute; content: ''; border-radius: 50%; pointer-events: none; }
.hero::before { top: -175px; left: 43%; width: 350px; height: 350px; background: rgba(245, 195, 78, .17); }
.hero::after { right: -80px; bottom: -105px; width: 280px; height: 280px; background: rgba(101, 185, 137, .15); }
.hero-copy { position: relative; z-index: 3; }
.hero h1 { max-width: 620px; margin-bottom: 19px; font-size: clamp(50px, 6vw, 74px); font-weight: 900; letter-spacing: -.05em; line-height: .98; }
.hero-copy > p:not(.eyebrow) { max-width: 570px; margin-bottom: 27px; color: var(--muted); font-size: 18px; font-weight: 800; line-height: 1.52; }

.hero-scene {
  position: relative;
  z-index: 2;
  min-height: 365px;
  overflow: hidden;
  background: linear-gradient(180deg, #ccecf4 0 55%, #bde39b 56% 100%);
  border: 8px solid white;
  border-radius: 36px;
  box-shadow: 0 20px 36px rgba(62, 82, 74, .18), inset 0 0 0 3px #d6d1b8;
  transform: rotate(1.4deg);
}
.hero-scene::after { position: absolute; right: -35px; bottom: -38px; width: 170px; height: 115px; background: #8ccb75; border-radius: 50%; content: ''; }
.hero-cloud { position: absolute; z-index: 1; width: 70px; height: 25px; background: rgba(255,255,255,.85); border-radius: 999px; }
.hero-cloud::before,
.hero-cloud::after { position: absolute; bottom: 0; background: inherit; border-radius: 50%; content: ''; }
.hero-cloud::before { left: 12px; width: 34px; height: 34px; }
.hero-cloud::after { right: 8px; width: 28px; height: 28px; }
.hero-cloud-one { top: 40px; left: 25px; }
.hero-cloud-two { top: 78px; right: 30px; transform: scale(.72); }
.hero-animals { position: absolute; z-index: 3; right: 5%; bottom: 38px; left: 5%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.hero-animals span { display: grid; place-items: end center; }
.hero-animals .object-svg { width: 105px; height: 105px; filter: drop-shadow(0 8px 5px rgba(48, 70, 65, .16)); }
.hero-animals span:nth-child(1) { transform: rotate(-5deg); }
.hero-animals span:nth-child(3) { transform: rotate(5deg); }
.hero-count { position: absolute; z-index: 5; top: 25px; left: 50%; display: grid; min-width: 190px; min-height: 105px; place-items: center; align-content: center; padding: 10px; background: rgba(255,253,247,.95); border: 3px solid #ddd4b7; border-radius: 24px; box-shadow: var(--soft-shadow); transform: translateX(-50%) rotate(-2deg); }
.hero-count small { color: var(--muted); font-size: 11px; font-weight: 900; }
.hero-count strong { font-family: Georgia, serif; font-size: 49px; line-height: .9; }
.hero-count span { color: var(--gold); font-size: 14px; letter-spacing: 4px; }

.how-section,
.levels-section { margin-top: 50px; }
.section-heading { justify-content: space-between; gap: 25px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4.4vw, 46px); font-weight: 900; letter-spacing: -.04em; }
.section-heading > p { max-width: 440px; 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, minmax(0, 1fr)); gap: 13px; }
.step-card { display: grid; min-height: 130px; align-items: center; grid-template-columns: 66px 1fr; gap: 14px; padding: 19px; background: rgba(255, 253, 247, .9); border: 2px solid var(--line); border-radius: 25px; box-shadow: var(--soft-shadow); }
.step-number { display: grid; width: 59px; height: 59px; place-items: center; color: white; font-family: Georgia, serif; font-size: 28px; font-weight: 900; background: var(--green); border: 5px solid #d6eddd; border-radius: 50%; }
.step-card:nth-child(2) .step-number { background: var(--blue); border-color: #d8edf7; }
.step-card:nth-child(3) .step-number { background: var(--purple); border-color: #e5ddf3; }
.step-card strong,
.step-card small { display: block; }
.step-card strong { margin-bottom: 5px; font-size: 18px; font-weight: 900; }
.step-card small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.42; }

.levels-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.level-card { position: relative; display: flex; min-width: 0; min-height: 415px; flex-direction: column; padding: 23px; overflow: hidden; text-align: left; background: #fffdf7; border: 3px solid color-mix(in srgb, var(--accent), white 55%); border-radius: 31px; box-shadow: var(--soft-shadow); transition: transform 180ms ease, box-shadow 180ms ease; }
.level-card::after { position: absolute; right: -38px; bottom: -50px; width: 140px; height: 140px; background: color-mix(in srgb, var(--accent), transparent 82%); border-radius: 50%; content: ''; }
.level-card:not(:disabled):hover { transform: translateY(-6px); box-shadow: 0 18px 34px rgba(62, 83, 75, .16); }
.level-top { position: relative; z-index: 2; justify-content: space-between; }
.level-icon { display: grid; width: 53px; height: 53px; place-items: center; font-size: 27px; background: color-mix(in srgb, var(--accent), white 77%); border-radius: 17px; }
.level-best { color: #786437; font-size: 13px; font-weight: 900; letter-spacing: .07em; }
.level-preview { position: relative; z-index: 2; display: grid; min-height: 116px; align-items: center; grid-template-columns: 1fr 52px; gap: 7px; margin: 16px 0 17px; padding: 9px; background: color-mix(in srgb, var(--accent), white 89%); border: 2px solid color-mix(in srgb, var(--accent), white 65%); border-radius: 21px; }
.preview-objects { display: grid; grid-template-columns: repeat(2, 1fr); }
.preview-objects .object-svg { width: 52px; height: 52px; }
.level-preview > b { display: grid; width: 46px; height: 46px; place-items: center; color: white; font-family: Georgia, serif; font-size: 26px; background: var(--accent); border-radius: 50%; }
.level-copy { position: relative; z-index: 2; display: block; }
.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: .1em; text-transform: uppercase; }
.level-copy strong { margin-bottom: 8px; font-size: 25px; font-weight: 900; letter-spacing: -.02em; }
.level-copy > span { color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.42; }
.level-footer { position: relative; z-index: 2; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 17px; font-size: 12px; font-weight: 900; }
.level-footer b { color: var(--accent); }
.parent-tip { display: grid; max-width: 900px; grid-template-columns: 54px 1fr; gap: 15px; margin: 39px auto 0; padding: 20px 24px; background: #fff7d8; border: 2px solid #ead28c; border-radius: 24px; }
.parent-tip > span { display: grid; width: 49px; height: 49px; place-items: center; font-size: 25px; background: white; border-radius: 16px; }
.parent-tip p { align-self: center; margin: 0; color: #715f3f; font-size: 14px; font-weight: 800; line-height: 1.5; }

/* Игровой экран */
.game-shell { padding: clamp(24px, 4vw, 46px); background: rgba(255, 253, 247, .96); border: 3px solid #ddd4b7; border-radius: 42px; box-shadow: var(--shadow); }
.game-heading { justify-content: space-between; gap: 24px; }
.game-heading h1 { max-width: 820px; margin-bottom: 7px; font-size: clamp(31px, 4.5vw, 49px); font-weight: 900; letter-spacing: -.04em; line-height: 1.03; }
.game-heading > div > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 16px; font-weight: 800; }
.round-badge { display: grid; min-width: 84px; height: 84px; place-items: center; align-content: center; color: white; background: var(--level-accent); border: 7px solid color-mix(in srgb, var(--level-accent), white 70%); border-radius: 50%; box-shadow: 0 8px 17px rgba(62, 83, 75, .15); }
.round-badge strong { font-family: Georgia, serif; font-size: 29px; line-height: .9; }
.round-badge span { margin-top: 3px; font-size: 11px; font-weight: 900; }
.mission-strip { justify-content: space-between; gap: 18px; margin: 25px 0 20px; padding: 13px 17px; background: color-mix(in srgb, var(--level-accent), white 91%); border: 2px solid color-mix(in srgb, var(--level-accent), white 68%); border-radius: 18px; }
.mission-strip > span { font-size: 12px; font-weight: 900; }
.progress-dots { display: grid; width: min(560px, 70%); grid-template-columns: repeat(10, minmax(7px, 1fr)); gap: 6px; }
.progress-dot { height: 9px; background: white; border: 1px solid color-mix(in srgb, var(--level-accent), white 56%); border-radius: 999px; }
.progress-dot.done { background: var(--level-accent); }
.progress-dot.current { background: var(--gold); box-shadow: 0 0 0 3px rgba(241, 189, 72, .2); }

.scene-board { position: relative; min-height: 420px; overflow: hidden; background: linear-gradient(180deg, #d9f0f5 0 57%, #b9df91 58% 100%); border: 3px solid #c9d9c7; border-radius: 31px; isolation: isolate; }
.scene-land { position: absolute; z-index: 0; right: -5%; bottom: -65px; left: -5%; height: 180px; background: #9fd078; border-radius: 50% 50% 0 0; }
.scene-sun { position: absolute; z-index: 0; top: 24px; right: 31px; width: 58px; height: 58px; background: #f5c34e; border: 6px solid rgba(255,255,255,.55); border-radius: 50%; box-shadow: 0 0 0 12px rgba(245,195,78,.18); }
.scene-cloud { position: absolute; z-index: 0; width: 78px; height: 25px; background: rgba(255,255,255,.82); border-radius: 999px; }
.scene-cloud::before,
.scene-cloud::after { position: absolute; bottom: 0; background: inherit; border-radius: 50%; content: ''; }
.scene-cloud::before { left: 12px; width: 37px; height: 37px; }
.scene-cloud::after { right: 9px; width: 29px; height: 29px; }
.cloud-a { top: 42px; left: 30px; }
.cloud-b { top: 98px; right: 120px; transform: scale(.7); }
.scene-items { position: relative; z-index: 3; display: grid; min-height: 414px; align-items: center; justify-content: center; grid-template-columns: repeat(var(--scene-columns), minmax(0, 1fr)); gap: 5px 12px; padding: 25px 34px 18px; }
.scene-item { position: relative; display: grid; min-width: 0; place-items: center; transform: rotate(var(--angle)); }
.scene-item .object-svg { width: 108px; height: 104px; max-width: 100%; filter: drop-shadow(0 8px 5px rgba(48, 70, 65, .16)); }
.density-low .scene-item .object-svg { width: 125px; height: 120px; }
.density-high .scene-items { gap: 1px 9px; padding-block: 19px 12px; }
.density-high .scene-item .object-svg { width: 91px; height: 88px; }
.decoy-item { opacity: .92; }
.count-marker { position: absolute; z-index: 6; top: 1px; right: max(2px, 9%); display: grid; width: 30px; height: 30px; place-items: center; padding-top: 1px; color: white; font-family: Georgia, serif; font-size: 16px; font-weight: 900; line-height: 1; background: #3e9875; border: 3px solid white; border-radius: 50%; box-shadow: 0 5px 10px rgba(47, 93, 75, .2); animation: marker-in .25s ease both; }

.theme-ocean { background: linear-gradient(180deg, #bde9f3 0 15%, #76c8de 16% 100%); }
.theme-ocean .scene-land { bottom: -115px; height: 170px; background: #58b5d1; box-shadow: 0 -19px 0 rgba(255,255,255,.25), 0 -38px 0 rgba(255,255,255,.12); }
.theme-ocean .scene-sun { display: none; }
.theme-pond { background: linear-gradient(180deg, #d8eff5 0 43%, #b8df91 44% 100%); }
.theme-pond .scene-land { bottom: -105px; height: 210px; background: #70c1d5; border: 18px solid #93ca79; }
.theme-snow { background: linear-gradient(180deg, #d8eff8 0 58%, #f5fbff 59% 100%); }
.theme-snow .scene-land { background: white; box-shadow: 0 -10px 0 #d8edf4; }
.theme-beach { background: linear-gradient(180deg, #cdeef4 0 54%, #f6d890 55% 100%); }
.theme-beach .scene-land { background: #edc975; }
.theme-sky { background: linear-gradient(180deg, #c5eaf5, #e8f7fa); }
.theme-sky .scene-land { display: none; }
.theme-home { background: linear-gradient(180deg, #fff2dc 0 65%, #d9b786 66% 100%); }
.theme-home::before { position: absolute; inset: 0 0 35%; z-index: 0; opacity: .24; background-image: linear-gradient(90deg, #efb4a9 2px, transparent 2px), linear-gradient(#efb4a9 2px, transparent 2px); background-size: 34px 34px; content: ''; }
.theme-home .scene-land { bottom: -110px; height: 170px; background: #c99f69; }
.theme-home .scene-sun,
.theme-home .scene-cloud { display: none; }
.theme-farm { background: linear-gradient(180deg, #d9f0f5 0 57%, #ecd18b 58% 100%); }
.theme-farm .scene-land { background: repeating-linear-gradient(90deg, #c98c5a 0 11px, #edc083 12px 37px); }
.theme-forest { background: linear-gradient(180deg, #cfe9df 0 45%, #82bd78 46% 100%); }
.theme-forest::before,
.theme-forest::after { position: absolute; z-index: 0; bottom: 22px; width: 90px; height: 260px; background: linear-gradient(90deg, transparent 38%, #8c684d 39% 61%, transparent 62%), radial-gradient(ellipse at 50% 28%, #5f9f68 0 38%, transparent 39%); content: ''; }
.theme-forest::before { left: -10px; }
.theme-forest::after { right: -10px; transform: scale(.85); }
.theme-orchard { background: linear-gradient(180deg, #d8eff5 0 54%, #aad583 55% 100%); }
.theme-orchard::before,
.theme-orchard::after { position: absolute; z-index: 0; top: 5px; width: 120px; height: 180px; background: radial-gradient(circle at 34% 32%, #ef7468 0 6px, transparent 7px), radial-gradient(circle at 66% 26%, #ef7468 0 6px, transparent 7px), radial-gradient(ellipse at 50% 36%, #69aa6d 0 40%, transparent 41%), linear-gradient(90deg, transparent 44%, #8b694d 45% 56%, transparent 57%); content: ''; }
.theme-orchard::before { left: 6px; }
.theme-orchard::after { right: 6px; transform: scale(.83); }

.choice-section { margin-top: 29px; }
.choice-heading { justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.choice-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 37px); font-weight: 900; letter-spacing: -.03em; }
.numbers-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.number-card { position: relative; display: grid; min-width: 0; min-height: 152px; place-items: center; align-content: center; gap: 5px; padding: 13px; overflow: hidden; background: white; border: 3px solid #d9d5c2; border-radius: 25px; box-shadow: 0 7px 0 #d8d3bf, 0 13px 23px rgba(62, 83, 75, .1); transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, opacity 150ms ease; }
.number-card:not(:disabled):hover { border-color: var(--level-accent); transform: translateY(-4px); }
.number-card:not(:disabled):active { box-shadow: 0 2px 0 #d8d3bf; transform: translateY(4px); }
.number-card > strong { font-family: Georgia, serif; font-size: 65px; line-height: .9; }
.number-dots { display: flex; min-height: 21px; flex-wrap: wrap; justify-content: center; gap: 3px; }
.number-dots i { width: 8px; height: 8px; background: var(--level-accent); border-radius: 50%; }
.option-number { position: absolute; top: 9px; left: 10px; z-index: 3; display: grid; width: 29px; height: 29px; place-items: center; color: var(--ink); font-family: Georgia, serif; font-size: 14px; font-weight: 900; background: #f7f5ed; border: 2px solid #ded9c8; border-radius: 50%; }
.answer-mark { position: absolute; right: 10px; bottom: 9px; z-index: 3; display: grid; width: 34px; height: 34px; place-items: center; color: white; font-size: 22px; font-weight: 900; border-radius: 50%; }
.number-card.is-wrong { opacity: .56; background: #fff1ef; border-color: #e8837a; box-shadow: none; animation: shake .33s ease; }
.number-card.is-wrong .answer-mark { background: #df665d; }
.number-card.is-correct { background: #e8f7e9; border-color: #65b989; box-shadow: 0 0 0 5px rgba(101,185,137,.18); animation: solved-pop .38s ease-out; }
.number-card.is-correct .answer-mark { background: #3e9875; }
.number-card.is-dimmed { opacity: .55; box-shadow: none; }
.number-card:disabled { cursor: default; }

.feedback-card { min-height: 82px; gap: 14px; margin-top: 22px; padding: 15px 17px; background: #f5f7f3; border: 2px solid #d8dfd7; border-radius: 22px; }
.feedback-icon { display: grid; min-width: 49px; height: 49px; place-items: center; font-size: 25px; background: white; border-radius: 15px; }
.feedback-card p { margin: 0; }
.feedback-card strong,
.feedback-card small { display: block; }
.feedback-card strong { margin-bottom: 4px; font-size: 16px; font-weight: 900; }
.feedback-card small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.feedback-card.wrong { background: #fff2ef; border-color: #efbbb5; }
.feedback-card.hint { background: #fff7da; border-color: #ead189; }
.feedback-card.correct { background: #eaf8ec; border-color: #acd9b5; }

/* Результат */
.result-card { position: relative; min-height: 700px; overflow: hidden; padding: clamp(34px, 6vw, 66px); text-align: center; background: linear-gradient(145deg, #fffdf7, color-mix(in srgb, var(--level-accent), white 91%)); border: 3px solid #ddd4b7; border-radius: 44px; box-shadow: var(--shadow); }
.result-card::before,
.result-card::after { position: absolute; content: ''; border-radius: 50%; }
.result-card::before { top: -120px; left: -90px; width: 290px; height: 290px; background: rgba(245,195,78,.18); }
.result-card::after { right: -90px; bottom: -120px; width: 300px; height: 300px; background: color-mix(in srgb, var(--level-accent), transparent 80%); }
.result-card > * { position: relative; z-index: 2; }
.result-icon { display: grid; width: 89px; height: 89px; margin: 0 auto 15px; place-items: center; font-size: 47px; background: white; border: 4px solid color-mix(in srgb, var(--level-accent), white 55%); border-radius: 29px; box-shadow: var(--soft-shadow); transform: rotate(-4deg); }
.result-card h1 { margin-bottom: 10px; font-size: clamp(43px, 6vw, 66px); font-weight: 900; letter-spacing: -.05em; }
.result-lead { max-width: 650px; margin: 0 auto 9px; color: var(--muted); font-size: 17px; font-weight: 800; line-height: 1.5; }
.result-stars { color: var(--gold); font-size: 50px; letter-spacing: 7px; text-shadow: 0 4px 0 #d89e2f; }
.result-stars span { color: #e4decd; text-shadow: none; }
.result-animals { display: grid; max-width: 760px; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 20px auto; padding: 10px; background: rgba(255,255,255,.72); border: 2px solid #ded8c4; border-radius: 24px; }
.result-animals > span { position: relative; display: grid; min-width: 0; min-height: 115px; place-items: center; background: white; border: 2px solid #e0ddcf; border-radius: 16px; animation: animal-in .35s ease both; animation-delay: var(--delay); }
.result-animals .object-svg { width: 90px; height: 86px; }
.result-animals b { position: absolute; right: 5px; bottom: 5px; display: grid; width: 27px; height: 27px; place-items: center; color: white; font-family: Georgia, serif; background: var(--level-accent); border-radius: 50%; }
.result-stats { max-width: 680px; justify-content: center; margin: 0 auto 28px; overflow: hidden; background: rgba(255,255,255,.72); border: 2px solid #ded8c4; border-radius: 23px; }
.result-stats > span { min-width: 0; flex: 1; padding: 17px 10px; }
.result-stats > span + span { border-left: 2px solid #e3decf; }
.result-stats strong,
.result-stats small { display: block; }
.result-stats strong { margin-bottom: 4px; font-family: Georgia, serif; font-size: 29px; }
.result-stats small { color: var(--muted); font-size: 11px; font-weight: 900; }
.result-actions { justify-content: center; gap: 13px; }
.result-confetti i { position: absolute; color: var(--level-accent); font-family: Georgia, serif; font-size: 24px; font-style: normal; font-weight: 900; animation: float 1.7s ease-in-out infinite alternate; }
.result-confetti i:nth-child(1) { top: 10%; left: 8%; color: var(--coral); }
.result-confetti i:nth-child(2) { top: 20%; right: 11%; color: var(--blue); animation-delay: .3s; }
.result-confetti i:nth-child(3) { bottom: 21%; left: 12%; color: var(--green); animation-delay: .6s; }
.result-confetti i:nth-child(4) { top: 9%; right: 27%; color: var(--gold); animation-delay: .9s; }
.result-confetti i:nth-child(5) { bottom: 12%; right: 8%; color: var(--purple); animation-delay: .4s; }
.result-confetti i:nth-child(6) { top: 36%; left: 5%; color: var(--gold); animation-delay: .7s; }

@keyframes marker-in { 50% { transform: scale(1.16) rotate(4deg); } }
@keyframes solved-pop { 50% { transform: scale(1.05) rotate(1deg); } }
@keyframes animal-in { from { opacity: 0; transform: translateY(10px) scale(.9); } }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes float { to { transform: translateY(-10px) rotate(4deg); } }
@keyframes twinkle { 50% { opacity: .45; transform: rotate(25deg) scale(.75); } }

@media (max-width: 900px) {
  .hero { min-height: 0; grid-template-columns: 1fr; padding: 44px; }
  .hero-copy { text-align: center; }
  .hero-copy > p:not(.eyebrow) { margin-inline: auto; }
  .hero-scene { width: min(520px, 100%); min-height: 340px; margin: 0 auto; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 105px; }
  .levels-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 255px; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 0 18px; }
  .level-top { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .level-best { display: none; }
  .level-preview { grid-column: 2; margin: 0 0 15px; }
  .level-copy { grid-column: 2; }
  .level-footer { grid-column: 2; }
  .numbers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 12px; }
  .topbar { min-height: 53px; margin-bottom: 13px; }
  .brand { gap: 8px; }
  .brand-mark { width: 46px; height: 46px; font-size: 23px; border-radius: 15px; }
  .brand strong { font-size: 19px; }
  .brand small,
  .sound-button span:last-child,
  .top-spark { display: none; }
  .sound-button,
  .back-button { width: 46px; min-height: 46px; justify-content: center; padding: 0; }
  .hero { padding: 34px 21px; border-radius: 31px; }
  .hero h1 { font-size: clamp(42px, 13vw, 58px); }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .hero-scene { min-height: 300px; border-width: 6px; border-radius: 27px; }
  .hero-count { min-width: 160px; min-height: 89px; }
  .hero-count strong { font-size: 42px; }
  .hero-animals .object-svg { width: 85px; height: 85px; }
  .how-section,
  .levels-section { margin-top: 38px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading > p { text-align: left; }
  .section-heading h2 { font-size: 34px; }
  .step-card { grid-template-columns: 55px 1fr; padding: 16px; }
  .step-number { width: 52px; height: 52px; font-size: 24px; }
  .level-card { min-height: 392px; grid-template-columns: 1fr; padding: 19px; }
  .level-top, .level-preview, .level-copy, .level-footer { grid-column: 1; }
  .level-top { grid-row: auto; margin-bottom: 13px; }
  .level-best { display: block; }
  .level-preview { min-height: 108px; }
  .parent-tip { grid-template-columns: 44px 1fr; padding: 17px; }
  .parent-tip > span { width: 42px; height: 42px; }
  .game-shell { padding: 20px 14px 22px; border-radius: 29px; }
  .game-heading { align-items: flex-start; }
  .game-heading h1 { font-size: 30px; }
  .game-heading > div > p:not(.eyebrow) { font-size: 14px; line-height: 1.4; }
  .round-badge { min-width: 66px; height: 66px; border-width: 5px; }
  .round-badge strong { font-size: 23px; }
  .mission-strip { margin-block: 18px 14px; padding: 10px 12px; }
  .mission-strip > span { display: none; }
  .progress-dots { width: 100%; }
  .scene-board { min-height: 330px; border-radius: 23px; }
  .scene-items { min-height: 324px; gap: 1px 4px; padding: 17px 8px 10px; }
  .scene-item .object-svg,
  .density-low .scene-item .object-svg { width: 82px; height: 79px; }
  .density-high .scene-item .object-svg { width: 72px; height: 69px; }
  .count-marker { top: 0; right: 1px; width: 25px; height: 25px; border-width: 2px; font-size: 13px; }
  .scene-sun { top: 18px; right: 20px; width: 45px; height: 45px; }
  .choice-section { margin-top: 24px; }
  .choice-heading { align-items: flex-end; }
  .choice-heading h2 { font-size: 27px; }
  .choice-heading .eyebrow { margin-bottom: 4px; }
  .hint-button { min-height: 45px; padding: 0 12px; font-size: 13px; border-radius: 14px; }
  .numbers-grid { gap: 9px; }
  .number-card { min-height: 125px; padding: 9px; border-radius: 20px; }
  .number-card > strong { font-size: 53px; }
  .option-number { top: 7px; left: 7px; width: 26px; height: 26px; font-size: 12px; }
  .answer-mark { right: 7px; bottom: 7px; width: 29px; height: 29px; font-size: 19px; }
  .feedback-card { align-items: flex-start; min-height: 0; padding: 13px; }
  .feedback-icon { min-width: 42px; height: 42px; font-size: 21px; }
  .feedback-card.correct { flex-wrap: wrap; }
  .feedback-card.correct p { min-width: 0; flex: 1; }
  .feedback-card .primary-button.compact { width: 100%; margin-left: 0; }
  .result-card { min-height: 0; padding: 39px 17px; border-radius: 31px; }
  .result-card h1 { font-size: 43px; }
  .result-icon { width: 75px; height: 75px; font-size: 39px; }
  .result-stars { font-size: 40px; }
  .result-animals { grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 7px; border-radius: 16px; }
  .result-animals > span { min-height: 93px; border-radius: 11px; }
  .result-animals .object-svg { width: 70px; height: 67px; }
  .result-stats small { min-height: 26px; }
  .result-actions { align-items: stretch; flex-direction: column-reverse; }
}

@media (max-width: 400px) {
  .brand strong { max-width: 145px; font-size: 17px; }
  .game-heading h1 { font-size: 27px; }
  .round-badge { min-width: 60px; height: 60px; }
  .scene-board { min-height: 305px; }
  .scene-items { min-height: 299px; }
  .scene-item .object-svg,
  .density-low .scene-item .object-svg { width: 74px; height: 71px; }
  .density-high .scene-item .object-svg { width: 65px; height: 62px; }
  .choice-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .hint-button { align-self: stretch; }
}

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