:root {
  --ink: #1a2b4a;
  --muted: #4d6280;
  --paper: #fffefb;
  --coral: #ff5a4e;
  --sun: #ffc43a;
  --mint: #1ec8b0;
  --sky: #3db8ff;
  --leaf: #2fbf71;
  --peach: #ff8f6b;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(26, 43, 74, 0.08);
  --shadow: 0 14px 36px rgba(26, 43, 74, 0.1);
  --radius: 22px;
  --font-display: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background-color: #ffe56a;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 111, 97, 0.55) 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(61, 184, 255, 0.5) 0%, transparent 40%),
    radial-gradient(circle at 78% 82%, rgba(30, 200, 176, 0.45) 0%, transparent 45%),
    radial-gradient(circle at 10% 88%, rgba(255, 90, 130, 0.35) 0%, transparent 40%),
    linear-gradient(160deg, #ffe56a 0%, #ffd4a8 25%, #b8f0ff 55%, #9ff5d8 80%, #ffc4b0 100%);
  background-attachment: scroll;
}

/* Soft playful dots + floating blobs on every page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 1.4px, transparent 1.5px);
  background-size: 28px 28px;
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  top: 18%;
  right: -60px;
  background: radial-gradient(circle, rgba(255, 143, 107, 0.35), transparent 70%);
  animation: floatBlob 12s ease-in-out infinite alternate;
  box-shadow:
    -40vw 55vh 0 -40px rgba(61, 184, 255, 0.22),
    -70vw 20vh 0 -70px rgba(255, 196, 58, 0.28),
    -15vw 75vh 0 -50px rgba(30, 200, 176, 0.25);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.container { width: min(1120px, 92vw); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 254, 251, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(26, 43, 74, 0.04);
  transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  transition: padding .25s ease;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: font-size .25s ease;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--coral), var(--sun));
  box-shadow: 0 8px 18px rgba(255, 90, 78, 0.28);
  font-size: 1.4rem;
  animation: bob 3s ease-in-out infinite;
  transition: width .25s ease, height .25s ease, border-radius .25s ease;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav-links a {
  position: relative;
  padding: 6px 10px;
  border-radius: 12px;
  transition: background .15s ease, color .15s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--sun));
  transition: left .2s ease, right .2s ease;
}
.nav-links a:hover {
  color: var(--coral);
  background: rgba(255, 90, 78, 0.08);
}
.nav-links a:hover::after {
  left: 10px;
  right: 10px;
}
.nav-links a[aria-current="page"] {
  color: var(--coral);
  background: rgba(255, 90, 78, 0.1);
}
.nav-links a[aria-current="page"]::after {
  left: 10px;
  right: 10px;
}
body.is-scrolled .site-header {
  background: rgba(255, 254, 251, 0.94);
  border-bottom-color: rgba(26, 43, 74, 0.09);
  box-shadow: 0 10px 30px rgba(26, 43, 74, 0.13);
}
body.is-scrolled .nav { padding: 6px 0; }
body.is-scrolled .brand { font-size: 1.15rem; }
body.is-scrolled .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
}
.scroll-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--mint), var(--sky));
  box-shadow: 0 1px 8px rgba(61, 184, 255, 0.4);
  pointer-events: none;
  will-change: transform;
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(26, 43, 74, 0.55) 0%, rgba(26, 43, 74, 0.18) 45%, rgba(255, 196, 58, 0.12) 100%),
    url("https://images.unsplash.com/photo-1503454537195-1dcabb73ffb9?auto=format&fit=crop&w=1800&q=80") center/cover no-repeat;
  transform: scale(1.03);
  animation: slowZoom 20s ease-in-out infinite alternate;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(to top, rgba(255, 248, 232, 0.95), transparent);
}
.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 680px;
  align-self: end;
  padding: 48px 0 72px;
  animation: riseIn 0.85s ease both;
}
.hero .brand-hero {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.98;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.28);
}
.hero .brand-hero span {
  display: inline;
  color: #ffe566;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.hero p {
  margin: 0 0 26px;
  font-size: 1.15rem;
  max-width: 480px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--peach));
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 90, 78, 0.32);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(26, 43, 74, 0.12);
}
.btn-soft {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border: 2px solid rgba(26, 43, 74, 0.08);
  backdrop-filter: blur(8px);
}

.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  margin: 0;
  letter-spacing: -0.02em;
}
.section-head p { margin: 6px 0 0; color: var(--muted); font-weight: 600; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: riseIn .7s ease both;
}
.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 40px rgba(26, 43, 74, 0.14);
}
.card .emoji {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin-bottom: 12px;
}
.card h3 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.card p { margin: 0; color: var(--muted); font-weight: 600; }
.tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 10px;
  background: rgba(30, 200, 176, 0.15);
  color: #0e8f7e;
  margin-bottom: 10px;
}

.band {
  border-radius: 28px;
  padding: 32px;
  background:
    linear-gradient(125deg, rgba(255, 90, 78, 0.95), rgba(255, 196, 58, 0.9) 48%, rgba(30, 200, 176, 0.92));
  color: #fff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.band::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  top: -50px;
  right: -30px;
}
.band h2, .band p, .band .btn { position: relative; z-index: 1; }
.band h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.band p { margin: 0 0 18px; color: rgba(255, 255, 255, 0.95); font-weight: 600; max-width: 48ch; }

.page {
  padding: 40px 0 70px;
}
.page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lead { color: var(--muted); font-size: 1.08rem; max-width: 68ch; font-weight: 600; }

.activity-shell { padding: 28px 0 60px; }
.activity-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(12px);
}
.activity-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.activity-title {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.7rem;
}
.activity-meta { color: var(--muted); font-weight: 700; }
.level-nav {
  margin-top: 16px;
  text-align: center;
}
.level-info {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}
.activity-hint {
  text-align: center;
  color: #5b6b88;
  font-weight: 700;
  margin: 0 0 10px;
}
.activity-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.activity-actions .btn {
  min-width: 140px;
}
.next-level-wrap {
  margin-top: 18px;
  text-align: center;
}
.next-level-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  font-size: 1.1rem;
  padding: 14px 28px;
}
.level-done, .level-locked {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.activity-area {
  min-height: 300px;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(232, 249, 255, 0.9), rgba(255, 248, 232, 0.95));
  border: 2px dashed rgba(61, 184, 255, 0.35);
  padding: 18px;
}
.feedback {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
}
.feedback.show { display: block; }
.feedback.ok { background: #e5f9ee; color: #157a42; }
.feedback.bad { background: #ffe6e2; color: #b42318; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
}
.item-btn, .drag-item, .drop-zone {
  min-height: 92px;
  border-radius: 18px;
  border: 2px solid rgba(26, 43, 74, 0.08);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  box-shadow: 0 4px 12px rgba(26, 43, 74, 0.05);
}
.item-btn:hover, .drag-item:hover { transform: scale(1.05); }
.item-btn.selected { border-color: var(--mint); background: #eafaf7; }
.item-btn.correct { border-color: var(--leaf); background: #e8f8ee; }
.item-btn.wrong { border-color: var(--coral); background: #ffe8e4; }
.drop-zone {
  font-size: 1rem;
  color: var(--muted);
  border-style: dashed;
  font-weight: 700;
}
.drop-zone.filled { border-style: solid; border-color: var(--mint); color: var(--ink); }

.photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.item-btn.has-photo,
.drag-item.has-photo,
.drop-zone.filled {
  padding: 8px;
  gap: 6px;
  font-size: 0.95rem;
}
.item-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  pointer-events: none;
  border: 1.5px solid rgba(26, 43, 74, 0.18);
  background: #fff;
  box-sizing: border-box;
}
.item-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.item-btn.face-down {
  background: linear-gradient(145deg, #3db8ff, #ff8f6b 55%, #ffc43a);
  border-color: #fff;
}
.card-back {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.count-photos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.count-photos .item-photo {
  width: 72px;
  height: 72px;
}
.spell-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.spell-photo-wrap .item-photo {
  width: min(220px, 70vw);
  height: min(220px, 70vw);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(26, 43, 74, 0.1);
}
.shadow-photo {
  filter: brightness(0) contrast(1.15);
  opacity: 0.85;
}
.card-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 10px;
  display: block;
  border: 1.5px solid rgba(26, 43, 74, 0.18);
  box-shadow: 0 6px 14px rgba(26, 43, 74, 0.1);
}
.card-photo {
  padding: 14px;
  overflow: hidden;
}
.card-cover-wrap {
  position: relative;
  width: 58%;
  aspect-ratio: 1 / 1;
  padding: 5px;
  margin: 0 auto 8px;
  box-sizing: border-box;
  flex: 0 0 auto;
  transform: scale(var(--scroll-scale, .42));
  transform-origin: center;
  will-change: transform;
}
.card-cover-wrap::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.72) 0 7%, transparent 8%),
    radial-gradient(circle at 76% 68%, rgba(255,255,255,.5) 0 10%, transparent 11%),
    var(--card-tint, #fff1c9);
  border: 2.5px solid rgba(26, 43, 74, 0.2);
  transform: rotate(-1.2deg) scale(1.015);
  box-shadow: 0 7px 15px rgba(26, 43, 74, 0.12);
}
.card-cover {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  margin-bottom: 0;
  display: block;
  border: 3px solid rgba(26, 43, 74, 0.28);
  background: #fff;
  box-shadow: 0 7px 16px rgba(26, 43, 74, 0.13);
  box-sizing: border-box;
}
.card-cover-fallback {
  background: linear-gradient(135deg, #ffc43a, #ff5a4e);
  aspect-ratio: 1 / 1;
  border: 1.5px solid rgba(26, 43, 74, 0.2);
  box-shadow: 0 6px 14px rgba(26, 43, 74, 0.08);
  border-radius: 50%;
}
.card-number {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  color: #1a2b4a;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(26, 43, 74, 0.18);
  box-shadow: 0 4px 10px rgba(26, 43, 74, 0.12);
  pointer-events: none;
}
.card-number-preview {
  font-size: 0.72rem;
  min-width: auto;
  padding: 0 10px;
  background: rgba(255, 243, 196, 0.96);
  color: #8a5a00;
}
.card-type {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1a2b4a;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(26, 43, 74, 0.14);
  box-shadow: 0 4px 10px rgba(26, 43, 74, 0.1);
  pointer-events: none;
}
.card.card-photo {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border: 1.5px solid rgba(26, 43, 74, 0.22);
  border-radius: 22px;
  background: linear-gradient(155deg, var(--card-tint, #fff8e8), #fff 72%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.75),
    0 10px 24px rgba(26, 43, 74, 0.12);
  backdrop-filter: none;
  content-visibility: auto;
  contain-intrinsic-size: 260px 260px;
}
.card.card-photo::before,
.card.card-photo::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.42;
}
.card.card-photo::before {
  width: 150px;
  height: 150px;
  right: -48px;
  bottom: -48px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.2) 0 22%, transparent 23%),
    repeating-radial-gradient(circle, rgba(61,184,255,.28) 0 5px, transparent 6px 13px);
}
.card.card-photo::after {
  width: 96px;
  height: 96px;
  left: -28px;
  bottom: 42px;
  background:
    repeating-linear-gradient(45deg, rgba(255,196,58,.28) 0 7px, transparent 7px 15px);
}
.card.card-photo > * {
  position: relative;
  z-index: 1;
}
.card.card-photo[data-category="Animals"]::before { filter: hue-rotate(8deg); }
.card.card-photo[data-category="Food"]::before { filter: hue-rotate(115deg); }
.card.card-photo[data-category="Numbers"]::before { filter: hue-rotate(195deg); }
.card.card-photo[data-category="Words"]::before { filter: hue-rotate(245deg); }
.card.card-photo[data-category="Nature"]::before { filter: hue-rotate(70deg); }
.card.card-photo[data-category="Shapes"]::before { filter: hue-rotate(285deg); }
.card.card-photo .tag,
.card.card-photo h3,
.card.card-photo p {
  position: relative;
  z-index: 2;
}
.card.card-photo h3 {
  font-size: 0.98rem;
  line-height: 1.2;
  margin: 0 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card.card-photo .tag {
  align-self: flex-start;
  margin-bottom: 5px;
  padding: 4px 9px;
  font-size: 0.7rem;
}
.card.card-photo p {
  font-size: 0.8rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
}
.filter-chip {
  border: 1.5px solid rgba(26, 43, 74, 0.14);
  background: rgba(255, 255, 255, 0.85);
  color: #1a2b4a;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.filter-chip:hover { transform: translateY(-2px); }
.filter-chip.active {
  background: #1a2b4a;
  color: #fff;
  border-color: #1a2b4a;
}
.activities-hero {
  border-radius: 28px;
  padding: 22px 22px 8px;
  margin-bottom: 8px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 159, 122, 0.45), transparent 42%),
    radial-gradient(circle at 90% 10%, rgba(90, 208, 255, 0.4), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(255, 248, 232, 0.9));
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}
.activities-hero h1 { margin-bottom: 6px; }
.home-featured-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(26, 43, 74, 0.18);
  box-shadow: 0 5px 14px rgba(26, 43, 74, 0.1);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.92rem;
}
body[data-page="home"] .section-head > .btn {
  border: 2px solid rgba(26, 43, 74, 0.2);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(26, 43, 74, 0.12);
}
body[data-page="home"] .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
body[data-page="activities-list"] .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
body[data-page="activities-list"] {
  background:
    radial-gradient(circle at 8% 12%, rgba(160, 196, 255, 0.35), transparent 36%),
    radial-gradient(circle at 92% 18%, rgba(255, 173, 173, 0.3), transparent 34%),
    linear-gradient(180deg, #f3fbff 0%, #fff8ef 48%, #f6fff8 100%);
  background-attachment: fixed;
}

/* Confetti / FX */
#fx-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
}
.candy {
  position: absolute;
  top: -40px;
  font-size: 1.6rem;
  animation: fall linear forwards;
  z-index: 10000;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .15; }
}
.paper-piece {
  position: absolute;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  z-index: 10001;
  animation: popOut ease-out forwards;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}
