/* ============ Splash ============ */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  cursor: pointer;
  text-align: center;
  min-height: 78dvh;
}

.splash__glow {
  position: relative;
  display: grid;
  place-items: center;
}
.splash__glow::before {
  content: "";
  position: absolute;
  width: min(320px, 82vw);
  height: min(320px, 82vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 68%);
  animation: halo 3.2s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* Static rainbow ring — it pops in, then just breathes gently. */
.splash__ring {
  position: relative;
  border-radius: 50%;
  padding: 9px;
  background: conic-gradient(from 210deg, var(--sun), var(--pink), var(--grape), var(--blue), var(--mint), var(--sun));
  box-shadow: 0 18px 36px rgba(42, 53, 87, .32);
  animation: pop .7s var(--bounce) both, float-y 3.6s ease-in-out .7s infinite;
}

.splash__welcome {
  font-size: clamp(1.9rem, 8.5vw, 2.7rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 0 var(--blue-deep), 0 8px 18px rgba(42, 53, 87, .35);
  animation: welcome-in .55s var(--bounce) .3s both;
}
@keyframes welcome-in {
  from { opacity: 0; transform: translateY(16px) scale(.9); }
}
.splash__heart {
  display: inline-block;
  /* No text-shadow on the emoji — it muddies the glyph. */
  text-shadow: none;
  animation: heartbeat 1.6s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.22); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

.splash__hint {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, .7);
  padding: 5px 16px;
  border-radius: var(--r-pill);
  animation: fade-in .8s ease 1.3s both;
}

/* ============ Home ============ */
.home__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 8px 0 4px;
}
.home__mascot {
  cursor: pointer;
  animation: float-y 3s ease-in-out infinite;
}
.home__title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
  text-shadow: 0 3px 0 var(--blue-deep), 0 6px 14px rgba(42, 53, 87, .3);
}
.home__tagline {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, .7);
  padding: 4px 14px;
  border-radius: var(--r-pill);
}

.home__sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 400px) {
  .home__sections { grid-template-columns: 1fr; }
}

.statstrip {
  display: flex;
  gap: 10px;
}
.statstrip__item {
  flex: 1;
  background: rgba(255, 255, 255, .9);
  border-radius: var(--r-md);
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--lift-1);
}
.statstrip__value {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.statstrip__label { font-size: .74rem; color: var(--ink-soft); }

/* ============ Menus ============ */
.menu-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}
.menu-head__emoji { font-size: 2.8rem; animation: wiggle 3.5s ease-in-out infinite; }
.menu-head__title { font-size: 1.75rem; font-weight: 700; }
.menu-head__sub { color: var(--ink); opacity: .75; font-size: .95rem; }

.menu-list { display: grid; gap: 12px; }

.level-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .74rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--paper-tint);
  color: var(--ink-soft);
  margin-top: 5px;
}

/* ============ Play screen (shared game chrome) ============ */
.play {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.play__question {
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--lift-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: q-in .35s var(--bounce) both;
}
@keyframes q-in {
  from { opacity: 0; transform: scale(.9) translateY(10px); }
}

.play__prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .16em;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.play__prompt .op { color: var(--grape); padding: 0 .08em; }
.play__prompt .blank {
  display: inline-block;
  min-width: 1.4em;
  border-bottom: 6px solid var(--sun);
  color: var(--sun-deep);
}
.play__instruction {
  font-size: .95rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.play__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============ Flash mode ============ */
.flash-stage {
  flex: 1;
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(160deg, #2A3557, #46538A);
  border-radius: var(--r-xl);
  box-shadow: var(--lift-2);
  position: relative;
  overflow: hidden;
  transition: filter .1s var(--swift);
}

/* While numbers are still to come, the whole panel is the tap target. */
.flash-stage--live { cursor: pointer; }
.flash-stage--live:hover { filter: brightness(1.08); }
.flash-stage--live:active { filter: brightness(1.16); }
.flash-stage:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
.flash-stage__number {
  font-size: clamp(4rem, 26vw, 8rem);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(255, 255, 255, .45);
}
.flash-stage__number--in { animation: flash-in .16s var(--bounce) both; }
@keyframes flash-in {
  from { opacity: 0; transform: scale(.55); }
  to   { opacity: 1; transform: none; }
}
.flash-stage__number--minus { color: var(--coral); }
.flash-stage__hint {
  color: rgba(255, 255, 255, .8);
  font-size: 1.1rem;
  text-align: center;
  padding: 0 20px;
}
/* "Get ready" beat — no digits, so nothing here can be mistaken for a number
   the child is supposed to add. */
.flash-ready {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fade-in .25s ease both;
}
.flash-ready[hidden] { display: none; }

.flash-ready__eyes {
  font-size: 3.2rem;
  line-height: 1;
  animation: ready-bob 1s ease-in-out infinite;
}
@keyframes ready-bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.08); }
}

.flash-ready__dots { display: flex; gap: 13px; }
.flash-ready__dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  animation: ready-dot 1.15s ease-in-out infinite;
}
.flash-ready__dots span:nth-child(2) { animation-delay: .19s; }
.flash-ready__dots span:nth-child(3) { animation-delay: .38s; }
@keyframes ready-dot {
  0%, 55%, 100% { background: rgba(255, 255, 255, .3); transform: scale(1); }
  27% { background: var(--sun); transform: scale(1.55); }
}

.flash-ready__text {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.flash-stage__count {
  position: absolute;
  top: 12px;
  right: 16px;
  color: rgba(255, 255, 255, .55);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

/* ============ Results ============ */
.results {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding-top: 10px;
}
.results__emoji { font-size: 5rem; animation: pop .6s var(--bounce) both; }
.results__title { font-size: 2rem; font-weight: 700; }
.results__sub { color: var(--ink-soft); }

.results__score {
  display: flex;
  gap: 12px;
  width: 100%;
}
.results__cell {
  flex: 1;
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 14px 8px;
  box-shadow: var(--lift-1);
}
.results__cell-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.results__cell-label { font-size: .78rem; color: var(--ink-soft); }

.results__stars {
  font-size: 2.2rem;
  letter-spacing: .1em;
  min-height: 2.6rem;
}
.results__stars span {
  display: inline-block;
  animation: pop .5s var(--bounce) both;
}

.results__actions {
  margin-top: auto;
  display: grid;
  gap: 12px;
  width: 100%;
}

.badge-new {
  display: inline-block;
  background: var(--sun);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  box-shadow: var(--lift-1);
  animation: wiggle 1.6s ease-in-out infinite;
}
