/* Zentra Kids — bright, kid-friendly, mobile-first */
:root {
  --sky: #7dd3fc;
  --sky-deep: #38bdf8;
  --sun: #fbbf24;
  --sun-deep: #f59e0b;
  --coral: #fb7185;
  --coral-deep: #f43f5e;
  --grape: #a78bfa;
  --grape-deep: #8b5cf6;
  --leaf: #4ade80;
  --leaf-deep: #22c55e;
  --ink: #1e293b;
  --ink-soft: #475569;
  --paper: #fffbeb;
  --white: #ffffff;
  --radius: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #bae6fd 0%, #fef9c3 55%, #fffbeb 100%);
  color: var(--ink);
  min-height: 100vh;
}
a { color: #0369a1; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.topbar {
  background: linear-gradient(90deg, #fde047, #fbbf24);
  border-bottom: 4px solid #f59e0b;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 52px; height: 52px; border-radius: 50%; background: #0f2a5c; padding: 3px; }
.brand-name { font-size: 30px; font-weight: 900; line-height: 1; display: block; }
.brand-kids { color: #dc2626; }
.brand-sub { font-size: 12px; color: var(--ink-soft); display: block; margin-top: 2px; }
.topnav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.nav-pill {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px;
  background: var(--white); border: 2px solid #e2e8f0; border-radius: 999px;
  padding: 8px 14px; min-height: 44px; display: inline-flex; align-items: center;
}
.nav-pill:hover { border-color: var(--sun-deep); }

/* ---------- Hero ---------- */
.hero {
  max-width: 1080px; margin: 20px auto; padding: 24px;
  background: linear-gradient(135deg, #fda4af, #fbbf24 60%, #fde68a);
  border-radius: var(--radius); border: 3px solid #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.hero-text { flex: 1 1 320px; }
.hero-badge {
  background: #dc2626; color: #fff; font-weight: 800; font-size: 13px;
  padding: 5px 12px; border-radius: 999px; display: inline-block;
}
.hero h1 { font-size: 44px; margin: 10px 0 8px; line-height: 1.05; }
.hero p { font-size: 18px; margin: 0 0 14px; color: #334155; }
.hero-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.grade-chip {
  background: #fff; border-radius: 999px; padding: 5px 12px;
  font-weight: 800; font-size: 14px; border: 2px solid #f59e0b;
}
.hero-cat { font-weight: 700; }
.hero-art { flex: 0 0 180px; text-align: center; margin: 0 auto; }
.hero-ball { font-size: 110px; line-height: 1; animation: bounce 1.6s ease-in-out infinite; }
.hero-symbols { font-size: 26px; font-weight: 900; color: #92400e; letter-spacing: 6px; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 999px; font-weight: 800; font-size: 17px;
  padding: 13px 26px; min-height: 48px; color: #fff;
  background: var(--leaf-deep); box-shadow: 0 4px 0 rgba(0,0,0,.18);
  transition: transform .08s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn-play { background: var(--leaf-deep); }
.btn-big { font-size: 20px; padding: 15px 34px; }
.btn-back { background: #64748b; font-size: 15px; padding: 10px 18px; min-height: 44px; }
.btn-secondary { background: #0ea5e9; }
.btn-warn { background: var(--coral-deep); }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Filters ---------- */
.filters { max-width: 1080px; margin: 8px auto 0; padding: 0 16px; text-align: center; }
.filters h2 { font-size: 24px; margin: 10px 0; }
.filter-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.filter-btn {
  border: 3px solid #38bdf8; background: #fff; color: var(--ink);
  border-radius: 999px; padding: 10px 20px; font-size: 16px; font-weight: 800; min-height: 48px;
}
.filter-btn.active { background: var(--sky-deep); color: #fff; border-color: #0284c7; }
.filter-note { color: var(--ink-soft); font-size: 15px; }

/* ---------- Categories & cards ---------- */
.category { max-width: 1080px; margin: 0 auto; padding: 8px 16px 4px; }
.cat-title { font-size: 28px; margin: 14px 0 2px; }
.cat-math { color: #ea580c; }
.cat-words { color: #7c3aed; }
.cat-puzzles { color: #15803d; }
.cat-sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; }
.game-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.game-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 3px solid #e2e8f0; box-shadow: 0 4px 14px rgba(0,0,0,.08);
  display: flex; flex-direction: column;
}
.game-card:hover { border-color: var(--sun-deep); }
.game-thumb {
  height: 150px; display: flex; align-items: center; justify-content: center;
  font-size: 84px; position: relative;
}
.thumb-math { background: linear-gradient(135deg, #fed7aa, #f97316); }
.thumb-words { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); }
.thumb-puzzles { background: linear-gradient(135deg, #bbf7d0, #22c55e); }
.thumb-badge {
  position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.95);
  border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; color: var(--ink);
}
.game-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-body h3 { margin: 0; font-size: 21px; }
.game-desc { margin: 0; color: var(--ink-soft); font-size: 15px; flex: 1; }
.game-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-grade { font-size: 13px; font-weight: 800; background: #fef3c7; border-radius: 999px; padding: 4px 10px; }

/* ---------- Why section ---------- */
.why { max-width: 1080px; margin: 10px auto 30px; padding: 0 16px; }
.why h2 { text-align: center; font-size: 26px; }
.why-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.why-card { background: #fff; border-radius: var(--radius); border: 3px solid #e2e8f0; padding: 16px; text-align: center; }
.why-emoji { font-size: 40px; }
.why-card h3 { margin: 8px 0 4px; font-size: 18px; }
.why-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- Game player ---------- */
.game-topbar {
  max-width: 720px; margin: 16px auto 0; padding: 0 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.game-topbar h2 { margin: 0; font-size: 26px; flex: 1; }
.game-area {
  max-width: 720px; margin: 12px auto 30px; padding: 20px 16px;
  background: #fff; border-radius: var(--radius); border: 3px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(0,0,0,.10); min-height: 420px; text-align: center;
}
.game-area h3 { font-size: 24px; margin: 6px 0 10px; }
.game-area p { font-size: 17px; color: var(--ink-soft); }
.instructions { background: #fef9c3; border: 2px dashed #f59e0b; border-radius: 14px; padding: 12px 16px; text-align: left; margin: 12px auto; max-width: 560px; }
.instructions li { margin: 4px 0; font-size: 16px; }
.scorebar {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0;
}
.score-pill {
  background: #e0f2fe; border: 2px solid #38bdf8; border-radius: 999px;
  padding: 8px 16px; font-weight: 800; font-size: 16px;
}
.score-pill.good { background: #dcfce7; border-color: #22c55e; }
.score-pill.bad { background: #ffe4e6; border-color: #f43f5e; }
.big-question { font-size: 44px; font-weight: 900; margin: 16px 0; }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 420px; margin: 0 auto; }
.answer-btn {
  font-size: 26px; font-weight: 900; min-height: 64px; border-radius: 16px;
  border: 3px solid #38bdf8; background: #f0f9ff; color: var(--ink);
}
.answer-btn:hover { background: #e0f2fe; }
.answer-btn.correct { background: #dcfce7; border-color: #22c55e; }
.answer-btn.wrong { background: #ffe4e6; border-color: #f43f5e; }
.feedback { font-size: 22px; font-weight: 900; min-height: 34px; margin: 10px 0; }
.feedback.good { color: #16a34a; }
.feedback.bad { color: #dc2626; }

/* Baseball diamond */
.diamond { position: relative; width: 180px; height: 180px; margin: 8px auto; }
.diamond .field {
  position: absolute; inset: 20px; background: #86efac; border: 3px solid #16a34a;
  transform: rotate(45deg); border-radius: 12px;
}
.base {
  position: absolute; width: 26px; height: 26px; background: #fff; border: 3px solid #92400e;
  border-radius: 6px; transform: rotate(45deg); z-index: 2;
}
.base.on { background: #fbbf24; }
.base-1 { right: 6px; top: 50%; margin-top: -13px; }
.base-2 { left: 50%; top: -6px; margin-left: -13px; }
.base-3 { left: 6px; top: 50%; margin-top: -13px; }
.base-h { left: 50%; bottom: -6px; margin-left: -13px; background: #fca5a5; }
.diamond .pitcher { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 34px; z-index: 2; }

/* Letter buttons (word scramble) */
.scramble-letters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.letter-btn {
  width: 52px; height: 52px; font-size: 26px; font-weight: 900; border-radius: 14px;
  border: 3px solid #8b5cf6; background: #ede9fe; color: var(--ink);
}
.letter-btn:disabled { opacity: .35; }
.answer-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 56px; margin: 10px 0; }
.answer-slot {
  width: 52px; height: 52px; font-size: 26px; font-weight: 900; border-radius: 14px;
  border: 3px dashed #a78bfa; background: #faf5ff; display: flex; align-items: center; justify-content: center;
}
.answer-slot.filled { border-style: solid; background: #ede9fe; }

/* Memory cards */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 440px; margin: 12px auto; }
.memory-card {
  aspect-ratio: 1; font-size: 38px; border-radius: 14px; border: 3px solid #38bdf8;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8); color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.memory-card.flipped { background: #fff; }
.memory-card.matched { background: #dcfce7; border-color: #22c55e; }
.memory-card:disabled { cursor: default; }

/* Number guessing */
.guess-display { font-size: 40px; font-weight: 900; min-height: 56px; margin: 8px 0; letter-spacing: 4px; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 10px auto; }
.num-btn {
  font-size: 26px; font-weight: 900; min-height: 60px; border-radius: 14px;
  border: 3px solid #f59e0b; background: #fffbeb; color: var(--ink);
}
.num-btn.wide { grid-column: span 1; }

/* Tic tac toe */
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: 14px auto; }
.ttt-cell {
  aspect-ratio: 1; font-size: 56px; font-weight: 900; border-radius: 16px;
  border: 3px solid #22c55e; background: #f0fdf4; color: var(--ink);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.ttt-cell.x { color: #dc2626; }
.ttt-cell.o { color: #2563eb; }
.ttt-cell:disabled { cursor: default; }

/* Snakes & ladders */
.snakes-board {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px;
  max-width: 480px; margin: 12px auto; background: #e2e8f0; padding: 4px; border-radius: 12px;
}
.snakes-cell {
  aspect-ratio: 1; font-size: 11px; font-weight: 700; border-radius: 5px;
  background: #fff; display: flex; align-items: center; justify-content: center; position: relative;
}
.snakes-cell:nth-child(odd) { background: #fef9c3; }
.snakes-cell.snake { background: #fecdd3; }
.snakes-cell.ladder { background: #bbf7d0; }
.snakes-cell .token { position: absolute; font-size: 20px; line-height: 1; }
.token-you { top: 0; left: 1px; }
.token-cpu { bottom: 0; right: 1px; }
.dice { font-size: 64px; line-height: 1; margin: 6px 0; }
.snakes-legend { font-size: 15px; color: var(--ink-soft); }
.turn-banner { font-size: 19px; font-weight: 800; margin: 8px 0; }

/* Footer */
.footer { background: #0f2a5c; color: #e2e8f0; margin-top: 10px; }
.footer-in { max-width: 1080px; margin: 0 auto; padding: 26px 16px; text-align: center; }
.footer-logo { width: 56px; height: 56px; border-radius: 50%; background: #fff; padding: 3px; }
.footer a { color: #fbbf24; }
.footer p { margin: 6px 0; font-size: 15px; }

/* ---------- Phone tweaks ---------- */
@media (max-width: 640px) {
  .hero { margin: 12px; padding: 18px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-art { display: none; }
  .brand-name { font-size: 24px; }
  .big-question { font-size: 36px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .game-thumb { height: 110px; font-size: 60px; }
  .memory-card { font-size: 28px; }
  .ttt-cell { font-size: 44px; }
  .snakes-cell { font-size: 9px; }
  .snakes-cell .token { font-size: 15px; }
}
