: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 6% 9%, rgba(244, 193, 75, .22) 0 120px, transparent 122px),
    radial-gradient(circle at 95% 8%, rgba(98, 172, 214, .19) 0 158px, transparent 160px),
    linear-gradient(145deg, #f3f9ec 0%, #fffaf0 52%, #f2effc 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .16;
  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, .7); 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: search 1.5s 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,
.focus-card,
.board-heading,
.board-actions,
.status-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;
  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 9px 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: .54; box-shadow: none; }

/* Главная */
.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, 70px);
  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: 580px; margin-bottom: 19px; font-size: clamp(52px, 6.3vw, 76px); 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, #cff0f8 0 62%, #f7dfa7 62% 72%, #eabf79 72% 100%);
  border: 8px solid white;
  border-radius: 38px;
  box-shadow: 0 20px 38px rgba(57, 75, 70, .2);
  transform: rotate(1deg);
}

.hero-label {
  position: absolute;
  z-index: 6;
  top: 17px;
  left: 50%;
  padding: 8px 15px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255,255,255,.91);
  border: 2px solid #ddd5b9;
  border-radius: 999px;
  transform: translateX(-50%);
}

.hero-object { position: absolute; display: block; width: 150px; height: 155px; }
.hero-object .object-svg { width: 100%; height: 100%; }
.hero-object-0 { left: 3%; bottom: 30px; transform: rotate(-6deg); }
.hero-object-1 { left: 34%; bottom: 38px; transform: rotate(4deg); }
.hero-object-2 { right: 3%; bottom: 26px; transform: rotate(-2deg); animation: odd-bounce 1.3s ease-in-out infinite alternate; }
.hero-magnifier { position: absolute; z-index: 7; right: 4px; bottom: 4px; font-size: 55px; transform: rotate(-14deg); }
.hero-question { position: absolute; z-index: 8; right: 19%; top: 55px; color: var(--coral); font-family: Georgia, serif; font-size: 54px; font-weight: 900; transform: rotate(9deg); }

