:root {
  color-scheme: light;
  --berry-950: #54112f;
  --berry-800: #7d1f48;
  --berry-700: #a52d5d;
  --berry-600: #cc3d74;
  --pink-500: #f25b96;
  --pink-400: #ff79aa;
  --pink-300: #ff9fc0;
  --pink-200: #ffc4d8;
  --pink-100: #ffe0eb;
  --pink-50: #fff2f7;
  --cream: #fffaf2;
  --white: #ffffff;
  --mint: #88dfcb;
  --yellow: #ffd978;
  --shadow: 0 22px 55px rgba(123, 34, 74, 0.23);
  --soft-shadow: 0 10px 24px rgba(123, 34, 74, 0.16);
  --stage-radius: clamp(22px, 3vw, 38px);
  --font: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--berry-950);
  font-family: var(--font);
  font-weight: 700;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.92) 0 3.5%, transparent 3.7%),
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, 0.72) 0 5%, transparent 5.2%),
    radial-gradient(circle at 80% 92%, rgba(255, 197, 218, 0.75) 0 12%, transparent 12.2%),
    linear-gradient(145deg, #fff5f9 0%, #ffe2ed 48%, #ffc9dc 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 4px solid #6738c8;
  outline-offset: 3px;
}

#gameCanvas:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 4px #6738c8;
}

[hidden] {
  display: none !important;
}

.screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-sprinkles {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-sprinkles i {
  position: absolute;
  width: 22px;
  height: 7px;
  border-radius: 99px;
  background: var(--pink-400);
  opacity: 0.48;
  transform: rotate(var(--r, 25deg));
}

.page-sprinkles i:nth-child(1) { top: 10%; left: 3%; --r: 20deg; }
.page-sprinkles i:nth-child(2) { top: 24%; right: 4%; --r: -35deg; background: var(--mint); }
.page-sprinkles i:nth-child(3) { top: 62%; left: 2%; --r: -12deg; background: var(--yellow); }
.page-sprinkles i:nth-child(4) { top: 82%; right: 2%; --r: 45deg; }
.page-sprinkles i:nth-child(5) { top: 5%; left: 77%; --r: 75deg; background: #a9d8ff; }
.page-sprinkles i:nth-child(6) { top: 45%; left: 7%; --r: -55deg; background: var(--mint); }
.page-sprinkles i:nth-child(7) { top: 74%; right: 8%; --r: 5deg; background: #a9d8ff; }
.page-sprinkles i:nth-child(8) { top: 92%; left: 18%; --r: 55deg; }
.page-sprinkles i:nth-child(9) { top: 14%; left: 20%; --r: -20deg; background: var(--yellow); }
.page-sprinkles i:nth-child(10) { top: 51%; right: 1%; --r: 30deg; background: var(--yellow); }

.game-app {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 1440px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: max(clamp(10px, 2.2vh, 24px), env(safe-area-inset-top));
  padding-right: max(clamp(10px, 2.2vw, 30px), env(safe-area-inset-right));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-left: max(clamp(10px, 2.2vw, 30px), env(safe-area-inset-left));
  flex-direction: column;
  justify-content: center;
}

.site-header,
.site-footer {
  display: flex;
  width: min(100%, 1180px);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 46px;
  padding: 0 8px 10px;
}

.mini-brand {
  display: inline-flex;
  color: var(--berry-800);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-decoration: none;
  align-items: center;
  gap: 9px;
}

.mini-brand__donut {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border: 4px solid #c57a47;
  border-radius: 50%;
  background: var(--pink-400);
  box-shadow: inset 0 0 0 3px #ffacd0;
  transform: rotate(-12deg);
}

.mini-brand__donut::after {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cream);
  content: "";
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.site-header__tagline,
.site-footer {
  color: rgba(84, 17, 47, 0.65);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.games-home-link {
  display: inline-flex;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(84, 17, 47, .14);
  border-radius: 999px;
  align-items: center;
  color: rgba(84, 17, 47, .72);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  text-decoration: none;
  background: rgba(255, 255, 255, .48);
}

.games-home-link:hover {
  background: rgba(255, 255, 255, .82);
}

.site-header__tagline,
.site-footer p {
  margin: 0;
}

.game-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(5px, 0.8vw, 9px);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: calc(var(--stage-radius) + 10px);
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(194, 57, 109, 0.08);
  backdrop-filter: blur(14px);
}

.game-stage {
  position: relative;
  width: 100%;
  max-height: calc(100dvh - 126px);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: clamp(3px, 0.45vw, 6px) solid #fffafc;
  border-radius: var(--stage-radius);
  background:
    linear-gradient(180deg, transparent 0 67%, rgba(252, 170, 199, 0.42) 67% 70%, transparent 70%),
    radial-gradient(ellipse at 20% 71%, #fff 0 11%, transparent 11.4%),
    linear-gradient(180deg, #cbefff 0%, #f7dbf0 63%, #ffb8d1 63%, #ff91ba 100%);
  box-shadow:
    inset 0 0 0 2px rgba(191, 48, 103, 0.18),
    inset 0 -26px 54px rgba(151, 25, 77, 0.11);
  isolation: isolate;
}

#gameCanvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.stage-gloss {
  position: absolute;
  z-index: 2;
  top: -28%;
  left: -10%;
  width: 74%;
  height: 55%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
  transform: rotate(-5deg);
}

.game-hud {
  position: absolute;
  z-index: 8;
  top: clamp(10px, 1.8vw, 22px);
  right: clamp(10px, 1.8vw, 22px);
  left: clamp(10px, 1.8vw, 22px);
  display: grid;
  grid-template-columns: auto minmax(180px, 460px) auto;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.6vw, 20px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.game-hud.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cookie-pill,
.icon-button {
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 249, 252, 0.9);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.cookie-pill {
  display: flex;
  min-width: 96px;
  height: clamp(40px, 5vw, 52px);
  padding: 4px 14px 4px 6px;
  border-radius: 99px;
  color: var(--berry-800);
  align-items: center;
  gap: 7px;
}

.cookie-icon {
  display: grid;
  width: clamp(30px, 4vw, 40px);
  height: clamp(30px, 4vw, 40px);
  border-radius: 50%;
  background: #fff0c9;
  font-size: clamp(19px, 2.5vw, 27px);
  place-items: center;
}

.cookie-pill__numbers {
  display: flex;
  font-size: clamp(14px, 1.7vw, 19px);
  letter-spacing: 0.02em;
  align-items: baseline;
  gap: 3px;
}

.cookie-pill__numbers strong {
  color: var(--berry-700);
  font-size: 1.22em;
  font-weight: 950;
}

.progress-group {
  min-width: 0;
}

.progress-labels {
  display: flex;
  margin: 0 4px 5px;
  color: var(--berry-800);
  font-size: clamp(8px, 0.9vw, 11px);
  font-weight: 950;
  letter-spacing: 0.08em;
  justify-content: space-between;
  text-shadow: 0 1px rgba(255, 255, 255, 0.75);
}

.progress-labels span:nth-child(2) {
  color: var(--berry-600);
}

.progress-track {
  position: relative;
  height: clamp(12px, 1.6vw, 18px);
  overflow: visible;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 99px;
  background: rgba(111, 40, 75, 0.17);
  box-shadow:
    inset 0 2px 5px rgba(89, 20, 54, 0.13),
    0 3px 9px rgba(106, 31, 67, 0.13);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 0;
  max-width: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.27) 0 45%, transparent 45% 55%, rgba(255, 255, 255, 0.2) 55%) 0 0 / 16px 100%,
    linear-gradient(90deg, var(--pink-500), var(--pink-300));
  box-shadow: 0 0 12px rgba(242, 91, 150, 0.5);
  transition: width 180ms linear;
}

.progress-runner {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  width: clamp(25px, 3vw, 34px);
  height: clamp(25px, 3vw, 34px);
  border-radius: 50%;
  background: #fff7fa;
  box-shadow: 0 3px 9px rgba(109, 25, 64, 0.25);
  font-size: clamp(15px, 1.8vw, 21px);
  place-items: center;
  transform: translate(50%, -50%);
}

.hud-actions {
  display: flex;
  gap: clamp(6px, 0.9vw, 10px);
  pointer-events: auto;
}

.icon-button {
  display: grid;
  width: clamp(40px, 5vw, 52px);
  height: clamp(40px, 5vw, 52px);
  padding: 0;
  border-radius: 17px;
  color: var(--berry-700);
  font-size: clamp(19px, 2.2vw, 26px);
  cursor: pointer;
  place-items: center;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.icon-button:hover {
  background: #fff;
  box-shadow: 0 12px 22px rgba(109, 25, 64, 0.22);
  transform: translateY(-2px) rotate(-2deg);
}

.icon-button:active {
  transform: translateY(1px) scale(0.96);
}

.icon-button.is-muted {
  color: rgba(125, 31, 72, 0.55);
  background: rgba(255, 249, 252, 0.72);
}

.pause-icon {
  display: flex;
  gap: 4px;
}

.pause-icon i {
  display: block;
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: currentColor;
}

.screen-overlay,
.modal-layer {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  padding: clamp(58px, 8vw, 86px) clamp(14px, 4vw, 46px) clamp(16px, 3vw, 32px);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 248, 252, 0.38), transparent 42%),
    linear-gradient(135deg, rgba(123, 46, 93, 0.18), rgba(255, 154, 194, 0.27));
  place-items: center;
  scrollbar-width: thin;
  backdrop-filter: blur(5px);
}

.screen-overlay--start {
  background:
    linear-gradient(180deg, rgba(209, 242, 255, 0.2), rgba(255, 161, 196, 0.22)),
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.45), transparent 45%);
}

