/* ---------- Little Learners · Play mode ----------
   Warm cream Montessori play screens. All interactive targets >= 48px. */

.play-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 260px;
}
@media (min-width: 900px) {
  .play-shell { padding-bottom: 170px; }
}

/* ---------- header ---------- */
.play-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 6px;
}
.play-title {
  flex: 1;
  margin: 0;
  font-size: clamp(1.3rem, 5.4vw, 1.8rem);
  line-height: 1.2;
}
.play-header-btns { display: flex; gap: 10px; }
.play-icon-btn {
  width: 56px; height: 56px;
  border-radius: 999px;
  border: 2px solid var(--beige);
  background: #fff;
  font-size: 24px;
  display: inline-grid; place-items: center;
  box-shadow: var(--card-shadow);
  flex: 0 0 auto;
}
.play-icon-btn:active { transform: scale(.94); }
.play-icon-btn.is-on { background: var(--yellow); border-color: var(--coral-deep); }

/* ---------- stage ---------- */
#play-stage { margin-top: 10px; }
.play-game { padding-bottom: 8px; }
.play-hint {
  font-size: clamp(1.05rem, 4.4vw, 1.3rem);
  font-weight: 700;
  font-family: var(--font-head);
  text-align: center;
  margin: 6px 0 14px;
}
.play-msg {
  min-height: 2.2em;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--coral-deep);
  margin: 10px 0;
}
.play-item-count {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 8px;
}
.play-progress {
  height: 18px;
  background: var(--beige);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 12px;
}
.play-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--sage-deep));
  transition: width .35s ease;
}
.play-nav {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.play-btn {
  min-height: 52px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid var(--beige);
  background: #fff;
  font-weight: 800;
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--ink);
  box-shadow: var(--card-shadow);
}
.play-btn:active { transform: scale(.96); }
.play-btn.primary { background: var(--coral-deep); border-color: var(--coral-deep); color: #fff; }
.play-btn.sage { background: var(--sage); border-color: var(--sage-deep); }
.play-btn:disabled { opacity: .45; }

.play-fallback {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 36px 24px;
  text-align: center;
}
.play-fallback .big { font-size: 3rem; margin-bottom: 8px; }

/* ---------- tracing ---------- */
.play-canvas-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 12px;
  touch-action: none;
}
.play-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--cream);
  touch-action: none;
  cursor: crosshair;
}

/* ---------- counting ---------- */
.count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
  margin: 8px 0 6px;
}
.count-tile {
  position: relative;
  min-height: 104px;
  border-radius: 22px;
  background: #fff;
  border: 3px solid var(--beige);
  box-shadow: var(--card-shadow);
  display: grid;
  place-items: center;
  font-size: 3rem;
}
.count-tile:active { transform: scale(.94); }
.count-tile.tapped { border-color: var(--sage-deep); background: var(--sage); }
.count-blob {
  width: 64px; height: 64px;
  border-radius: 999px;
  display: grid; place-items: center;
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  padding: 4px;
  text-align: center;
  line-height: 1.1;
  font-family: var(--font-head);
}
.count-badge {
  position: absolute;
  top: -10px; right: -8px;
  min-width: 40px; height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--coral-deep);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  display: grid; place-items: center;
  box-shadow: var(--card-shadow);
  animation: play-pop .3s ease;
}
.count-readout {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-head);
  min-height: 2em;
  margin: 6px 0;
}
.count-done {
  text-align: center;
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 800;
  font-family: var(--font-head);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 22px;
  margin: 10px 0;
  animation: play-pop .4s ease;
}

/* ---------- matching ---------- */
.match-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (min-width: 640px) { .match-cols { gap: 22px; } }
.match-col { display: flex; flex-direction: column; gap: 12px; }
.match-card {
  min-height: 76px;
  border-radius: 18px;
  background: #fff;
  border: 3px solid var(--beige);
  box-shadow: var(--card-shadow);
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-head);
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.match-card:active { transform: scale(.95); }
.match-card.selected { border-color: var(--coral-deep); background: var(--yellow); }
.match-card.matched {
  background: var(--sage);
  border-color: var(--sage-deep);
  animation: play-flip .5s ease;
  pointer-events: none;
}
.match-card .m-emoji { font-size: 2rem; }

