:root {
  --sky: #dff7ff;
  --mint: #d8f7db;
  --sun: #ffe69a;
  --melon: #ffb8a8;
  --berry: #ff7f96;
  --ink: #24324a;
  --paper: #fffdf6;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(36, 50, 74, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Assistant", "Rubik", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(255, 230, 154, 0.95), transparent 24%),
    radial-gradient(circle at left 20%, rgba(216, 247, 219, 0.95), transparent 22%),
    linear-gradient(180deg, #bdefff 0%, #e9fbff 46%, #fff9ef 100%);
  color: var(--ink);
}

body.accessibility-font-large {
  font-size: 1.12rem;
}

body.accessibility-readable-font {
  font-family: "Arial", "Noto Sans Hebrew", sans-serif;
}

body.accessibility-high-contrast {
  background: #fffef4;
  color: #111111;
}

body.accessibility-high-contrast .hero,
body.accessibility-high-contrast .panel,
body.accessibility-high-contrast .gorilla-guide__bubble,
body.accessibility-high-contrast .gorilla-guide__stat,
body.accessibility-high-contrast .play-card,
body.accessibility-high-contrast .focus-card,
body.accessibility-high-contrast .number-focus-card,
body.accessibility-high-contrast .opening-letter-game__board,
body.accessibility-high-contrast .compare-counts-game__board,
body.accessibility-high-contrast .catch-answer-game__board,
body.accessibility-high-contrast .catch-answer-arena,
body.accessibility-high-contrast .math-game__board,
body.accessibility-high-contrast .site-footer,
body.accessibility-high-contrast .legal-modal__dialog,
body.accessibility-high-contrast .cookie-banner,
body.accessibility-high-contrast .accessibility-toolbar {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 0 0 2px #111111;
}

body.accessibility-high-contrast .button,
body.accessibility-high-contrast .accessibility-toolbar__button,
body.accessibility-high-contrast .site-footer__link,
body.accessibility-high-contrast .legal-modal__close {
  border: 2px solid #111111;
  box-shadow: none;
}

.accessibility-toolbar {
  position: sticky;
  top: 10px;
  z-index: 22;
  width: min(1120px, calc(100% - 32px));
  margin: 10px auto 0;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(36, 50, 74, 0.1);
  backdrop-filter: blur(8px);
}

.accessibility-toolbar__button {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffffff, #eef8ff);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(36, 50, 74, 0.08);
}

.accessibility-toolbar__button.is-active {
  background: linear-gradient(135deg, #ffcf9f, #ff8fb1);
  color: #2f2330;
}

.site-footer {
  margin-top: 26px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  box-shadow: 0 14px 26px rgba(36, 50, 74, 0.08);
  display: grid;
  gap: 14px;
  text-align: center;
}

.site-footer__note {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.site-footer__link {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff6df;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 50, 74, 0.45);
}

.legal-modal__dialog {
  position: relative;
  width: min(720px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  background: #fffdf6;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(36, 50, 74, 0.22);
  overflow: auto;
  padding: 20px;
}

.legal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.legal-modal__header h2 {
  margin: 0;
}

.legal-modal__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff1ea;
  font: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}

.legal-modal__content {
  display: grid;
  gap: 14px;
  line-height: 1.7;
}

.legal-modal__content p,
.legal-modal__content ul {
  margin: 0;
}

.cookie-banner {
  position: fixed;
  right: 16px;
  left: 16px;
  bottom: 16px;
  z-index: 35;
  background: rgba(255, 253, 246, 0.97);
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(36, 50, 74, 0.18);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.cookie-banner__text {
  line-height: 1.6;
  font-weight: 700;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.gorilla-guide {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 25;
  width: min(260px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
}

.gorilla-guide__mobile-toggle {
  display: none;
}

.gorilla-guide__collapse-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  z-index: 26;
  transition: gap 0.2s ease, padding 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.gorilla-guide__collapse-toggle:focus-visible {
  outline: 3px solid rgba(255, 179, 107, 0.8);
  outline-offset: 3px;
}

.gorilla-guide__collapse-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.gorilla-guide__collapse-label {
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.gorilla-guide.is-collapsed .gorilla-guide__collapse-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  top: auto;
  right: auto;
  padding: 0 14px;
  gap: 8px;
  background: linear-gradient(135deg, #fff6cf, #ffffff);
  box-shadow: 0 12px 22px rgba(36, 50, 74, 0.14);
}

.gorilla-guide.is-collapsed .gorilla-guide__collapse-label {
  width: 82px;
  opacity: 1;
}

.gorilla-guide__bubble {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 24px 24px 24px 8px;
  padding: 14px 16px;
  box-shadow: 0 14px 28px rgba(36, 50, 74, 0.12);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.5;
}

.gorilla-guide__effect {
  min-height: 24px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gorilla-guide__effect.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gorilla-guide__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gorilla-guide__stat {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  padding: 8px 10px;
  text-align: center;
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
}

.gorilla-guide__stat span {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.gorilla-guide__stat strong {
  font-size: 1rem;
}

.gorilla-guide__character {
  position: relative;
  width: 170px;
  margin-right: auto;
  animation: gorilla-float 3.2s ease-in-out infinite, gorilla-sway 5.8s ease-in-out infinite;
  filter: drop-shadow(0 14px 24px rgba(36, 50, 74, 0.14));
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
}

.gorilla-guide.is-collapsed .gorilla-guide__bubble,
.gorilla-guide.is-collapsed .gorilla-guide__stats,
.gorilla-guide.is-collapsed .gorilla-guide__effect,
.gorilla-guide.is-collapsed .gorilla-guide__character,
.gorilla-guide.is-collapsed .gorilla-menu {
  display: none;
}

.gorilla-guide__character:focus-visible {
  outline: 3px solid rgba(255, 179, 107, 0.8);
  outline-offset: 6px;
}

.gorilla-guide__action-prop {
  position: absolute;
  right: -8px;
  top: 36px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  opacity: 0;
  transform: translateY(10px) scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 4;
}

.gorilla-guide__action-prop.is-visible {
  opacity: 1;
}

.gorilla-guide__character.is-feeding .gorilla-guide__head {
  animation: gorilla-chew 1.4s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-feeding .gorilla-guide__action-prop {
  animation: gorilla-prop-feed 1.5s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-bathing .gorilla-guide__face,
.gorilla-guide__character.is-bathing .gorilla-guide__body {
  animation: gorilla-bath-bounce 1.6s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-bathing .gorilla-guide__action-prop {
  animation: gorilla-prop-bath 1.6s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-sleeping .gorilla-guide__eyes span {
  animation: none;
  transform: scaleY(0.12);
}

.gorilla-guide__character.is-sleeping {
  animation: gorilla-sleep-drift 3.4s cubic-bezier(0.22, 1, 0.36, 1) 1;
}

.gorilla-guide__character.is-sleeping .gorilla-guide__action-prop {
  animation: gorilla-prop-sleep 2s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-petting .gorilla-guide__head {
  animation: gorilla-pet-lean 1.2s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-petting .gorilla-guide__action-prop {
  animation: gorilla-prop-pet 1.2s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.gorilla-guide__character.is-playing .gorilla-guide__body {
  animation: gorilla-play-hop 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) 3;
}

.gorilla-guide__character.is-playing .gorilla-guide__action-prop {
  animation: gorilla-prop-play 1s cubic-bezier(0.34, 1.56, 0.64, 1) 3;
}

.gorilla-guide__character.is-feeding .gorilla-guide__mouth,
.gorilla-guide__character.is-feeding .gorilla-guide__nose {
  animation-duration: 0.7s;
  animation-iteration-count: 4;
}

.gorilla-guide__character.is-bathing .gorilla-guide__sparkles span {
  animation: gorilla-bubble-pop 1.3s ease-in-out 3;
}

.gorilla-guide__character.is-playing .gorilla-guide__arm--right {
  animation: gorilla-play-wave 0.6s ease-in-out 4;
}

.gorilla-guide__character.is-playing .gorilla-guide__arm--left {
  animation: gorilla-play-wave-left 0.6s ease-in-out 4;
}

.gorilla-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 14px 28px rgba(36, 50, 74, 0.12);
}

.gorilla-menu__action {
  min-height: 68px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff7ef, #ffe4d7);
  display: grid;
  place-items: center;
  gap: 2px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.gorilla-menu__action span:first-child {
  font-size: 1.4rem;
}

.gorilla-guide__sparkles span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  animation: gorilla-sparkle 2.6s ease-in-out infinite;
}

.gorilla-guide__sparkles span:nth-child(1) {
  top: 12px;
  right: -4px;
}

.gorilla-guide__sparkles span:nth-child(2) {
  top: 48px;
  left: -8px;
  animation-delay: 0.7s;
}

.gorilla-guide__sparkles span:nth-child(3) {
  top: 96px;
  right: 8px;
  animation-delay: 1.2s;
}

.gorilla-guide__head {
  position: relative;
  width: 150px;
  height: 142px;
  margin: 0 auto -12px;
  animation: gorilla-head-tilt 4.6s ease-in-out infinite;
  transform-origin: center bottom;
}

.gorilla-guide__ear {
  position: absolute;
  top: 2px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #c7927a;
  box-shadow: inset 0 0 0 10px #ffe1da;
}

.gorilla-guide__ear--right {
  right: -2px;
}

.gorilla-guide__ear--left {
  left: -2px;
}

.gorilla-guide__face {
  position: absolute;
  inset: 0;
  border-radius: 52% 52% 46% 46%;
  background: linear-gradient(180deg, #c99782, #a97360);
  box-shadow: 0 14px 24px rgba(36, 50, 74, 0.16);
  animation: gorilla-breathe 3.8s ease-in-out infinite;
  transform-origin: center center;
}

.gorilla-guide__brow {
  position: absolute;
  top: 30px;
  right: 22px;
  width: 106px;
  height: 22px;
  border-radius: 999px 999px 18px 18px;
  background: rgba(120, 78, 64, 0.32);
}

.gorilla-guide__eyes {
  position: absolute;
  top: 44px;
  right: 34px;
  left: 34px;
  display: flex;
  justify-content: space-between;
}

.gorilla-guide__eyes span {
  width: 16px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3a2b27, #5a433d);
  animation: gorilla-blink 4.4s infinite;
  transform-origin: center;
  position: relative;
}

.gorilla-guide__eyes span::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.gorilla-guide__muzzle {
  position: absolute;
  right: 50%;
  bottom: 14px;
  width: 84px;
  height: 62px;
  transform: translateX(50%);
  border-radius: 42px 42px 34px 34px;
  background: linear-gradient(180deg, #f7dacd, #ecc1af);
  box-shadow: inset 0 -4px 0 rgba(214, 156, 134, 0.35);
}

.gorilla-guide__nose {
  position: absolute;
  top: 10px;
  right: 50%;
  width: 38px;
  height: 20px;
  transform: translateX(50%);
  border-radius: 16px;
  background: linear-gradient(180deg, #71544a, #533d35);
  animation: gorilla-nose-bob 3.8s ease-in-out infinite;
}

.gorilla-guide__nose::before,
.gorilla-guide__nose::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 232, 226, 0.3);
}

.gorilla-guide__nose::before {
  right: 7px;
}

.gorilla-guide__nose::after {
  left: 7px;
}

.gorilla-guide__mouth {
  position: absolute;
  right: 50%;
  bottom: 10px;
  width: 42px;
  height: 16px;
  transform: translateX(50%);
  border-radius: 0 0 24px 24px;
  border-bottom: 4px solid #fff7f4;
  animation: gorilla-smile 3.4s ease-in-out infinite;
}

.gorilla-guide__body {
  position: relative;
  width: 176px;
  height: 138px;
  border-radius: 48px 48px 30px 30px;
  background: linear-gradient(180deg, #c8917a, #a86f5c);
  box-shadow: 0 14px 24px rgba(36, 50, 74, 0.16);
  animation: gorilla-body-bounce 3.2s ease-in-out infinite;
  transform-origin: center top;
}

.gorilla-guide__arm {
  position: absolute;
  top: 18px;
  width: 48px;
  height: 94px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c8917a, #a86f5c);
}

.gorilla-guide__arm--right {
  right: -14px;
  transform: rotate(-16deg);
  animation: gorilla-wave 2.2s ease-in-out infinite;
  transform-origin: top center;
}

.gorilla-guide__arm--left {
  left: -14px;
  transform: rotate(18deg);
  animation: gorilla-arm-bob 3.1s ease-in-out infinite;
  transform-origin: top center;
}

.gorilla-guide__belly {
  position: absolute;
  inset: 26px 30px 12px;
  border-radius: 40px;
  background: linear-gradient(180deg, #fff1ea, #ffd7ca);
}

@keyframes gorilla-float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes gorilla-sway {
  0%, 100% {
    rotate: -1deg;
  }

  50% {
    rotate: 1.4deg;
  }
}

@keyframes gorilla-head-tilt {
  0%, 100% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-3deg);
  }

  55% {
    transform: rotate(2deg);
  }

  75% {
    transform: rotate(-1deg);
  }
}

@keyframes gorilla-blink {
  0%, 45%, 100% {
    transform: scaleY(1);
  }

  48%, 52% {
    transform: scaleY(0.1);
  }
}

@keyframes gorilla-breathe {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02, 1.03);
  }
}

@keyframes gorilla-nose-bob {
  0%, 100% {
    transform: translateX(50%) translateY(0);
  }

  50% {
    transform: translateX(50%) translateY(1px);
  }
}

@keyframes gorilla-smile {
  0%, 100% {
    transform: translateX(50%) scaleX(1);
  }

  50% {
    transform: translateX(50%) scaleX(1.08);
  }
}

@keyframes gorilla-wave {
  0%, 100% {
    transform: rotate(-16deg);
  }

  50% {
    transform: rotate(-36deg);
  }
}

@keyframes gorilla-arm-bob {
  0%, 100% {
    transform: rotate(18deg);
  }

  50% {
    transform: rotate(28deg);
  }
}

@keyframes gorilla-body-bounce {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }

  40% {
    transform: translateY(-2px) scaleY(1.01);
  }

  60% {
    transform: translateY(2px) scaleY(0.99);
  }
}

@keyframes gorilla-chew {
  0%, 100% {
    transform: rotate(0deg) translateY(0) scale(1);
  }

  20% {
    transform: rotate(-3deg) translateY(2px) scale(1.02);
  }

  45% {
    transform: rotate(3deg) translateY(-1px) scale(0.99);
  }

  70% {
    transform: rotate(-2deg) translateY(1px) scale(1.01);
  }
}

@keyframes gorilla-bath-bounce {
  0%, 100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }

  25% {
    transform: translateY(-5px) scale(1.02) rotate(-2deg);
  }

  50% {
    transform: translateY(-9px) scale(1.04) rotate(2deg);
  }

  75% {
    transform: translateY(-3px) scale(1.01) rotate(-1deg);
  }
}

@keyframes gorilla-sleep-drift {
  0%, 100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }

  25% {
    transform: translateX(-4px) translateY(2px) rotate(-2deg);
  }

  75% {
    transform: translateX(4px) translateY(-2px) rotate(2deg);
  }
}

@keyframes gorilla-pet-lean {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }

  35% {
    transform: rotate(-7deg) scale(1.02);
  }

  70% {
    transform: rotate(3deg) scale(0.99);
  }
}

@keyframes gorilla-play-hop {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }

  25% {
    transform: translateY(-6px) scale(1.02, 0.99);
  }

  50% {
    transform: translateY(-16px) scale(1.03, 0.97);
  }

  75% {
    transform: translateY(-3px) scale(0.99, 1.02);
  }
}

@keyframes gorilla-prop-feed {
  0%, 100% {
    transform: translate(0, 12px) rotate(6deg) scale(0.72);
  }

  35% {
    transform: translate(-16px, -8px) rotate(-10deg) scale(0.92);
  }

  60% {
    transform: translate(-28px, -20px) rotate(-24deg) scale(1.08);
  }

  80% {
    transform: translate(-12px, -6px) rotate(-8deg) scale(0.94);
  }
}

@keyframes gorilla-prop-bath {
  0%, 100% {
    transform: translateY(8px) scale(0.8);
  }

  30% {
    transform: translate(-4px, -8px) scale(0.92);
  }

  60% {
    transform: translate(6px, -16px) scale(1.12);
  }
}

@keyframes gorilla-prop-sleep {
  0%, 100% {
    transform: translateY(6px) scale(0.8);
  }

  50% {
    transform: translate(-10px, -10px) scale(1);
  }
}

@keyframes gorilla-prop-pet {
  0%, 100% {
    transform: translateY(8px) scale(0.8) rotate(0deg);
  }

  50% {
    transform: translate(-18px, -6px) scale(1.04) rotate(-10deg);
  }
}

@keyframes gorilla-prop-play {
  0%, 100% {
    transform: translateY(8px) rotate(0deg) scale(0.8);
  }

  25% {
    transform: translate(-4px, -10px) rotate(10deg) scale(0.96);
  }

  50% {
    transform: translate(-14px, -20px) rotate(18deg) scale(1.08);
  }

  75% {
    transform: translate(4px, -8px) rotate(-8deg) scale(0.95);
  }
}

@keyframes gorilla-bubble-pop {
  0%, 100% {
    transform: scale(0.85) translateY(0);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.25) translateY(-8px);
    opacity: 1;
  }
}

@keyframes gorilla-play-wave {
  0%, 100% {
    transform: rotate(-16deg);
  }

  50% {
    transform: rotate(-48deg);
  }
}

@keyframes gorilla-play-wave-left {
  0%, 100% {
    transform: rotate(18deg);
  }

  50% {
    transform: rotate(36deg);
  }
}


@keyframes gorilla-sparkle {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes catch-answer-fall {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(420px);
  }
}

.firework {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.2);
  animation: firework-burst 2600ms ease-out forwards;
}

@keyframes firework-burst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.3);
  }
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 217, 0.95));
  border-radius: 40px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0.4;
}