.screen-card,
.how-to-card {
  position: relative;
  width: min(100%, 590px);
  padding: clamp(20px, 3.2vw, 42px);
  border: clamp(3px, 0.45vw, 5px) solid rgba(255, 255, 255, 0.95);
  border-radius: clamp(24px, 4vw, 42px);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.85) 0 2px, transparent 3px),
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(255, 233, 241, 0.94));
  box-shadow:
    0 24px 50px rgba(104, 25, 65, 0.24),
    inset 0 0 0 2px rgba(249, 123, 170, 0.15);
  text-align: center;
}

.start-card {
  width: min(100%, 650px);
  padding-top: clamp(54px, 7vw, 86px);
}

.start-card::before,
.start-card::after {
  position: absolute;
  z-index: -1;
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #ffc2d7;
  content: "";
}

.start-card::before { top: 22%; left: -26px; }
.start-card::after { right: -24px; bottom: 19%; }

.start-card__sparkles {
  position: absolute;
  top: 20px;
  right: 34px;
  color: var(--pink-400);
  font-size: clamp(15px, 2.2vw, 24px);
  letter-spacing: 0.1em;
}

.start-best {
  margin: 10px 0 0;
  color: rgba(84, 17, 47, 0.68);
  font-size: clamp(11px, 1.2vw, 14px);
}

.start-best strong {
  color: var(--berry-700);
  font-weight: 950;
}

