/* ============================================================
   PLAYLAB — Design System
   Palette: deep navy base + single amber accent.
   Category hues used ONLY as thin card markers, never as fills.
   No emoji icons. Inline SVG only. Hairline dividers.
   ============================================================ */

:root {
  /* Core */
  --navy-900: #0b1220;
  --navy-800: #0f172a;
  --navy-700: #1a2333;
  --navy-600: #253149;
  --navy-400: #64748b;
  --navy-300: #94a3b8;
  --navy-200: #cbd5e1;
  --navy-100: #e2e8f0;
  --navy-050: #f1f5f9;
  --paper:   #ffffff;
  --page:    #f7f8fa;

  /* Accent */
  --amber:      #f59e0b;
  --amber-700:  #b45309;
  --amber-050:  #fffbeb;

  /* Category hues (marker only) */
  --c-quiz:     #7c3aed;
  --c-math:     #0284c7;
  --c-word:     #059669;
  --c-logic:    #0d9488;
  --c-reflex:   #e11d48;
  --c-adventure:#ea580c;
  --c-early:    #c026d3;
  --c-doll:     #db2777;

  --ok:   #15803d;
  --ok-bg:#f0fdf4;
  --bad:  #b91c1c;
  --bad-bg:#fef2f2;

  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 4px 14px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 48px rgba(15,23,42,.14);

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--navy-800);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.label {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--amber-700);
}

.serif { font-family: var(--serif); }

.rule { height: 1px; background: var(--navy-100); border: 0; margin: 0; }

/* ---------------- Header ---------------- */
.site-head {
  background: var(--navy-800);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 26px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.brand svg { display: block; }
.brand-name {
  font-family: var(--serif); font-size: 21px; font-weight: 700;
  letter-spacing: .01em; line-height: 1;
}
.brand-sub {
  font-size: 10px; letter-spacing: .17em; text-transform: uppercase;
  color: var(--amber); font-weight: 700; margin-top: 3px;
}

.head-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.head-nav a {
  text-decoration: none; font-size: 13.5px; font-weight: 600;
  color: var(--navy-200); letter-spacing: .01em;
  padding: 6px 0; border-bottom: 1.5px solid transparent;
}
.head-nav a:hover { color: #fff; }
.head-nav a:hover, .head-nav a.active { color: #fff; border-bottom-color: var(--amber); }

.head-stats { display: flex; gap: 16px; align-items: center; padding-left: 20px; border-left: 1px solid rgba(255,255,255,.14); }
.hstat { text-align: right; line-height: 1.15; }
.hstat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.hstat span { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-300); }

.sound-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18); background: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background .15s, border-color .15s;
}
.sound-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.32); }
.sound-btn svg { width: 17px; height: 17px; stroke: var(--navy-200); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn.off svg { stroke: var(--navy-400); }

.menu-btn { display: none; }

/* ---------------- Hero ---------------- */
.hero {
  background: var(--navy-800);
  color: #fff;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(245,158,11,.16), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(245,158,11,.09), transparent 46%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 78%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; padding: 76px 24px 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.05;
  margin: 14px 0 20px;
  letter-spacing: -.015em;
  font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p.lede {
  font-size: 17.5px; color: var(--navy-200); max-width: 52ch; margin: 0 0 30px;
}
.hero-cta { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 11px; border-radius: 100px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  font-size: 12.5px; font-weight: 600; color: var(--navy-100);
}
.hero-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); display: block; }

