* { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --bg1: #fff4d6;
  --bg2: #cdeaff;
  --primary: #ff7a59;
  --primary-dark: #e8613f;
  --secondary: #4fb0ff;
  --secondary-dark: #2f8ede;
  --card-bg: #ffffff;
  --text: #333844;
  --radius: 22px;
}

body {
  margin: 0;
  font-family: "Comic Sans MS", "Segoe UI", Verdana, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,105,180,0.55), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(64,180,255,0.55), transparent 45%),
    radial-gradient(circle at 20% 85%, rgba(90,220,130,0.5), transparent 42%),
    radial-gradient(circle at 92% 80%, rgba(255,175,55,0.55), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255,225,90,0.4), transparent 60%),
    linear-gradient(135deg, #fff2b8, #b9e6ff);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* Playful floating decorations behind the content */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  font-size: 2.6rem;
  opacity: 0.55;
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.bg-shape.s1  { top: 8%;  left: 6%;  font-size: 3rem;   animation-delay: 0s;   animation-duration: 7s; }
.bg-shape.s2  { top: 18%; left: 88%; font-size: 2.4rem;  animation-delay: 1.2s; animation-duration: 8s; }
.bg-shape.s3  { top: 68%; left: 4%;  font-size: 2.8rem;  animation-delay: 0.6s; animation-duration: 6.5s; }
.bg-shape.s4  { top: 78%; left: 90%; font-size: 3.2rem;  animation-delay: 2s;   animation-duration: 7.5s; }
.bg-shape.s5  { top: 42%; left: 94%; font-size: 2.2rem;  animation-delay: 1.6s; animation-duration: 6s; }
.bg-shape.s6  { top: 48%; left: 2%;  font-size: 2.2rem;  animation-delay: 0.9s; animation-duration: 8.5s; }
.bg-shape.s7  { top: 4%;  left: 46%; font-size: 2rem;    animation-delay: 2.4s; animation-duration: 7s; }
.bg-shape.s8  { top: 88%; left: 46%; font-size: 2.2rem;  animation-delay: 1.8s; animation-duration: 6.8s; }
.bg-shape.s9  { top: 30%; left: 16%; font-size: 2rem;    animation-delay: 0.3s; animation-duration: 7.2s; }
.bg-shape.s10 { top: 58%; left: 78%; font-size: 2.3rem;  animation-delay: 2.6s; animation-duration: 6.4s; }
.bg-shape.s11 { top: 10%; left: 70%; font-size: 2.6rem;  animation-delay: 1s;   animation-duration: 8.2s; }
.bg-shape.s12 { top: 60%; left: 30%; font-size: 2.1rem;  animation-delay: 1.9s; animation-duration: 7.8s; }
.bg-shape.s13 { top: 34%; left: 58%; font-size: 2.4rem;  animation-delay: 0.4s; animation-duration: 6.9s; }
.bg-shape.s14 { top: 92%; left: 20%; font-size: 2rem;    animation-delay: 2.2s; animation-duration: 7.4s; }
.bg-shape.s15 { top: 22%; left: 34%; font-size: 1.9rem;  animation-delay: 1.4s; animation-duration: 6.6s; }
.bg-shape.s16 { top: 74%; left: 62%; font-size: 2.2rem;  animation-delay: 0.7s; animation-duration: 8s; }
.bg-shape.s17 { top: 2%;  left: 22%; font-size: 1.8rem;  animation-delay: 2.8s; animation-duration: 7.6s; }
.bg-shape.s18 { top: 55%; left: 8%;  font-size: 2rem;    animation-delay: 1.1s; animation-duration: 6.2s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

.hero {
  text-align: center;
  padding: 30px 20px 14px;
}

.hero-emojis {
  font-size: 1.4rem;
  letter-spacing: 6px;
  margin-bottom: 4px;
}

.hero h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--primary-dark);
  text-shadow: 2px 2px 0 rgba(255,255,255,0.6);
}

.subtitle {
  font-size: 1rem;
  margin-top: 6px;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
  gap: 16px;
  max-width: 820px;
  margin: 16px auto 50px;
  padding: 0 20px;
  justify-content: center;
}

.game-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px 12px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 5px 0 rgba(0,0,0,0.08), 0 6px 14px rgba(0,0,0,0.12);
  border: 3px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  box-shadow: 0 7px 0 rgba(0,0,0,0.08), 0 10px 20px rgba(0,0,0,0.16);
}

.game-card:active {
  transform: translateY(-1px);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin: 0 auto 10px;
}

.game-card h2 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--primary-dark);
}

.game-card p {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.3;
  min-height: 2.4em;
}

.badge {
  display: inline-block;
  font-weight: bold;
  font-size: 0.68rem;
  padding: 5px 12px;
  border-radius: 999px;
}

.badge-play {
  background: var(--primary);
  color: white;
}

.badge-soon {
  background: #f1f1f1;
  color: #888;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.modal-icon {
  font-size: 2.6rem;
  margin-bottom: 6px;
}

.modal-actions {
  margin-top: 20px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
}
