:root {
  color-scheme: light;
  font-family: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  font-synthesis: none;
  --ink: #294b49;
  --muted: #6b827e;
  --paper: #fffdf7;
  --cream: #fff5d9;
  --line: #d9d7bd;
  --green: #67bd91;
  --green-dark: #347a61;
  --gold: #f3bd4c;
  --coral: #f27b68;
  --blue: #62addb;
  --shadow: 0 18px 44px rgba(70, 98, 88, .14);
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 12%, rgba(255, 225, 135, .32) 0 110px, transparent 112px),
    radial-gradient(circle at 91% 8%, rgba(125, 205, 185, .24) 0 150px, transparent 152px),
    linear-gradient(180deg, #ecfaf7 0%, #f9f8e9 100%);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 5px solid rgba(243, 189, 76, .55);
  outline-offset: 4px;
}

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

.loading-card {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(360px, calc(100% - 40px));
  padding: 34px;
  text-align: center;
  background: var(--paper);
  border: 3px solid #d8dac4;
  border-radius: 34px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.loading-card span {
  display: block;
  font-size: 58px;
}

.loading-card p {
  margin: 12px 0 0;
  font-weight: 900;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  margin-bottom: 25px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 4px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  font-size: 31px;
  background: #fff8dc;
  border: 3px solid #e1d6ad;
  border-radius: 19px;
  box-shadow: 0 8px 18px rgba(81, 106, 95, .12);
  transform: rotate(-4deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(19px, 2.1vw, 27px);
  font-weight: 900;
  line-height: 1.05;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-button,
.pause-button,
.back-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--ink);
  font-weight: 900;
  background: rgba(255, 253, 247, .86);
  border: 2px solid #d5d9c5;
  border-radius: 17px;
  box-shadow: 0 7px 17px rgba(67, 91, 82, .09);
  cursor: pointer;
}

.sound-button span:first-child,
.pause-button span:first-child {
  font-size: 20px;
}

.back-button {
  width: 48px;
  padding: 0;
  font-size: 25px;
}

.top-spark {
  color: #e9a73a;
  font-size: 25px;
  animation: twinkle 2.2s ease-in-out infinite;
}

.hero {
  position: relative;
  display: grid;
  min-height: 400px;
  align-items: center;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, .94fr);
  gap: clamp(28px, 5vw, 80px);
  overflow: hidden;
  padding: clamp(35px, 5vw, 72px);
  background:
    linear-gradient(120deg, rgba(255,255,255,.95), rgba(255,250,226,.93)),
    var(--paper);
  border: 3px solid #d9d4b7;
  border-radius: 48px;
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  position: absolute;
  content: '';
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  top: -105px;
  right: -90px;
  width: 340px;
  height: 340px;
  background: rgba(105, 190, 146, .13);
}

.hero::after {
  bottom: -130px;
  left: 34%;
  width: 290px;
  height: 290px;
  background: rgba(98, 173, 219, .1);
}

