/* Noah's Play — shared toddler-friendly styles */

:root {
  --sky-top: #1a3a4a;
  --sky-mid: #2d5a6b;
  --sky-bottom: #3d7a6a;
  --ground: #c4a35a;
  --ground-dark: #a88840;
  --teal: #2a9d8f;
  --teal-dark: #1f7a6f;
  --cream: #fff8e7;
  --ink: #1e2a2e;
  --accent: #e76f51;
  --soft-white: #f5f0e6;
  --shadow: rgba(0, 0, 0, 0.35);
  --font-display: "Fredoka", "Nunito", "Comic Sans MS", sans-serif;
  --font-body: "Nunito", "Fredoka", sans-serif;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--sky-top);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ——— Scene shells ——— */

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #4a8a7a 0%, transparent 55%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 78%, var(--ground) 78%, var(--ground-dark) 100%);
  overflow: hidden;
}

.scene--home {
  background:
    radial-gradient(circle at 20% 25%, #5a9a88 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, #3d6a7a 0%, transparent 35%),
    linear-gradient(180deg, #1e4a55 0%, #2d6a5a 55%, #c4a35a 78%, #a88840 100%);
}

.scene--letters {
  background:
    radial-gradient(ellipse at 50% 30%, #3d6a80 0%, transparent 50%),
    linear-gradient(180deg, #1a3550 0%, #2a5570 60%, #3a6a60 100%);
}

/* Japanese hand-drawn / ink-wash letter scene */
.scene--ink {
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 180, 160, 0.35), transparent 45%),
    radial-gradient(ellipse at 85% 20%, rgba(160, 210, 255, 0.35), transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(180, 230, 160, 0.3), transparent 45%),
    linear-gradient(165deg, #f7efe3 0%, #efe4d4 40%, #e7f0ea 100%);
  color: #3d2914;
}

.scene--ink .brand-tag {
  color: #5c4033;
  opacity: 0.75;
}

.ink-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.letter-stage--ink {
  z-index: 5;
  gap: 1rem;
}

.letter-pair--ink {
  font-family: "Yomogi", "Kiwi Maru", "Fredoka", cursive;
  color: #3d2914;
  text-shadow: 2px 3px 0 rgba(255, 255, 255, 0.7);
}

.figure-frame--ink {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), rgba(255, 248, 231, 0.75));
  border: 3px solid #3d2914;
  border-radius: 42% 58% 48% 52% / 52% 42% 58% 48%;
  box-shadow:
    4px 6px 0 rgba(61, 41, 20, 0.12),
    inset 0 0 0 6px rgba(255, 255, 255, 0.35);
}

.figure-frame--ink svg.ink-draw {
  width: 82%;
  height: 82%;
  filter: drop-shadow(1px 2px 0 rgba(61, 41, 20, 0.08));
}

.figure-word--ink {
  font-family: "Kiwi Maru", "Yomogi", "Fredoka", sans-serif;
  color: #5c4033;
  text-transform: lowercase;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.2em 0.75em;
  border-radius: 999px;
  border: 2px dashed #3d2914;
}

.press-hint--ink {
  font-family: "Kiwi Maru", "Fredoka", sans-serif;
  background: #fff8e7;
  border: 2.5px solid #3d2914;
  box-shadow: 3px 4px 0 rgba(61, 41, 20, 0.15);
  border-radius: 1.2rem;
}

.press-hint--ink .key-cap {
  background: #ff6b6b;
  border: 2px solid #3d2914;
  box-shadow: 2px 2px 0 #3d2914;
}

.say-again {
  margin-top: 0.25rem;
  font-family: "Kiwi Maru", "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #3d2914;
  background: #ffe066;
  border: 2.5px solid #3d2914;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  box-shadow: 3px 3px 0 rgba(61, 41, 20, 0.18);
  cursor: pointer;
}

.say-again:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(61, 41, 20, 0.18);
}

/* Dramatic FX overlays */
.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}

.fx-layer.is-on {
  display: flex;
}

.fx-stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fx-cross svg {
  width: min(55vw, 280px);
  height: min(55vw, 280px);
}

.fx-cross path {
  fill: none;
  stroke: #e03131;
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 0 rgba(130, 0, 0, 0.35));
}

.fx--wrong.is-animating .fx-cross {
  animation: cross-slam 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

.fx-poopoo {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.2rem, 2vw, 0.9rem);
  max-width: 94vw;
  min-height: min(52vh, 420px);
}