/* ---------- coloring ---------- */
.color-stage { display: grid; gap: 14px; justify-items: center; }
.color-svg-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 18px;
  width: 100%;
  max-width: 380px;
}
.color-svg-wrap svg { display: block; width: 100%; height: auto; }
.color-region { cursor: pointer; transition: transform .18s ease; transform-origin: center; transform-box: fill-box; }
.color-region.filled { animation: play-pop .35s ease; }
.palette {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.palette-btn {
  width: 62px; height: 62px;
  border-radius: 999px;
  border: 4px solid #fff;
  box-shadow: var(--card-shadow);
}
.palette-btn.selected { border-color: var(--ink); transform: scale(1.12); }

/* ---------- sorting ---------- */
.sort-bins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sort-bin {
  min-height: 120px;
  border: 3px dashed var(--sage-deep);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: flex; flex-direction: column;
  gap: 8px;
  transition: background .2s ease, transform .2s ease;
}
.sort-bin.over { background: var(--sage); transform: scale(1.03); }
.sort-bin-label {
  font-weight: 800;
  font-family: var(--font-head);
  text-align: center;
  font-size: 1.05rem;
}
.sort-bin-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sort-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  min-height: 90px;
  padding: 14px;
  background: var(--beige);
  border-radius: var(--radius);
}
.sort-chip {
  min-height: 60px;
  min-width: 110px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--blue);
  box-shadow: var(--card-shadow);
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-head);
  display: inline-flex; align-items: center; gap: 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sort-chip.selected { border-color: var(--coral-deep); background: var(--yellow); }
.sort-chip.dragging {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  margin: 0;
  box-shadow: 0 10px 30px rgba(38,50,56,.22);
  transform: scale(1.08);
}
.sort-chip.placed {
  min-height: 48px;
  min-width: 0;
  font-size: 1rem;
  animation: play-bounce .45s ease;
}

/* ---------- patterns ---------- */
.seq-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px 0 18px;
}
.seq-chip {
  min-width: 64px; min-height: 64px;
  border-radius: 18px;
  background: #fff;
  border: 3px solid var(--beige);
  box-shadow: var(--card-shadow);
  display: grid; place-items: center;
  font-size: 1.9rem;
  font-weight: 800;
  font-family: var(--font-head);
  padding: 6px 10px;
}
.seq-chip.missing {
  border: 3px dashed var(--coral-deep);
  background: var(--yellow);
  animation: play-pulse 1.6s ease infinite;
}
.seq-chip.filled-ok { border-color: var(--sage-deep); background: var(--sage); animation: play-pop .4s ease; }
.choice-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.choice-btn {
  min-width: 84px; min-height: 84px;
  border-radius: 22px;
  background: #fff;
  border: 3px solid var(--blue);
  box-shadow: var(--card-shadow);
  font-size: 2.1rem;
  font-weight: 800;
  font-family: var(--font-head);
  padding: 8px 14px;
}
.choice-btn:active { transform: scale(.93); }

/* ---------- flashcards ---------- */
.flip-wrap { display: grid; justify-items: center; gap: 14px; }
.flip-card {
  width: min(100%, 360px);
  height: 300px;
  perspective: 1200px;
  background: none; border: none; padding: 0;
}
.flip-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform .55s ease;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: grid; place-items: center;
  padding: 20px;
  text-align: center;
}
.flip-front { background: #fff; border: 4px solid var(--yellow); }
.flip-back { background: var(--sage); transform: rotateY(180deg); }
.flip-big { font-size: 5rem; font-weight: 800; font-family: var(--font-head); line-height: 1; }
.flip-word { font-size: 1.6rem; font-weight: 800; font-family: var(--font-head); margin-top: 8px; }
.flip-emoji { font-size: 3.4rem; }
.card-speaker-row { display: flex; justify-content: center; }

/* ---------- scavenger hunt ---------- */
.hunt-list { display: grid; gap: 12px; }
.hunt-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 12px 18px;
  border: 3px solid transparent;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-head);
  text-align: left;
  width: 100%;
}
.hunt-row:active { transform: scale(.98); }
.hunt-check {
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 3px solid var(--sage-deep);
  display: grid; place-items: center;
  font-size: 1.4rem; color: transparent;
  flex: 0 0 auto;
  transition: background .2s ease;
}
.hunt-row.done { border-color: var(--sage-deep); background: var(--sage); }
.hunt-row.done .hunt-check { background: var(--sage-deep); color: #fff; animation: play-pop .3s ease; }
.hunt-row.done .hunt-text { text-decoration: line-through; opacity: .75; }

/* ---------- bingo ---------- */
.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}
.bingo-cell {
  aspect-ratio: 1;
  min-height: 56px;
  border-radius: 16px;
  background: #fff;
  border: 3px solid var(--beige);
  box-shadow: var(--card-shadow);
  font-weight: 800;
  font-family: var(--font-head);
  font-size: clamp(.8rem, 3.4vw, 1.05rem);
  display: grid; place-items: center;
  padding: 4px;
  position: relative;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
}
.bingo-cell .bingo-dot {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  color: var(--coral-deep);
  animation: play-pop .3s ease;
  pointer-events: none;
}
.bingo-cell.marked { border-color: var(--coral-deep); background: var(--yellow); }
.bingo-cell.free { background: var(--blue); border-color: var(--ink-soft); }
.bingo-cell.win { background: var(--sage); border-color: var(--sage-deep); }