.how-section,
.levels-section { margin-top: 49px; }
.section-heading { justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 47px); font-weight: 900; letter-spacing: -.035em; }
.section-heading > p { max-width: 430px; 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: 15px;
  padding: 21px;
  background: rgba(255,253,247,.86);
  border: 2px solid #ddd5ba;
  border-radius: 25px;
  box-shadow: 0 8px 20px rgba(64, 82, 75, .07);
}
.step-number {
  display: grid;
  width: 60px;
  height: 60px;
  padding-bottom: 2px;
  place-items: center;
  color: white;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  background: var(--green);
  border: 6px solid #c7ead6;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #4f9f77;
}
.step-card:nth-child(2) .step-number { background: var(--gold); border-color: #ffefbc; box-shadow: 0 0 0 2px #d09a30; }
.step-card:nth-child(3) .step-number { background: var(--coral); border-color: #ffd1ca; box-shadow: 0 0 0 2px #c96359; }
.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: 12px; font-weight: 800; line-height: 1.4; }

.levels-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.level-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 430px;
  grid-template-rows: auto 145px 1fr auto;
  padding: 24px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  background: color-mix(in srgb, var(--accent) 13%, white);
  border: 3px solid color-mix(in srgb, var(--accent) 45%, #e4d9bb);
  border-radius: 30px;
  box-shadow: var(--soft-shadow);
  transition: transform 170ms ease, box-shadow 170ms ease;
}
.level-card::after { position: absolute; right: -45px; bottom: -65px; width: 180px; height: 180px; opacity: .12; background: var(--accent); border-radius: 50%; content: ''; }
.level-card:not(:disabled):hover { z-index: 2; transform: translateY(-6px) rotate(-.35deg); box-shadow: 0 19px 34px rgba(60, 81, 73, .16); }
.level-top { position: relative; z-index: 2; align-items: flex-start; justify-content: space-between; gap: 10px; }
.level-icon { display: grid; width: 61px; height: 61px; place-items: center; font-size: 32px; background: rgba(255,255,255,.78); border: 2px solid rgba(64,85,77,.13); border-radius: 20px; }
.level-best { padding: 7px 10px; color: color-mix(in srgb, var(--accent) 75%, #3e554f); font-size: 12px; font-weight: 900; background: rgba(255,255,255,.75); border-radius: 999px; }
.level-preview { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 0; margin: 6px 0; }
.level-preview > span { display: block; width: 105px; height: 120px; margin: 0 -17px; }
.level-preview > span:nth-child(1) { transform: rotate(-7deg); }
.level-preview > span:nth-child(2) { z-index: 2; transform: translateY(-8px); }
.level-preview > span:nth-child(3) { transform: rotate(7deg); }
.level-preview .object-svg { width: 100%; height: 100%; }
.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: 4px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.level-copy > strong { margin-bottom: 7px; font-size: 28px; font-weight: 900; }
.level-copy > span { color: #5f7772; font-size: 13px; font-weight: 800; line-height: 1.43; }
.level-footer { position: relative; z-index: 2; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed rgba(75, 97, 88, .2); }
.level-footer span { color: var(--muted); font-size: 11px; font-weight: 900; }
.level-footer b { color: var(--accent); font-size: 12px; }

.parent-tip {
  display: flex;
  max-width: 900px;
  align-items: center;
  gap: 15px;
  margin: 36px auto 0;
  padding: 18px 22px;
  background: rgba(255,255,255,.7);
  border: 2px dashed #cec8ae;
  border-radius: 22px;
}
.parent-tip > span { font-size: 29px; }
.parent-tip p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.42; }
.parent-tip strong { color: var(--ink); }

/* Игра */
.game-heading { align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.game-heading h1 { margin-bottom: 5px; font-size: clamp(34px, 4.5vw, 53px); font-weight: 900; letter-spacing: -.035em; }
.game-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 15px; font-weight: 800; }
.round-counter { min-width: 128px; padding: 13px 18px; text-align: center; background: rgba(255,253,247,.93); border: 2px solid var(--line); border-radius: 21px; box-shadow: var(--soft-shadow); }
.round-counter strong,
.round-counter span { display: block; }
.round-counter strong { font-size: 23px; font-weight: 900; }
.round-counter span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.round-track { height: 11px; margin-bottom: 14px; overflow: hidden; background: rgba(255,253,247,.9); border: 2px solid #d8d4bd; border-radius: 999px; }
.round-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #8dd6a8); border-radius: inherit; transition: width 320ms ease; }

.mission-strip { align-items: stretch; justify-content: space-between; gap: 13px; margin-bottom: 14px; }
.focus-card,
.star-card { background: rgba(255,253,247,.94); border: 2px solid var(--line); border-radius: 23px; box-shadow: var(--soft-shadow); }
.focus-card { flex: 1; gap: 14px; padding: 13px 17px; }
.focus-icon { display: grid; width: 52px; height: 52px; place-items: center; font-size: 27px; background: #edf8e9; border-radius: 17px; }
.focus-card small,
.focus-card strong { display: block; }
.focus-card small { margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.focus-card strong { font-size: 22px; font-weight: 900; }
.star-card { display: grid; min-width: 205px; place-items: center; align-content: center; padding: 10px 17px; text-align: center; }
.star-card span { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.star-card strong { color: #e7a62e; font-size: 27px; letter-spacing: 3px; }

.board-card {
  position: relative;
  padding: 22px;
  background: rgba(255,253,247,.95);
  border: 3px solid #d9d3b8;
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.board-heading { justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.board-heading h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -.025em; }
.board-heading > span { flex: 0 0 auto; padding: 8px 12px; color: var(--muted); font-size: 11px; font-weight: 900; background: #f2f5e9; border-radius: 999px; }

.object-grid { display: grid; gap: 13px; }
.object-grid.options-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.object-grid.options-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.object-grid.options-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.object-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 218px;
  place-items: center;
  padding: 12px;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(145deg, #fbfcf6, #f1f0f7);
  border: 3px solid #d9d6c5;
  border-radius: 25px;
  box-shadow: 0 8px 16px rgba(62, 79, 73, .08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.object-card:not(:disabled):hover { z-index: 2; border-color: #90b8a2; box-shadow: 0 14px 24px rgba(60, 82, 73, .14); transform: translateY(-5px) rotate(-.4deg); }
.object-card:not(:disabled):active { transform: translateY(1px) scale(.98); }
.object-figure { display: grid; width: 180px; height: 190px; max-width: 100%; place-items: center; transform: scale(var(--scale, 1)); transition: transform 230ms ease; }
.object-svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 10px 6px rgba(56, 77, 69, .15)); }
.option-number {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  padding-bottom: 2px;
  place-items: center;
  color: #5e5967;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  background: white;
  border: 2px solid #d7d2c1;
  border-radius: 50%;
}
.answer-mark { position: absolute; z-index: 7; top: 10px; right: 10px; display: grid; width: 36px; height: 36px; place-items: center; color: white; font-size: 22px; font-weight: 900; border-radius: 50%; }
.object-card.wrong { background: #fff0eb; border-color: #d86b5f; animation: wrong-shake 420ms ease; }
.object-card.wrong .answer-mark { background: #d86b5f; }
.object-card.correct { background: #e8f8e9; border-color: #4da677; box-shadow: 0 0 0 6px rgba(83,169,121,.17), 0 15px 25px rgba(55,115,86,.18); animation: correct-pop 520ms ease both; }
.object-card.correct .object-figure { transform: scale(calc(var(--scale, 1) * 1.04)); }
.object-card.correct .answer-mark { background: #4da677; }
.object-card.dimmed { opacity: .56; }
.object-card.hinted { border-color: #e7b33e; box-shadow: 0 0 0 6px rgba(241,186,67,.2); animation: hint-pulse 1s ease-in-out infinite; }

.rule-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 15px;
  padding: 15px 18px;
  background: #ecf8ea;
  border: 2px solid #b8dab9;
  border-radius: 20px;
  animation: rule-in 330ms ease both;
}
.rule-card > span { font-size: 32px; }
.rule-card strong { display: block; margin-bottom: 3px; font-size: 16px; font-weight: 900; }
.rule-card p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.4; }
.board-actions { justify-content: space-between; gap: 14px; margin-top: 18px; }
.action-note { flex: 1; color: var(--muted); font-size: 13px; font-weight: 800; text-align: center; }
.status-card { justify-content: space-between; gap: 15px; margin-top: 14px; padding: 13px 18px; background: rgba(255,253,247,.85); border: 2px solid var(--line); border-radius: 20px; }
.status-card strong,
.status-card small { display: block; }
.status-card strong { font-size: 14px; font-weight: 900; }
.status-card small { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.status-stars { color: #e5a32e; font-size: 24px; letter-spacing: 3px; }

.feedback-toast {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: 22px;
  max-width: min(560px, calc(100% - 28px));
  padding: 14px 21px;
  color: white;
  font-weight: 900;
  text-align: center;
  background: #418c6d;
  border: 4px solid white;
  border-radius: 19px;
  box-shadow: 0 15px 30px rgba(52, 73, 65, .24);
  transform: translateX(50%);
  animation: toast-in 260ms ease both;
}
.feedback-toast.try { background: #c96358; }
.feedback-toast.hint { color: #66501c; background: #f5cf68; }

/* Результат */
.result-card {
  position: relative;
  display: grid;
  min-height: 650px;
  align-items: center;
  grid-template-columns: minmax(0, .92fr) minmax(390px, 1.08fr);
  gap: clamp(32px, 6vw, 78px);
  overflow: hidden;
  padding: clamp(40px, 6vw, 72px);
  background: rgba(255,253,247,.96);
  border: 4px solid #dad3b5;
  border-radius: 47px;
  box-shadow: var(--shadow);
}
.result-card::after { position: absolute; right: -110px; bottom: -150px; width: 390px; height: 390px; background: rgba(101,185,137,.14); border-radius: 50%; content: ''; }
.result-copy,
.result-scene { position: relative; z-index: 2; }
.result-copy h1 { margin-bottom: 16px; font-size: clamp(48px, 6vw, 76px); font-weight: 900; letter-spacing: -.05em; line-height: .97; }
.result-copy > p:not(.eyebrow) { max-width: 560px; margin-bottom: 19px; color: var(--muted); font-size: 17px; font-weight: 800; line-height: 1.5; }
.result-stars { margin-bottom: 20px; color: #e6a32d; font-size: 57px; letter-spacing: 6px; line-height: 1; text-shadow: 0 3px 0 #bc7f20; }
.result-stats { flex-wrap: wrap; gap: 9px; margin-bottom: 24px; }
.result-stats > div { min-width: 118px; padding: 11px 14px; background: #eef8eb; border: 2px solid #cbdcc5; border-radius: 17px; }
.result-stats strong,
.result-stats span { display: block; }
.result-stats strong { font-size: 22px; font-weight: 900; }
.result-stats span { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.result-actions { flex-wrap: wrap; gap: 10px; }

.result-scene {
  min-height: 470px;
  overflow: hidden;
  background: linear-gradient(180deg, #d5f0f7 0 63%, #f5dea7 63% 74%, #e9bf7b 74%);
  border: 8px solid white;
  border-radius: 39px;
  box-shadow: 0 20px 37px rgba(59, 78, 70, .2);
  transform: rotate(1deg);
}
.result-badge { position: absolute; z-index: 5; top: 18px; left: 50%; padding: 8px 14px; font-size: 11px; font-weight: 900; white-space: nowrap; background: rgba(255,255,255,.9); border: 2px solid #d9d2b6; border-radius: 999px; transform: translateX(-50%); }
.result-sample { position: absolute; display: block; width: 155px; height: 160px; }
.result-sample .object-svg { width: 100%; height: 100%; }
.result-sample-0 { left: 3%; top: 76px; transform: rotate(-8deg); }
.result-sample-1 { right: 3%; top: 67px; transform: rotate(7deg); }
.result-sample-2 { left: 10%; bottom: 20px; transform: rotate(5deg); }
.result-sample-3 { right: 10%; bottom: 15px; transform: rotate(-5deg); }
.result-check { position: absolute; z-index: 7; left: 50%; top: 50%; display: grid; width: 85px; height: 85px; place-items: center; color: white; font-size: 50px; font-weight: 900; background: var(--green); border: 8px solid white; border-radius: 50%; box-shadow: 0 12px 25px rgba(47, 105, 78, .25); transform: translate(-50%, -50%) rotate(-6deg); }

.confetti { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -30px; left: var(--x); width: 12px; height: 20px; opacity: 0; background: var(--color); border-radius: 4px; animation: confetti 2.3s var(--delay) ease-in forwards; }

@keyframes search { from { transform: translate(-9px, 4px) rotate(-12deg); } to { transform: translate(10px, -5px) rotate(8deg); } }
@keyframes twinkle { 50% { opacity: .4; transform: rotate(25deg) scale(.8); } }
@keyframes odd-bounce { to { transform: translateY(-12px) rotate(5deg); } }
@keyframes wrong-shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
@keyframes correct-pop { from { transform: scale(.88); } 65% { transform: scale(1.04) rotate(-1deg); } to { transform: none; } }
@keyframes hint-pulse { 50% { box-shadow: 0 0 0 10px rgba(241,186,67,.22); } }
@keyframes rule-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(50%, 15px) scale(.94); } }
@keyframes confetti { 10% { opacity: 1; } to { opacity: .82; transform: translateY(105vh) rotate(650deg); } }

@media (max-width: 950px) {
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-scene { min-height: 330px; }
  .levels-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 300px; grid-template-columns: .85fr 1.15fr; grid-template-rows: auto 1fr auto; align-items: center; }
  .level-top { grid-column: 1 / -1; }
  .level-preview { grid-column: 1; grid-row: 2 / 4; }
  .level-copy { align-self: end; }
  .level-footer { align-self: start; }
  .object-grid.options-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .object-grid.options-5 .object-card:nth-child(4) { grid-column: 1 / 2; }
  .object-grid.options-5 .object-card:nth-child(5) { grid-column: 2 / 3; }
  .result-card { grid-template-columns: 1fr; }
  .result-scene { min-height: 450px; grid-row: 1; }
}

@media (max-width: 700px) {
  .app { width: min(100% - 18px, 1120px); padding-top: 12px; }
  .topbar { min-height: 55px; margin-bottom: 15px; }
  .brand-mark { width: 49px; height: 49px; font-size: 25px; border-radius: 16px; }
  .brand strong { font-size: 18px; }
  .brand small,
  .sound-button span:last-child,
  .top-spark { display: none; }
  .sound-button,
  .back-button { width: 47px; min-height: 47px; justify-content: center; padding: 0; }
  .hero { padding: 30px 22px; border-radius: 34px; }
  .hero h1 { font-size: clamp(48px, 14vw, 67px); }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .hero-scene { min-height: 255px; border-width: 6px; border-radius: 29px; }
  .hero-object { width: 105px; height: 120px; }
  .hero-object-0 { left: 0; }
  .hero-object-1 { left: 32%; }
  .hero-object-2 { right: 0; }
  .hero-label { font-size: 10px; }
  .hero-question { top: 43px; font-size: 40px; }
  .hero-magnifier { font-size: 39px; }
  .how-section,
  .levels-section { margin-top: 39px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 8px; text-align: left; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 105px; padding: 17px; }
  .level-card { min-height: 365px; grid-template-columns: 1fr; grid-template-rows: auto 135px 1fr auto; padding: 20px; }
  .level-top { grid-column: 1; }
  .level-preview { grid-column: 1; grid-row: 2; }
  .level-copy { align-self: auto; }
  .level-footer { align-self: auto; }
  .parent-tip { align-items: flex-start; padding: 16px; }
  .game-heading { align-items: center; }
  .game-heading h1 { font-size: 29px; }
  .game-heading > div > p:last-child { display: none; }
  .round-counter { min-width: 95px; padding: 10px; }
  .round-counter strong { font-size: 19px; }
  .mission-strip { gap: 8px; }
  .focus-card { gap: 9px; padding: 9px; }
  .focus-icon { width: 43px; height: 43px; font-size: 22px; border-radius: 14px; }
  .focus-card strong { font-size: 16px; }
  .focus-card small { font-size: 8px; }
  .star-card { min-width: 105px; padding: 8px; }
  .star-card strong { font-size: 18px; letter-spacing: 1px; }
  .board-card { padding: 14px; border-radius: 28px; }
  .board-heading { align-items: flex-start; }
  .board-heading h2 { font-size: 22px; }
  .board-heading > span { display: none; }
  .object-grid,
  .object-grid.options-4,
  .object-grid.options-5,
  .object-grid.options-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .object-grid.options-5 .object-card:nth-child(4) { grid-column: auto; }
  .object-grid.options-5 .object-card:nth-child(5) { width: calc(50% - 5px); grid-column: 1 / -1; justify-self: center; }
  .object-card { min-height: 178px; padding: 7px; border-radius: 20px; }
  .object-figure { width: 145px; height: 155px; }
  .option-number { top: 7px; left: 7px; width: 28px; height: 28px; font-size: 12px; }
  .answer-mark { top: 7px; right: 7px; width: 30px; height: 30px; font-size: 18px; }
  .rule-card { align-items: flex-start; padding: 13px; }
  .board-actions { flex-wrap: wrap; }
  .board-actions .hint-button,
  .board-actions .primary-button { flex: 1 1 190px; }
  .action-note { flex-basis: 100%; order: -1; }
  .status-card { padding: 11px 14px; }
  .status-stars { font-size: 19px; letter-spacing: 1px; }
  .feedback-toast { bottom: 12px; font-size: 13px; }
  .result-card { min-height: auto; padding: 30px 22px; border-radius: 35px; }
  .result-scene { min-height: 340px; border-width: 6px; border-radius: 29px; }
  .result-sample { width: 115px; height: 120px; }
  .result-copy h1 { font-size: clamp(47px, 14vw, 64px); }
  .result-stars { font-size: 43px; }
  .result-actions .primary-button,
  .result-actions .secondary-button { width: 100%; }
}

@media (max-width: 390px) {
  .brand strong { max-width: 145px; font-size: 16px; }
  .hero-object { width: 96px; height: 110px; }
  .object-card { min-height: 164px; }
  .object-figure { width: 132px; height: 143px; }
  .focus-card strong { font-size: 14px; }
  .rule-card strong { font-size: 14px; }
}

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