.poo-fall {
  display: grid;
  place-items: center;
}

.poopoo-draw {
  width: var(--poo-size, min(58vw, 300px));
  height: var(--poo-size, min(58vw, 300px));
  filter: drop-shadow(0 10px 0 rgba(61, 41, 20, 0.2));
}

.fx--correct.is-animating .poo-fall {
  animation: poopoo-fall 1.35s cubic-bezier(0.22, 1.35, 0.35, 1) both;
  animation-delay: var(--poo-delay, 0s);
}

.fx--wrong {
  background: rgba(255, 80, 80, 0.18);
}

.fx--correct {
  background: rgba(255, 220, 120, 0.22);
}

/* Persistent ten-step streak meter */
.streak-bar {
  position: absolute;
  top: 4.3rem;
  bottom: 0.7rem;
  left: 0.55rem;
  z-index: 25;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-evenly;
  align-items: center;
  width: clamp(34px, 5vw, 54px);
  max-height: 82vh;
  padding: 0.25rem;
  border: 2px solid rgba(92, 64, 51, 0.2);
  border-radius: 999px;
  background: rgba(255, 248, 231, 0.72);
  box-shadow: 2px 3px 0 rgba(61, 41, 20, 0.1);
  pointer-events: none;
}

.streak-step {
  display: grid;
  place-items: center;
  min-height: 0;
  opacity: 0.2;
  filter: grayscale(1);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.streak-step .poopoo-draw {
  --poo-size: min(4.8vh, 44px);
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 2px 0 rgba(61, 41, 20, 0.15));
}

.streak-step.is-on {
  opacity: 1;
  filter: none;
}

.streak-step.is-new {
  animation: streak-light-up 0.7s cubic-bezier(0.2, 1.7, 0.3, 1);
}

@keyframes streak-light-up {
  0% {
    transform: scale(0.25);
  }
  55% {
    transform: scale(1.45);
  }
  100% {
    transform: scale(1);
  }
}

/* Five- and ten-in-a-row celebrations */
.congrats-layer {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vh, 1.2rem);
  padding: 1rem;
  background: rgba(255, 248, 231, 0.94);
}

.congrats-layer.is-on {
  display: flex;
}

.congrats-title {
  font-family: "Yomogi", "Fredoka", cursive;
  font-size: clamp(1.5rem, 6vw, 2.6rem);
  font-weight: 700;
  color: #5c4033;
  text-align: center;
  text-shadow: 3px 3px 0 #ffe066;
}

.congrats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.3rem, 2vw, 1rem);
  max-width: min(92vw, 640px);
}

.congrats-poo {
  position: relative;
  display: grid;
  place-items: center;
  border: none;
  padding: 0 0 1.5rem;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  filter: grayscale(0.55);
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.congrats-poo .poopoo-draw {
  --poo-size: min(16vw, 96px);
}

.congrats-poo.is-next {
  opacity: 1;
  filter: none;
  animation: congrats-wiggle 1.1s ease-in-out infinite;
}

.congrats-poo.is-ready {
  opacity: 1;
  filter: none;
}

.congrats-poo.is-done {
  opacity: 1;
  filter: none;
  animation: none;
}

.congrats-poo.is-flushing {
  animation: none;
  pointer-events: none;
}

.congrats-poo.is-flushing .poopoo-draw {
  animation: poo-flush-drop 0.85s cubic-bezier(0.45, 0.05, 0.7, 0.2) both;
  transform-origin: 50% 80%;
}

.congrats-poo.is-flushing .toilet-draw {
  animation: toilet-flush 0.95s ease-out both;
}

.congrats-poo.is-flushed {
  opacity: 0.28;
  filter: grayscale(1);
  animation: none;
  pointer-events: none;
}

.congrats-poo.is-flushed .poopoo-draw {
  opacity: 0.55;
}

.congrats-poo .toilet-draw {
  position: absolute;
  bottom: 1.35rem;
  width: min(14vw, 78px);
  height: min(10vw, 56px);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.congrats-poo.is-flushing .toilet-draw {
  opacity: 1;
}

.congrats-poo.is-flushed .toilet-draw {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.congrats-num {
  position: absolute;
  bottom: 0;
  min-width: 1.9em;
  font-family: "Fredoka", "Yomogi", cursive;
  font-size: clamp(0.9rem, 3.2vw, 1.3rem);
  font-weight: 700;
  line-height: 1.5;
  color: #3d2914;
  background: #fff8e7;
  border: 2.5px solid #3d2914;
  border-radius: 999px;
}

.congrats-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.halfway-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 2vw, 1rem);
  max-width: min(92vw, 640px);
}

.halfway-poo .poopoo-draw {
  --poo-size: min(17vw, 112px);
  animation: congrats-pop 0.75s cubic-bezier(0.2, 1.6, 0.3, 1) both;
  animation-delay: var(--poo-delay, 0s);
}

.halfway-subtitle {
  max-width: min(90vw, 640px);
  font-family: "Fredoka", "Yomogi", cursive;
  font-size: clamp(1.05rem, 4vw, 1.5rem);
  font-weight: 700;
  color: #6d4c41;
  text-align: center;
}

.congrats-btn {
  font-family: "Fredoka", "Yomogi", cursive;
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  font-weight: 700;
  color: #3d2914;
  background: #ffe066;
  border: 2.5px solid #3d2914;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  box-shadow: 3px 3px 0 rgba(61, 41, 20, 0.18);
  cursor: pointer;
}

.congrats-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(61, 41, 20, 0.18);
}