.hero::before {
  width: 180px;
  height: 180px;
  background: var(--melon);
  top: -50px;
  left: -30px;
}

.hero::after {
  width: 140px;
  height: 140px;
  background: var(--mint);
  bottom: -30px;
  right: 24px;
}

.hero__badge {
  display: inline-block;
  background: var(--white);
  border: 2px dashed rgba(36, 50, 74, 0.2);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 700;
}

.hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 360px);
  gap: 26px;
  align-items: center;
}

.hero__copy {
  text-align: right;
}

h1,
h2,
h3,
.equation,
.focus-card__letter,
.number-card__digit,
.letter-card {
  font-family: "Rubik", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
  margin: 18px 0 12px;
}

.hero p {
  max-width: 680px;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.audience-switcher {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.audience-switcher__label {
  font-size: 0.98rem;
  font-weight: 800;
}

.audience-switcher__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audience-switcher__button {
  min-width: 136px;
  border: 2px solid rgba(36, 50, 74, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 22px rgba(36, 50, 74, 0.08);
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.audience-switcher__button:hover,
.audience-switcher__button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(36, 50, 74, 0.12);
}

.audience-switcher__button:focus-visible {
  outline: 3px solid rgba(255, 179, 107, 0.65);
  outline-offset: 3px;
}

.audience-switcher__button.is-active {
  border-color: rgba(255, 127, 150, 0.65);
  background: linear-gradient(180deg, #fff7ef, #ffe0ea);
}

.audience-switcher__icon {
  font-size: 1.4rem;
  line-height: 1;
}

.hero__mascot {
  position: relative;
  min-height: 320px;
  border-radius: 34px;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(180deg, #c6f3ff 0%, #fff3c1 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.hero__mascot-face {
  width: 132px;
  height: 132px;
  margin: 22px auto 16px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  font-size: 4.8rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 16px 26px rgba(36, 50, 74, 0.12);
}

.hero__mascot-bubble {
  max-width: 250px;
  margin: 0 auto;
  display: grid;
  gap: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  padding: 16px 14px;
}

.hero__mascot-bubble strong {
  font-size: 1.25rem;
}

.hero__mascot-bubble span {
  font-size: 1rem;
  line-height: 1.5;
}

.hero__spark {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 20px rgba(36, 50, 74, 0.1);
  font-size: 1.7rem;
}

.hero__spark--one {
  top: 24px;
  right: 18px;
}

.hero__spark--two {
  left: 18px;
  top: 88px;
}

.hero__spark--three {
  right: 36px;
  bottom: 26px;
}

.hero-playground {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.play-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border-radius: 28px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 14px 24px rgba(36, 50, 74, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.play-card:hover,
.play-card:focus-visible {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 18px 28px rgba(36, 50, 74, 0.13);
}

.play-card__emoji {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.68);
}

.play-card strong {
  font-size: 1.3rem;
}

.play-card span:last-child {
  font-size: 1rem;
  line-height: 1.5;
}

.play-card--letters {
  background: linear-gradient(180deg, #ffe1ec, #fff8cc);
}

.play-card--numbers {
  background: linear-gradient(180deg, #d8ffe1, #f7ffd7);
}

.play-card--memory {
  background: linear-gradient(180deg, #dff0ff, #efe7ff);
}

.play-card--count {
  background: linear-gradient(180deg, #e2fff8, #dbf0ff);
}

.play-card--math {
  background: linear-gradient(180deg, #fff0db, #ffe2c2);
}

.play-card--celebrate {
  background: linear-gradient(180deg, #f8e6ff, #ffe7f1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.button:focus-visible,
.letter-card:hover,
.letter-card:focus-visible,
.answer-button:hover,
.answer-button:focus-visible,
.number-card:hover {
  transform: translateY(-3px) scale(1.01);
}

.button--primary {
  background: linear-gradient(135deg, #ff8fa3, #ffb36b);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(255, 127, 150, 0.3);
}

.button--secondary {
  background: var(--white);
  color: var(--ink);
  border: 2px solid rgba(36, 50, 74, 0.12);
}

.content {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel--letters {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 246, 255, 0.96));
}

.panel--numbers {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 255, 244, 0.96));
}

.panel--math {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 231, 0.96));
}

.panel--memory {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 247, 255, 0.96));
}

.seo-copy {
  margin-top: 22px;
}

.seo-copy__text {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.8;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading__icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #a9ebff, #ffe592);
  font-size: 2rem;
  font-weight: 800;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.section-heading p {
  margin: 0;
  font-size: 1.05rem;
}

.letters-grid,
.numbers-grid,
.answers {
  display: grid;
  gap: 14px;
}

.letters-grid {
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
}

.letter-card {
  min-height: 76px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #ffeef2);
  color: var(--ink);
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
  cursor: pointer;
}

.letter-card.is-active {
  background: linear-gradient(135deg, #ff8fa3, #ffd36f);
  color: var(--white);
}

.focus-card {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 3px dashed rgba(255, 179, 107, 0.45);
}

.focus-card__visuals {
  display: grid;
  gap: 12px;
}

.focus-card__letter {
  width: 100%;
  min-height: 108px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 4.3rem;
  background: linear-gradient(135deg, #b1ecff, #fff0a7);
}

.focus-card__icon {
  width: 100%;
  min-height: 108px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #ffd3df, #fff3bf);
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
}

.focus-card__text h3 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.focus-card__text p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.6;
}

.numbers-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.number-card {
  background: linear-gradient(180deg, #ffffff, #edfff1);
  border-radius: 24px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
  cursor: pointer;
  border: none;
  color: var(--ink);
  font-family: inherit;
}

.number-card.is-active {
  background: linear-gradient(135deg, #7edb9a, #bff2a3);
}

.number-card__digit {
  font-size: 3.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.number-card__name {
  font-size: 1.2rem;
  font-weight: 700;
}

.number-card__dots {
  margin-top: 10px;
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.number-focus-card {
  margin-top: 20px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 3px dashed rgba(126, 219, 154, 0.5);
  padding: 20px;
  display: grid;
  gap: 18px;
}

.number-focus-card__main {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
}

.number-focus-card__digit {
  min-height: 124px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 4.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #b8f3c5, #fff0a7);
}

.number-focus-card__text h3 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.number-focus-card__text p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.6;
}

.number-focus-card__items {
  min-height: 120px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #effff3);
  padding: 16px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.8;
  box-shadow: inset 0 0 0 2px rgba(126, 219, 154, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.number-focus-card__item {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f7fff8);
  box-shadow: 0 8px 16px rgba(36, 50, 74, 0.08);
}

.opening-letter-game {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.opening-letter-game__board {
  background: linear-gradient(180deg, #e8f8ff, #ffffff);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 2px rgba(86, 207, 225, 0.18);
  text-align: center;
  display: grid;
  gap: 14px;
}

.opening-letter-game__label {
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(36, 50, 74, 0.74);
}

.opening-letter-game__target {
  min-height: 132px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  font-size: 4.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #9fe8ff, #ffe7a8);
}

.opening-letter-game__hint {
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.6;
}

.opening-letter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.opening-letter-option {
  min-height: 126px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f2fbff);
  padding: 14px 10px;
  display: grid;
  place-items: center;
  gap: 8px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(36, 50, 74, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.opening-letter-option:hover,
.opening-letter-option:focus-visible {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 18px 28px rgba(36, 50, 74, 0.12);
}

.opening-letter-option.is-correct {
  background: linear-gradient(135deg, #98e3a3, #daf7ae);
}

.opening-letter-option.is-wrong {
  background: linear-gradient(135deg, #ffb7b7, #ffd8aa);
}

.opening-letter-option__emoji {
  font-size: 2.9rem;
  line-height: 1;
}

.opening-letter-option__word {
  font-size: 1.1rem;
  font-weight: 800;
}

.alphabet-order-game {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.alphabet-order-game__board {
  background: linear-gradient(180deg, #fff4f7, #ffffff);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 2px rgba(255, 127, 150, 0.18);
  text-align: center;
  display: grid;
  gap: 14px;
}

.alphabet-order-game__label {
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(36, 50, 74, 0.74);
}

.alphabet-order-game__hint {
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.6;
}

.alphabet-order-game__play {
  display: grid;
  gap: 14px;
}

.alphabet-order-targets,
.alphabet-order-bank {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.alphabet-order-slot,
.alphabet-order-letter {
  min-height: 76px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 2rem;
}

.alphabet-order-slot {
  border: 3px dashed rgba(36, 50, 74, 0.2);
  background: rgba(255, 255, 255, 0.74);
}

.alphabet-order-slot.is-over {
  border-color: rgba(255, 127, 150, 0.65);
  background: #fff1f4;
}

.alphabet-order-slot.is-filled {
  border-style: solid;
  border-color: rgba(126, 219, 154, 0.6);
  background: linear-gradient(180deg, #f4fff5, #ffffff);
}

.alphabet-order-slot__index {
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.65;
}

.alphabet-order-slot__letter {
  font-size: 2rem;
  font-weight: 800;
}

.alphabet-order-letter {
  border: none;
  cursor: grab;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #eef8ff);
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
}

.alphabet-order-letter:active {
  cursor: grabbing;
}

.alphabet-order-letter.is-used {
  opacity: 0.35;
  pointer-events: none;
}

.compare-counts-game {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.compare-counts-game__board {
  background: linear-gradient(180deg, #eefee9, #ffffff);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 2px rgba(126, 219, 154, 0.2);
  display: grid;
  gap: 14px;
}

.compare-counts-game__label,
.compare-counts-group__title {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.compare-counts-visuals {
  display: grid;
  gap: 12px;
}

.compare-counts-group {
  display: grid;
  gap: 8px;
}

.compare-counts-group__items {
  min-height: 110px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f7fff8);
  box-shadow: inset 0 0 0 2px rgba(126, 219, 154, 0.14);
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.compare-counts-item {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #f2fff5);
  box-shadow: 0 8px 16px rgba(36, 50, 74, 0.08);
  font-size: 1.5rem;
}

.compare-counts-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.compare-counts-option {
  min-height: 110px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f2fbff);
  color: var(--ink);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(36, 50, 74, 0.08);
}

.compare-counts-option.is-correct {
  background: linear-gradient(135deg, #79d98f, #b9f3a7);
}

.compare-counts-option.is-wrong {
  background: linear-gradient(135deg, #ffb3b3, #ffd3a4);
}

.catch-answer-game {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.catch-answer-game__board {
  background: linear-gradient(180deg, #fff2ea, #ffffff);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 2px rgba(255, 184, 168, 0.22);
  text-align: center;
  display: grid;
  gap: 14px;
}

.catch-answer-score {
  font-size: 1.05rem;
  font-weight: 800;
}

.catch-answer-arena {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.92), transparent 22%),
    linear-gradient(180deg, #dff7ff 0%, #fff7e7 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 184, 168, 0.18);
}

.catch-answer-bubble {
  position: absolute;
  top: -64px;
  min-width: 72px;
  min-height: 64px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #ffe8d8);
  color: var(--ink);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(36, 50, 74, 0.12);
  animation: catch-answer-fall linear forwards;
}

.catch-answer-bubble.is-correct {
  background: linear-gradient(135deg, #79d98f, #b9f3a7);
}

.catch-answer-bubble.is-wrong {
  background: linear-gradient(135deg, #ffb3b3, #ffd3a4);
}

.math-game {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.math-game__board {
  background: linear-gradient(180deg, #fff6d7, #ffffff);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 2px rgba(255, 179, 107, 0.2);
  text-align: center;
}

.math-label {
  font-size: 1rem;
  font-weight: 700;
}

.equation {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 16px 0 18px;
}

.answers {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  align-content: start;
}

.answer-button {
  min-height: 88px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(180deg, #f2fbff, #ffffff);
  color: var(--ink);
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
}

.answer-button.is-correct {
  background: linear-gradient(135deg, #79d98f, #b9f3a7);
}

.answer-button.is-wrong {
  background: linear-gradient(135deg, #ffb3b3, #ffd3a4);
}

.feedback {
  min-height: 34px;
  margin: 18px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.memory-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.memory-meta {
  display: grid;
  gap: 6px;
}

.memory-status {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.memory-attempts {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(36, 50, 74, 0.8);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.memory-card {
  min-height: 154px;
  perspective: 1000px;
}

.memory-card__button {
  width: 100%;
  height: 100%;
  min-height: 154px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.memory-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 154px;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}

.memory-card.is-flipped .memory-card__inner,
.memory-card.is-matched .memory-card__inner {
  transform: rotateY(180deg);
}

.memory-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  padding: 12px 10px;
  backface-visibility: hidden;
  box-shadow: 0 10px 18px rgba(36, 50, 74, 0.08);
  overflow: hidden;
}

.memory-card__face--front {
  background: linear-gradient(135deg, #ffbad1, #ffd977);
  color: var(--white);
  font-size: 2.7rem;
  font-weight: 800;
}

.memory-card__face--back {
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  color: var(--ink);
  transform: rotateY(180deg);
  gap: 6px;
  text-align: center;
}

.memory-card__emoji {
  font-size: 2.8rem;
  line-height: 1;
  max-width: 100%;
}

.memory-card__quantity {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 94px;
  margin: 0 auto;
}

.memory-card__quantity-item {
  display: grid;
  place-items: center;
  font-size: 0.98rem;
  line-height: 1;
}

.memory-card__label {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.memory-card__type {
  font-size: 0.82rem;
  opacity: 0.8;
  line-height: 1;
}

.memory-card--quantity .memory-card__face--back {
  padding: 10px 8px;
  gap: 4px;
}

.memory-card--quantity .memory-card__label {
  font-size: 0.88rem;
}

.memory-card--quantity .memory-card__type {
  font-size: 0.74rem;
}

.memory-card--digit .memory-card__emoji {
  font-size: 3.2rem;
}

.memory-card.is-matched .memory-card__face--back {
  background: linear-gradient(180deg, #e8ffe8, #faffea);
}

@media (max-width: 780px) {
  .accessibility-toolbar {
    width: calc(100% - 20px);
    top: 8px;
    padding: 8px;
  }

  .accessibility-toolbar__button {
    flex: 1 1 140px;
  }

  .site-footer__links,
  .cookie-banner__actions {
    flex-direction: column;
  }

  .legal-modal__dialog {
    width: calc(100% - 18px);
    margin: 9px auto;
    max-height: calc(100vh - 18px);
  }

  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
    padding-bottom: 190px;
  }

  .hero,
  .panel {
    padding: 22px 18px;
  }

  .gorilla-guide {
    left: 10px;
    bottom: 10px;
    width: min(220px, calc(100vw - 20px));
  }

  .gorilla-guide.is-collapsed .gorilla-guide__collapse-toggle {
    left: 10px;
    bottom: 10px;
  }

  .gorilla-guide__mobile-toggle {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-right: auto;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffcf9f, #ff8fb1);
    color: #3f2f2a;
    font-size: 1.9rem;
    box-shadow: 0 10px 18px rgba(36, 50, 74, 0.16);
    pointer-events: auto;
  }

  .gorilla-guide:not(.is-open):not(.is-collapsed) .gorilla-guide__bubble,
  .gorilla-guide:not(.is-open):not(.is-collapsed) .gorilla-guide__stats,
  .gorilla-guide:not(.is-open):not(.is-collapsed) .gorilla-guide__effect,
  .gorilla-guide:not(.is-open):not(.is-collapsed) .gorilla-guide__character,
  .gorilla-guide:not(.is-open):not(.is-collapsed) .gorilla-menu {
    display: none;
  }

  .gorilla-guide.is-open .gorilla-guide__mobile-toggle {
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
  }

  .gorilla-guide__stats {
    grid-template-columns: 1fr;
  }

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

  .gorilla-guide__character {
    width: 122px;
  }

  .gorilla-guide__body {
    width: 124px;
    height: 98px;
  }

  .gorilla-guide__bubble {
    font-size: 0.9rem;
  }

  .gorilla-guide__effect {
    font-size: 1.2rem;
  }

  .gorilla-guide__head {
    width: 116px;
    height: 112px;
  }

  .gorilla-guide__muzzle {
    width: 64px;
    height: 46px;
    bottom: 12px;
  }

  .gorilla-guide__ear {
    width: 36px;
    height: 36px;
    box-shadow: inset 0 0 0 7px #ffe1da;
  }

  .gorilla-guide__arm {
    width: 34px;
    height: 70px;
  }

  .hero__layout,
  .hero-playground {
    grid-template-columns: 1fr;
  }

  .hero__copy {
    text-align: center;
  }

  .hero p {
    margin: 0 auto;
    font-size: 1.05rem;
  }

  .hero__actions {
    justify-content: center;
  }

  .button {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
  }

  .play-card {
    min-height: 126px;
    padding: 16px;
  }

  .play-card strong {
    font-size: 1.15rem;
  }

  .play-card span:last-child {
    font-size: 0.95rem;
  }

  .focus-card,
  .compare-counts-game,
  .catch-answer-game,
  .alphabet-order-game,
  .math-game,
  .opening-letter-game,
  .number-focus-card__main {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .letters-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .numbers-grid,
  .answers,
  .opening-letter-options,
  .compare-counts-options,
  .alphabet-order-targets,
  .alphabet-order-bank {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focus-card__letter {
    margin: 0 auto;
  }

  .focus-card__visuals {
    width: min(220px, 100%);
    margin: 0 auto;
  }

  .number-focus-card__digit {
    width: min(220px, 100%);
    margin: 0 auto;
  }

  .number-card {
    padding: 14px 10px;
  }

  .number-card__digit {
    font-size: 2.7rem;
  }

  .letter-card,
  .answer-button {
    min-height: 70px;
  }

  .equation {
    font-size: clamp(2.2rem, 9vw, 3.2rem);
  }

  .memory-card {
    min-height: 108px;
  }

  .memory-card__button,
  .memory-card__inner {
    min-height: 108px;
  }

  .memory-card__emoji {
    font-size: 1.8rem;
  }

  .memory-card__label {
    font-size: 0.78rem;
  }

  .memory-card__quantity {
    max-width: 64px;
  }

  .section-heading {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .accessibility-toolbar {
    width: calc(100% - 14px);
  }

  .page-shell {
    width: calc(100% - 14px);
    padding-bottom: 210px;
  }

  h1 {
    font-size: clamp(1.9rem, 10vw, 2.8rem);
  }

  .hero,
  .panel {
    border-radius: 28px;
    padding: 18px 14px;
  }

  .hero__actions {
    gap: 10px;
  }

  .audience-switcher__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audience-switcher__button {
    min-width: 0;
    width: 100%;
    padding: 12px 10px;
  }

  .section-heading__icon {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }

  .section-heading h2 {
    font-size: 1.45rem;
  }

  .letters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .numbers-grid,
  .answers,
  .opening-letter-options,
  .compare-counts-options,
  .alphabet-order-targets,
  .alphabet-order-bank,
  .hero-playground {
    grid-template-columns: 1fr;
  }

  .catch-answer-arena {
    min-height: 300px;
  }

  .memory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .gorilla-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gorilla-guide {
    width: calc(100vw - 20px);
  }

  .gorilla-guide__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gorilla-guide__bubble {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .gorilla-guide__character {
    width: 104px;
  }

  .gorilla-guide__head {
    width: 100px;
    height: 96px;
  }

  .gorilla-guide__body {
    width: 104px;
    height: 82px;
  }

  .gorilla-guide__arm {
    width: 28px;
    height: 58px;
  }

  .gorilla-guide__muzzle {
    width: 56px;
    height: 40px;
  }
}