.hero-panel {
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-xl);
  padding: 28px;
  backdrop-filter: blur(6px);
}
.hp-title { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.hp-list { list-style: none; padding: 0; margin: 18px 0 0; }
.hp-list li {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 0; border-top: 1px solid rgba(255,255,255,.11);
}
.hp-list li:first-child { border-top: 0; padding-top: 4px; }
.hp-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
  background: rgba(245,158,11,.14); display: grid; place-items: center;
}
.hp-ico svg { width: 16px; height: 16px; stroke: var(--amber); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hp-list b { display: block; font-size: 14px; font-weight: 700; color: #fff; }
.hp-list span { font-size: 12.5px; color: var(--navy-300); line-height: 1.45; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(255,255,255,.13);
  border-top: 1px solid rgba(255,255,255,.13);
  margin-top: 62px; position: relative; z-index: 2;
}
.hero-stats > div { background: var(--navy-800); padding: 22px 24px; }
.hero-stats b {
  display: block; font-family: var(--serif); font-size: 30px; line-height: 1;
  color: #fff; font-variant-numeric: tabular-nums;
}
.hero-stats span {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-300); display: block; margin-top: 8px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 700;
  padding: 13px 24px; border-radius: 100px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: all .16s ease;
  letter-spacing: .01em;
}
.btn svg { width: 17px; height: 17px; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--amber); color: var(--navy-900); }
.btn-primary:hover { background: #fbbf24; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(245,158,11,.28); }
.btn-ghost { border-color: rgba(255,255,255,.26); color: #fff; background: transparent; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.07); }
.btn-outline { border-color: var(--navy-200); color: var(--navy-800); background: #fff; }
.btn-outline:hover { border-color: var(--navy-800); }
.btn-dark { background: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--navy-700); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ---------------- Section ---------------- */
.section { padding: 76px 0; }
.section.tint { background: #fff; border-top: 1px solid var(--navy-100); border-bottom: 1px solid var(--navy-100); }
.sec-head { max-width: 660px; margin-bottom: 38px; }
.sec-head h2 {
  font-family: var(--serif); font-size: clamp(27px, 3.4vw, 38px);
  margin: 10px 0 12px; line-height: 1.14; letter-spacing: -.01em; font-weight: 700;
}
.sec-head p { color: var(--navy-600); font-size: 15.5px; margin: 0; }

/* ---------------- Category filter ---------------- */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--navy-100);
}
.chip {
  border: 1px solid var(--navy-200); background: #fff; color: var(--navy-700);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 100px; cursor: pointer;
  transition: all .15s ease; display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { border-color: var(--navy-400); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; }
.chip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip.on i { opacity: 1; }
.chip .ct { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }

/* ---------------- Game grid ---------------- */
.game-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}
.gcard {
  position: relative; background: #fff; border: 1px solid var(--navy-100);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none; color: inherit;
}
.gcard::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent, var(--amber));
}
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.gcard-top { padding: 24px 22px 0; display: flex; align-items: flex-start; gap: 15px; }
.gcard-ico {
  width: 50px; height: 50px; flex: 0 0 50px; border-radius: 13px;
  background: var(--navy-050); border: 1px solid var(--navy-100);
  display: grid; place-items: center;
}
.gcard-ico svg { width: 25px; height: 25px; stroke: var(--accent, var(--amber)); fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.gcard-cat {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--accent, var(--amber)); display: block; margin-bottom: 5px;
}
.gcard h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 5px; line-height: 1.22; font-weight: 700; }
.gcard .desc { font-size: 13.5px; color: var(--navy-600); margin: 0; line-height: 1.5; }
.gcard-foot {
  margin-top: auto; padding: 16px 22px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--navy-100);
}
.gcard-meta { font-size: 11.5px; color: var(--navy-400); display: flex; align-items: center; gap: 7px; }
.gcard-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--navy-300); }
.gcard-go { color: var(--navy-800); display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.gcard-go svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s; }
.gcard:hover .gcard-go svg { transform: translateX(3px); }
.played-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ok); background: var(--ok-bg); border: 1px solid #bbf7d0;
  padding: 3px 9px; border-radius: 100px;
}

