/* ============ Tokens ============ */
:root {
  --bg: #fffaf0;
  --paper: #ffffff;
  --ink: #1f2544;
  --muted: #5d6385;
  --line: #f0e6d2;
  --shadow: 0 3px 0 rgba(31, 37, 68, .08), 0 10px 24px rgba(31, 37, 68, .06);
  --coral: #ff6b6b; --coral-bg: #ffe9e6;
  --sky: #2f9bf0; --sky-bg: #e3f2ff;
  --grape: #8b5cf6; --grape-bg: #efe8ff;
  --leaf: #1fb863; --leaf-bg: #e2f8ea;
  --sun: #ffb800; --sun-bg: #fff4d1;
  --orange: #ff8a3d; --orange-bg: #ffecdf;
  --pink: #ff5fa2; --pink-bg: #ffe6f1;
  --teal: #14b8a6; --teal-bg: #dcf7f3;
  /* darker shades of the brand colors for white text and text links (WCAG AA 4.5:1) */
  --coral-d: #c73e3e; --sky-d: #1f6fb2; --leaf-d: #13804a; --grape-d: #7046dd; --orange-d: #b45309; --teal-d: #0f766e; --pink-d: #be2d73;
  --radius: 22px;
  --head: 'Fredoka', 'Baloo 2', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #1565c0; outline-offset: 3px; border-radius: 8px; }

/* ============ Header ============ */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header-inner { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 1.75rem; letter-spacing: .5px; flex-shrink: 0; }
.logo-badge { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #ffc233, #ff8a3d); color: #fff; font-size: 1.35rem; transform: rotate(-8deg); box-shadow: 0 3px 0 #e07a1f; }
.logo:hover .logo-badge { transform: rotate(8deg) scale(1.06); transition: transform .25s; }
.logo-text { display: inline-flex; align-items: baseline; gap: 3px; }
.logo-fun { display: inline-flex; font-weight: 700; font-size: 1.12em; letter-spacing: 0; }
.logo-fun span { display: inline-block; -webkit-text-stroke: 1.5px rgba(31, 37, 68, .18); transition: transform .2s; }
.logo-fun span:nth-child(1) { color: #ff5a5f; transform: rotate(-8deg) translateY(1px); text-shadow: 0 3px 0 #c9393e; }
.logo-fun span:nth-child(2) { color: #ff9f1c; transform: rotate(5deg) translateY(-2px); text-shadow: 0 3px 0 #d17a00; }
.logo-fun span:nth-child(3) { color: #ffc233; transform: rotate(-4deg); text-shadow: 0 3px 0 #d69a00; }
.logo-rest { position: relative; font-weight: 600; background: linear-gradient(90deg, #8b5cf6 0%, #3f8cf5 38%, #14b8a6 70%, #22c55e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 2px; }
.logo-rest::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: -6px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='8' viewBox='0 0 22 8'%3E%3Cpath d='M0 5 Q5.5 0 11 4 T22 4' fill='none' stroke='%23ff5fa2' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left center / 22px 8px; opacity: .9; }
.logo:hover .logo-fun span { animation: wiggle .5s ease-in-out; }
.logo:hover .logo-fun span:nth-child(2) { animation-delay: .07s; } .logo:hover .logo-fun span:nth-child(3) { animation-delay: .14s; }
@keyframes wiggle { 0%, 100% { translate: 0 0; } 40% { translate: 0 -6px; } 70% { translate: 0 1px; } }
.site-footer .logo-rest { background-image: linear-gradient(90deg, #c4b5fd 0%, #7dd3fc 45%, #5eead4 75%, #86efac 100%); }
@media (prefers-reduced-motion: reduce) { .logo:hover .logo-fun span { animation: none; } }
.search { flex: 1; display: flex; max-width: 480px; margin-left: auto; background: var(--bg); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.search:focus-within { border-color: var(--sun); }
.search input { flex: 1; border: 0; background: transparent; padding: 9px 16px; font: inherit; font-size: 15px; min-width: 0; outline: none; }
.search button { border: 0; background: transparent; padding: 0 14px; cursor: pointer; font-size: 16px; }
.fav-link { position: relative; text-decoration: none; font-size: 22px; color: #c2185b; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--pink-bg); flex-shrink: 0; }
.fav-count { position: absolute; top: -4px; right: -4px; background: var(--pink); color: #fff; font: 700 11px/18px var(--body); min-width: 18px; height: 18px; border-radius: 9px; text-align: center; padding: 0 4px; }
.main-nav { border-top: 1px solid var(--line); }
.nav-inner { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 0; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-inner.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.nav-inner.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.nav-inner.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.main-nav a { display: flex; align-items: center; gap: 7px; white-space: nowrap; text-decoration: none; font-family: var(--head); font-weight: 500; font-size: 1.05rem; padding: 7px 15px; border-radius: 999px; transition: background .15s, transform .15s; }
.main-nav a:hover { background: var(--bg); transform: translateY(-1px); }
.main-nav a.active { color: #fff; }
.nav-coloring.active { background: var(--coral); } .nav-worksheets.active { background: var(--sky); } .nav-stories.active { background: var(--grape); }
.nav-draw.active { background: var(--leaf); } .nav-printables.active { background: var(--teal); } .nav-make.active { background: var(--pink); } .nav-games.active { background: var(--orange); } .nav-fun.active { background: var(--sun); color: var(--ink) !important; }
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .logo { font-size: 1.45rem; } .logo-badge { width: 34px; height: 34px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .fav-link { margin-left: auto; }
}

/* ============ Layout blocks ============ */
main { padding-bottom: 60px; }
.block { margin: 44px 0; }
.block-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.block-head h2 { margin: 0; }
.block-head p { margin: 4px 0 0; }
.more { font-family: var(--head); font-weight: 600; text-decoration: none; color: var(--sky); white-space: nowrap; }
.more:hover { text-decoration: underline; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); margin: 18px 0 6px; }
.crumbs a { text-decoration: none; } .crumbs a:hover { text-decoration: underline; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* ============ Hero ============ */
.page-hero { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: center; border-radius: 32px; padding: clamp(24px, 5vw, 52px); margin: 18px 0 8px; overflow: hidden; }
.page-hero h1 { margin-bottom: .25em; }
.page-hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.h-coral { background: var(--coral-bg); } .h-sky { background: var(--sky-bg); } .h-grape { background: var(--grape-bg); }
.h-leaf { background: var(--leaf-bg); } .h-sun { background: var(--sun-bg); } .h-orange { background: var(--orange-bg); } .h-pink { background: var(--pink-bg); } .h-teal { background: var(--teal-bg); }
.page-hero-art { position: relative; height: 220px; }
.page-hero-art img { position: absolute; width: 46%; filter: drop-shadow(0 8px 10px rgba(0,0,0,.08)); }
.page-hero-art .f0 { left: 4%; top: 12%; width: 52%; } .page-hero-art .f1 { right: 0; top: 0; } .page-hero-art .f2 { right: 18%; bottom: -8%; width: 40%; }
.float { animation: bob 5s ease-in-out infinite; }
.f1 { animation-delay: -1.6s; } .f2 { animation-delay: -3.2s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@media (max-width: 760px) { .page-hero { grid-template-columns: 1fr; } .page-hero-art { height: 150px; } .page-hero-art img { width: 34%; } .page-hero-art .f0 { width: 38%; left: 10%; } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }

/* Home hero */
.home-hero { text-align: center; padding: clamp(30px, 6vw, 70px) 20px clamp(90px, 12vw, 130px); background: radial-gradient(circle at 20% 20%, #fff3c4 0, transparent 40%), radial-gradient(circle at 80% 30%, #ffe0ea 0, transparent 40%), linear-gradient(180deg, #dff1ff, #fffaf0); border-radius: 0 0 48px 48px; position: relative; overflow: hidden; }
.home-hero h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); max-width: 14ch; margin: 0 auto .2em; }
.home-hero h1 .hl { background: linear-gradient(transparent 62%, #ffd84d 62%); padding: 0 .1em; }
.home-hero p { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 46ch; margin: 0 auto 26px; }
.big-search { display: flex; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 999px; box-shadow: 0 6px 0 rgba(31,37,68,.08), 0 18px 40px rgba(31,37,68,.1); padding: 6px; }
.big-search input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: 1.1rem; padding: 12px 20px; outline: none; background: transparent; }
.big-search button { border: 0; border-radius: 999px; background: var(--coral); color: #fff; font: 600 1.05rem var(--head); padding: 0 24px; cursor: pointer; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.hero-tags a { background: rgba(255,255,255,.8); border-radius: 999px; padding: 5px 14px; text-decoration: none; font-weight: 700; font-size: 14px; }
.hero-tags a:hover { background: #fff; }
.hero-floaters img { position: absolute; width: clamp(70px, 11vw, 140px); filter: drop-shadow(0 8px 10px rgba(0,0,0,.08)); }
@media (max-width: 1080px) { .hero-floaters { display: none; } } /* below this they crowd the headline and search box */

/* ============ Section tiles ============ */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; margin-top: -70px; position: relative; }
.tile { display: grid; grid-template-columns: 1fr 96px; align-items: center; gap: 8px; text-decoration: none; background: #fff; border-radius: var(--radius); padding: 20px 18px 20px 22px; box-shadow: var(--shadow); border: 2px solid transparent; transition: transform .18s, border-color .18s; min-height: 132px; }
.tile:hover { transform: translateY(-4px) rotate(-.5deg); }
.tile h2, .tile h3 { font-size: 1.4rem; margin: 0 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.tile .count { display: inline-block; margin-top: 8px; font: 700 13px var(--body); border-radius: 999px; padding: 2px 10px; }
.tile img { width: 96px; height: 96px; }
.t-coral:hover { border-color: var(--coral); } .t-coral .count { background: var(--coral-bg); color: #b42323; }
.t-sky:hover { border-color: var(--sky); } .t-sky .count { background: var(--sky-bg); color: #135c9e; }
.t-grape:hover { border-color: var(--grape); } .t-grape .count { background: var(--grape-bg); color: #5a2fbf; }
.t-leaf:hover { border-color: var(--leaf); } .t-leaf .count { background: var(--leaf-bg); color: #0b6b38; }
.t-orange:hover { border-color: var(--orange); } .t-orange .count { background: var(--orange-bg); color: #a3480d; }
.t-sun:hover { border-color: var(--sun); } .t-sun .count { background: var(--sun-bg); color: #7a5200; }
.t-pink:hover { border-color: var(--pink); } .t-pink .count { background: var(--pink-bg); color: #a3245f; }
.t-teal:hover { border-color: var(--teal); } .t-teal .count { background: var(--teal-bg); color: #0d8a7c; }

/* ============ Cards ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; text-decoration: none; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 4px 0 rgba(31,37,68,.08), 0 16px 30px rgba(31,37,68,.12); }
.card-img { aspect-ratio: 1; background: #fbf7ee; display: grid; place-items: center; padding: 10%; }
.card-img.tall { aspect-ratio: 8.5 / 11; padding: 6%; background: #eef2f7; }
.card-img.tall img { box-shadow: 0 2px 8px rgba(0,0,0,.12); background: #fff; border-radius: 4px; }
.card:nth-child(6n+1) .card-img:not(.tall) { background: #fff1ee; } .card:nth-child(6n+2) .card-img:not(.tall) { background: #eaf5ff; }
.card:nth-child(6n+3) .card-img:not(.tall) { background: #fff7dc; } .card:nth-child(6n+4) .card-img:not(.tall) { background: #eafaf0; }
.card:nth-child(6n+5) .card-img:not(.tall) { background: #f3edff; } .card:nth-child(6n+6) .card-img:not(.tall) { background: #ffeef6; }
.card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s; }
.card:hover .card-img img { transform: scale(1.05) rotate(-1.5deg); }
.card-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.card-title { font-family: var(--head); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.card-sub { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.chip { align-self: flex-start; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--sun-bg); color: #8a5d00; margin-top: 4px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 20px; }
.pill { text-decoration: none; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 15px; transition: all .15s; cursor: pointer; font-family: var(--body); color: var(--ink); }
.pill:hover { border-color: var(--sun); }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Category cards (big) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cat { display: flex; align-items: center; gap: 14px; text-decoration: none; background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: transform .18s; }
.cat:hover { transform: translateY(-3px); }
.cat img { width: 70px; height: 70px; flex-shrink: 0; }
.cat b { font-family: var(--head); font-weight: 600; font-size: 1.12rem; display: block; line-height: 1.2; }
.cat small { color: var(--muted); font-size: 13.5px; }

/* ============ Buttons ============ */
.btn { font: 600 1rem var(--head); display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; background: #fff; color: var(--ink); padding: 11px 18px; border-radius: 16px; box-shadow: 0 4px 0 #e3d8c3, 0 0 0 2px #efe4cf inset; transition: transform .1s, box-shadow .1s; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e3d8c3, 0 0 0 2px #efe4cf inset; }
.btn.primary { background: var(--coral); color: #fff; box-shadow: 0 4px 0 #d64545; }
.btn.blue { background: var(--sky); color: #fff; box-shadow: 0 4px 0 #1a73c0; }
.btn.green { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 #13874a; }
.btn.purple { background: var(--grape); color: #fff; box-shadow: 0 4px 0 #6d3ed6; }
.btn.yellow { background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #cc9300; }
.btn.fav[aria-pressed="true"] { background: var(--pink); color: #fff; box-shadow: 0 4px 0 #c73579; }
.btn.small { padding: 7px 12px; font-size: .92rem; border-radius: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

/* ============ Item page ============ */
.item { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; margin-top: 10px; }
.item-side { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2, .panel h3 { font-size: 1.15rem; }
.panel ul { margin: 0; padding-left: 20px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.meta span { background: var(--bg); border-radius: 999px; padding: 3px 12px; font-size: 14px; font-weight: 700; }
.paper { background: #fff; border-radius: 26px; box-shadow: var(--shadow); padding: clamp(10px, 3vw, 28px); }
.paper svg { width: 100%; height: auto; margin: 0 auto; }
.sheet-paper { background: #e9eef5; border-radius: 26px; padding: clamp(10px, 3vw, 30px); }
.sheet-paper .ws { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.12); max-width: 760px; margin: 0 auto; border-radius: 6px; overflow: hidden; }
.ws svg { width: 100%; height: auto; }
.ws .ans { display: none; }
.ws.show-ans .ans { display: inline; }
@media (max-width: 900px) { .item { grid-template-columns: 1fr; } .item-side { position: static; } .item-side:has([data-maker]) { order: -1; } }

.tip { background: var(--sun-bg); border-radius: 18px; padding: 14px 18px; font-size: 15px; }
.tip b { font-family: var(--head); }
.num-links { display: flex; flex-wrap: wrap; gap: 8px; }
.num-links a { text-decoration: none; min-width: 46px; text-align: center; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; font-weight: 800; }
.num-links a:hover, .num-links a.active { border-color: var(--sky); background: var(--sky-bg); }

/* ============ Coloring tool ============ */
.colorer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.colorer .paper > svg { max-height: calc(100vh - 170px); width: auto; max-width: 100%; }
.colorer .paper svg .f { cursor: pointer; transition: fill .15s; }
.colorer .paper svg .f:hover { filter: brightness(.97); }
.colorer svg .k, .colorer svg .w, .colorer svg .l, .colorer svg .n { pointer-events: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: #fff; border-radius: 22px; padding: 12px 14px; box-shadow: var(--shadow); }
.palette { display: flex; flex-wrap: wrap; gap: 7px; flex: 1 1 300px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #e5dccb; cursor: pointer; padding: 0; transition: transform .12s; position: relative; font: 800 14px var(--body); color: #1f2544; }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.14); }
.swatch.custom { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.swatch.custom input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool { font: 600 .95rem var(--head); border: 0; background: var(--bg); border-radius: 14px; padding: 9px 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tool:hover { background: #f5ecd9; }
.tool[aria-pressed="true"] { background: var(--ink); color: #fff; }
.current { width: 46px; height: 46px; border-radius: 14px; border: 3px solid var(--ink); flex-shrink: 0; }
.cbn-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.cbn-legend .swatch { width: 46px; height: 46px; }
.done-banner { display: none; text-align: center; font: 700 1.4rem var(--head); color: var(--leaf); }
.colorer.done .done-banner { display: block; animation: pop .5s; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 100; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ============ Drawing lessons ============ */
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; counter-reset: step; }
.step { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.step h2, .step h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 0 0 8px; }
.step h2 b, .step h3 b { width: 34px; height: 34px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; }
.step p { font-size: 14.5px; color: var(--muted); margin: 8px 0 0; }
.step.final h2 b, .step.final h3 b { background: var(--coral); }

/* ============ Stories ============ */
.story { max-width: 760px; margin: 0 auto; }
.story-cover { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; background: var(--grape-bg); border-radius: 30px; padding: 24px; margin: 18px 0 20px; }
.story-cover img { width: 180px; height: 180px; background: #fff; border-radius: 26px; padding: 14px; box-shadow: var(--shadow); }
.story-cover h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
@media (max-width: 600px) { .story-cover { grid-template-columns: 1fr; text-align: center; } .story-cover img { margin: 0 auto; } }
.story-text { font-size: var(--story-size, 1.3rem); line-height: 1.75; }
.story-text p { margin: 0 0 1.05em; }
.story-pic { margin: 8px auto 26px; max-width: 460px; background: #fff; border-radius: 26px; padding: 14px; box-shadow: var(--shadow); transform: rotate(-1deg); }
.story-pic:nth-of-type(even) { transform: rotate(1deg); }
.story-pic img { width: 100%; height: auto; border-radius: 16px; }
.story-pic figcaption { text-align: center; font: 600 1rem var(--head); margin-top: 8px; }
.story-pic figcaption a { text-decoration: none; color: var(--grape); }
.story-text .w.on { background: #ffe066; border-radius: 4px; }
.reader { position: sticky; top: 118px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: rgba(255, 250, 240, .95); backdrop-filter: blur(6px); padding: 10px 0; margin-bottom: 10px; }
.q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.q-list li { background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow); }
.q-list details summary { cursor: pointer; font-weight: 700; color: var(--grape); margin-top: 6px; }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vocab div { background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.vocab b { font-family: var(--head); font-size: 1.15rem; color: var(--grape); display: block; }
.lesson { background: var(--leaf-bg); border-radius: 22px; padding: 18px 22px; font-size: 1.1rem; }
.fact-box { background: var(--sky-bg); border-radius: 22px; padding: 18px 22px; }

/* ============ Fun ============ */
.jokes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.joke { background: #fff; border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); }
.joke p { font-weight: 700; margin: 0 0 8px; font-size: 1.05rem; }
.joke button { font: 600 .95rem var(--head); border: 0; background: var(--sun-bg); border-radius: 12px; padding: 7px 12px; cursor: pointer; }
.joke .a { display: none; color: #c2410c; font-family: var(--head); font-size: 1.1rem; margin-top: 6px; }
.joke.open .a { display: block; animation: pop .35s; }
.joke.open button { display: none; }
.big-card { background: #fff; border-radius: 32px; box-shadow: var(--shadow); padding: clamp(24px, 5vw, 48px); text-align: center; max-width: 720px; margin: 20px auto; }
.big-card .q { font: 600 clamp(1.4rem, 3.5vw, 2rem)/1.3 var(--head); margin-bottom: 16px; }
.big-card .a { font: 600 clamp(1.2rem, 3vw, 1.6rem) var(--head); color: #c2410c; min-height: 1.5em; }
.fact-cat { display: inline-block; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: 999px; background: var(--sky-bg); color: #1a73c0; margin-bottom: 8px; }

.fun-item .fun-pic { width: 170px; height: 170px; margin: 0 auto 10px; }
.fun-item h1.q { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.3; margin-bottom: 16px; }
.joke .open-link { display: inline-block; margin-top: 8px; margin-left: 8px; font: 600 .9rem var(--head); color: var(--sky); text-decoration: none; }
.joke-link { text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; transition: transform .15s; }
.joke-link:hover { transform: translateY(-3px); }

/* ============ Games ============ */
.game { max-width: 900px; margin: 0 auto; }
.game-stage { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: clamp(14px, 3vw, 28px); }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mem { aspect-ratio: 1; border: 0; border-radius: 18px; cursor: pointer; background: linear-gradient(135deg, #8b5cf6, #3fa9f5); position: relative; padding: 0; transform-style: preserve-3d; transition: transform .35s; }
.mem::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 2rem var(--head); backface-visibility: hidden; }
.mem img { position: absolute; inset: 8%; width: 84%; height: 84%; opacity: 0; transition: opacity .2s .1s; }
.mem.up { background: #fff8e6; transform: rotateY(180deg); } .mem.up::after { display: none; } .mem.up img { opacity: 1; transform: rotateY(180deg); }
.mem.matched { background: #e2f8ea; }
.score { display: flex; gap: 12px; flex-wrap: wrap; font: 600 1.1rem var(--head); margin-bottom: 12px; }
.score span { background: var(--bg); padding: 6px 14px; border-radius: 999px; }
.quiz-q { font: 700 clamp(2.4rem, 8vw, 4rem) var(--head); text-align: center; margin: 10px 0 20px; }
.quiz-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quiz-opts button { font: 700 clamp(1.5rem, 5vw, 2.2rem) var(--head); border: 0; border-radius: 20px; padding: 16px; cursor: pointer; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.15); }
.quiz-opts button:nth-child(1) { background: var(--coral); } .quiz-opts button:nth-child(2) { background: var(--sky); } .quiz-opts button:nth-child(3) { background: var(--leaf); } .quiz-opts button:nth-child(4) { background: var(--orange); }
.quiz-opts button.good { outline: 5px solid #ffd84d; } .quiz-opts button.bad { opacity: .35; }
/* Geography games */
.geo-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font: 600 1rem var(--head); }
.geo-controls select { font: inherit; padding: 6px 10px; border-radius: 12px; border: 2px solid #e2e8f0; background: #fff; }
.geo-q { font: 700 clamp(1.3rem, 4.2vw, 2rem) var(--head); text-align: center; margin: 8px 0 14px; }
.geo-best { font-size: 1.1rem; color: var(--muted); margin-top: 6px; }
.geo-flag svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 14px; }
.geo-badge { width: 120px; margin: 0 auto 14px; text-align: center; font: 700 2.6rem var(--head); color: var(--orange-d); background: #fff7ed; border: 3px solid #fdba74; border-radius: 18px; }
.geo-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.geo-opts button { font: 700 clamp(1rem, 3.4vw, 1.45rem) var(--head); border: 0; border-radius: 18px; padding: 14px 10px; min-height: 64px; cursor: pointer; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.15); }
.geo-opts button:nth-child(1) { background: var(--coral-d); } .geo-opts button:nth-child(2) { background: var(--sky-d); } .geo-opts button:nth-child(3) { background: var(--leaf-d); } .geo-opts button:nth-child(4) { background: var(--grape-d); }
.geo-opts button.good { outline: 5px solid #ffd84d; transform: scale(1.03); } .geo-opts button.bad { opacity: .35; } .geo-opts button:disabled { cursor: default; }
.geo-prompt { font: 700 clamp(1.2rem, 4vw, 1.9rem) var(--head); text-align: center; margin: 6px 0 12px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.geo-prompt small { font-size: .9rem; color: var(--muted); } .geo-hint { color: var(--orange-d); }
.mini-flag { width: 58px; height: 40px; }
.map-stage svg { display: block; width: 100%; height: auto; background: #e0f2fe; border-radius: 18px; touch-action: manipulation; }
.map-stage path { fill: #fff; stroke: #334155; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill .2s; }
.map-stage path.t { cursor: pointer; } .map-stage path.t:hover { fill: #fef3c7; }
.map-stage path.found { fill: #86efac; } .map-stage path.miss { fill: #fca5a5; } .map-stage path.hint { fill: #fde047; animation: geo-pulse .6s ease-in-out 3; }
.geo-type { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.geo-type input { font: 600 clamp(1.1rem, 4vw, 1.5rem) var(--head); padding: 12px 16px; border: 3px solid #e2e8f0; border-radius: 16px; min-width: 0; flex: 1 1 220px; max-width: 420px; }
.geo-type input.good { border-color: var(--leaf-d); background: #ecfdf5; } .geo-type input.bad { border-color: var(--coral-d); background: #fef2f2; }
.geo-type button { font: 700 1.2rem var(--head); border: 0; border-radius: 16px; padding: 12px 22px; background: var(--leaf-d); color: #fff; cursor: pointer; }
.geo-reveal { grid-column: 1 / -1; text-align: center; font: 600 1.2rem var(--head); color: var(--coral-d); margin: 6px 0 0; }
.mem .mem-name { position: absolute; inset: 6%; opacity: 0; transition: opacity .2s .1s; display: flex; align-items: center; justify-content: center; padding: 2px; color: var(--ink, #1f2937); font: 700 clamp(.8rem, 3vw, 1.25rem) var(--head); text-align: center; line-height: 1.15; }
.mem.up .mem-name { opacity: 1; transform: rotateY(180deg); }
.compare-stage svg { display: block; width: 100%; height: auto; background: #e0f2fe; border-radius: 18px; }
.compare-stage path { stroke: #1e293b; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.compare-stage path.a { fill: rgba(59, 130, 246, .55); } .compare-stage path.b { fill: rgba(249, 115, 22, .6); }
.ka, .kb { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin: 0 4px 0 10px; } .ka { background: #3b82f6; } .kb { background: #f97316; }
.compare-result { font: 600 clamp(1.05rem, 3.4vw, 1.35rem) var(--head); text-align: center; margin: 14px 0; }
.compare-key { font: 500 .95rem var(--body, inherit); color: var(--muted); margin-top: 6px; }
@keyframes geo-pulse { 50% { fill: #fb923c; } }
@media (prefers-reduced-motion: reduce) { .map-stage path.hint { animation: none; } }
.letters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.letters button, .slots span { width: 54px; height: 60px; border-radius: 14px; font: 700 1.8rem var(--head); display: grid; place-items: center; }
.letters button { border: 0; background: var(--sun); cursor: pointer; box-shadow: 0 4px 0 #cc9300; }
.letters button:disabled { opacity: .25; }
.slots { display: flex; gap: 8px; justify-content: center; }
.slots span { background: var(--bg); border: 3px dashed #d9ccb2; }
.slots span.filled { border-style: solid; border-color: var(--leaf); background: var(--leaf-bg); }

/* Drawing pad */
.pad-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pad-stage { position: relative; background: #fff; border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; touch-action: none; aspect-ratio: 4 / 3; }
.pad-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.pad-stage .trace { position: absolute; inset: 6%; width: 88%; height: 88%; opacity: .22; pointer-events: none; object-fit: contain; }
.sizes { display: flex; gap: 6px; align-items: center; }
.sizes button { border: 0; background: var(--bg); border-radius: 50%; width: 40px; height: 40px; cursor: pointer; display: grid; place-items: center; }
.sizes button[aria-pressed="true"] { background: var(--ink); }
.sizes button i { display: block; background: var(--ink); border-radius: 50%; }
.sizes button[aria-pressed="true"] i { background: #fff; }

/* ============ Misc ============ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.feature { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature .ic { font-size: 2rem; }
.feature h3 { margin: 8px 0 4px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.age-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.age-card { text-decoration: none; border-radius: 26px; padding: 24px; text-align: center; transition: transform .18s; }
.age-card:hover { transform: translateY(-4px); }
.age-card b { display: block; font: 700 1.6rem var(--head); }
.age-card span { color: var(--muted); font-weight: 700; }
.age-card img { width: 100px; height: 100px; margin: 0 auto 8px; }
@media (max-width: 700px) { .age-band { grid-template-columns: 1fr; } }
.fact-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; background: #1f2544; color: #fff; border-radius: 28px; padding: 22px 26px; }
.fact-strip .big { font-size: 2.6rem; }
.fact-strip p { margin: 0; font: 500 1.2rem/1.4 var(--head); }
.fact-strip small { color: #ffd84d; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
@media (max-width: 600px) { .fact-strip { grid-template-columns: 1fr; text-align: center; } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.search-page .big-search { margin: 20px 0; max-width: none; }
.results-count { color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }

.field { display: block; font: 700 .95rem var(--body); margin-bottom: 14px; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 6px; font: 500 1rem var(--body); padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sky); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-paper .ws.landscape { max-width: 900px; }

.pack-banner { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; text-decoration: none; background: #fff; border-radius: 26px; padding: 18px; box-shadow: var(--shadow); margin: 26px 0; transition: transform .18s; }
.pack-banner:hover { transform: translateY(-3px); }
.pack-banner img { width: 170px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pack-banner b { display: block; font: 600 1.4rem var(--head); } .pack-banner small { display: block; color: var(--muted); margin: 4px 0 12px; font-size: 15px; }
@media (max-width: 560px) { .pack-banner { grid-template-columns: 1fr; } .pack-banner img { margin: 0 auto; } }

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.pick { display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .18s; }
.pick:hover { transform: translateY(-4px); }
.pick small { font: 700 12px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pick img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fbf7ee; border-radius: 16px; padding: 10px; }
.pick b { font: 600 1.1rem/1.3 var(--head); }
.p-j { background: var(--sun-bg); justify-content: center; } .p-j b { font-size: 1.35rem; }

/* ============ Activity packs ============ */
.pack { display: grid; gap: 24px; background: #e9eef5; border-radius: 26px; padding: clamp(10px, 3vw, 30px); }
.pack-page { max-width: 760px; width: 100%; margin: 0 auto; background: #fff; border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.12); overflow: hidden; scroll-margin-top: 130px; }
.pack-page svg { width: 100%; height: auto; }

/* ============ Footer ============ */
.site-footer { background: #1f2544; color: #cfd3ea; padding: 44px 0 24px; border-radius: 40px 40px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px; }
.site-footer h2 { color: #fff; font-size: 1.05rem; }
.site-footer a { display: block; text-decoration: none; padding: 3px 0; color: #cfd3ea; }
.site-footer a:hover { color: #ffd84d; }
.site-footer .logo { color: #fff; margin-bottom: 8px; }
.site-footer p { font-size: 15px; }
.copy a { display: inline; color: #cfd3ea; }
.copy { font-size: 13px; color: #8d93b6; border-top: 1px solid #343b62; padding-top: 18px; margin-top: 22px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ============ Print ============ */
@media print {
  @page { margin: 0.35in; }
  body { background: #fff; }
  main > h1, main > .lead, .site-header, .site-footer, .no-print, .crumbs, .item-side, .toolbar, .block, .reader, .page-hero, .skip { display: none !important; }
  main, .wrap { width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .item { display: block; }
  .paper, .sheet-paper, .sheet-paper .ws { box-shadow: none !important; padding: 0 !important; background: #fff !important; border-radius: 0 !important; max-width: none !important; }
  .print-area svg { width: 100%; height: auto; max-height: 9.6in; }
  .pack { display: block; background: none; padding: 0; }
  .pack-page { box-shadow: none; border-radius: 0; max-width: none; break-after: page; page-break-after: always; }
  .pack-page svg { width: auto; height: 9.9in; max-height: none; margin: 0 auto; }
  .pack-page:last-child { break-after: auto; page-break-after: auto; }
  .print-brand { display: block !important; position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font: 500 10pt var(--head); color: #64748b; }
  .print-brand span { color: #f25f5c; }
  .print-title { display: block !important; text-align: center; font: 600 22pt var(--head); margin-bottom: 10pt; }
  .story-cover { background: none; padding: 0; }
  .story-text { font-size: 14pt; }
  .story-pic { box-shadow: none; transform: none; max-width: 3.2in; break-inside: avoid; }
  .story-pic figcaption { display: none; }
  /* How-to-draw lessons: a clean 3-across grid of steps that fills the page */
  .steps { grid-template-columns: repeat(3, 1fr) !important; gap: 10pt !important; }
  .step { box-shadow: none !important; border: 1.5pt solid #cbd5e1; border-radius: 10pt; padding: 6pt !important; break-inside: avoid; background: #fff !important; }
  .step svg, .step img { width: 100%; height: auto; max-height: 2.4in; }
  .step p { font-size: 9.5pt; }
}
.print-title { display: none; }
.print-brand { display: none; }

/* Accessible contrast: buttons, active tabs and links use the darker shades */
.btn.primary, .big-search button { background: var(--coral-d); } .btn.primary { box-shadow: 0 4px 0 #8f2b2b; }
.btn.blue { background: var(--sky-d); box-shadow: 0 4px 0 #154d7c; }
.btn.green { background: var(--leaf-d); box-shadow: 0 4px 0 #0c5a33; }
.btn.purple { background: var(--grape-d); box-shadow: 0 4px 0 #4f2fa3; }
.nav-coloring.active { background: var(--coral-d); } .nav-worksheets.active { background: var(--sky-d); } .nav-stories.active { background: var(--grape-d); }
.nav-draw.active { background: var(--leaf-d); } .nav-printables.active { background: var(--teal-d); } .nav-make.active { background: var(--pink-d); } .nav-games.active { background: var(--orange-d); }
.more, .joke-link .more { color: var(--sky-d); }
.story-pic figcaption a, .q-list details summary, .vocab b { color: var(--grape-d); }
.done-banner { color: var(--leaf-d); }
.site-header .search:focus-within { outline: 3px solid var(--sky-d); outline-offset: 2px; }
