:root {
  --bg-sky: #f0f9ff;
  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-soft: #475569;
  --mint: #10b981;
  --mint-dark: #059669;
  --mint-soft: #d1fae5;
  --coral: #f43f5e;
  --coral-soft: #ffe4e6;
  --sun: #fbbf24;
  --sun-dark: #d97706;
  --sun-soft: #fef3c7;
  --sky: #38bdf8;
  --sky-dark: #0284c7;
  --border: #cbd5e1;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  background: var(--bg-sky);
  color: var(--text-dark);
  line-height: 1.5;
}

h1, h2, h3, .brand-title {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
}

.container {
  width: min(1120px, 100% - 1.5rem);
  margin-inline: auto;
}

button, input {
  font: inherit;
}

/* Header */
.kids-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid #e2e8f0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 70px;
}

.kids-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
}

.badge-kids {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--sun);
  color: #1e293b;
  font-size: 0.78rem;
  vertical-align: middle;
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--sun-soft);
  border: 2px solid var(--sun);
  font-weight: 800;
  color: #92400e;
}

/* Chunky 3D Buttons */
.btn-chunky {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border-radius: 14px;
  border: 2px solid transparent;
  border-bottom-width: 4px;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-chunky:active {
  transform: translateY(2px);
}

.btn-mint {
  background: var(--mint);
  border-color: var(--mint-dark);
  color: #fff;
}

.btn-sky {
  background: var(--sky);
  border-color: var(--sky-dark);
  color: #fff;
}

.btn-white {
  background: #fff;
  border-color: var(--border);
  color: var(--text-dark);
}

/* Hero */
.kids-hero {
  padding-block: 1.75rem 2rem;
  background: linear-gradient(135deg, #e0f2fe 0%, #fef9c3 55%, #dcfce7 100%);
  border-bottom: 3px solid #cbd5e1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.95fr;
  }
}

.hero-text {
  min-width: 0;
}

.level-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--mint);
  color: var(--mint-dark);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.kids-hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.7rem);
  line-height: 1.15;
}

.highlight {
  color: var(--mint-dark);
}

.kids-hero p {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-soft);
}

.kids-search-box {
  display: flex;
  gap: 0.5rem;
  background: #fff;
  padding: 0.45rem;
  border-radius: 18px;
  border: 3px solid #94a3b8;
  max-width: 560px;
}

.kids-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0.45rem 0.65rem;
  font-size: 1rem;
  font-weight: 700;
}

.kids-search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.tag-btn {
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.tag-btn:hover {
  border-color: var(--mint);
  background: var(--mint-soft);
}

/* Mini Quiz Card */
.quiz-card {
  min-width: 0;
  background: #fff;
  border: 3px solid #38bdf8;
  border-bottom-width: 6px;
  border-radius: 24px;
  padding: 1.15rem;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.12);
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.quiz-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--sky-dark);
  font-weight: 800;
  font-size: 0.82rem;
}

.quiz-score {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--sun-dark);
}

.quiz-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.quiz-hint {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  font-weight: 600;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.quiz-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.8rem 0.5rem;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  border-bottom-width: 4px;
  background: #f8fafc;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}

.quiz-opt-btn:hover {
  border-color: var(--sky);
  background: #f0f9ff;
}

.quiz-feedback {
  margin-top: 0.8rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
}

.quiz-feedback.win {
  background: var(--mint-soft);
  color: var(--mint-dark);
}

.quiz-feedback.try {
  background: var(--coral-soft);
  color: var(--coral);
}

/* Workspace & Categories */
.kids-workspace {
  padding-block: 1.5rem 3rem;
}

.kids-cats {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.kids-cat-btn {
  padding: 0.55rem 1rem;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  border-bottom-width: 4px;
  background: #fff;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.kids-cat-btn.active {
  background: var(--mint);
  border-color: var(--mint-dark);
  color: #fff;
}

/* Kids Product Grid */
.kids-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

.kid-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.1rem;
  background: #fff;
  border: 3px solid #e2e8f0;
  border-bottom-width: 6px;
  border-radius: 22px;
}

.kid-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-soft);
}

.kid-swap-box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.kid-side {
  padding: 0.7rem 0.5rem;
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.kid-side.leave {
  background: var(--coral-soft);
  border: 2px solid #fda4af;
}

.kid-side.pick {
  background: var(--mint-soft);
  border: 2px solid #6ee7b7;
}

.kid-side .emoji {
  font-size: 1.8rem;
}

.kid-side .label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.kid-side strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.kid-arrow {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--mint-dark);
}

.kid-alts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kid-alt-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  border: 2px solid var(--mint);
  background: var(--mint-soft);
  color: var(--mint-dark);
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
}

.kid-alt-btn:hover {
  background: var(--mint);
  color: #fff;
}

.kids-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #fff;
  border-radius: 22px;
  border: 3px dashed #cbd5e1;
}

.kids-footer {
  text-align: center;
  padding: 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-soft);
  border-top: 2px solid #e2e8f0;
  background: #fff;
}

/* Dialog */
dialog.kids-dialog {
  width: min(520px, 100% - 1.5rem);
  max-height: 85dvh;
  padding: 0;
  border: 3px solid var(--sky);
  border-radius: 24px;
  background: #fff;
}

dialog.kids-dialog:modal {
  overscroll-behavior: contain;
}

dialog.kids-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 2px solid #e2e8f0;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.btn-close-kids {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  font-weight: 800;
  cursor: pointer;
}

.dialog-body {
  padding: 1.15rem;
}

.basket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.kids-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  z-index: 50;
}

@media (max-width: 560px) {
  .hide-sm {
    display: none;
  }
  .brand-sub {
    display: none;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .mascot-mini {
    width: 36px;
    height: 36px;
  }
  .header-right {
    gap: 0.35rem;
  }
  .star-pill,
  .btn-chunky {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}