/* ---------------- Progress / parent ---------------- */
.dash {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 22px;
}
.panel {
  background: #fff; border: 1px solid var(--navy-100); border-radius: var(--r-lg);
  padding: 28px;
}
.panel h3 { font-family: var(--serif); font-size: 21px; margin: 0 0 5px; font-weight: 700; }
.panel .panel-sub { font-size: 13.5px; color: var(--navy-600); margin: 0 0 22px; }

.bar-row { margin-bottom: 15px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.bar-head span:last-child { color: var(--navy-500, var(--navy-400)); font-variant-numeric: tabular-nums; font-weight: 700; }
.bar { height: 7px; background: var(--navy-050); border-radius: 100px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 100px; background: var(--accent, var(--amber)); transition: width .8s cubic-bezier(.2,.7,.3,1); }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.kpi {
  background: var(--navy-050); border: 1px solid var(--navy-100); border-radius: var(--r-md);
  padding: 17px 18px;
}
.kpi b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-400); display: block; margin-top: 8px; }

/* ---------------- Badges ---------------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }
.badge {
  text-align: center; padding: 20px 14px; border-radius: var(--r-md);
  border: 1px solid var(--navy-100); background: #fff;
}
.badge.locked { background: var(--navy-050); opacity: .58; }
.badge-ring {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--amber-050); border: 1.5px solid var(--amber);
}
.badge-ring svg { width: 25px; height: 25px; stroke: var(--amber-700); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.badge.locked .badge-ring { background: var(--navy-100); border-color: var(--navy-200); }
.badge.locked .badge-ring svg { stroke: var(--navy-400); }
.badge b { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; }
.badge span { font-size: 11px; color: var(--navy-400); display: block; margin-top: 5px; line-height: 1.35; }

/* ---------------- How it works ---------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.step { padding-top: 22px; border-top: 2px solid var(--navy-800); position: relative; }
.step .num {
  font-family: var(--serif); font-size: 13px; font-weight: 700;
  color: var(--amber-700); letter-spacing: .1em; display: block; margin-bottom: 9px;
}
.step h4 { font-family: var(--serif); font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.step p { font-size: 14px; color: var(--navy-600); margin: 0; line-height: 1.6; }

/* ---------------- Footer ---------------- */
.site-foot { background: var(--navy-900); color: var(--navy-300); padding: 52px 0 34px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
.foot-grid h5 {
  font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 15px; font-weight: 700;
}
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 9px; }
.foot-grid a { font-size: 13.5px; text-decoration: none; color: var(--navy-300); }
.foot-grid a:hover { color: #fff; }
.foot-brand p { font-size: 13.5px; line-height: 1.65; max-width: 34ch; margin: 12px 0 0; }
.foot-bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--navy-400);
}

/* ---------------- Toast ---------------- */
#toasts {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--navy-800); color: #fff; padding: 12px 20px; border-radius: 100px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s cubic-bezier(.2,.8,.3,1);
  border: 1px solid rgba(255,255,255,.12);
}
.toast svg { width: 16px; height: 16px; stroke: var(--amber); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toast.good { border-color: rgba(21,128,61,.5); }
.toast.good svg { stroke: #4ade80; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 38px; }
  .hero .wrap { padding: 54px 24px 50px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); margin-top: 44px; }
  .dash { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .head-nav { display: none; }
  .menu-btn {
    display: grid; place-items: center; margin-left: auto;
    width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
    background: transparent; border: 1px solid rgba(255,255,255,.2); padding: 0;
  }
  .menu-btn svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.9; stroke-linecap: round; }
  .mobile-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--navy-800); border-bottom: 1px solid rgba(255,255,255,.12);
    padding: 14px 24px 20px; flex-direction: column; gap: 3px;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    color: var(--navy-100); text-decoration: none; padding: 11px 0; font-size: 15px;
    font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .head-stats { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero .wrap { padding: 46px 18px 44px; }
  .hero h1 { font-size: 33px; }
  .section { padding: 54px 0; }
  .hero-stats > div { padding: 17px 18px; }
  .hero-stats b { font-size: 24px; }
  .game-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
}
