:root {
  --sky: #5cc4f5;
  --sky-deep: #2a9fd8;
  --grass: #7dd33a;
  --grass-deep: #4ea21b;
  --sun: #ffd23f;
  --pink: #ff5fa2;
  --ink: #3b2416;
  --ink-soft: #6b5446;
  --cream: #fff8ec;
  --card: #ffffff;
  --line: #f0e2cc;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(59, 36, 22, 0.12), 0 18px 40px rgba(59, 36, 22, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sky-deep); font-weight: 700; }
a:hover { color: var(--pink); }

h1, h2, h3, .brand { font-family: "Fredoka", "Nunito", sans-serif; line-height: 1.15; margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 10; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 248, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.top nav { display: flex; gap: 18px; }
.top nav a { color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--pink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.1rem;
  text-decoration: none; border: 3px solid var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.btn-play { background: var(--grass); color: #fff; box-shadow: 0 5px 0 var(--ink); text-shadow: 0 2px 0 rgba(0,0,0,0.2); }
.btn-play:hover { color: #fff; box-shadow: 0 7px 0 var(--ink); }
.btn-apple { background: #111; color: #fff; box-shadow: 0 5px 0 var(--ink); }
.btn-apple:hover { color: #fff; box-shadow: 0 7px 0 var(--ink); }
.btn-play, .btn-apple { min-width: 196px; justify-content: center; text-align: left; }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.btn-ghost:hover { color: var(--ink); }
.btn small { display: block; font-size: 0.7rem; font-weight: 500; opacity: 0.9; line-height: 1; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky) 0%, #a5e0fb 70%, var(--cream) 100%);
  padding: 56px 0 72px;
}
.hero .wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; }
.hero .logo { width: min(440px, 100%); filter: drop-shadow(0 6px 0 rgba(59,36,22,0.15)); }
.hero p.lead { font-size: 1.15rem; font-weight: 700; color: var(--ink-soft); margin: 10px 0 24px; max-width: 34ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .hero-title {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 600; color: var(--ink);
  margin: 14px 0 0; max-width: 24ch;
}
.note { margin-top: 14px; font-size: 0.9rem; color: var(--ink-soft); font-weight: 700; }
.hero .shot {
  border-radius: var(--radius); border: 5px solid #fff;
  box-shadow: var(--shadow); transform: rotate(1.5deg);
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.badges li {
  background: #fff; border: 2px solid var(--ink); border-radius: 999px;
  padding: 4px 12px; font-weight: 800; font-size: 0.85rem;
}

/* Sections */
section { padding: 72px 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; text-align: center; }
.section-sub { text-align: center; color: var(--ink-soft); max-width: 56ch; margin: 10px auto 40px; font-weight: 600; }

.tinted { background: #fff3e0; }

/* How to play */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.steps li {
  position: relative; background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 30px 24px 24px; box-shadow: var(--shadow);
}
.step-num {
  position: absolute; top: -18px; left: 24px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sun); border: 3px solid var(--ink);
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.2rem;
}
.steps h3 { font-size: 1.25rem; font-weight: 600; margin: 6px 0 6px; }
.steps p { margin: 0; color: var(--ink-soft); }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 0 22px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 28px 18px 0; position: relative;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.15rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-size: 1.5rem; color: var(--sky-deep); }
.faq details[open] summary::after { content: "–"; }
.faq summary:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 8px; }
.faq details p { margin: 0 0 18px; color: var(--ink-soft); }

/* 404 */
.lost { text-align: center; padding: 96px 20px; }
.lost h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 600; margin-bottom: 12px; }
.lost .ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* Buddies strip */
.buddies { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 0; padding: 0; list-style: none; }
.buddies li { text-align: center; font-family: "Fredoka", sans-serif; font-weight: 500; }
.buddies img {
  width: 92px; height: 92px; object-fit: contain;
  background: #fff; border-radius: 50%; padding: 10px; border: 3px solid var(--line);
  transition: transform 0.2s ease;
}
.buddies li:hover img { transform: translateY(-6px) rotate(-6deg); }

/* Features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  border: 2px solid var(--line); box-shadow: var(--shadow);
}
.card .icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  border: 3px solid var(--ink); color: var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.icon-sky { background: #bfe8fc; }
.icon-pink { background: #ffd0e4; }
.icon-grass { background: #d6f2b8; }
.icon-sun { background: #ffe89a; }
.play-svg { flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.2)); }
.card h3 { font-size: 1.25rem; font-weight: 600; margin: 12px 0 6px; }
.card p { margin: 0; color: var(--ink-soft); }

/* Parents band */
.parents { background: #e9f8d9; border-top: 3px dashed #bfe59a; border-bottom: 3px dashed #bfe59a; }
.parents .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.parents h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 600; }
.checks { list-style: none; padding: 0; margin: 20px 0 0; }
.checks li { position: relative; padding-left: 36px; margin: 10px 0; font-weight: 700; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--grass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.parents img { border-radius: var(--radius); border: 5px solid #fff; box-shadow: var(--shadow); }

/* Gallery */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 520px);
  gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 4px 18px; margin: 0; list-style: none;
}
.gallery li { scroll-snap-align: start; }
.gallery img { border-radius: 18px; border: 4px solid #fff; box-shadow: var(--shadow); }

/* Download band */
.download { text-align: center; background: linear-gradient(180deg, var(--cream), #ffe9f3); }
.download .ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* Footer */
footer { background: var(--ink); color: #f6e9dc; padding: 36px 0; font-size: 0.95rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
footer a { color: var(--sun); }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }

/* Policy page */
.doc { max-width: 760px; margin: 0 auto; padding: 48px 20px 72px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 600; }
.doc .meta { color: var(--ink-soft); font-weight: 700; margin: 8px 0 28px; }
.doc h2 { font-size: 1.4rem; font-weight: 600; margin: 36px 0 10px; }
.doc p, .doc li { color: #4a3427; }
.doc ul { padding-left: 22px; }
.summary {
  background: #e9f8d9; border: 2px solid #bfe59a; border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 8px;
}
.summary h2 { margin-top: 0; }
.summary ul { margin: 0; }
table.facts { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
table.facts th, table.facts td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); vertical-align: top; }
table.facts th { font-family: "Fredoka", sans-serif; font-weight: 600; }

@media (max-width: 860px) {
  .hero .wrap, .parents .wrap { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .hero .shot { transform: none; }
  .grid, .steps { grid-template-columns: 1fr; }
  .steps { gap: 32px; }
  .top nav a.hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .buddies img { transition: none; }
}

/* ---------- Printable mazes ---------- */
.pm-hero { background: linear-gradient(180deg, var(--sky) 0%, #a5e0fb 75%, var(--cream) 100%); padding: 40px 0 28px; }
.pm-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 600; margin-top: 8px; }
.pm-hero .lead { font-size: 1.15rem; font-weight: 700; color: var(--ink-soft); max-width: 60ch; margin: 12px 0 0; }
.crumbs { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }

.pm-tool { padding: 28px 0 64px; }
.pm-layout { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.pm-controls {
  position: sticky; top: 84px; background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 18px;
}
.pm-controls { grid-template-columns: minmax(0, 1fr); }
.pm-controls > *, .pm-buttons > * { min-width: 0; }
.pm-controls fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
#pm-seed { flex: 1 1 auto; min-width: 0; }
.pm-controls legend, .pm-row > label { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.05rem; margin-bottom: 8px; display: block; padding: 0; }
.pm-sizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pm-sizes label { cursor: pointer; }
.pm-sizes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pm-sizes span {
  display: grid; text-align: center; padding: 8px 2px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--cream); line-height: 1.2;
}
.pm-sizes b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 0.85rem; }
.pm-sizes small { font-size: 0.7rem; color: var(--ink-soft); font-weight: 700; }
.pm-sizes input:checked + span { background: var(--sun); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.pm-sizes input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.pm-controls select, .pm-controls input[type="text"], #pm-seed {
  width: 100%; font: inherit; font-weight: 700; color: var(--ink); padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--cream);
}
.pm-controls select:focus-visible, #pm-seed:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.pm-check { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.pm-check input { width: 20px; height: 20px; accent-color: var(--grass-deep); }
.pm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-buttons .btn { justify-content: center; min-width: 0; padding: 12px 10px; font-size: 1rem; cursor: pointer; font-family: "Fredoka", sans-serif; }
.pm-code-row { display: flex; gap: 8px; }
.pm-small-btn {
  font: inherit; font-weight: 800; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
.pm-small-btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.pm-hint { margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }

.pm-preview { display: grid; gap: 24px; min-width: 0; }
.sheet {
  background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 24px 28px 18px;
  box-shadow: var(--shadow); max-width: 720px; width: 100%; margin: 0 auto;
}
.sheet-answer { background: #fffafc; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.sheet-brand { display: flex; align-items: center; gap: 8px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.1rem; }
.sheet-brand img { width: 28px; height: 28px; border-radius: 7px; }
.sheet-meta { font-weight: 800; font-size: 0.9rem; color: var(--ink-soft); }
.sheet-name { margin: 14px 0 0; font-weight: 800; font-size: 1.05rem; border-bottom: 2px solid var(--ink); padding-bottom: 2px; width: 70%; }
.sheet-task { margin: 12px 0 6px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.2rem; text-align: center; }
.maze-svg { display: block; width: 100%; height: auto; max-height: 78vh; margin: 0 auto; }
.sheet-foot { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin: 6px 0 0; }

.pm-info { padding: 24px 0 72px; }
.pm-prose { max-width: 780px; }
.pm-prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; margin: 40px 0 12px; }
.pm-prose h2:first-child { margin-top: 0; }
.pm-prose ol, .pm-prose ul { padding-left: 22px; }
.pm-prose li { margin: 8px 0; }
.pm-prose .faq { margin: 0; }
.pm-table-wrap { overflow-x: auto; }

.home-print { background: #fff3e0; }
.home-print .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.home-print h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 600; }
.home-print p { color: var(--ink-soft); font-weight: 600; margin: 12px 0 22px; }
.home-print .mini-maze { background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink); padding: 18px; }

@media (max-width: 860px) {
  .pm-layout, .home-print .wrap { grid-template-columns: 1fr; }
  .pm-controls { position: static; }
  .sheet { padding: 16px; }
}

@media print {
  @page { margin: 12mm; }
  body.pm-page { background: #fff; font-size: 12pt; }
  body.pm-page .skip, body.pm-page .top, body.pm-page footer,
  body.pm-page .pm-hero, body.pm-page .pm-info, body.pm-page .download,
  body.pm-page .pm-controls { display: none !important; }
  .pm-tool { padding: 0; }
  .pm-tool .wrap { max-width: none; padding: 0; }
  .pm-layout { display: block; }
  .pm-preview { display: block; }
  .sheet {
    border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; max-width: none;
    background: #fff; break-after: page; page-break-after: always; break-inside: avoid;
  }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sheet-task { font-size: 15pt; }
  .maze-svg { width: auto; max-width: 100%; height: 205mm; max-height: none; }
  .maze-svg, .sheet-brand img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
