/* Gan Champions 43: shared play layer. Motion tokens: 120 / 240 / 450 / 900ms. */
:root {
  --motion-press: 120ms;
  --motion-quick: 240ms;
  --motion-feedback: 450ms;
  --motion-celebrate: 900ms;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

/* Press: the card sinks under the finger. `scale` composes with each page's own transform. */
:is(button[data-answer-number], .adventure42-option, button.choice, .patterns-choices button):active:not(:disabled) {
  scale: .94;
}
html.no-motion :is(button[data-answer-number], .adventure42-option, button.choice, .patterns-choices button):active:not(:disabled) {
  scale: none;
  filter: brightness(.96);
}
@media (prefers-reduced-motion: reduce) {
  :is(button[data-answer-number], .adventure42-option, button.choice, .patterns-choices button):active:not(:disabled) {
    scale: none;
    filter: brightness(.96);
  }
}

/* A tried answer fades instead of staying pink. */
.play42-tried:not(.hint-glow) {
  opacity: .5;
}

/* Correct: a ✓ stamp turns in. */
.play42-stamp {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2b9d5f;
  color: #fff;
  box-shadow: 0 2px 0 #1d6b41;
  font: 800 16px/1 system-ui, Arial, sans-serif;
  pointer-events: none;
  animation: play42-stamp var(--motion-feedback) var(--ease-bounce) 60ms both;
}
@keyframes play42-stamp {
  from { transform: scale(0) rotate(-35deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
html.no-motion .play42-stamp { animation: play42-fade var(--motion-quick) linear both; }
@media (prefers-reduced-motion: reduce) { .play42-stamp { animation: play42-fade var(--motion-quick) linear both; } }
@keyframes play42-fade { from { opacity: 0; } to { opacity: 1; } }

.play42-layer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}
.play42-star {
  position: absolute;
  left: 0;
  top: 0;
  color: #e3a400;
  text-shadow: 0 2px 0 #fff4bf;
  font: 800 28px/1 system-ui, Arial, sans-serif;
  will-change: transform;
}
.play42-confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
}

/* Questions in English get a label, so a child who hears English is not surprised. */
.play42-en::before {
  content: "English";
  display: inline-block;
  margin-inline-end: .5em;
  padding: .15em .55em;
  border-radius: 999px;
  background: #1f4ea8;
  color: #fff;
  font-size: .6em;
  font-weight: 800;
  letter-spacing: .03em;
  vertical-align: middle;
}

/* Patterns: bigger shapes, and the train rolls when the row is done. */
.patterns-page .patterns-choices button {
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1;
}
.patterns-train.play42-travel {
  animation: play42-travel 900ms var(--ease-standard);
}
@keyframes play42-travel {
  35% { transform: translateX(7%) translateY(-3px); }
  70% { transform: translateX(-15%); }
  to { transform: none; }
}
html.no-motion .patterns-train.play42-travel { animation: none; }
@media (prefers-reduced-motion: reduce) { .patterns-train.play42-travel { animation: none; } }

/* Phones: while a question is on screen, the floating helpers get smaller and quieter. */
@media (max-width: 700px) {
  html.play42 .engage34-fab { scale: .86; transform-origin: bottom left; }
  html.play42 .access-open32 { scale: .9; }
}