@keyframes congrats-wiggle {
  0%,
  100% {
    transform: scale(1) rotate(-3deg);
  }
  50% {
    transform: scale(1.12) rotate(3deg);
  }
}

@keyframes congrats-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.55) rotate(6deg);
  }
  100% {
    transform: scale(1.06) rotate(0deg);
  }
}

@keyframes cross-slam {
  0% {
    transform: scale(0.15) rotate(-25deg);
    opacity: 0;
  }
  45% {
    transform: scale(1.25) rotate(8deg);
    opacity: 1;
  }
  70% {
    transform: scale(0.92) rotate(-4deg);
  }
  100% {
    transform: scale(1.05) rotate(0deg);
    opacity: 1;
  }
}

@keyframes poopoo-fall {
  0% {
    transform: translate(calc(var(--drift-x, 0) * 1px), -52vh) scale(0.18)
      rotate(calc(var(--spin-start, -18) * 1deg));
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  42% {
    transform: translate(calc(var(--drift-x, 0) * 0.55px), calc(var(--land-y, 0) * 1px - 18px))
      scale(1.62) rotate(calc(var(--spin-end, 8) * -1.2deg));
  }
  60% {
    transform: translate(calc(var(--drift-x, 0) * 0.3px), calc(var(--land-y, 0) * 1px + 10px))
      scale(0.82) rotate(calc(var(--spin-end, 8) * 0.45deg));
  }
  78% {
    transform: translate(calc(var(--drift-x, 0) * 0.12px), calc(var(--land-y, 0) * 1px - 5px))
      scale(1.18) rotate(calc(var(--spin-end, 8) * 1deg));
  }
  100% {
    transform: translate(calc(var(--drift-x, 0) * 0.08px), calc(var(--land-y, 0) * 1px))
      scale(1) rotate(calc(var(--spin-end, 8) * 1deg));
    opacity: 1;
  }
}

@keyframes poo-flush-drop {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  35% {
    transform: translateY(8px) scale(1.15) rotate(18deg);
    opacity: 1;
  }
  70% {
    transform: translateY(42px) scale(0.45) rotate(210deg);
    opacity: 0.85;
  }
  100% {
    transform: translateY(58px) scale(0.12) rotate(340deg);
    opacity: 0;
  }
}

@keyframes toilet-flush {
  0% {
    transform: translateY(12px) scale(0.4);
    opacity: 0;
  }
  18% {
    transform: translateY(0) scale(1.08);
    opacity: 1;
  }
  55% {
    transform: translateY(0) scale(1);
  }
  70% {
    transform: translateY(2px) scale(0.96);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.ground-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(180deg, var(--ground) 0%, var(--ground-dark) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ——— Top chrome ——— */

.top-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.btn-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  background: var(--teal);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  border-radius: 0.5rem;
  box-shadow: 0 3px 0 var(--teal-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-menu:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--teal-dark);
}

.btn-menu svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.btn-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.65rem;
  background: rgba(255, 248, 231, 0.28);
  color: rgba(255, 248, 231, 0.9);
  border: 2px solid rgba(255, 248, 231, 0.45);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  z-index: 25;
}

.btn-settings svg {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-settings:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.brand-tag {
  font-size: 0.85rem;
  opacity: 0.7;
  font-weight: 600;
}

/* ——— Home ——— */

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem 7.5rem;
  position: relative;
  z-index: 2;
  gap: 1.5rem;
}

.home-brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  animation: brand-bob 3s ease-in-out infinite;
}

.home-sub {
  font-size: clamp(1rem, 3vw, 1.35rem);
  opacity: 0.9;
  font-weight: 600;
  margin-top: -0.75rem;
}

.home-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(420px, 92vw);
  margin-top: 0.5rem;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 248, 231, 0.95);
  color: var(--ink);
  border-radius: 1rem;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-weight: 700;
  font-size: 1.25rem;
  font-family: var(--font-display);
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