.paper-piece.sq { width: 12px; height: 12px; border-radius: 2px; }
.paper-piece.ribbon { width: 6px; height: 22px; border-radius: 3px; }
@keyframes popOut {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 180px)) rotate(var(--rot)); opacity: 0; }
}
.party-bang {
  position: fixed;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%) scale(.4);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 800;
  font-family: var(--font-display);
  color: #ff1f7a;
  text-shadow: 0 4px 0 #ffe066, 0 8px 20px rgba(0, 0, 0, .15);
  animation: bangIn .9s ease forwards;
  z-index: 10002;
}
@keyframes bangIn {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  35% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(1); opacity: 0; }
}
body.wrong-flash {
  animation: wrongFlash .35s ease;
}
@keyframes wrongFlash {
  0%, 100% { filter: none; }
  40% { filter: sepia(0.4) saturate(2) hue-rotate(-20deg); }
}

.spelling-input {
  width: min(340px, 100%);
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid rgba(61, 184, 255, 0.35);
  font-size: 1.1rem;
  font-weight: 700;
  background: #fff;
}
.counter-display {
  text-align: center;
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 10px 0;
}

.site-footer {
  margin-top: 20px;
  padding: 32px 0 44px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 18px;
}
.footer-brand {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.2rem;
}

.palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.swatch {
  height: 74px;
  border-radius: 16px;
  display: grid;
  place-items: end start;
  padding: 10px;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes slowZoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatBlob {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-24px, 30px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .card-cover-wrap {
    transform: scale(1) !important;
  }
}

/* —— Ads (AdSense-ready placeholders) —— */
body.has-ads { padding-bottom: 84px; }

.ad-slot {
  border: 2px dashed rgba(77, 98, 128, 0.45);
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72) 8px, rgba(232, 240, 250, 0.9) 8px, rgba(232, 240, 250, 0.9) 16px);
  border-radius: 16px;
  color: #4d6280;
  font-weight: 800;
  text-align: center;
  padding: 12px;
  margin: 12px 0;
  position: relative;
}
.ad-slot .ad-label {
  position: absolute;
  top: 6px;
  left: 8px;
  background: #35507d;
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
}
.ad-label-inline {
  position: static;
  display: inline-block;
  margin-bottom: 8px;
}
.ad-slot .ad-body {
  padding-top: 22px;
  font-size: 0.92rem;
  line-height: 1.35;
}
.ad-slot small { font-weight: 700; opacity: 0.85; }