/* ---------- together mode (no printable) ---------- */
.together-intro {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.step-list { display: grid; gap: 12px; margin: 14px 0; }
.step-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
  border: 3px solid transparent;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  width: 100%;
  min-height: 72px;
}
.step-card:active { transform: scale(.99); }
.step-main {
  flex: 1;
  display: flex; align-items: center; gap: 14px;
  background: none; border: none; padding: 0;
  font: inherit; color: inherit; text-align: left;
  min-height: 56px;
}
.step-num {
  width: 48px; height: 48px;
  border-radius: 999px;
  background: var(--yellow);
  display: grid; place-items: center;
  font-weight: 800; font-family: var(--font-head); font-size: 1.3rem;
  flex: 0 0 auto;
}
.step-card.done { border-color: var(--sage-deep); background: var(--sage); }
.step-card.done .step-num { background: var(--sage-deep); color: #fff; }
.step-card.done .step-text { text-decoration: line-through; opacity: .7; }
.step-say {
  margin-left: auto;
  width: 52px; height: 52px;
  border-radius: 999px;
  border: 2px solid var(--beige);
  background: var(--cream);
  font-size: 22px;
  flex: 0 0 auto;
}
.ask-list {
  display: grid; gap: 10px; margin-top: 10px;
}
.ask-chip {
  background: var(--blue);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: 600;
}

/* ---------- footer ---------- */
.play-footer {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 8px 20px 0;
  pointer-events: none;
}
@media (min-width: 900px) {
  .play-footer { bottom: 0; padding-bottom: 16px; }
}
.play-footer-inner { max-width: 720px; margin: 0 auto; pointer-events: auto; }
.play-nudge {
  background: var(--yellow);
  border: 3px solid var(--coral-deep);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px 18px;
  font-weight: 800;
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 10px;
  animation: play-pulse 1.8s ease infinite;
}
.play-done-btn {
  width: 100%;
  min-height: 62px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--coral-deep), var(--coral-dark));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-head);
  box-shadow: 0 8px 28px rgba(196, 112, 79, .4);
}
.play-done-btn:active { transform: scale(.98); }
.play-done-btn:disabled { opacity: .7; }
.play-done-btn.is-done { background: linear-gradient(135deg, var(--sage-deep), #4e7d5e); box-shadow: 0 8px 28px rgba(110, 155, 126, .4); }

/* ---------- celebration ---------- */
.play-celebrate {
  position: fixed; inset: 0;
  z-index: 300;
  background: rgba(38, 50, 56, .45);
  display: grid; place-items: center;
  padding: 24px;
  overflow: hidden;
}
.play-celebrate-card {
  background: var(--cream);
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(38,50,56,.3);
  padding: 36px 30px;
  text-align: center;
  max-width: 380px;
  position: relative;
  z-index: 2;
  animation: play-pop .45s ease;
}
.play-celebrate-card h2 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.play-confetti { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.play-confetti span {
  position: absolute;
  top: -16px;
  border-radius: 3px;
  animation: confetti-fall linear forwards;
}

/* ---------- animations ---------- */
@keyframes play-pop {
  0% { transform: scale(.55); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes play-bounce {
  0% { transform: scale(.7); }
  45% { transform: scale(1.15); }
  70% { transform: scale(.95); }
  100% { transform: scale(1); }
}
@keyframes play-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
@keyframes play-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-1.6deg); }
  75% { transform: rotate(1.6deg); }
}
@keyframes play-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
@keyframes play-flip {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(360deg); }
}
@keyframes confetti-fall {
  to { transform: translateY(108vh) rotate(680deg); }
}
.play-shake { animation: play-shake .45s ease; }
.play-wiggle { animation: play-wiggle .5s ease; }

/* ---------- landscape tweaks ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .play-shell { padding-bottom: 190px; }
  .flip-card { height: 220px; }
  .flip-big { font-size: 3.6rem; }
  .count-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .count-tile { min-height: 88px; font-size: 2.4rem; }
}

/* ---------- rewards header pill ---------- */
.play-rewards {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--beige);
  box-shadow: var(--card-shadow);
  font-weight: 800;
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--ink);
}

/* ---------- star burst + celebration mascot ---------- */
.celebrate-mascot {
  width: 130px; height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
  animation: play-bounce .6s ease;
}
.star-burst { margin: 10px 0 4px; }
.star-pop {
  display: inline-block;
  font-size: 3rem;
  animation: star-pop .55s cubic-bezier(.2, 1.6, .4, 1);
}
.star-gain {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--coral-deep);
  margin-top: 2px;
  animation: play-pop .5s ease .15s both;
}
@keyframes star-pop {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ---------- gentle "time's up" overlay ---------- */
.timesup-overlay {
  position: fixed; inset: 0;
  z-index: 400;
  background: rgba(38, 50, 56, .45);
  display: grid; place-items: center;
  padding: 24px;
}
.timesup-inline { display: grid; place-items: center; padding: 56px 16px; }
.timesup-card {
  background: var(--cream);
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(38,50,56,.3);
  padding: 40px 32px;
  text-align: center;
  max-width: 380px;
  animation: play-pop .45s ease;
}
.timesup-card h2 { font-size: 1.7rem; margin: 14px 0 8px; }
.timesup-card .play-btn { margin-top: 14px; }