.game-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.game-card__icon {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.game-card__icon svg {
  width: 100%;
  height: 100%;
}

.game-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}

.game-card__label {
  font-size: 1.35rem;
  line-height: 1.1;
}

.game-card__hint {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  opacity: 0.65;
}

.home-deco {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 90vw);
  height: 90px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

/* ——— Game stage ——— */

.stage {
  flex: 1;
  position: relative;
  z-index: 5;
  width: 100%;
  overflow: hidden;
}

.stage-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hint-banner {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(255, 248, 231, 0.92);
  color: var(--ink);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  box-shadow: 0 3px 12px var(--shadow);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hint-banner.is-visible {
  opacity: 1;
}

/* ——— Guide point ——— */

.guide-ring {
  position: absolute;
  z-index: 30;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  margin-top: -36px;
  pointer-events: none;
  display: none;
}

.guide-ring.is-visible {
  display: block;
}

.guide-ring__pulse {
  position: absolute;
  inset: 0;
  border: 4px solid #ffe66d;
  border-radius: 50%;
  animation: guide-pulse 1.4s ease-out infinite;
  box-shadow: 0 0 0 2px rgba(255, 230, 109, 0.35);
}

.guide-ring__core {
  position: absolute;
  inset: 18px;
  background: rgba(255, 230, 109, 0.45);
  border-radius: 50%;
  border: 3px solid #fff;
}

.guide-ring__finger {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  width: 28px;
  height: 36px;
  animation: finger-bob 1s ease-in-out infinite;
}

.guide-ring__finger svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

/* ——— Letter games ——— */

.letter-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem 2.5rem;
  position: relative;
  z-index: 5;
}

.letter-pair {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 14vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  line-height: 1;
  min-height: 1.1em;
}

.letter-pair .lower {
  opacity: 0.85;
  margin-left: 0.15em;
}

.figure-frame {
  width: min(280px, 55vw);
  height: min(280px, 55vw);
  display: grid;
  place-items: center;
  background: rgba(255, 248, 231, 0.12);
  border-radius: 50%;
  border: 4px solid rgba(255, 248, 231, 0.25);
}

.figure-frame svg {
  width: 75%;
  height: 75%;
  overflow: visible;
}

.figure-word {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  min-height: 1.2em;
}

.press-hint {
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 700;
  background: rgba(255, 248, 231, 0.92);
  color: var(--ink);
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  box-shadow: 0 3px 12px var(--shadow);
}

.press-hint .key-cap {
  display: inline-block;
  background: var(--teal);
  color: white;
  padding: 0.1em 0.45em;
  border-radius: 0.35rem;
  margin: 0 0.2em;
  font-family: var(--font-display);
}

.letter-idle {
  opacity: 0.55;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 600;
  text-align: center;
  max-width: 18rem;
}

/* Animations */

@keyframes brand-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes guide-pulse {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@keyframes finger-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

@keyframes pop-in {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-18px);
  }
  70% {
    transform: translateY(-6px);
  }
}

@keyframes shake-oops {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px) rotate(-3deg);
  }
  40% {
    transform: translateX(10px) rotate(3deg);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(8deg);
  }
}

@keyframes flap {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(-25deg);
  }
}

@keyframes hen-jump {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-55px) scale(1.05);
  }
  55% {
    transform: translateY(-40px) scale(1.08);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes crack-shake {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-6deg) scale(1.05);
  }
  75% {
    transform: rotate(6deg) scale(1.05);
  }
}

