/* KSMaths – Child-friendly visual theme */

:root {
  --sky-top: #e0f2fe;
  --sky-mid: #f0f9ff;
  --sky-bottom: #fefce8;
  --card-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.15);
}

html, body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: 'Nunito', 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(165deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Soft floating shapes background (CSS only – no external images required) */
.bg-playful {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto; /* allow vertical scroll */
}

.bg-playful::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    /* soft circles */
    radial-gradient(circle at 10% 20%, rgba(147, 197, 253, 0.35) 0%, transparent 25%),
    radial-gradient(circle at 85% 15%, rgba(253, 224, 71, 0.25) 0%, transparent 22%),
    radial-gradient(circle at 70% 80%, rgba(196, 181, 253, 0.3) 0%, transparent 28%),
    radial-gradient(circle at 15% 75%, rgba(167, 243, 208, 0.3) 0%, transparent 22%),
    radial-gradient(circle at 50% 50%, rgba(251, 207, 232, 0.2) 0%, transparent 30%),
    /* tiny dots pattern */
    radial-gradient(rgba(99, 102, 241, 0.07) 1.5px, transparent 1.5px);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    28px 28px;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
}

/* Decorative floating maths symbols (pure CSS) */
.math-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.math-decor span {
  position: absolute;
  font-size: 1.75rem;
  opacity: 0.12;
  color: #6366f1;
  animation: float 18s ease-in-out infinite;
  user-select: none;
}

.math-decor span:nth-child(1)  { top: 8%;  left: 6%;  animation-delay: 0s;   font-size: 2.2rem; }
.math-decor span:nth-child(2)  { top: 18%; left: 88%; animation-delay: 2s;   font-size: 1.8rem; color: #ec4899; }
.math-decor span:nth-child(3)  { top: 42%; left: 4%;  animation-delay: 4s;   font-size: 2rem;   color: #10b981; }
.math-decor span:nth-child(4)  { top: 65%; left: 92%; animation-delay: 1s;   font-size: 1.6rem; color: #f59e0b; }
.math-decor span:nth-child(5)  { top: 78%; left: 12%; animation-delay: 3s;   font-size: 2.4rem; color: #8b5cf6; }
.math-decor span:nth-child(6)  { top: 30%; left: 78%; animation-delay: 5s;   font-size: 1.5rem; color: #06b6d4; }
.math-decor span:nth-child(7)  { top: 55%; left: 55%; animation-delay: 2.5s; font-size: 1.9rem; color: #f43f5e; }
.math-decor span:nth-child(8)  { top: 12%; left: 45%; animation-delay: 6s;   font-size: 1.4rem; color: #84cc16; }
.math-decor span:nth-child(9)  { top: 88%; left: 70%; animation-delay: 1.5s; font-size: 2.1rem; color: #6366f1; }
.math-decor span:nth-child(10) { top: 48%; left: 25%; animation-delay: 4.5s; font-size: 1.7rem; color: #a855f7; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-18px) rotate(6deg); }
  50%      { transform: translateY(8px) rotate(-4deg); }
  75%      { transform: translateY(-10px) rotate(3deg); }
}

/* Content above decorations */
#app {
  position: relative;
  z-index: 1;
}

/* Soft glass / card styling */
.card-soft {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.header-soft {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Playful rounded buttons & hover lift */
.btn-play {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-play:hover {
  transform: translateY(-2px);
}
.btn-play:active {
  transform: translateY(0);
}

/* KS card hover glow */
.ks-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.ks-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.25);
}

/* Star rating bounce */
.star-pop {
  display: inline-block;
  animation: starPop 0.5s ease backwards;
}
.star-pop:nth-child(2) { animation-delay: 0.12s; }
.star-pop:nth-child(3) { animation-delay: 0.24s; }

@keyframes starPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

/* Smooth progress bar */
.progress-fill {
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Option buttons */
.option-btn {
  transition: all 0.15s ease;
}
.option-btn:hover {
  transform: scale(1.01);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .math-decor span,
  .star-pop,
  .ks-card,
  .btn-play {
    animation: none !important;
    transition: none !important;
  }
}
