:root {
  color-scheme: light;
  font-family: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  font-synthesis: none;
  --ink: #304f4d;
  --muted: #6d827e;
  --paper: #fffdf7;
  --cream: #fff3d2;
  --line: #ded3b3;
  --coral: #ef7668;
  --gold: #f2bd4b;
  --green: #66b98c;
  --green-dark: #397a61;
  --blue: #65add8;
  --purple: #957cc4;
  --shadow: 0 18px 44px rgba(71, 88, 78, .15);
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 7%, rgba(239, 118, 104, .14) 0 115px, transparent 117px),
    radial-gradient(circle at 96% 6%, rgba(101, 173, 216, .18) 0 150px, transparent 152px),
    linear-gradient(180deg, #fff9e8 0%, #eff8ed 100%);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 5px solid rgba(241, 185, 66, .58);
  outline-offset: 4px;
}

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

.loading-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(380px, calc(100% - 38px));
  padding: 35px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

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

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

.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  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: 32px;
  line-height: 1;
  background: #fff7db;
  border: 3px solid #e2d3ab;
  border-radius: 19px;
  box-shadow: 0 8px 17px rgba(83, 94, 84, .12);
  transform: rotate(-4deg);
}

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

.brand strong {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 900;
  line-height: 1.04;
}

.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,
.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, .9);
  border: 2px solid #dad2b8;
  border-radius: 17px;
  box-shadow: 0 7px 17px rgba(70, 86, 78, .09);
  cursor: pointer;
}

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

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

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

.hero {
  position: relative;
  display: grid;
  min-height: 440px;
  align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(410px, .95fr);
  gap: clamp(28px, 5vw, 78px);
  overflow: hidden;
  padding: clamp(36px, 5vw, 72px);
  background:
    linear-gradient(125deg, rgba(255,255,255,.96), rgba(255,245,210,.88)),
    var(--paper);
  border: 3px solid #ded1ac;
  border-radius: 48px;
  box-shadow: var(--shadow);
}

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

.hero::before {
  top: -95px;
  right: -80px;
  width: 340px;
  height: 340px;
  background: rgba(104, 183, 141, .12);
  border-radius: 50%;
}

.hero::after {
  bottom: -135px;
  left: 34%;
  width: 300px;
  height: 300px;
  background: rgba(101, 173, 216, .1);
  border-radius: 50%;
}

.hero-copy,
.hero-parade {
  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: 700px;
  margin-bottom: 18px;
  font-size: clamp(46px, 6.2vw, 82px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: .96;
}

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

.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, #e87767, #c85652);
  border: 0;
  box-shadow: 0 12px 22px rgba(193, 83, 78, .24);
}

.secondary-button {
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid #d8d0b7;
  box-shadow: 0 8px 18px rgba(70, 86, 78, .1);
}

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

