:root {
  --tt-primary-yellow: #ffd93d;
  --tt-primary-blue: #6bcf7f;
  --tt-primary-pink: #ff6b9d;
  --tt-primary-purple: #9d6cff;
  --tt-primary-orange: #ff9b50;
  --tt-bg-cream: #fff9e6;
  --tt-bg-light-blue: #e8f5ff;
  --tt-text-dark: #2d3142;

  --pt-primary-teal: #2d9596;
  --pt-primary-coral: #ff8a8a;
  --pt-primary-sage: #a1c398;
  --pt-secondary-navy: #1a365d;
  --pt-accent-gold: #f4b860;
  --pt-bg-white: #faf9f6;
  --pt-bg-light-gray: #f5f5f5;
  --pt-text-primary: #2d3142;
  --pt-text-secondary: #595959;
  --pt-border-light: #e8e8e8;

  --tt-font-display: "Fredoka", sans-serif;
  --tt-font-ui: "Baloo 2", cursive;
  --pt-font-heading: "Outfit", sans-serif;
  --pt-font-body: "Open Sans", sans-serif;

  --container: 1200px;
  --container-wide: 1280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--pt-font-body);
  color: var(--pt-text-primary);
  background: linear-gradient(180deg, #fdfcf8 0%, #f9fbff 50%, #fef9f4 100%);
}

a { color: var(--pt-primary-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--pt-font-heading); margin-top: 0; color: var(--pt-text-primary); }
h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

.container,
.container-wide {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}
.container-wide { width: min(100% - 2rem, var(--container-wide)); }

.main-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--pt-border-light);
}

.main-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--tt-font-display);
  font-weight: 700;
  color: var(--pt-secondary-navy);
}
.brand-mark { font-size: 1.7rem; }
.brand-text { font-size: 1.4rem; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.2rem;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .2rem;
  color: var(--pt-text-primary);
  font-weight: 600;
}