.hero-donut {
  position: absolute;
  top: clamp(-49px, -4.5vw, -35px);
  left: 50%;
  width: clamp(90px, 11vw, 128px);
  height: clamp(90px, 11vw, 128px);
  border: clamp(9px, 1.1vw, 14px) solid #bd7446;
  border-radius: 50%;
  background:
    radial-gradient(circle at 22% 32%, #fff2a8 0 3px, transparent 4px),
    radial-gradient(circle at 72% 20%, #9ce6d3 0 3px, transparent 4px),
    radial-gradient(circle at 80% 62%, #9fcff9 0 3px, transparent 4px),
    radial-gradient(circle at 30% 74%, #fff 0 3px, transparent 4px),
    linear-gradient(145deg, #ff9fc5, #ee528d);
  box-shadow:
    0 13px 20px rgba(102, 28, 62, 0.25),
    inset 0 0 0 8px rgba(255, 255, 255, 0.17);
  transform: translateX(-50%) rotate(-7deg);
}

.hero-donut__hole {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32%;
  height: 32%;
  border: 7px solid #b46c43;
  border-radius: 50%;
  background: #fff3f7;
  box-shadow: inset 2px 3px 5px rgba(103, 37, 67, 0.15);
  transform: translate(-50%, -50%);
}

.hero-donut i {
  position: absolute;
  width: 14px;
  height: 4px;
  border-radius: 99px;
  background: var(--c, #fff1a8);
  transform: rotate(var(--r, 25deg));
}

.hero-donut i:nth-of-type(1) { top: 19%; left: 47%; --r: -30deg; --c: #fff; }
.hero-donut i:nth-of-type(2) { top: 40%; right: 9%; --r: 55deg; --c: #ffe26f; }
.hero-donut i:nth-of-type(3) { right: 24%; bottom: 14%; --r: -10deg; --c: #95e2cf; }
.hero-donut i:nth-of-type(4) { bottom: 9%; left: 38%; --r: 70deg; --c: #b9dcff; }
.hero-donut i:nth-of-type(5) { top: 48%; left: 8%; --r: 15deg; --c: #fff; }
.hero-donut i:nth-of-type(6) { top: 24%; left: 20%; --r: 78deg; --c: #ffe26f; }

.eyebrow {
  margin: 0 0 clamp(6px, 1vw, 12px);
  color: var(--berry-600);
  font-size: clamp(9px, 1.1vw, 13px);
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.start-card h1,
.screen-card h2,
.how-to-card h2 {
  margin: 0;
  color: var(--berry-800);
  font-weight: 950;
  line-height: 0.92;
  text-wrap: balance;
}

.start-card h1 {
  font-size: clamp(36px, 6.6vw, 76px);
  letter-spacing: -0.07em;
  text-shadow: 0 5px 0 rgba(255, 255, 255, 0.9);
}

.start-card h1 span {
  display: inline-block;
  color: var(--pink-500);
  transform: rotate(-2deg);
}

.screen-card h2,
.how-to-card h2 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.045em;
}

.start-card__lead,
.compact-card > p:not(.eyebrow),
.win-card__lead {
  margin: clamp(12px, 2vw, 20px) auto;
  color: rgba(84, 17, 47, 0.73);
  font-size: clamp(13px, 1.55vw, 18px);
  line-height: 1.5;
}

.start-card__actions,
.stacked-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.stacked-actions {
  width: min(100%, 330px);
  margin: 22px auto 0;
  flex-direction: column;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-button {
  display: inline-flex;
  min-width: min(100%, 220px);
  padding: 13px 24px;
  color: #fff;
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 950;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(135deg, #d83a78, #aa285d);
  box-shadow:
    0 7px 0 #a92b5d,
    0 13px 20px rgba(173, 42, 94, 0.25);
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.primary-button:hover {
  filter: saturate(1.08) brightness(1.04);
  transform: translateY(-2px);
}

.primary-button:active {
  box-shadow: 0 2px 0 #a92b5d, 0 6px 12px rgba(173, 42, 94, 0.2);
  transform: translateY(4px);
}

.secondary-button {
  width: 100%;
  padding: 11px 20px;
  border: 2px solid var(--pink-200);
  color: var(--berry-700);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 5px 0 #f2b1ca;
}

.secondary-button:hover {
  background: #fff;
  transform: translateY(-1px);
}

.text-button {
  display: inline-flex;
  padding: 10px 17px;
  color: var(--berry-700);
  background: transparent;
  align-items: center;
  gap: 7px;
}

.text-button:hover {
  color: var(--berry-950);
  background: rgba(255, 255, 255, 0.58);
}

.text-button__icon {
  display: grid;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  place-items: center;
}

.control-hint {
  display: flex;
  margin: clamp(15px, 2.4vw, 27px) 0 0;
  color: rgba(84, 17, 47, 0.72);
  font-size: clamp(10px, 1.15vw, 13px);
  align-items: center;
  justify-content: center;
  gap: 9px;
}

kbd {
  display: inline-block;
  padding: 5px 9px;
  border: 1px solid #e6a8c1;
  border-bottom-width: 3px;
  border-radius: 7px;
  color: var(--berry-800);
  font: 900 10px/1 var(--font);
  letter-spacing: 0.08em;
  background: #fff;
  box-shadow: 0 2px 5px rgba(91, 21, 55, 0.1);
}

.start-decor {
  position: absolute;
  z-index: 2;
  filter: drop-shadow(0 12px 10px rgba(81, 23, 52, 0.18));
  font-size: clamp(42px, 8vw, 92px);
  pointer-events: none;
}

.start-decor--cookie {
  bottom: 11%;
  left: 8%;
  transform: rotate(-18deg);
}

.start-decor--watermelon {
  right: 7%;
  bottom: 14%;
  transform: rotate(13deg);
}

.compact-card {
  width: min(100%, 480px);
  padding-top: clamp(50px, 6vw, 70px);
}

.card-sticker {
  position: absolute;
  top: -38px;
  left: 50%;
  display: grid;
  width: 76px;
  height: 76px;
  border: 5px solid #fff;
  border-radius: 27px;
  background: #ffe0ad;
  box-shadow: var(--soft-shadow);
  font-size: 42px;
  place-items: center;
  transform: translateX(-50%) rotate(-5deg);
}

.screen-overlay--win {
  background: rgba(247, 152, 190, 0.28);
}

.win-card {
  width: min(100%, 550px);
  padding-top: clamp(47px, 6vw, 68px);
}

.win-crown {
  position: absolute;
  top: -42px;
  left: 50%;
  color: #ffbd3f;
  font-size: clamp(70px, 9vw, 100px);
  line-height: 1;
  filter: drop-shadow(0 6px 0 #fff) drop-shadow(0 10px 10px rgba(90, 23, 54, 0.2));
  transform: translateX(-50%) rotate(-5deg);
}

.stats-grid {
  display: grid;
  margin: 20px 0 14px;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.stats-grid > div {
  padding: clamp(10px, 1.5vw, 17px) 7px;
  border: 2px solid rgba(248, 145, 183, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.stats-grid dt {
  margin-bottom: 5px;
  color: rgba(84, 17, 47, 0.72);
  font-size: clamp(9px, 1vw, 12px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-grid dd {
  margin: 0;
  color: var(--berry-800);
  font-size: clamp(17px, 2.3vw, 26px);
  font-weight: 950;
}

.best-score {
  margin: 0 0 18px;
  color: rgba(84, 17, 47, 0.65);
  font-size: 12px;
}

.best-score strong {
  color: var(--berry-700);
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -12%;
  left: var(--x);
  width: 10px;
  height: 20px;
  border-radius: 5px;
  background: var(--c);
  animation: confetti-fall var(--d) linear infinite;
  animation-delay: var(--delay);
}

.confetti i:nth-child(1) { --x: 5%; --c: #ff5794; --d: 4.1s; --delay: -1s; }
.confetti i:nth-child(2) { --x: 14%; --c: #ffdc6e; --d: 5s; --delay: -3s; }
.confetti i:nth-child(3) { --x: 24%; --c: #88dfcb; --d: 4.7s; --delay: -2s; }
.confetti i:nth-child(4) { --x: 34%; --c: #a9d8ff; --d: 5.4s; --delay: -4s; }
.confetti i:nth-child(5) { --x: 44%; --c: #ff81af; --d: 4.3s; --delay: -2.3s; }
.confetti i:nth-child(6) { --x: 53%; --c: #ffdc6e; --d: 5.3s; --delay: -1.5s; }
.confetti i:nth-child(7) { --x: 63%; --c: #88dfcb; --d: 4.8s; --delay: -3.8s; }
.confetti i:nth-child(8) { --x: 72%; --c: #ff5794; --d: 5.1s; --delay: -2.8s; }
.confetti i:nth-child(9) { --x: 80%; --c: #a9d8ff; --d: 4.5s; --delay: -1.2s; }
.confetti i:nth-child(10) { --x: 88%; --c: #ffdc6e; --d: 5.5s; --delay: -4.1s; }
.confetti i:nth-child(11) { --x: 95%; --c: #ff81af; --d: 4.2s; --delay: -2.1s; }
.confetti i:nth-child(12) { --x: 58%; --c: #b697ff; --d: 5.7s; --delay: -4.8s; }

@keyframes confetti-fall {
  to { transform: translateY(130vh) rotate(560deg); }
}

.modal-layer {
  z-index: 30;
  padding: clamp(12px, 3vw, 36px);
  background: rgba(82, 24, 55, 0.42);
  backdrop-filter: blur(9px);
}

.how-to-card {
  width: min(100%, 580px);
  max-height: 100%;
  overflow: auto;
  text-align: left;
}

.how-to-card .eyebrow,
.how-to-card h2 {
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  border: 2px solid var(--pink-200);
  border-radius: 14px;
  color: var(--berry-700);
  font-size: 27px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  place-items: center;
}

.modal-close:hover {
  background: var(--white);
  transform: rotate(4deg);
}

.how-to-list {
  display: grid;
  margin: clamp(18px, 3vw, 30px) 0;
  padding: 0;
  list-style: none;
  gap: 10px;
}

.how-to-list li {
  display: grid;
  padding: 11px 14px 11px 10px;
  border: 2px solid rgba(246, 129, 174, 0.22);
  border-radius: 19px;
  color: rgba(84, 17, 47, 0.65);
  font-size: clamp(11px, 1.25vw, 14px);
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.68);
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
}

.how-to-list__art {
  display: grid;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: var(--pink-100);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
  font-size: 30px;
  place-items: center;
}

.how-to-list li:nth-child(2) .how-to-list__art { background: #fff0c8; }
.how-to-list li:nth-child(3) .how-to-list__art { background: #dff8ed; }

.jump-art {
  color: var(--berry-600);
  font-size: 38px;
}

.how-to-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--berry-800);
  font-size: 1.15em;
}

.how-to-card > .primary-button {
  display: flex;
  width: min(100%, 270px);
  margin: 0 auto;
}

.jump-button {
  position: absolute;
  z-index: 9;
  right: 18px;
  bottom: 18px;
  display: none;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.06em;
  background: linear-gradient(145deg, #d83a78, #9f2a58);
  box-shadow: 0 8px 0 #9f2a58, 0 14px 20px rgba(84, 17, 47, 0.28);
  cursor: pointer;
  touch-action: manipulation;
}

.jump-button span {
  display: block;
}

.jump-button span:first-child {
  margin-bottom: -3px;
  font-size: 33px;
  line-height: 0.85;
}

.jump-button:active {
  bottom: 12px;
  box-shadow: 0 2px 0 #9f2a58, 0 6px 12px rgba(84, 17, 47, 0.22);
}

.game-toast {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: clamp(20px, 4vw, 44px);
  max-width: min(88%, 360px);
  margin: 0;
  padding: 9px 18px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 99px;
  color: var(--berry-800);
  font-size: clamp(11px, 1.5vw, 15px);
  text-align: center;
  background: rgba(255, 248, 252, 0.92);
  box-shadow: var(--soft-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease;
}

.game-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.site-footer {
  min-height: 38px;
  padding: 10px 10px 0;
  font-size: 10px;
}

.site-footer span {
  color: var(--pink-500);
}

.noscript-message {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 16px;
  left: 16px;
  margin: 0;
  padding: 14px 18px;
  border: 2px solid var(--pink-300);
  border-radius: 14px;
  color: var(--berry-950);
  text-align: center;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

@media (max-width: 700px) {
  .game-app {
    padding-right: max(5px, env(safe-area-inset-right));
    padding-left: max(5px, env(safe-area-inset-left));
  }

  .site-header,
  .site-footer {
    padding-inline: 10px;
  }

  .site-header__tagline,
  .keyboard-tip {
    display: none;
  }

  .game-shell {
    padding: 4px;
    border-radius: calc(var(--stage-radius) + 5px);
  }

  .game-stage {
    min-height: min(74dvh, 720px);
    max-height: calc(100dvh - 102px);
    aspect-ratio: auto;
  }

  .game-hud {
    grid-template-columns: auto 1fr auto;
    gap: 7px;
  }

  .progress-labels span:first-child,
  .progress-labels span:last-child {
    display: none;
  }

  .progress-labels {
    justify-content: center;
  }

  .cookie-pill {
    min-width: 76px;
    padding-right: 10px;
  }

  .icon-button {
    border-radius: 14px;
  }

  .hud-actions {
    gap: 5px;
  }

  .screen-overlay {
    padding-top: 74px;
  }

  .start-card {
    padding-top: 58px;
  }

  .start-card__actions {
    flex-direction: column;
  }

  .start-card__actions .primary-button {
    width: min(100%, 260px);
  }

  .control-hint {
    flex-direction: column;
    gap: 5px;
  }

  .start-decor {
    display: none;
  }

  .desktop-break {
    display: none;
  }

  .jump-button {
    display: block;
  }

  .game-toast {
    bottom: 108px;
  }

  .game-stage:has(#startScreen.is-active) .jump-button,
  .game-stage:has(#pauseScreen.is-active) .jump-button,
  .game-stage:has(#winScreen.is-active) .jump-button,
  .game-stage:has(#howPanel.is-active) .jump-button {
    display: none;
  }
}

@media (max-width: 440px) {
  .game-app {
    padding-top: 5px;
  }

  .site-header {
    min-height: 38px;
    padding-bottom: 5px;
  }

  .mini-brand {
    font-size: 12px;
  }

  .mini-brand__donut {
    width: 22px;
    height: 22px;
  }

  .game-stage {
    min-height: calc(100dvh - 81px);
    max-height: calc(100dvh - 81px);
  }

  .site-footer {
    min-height: 33px;
    justify-content: center;
  }

  .cookie-icon {
    display: none;
  }

  .cookie-pill {
    min-width: 57px;
    padding-left: 10px;
    justify-content: center;
  }

  .screen-card,
  .how-to-card {
    padding-inline: 18px;
  }

  .stats-grid {
    gap: 5px;
  }

  .stats-grid > div {
    padding-inline: 3px;
  }

  .how-to-list li {
    padding-right: 9px;
    grid-template-columns: 46px 1fr;
    gap: 8px;
  }

  .how-to-list__art {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 25px;
  }
}

@media (max-height: 670px) and (min-width: 701px) {
  .site-header,
  .site-footer {
    display: none;
  }

  .game-app {
    padding-block: 5px;
  }

  .game-stage {
    max-height: calc(100dvh - 20px);
  }

  .screen-overlay {
    padding-top: 66px;
  }

  .start-card {
    transform: scale(0.91);
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .game-app {
    width: min(100%, calc(100dvh * 16 / 9 + 18px));
  }

  .game-stage {
    min-height: 0;
    max-height: calc(100dvh - 18px);
    aspect-ratio: 16 / 9;
  }

  .jump-button {
    display: block;
    width: 64px;
    height: 64px;
  }

  .start-card,
  .compact-card,
  .win-card {
    transform: scale(0.78);
  }
}

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

@media (prefers-contrast: more) {
  .screen-card,
  .how-to-card,
  .cookie-pill,
  .icon-button {
    border-color: var(--berry-800);
  }

  .start-card__lead,
  .compact-card > p:not(.eyebrow),
  .win-card__lead,
  .how-to-list li {
    color: var(--berry-950);
  }
}