.hero-parade {
  min-height: 330px;
  overflow: hidden;
  background: linear-gradient(180deg, #cfeef8 0 60%, #f5dfac 60% 72%, #e8bd79 72%);
  border: 8px solid #fff;
  border-radius: 39px;
  box-shadow: 0 19px 33px rgba(70, 88, 79, .18);
  transform: rotate(1.4deg);
}

.hero-parade::before {
  position: absolute;
  top: 26px;
  left: -5%;
  width: 110%;
  height: 22px;
  content: '';
  border-top: 3px solid #7d8174;
  transform: rotate(-2deg);
}

.mini-flag {
  position: absolute;
  top: 23px;
  left: var(--x);
  width: 27px;
  height: 34px;
  background: var(--flag);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.hero-shape {
  position: absolute;
  bottom: 52px;
  left: var(--x);
  display: grid;
  width: var(--size);
  height: var(--size);
  place-items: center;
  color: var(--shape);
  filter: drop-shadow(0 12px 8px rgba(63, 81, 74, .2));
  animation: hero-march var(--speed) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}

.hero-shape::before {
  width: 78%;
  height: 78%;
  content: '';
  background: currentColor;
  border: 5px solid color-mix(in srgb, currentColor 73%, #334d49);
}

.hero-shape.circle::before { border-radius: 50%; }
.hero-shape.square::before { border-radius: 13px; }
.hero-shape.triangle::before { clip-path: polygon(50% 2%, 98% 92%, 2% 92%); }
.hero-shape.star::before { clip-path: polygon(50% 0,61% 34%,98% 36%,68% 57%,78% 94%,50% 73%,22% 94%,32% 57%,2% 36%,39% 34%); }

.hero-face {
  position: absolute;
  top: 41%;
  left: 50%;
  width: 36%;
  height: 16%;
  border-bottom: 4px solid #36504c;
  border-radius: 0 0 50% 50%;
  transform: translate(-50%, -50%);
}

.hero-face::before,
.hero-face::after {
  position: absolute;
  top: -6px;
  width: 7px;
  height: 9px;
  content: '';
  background: #36504c;
  border-radius: 50%;
}

.hero-face::before { left: 3px; }
.hero-face::after { right: 3px; }

.hero-road-dots {
  position: absolute;
  right: 0;
  bottom: 19px;
  left: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 32px, transparent 32px 61px);
}

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

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

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(31px, 3.8vw, 49px);
  font-weight: 900;
  letter-spacing: -.03em;
}

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

.shape-ribbon {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 11px;
}

.shape-chip {
  display: grid;
  min-height: 128px;
  place-items: center;
  padding: 14px 8px 12px;
  text-align: center;
  background: rgba(255,253,247,.85);
  border: 2px solid #ddd3b8;
  border-radius: 23px;
}

.chip-icon {
  display: grid;
  width: 65px;
  height: 65px;
  place-items: center;
}

.chip-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.shape-chip strong {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 900;
}

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

.level-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  padding: 28px;
  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(70, 87, 79, .1);
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.level-card:hover {
  box-shadow: 0 18px 31px rgba(70, 87, 79, .16);
  transform: translateY(-5px) rotate(-.25deg);
}

.level-card.basic { --level-bg:#e8f6e7; --level-line:#abd3aa; --accent:#4fa36f; }
.level-card.more { --level-bg:#fff1c9; --level-line:#e6cd84; --accent:#d59a2e; }
.level-card.grand { --level-bg:#f3e7fa; --level-line:#cfb6df; --accent:#8567b5; }

.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,.72);
  border: 2px solid rgba(65, 85, 76, .15);
  border-radius: 21px;
}

.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: 28px;
  font-weight: 900;
}

.level-card p {
  position: relative;
  z-index: 2;
  max-width: 300px;
  margin-bottom: 18px;
  color: #5e7470;
  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: -35px;
  bottom: -50px;
  width: 175px;
  height: 175px;
  opacity: .16;
  background: var(--accent);
  border-radius: 50%;
}

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

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

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

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

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

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

.mission-card {
  display: flex;
  min-height: 116px;
  align-items: center;
  gap: 20px;
  padding: 15px 24px;
  background: rgba(255,253,247,.95);
  border: 3px solid #ded2b2;
  border-radius: 29px;
  box-shadow: 0 10px 24px rgba(70, 86, 78, .1);
}

.target-preview {
  display: grid;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  place-items: center;
  background: #fff9e8;
  border: 3px solid #e3d6b5;
  border-radius: 23px;
}

.target-preview svg {
  width: 70px;
  height: 70px;
}

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

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

.mission-card strong {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  line-height: 1.04;
}

.round-card {
  display: grid;
  min-width: 220px;
  place-items: center;
  padding: 14px 23px;
  text-align: center;
  background: rgba(255,253,247,.95);
  border: 3px solid #ded2b2;
  border-radius: 29px;
  box-shadow: 0 10px 24px rgba(70, 86, 78, .1);
}

.round-card strong,
.round-card span {
  display: block;
}

.round-card strong {
  font-size: 24px;
  font-weight: 900;
}

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

.round-progress {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.round-progress i {
  width: 13px;
  height: 13px;
  background: #e4e1ce;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #cfcbb6;
}

.round-progress i.done {
  background: #67b98b;
  box-shadow: 0 0 0 1px #3e8063;
}

.parade-stage {
  position: relative;
  min-height: clamp(470px, 59vh, 650px);
  overflow: hidden;
  background:
    linear-gradient(180deg, #cfeff8 0 61%, #f5dfa9 61% 72%, #eabf7a 72% 100%);
  border: 7px solid #fffdf7;
  border-radius: 40px;
  box-shadow: 0 18px 38px rgba(67, 86, 77, .17), 0 0 0 3px #d9cfaf;
  isolation: isolate;
}

.parade-stage::before {
  position: absolute;
  z-index: 1;
  top: 39px;
  left: -4%;
  width: 108%;
  height: 20px;
  content: '';
  border-top: 4px solid rgba(72, 84, 78, .55);
  transform: rotate(-1deg);
}

.stage-flag {
  position: absolute;
  z-index: 2;
  top: 36px;
  left: var(--x);
  width: 32px;
  height: 39px;
  background: var(--flag);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.stage-cloud {
  position: absolute;
  z-index: 0;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: calc(var(--w) * .33);
  opacity: .62;
  background: #fff;
  border-radius: 999px;
}

.stage-cloud::before,
.stage-cloud::after {
  position: absolute;
  bottom: 0;
  content: '';
  background: #fff;
  border-radius: 50%;
}

.stage-cloud::before { left: 18%; width: 45%; height: 150%; }
.stage-cloud::after { right: 12%; width: 36%; height: 120%; }

.parade-line {
  position: absolute;
  z-index: 6;
  inset: 95px 28px 70px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: clamp(5px, 1.7vw, 22px);
}

.shape-character {
  position: relative;
  display: grid;
  width: min(19%, 220px);
  min-width: 132px;
  max-width: 220px;
  aspect-ratio: 1 / 1.08;
  padding: 5px;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 30px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: character-march 1.65s ease-in-out infinite alternate;
  animation-delay: var(--delay);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.shape-character svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 12px 8px rgba(61, 79, 72, .2));
  transition: transform 150ms ease, filter 150ms ease;
}

.shape-character:hover svg,
.shape-character:focus-visible svg {
  filter: drop-shadow(0 15px 10px rgba(61, 79, 72, .25));
  transform: scale(1.07);
}

.shape-character.correct {
  background: rgba(255,255,255,.5);
  box-shadow: 0 0 0 6px rgba(83, 168, 112, .72);
}

.shape-character.correct svg {
  animation: correct-jump 550ms ease both;
}

.shape-character.wrong svg {
  animation: wrong-shake 430ms ease;
}

.shape-character.dimmed {
  opacity: .48;
}

.stage-crowd {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 8px;
  left: 0;
  display: flex;
  align-items: end;
  justify-content: space-around;
  padding: 0 6%;
  color: rgba(68, 88, 78, .62);
  font-size: clamp(25px, 3vw, 40px);
  letter-spacing: clamp(12px, 4vw, 50px);
  pointer-events: none;
}

.feedback-toast {
  position: absolute;
  z-index: 20;
  bottom: 30px;
  left: 50%;
  max-width: calc(100% - 35px);
  padding: 11px 19px;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
  background: #3d8064;
  border: 3px solid rgba(255,255,255,.86);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(47, 71, 63, .22);
  transform: translateX(-50%);
  animation: toast-pop 1.2s ease both;
  pointer-events: none;
}

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

.confetti-piece {
  position: absolute;
  z-index: 14;
  width: 12px;
  height: 17px;
  background: var(--confetti);
  border-radius: 3px;
  pointer-events: none;
  animation: confetti-fly 650ms ease-out forwards;
}

.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,.91);
  border: 2px solid #dbd1b5;
  border-radius: 24px;
}

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

.score-box > span:first-child {
  font-size: 27px;
}

.score-box strong,
.score-box small,
.star-box strong,
.star-box small {
  display: block;
}

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

.score-box small,
.star-box small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

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

.star-preview {
  color: #e7ad35;
  font-size: 21px;
  letter-spacing: 2px;
}

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

.result-card::after {
  position: absolute;
  right: -110px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  content: '';
  background: rgba(101, 184, 140, .11);
  border-radius: 50%;
}

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

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

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

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

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

.result-stat {
  min-width: 128px;
  padding: 12px 15px;
  background: #f1f8ed;
  border: 2px solid #cfddc5;
  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: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.result-parade {
  min-height: 440px;
  overflow: hidden;
  background: linear-gradient(180deg, #cfeef8 0 65%, #edc77f 65%);
  border: 8px solid #fff;
  border-radius: 40px;
  box-shadow: 0 19px 34px rgba(64, 83, 75, .18);
  transform: rotate(1.3deg);
}

.result-banner {
  position: absolute;
  top: 33px;
  left: 50%;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  background: #fffdf7;
  border: 3px solid #ded1ad;
  border-radius: 999px;
  box-shadow: 0 8px 17px rgba(57, 76, 68, .14);
  transform: translateX(-50%);
}

.result-shapes {
  position: absolute;
  inset: 110px 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.result-shape {
  width: 29%;
  max-width: 160px;
  animation: result-dance 1.5s ease-in-out infinite alternate;
  animation-delay: var(--delay);
}

.result-shape svg {
  width: 100%;
  overflow: visible;
  filter: drop-shadow(0 12px 8px rgba(58, 78, 70, .2));
}

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

@keyframes hero-march {
  from { transform: translateY(-4px) rotate(-5deg); }
  to { transform: translateY(12px) rotate(5deg); }
}

@keyframes character-march {
  from { transform: translateY(-6px) rotate(-2deg); }
  to { transform: translateY(8px) rotate(2deg); }
}

@keyframes correct-jump {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-32px) scale(1.13) rotate(-6deg); }
  100% { transform: translateY(0) scale(1.06); }
}

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

@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 confetti-fly {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--spin)); }
}

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

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

  .hero-parade {
    min-height: 310px;
  }

  .shape-ribbon {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

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

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

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

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

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

  .sound-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(47px, 16vw, 67px);
  }

  .hero-parade {
    min-height: 265px;
    border-width: 6px;
    border-radius: 30px;
  }

  .section-heading {
    display: block;
  }

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

  .shape-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shape-chip {
    min-width: 0;
    min-height: 110px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px;
    text-align: left;
  }

  .chip-icon {
    width: 56px;
    height: 56px;
  }

  .shape-chip strong {
    margin: 0;
    font-size: 14px;
  }

  .mission-strip {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .mission-card {
    min-height: 88px;
    gap: 11px;
    padding: 10px 13px;
    border-radius: 23px;
  }

  .target-preview {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .target-preview svg {
    width: 52px;
    height: 52px;
  }

  .mission-card small {
    font-size: 9px;
  }

  .mission-card strong {
    font-size: clamp(21px, 6.2vw, 31px);
  }

  .round-card {
    min-width: 82px;
    padding: 8px;
    border-radius: 23px;
  }

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

  .round-card span,
  .round-progress {
    display: none;
  }

  .parade-stage {
    min-height: clamp(510px, 68vh, 620px);
    border-width: 5px;
    border-radius: 29px;
  }

  .parade-line {
    inset: 86px 10px 60px;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 5px 15px;
  }

  .shape-character {
    width: 42%;
    min-width: 112px;
    max-width: 170px;
  }

  .parade-line.lineup-5 .shape-character {
    width: 30%;
    min-width: 98px;
    max-width: 135px;
  }

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

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

  .feedback-toast {
    bottom: 15px;
    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-parade {
    min-height: 325px;
    border-width: 6px;
    border-radius: 30px;
  }

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

@media (max-width: 430px) {
  .brand strong {
    max-width: 150px;
    font-size: 18px;
  }

  .hero-parade {
    min-height: 235px;
  }

  .shape-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level-card {
    padding: 22px;
  }

  .parade-stage {
    min-height: 540px;
  }

  .shape-character {
    width: 45%;
    min-width: 108px;
  }
}

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