@keyframes celebrate {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.2) rotate(-5deg);
  }
  60% {
    transform: scale(1.15) rotate(5deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse-hint {
  0%,
  100% {
    box-shadow: 0 3px 12px var(--shadow);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(42, 157, 143, 0.35);
    transform: scale(1.05);
  }
}

.is-popping {
  animation: pop-in 0.45s ease-out;
}

.is-bouncing {
  animation: bounce-soft 0.55s ease;
}

.is-shaking {
  animation: shake-oops 0.45s ease;
}

.is-celebrating {
  animation: celebrate 0.6s ease;
}

.is-hint-pulse {
  animation: pulse-hint 0.7s ease 2;
}


/* Chickens SVG helpers */

.hen,
.chick,
.egg,
.mommy {
  cursor: pointer;
}

.hen .wing {
  transform-box: fill-box;
  transform-origin: center;
}

.hen-body.is-flapping .wing {
  animation: flap 0.25s ease-in-out 3;
}

.hen-body.is-jumping {
  animation: hen-jump 0.7s ease;
}

.egg-body.is-cracking {
  animation: crack-shake 0.4s ease;
}

.hen-body.is-celebrating,
.chick-body.is-celebrating,
.egg-body.is-popping,
.chick-body.is-popping {
  transform-box: fill-box;
  transform-origin: center;
}

.hen-body.is-celebrating,
.chick-body.is-celebrating {
  animation: celebrate 0.6s ease;
}

.egg-body.is-popping,
.chick-body.is-popping {
  animation: pop-in 0.45s ease-out;
}

.egg-crack {
  stroke: #5c4030;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  opacity: 0;
}

.egg[data-crack="1"] .egg-crack.c1 {
  opacity: 1;
}

.egg[data-crack="2"] .egg-crack.c1,
.egg[data-crack="2"] .egg-crack.c2 {
  opacity: 1;
}

.egg[data-crack="3"] .egg-crack {
  opacity: 1;
}

.dust-puff {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 248, 231, 0.5);
  pointer-events: none;
  z-index: 25;
  animation: dust-fade 0.4s ease-out forwards;
}

@keyframes dust-fade {
  to {
    transform: translateY(-20px) scale(1.8);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .home-menu {
    gap: 0.75rem;
  }

  .game-card {
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
  }

  .game-card__icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  .guide-ring {
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
  }
}

/* ——— Graphic Test (parent approval) ——— */

body.page-scroll {
  overflow: auto;
  height: auto;
  min-height: 100%;
  background: #efe6d8;
  color: #3d2914;
}

html.page-scroll {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

.game-card--tool {
  background: rgba(255, 248, 231, 0.82);
  border: 2px dashed rgba(30, 42, 46, 0.25);
}

.gtest {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  font-family: var(--font-body);
}

.gtest-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gtest-title-block h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.35rem;
}

.gtest-title-block p {
  max-width: 40rem;
  opacity: 0.8;
  font-weight: 600;
  line-height: 1.4;
}

.gtest-section {
  margin-bottom: 2rem;
}

.gtest-section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.gtest-note {
  opacity: 0.7;
  font-weight: 600;
  margin-bottom: 1rem;
}

.gtest-styles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gtest-card {
  background: #fffaf2;
  border: 3px solid #3d2914;
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  box-shadow: 4px 5px 0 rgba(61, 41, 20, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.gtest-card:hover {
  transform: translateY(-2px);
}

.gtest-card.is-picked {
  outline: 4px solid #2a9d8f;
  outline-offset: 2px;
  background: #f0faf7;
}

.gtest-card__head h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0.25rem 0;
}

.gtest-card__head p {
  opacity: 0.7;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.gtest-badge {
  display: inline-block;
  background: #ffe066;
  border: 2px solid #3d2914;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.gtest-card__arts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.gtest-art__frame {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 25%, #fff, #f3ebe0);
  border: 2px solid #3d2914;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.gtest-art__frame svg {
  width: 88%;
  height: 88%;
}

.gtest-art__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.gtest-poos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.gtest-poo {
  background: #fffaf2;
  border: 3px solid #3d2914;
  border-radius: 1rem;
  padding: 0.75rem;
  cursor: pointer;
  text-align: center;
  box-shadow: 4px 5px 0 rgba(61, 41, 20, 0.12);
}

.gtest-poo.is-picked {
  outline: 4px solid #e76f51;
  outline-offset: 2px;
  background: #fff5f0;
}

.gtest-poo__frame {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: rgba(255, 230, 109, 0.15);
  border-radius: 0.75rem;
  border: 2px dashed #3d2914;
}

.gtest-poo__frame svg {
  width: 85%;
  height: 85%;
}

.gtest-poo__label {
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.gtest-poo__shout {
  font-size: 1.1rem;
  margin-top: 0.15rem;
}

.gtest-picks {
  background: #fffaf2;
  border: 3px solid #3d2914;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
}

.gtest-picks p {
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .gtest-card__arts {
    grid-template-columns: 1fr;
  }
}
