/* Moon Phase Helper — animated night-sky tap game (kids 3–8, almost no reading) */
@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&display=swap");

body.theme-moon-phase {
  --g-accent: #fbbf24;
  --g-accent-2: #a5b4fc;
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(99, 102, 241, 0.45), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 70%, rgba(167, 139, 250, 0.25), transparent 50%),
    linear-gradient(165deg, #0b1026 0%, #1e1b4b 45%, #0f172a 100%);
  font-family: "Fredoka", "Noto Sans Bengali", system-ui, sans-serif;
}
body.theme-moon-phase::before {
  background: rgba(251, 191, 36, 0.3);
}
body.theme-moon-phase::after {
  background: rgba(129, 140, 248, 0.28);
}

body.theme-moon-phase .game-top {
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.94), rgba(15, 23, 42, 0.9));
  border: 2px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
body.theme-moon-phase .game-top h1 {
  color: #fde68a;
  font-size: clamp(1rem, 4.2vw, 1.25rem);
}
body.theme-moon-phase .g-chip {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(165, 180, 252, 0.35);
}
body.theme-moon-phase .hint {
  color: #e0e7ff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  margin: 0.35rem 0 0.5rem;
}
body.theme-moon-phase .adv-mode-tag {
  display: inline-block;
  margin: 0 auto 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.mp-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 3 / 4.2;
  border-radius: 22px;
  overflow: hidden;
  border: 4px solid rgba(251, 191, 36, 0.4);
  box-shadow:
    0 0 0 3px rgba(49, 46, 129, 0.55),
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 0 80px rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(99, 102, 241, 0.35), transparent 60%),
    linear-gradient(180deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
  touch-action: manipulation;
  user-select: none;
}

.mp-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.mp-stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: mpTwinkle 2.4s ease-in-out infinite;
}
.mp-stars i.big {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}
@keyframes mpTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.mp-hill {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -8%;
  height: 28%;
  background: radial-gradient(ellipse 80% 100% at 50% 100%, #1a2744, #0b1224);
  border-radius: 50% 50% 0 0;
  z-index: 2;
  pointer-events: none;
}
.mp-hill::before {
  content: "🌲  🏠  🌲";
  position: absolute;
  left: 50%;
  bottom: 42%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  letter-spacing: 1.2rem;
  opacity: 0.85;
  filter: brightness(0.85);
}

.mp-want {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  pointer-events: none;
}
.mp-want-moon {
  font-size: clamp(3.2rem, 18vw, 4.4rem);
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.55));
  animation: mpWantPulse 1.8s ease-in-out infinite;
}
@keyframes mpWantPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.mp-want-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fde68a;
  background: rgba(15, 23, 42, 0.75);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.mp-field {
  position: absolute;
  inset: 22% 4% 18% 4%;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem 0.75rem;
  align-content: center;
  justify-items: center;
}

.mp-moon {
  appearance: none;
  border: none;
  background: rgba(15, 23, 42, 0.45);
  width: min(38vw, 148px);
  aspect-ratio: 1;
  max-height: 148px;
  border-radius: 50%;
  font-size: clamp(2.8rem, 14vw, 3.8rem);
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  border: 3px solid rgba(165, 180, 252, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  animation: mpFloat 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0ms);
}
.mp-moon:nth-child(2) { animation-delay: 0.4s; }
.mp-moon:nth-child(3) { animation-delay: 0.8s; }
.mp-moon:nth-child(4) { animation-delay: 1.1s; }
@keyframes mpFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.mp-moon.is-target {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow:
    0 0 0 4px rgba(251, 191, 36, 0.25),
    0 0 28px rgba(251, 191, 36, 0.55),
    0 8px 20px rgba(0, 0, 0, 0.35);
  animation: mpGlow 1.2s ease-in-out infinite, mpFloat 3.2s ease-in-out infinite;
}
@keyframes mpGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2), 0 0 18px rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.35), 0 0 36px rgba(251, 191, 36, 0.7); }
}
.mp-moon:active { transform: scale(0.94); }
.mp-moon.correct {
  border-color: #4ade80;
  animation: none;
  transform: scale(1.12);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.7);
}
.mp-moon.wrong {
  border-color: #f87171;
  animation: mpShake 0.4s ease;
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.55);
}
@keyframes mpShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.mp-cue {
  position: absolute;
  bottom: 3.5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-size: 0.9rem;
  font-weight: 800;
  color: #e0e7ff;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(165, 180, 252, 0.4);
  white-space: nowrap;
  pointer-events: none;
}
.mp-cue .glow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  margin-right: 0.35rem;
  box-shadow: 0 0 10px #fbbf24;
  animation: mpTwinkle 1s ease-in-out infinite;
}

.mp-spark {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  font-size: 1.4rem;
  animation: mpSpark 0.7s ease-out forwards;
}
@keyframes mpSpark {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-36px) scale(1.4); }
}

.mp-owl {
  position: absolute;
  right: 8%;
  bottom: 22%;
  z-index: 3;
  font-size: 1.6rem;
  pointer-events: none;
  animation: mpOwl 4s ease-in-out infinite;
}
@keyframes mpOwl {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.mp-owl.happy { animation: mpPop 0.5s ease; }
.mp-owl.oops { filter: grayscale(0.4); }
@keyframes mpPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.mp-win-moons {
  font-size: 1.6rem;
  letter-spacing: 0.15rem;
  text-align: center;
  margin: 0.35rem 0 0.5rem;
}

@media (max-width: 380px) {
  .mp-field {
    inset: 24% 2% 16% 2%;
    gap: 0.45rem;
  }
  .mp-moon {
    width: min(42vw, 130px);
    font-size: clamp(2.4rem, 13vw, 3.2rem);
  }
}
