/* ===== Giggle Zone — shared base styles ===== */
:root {
  --font-fun: "Trebuchet MS", "Comic Sans MS", "Segoe UI", Verdana, sans-serif;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  /* Layered "soft-UI" shadow: a tight contact shadow + a broad ambient one reads
     more modern than a single hard drop-shadow. */
  --shadow-soft: 0 2px 4px rgba(58, 46, 92, 0.06), 0 12px 28px rgba(58, 46, 92, 0.10);
  --shadow-hover: 0 6px 10px rgba(58, 46, 92, 0.08), 0 20px 36px rgba(58, 46, 92, 0.16);
  --shadow-pop: 0 6px 0 rgba(0, 0, 0, 0.15);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ink: #3a2e5c;
  --paper: #ffffff;
  --paper-glass: rgba(255, 255, 255, 0.72);
  --yellow: #ffd93d;
  --orange: #ff9f43;
  --pink: #ff6fa5;
  --purple: #a06cd5;
  --blue: #4dc3ff;
  --green: #6fd08c;
  --red: #ff6b6b;
  --ad-bg: #f4f2fa;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-fun);
  color: var(--ink);
  background: linear-gradient(160deg, #fff6e0 0%, #ffe1ec 45%, #e0f3ff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Soft floating color blobs for a bit of modern depth behind the content —
   purely decorative, fixed so they don't affect page layout or scrolling. */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}
body::before {
  top: -10%; left: -8%;
  width: 42vmin; height: 42vmin;
  background: radial-gradient(circle, var(--yellow), transparent 70%);
  animation: blob-float 16s ease-in-out infinite;
}
body::after {
  bottom: -12%; right: -10%;
  width: 50vmin; height: 50vmin;
  background: radial-gradient(circle, var(--blue), transparent 70%);
  animation: blob-float 20s ease-in-out infinite reverse;
}
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vmin, 3vmin) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

img, svg { max-width: 100%; }

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar (site header) ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper-glass);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(58, 46, 92, 0.06);
}

button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
}

.brand .brand-emoji { font-size: 1.8rem; }

.header-actions { display: flex; gap: 10px; }

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s ease;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.06); box-shadow: var(--shadow-hover); }
.icon-btn:active { transform: scale(0.88); }

.lang-switcher select {
  height: 48px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  font-size: 1rem;
  font-weight: 700;
  padding: 0 14px;
  color: var(--ink);
  font-family: inherit;
}

/* ---------- Main content wrapper ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px 30px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 20px 10px 10px;
  position: relative;
  animation: fade-in-up 0.6s var(--ease-bounce) both;
}

.hero h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  margin: 10px 0 6px;
  line-height: 1.15;
}

.hero p.tagline {
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: #6b5f8f;
  margin: 0 0 20px;
}

.wave-emojis {
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  display: inline-block;
  animation: wiggle 1.8s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.cta-button {
  display: inline-block;
  margin-top: 8px;
  padding: 16px 36px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-radius: 999px;
  box-shadow: 0 8px 0 #c94f8a, var(--shadow-soft);
  transition: transform 0.16s var(--ease-bounce), box-shadow 0.16s ease;
}
.cta-button:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 0 #c94f8a, var(--shadow-hover); }
.cta-button:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #c94f8a, var(--shadow-soft);
}

/* ---------- Confetti (falling emoji) ---------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}
.confetti-piece {
  position: absolute;
  top: -10%;
  font-size: 1.8rem;
  will-change: transform, opacity;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(115vh) rotate(360deg); opacity: 0.9; }
}

/* ---------- Game grid / categories ---------- */
.section-title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin: 34px 0 16px;
  text-align: center;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 18px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  border: 3px solid transparent;
  animation: fade-in-up 0.5s var(--ease-bounce) both;
  animation-delay: calc(var(--card-i, 0) * 60ms);
}
.game-card:hover, .game-card:focus-visible {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-hover);
  border-color: var(--card-color, var(--pink));
}
.game-card:active { transform: translateY(2px) scale(0.99); }

.game-card .card-emoji {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.12));
  transition: transform 0.3s var(--ease-bounce);
}
.game-card:hover .card-emoji { transform: scale(1.15) rotate(-4deg); }

.game-card h3 { margin: 4px 0 2px; font-size: 1.2rem; }
.game-card p { margin: 0; font-size: 0.92rem; color: #6b5f8f; }

.card-stars {
  margin-top: 6px;
  font-size: 1rem;
  letter-spacing: 2px;
}

.badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: var(--yellow);
  color: #6b4b00;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ---------- Game of the hour ---------- */
.featured-game {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #fff2cc, #ffe4f2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 22px;
  margin: 26px auto 0;
  max-width: 640px;
  text-decoration: none;
  color: var(--ink);
  border: 3px solid var(--yellow);
}
.featured-game .featured-emoji {
  font-size: 3rem;
  flex-shrink: 0;
}
.featured-game .featured-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a3720a;
  background: var(--yellow);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.featured-game h3 { margin: 0 0 2px; font-size: 1.25rem; }
.featured-game p { margin: 0; font-size: 0.9rem; color: #6b5f8f; }

/* ---------- Star tally on home ---------- */
.star-tally {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  padding: 10px 22px;
  margin: 18px auto 0;
  width: fit-content;
  font-weight: 800;
  font-size: 1.1rem;
}

/* ---------- Footer / About ---------- */
.about-blurb {
  max-width: 640px;
  margin: 40px auto 0;
  text-align: center;
  color: #6b5f8f;
  font-size: 0.95rem;
  line-height: 1.5;
}

footer.site-footer {
  text-align: center;
  padding: 26px 16px 20px;
  font-size: 0.82rem;
  color: #8a7fae;
  max-width: 900px;
  margin: 0 auto;
}

footer.site-footer .footer-tagline {
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer-network {
  margin: 6px 0 16px;
  padding: 14px;
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.footer-network .network-title {
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-network a {
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
}
.footer-network a:hover { text-decoration: underline; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 12px;
}
.footer-links a {
  color: #6b5f8f;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-links a:hover { color: var(--purple); }

.footer-copyright { font-size: 0.75rem; color: #a89dc9; }

/* ---------- Legal page ---------- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 30px 26px 40px;
}
.legal-page h1 { margin-top: 0; }
.legal-page h2 {
  margin-top: 34px;
  padding-top: 10px;
  border-top: 2px dashed #eee5ff;
  scroll-margin-top: 16px;
}
.legal-page p, .legal-page li { line-height: 1.65; color: #4a3f6b; }
.legal-page a { color: var(--purple); }
.legal-updated { color: #8a7fae; font-size: 0.85rem; margin-top: -8px; }

/* ---------- Ad slot (non-intrusive, bottom of page) ---------- */
.ad-slot {
  margin: 30px auto 0;
  max-width: 728px;
  width: 100%;
  min-height: 90px;
  background: var(--ad-bg);
  border: 1px dashed #cfc7e8;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9891b8;
  font-size: 0.78rem;
  padding: 10px;
  text-align: center;
}
.ad-slot .ad-label {
  position: relative;
  width: 100%;
}
.ad-slot .ad-label::before {
  content: "Advertisement";
  display: block;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #b3abd1;
}

@media (max-width: 480px) {
  .ad-slot { min-height: 70px; }
}
