@font-face { font-family: 'Fredoka'; src: url('../fonts/FredokaSB.ttf') format('truetype'); font-weight: 600; font-display: swap; }
:root {
  --lilac: #C8D2FD; --lilac-2: #B3C4FA; --navy: #2B2540; --orange: #FF8040; --yellow: #FFCA28;
  --pink: #FF5C96; --blue: #40BEF5; --green: #78D250; --purple: #AA78F0; --cream: #FFF8EC; --white: #fff;
  --shadow: 0 6px 0 rgba(43, 37, 64, .9);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif; font-weight: 600; color: var(--navy);
  background: linear-gradient(180deg, var(--lilac-2) 0%, var(--lilac) 40%, #D6DEFF 100%); min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(200, 210, 253, .92); backdrop-filter: blur(6px); border-bottom: 4px solid var(--navy); }
.top .wrap { display: flex; align-items: center; gap: 14px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
nav { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
nav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; background: var(--white); border: 3px solid var(--navy); font-size: 17px; }
nav a.on { background: var(--yellow); }
@media (max-width: 760px) {
  .top .wrap { flex-direction: column; gap: 6px; padding-left: 10px; padding-right: 10px; }
  nav { margin: 0; flex-wrap: nowrap; overflow-x: auto; width: 100%; justify-content: flex-start; padding-bottom: 2px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { font-size: 15px; padding: 5px 11px; white-space: nowrap; flex-shrink: 0; }
  .brand img { height: 26px; }
}

section { display: none; padding: 26px 0 60px; scroll-margin-top: 400px; }
section.show { display: block; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.1; }
h2 { font-size: clamp(28px, 5vw, 44px); text-align: center; }
h2 .hi { color: var(--orange); -webkit-text-stroke: 2px var(--navy); paint-order: stroke fill; }
.lead { text-align: center; font-size: 19px; max-width: 640px; margin: 0 auto 22px; font-weight: 500; }
.card { background: var(--white); border: 4px solid var(--navy); border-radius: 26px; box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 12px 22px; border-radius: 999px;
  border: 4px solid var(--navy); background: var(--yellow); box-shadow: 0 5px 0 var(--navy); font-size: 19px; transition: transform .1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--navy); }
.btn.o { background: var(--orange); color: #fff; } .btn.p { background: var(--pink); color: #fff; } .btn.b { background: var(--blue); }
.btn.g { background: var(--green); } .btn.w { background: #fff; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* home */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 20px; padding-top: 10px; }
.hero .sub { width: min(420px, 70%); margin: 0 auto 6px; }
.hero .logo { width: 100%; }
.hero p { font-size: 21px; text-align: center; font-weight: 500; }
.hero .chars { width: 100%; max-width: 470px; margin: 0 auto; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero .chars { max-width: 300px; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 30px; }
.tile { text-decoration: none; padding: 18px 12px; text-align: center; transition: transform .15s; }
.tile:hover { transform: translateY(-4px) rotate(-1deg); }
.tile .ico { font-size: 52px; line-height: 1; display: block; margin-bottom: 8px; }
.tile b { font-size: 22px; display: block; }
.tile span { font-size: 15px; font-weight: 500; }
.t1 { background: #FFE9A8; } .t2 { background: #FFD3C0; } .t3 { background: #D2F2FF; } .t4 { background: #DDF6CF; } .t5 { background: #EADDFF; } .t6 { background: #FFD6E7; }
.friday { margin: 28px auto 0; max-width: 640px; text-align: center; padding: 16px; background: var(--orange); color: #fff; font-size: 22px; }

/* episodes */
.eps { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.ep { overflow: hidden; }
.ep img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-bottom: 4px solid var(--navy); }
.ep .in { padding: 14px 16px 18px; }
.ep h3 { font-size: 22px; } .ep p { margin: 0 0 12px; font-weight: 500; }
.tag { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--lilac); border: 2px solid var(--navy); margin-bottom: 8px; }
.soon { opacity: .9; }

/* colouring */
.colour { display: grid; grid-template-columns: 1fr 230px; gap: 18px; align-items: start; }
@media (max-width: 820px) { .colour { grid-template-columns: 1fr; } }
.canvas { padding: 10px; }
.canvas svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.canvas .r { cursor: pointer; transition: fill .15s; }
.tools { padding: 14px; }
.pal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 14px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--navy); }
.sw.on { outline: 5px solid var(--yellow); outline-offset: 2px; transform: scale(1.08); }
.pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 14px; }
.pick button { padding: 6px 2px; border-radius: 14px; border: 3px solid var(--navy); background: #fff; font-size: 13px; }
.pick button.on { background: var(--yellow); }
.tools .btn { width: 100%; justify-content: center; margin-top: 8px; font-size: 17px; padding: 9px 14px; }
@media (max-width: 820px) { .pick { grid-template-columns: repeat(5, 1fr); } .pal { grid-template-columns: repeat(8, 1fr); } }

/* games */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.game-tile { padding: 16px; text-align: center; text-decoration: none; }
.game-tile .ico { font-size: 56px; }
.game-tile b { display: block; font-size: 22px; margin-top: 4px; }
.game-tile span { font-weight: 500; }
.back { margin-bottom: 14px; }
.stage { padding: 16px; text-align: center; }
.levels { margin-bottom: 12px; }

.jig { display: grid; gap: 4px; margin: 0 auto; max-width: 720px; aspect-ratio: 16/9; background: var(--navy); border: 4px solid var(--navy); border-radius: 12px; overflow: hidden; }
.piece { background-size: 300% 300%; cursor: pointer; transition: transform .15s, filter .15s; }
.piece.sel { filter: brightness(1.15); transform: scale(.92); outline: 5px solid var(--yellow); outline-offset: -5px; }
.thumbs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.thumbs img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; border: 3px solid var(--navy); cursor: pointer; }
.thumbs img.on { outline: 5px solid var(--yellow); }

.pairs { display: grid; gap: 10px; max-width: 640px; margin: 0 auto; }
.pc { aspect-ratio: 1; perspective: 600px; cursor: pointer; }
.pc .f { position: relative; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.pc.up .f, .pc.done .f { transform: rotateY(180deg); }
.pc .s { position: absolute; inset: 0; border: 4px solid var(--navy); border-radius: 16px; backface-visibility: hidden; display: grid; place-items: center; overflow: hidden; }
.pc .back { background: repeating-linear-gradient(45deg, var(--blue), var(--blue) 12px, #6FD0FA 12px, #6FD0FA 24px); }
.pc .back::after { content: '?'; font-size: 40px; color: #fff; -webkit-text-stroke: 2px var(--navy); }
.pc .front { background: #fff; transform: rotateY(180deg); font-size: clamp(34px, 9vw, 60px); }
.pc .front img { width: 100%; height: 100%; object-fit: cover; }
.pc.done .front { background: #E8FFD9; }

.bees { position: relative; max-width: 640px; height: 340px; margin: 0 auto 14px; background: linear-gradient(#BFE4FF, #DDF2FF 60%, #9FD77F 60%); border: 4px solid var(--navy); border-radius: 20px; overflow: hidden; }
.bees svg { position: absolute; width: 64px; height: 56px; animation: buzz 1.6s ease-in-out infinite; }
@keyframes buzz { 0%, 100% { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(6px, -8px) rotate(4deg); } }
.nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 520px; margin: 0 auto; }
.nums button { font-size: 30px; padding: 8px 0; border-radius: 16px; border: 4px solid var(--navy); background: #fff; box-shadow: 0 4px 0 var(--navy); }

.mazebox { max-width: 520px; margin: 0 auto; }
.maze { width: 100%; aspect-ratio: 1; background: #fff; border: 4px solid var(--navy); border-radius: 14px; touch-action: none; display: block; }
.pad { display: grid; grid-template-columns: repeat(3, 70px); gap: 6px; justify-content: center; margin-top: 12px; }
.pad button { height: 60px; font-size: 28px; border-radius: 16px; border: 4px solid var(--navy); background: var(--yellow); box-shadow: 0 4px 0 var(--navy); }

.spot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .spot { grid-template-columns: 1fr; } }
.spot .pic { position: relative; border: 4px solid var(--navy); border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer; }
.spot .pic svg { width: 100%; height: auto; display: block; }
.ring { position: absolute; border: 6px solid #FF3D7F; border-radius: 50%; pointer-events: none; animation: ring .4s ease; }
@keyframes ring { from { transform: scale(1.6); opacity: 0; } }
.found { font-size: 22px; margin: 10px 0; }

.yay { position: fixed; inset: 0; display: none; place-items: center; z-index: 60; background: rgba(43, 37, 64, .35); }
.yay.show { display: grid; }
.yay .card { padding: 26px 30px; text-align: center; max-width: 380px; animation: pop .3s ease; }
.yay img { width: 200px; margin: 0 auto 6px; }
.yay h3 { font-size: 34px; color: var(--orange); -webkit-text-stroke: 1.5px var(--navy); paint-order: stroke fill; }
.confetti { position: fixed; top: -20px; width: 12px; height: 18px; z-index: 61; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* print */
.sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.sheet { padding: 12px; text-align: center; }
.sheet .prev { border: 3px dashed var(--lilac-2); border-radius: 12px; padding: 8px; margin-bottom: 10px; }
.sheet .prev svg { width: 100%; height: 190px; }
.sheet b { display: block; font-size: 20px; margin-bottom: 8px; }
.printnote { text-align: center; font-weight: 500; margin-top: 16px; }
#printarea { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#printarea) { display: none !important; }
  #printarea { display: block !important; }
  #printarea .ph { text-align: center; font-size: 26pt; margin: 0 0 6mm; }
  #printarea svg { width: 100%; height: auto; max-height: 230mm; }
  #printarea .pf { text-align: center; font-size: 11pt; margin-top: 4mm; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* song */
.song { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
@media (max-width: 760px) { .song { grid-template-columns: 1fr; } }
.dance { max-width: 380px; margin: 0 auto; transform-origin: bottom center; }
.dance.go { animation: dance .51s ease-in-out infinite alternate; }
@keyframes dance { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-14px); } }
.moves { padding: 18px; }
.moves li { font-size: 20px; margin: 8px 0; font-weight: 500; }
.big { font-size: 26px; padding: 16px 30px; }

/* parents */
.par { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.par .card { padding: 20px; }
.par p, .par li { font-weight: 500; line-height: 1.5; }
.par h3 { font-size: 23px; }

footer { border-top: 4px solid var(--navy); background: var(--navy); color: #fff; padding: 22px 0; text-align: center; }
footer a { color: var(--yellow); }
footer p { margin: 6px 0; font-weight: 500; }
/* keep everything inside the screen on phones */
html, body { overflow-x: hidden; }
.song > *, .colour > *, .hero > * { min-width: 0; }
.moves .big { font-size: 22px; padding: 14px 22px; max-width: 100%; }
.dance { width: 100%; max-width: min(380px, 100%); }