.nav-list a.active { color: var(--pt-primary-teal); }
.mobile-toggle { display: none; }

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0;
  position: relative;
  overflow: clip;
}
.hero-home {
  background: radial-gradient(circle at 20% 20%, #fff6cc 0, transparent 45%),
              radial-gradient(circle at 80% 70%, #e8f5ff 0, transparent 45%),
              #fff;
}
.hero-games,
.hero-category {
  background: linear-gradient(135deg, var(--tt-bg-cream), var(--tt-bg-light-blue));
}
.hero-blog { background: linear-gradient(135deg, #f0fffa, #fff4e8); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
}
.hero .lead { font-size: clamp(1rem, 2vw, 1.4rem); color: var(--pt-text-secondary); max-width: 60ch; }
.kicker {
  display: inline-block;
  font-family: var(--tt-font-ui);
  background: var(--tt-primary-yellow);
  color: #4a3f1a;
  border-radius: 999px;
  padding: .4rem .85rem;
  margin: 0 0 .8rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.2rem; }

.hero-art { min-height: 320px; position: relative; }
.orb {
  position: absolute;
  border-radius: 50%;
  animation: float 7s ease-in-out infinite;
}
.orb-a { width: 220px; height: 220px; background: #ffd93d; top: 20px; left: 20px; }
.orb-b { width: 180px; height: 180px; background: #6bcf7f; right: 30px; top: 110px; animation-delay: .8s; }
.orb-c { width: 140px; height: 140px; background: #ff6b9d; left: 110px; bottom: 10px; animation-delay: 1.4s; }

.section { padding: clamp(2rem, 5vw, 4rem) 0; }
.section-soft { background: var(--pt-bg-light-gray); }

.card {
  background: #fff;
  border: 1px solid var(--pt-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); transition: .25s ease; }

.feature-grid,
.game-grid,
.product-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature { text-align: left; }
.feature a { font-weight: 700; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.category-card {
  text-align: center;
  border-radius: 24px;
  border: 2px solid color-mix(in srgb, var(--category-color) 60%, white);
  background: linear-gradient(160deg, color-mix(in srgb, var(--category-color) 18%, white), #fff);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.big-icon { font-size: 5.8rem; line-height: 1; }

.thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff2bd, #ffd4e4);
  font-size: 4rem;
  margin-bottom: .8rem;
}

.pill {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: .15rem .5rem;
  margin-bottom: .5rem;
}

.forum-row,
.forum-post,
.blog-row { display: grid; gap: .4rem; }
.stack { display: grid; gap: 1rem; }
.meta { color: var(--pt-text-secondary); font-size: .92rem; }
.stats { font-weight: 600; color: #444; }
.game-empty {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.15rem;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.btn.toddler {
  font-family: var(--tt-font-ui);
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--tt-primary-yellow), var(--tt-primary-orange));
  color: #2d3142;
  box-shadow: 0 8px 24px rgba(255, 155, 80, .4);
}
.btn.parent {
  background: var(--pt-primary-teal);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--pt-border-light);
  color: var(--pt-text-primary);
}
.btn.small { min-height: 40px; padding: .5rem .85rem; border-radius: 10px; background: var(--tt-primary-blue); color: #0f2d18; }

.game-player-page .game-canvas {
  text-align: center;
  padding: 2rem 1.2rem;
  min-height: 420px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .65rem;
}
.game-emoji { font-size: 6.4rem; }
.toggle-btn { min-height: 44px; padding: .5rem .8rem; }
.game-app { width: min(100%, 780px); margin: .6rem auto; }
.game-status {
  font-weight: 700;
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  color: #27434a;
  background: #eaf7ff;
  border: 1px solid #cbe7fa;
  border-radius: 12px;
  padding: .6rem .8rem;
  width: min(100%, 640px);
  margin: 0 auto;
}
.game-hint {
  margin: 0;
  color: #54606b;
  font-size: .95rem;
}
.game-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  color: #254f53;
  margin: .5rem 0;
}
.game-options { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: .8rem; }
.game-options .btn {
  min-height: 86px;
  min-width: 110px;
  font-size: 1.8rem;
  border-radius: 16px;
}
.ducks-wrap {
  min-height: 86px;
  font-size: clamp(3rem, 9vw, 5.2rem);
  line-height: 1.2;
  background: #fff6d9;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: .5rem auto;
}
.animal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  width: min(520px, 100%);
  margin-inline: auto;
}
.animal-btn {
  min-height: 96px;
  border: 1px solid var(--pt-border-light);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: .25rem;
  font-weight: 700;
}
.animal-btn span { font-size: 2rem; }
.sound-text { color: #5a5f71; margin-top: .5rem; }
.choice-card {
  min-width: 140px;
  min-height: 96px;
  border: 1px solid var(--pt-border-light);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: .2rem;
  font-weight: 700;
}
.choice-big { font-size: 1.8rem; }
.rainbow-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
  width: min(100%, 650px);
  margin: .5rem auto;
}
.rainbow-stripe {
  min-height: 72px;
  border: 1px solid var(--pt-border-light);
  border-radius: 10px;
  background: #fff;
  font-size: 1.7rem;
  cursor: pointer;
}
.rainbow-stripe.done {
  background: #e4fbe9;
  border-color: #87d8a0;
}
.stars-play {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  width: min(520px, 100%);
}
.star-btn {
  min-height: 74px;
  border: 1px solid #f1d486;
  border-radius: 10px;
  background: #fff7d6;
  font-size: 1.8rem;
  cursor: pointer;
}
.music-pads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  width: min(560px, 100%);
  margin: .4rem auto;
}
.pad-btn {
  min-height: 108px;
  border: 1px solid #d6dbe7;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: .25rem;
}
.pad-btn span { font-size: 2rem; }
.pad-btn.active {
  transform: scale(0.98);
  background: #fff3c3;
  border-color: #f3cf6f;
}
.star-btn.done {
  opacity: .4;
  filter: grayscale(100%);
}
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
}
.toggles { display: flex; gap: .5rem; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: grid;
  place-items: center;
  z-index: 40;
}
.modal {
  width: min(90vw, 580px);
  background: #fff;
  border-radius: 16px;
  padding: 1.6rem;
  text-align: center;
  position: relative;
}
.modal-close-btn {
  position: absolute;
  right: .7rem;
  top: .5rem;
  border: 0;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #5c6279;
}
.modal-overlay[hidden] { display: none !important; }
.stars { font-size: 2rem; }

.community-layout,
.shop-layout,
.blog-layout,
.profile-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  gap: 1rem;
}
.admin-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.admin-item {
  display: grid;
  gap: .6rem;
}
.admin-table-wrap {
  overflow: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.admin-table th,
.admin-table td {
  border: 1px solid var(--pt-border-light);
  padding: .45rem .5rem;
  white-space: nowrap;
}
.admin-table th {
  background: #f6f8fc;
  font-weight: 700;
}
.shop-layout { grid-template-columns: 260px minmax(0, 1fr); }
.blog-layout { grid-template-columns: 260px minmax(0, 1fr); }
.profile-layout { grid-template-columns: 260px minmax(0, 1fr); margin-top: 1rem; }
.sidebar { align-self: start; position: sticky; top: 90px; }
.sidebar a, .sidebar p, .sidebar label { display: block; margin: .55rem 0; }

.promo {
  font-weight: 700;
  text-align: center;
  padding: .8rem;
  background: #ffeab9;
  border-radius: var(--radius-sm);
}

.product-card .product-image,
.product-gallery .gallery-main {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, #fff3cb, #e6f7ff);
  font-size: 3rem;
  margin-bottom: .8rem;
}
.price { font-size: 1.3rem; font-weight: 700; color: #1e3a8a; }
.old-price { font-size: .95rem; text-decoration: line-through; color: #666; margin-left: .45rem; }
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.gallery-thumbs { display: flex; gap: .45rem; }
.gallery-thumbs span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--pt-border-light); border-radius: 10px; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ececec;
  font-size: 2rem;
}
.progress-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: .6rem; align-items: center; margin: .6rem 0; }
.progress { height: 12px; border-radius: 999px; background: #ececec; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #2d9596, #8adcb7); }

.article-page { max-width: 760px; }
.article-content p,
.article-content li { font-size: 1.1rem; line-height: 1.7; color: var(--pt-text-secondary); }
.article-content blockquote {
  border-left: 4px solid var(--pt-accent-gold);
  margin: 1.5rem 0;
  padding: .5rem 1rem;
  font-style: italic;
  background: #fff8e7;
}

.site-footer {
  margin-top: 3rem;
  background: #2d3142;
  color: #fff;
  padding: 2.5rem 0 1.2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 1rem;
}
.site-footer h4 { color: #fff; margin-bottom: .6rem; }
.site-footer a { display: block; color: #bfc5db; margin: .3rem 0; }
.site-footer p { color: #d0d5e6; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  margin-top: 1.2rem;
  padding-top: 1rem;
  color: #bfc5db;
}
.newsletter-form { display: grid; gap: .5rem; }
.newsletter-form input {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #b7bfd9;
  padding: .5rem .7rem;
}
.newsletter-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  background: #ffd93d;
  color: #282d3f;
  cursor: pointer;
}

.center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .45s ease, transform .45s ease;
}
.reveal-on-scroll.visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 1023px) {
  .hero-grid,
  .community-layout,
  .shop-layout,
  .blog-layout,
  .profile-layout,
  .product-detail {
    grid-template-columns: 1fr;
  }
  .feature-grid,
  .game-grid,
  .category-grid,
  .product-grid,
  .blog-grid,
  .footer-grid,
  .admin-links,
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar { position: static; }
}

@media (max-width: 767px) {
  .mobile-toggle {
    display: inline-flex;
    min-height: 44px;
    border: 1px solid var(--pt-border-light);
    border-radius: 999px;
    background: #fff;
    padding: .4rem .9rem;
  }
  .nav-list {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--pt-border-light);
    padding: .8rem 1rem;
    display: none;
    flex-direction: column;
    gap: .2rem;
  }
  .nav-list.open { display: flex; }
  .feature-grid,
  .game-grid,
  .category-grid,
  .product-grid,
  .blog-grid,
  .footer-grid,
  .admin-links,
  .admin-stats {
    grid-template-columns: 1fr;
  }
  .hero-actions .btn { width: 100%; }
  .animal-grid { grid-template-columns: 1fr; }
  .stars-play { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rainbow-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .music-pads { grid-template-columns: 1fr; }
  .toggle-btn { width: 100%; }
  .toggles { width: 100%; }
  .game-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }
}

.flash-wrap { padding-top: .8rem; }
.flash {
  border-radius: 10px;
  padding: .75rem .9rem;
  font-weight: 600;
}
.flash-success { background: #e8fbef; color: #166534; border: 1px solid #8bdfad; }
.flash-error { background: #fff1f2; color: #9f1239; border: 1px solid #f9a8b8; }

.nav-form-item form { margin: 0; }
.nav-logout {
  min-height: 44px;
  border: 1px solid var(--pt-border-light);
  border-radius: 999px;
  padding: .35rem .8rem;
  background: #fff;
  color: var(--pt-text-primary);
  font-weight: 600;
  cursor: pointer;
}

.auth-shell { max-width: 720px; }
.auth-card { padding: 1.4rem; }
.form-stack { display: grid; gap: .8rem; }
.form-stack label {
  display: grid;
  gap: .35rem;
  font-weight: 600;
  color: var(--pt-text-primary);
}
.form-stack input,
.form-stack textarea {
  min-height: 46px;
  border: 1px solid var(--pt-border-light);
  border-radius: 10px;
  padding: .65rem .7rem;
  font: inherit;
  color: var(--pt-text-primary);
  background: #fff;
}
.form-stack textarea { min-height: 100px; }
.form-stack input:focus,
.form-stack textarea:focus {
  outline: none;
  border-color: var(--pt-primary-teal);
  box-shadow: 0 0 0 3px rgba(45, 149, 150, 0.12);
}

.child-row {
  border: 1px solid var(--pt-border-light);
  border-radius: 10px;
  padding: .9rem;
  background: #fff;
}

@media (max-width: 767px) {
  .nav-form-item { margin-top: .2rem; }
  .nav-logout { width: 100%; }
}