.ad-top-banner {
  width: min(1120px, 92vw);
  margin: 10px auto;
  min-height: 90px;
}

.page-ad-layout,
.page-ad-main,
.ad-rail-left,
.ad-rail-right {
  display: none !important;
}

.ad-inline { min-height: 110px; grid-column: 1 / -1; }

.ad-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  margin: 0;
  border-radius: 0;
  min-height: 68px;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(26, 43, 74, 0.08);
}

.ad-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 24, 40, 0.55);
  display: none;
  place-items: center;
  padding: 18px;
}
.ad-modal.show { display: grid; }
.ad-modal-card {
  width: min(420px, 94vw);
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.ad-modal-card h3 {
  margin: 6px 0;
  font-family: var(--font-display);
  color: var(--coral);
}
.ad-modal-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}
.video-fake {
  height: 180px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a2b4a, #3db8ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  margin: 10px 0 14px;
}

@media (max-width: 1100px) {
  .page-ad-layout {
    grid-template-columns: 1fr;
    width: min(1120px, 92vw);
  }
  .ad-rail-left,
  .ad-rail-right { display: none; }
}

@media (max-width: 760px) {
  .footer-grid, .palette { grid-template-columns: 1fr 1fr; }
  .nav { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 78vh; }
  .hero-content { padding: 36px 0 56px; }
  .section { padding: 40px 0; }
  .ad-top-banner { width: 92vw; min-height: 72px; }
}