.hero-copy,
.hero-demo {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(39px, 5.7vw, 76px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: .98;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 27px;
  color: #58716c;
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 700;
  line-height: 1.55;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 57px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 25px;
  font-weight: 900;
  border-radius: 19px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #4fa87b, #33785e);
  border: 0;
  box-shadow: 0 12px 22px rgba(52, 122, 97, .25);
}

.secondary-button {
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid #d6d4bd;
  box-shadow: 0 8px 18px rgba(68, 91, 82, .1);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.hero-demo {
  min-height: 310px;
  padding: 25px;
  background: linear-gradient(#cceefa 0 64%, #cce8a8 64%);
  border: 8px solid #fff;
  border-radius: 38px;
  box-shadow: 0 19px 32px rgba(66, 94, 83, .17);
  transform: rotate(1.6deg);
}

.demo-target {
  position: absolute;
  top: 19px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-weight: 900;
  background: rgba(255,255,255,.94);
  border: 2px solid #d6d8c6;
  border-radius: 999px;
  box-shadow: 0 6px 13px rgba(58, 89, 78, .13);
  transform: translateX(-50%);
}

.demo-target i {
  width: 24px;
  height: 24px;
  background: #f06f62;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #b94f49;
}

.demo-object {
  position: absolute;
  display: grid;
  width: var(--s);
  height: var(--s);
  place-items: center;
  font-size: calc(var(--s) * .61);
  filter: drop-shadow(0 9px 7px rgba(61, 90, 79, .18));
  animation: demo-float var(--d) ease-in-out infinite alternate;
}

.demo-object.one { --s: 96px; --d: 2.1s; top: 100px; left: 40px; }
.demo-object.two { --s: 81px; --d: 2.5s; top: 76px; right: 46px; animation-delay: -.8s; }
.demo-object.three { --s: 105px; --d: 2.8s; bottom: 23px; left: 42%; animation-delay: -1.5s; }
.demo-object.four { --s: 69px; --d: 2s; bottom: 30px; right: 25px; animation-delay: -.3s; }

.how-section,
.levels-section {
  margin-top: clamp(42px, 6vw, 76px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(29px, 3.7vw, 48px);
  font-weight: 900;
  letter-spacing: -.025em;
}

.section-heading > p {
  max-width: 470px;
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 24px;
  background: rgba(255, 253, 247, .82);
  border: 2px solid #dcd9c3;
  border-radius: 26px;
}

.step-number {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  background: var(--step, var(--green));
  border: 5px solid rgba(255,255,255,.72);
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--step, var(--green)) 70%, #536b64);
}

.step-card:nth-child(2) { --step: #efb74b; }
.step-card:nth-child(3) { --step: #ee7d6e; }

.step-card strong,
.step-card > span:last-child,
.step-card > span:last-child > span {
  display: block;
}

.step-card strong {
  margin-bottom: 3px;
  font-size: 19px;
  font-weight: 900;
}

.step-card span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.level-card {
  position: relative;
  min-height: 248px;
  overflow: hidden;
  padding: 27px;
  color: var(--ink);
  text-align: left;
  background: var(--level-bg);
  border: 3px solid var(--level-line);
  border-radius: 31px;
  box-shadow: 0 12px 25px rgba(68, 92, 83, .1);
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.level-card:hover {
  box-shadow: 0 18px 30px rgba(68, 92, 83, .16);
  transform: translateY(-5px) rotate(-.3deg);
}

.level-card.easy { --level-bg: #e8f8e8; --level-line: #add8ad; --accent: #53a973; }
.level-card.normal { --level-bg: #fff4cf; --level-line: #e7d18b; --accent: #d99c32; }
.level-card.fast { --level-bg: #ffe7df; --level-line: #edb7a8; --accent: #dc6c5c; }

.level-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.level-icon {
  display: grid;
  width: 65px;
  height: 65px;
  place-items: center;
  font-size: 35px;
  background: rgba(255,255,255,.75);
  border: 2px solid rgba(70, 94, 83, .15);
  border-radius: 22px;
}

.level-best {
  padding: 7px 11px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  background: rgba(255,255,255,.75);
  border-radius: 999px;
}

.level-card h3 {
  position: relative;
  z-index: 2;
  margin: 17px 0 6px;
  font-size: 27px;
  font-weight: 900;
}

.level-card p {
  position: relative;
  z-index: 2;
  max-width: 280px;
  margin-bottom: 17px;
  color: #59716c;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.level-meta {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 900;
}

.level-bubble {
  position: absolute;
  right: -30px;
  bottom: -38px;
  width: 155px;
  height: 155px;
  opacity: .18;
  background: var(--accent);
  border-radius: 50%;
}

.parent-tip {
  display: flex;
  max-width: 850px;
  align-items: center;
  gap: 15px;
  margin: 36px auto 0;
  padding: 18px 22px;
  background: rgba(255,255,255,.7);
  border: 2px dashed #c9cdb4;
  border-radius: 22px;
}

.parent-tip > span {
  font-size: 29px;
}

.parent-tip p {
  margin: 0;
  color: #607570;
  font-weight: 800;
}

.parent-tip strong {
  color: var(--ink);
}

/* Игровой экран */
.game-page {
  max-width: 1320px;
  margin: 0 auto;
}

.mission-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.target-card {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 18px;
  padding: 15px 22px;
  background: rgba(255,253,247,.95);
  border: 3px solid #d7d6bd;
  border-radius: 28px;
  box-shadow: 0 10px 24px rgba(63, 90, 80, .1);
}

.target-swatch {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  background: var(--target-color);
  border: 7px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--target-dark), 0 8px 14px rgba(49, 73, 67, .18);
}

.target-swatch::after {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 16px;
  height: 10px;
  content: '';
  background: rgba(255,255,255,.64);
  border-radius: 50%;
  transform: rotate(-28deg);
}

.target-card small,
.target-card strong {
  display: block;
}

.target-card small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.target-card strong {
  font-size: clamp(24px, 3.2vw, 42px);
  font-weight: 900;
  line-height: 1.05;
}

.round-card {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 18px;
  padding: 16px 21px;
  background: rgba(255,253,247,.94);
  border: 3px solid #d7d6bd;
  border-radius: 28px;
  box-shadow: 0 10px 24px rgba(63, 90, 80, .1);
}

.round-copy strong,
.round-copy span {
  display: block;
  white-space: nowrap;
}

.round-copy strong {
  font-size: 22px;
  font-weight: 900;
}

.round-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.round-dots {
  display: flex;
  gap: 8px;
}

.round-dot {
  width: 17px;
  height: 17px;
  background: #e3e2d1;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #c9cbb9;
}

.round-dot.done {
  background: #65b987;
  box-shadow: 0 0 0 2px #3e8063;
}

.round-dot.active {
  background: var(--target-color);
  box-shadow: 0 0 0 2px var(--target-dark);
  animation: target-pulse 1.2s ease-in-out infinite;
}

.arena-card {
  position: relative;
  min-height: clamp(430px, 58vh, 650px);
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(255,255,255,.75) 0 35px, transparent 37px),
    radial-gradient(circle at 21% 12%, rgba(255,255,255,.75) 0 48px, transparent 50px),
    radial-gradient(circle at 26% 13%, rgba(255,255,255,.75) 0 31px, transparent 33px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.65) 0 32px, transparent 34px),
    radial-gradient(circle at 83% 17%, rgba(255,255,255,.65) 0 43px, transparent 45px),
    linear-gradient(180deg, #cdeffa 0%, #e8f8ed 72%, #cbe7aa 72%, #b5dc92 100%);
  border: 7px solid #fffdf7;
  border-radius: 40px;
  box-shadow: 0 18px 38px rgba(61, 90, 80, .17), 0 0 0 3px #d1d2b9;
  isolation: isolate;
}

.arena-card::before {
  position: absolute;
  right: -65px;
  bottom: -82px;
  width: 370px;
  height: 180px;
  content: '';
  background: rgba(89, 165, 101, .23);
  border-radius: 50%;
  transform: rotate(-6deg);
}

.arena-card::after {
  position: absolute;
  bottom: -105px;
  left: -90px;
  width: 480px;
  height: 210px;
  content: '';
  background: rgba(102, 184, 115, .18);
  border-radius: 50%;
  transform: rotate(5deg);
}

.catch-arena {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  touch-action: manipulation;
}

.catch-object {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: var(--object-size);
  height: var(--object-size);
  padding: 0;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.object-visual {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  filter: drop-shadow(0 10px 7px rgba(54, 83, 73, .2));
  transition: transform 130ms ease, filter 130ms ease;
  animation: object-wiggle 2.4s ease-in-out infinite alternate;
}

.catch-object:hover .object-visual,
.catch-object:focus-visible .object-visual {
  filter: drop-shadow(0 13px 9px rgba(54, 83, 73, .25));
  transform: scale(1.09);
}

.object-visual svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.catch-object.wrong .object-visual {
  animation: object-wrong 430ms ease;
}

.catch-object.caught .object-visual {
  animation: object-caught 360ms ease forwards;
}

.stage-banner {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(460px, calc(100% - 34px));
  min-height: 170px;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: rgba(255,253,247,.96);
  border: 4px solid #ddd6b6;
  border-radius: 32px;
  box-shadow: 0 20px 45px rgba(45, 71, 63, .22);
  transform: translate(-50%, -50%);
  animation: banner-in 280ms ease both;
}

.stage-banner.hidden {
  display: none;
}

.banner-swatch {
  width: 65px;
  height: 65px;
  margin-bottom: 9px;
  background: var(--target-color);
  border: 7px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--target-dark);
}

.stage-banner strong {
  display: block;
  font-size: clamp(23px, 4vw, 36px);
  font-weight: 900;
}

.stage-banner span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.pause-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(47, 75, 68, .44);
  backdrop-filter: blur(5px);
}

.pause-overlay[hidden] {
  display: none;
}

.pause-panel {
  width: min(430px, 100%);
  padding: 32px;
  text-align: center;
  background: var(--paper);
  border: 4px solid #ded7b8;
  border-radius: 32px;
  box-shadow: 0 23px 50px rgba(36, 61, 55, .28);
}

.pause-panel > span {
  display: block;
  font-size: 48px;
}

.pause-panel h2 {
  margin: 5px 0 7px;
  font-size: 35px;
  font-weight: 900;
}

.pause-panel p {
  color: var(--muted);
  font-weight: 800;
}

.pause-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
}

.game-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 16px 20px;
  background: rgba(255,253,247,.9);
  border: 2px solid #d8d6be;
  border-radius: 24px;
}

.score-box,
.mistake-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-icon {
  font-size: 26px;
}

.score-box strong,
.score-box span,
.mistake-box strong,
.mistake-box span {
  display: block;
}

.score-box strong,
.mistake-box strong {
  font-size: 20px;
  font-weight: 900;
}

.score-box span,
.mistake-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-track {
  height: 18px;
  overflow: hidden;
  background: #e7e4d2;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px #d3d2bd;
}

.progress-fill {
  width: var(--progress);
  height: 100%;
  background: linear-gradient(90deg, #66bd8c, #f1bd4f);
  border-radius: inherit;
  transition: width 260ms ease;
}

.mistake-pips {
  display: flex;
  gap: 4px;
  margin-left: 3px;
}

.mistake-pip {
  color: #e0b84d;
  font-size: 19px;
}

.feedback-toast {
  position: absolute;
  z-index: 18;
  bottom: 20px;
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
  background: #397b63;
  border: 3px solid rgba(255,255,255,.84);
  border-radius: 999px;
  box-shadow: 0 9px 19px rgba(46, 75, 67, .22);
  transform: translateX(-50%);
  animation: toast-pop 1.15s ease both;
  pointer-events: none;
}

.feedback-toast.try {
  background: #c86a59;
}

.catch-spark {
  position: absolute;
  z-index: 10;
  width: 13px;
  height: 13px;
  background: var(--spark-color);
  border: 3px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  animation: spark-out 560ms ease-out forwards;
}

/* Результат */
.result-card {
  position: relative;
  display: grid;
  min-height: 620px;
  align-items: center;
  grid-template-columns: minmax(0, .95fr) minmax(390px, 1.05fr);
  gap: clamp(30px, 6vw, 85px);
  overflow: hidden;
  padding: clamp(38px, 6vw, 78px);
  background: rgba(255,253,247,.96);
  border: 4px solid #dcd6b9;
  border-radius: 48px;
  box-shadow: var(--shadow);
}

.result-card::before {
  position: absolute;
  inset: auto -90px -120px auto;
  width: 420px;
  height: 420px;
  content: '';
  background: rgba(102, 187, 140, .12);
  border-radius: 50%;
}

.result-copy,
.result-visual {
  position: relative;
  z-index: 2;
}

.result-copy h1 {
  margin-bottom: 15px;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: .97;
}

.result-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.result-stars {
  margin-bottom: 19px;
  color: #f0b83e;
  font-size: clamp(45px, 6vw, 68px);
  letter-spacing: 5px;
  line-height: 1;
  text-shadow: 0 3px 0 #c78a25;
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.result-stat {
  min-width: 125px;
  padding: 12px 15px;
  background: #eff8ef;
  border: 2px solid #cbdcc6;
  border-radius: 17px;
}

.result-stat strong,
.result-stat span {
  display: block;
}

.result-stat strong {
  font-size: 23px;
  font-weight: 900;
}

.result-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-visual {
  display: grid;
  min-height: 430px;
  place-items: center;
  background: linear-gradient(180deg, #cceefa 0 67%, #cce7aa 67%);
  border: 8px solid #fff;
  border-radius: 40px;
  box-shadow: 0 19px 34px rgba(57, 86, 77, .18);
  transform: rotate(1.4deg);
}

.trophy {
  position: relative;
  display: grid;
  width: 225px;
  height: 225px;
  place-items: center;
  font-size: 130px;
  background: rgba(255,255,255,.7);
  border: 6px solid rgba(255,255,255,.8);
  border-radius: 50%;
  box-shadow: 0 17px 30px rgba(52, 84, 73, .16);
  animation: trophy-bob 2.2s ease-in-out infinite alternate;
}

.result-bubbles span {
  position: absolute;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  font-size: 28px;
  background: var(--bubble);
  border: 5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 15px rgba(53, 81, 73, .16);
  animation: result-float 2.4s ease-in-out infinite alternate;
}

.result-bubbles span:nth-child(1) { --bubble:#ef7465; top: 47px; left: 48px; }
.result-bubbles span:nth-child(2) { --bubble:#f1c34f; top: 76px; right: 44px; animation-delay:-.8s; }
.result-bubbles span:nth-child(3) { --bubble:#65b987; bottom: 52px; left: 64px; animation-delay:-1.4s; }
.result-bubbles span:nth-child(4) { --bubble:#8e78c2; right: 60px; bottom: 48px; animation-delay:-.3s; }

@keyframes demo-float {
  from { transform: translateY(-5px) rotate(-7deg); }
  to { transform: translateY(12px) rotate(7deg); }
}

@keyframes twinkle {
  50% { opacity: .45; transform: rotate(25deg) scale(.82); }
}

@keyframes object-wiggle {
  from { rotate: -3deg; }
  to { rotate: 3deg; }
}

@keyframes object-wrong {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-11px) rotate(-5deg); }
  55% { transform: translateX(10px) rotate(5deg); }
  78% { transform: translateX(-5px) rotate(-2deg); }
}

@keyframes object-caught {
  0% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.28) rotate(10deg); opacity: 1; }
  100% { transform: scale(.1) rotate(35deg); opacity: 0; }
}

@keyframes target-pulse {
  50% { transform: scale(1.18); }
}

@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, -44%) scale(.88); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toast-pop {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.88); }
  16%, 75% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -5px) scale(.94); }
}

@keyframes spark-out {
  from { opacity: 1; transform: translate(0,0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); }
}

@keyframes trophy-bob {
  from { transform: translateY(-7px) rotate(-3deg); }
  to { transform: translateY(9px) rotate(3deg); }
}

@keyframes result-float {
  from { transform: translateY(-4px) rotate(-8deg); }
  to { transform: translateY(10px) rotate(8deg); }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-demo {
    min-height: 280px;
  }

  .steps-grid,
  .level-grid {
    grid-template-columns: 1fr;
  }

  .level-card {
    min-height: 215px;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .result-visual {
    min-height: 360px;
  }
}

@media (max-width: 720px) {
  .app {
    width: 100%;
    padding: 14px 12px 28px;
  }

  .topbar {
    min-height: 60px;
    margin-bottom: 15px;
  }

  .brand-mark {
    width: 49px;
    height: 49px;
    font-size: 26px;
    border-radius: 16px;
  }

  .brand small,
  .sound-button span:last-child,
  .pause-button span:last-child {
    display: none;
  }

  .sound-button,
  .pause-button,
  .back-button {
    width: 46px;
    min-height: 46px;
    padding: 0;
  }

  .hero {
    min-height: auto;
    padding: 31px 23px;
    border-radius: 34px;
  }

  .hero h1 {
    font-size: clamp(39px, 14vw, 58px);
  }

  .hero-demo {
    min-height: 255px;
    padding: 16px;
    border-width: 6px;
    border-radius: 30px;
  }

  .demo-object.one { left: 13px; }
  .demo-object.two { right: 19px; }
  .demo-object.three { left: 34%; }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 8px;
    text-align: left;
  }

  .step-card {
    padding: 18px;
  }

  .mission-bar {
    grid-template-columns: 1fr auto;
    gap: 9px;
  }

  .target-card {
    min-height: 79px;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 22px;
  }

  .target-swatch {
    width: 49px;
    height: 49px;
    border-width: 5px;
  }

  .target-card strong {
    font-size: clamp(20px, 6vw, 29px);
  }

  .target-card small {
    font-size: 10px;
  }

  .round-card {
    min-width: 82px;
    min-height: 79px;
    justify-content: center;
    padding: 10px;
    border-radius: 22px;
  }

  .round-copy span,
  .round-dots {
    display: none;
  }

  .round-copy strong {
    font-size: 17px;
  }

  .arena-card {
    min-height: clamp(420px, 65vh, 560px);
    border-width: 5px;
    border-radius: 29px;
  }

  .game-status {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px 14px;
  }

  .mistake-box {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .score-box strong,
  .mistake-box strong {
    font-size: 17px;
  }

  .feedback-toast {
    bottom: 12px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
  }

  .result-card {
    min-height: auto;
    padding: 32px 22px;
    border-radius: 34px;
  }

  .result-visual {
    min-height: 300px;
    border-width: 6px;
    border-radius: 30px;
  }

  .trophy {
    width: 175px;
    height: 175px;
    font-size: 100px;
  }

  .result-actions .primary-button,
  .result-actions .secondary-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand strong {
    max-width: 160px;
    font-size: 17px;
  }

  .hero-demo {
    min-height: 225px;
  }

  .demo-object.one { --s: 77px; }
  .demo-object.two { --s: 69px; }
  .demo-object.three { --s: 84px; }
  .demo-object.four { --s: 58px; }

  .level-card {
    padding: 22px;
  }

  .target-card strong {
    font-size: 19px;
  }

  .target-swatch {
    width: 43px;
    height: 43px;
  }

  .arena-card {
    min-height: 455px;
  }
}

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