/*! (c) 2026 taproute.io. All rights reserved. Doodle Checkers is proprietary: no licence to copy, host, modify or reuse. https://doodlecheckers.com/terms.html */
/* Doodle Checkers site: the shared stylesheet for the interactive pages (themes, learn, puzzles, intent pages, upgraded guides).
   It speaks the landing page's language (landing.html: notebook paper, marker type, chunky ink edges, hard shadows, tape, stickers, the monster and the robot)
   and copies its tokens, never imports it. Mobile first (390 px), then 700, 1000 and 1200.
   Everything is plain classes with an s- prefix; the page markup states the layout, site.js only adds behaviour through data-* hooks (see docs/SEO_ARCHITECTURE.md).
   Pages must read fully without script: boards are static markup, solutions sit in <details>. Fonts (Permanent Marker, Patrick Hand) come from the build's fonts.css.
   Each game has its own colour (--g, --g-soft), set from <body data-game> or a tile's data-g. */
:root { --ink: #2a2438; --ink2: #4e4868; --muted: #4f4866; --yellow: #ffd23f; --lilac: #b07cff; --mon: #ffae42; --bot: #2a6fc9; --pink: #ff8fb1; --sky: #8fd3ff;
  --paper: #fffbea; --card: #fff; --link: #5a2fbf; --good: #8be28b; --bad: #ff8a7a; --band: #e9f6ff;
  --ui: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --marker: 'Permanent Marker', 'Comic Sans MS', cursive; --hand: 'Patrick Hand', ui-rounded, system-ui, sans-serif;
  --pop: cubic-bezier(.3,1.5,.5,1); --edge: 3px solid var(--ink2); --shadow: 5px 5px 0 var(--ink2); --shadow-s: 3px 3px 0 var(--ink2);
  --g: #8b6cff; --g-soft: #efe6ff; --g-ink: #fff;
  /* a board's colours: a page or a world overrides these (or sets --board-img) */
  --sq-light: #efe6ff; --sq-dark: #6a4fc0; }
/* one colour per game: the page (body) or a tile (data-g) */
[data-game=checkers], [data-g=checkers] { --g: #8b6cff; --g-soft: #efe6ff; }
[data-game=chess], [data-g=chess] { --g: #22a594; --g-soft: #dcf5f0; }
[data-game=fox], [data-g=fox] { --g: #4fae4c; --g-soft: #e2f5dc; }
[data-game=breakthrough], [data-g=breakthrough] { --g: #f2792b; --g-soft: #ffe8d6; }
[data-game=loa], [data-g=loa] { --g: #2f8df0; --g-soft: #ddeeff; }
[data-game=giveaway], [data-g=giveaway] { --g: #ee5d97; --g-soft: #ffe2ee; }
[data-game=arimaa], [data-g=arimaa] { --g: #d99a1c; --g-soft: #fff0c9; --g-ink: #2a2438; }
[data-game=crazy], [data-g=crazy] { --g: #ff5d73; --g-soft: #ffe1e5; }
[data-game=ladders], [data-g=ladders] { --g: #39b86b; --g-soft: #ddf6e6; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 600 18px/1.55 var(--ui); overflow-x: hidden; background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(90,150,220,.2) 31px 32px); }
@media (min-width: 700px) { body { background-image: linear-gradient(90deg, transparent 58px, rgba(230,80,80,.28) 58px 60px, transparent 60px), repeating-linear-gradient(0deg, transparent 0 31px, rgba(90,150,220,.2) 31px 32px); } }
/* paper grain over everything, like the landing */
body::before { content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .05;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
img, picture, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: .15em; }
:focus-visible { outline: 3px dashed var(--lilac); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; border: 0; }
.s-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.s-ic { display: block; flex: none; }
.s-skip { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 10px 16px; border: var(--edge); border-radius: 12px; background: var(--yellow); color: var(--ink); font: 400 18px/1 var(--marker); }
.s-skip:focus { top: max(8px, env(safe-area-inset-top)); }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.s-main { display: block; padding-bottom: 8px; }
.s-section { padding-top: 56px; padding-bottom: 8px; }
@media (min-width: 700px) { .s-section { padding-top: 80px; } }
h1, h2, h3 { text-wrap: balance; }
h2, .s-h2 { position: relative; margin: 0 0 14px; font: 400 clamp(30px, 7.4vw, 48px)/1.06 var(--marker); transform: rotate(-1.2deg); text-shadow: 3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff; }
/* a scribbled underline in the game's colour */
h2::after, .s-h2::after { content: ''; display: block; width: min(220px, 60%); height: 12px; margin-top: 4px;
  background: var(--g); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 12'%3E%3Cpath d='M3 8C40 2 70 10 110 6s70-5 107 1' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 12'%3E%3Cpath d='M3 8C40 2 70 10 110 6s70-5 107 1' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }
.s-center h2::after, h2.s-center::after, .s-faq-h::after { margin-left: auto; margin-right: auto; }
.s-footer h2::after, .s-learn-tile h3::after { display: none; }
h3, .s-h3 { margin: 0 0 6px; font: 400 clamp(22px, 5.2vw, 28px)/1.15 var(--marker); }
.s-center { text-align: center; }
p { margin: 0 0 14px; }
.s-lede { margin: 0 0 22px; max-width: 34em; color: var(--muted); font: 400 23px/1.3 var(--hand); }
.s-center .s-lede, .s-lede.s-center { margin-left: auto; margin-right: auto; }
.hl { padding: 0 .12em; background: linear-gradient(100deg, transparent .2em, rgba(255,210,63,.85) .35em, rgba(255,210,63,.7) calc(100% - .3em), transparent) 0 62% / 100% 58% no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- paper pieces: card, tape, sticker, torn band ---------- */
.s-card { position: relative; padding: 18px; background: var(--card); border: var(--edge); border-radius: 22px; box-shadow: var(--shadow); }
.s-tape { position: absolute; z-index: 3; top: -13px; left: 50%; width: 96px; height: 26px; transform: translateX(-50%) rotate(-5deg); pointer-events: none;
  background: rgba(255,210,63,.75); border-left: 2px dashed rgba(42,36,56,.12); border-right: 2px dashed rgba(42,36,56,.12); }
.s-sticker { display: inline-block; padding: 4px 12px; border: var(--edge); border-radius: 12px; background: var(--yellow); box-shadow: var(--shadow-s); font: 400 18px/1.2 var(--marker); transform: rotate(-3deg); }
.s-sticker--lilac { background: var(--lilac); } .s-sticker--blue { background: #bfe3ff; } .s-sticker--green { background: var(--good); }
.s-stickers { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.s-stk { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border: 2.5px solid var(--ink2); border-radius: 999px; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink2);
  font: 400 16px/1.1 var(--marker); color: var(--ink); transform: rotate(-2deg); }
.s-stk--1 { background: var(--g-soft); transform: rotate(1.5deg); } .s-stk--2 { background: #dff6df; transform: rotate(-1deg); } .s-stk--3 { background: #ffe3ea; transform: rotate(2deg); }
.s-band { position: relative; margin-top: 56px; padding-top: 60px; padding-bottom: 54px; background: var(--band);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 14L7 4l7 8 7-11 7 13z'/%3E%3C/svg%3E") top left / 28px 14px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 0L7 10l7-8 7 11 7-13z'/%3E%3C/svg%3E") bottom left / 28px 14px repeat-x,
    linear-gradient(#000 0 0) center / 100% calc(100% - 26px) no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 14L7 4l7 8 7-11 7 13z'/%3E%3C/svg%3E") top left / 28px 14px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 0L7 10l7-8 7 11 7-13z'/%3E%3C/svg%3E") bottom left / 28px 14px repeat-x,
    linear-gradient(#000 0 0) center / 100% calc(100% - 26px) no-repeat; }
.s-band--yellow { --band: #fff0b8; } .s-band--lilac { --band: #ece0ff; } .s-band--green { --band: #dff6df; } .s-band--pink { --band: #ffe3ea; } .s-band--game { --band: var(--g-soft); }
.s-band > .wrap { position: relative; }
.s-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .s-grid--2, .s-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .s-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.s-prose { max-width: 40em; } .s-prose h2 { margin-top: 0; } .s-prose ul, .s-prose ol { padding-left: 1.3em; } .s-prose li { margin-bottom: 8px; }
.s-prose li::marker { color: var(--g); font-weight: 900; }
.s-callout { position: relative; margin: 20px 0; padding: 14px 18px 14px 56px; border: 2.5px dashed var(--ink2); border-radius: 18px; background: #fff7cf; font: 400 21px/1.3 var(--hand); }
.s-callout::before { content: '!'; position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 32px; height: 32px; border: 2.5px solid var(--ink2); border-radius: 50%; background: var(--yellow); font: 400 20px/1 var(--marker); transform: rotate(-8deg); }
.s-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: var(--edge); border-radius: 16px; overflow: hidden; font-size: 16px; box-shadow: var(--shadow-s); }
.s-table th, .s-table td { padding: 10px 12px; border-bottom: 1.5px solid rgba(78,72,104,.2); text-align: left; vertical-align: top; } .s-table th { background: var(--g-soft); font: 400 18px/1.2 var(--marker); }
.s-table tr:last-child td { border-bottom: 0; } .s-table tbody tr:nth-child(even) td { background: #fffdf3; }
.s-steps { counter-reset: st; margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.s-steps > li { counter-increment: st; position: relative; padding: 14px 16px 14px 62px; background: #fff; border: var(--edge); border-radius: 18px; box-shadow: var(--shadow-s); }
.s-steps > li::before { content: counter(st); position: absolute; left: 12px; top: 10px; display: grid; place-items: center; width: 38px; height: 38px; border: var(--edge); border-radius: 50%; background: var(--yellow); font: 400 21px/1 var(--marker); transform: rotate(-6deg); }
.s-steps > li:nth-child(4n+2)::before { background: var(--g-soft); } .s-steps > li:nth-child(4n+3)::before { background: #dff6df; } .s-steps > li:nth-child(4n)::before { background: #ffe3ea; }

/* ---------- the cast: a character with a speech bubble ---------- */
.s-mon, .s-bot { display: block; overflow: visible; }
.s-coach { display: flex; align-items: flex-end; gap: 10px; margin: 14px 0 10px; }
.s-coach__who { flex: none; width: 62px; transform-origin: 50% 100%; animation: s-idle 3.2s ease-in-out infinite; }
.s-coach--bot .s-coach__who { animation-delay: -1.6s; }
.s-bubble { position: relative; flex: 1; min-width: 0; margin-bottom: 14px; padding: 12px 16px; background: #fff; border: var(--edge); border-radius: 20px 20px 20px 6px; box-shadow: var(--shadow-s); font: 400 22px/1.28 var(--hand); color: var(--ink); }
.s-bubble::before { content: ''; position: absolute; left: -13px; bottom: 8px; width: 18px; height: 16px; background: #fff; border-left: var(--edge); border-bottom: var(--edge); transform: skewY(-28deg); border-radius: 0 0 0 4px; }
.s-bubble p { margin: 0; }

/* ---------- header, breadcrumb ---------- */
.s-top { position: relative; z-index: 20; background: #fff; border-bottom: var(--edge); box-shadow: 0 4px 0 rgba(78,72,104,.18); }
.s-top__in { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
.s-brand { display: inline-flex; align-items: center; min-height: 48px; color: var(--ink); text-decoration: none; }
.s-logo { display: block; width: 112px; }
@media (min-width: 700px) { .s-logo { width: 158px; } }
.s-logo__mark { position: relative; display: block; width: 100%; aspect-ratio: 3 / 1; }
.s-logo__mark svg { position: absolute; display: block; overflow: visible; }
.s-logo__letters { inset: 0; width: 100%; height: 100%; }
.s-logo__mon { left: 18.2%; top: 18.46%; width: 20.51%; height: 73.08%; transform-origin: 50% 88%; animation: s-idle 2.8s ease-in-out infinite; }
.s-logo__bot { left: 36.67%; top: 13.08%; width: 22.05%; height: 76.92%; transform-origin: 50% 90%; animation: s-idle 2.8s ease-in-out -1.4s infinite; }
.s-logo__word { display: block; width: 86%; margin: -1% auto 0; overflow: visible; }
.s-brand:hover .s-logo__mon, .s-brand:hover .s-logo__bot { animation: s-hop .5s ease-in-out; }
.s-nav { flex: 1 1 auto; min-width: 0; }
.s-nav ul { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 4px 2px 6px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.s-nav ul::-webkit-scrollbar { display: none; }
.s-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 4px 14px 4px 6px; border: 2.5px solid var(--ink2); border-radius: 999px; background: #fff; color: var(--ink);
  box-shadow: 2px 3px 0 var(--ink2); font: 400 18px/1 var(--marker); text-decoration: none; white-space: nowrap; transition: transform .15s var(--pop), background-color .2s; }
.s-pill .s-ic { width: 32px; height: 32px; padding: 3px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink2); }
.s-pill:hover { transform: translateY(-2px) rotate(-2deg); }
.s-pill:active { transform: translate(1px, 2px); box-shadow: 0 1px 0 var(--ink2); }
.s-pill--learn[aria-current], .s-pill--learn:hover { background: #e7dcff; } .s-pill--puzzles[aria-current], .s-pill--puzzles:hover { background: #fff0b0; }
.s-pill--themes[aria-current], .s-pill--themes:hover { background: #ffdce6; } .s-pill--guides[aria-current], .s-pill--guides:hover { background: #d9f5d6; }
.s-pill[aria-current] { transform: rotate(-2deg); }
@media (max-width: 699px) {
  .s-top__in { padding-bottom: 4px; }
  .s-nav { flex-basis: 100%; margin: 0 -18px; } .s-nav ul { justify-content: flex-start; padding-left: 18px; padding-right: 18px; }
  .s-pill { font-size: 17px; min-height: 44px; padding-right: 12px; } .s-pill .s-ic { width: 28px; height: 28px; }
}
.s-crumbs { padding-top: 10px; font-size: 15px; } .s-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.s-crumbs li + li::before { content: '\203A'; margin-right: 6px; font-weight: 800; } .s-crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink2); }

/* ---------- call to action ---------- */
.s-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 8px 26px; border: var(--edge); border-radius: 16px; background: var(--good); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink2); font: 400 clamp(20px, 5.4vw, 25px)/1.1 var(--marker); text-decoration: none; text-align: center; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.s-cta:hover { transform: translate(-1px,-3px) rotate(-1.5deg); box-shadow: 5px 7px 0 var(--ink2); }
.s-cta:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink2); }
.s-cta--yellow { background: var(--yellow); } .s-cta--lilac { background: var(--lilac); }
.s-cta--ghost { background: #fff; font-size: 20px; min-height: 52px; }
.s-cta[disabled], .s-cta[aria-disabled=true] { opacity: .55; pointer-events: none; }
.s-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; }
.s-center .s-cta-row, .s-cta-row.s-center { justify-content: center; }
.s-cta-note { margin: 10px 0 0; color: var(--muted); font: 400 19px/1.25 var(--hand); }
.s-badge { display: inline-block; padding: 8px; border-radius: 14px; } .s-badge img { display: block; height: 56px; width: auto; }
.s-sticky { display: none; }
@media (max-width: 899px) {
  .s-sticky { position: fixed; z-index: 45; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; min-height: 52px; padding: 8px 22px;
    border: var(--edge); border-radius: 999px; background: var(--yellow); box-shadow: var(--shadow-s); color: var(--ink); font: 400 20px/1 var(--marker); text-decoration: none; animation: s-wiggle 5s ease-in-out 3s infinite; }
}

/* ---------- hero variants: .s-hero plus one of --split (text and art), --center (stacked, centred), --world (full-bleed themed), --learn (lesson), --puzzle ---------- */
.s-hero { position: relative; display: grid; gap: 22px; padding-top: 26px; padding-bottom: 8px; align-items: center; }
.s-hero h1, .s-h1 { margin: 0 0 12px; font: 400 clamp(38px, 10vw, 66px)/1 var(--marker); letter-spacing: -.01em; transform: rotate(-1.5deg); transform-origin: 0 50%; }
.s-hero h1 .hl { white-space: normal; }
.s-hero__text { min-width: 0; } .s-hero__art { position: relative; min-width: 0; justify-self: center; width: 100%; max-width: 460px; }
.s-hero__art img, .s-hero__art picture { display: block; width: 100%; height: auto; }
.s-hero--center { justify-items: center; text-align: center; } .s-hero--center h1 { transform-origin: 50% 50%; } .s-hero--center .s-lede { margin-left: auto; margin-right: auto; } .s-hero--center .s-cta-row, .s-hero--center .s-stickers { justify-content: center; }
@media (min-width: 900px) {
  .s-hero--split { grid-template-columns: 1.05fr .95fr; column-gap: 48px; padding-top: 48px; }
  .s-hero--split.s-hero--flip .s-hero__art { order: -1; }
}
.s-hero--world { position: relative; padding: 24px 0 28px; color: var(--w-ink, var(--ink)); background: var(--w-bg, var(--band)); border-bottom: var(--edge); }
.s-hero--world > .wrap { display: grid; gap: 16px; align-items: center; }
@media (min-width: 900px) { .s-hero--world > .wrap { grid-template-columns: 1fr 1fr; column-gap: 40px; } }
.s-hero--learn h1 { font-size: clamp(36px, 9vw, 58px); }
@media (min-width: 900px) { .s-hero--learn { grid-template-columns: 1.1fr .9fr; column-gap: 44px; } }
.s-hero--puzzle { justify-items: center; text-align: center; } .s-hero--puzzle h1 { font-size: clamp(34px, 9vw, 56px); }
.s-meta { margin: 0 0 12px; color: var(--muted); font: 400 18px/1.2 var(--hand); }
/* the cast standing on the hero art: the monster on the left corner, the robot on the right */
.s-cast { position: absolute; z-index: 6; pointer-events: none; }
.s-cast--mon { left: -14px; bottom: -22px; width: clamp(70px, 19vw, 108px); transform: rotate(-8deg); }
.s-cast--bot { right: -10px; top: -46px; width: clamp(64px, 17vw, 96px); transform: rotate(7deg); }
.s-cast svg { width: 100%; height: auto; animation: s-idle 3s ease-in-out infinite; transform-origin: 50% 100%; }
.s-cast--bot svg { animation-delay: -1.5s; }
.s-hero__art .s-bframe { transform: rotate(1.5deg); }
.s-hero__art .s-tape { top: -12px; }

/* ---------- the board: 8x8, drawn by CSS (works without script). Pieces sit on top at --x/--y (column, row; row 0 is the top).
   Themes: set --sq-light/--sq-dark, or --board-img (a pre-rendered board picture) on the .s-board or any parent.
   .s-bframe is the chunky frame around it in the game's colour, with the square names (a-h along the bottom, 8-1 up the side). ---------- */
.s-bframe { position: relative; width: 100%; max-width: 520px; margin: 0 auto; padding: 10px 10px 30px 30px; background: var(--g); border: var(--edge); border-radius: 20px; box-shadow: var(--shadow);
  background-image: radial-gradient(rgba(255,255,255,.18) 1.5px, transparent 2px); background-size: 14px 14px; }
.s-bframe--sm { max-width: 340px; padding: 8px; border-radius: 16px; box-shadow: var(--shadow-s); }
.s-files, .s-ranks { position: absolute; display: grid; pointer-events: none; color: var(--g-ink); font: 400 15px/1 var(--marker); text-shadow: 0 1px 0 rgba(42,36,56,.45); }
.s-files { left: 30px; right: 10px; bottom: 6px; grid-template-columns: repeat(8, 1fr); text-align: center; }
.s-ranks { left: 0; top: 10px; bottom: 30px; width: 30px; grid-template-rows: repeat(8, 1fr); align-items: center; text-align: center; }
.s-files i, .s-ranks i { font-style: normal; }
.s-board { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; margin: 0 auto; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; touch-action: manipulation;
  background: var(--board-img, none) center / 100% 100% no-repeat, repeating-conic-gradient(var(--sq-dark) 0 25%, var(--sq-light) 0 50%) 0 0 / 25% 25%; transition: background-color .4s; }
.s-bframe .s-board { max-width: none; }
.s-board--img { background: var(--board-img) center / 100% 100% no-repeat; }
.s-board--sm { max-width: 320px; }
.s-board__grid, .s-board__layer { position: absolute; inset: 0; }
.s-board__layer { pointer-events: none; }
.s-sq { position: absolute; left: calc(var(--x) * 12.5%); top: calc(var(--y) * 12.5%); width: 12.5%; height: 12.5%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
button.s-sq { cursor: pointer; -webkit-tap-highlight-color: transparent; } button.s-sq:focus-visible { outline: 3px dashed var(--yellow); outline-offset: -3px; z-index: 5; }
.s-sq.is-from::before, .s-sq.is-to::before, .s-sq.is-cap::before, .s-sq.is-sel::before, .s-sq.is-hint::before, .s-sq.is-right::before, .s-sq.is-wrong::before { content: ''; position: absolute; inset: 0; border-radius: 6px; }
.s-sq.is-from::before { background: rgba(255,210,63,.6); } .s-sq.is-to::before { background: rgba(139,226,139,.75); box-shadow: inset 0 0 0 3px rgba(42,36,56,.55); }
.s-sq.is-sel::before { background: rgba(255,210,63,.75); box-shadow: inset 0 0 0 3px var(--ink); }
.s-sq.is-hint::after { content: ''; position: absolute; left: 32%; top: 32%; width: 36%; height: 36%; border-radius: 50%; background: rgba(255,210,63,.95); border: 2.5px solid var(--ink); animation: s-pulse 1s ease-in-out infinite; }
.s-sq.is-cap::before { background: rgba(255,93,115,.55); } .s-sq.is-right::before { background: rgba(139,226,139,.85); } .s-sq.is-wrong::before { background: rgba(255,93,115,.7); }
.s-pc { position: absolute; left: calc(var(--x) * 12.5%); top: calc(var(--y) * 12.5%); width: 12.5%; height: 12.5%; z-index: 2; transition: left .45s ease-in-out, top .45s ease-in-out, opacity .3s, transform .3s; }
.s-pc img { position: absolute; z-index: 1; left: -18%; right: -18%; bottom: 2%; height: 122%; width: auto; max-width: 136%; margin: 0 auto; transform-origin: 50% 100%; filter: drop-shadow(0 2px 0 rgba(42,36,56,.35)); }
/* no art for a team: a drawn disc, white and black like the game's own plain pieces (a king wears a crown mark) */
.s-pc--w, .s-pc--b { --disc: #fff; --rim: var(--ink2); }
.s-pc--w { --disc: var(--mon); } .s-pc--b { --disc: var(--bot); }
.s-pc:not(:has(img))::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; border: 2.5px solid var(--ink); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.6) 0 18%, transparent 19%), var(--disc); box-shadow: 0 3px 0 rgba(42,36,56,.55); }
.s-pc--k:not(:has(img))::after { content: '\265B'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 clamp(12px, 3.6vw, 24px)/1 var(--ui); text-shadow: 0 0 2px var(--ink), 1px 1px 0 var(--ink); }
.s-pc--k:has(img)::after { content: ''; position: absolute; z-index: 2; left: 50%; top: -6%; width: 34%; height: 24%; margin-left: -17%; background: var(--yellow); border: 2px solid var(--ink); clip-path: polygon(0 100%, 0 20%, 25% 60%, 50% 0, 75% 60%, 100% 20%, 100% 100%); }
.s-pc.is-gone { opacity: 0; transform: scale(.3) rotate(25deg); }
.s-pc.is-lift { z-index: 4; transform: translateY(-10%) scale(1.1); }
.s-pc.is-hop img { animation: s-hop .5s ease-in-out; }
.s-board-wrap { position: relative; width: 100%; max-width: 520px; margin: 0 auto; }
.s-board-caption { margin: 12px 0 0; text-align: center; color: var(--muted); font: 400 20px/1.25 var(--hand); }
.s-coords { display: none; }

/* ---------- rules stepper: a board, the coach saying the step, Restart / Back / Play / Next ---------- */
.s-stepper { position: relative; padding: 26px 16px 16px; background: #fff; border: var(--edge); border-radius: 24px; box-shadow: var(--shadow); }
.s-stepper__title { position: absolute; z-index: 4; left: 16px; top: -20px; max-width: calc(100% - 32px); margin: 0; padding: 6px 14px; border: var(--edge); border-radius: 12px; background: var(--g); color: var(--g-ink);
  box-shadow: var(--shadow-s); font: 400 clamp(18px, 4.6vw, 22px)/1.1 var(--marker); transform: rotate(-2deg); }
.s-stepper > .s-bframe { margin-top: 10px; }
.s-stepper__say { min-height: 4.2em; margin: 0; font: 400 22px/1.28 var(--hand); }
.s-stepper.is-playing .s-coach__who { animation: s-bounce .6s ease-in-out infinite; }
.s-stepper__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.s-stepper__count { min-width: 4.5em; text-align: center; color: var(--muted); font: 400 20px/1 var(--hand); }
.s-stepper__bar { height: 12px; margin: 14px 4px 0; border: 2.5px solid var(--ink2); border-radius: 99px; background: #fff; overflow: hidden; }
.s-stepper__bar > i { display: block; height: 100%; width: var(--p, 0%); background: repeating-linear-gradient(-45deg, var(--g) 0 8px, color-mix(in srgb, var(--g) 70%, #fff) 8px 16px); transition: width .3s; }
.s-ctl { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 52px; min-height: 52px; padding: 6px 18px; border: var(--edge); border-radius: 16px; background: var(--yellow); color: var(--ink);
  box-shadow: var(--shadow-s); font: 400 21px/1 var(--marker); cursor: pointer; transition: transform .08s, box-shadow .08s; }
.s-ctl:hover { transform: translateY(-2px) rotate(-1.5deg); }
.s-ctl:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink2); } .s-ctl:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; } .s-ctl--play { background: var(--good); min-width: 104px; }
.s-ctl--ghost { background: #fff; }
/* no script: the steps are an ordered list of positions in the page; with script they become the stepper */
.s-stepper:not(.is-live) .s-stepper__controls { display: none; }
.s-stepper.is-live .s-steps--text { display: none; }   /* the script shows the steps one at a time; the list is for readers without it */
.s-stepper:not(.is-live) .s-stepper__coach { display: none; }

/* ---------- puzzle panel: the coach reacts, confetti on a solve ---------- */
.s-puzzle { position: relative; padding: 20px 16px 16px; background: #fff; border: var(--edge); border-radius: 24px; box-shadow: var(--shadow); overflow: visible; }
.s-puzzle__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 8px; }
.s-puzzle__title { margin: 0; font: 400 clamp(23px, 5.8vw, 30px)/1.1 var(--marker); }
.s-puzzle__meta { padding: 3px 12px; border: 2.5px solid var(--ink2); border-radius: 999px; background: var(--g-soft); color: var(--ink); font: 400 17px/1.2 var(--marker); transform: rotate(2deg); }
.s-puzzle__meta:empty { display: none; }
.s-puzzle__prompt { margin: 8px 0 14px; font: 400 22px/1.28 var(--hand); }
.s-puzzle__choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.s-choice { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 8px 12px; border: var(--edge); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: var(--shadow-s); font: 400 19px/1.1 var(--marker); cursor: pointer; }
.s-choice[aria-pressed=true] { background: var(--yellow); } .s-choice.is-right { background: var(--good); } .s-choice.is-wrong { background: var(--bad); } .s-choice:disabled { cursor: default; }
.s-puzzle__feedback { min-height: 2.6em; margin: 0; font: 400 22px/1.28 var(--hand); } .s-puzzle__feedback.is-right { color: #17692a; } .s-puzzle__feedback.is-wrong { color: #a3262c; }
.s-puzzle__coach .s-bubble { transition: background-color .3s; }
.s-puzzle:has(.s-puzzle__feedback.is-right) .s-puzzle__coach .s-bubble, .s-puzzle:has(.s-puzzle__feedback.is-right) .s-puzzle__coach .s-bubble::before { background: #e4fbe2; }
.s-puzzle:has(.s-puzzle__feedback.is-right) .s-coach__who { animation: s-cheer .7s var(--pop) 2; }
.s-puzzle:has(.s-puzzle__feedback.is-wrong) .s-coach__who { animation: s-shake .45s ease-in-out; }
.s-puzzle__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.s-solution { margin: 16px 0 0; padding: 8px 16px; background: #fff7cf; border: 2.5px dashed var(--ink2); border-radius: 16px; } .s-solution summary { min-height: 44px; padding: 8px 0; cursor: pointer; font: 400 20px/1.2 var(--marker); } .s-solution p { margin: 4px 0 10px; }
.s-puzzle:not(.is-live) .s-puzzle__choices, .s-puzzle:not(.is-live) .s-puzzle__actions { display: none; }   /* the coach and its hint stay: they read without script */
/* confetti: ten paper bits that burst from the board when the feedback turns right */
.s-confetti { position: absolute; left: 50%; top: 42%; z-index: 8; width: 0; height: 0; pointer-events: none; }
.s-confetti i { position: absolute; width: 12px; height: 16px; border: 2px solid var(--ink); border-radius: 3px; opacity: 0; }
.s-confetti i:nth-child(5n+1) { background: var(--yellow); } .s-confetti i:nth-child(5n+2) { background: var(--pink); } .s-confetti i:nth-child(5n+3) { background: var(--good); } .s-confetti i:nth-child(5n+4) { background: var(--sky); } .s-confetti i:nth-child(5n) { background: var(--lilac); border-radius: 50%; }
.s-confetti i:nth-child(1) { --dx: -150px; --dy: -170px; --r: 200deg; } .s-confetti i:nth-child(2) { --dx: 160px; --dy: -150px; --r: -160deg; } .s-confetti i:nth-child(3) { --dx: -90px; --dy: -220px; --r: 120deg; }
.s-confetti i:nth-child(4) { --dx: 100px; --dy: -230px; --r: -220deg; } .s-confetti i:nth-child(5) { --dx: -200px; --dy: -60px; --r: 300deg; } .s-confetti i:nth-child(6) { --dx: 210px; --dy: -80px; --r: -280deg; }
.s-confetti i:nth-child(7) { --dx: -40px; --dy: -250px; --r: 90deg; } .s-confetti i:nth-child(8) { --dx: 50px; --dy: -190px; --r: -90deg; } .s-confetti i:nth-child(9) { --dx: -180px; --dy: -200px; --r: 180deg; } .s-confetti i:nth-child(10) { --dx: 180px; --dy: -210px; --r: -180deg; }
.s-puzzle:has(.s-puzzle__feedback.is-right) .s-confetti i { animation: s-burst 1.1s cubic-bezier(.2,.8,.4,1) both; }

/* ---------- world switcher: tabs that swap a themed board picture, a title and a blurb. Every world is also a static <section> for readers and crawlers. ---------- */
.s-worlds { position: relative; }
.s-worlds__tabs { display: flex; gap: 10px; margin: 0 -18px 14px; padding: 6px 18px 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; list-style: none; }
.s-worlds__tabs::-webkit-scrollbar { display: none; }
.s-world-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 6px 16px 6px 8px; border: var(--edge); border-radius: 999px; background: #fff; color: var(--ink);
  box-shadow: var(--shadow-s); font: 400 18px/1 var(--marker); text-decoration: none; cursor: pointer; scroll-snap-align: center; transition: transform .15s var(--pop), background-color .2s; }
.s-world-tab img { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--ink2); }
.s-world-tab:hover { transform: translateY(-2px) rotate(-2deg); }
.s-world-tab[aria-selected=true], .s-world-tab[aria-current=true] { background: var(--yellow); transform: rotate(-2deg) scale(1.05); }
.s-worlds__stage { position: relative; display: grid; gap: 16px; padding: 18px; color: var(--w-ink, var(--ink)); background: var(--w-bg, #fff); border: var(--edge); border-radius: 24px; box-shadow: var(--shadow); transition: background-color .45s, color .45s; }
@media (min-width: 900px) { .s-worlds__stage { grid-template-columns: 1.1fr .9fr; align-items: center; padding: 28px; column-gap: 36px; } }
.s-worlds__img { position: relative; margin: 0; } .s-worlds__img img { display: block; width: 100%; height: auto; border-radius: 16px; border: var(--edge); background: #fff; box-shadow: var(--shadow-s); transform: rotate(-1deg); transition: opacity .3s, transform .35s var(--pop); }
.s-worlds__stage.is-swapping .s-worlds__img img, .s-worlds__stage.is-swapping .s-worlds__copy { opacity: 0; transform: translateY(6px) scale(.98); }
.s-worlds__copy { transition: opacity .3s, transform .3s; } .s-worlds__title { margin: 0 0 8px; font: 400 clamp(30px, 7vw, 44px)/1.05 var(--marker); } .s-worlds__blurb { margin: 0 0 16px; font: 400 22px/1.3 var(--hand); }
.s-world-list { display: grid; gap: 20px; margin: 28px 0 0; padding: 0; list-style: none; }
.s-world { padding: 16px; background: #fff; border: var(--edge); border-radius: 22px; box-shadow: var(--shadow-s); }
.s-world img { display: block; width: 100%; height: auto; border-radius: 14px; margin-bottom: 10px; }
@media (min-width: 700px) { .s-world-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- FAQ (details), related games, footer hub ---------- */
.s-faq { max-width: 800px; margin: 0 auto; }
.s-faq details { margin: 0 0 14px; padding: 6px 18px; background: #fff; border: var(--edge); border-radius: 18px; box-shadow: var(--shadow-s); transition: transform .15s; }
.s-faq details:nth-child(odd) { transform: rotate(-.4deg); } .s-faq details:nth-child(even) { transform: rotate(.4deg); }
.s-faq summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 0; cursor: pointer; list-style: none; font: 400 23px/1.25 var(--hand); }
.s-faq summary::-webkit-details-marker { display: none; }
.s-faq summary::before { content: '?'; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 2.5px solid var(--ink2); border-radius: 50%; background: var(--g-soft); font: 400 20px/1 var(--marker); transition: transform .2s var(--pop); }
.s-faq details[open] summary::before { content: '!'; background: var(--yellow); transform: rotate(-10deg); }
.s-faq details p { margin: 4px 0 14px 46px; color: var(--muted); }
.s-related { margin: 0; padding: 6px 18px 16px; display: grid; grid-auto-flow: column; grid-auto-columns: min(66vw, 240px); gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; list-style: none; scrollbar-width: none; }
.s-related::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .s-related { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; padding-left: 0; padding-right: 0; } }
.s-related a { position: relative; display: grid; align-content: start; justify-items: start; gap: 6px; height: 100%; min-height: 110px; padding: 16px 16px 44px; scroll-snap-align: start; background: #fff; border: var(--edge); border-radius: 20px; box-shadow: var(--shadow-s); color: var(--ink); text-decoration: none; transition: transform .15s var(--pop); }
.s-related li:nth-child(4n+1) a { background: #f1eaff; } .s-related li:nth-child(4n+2) a { background: #fff5cc; } .s-related li:nth-child(4n+3) a { background: #e2f6e0; } .s-related li:nth-child(4n) a { background: #ffe8ee; }
.s-related a::after { content: '\2192'; position: absolute; right: 14px; bottom: 10px; display: grid; place-items: center; width: 32px; height: 32px; border: 2.5px solid var(--ink2); border-radius: 50%; background: #fff; font: 800 18px/1 var(--ui); }
.s-related a:hover { transform: translateY(-4px) rotate(-1.5deg); }
.s-related img { width: 48px; height: 48px; } .s-related b { font: 400 22px/1.1 var(--marker); } .s-related span { color: var(--muted); font-size: 16px; line-height: 1.3; }
.s-footer { position: relative; margin-top: 110px; padding-bottom: max(28px, env(safe-area-inset-bottom)); background: #ece0ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 14L7 4l7 8 7-11 7 13z'/%3E%3C/svg%3E") top left / 28px 14px repeat-x, linear-gradient(#000 0 0) 0 13px / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 14L7 4l7 8 7-11 7 13z'/%3E%3C/svg%3E") top left / 28px 14px repeat-x, linear-gradient(#000 0 0) 0 13px / 100% 100% no-repeat; }
.s-footer__cast { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding: 34px 18px 8px; }
.s-footer__cast svg { width: 78px; height: auto; transform-origin: 50% 100%; animation: s-idle 3s ease-in-out infinite; } .s-footer__bot { animation-delay: -1.5s !important; }
.s-footer__cast .s-bubble { flex: none; margin-bottom: 40px; font-size: 22px; transform: rotate(-2deg); }
.s-footer__grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 18px; }
@media (min-width: 700px) { .s-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .s-footer__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.s-footer h2 { margin: 0 0 6px; font: 400 21px/1.2 var(--marker); transform: none; text-shadow: none; }
.s-footer ul { margin: 0; padding: 0; list-style: none; } .s-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 2px 0; color: var(--ink); font-weight: 700; text-decoration-color: rgba(78,72,104,.35); }
.s-footer a:hover { color: var(--link); }
.s-footer__fine { margin: 22px 0 0; padding-top: 16px; border-top: 2.5px dashed rgba(78,72,104,.3); color: var(--muted); font-size: 15px; }

/* ---------- lessons: on wide screens the words sit beside the board ---------- */
.s-learn-block { max-width: 640px; margin: 22px auto 0; }
@media (min-width: 1000px) {
  .s-section:has(> .s-learn-block) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); column-gap: 56px; align-items: start; }
  .s-section:has(> .s-learn-block) > .s-prose { grid-column: 1; position: sticky; top: 24px; }
  .s-section:has(> .s-learn-block) > .s-learn-block { grid-column: 2; grid-row: 1 / span 3; width: 100%; margin: 26px 0 0; }
  .s-section:has(> .s-learn-block) > .s-prose + .s-learn-block + .s-prose { position: static; grid-column: 1; }
  .s-section:nth-of-type(even):has(> .s-learn-block) { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
  .s-section:nth-of-type(even):has(> .s-learn-block) > .s-prose { grid-column: 2; }
  .s-section:nth-of-type(even):has(> .s-learn-block) > .s-learn-block { grid-column: 1; }
}
.s-learn-try { margin-top: 24px; }
.s-learn-next { display: inline-flex; align-items: center; gap: 10px; margin: 20px 0 0; padding: 10px 18px; background: #fff; border: var(--edge); border-radius: 999px; box-shadow: var(--shadow-s); font: 400 21px/1.3 var(--hand); }
.s-learn-next a { font: 400 21px/1.2 var(--marker); }
.s-learn-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; } .s-learn-list li b { font-weight: 800; } .s-learn-list li span { color: var(--muted); }
.s-learn-fig { margin: 0; } .s-chess { background: #fff; box-shadow: var(--shadow-s); }
.s-learn-key { margin: 12px 0 0; padding-left: 1.2em; } .s-learn-key li { margin-bottom: 6px; }

/* ---------- the learn hub: a board-game trail for the first four lessons, then a colour tile per game ---------- */
.s-learn-path { position: relative; display: grid; gap: 26px; margin: 26px 0 0; padding: 0; list-style: none; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .s-learn-path { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (min-width: 1000px) { .s-learn-path { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; } }
/* the dotted trail behind the stops */
@media (min-width: 1000px) { .s-learn-path::before { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 0; border-top: 5px dashed rgba(78,72,104,.45); z-index: 0; } }
.s-learn-step { position: relative; z-index: 1; }
.s-learn-step:nth-child(odd) { transform: rotate(-1.2deg); } .s-learn-step:nth-child(even) { transform: rotate(1.2deg) translateY(14px); }
.s-learn-step a { position: relative; display: grid; gap: 8px; height: 100%; padding: 18px 16px 18px; background: #fff; border: var(--edge); border-radius: 22px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .18s var(--pop); }
.s-learn-step:nth-child(1) a { background: #f1eaff; } .s-learn-step:nth-child(2) a { background: #fff5cc; } .s-learn-step:nth-child(3) a { background: #e2f6e0; } .s-learn-step:nth-child(4) a { background: #ffe8ee; }
.s-learn-step a:hover { transform: translateY(-6px) rotate(-1.5deg); }
.s-learn-step b { font: 400 24px/1.1 var(--marker); } .s-learn-step span:not(.s-learn-step__n):not(.s-learn-step__go) { color: var(--muted); font-size: 17px; }
.s-learn-step__n { position: absolute; z-index: 3; left: -12px; top: -16px; display: grid; place-items: center; width: 48px; height: 48px; border: var(--edge); border-radius: 50%; background: var(--yellow); box-shadow: var(--shadow-s); font: 400 26px/1 var(--marker); transform: rotate(-8deg); }
.s-learn-step__go { justify-self: start; margin-top: 4px; padding: 6px 14px; border: 2.5px solid var(--ink2); border-radius: 12px; background: var(--good); box-shadow: 2px 2px 0 var(--ink2); font: 400 18px/1 var(--marker); }
.s-learn-step .s-bframe--sm { background: var(--g); }
.s-learn-step__flag { position: absolute; z-index: 4; right: -10px; top: -26px; width: 64px; transform: rotate(10deg); }
.s-learn-tiles { align-items: stretch; }
.s-learn-tile { display: grid; gap: 16px; align-content: start; padding: 0; overflow: hidden; background: #fff; }
.s-learn-tile__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--g); color: var(--g-ink); border-bottom: var(--edge); }
.s-learn-tile__head h3 { margin: 0; color: inherit; text-shadow: 2px 2px 0 rgba(42,36,56,.35); }
.s-learn-tile__count { flex: none; padding: 4px 12px; border: 2.5px solid var(--ink2); border-radius: 999px; background: #fff; color: var(--ink); font: 400 16px/1.2 var(--marker); transform: rotate(3deg); }
.s-learn-tile__body { display: grid; gap: 14px; padding: 0 18px 20px; }
@media (min-width: 560px) { .s-learn-tile__body { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: start; } }
.s-learn-tile__art { width: 100%; max-width: 240px; justify-self: center; }
.s-learn-tile__art .s-bframe--sm { transform: rotate(-2deg); }
.s-learn-tile__art .s-chess { max-width: 220px !important; border-radius: 14px !important; }
.s-learn-tile p { margin: 0 0 12px; }
.s-learn-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.s-learn-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 2.5px solid var(--ink2); border-radius: 14px; background: var(--g-soft); color: var(--ink); box-shadow: 2px 2px 0 var(--ink2);
  font: 700 16px/1.15 var(--ui); text-decoration: none; transition: transform .12s var(--pop); }
.s-learn-links a::after { content: '\2192'; font-weight: 900; }
.s-learn-links a:hover { transform: translateY(-2px) rotate(-1deg); background: var(--yellow); }
.s-learn-links .s-learn-links__guide a { background: #fff; border-style: dashed; }
@media (min-width: 1000px) { .s-learn-tile--wide { grid-column: 1 / -1; } .s-learn-tile--wide .s-learn-tile__body { grid-template-columns: 260px minmax(0, 1fr); } .s-learn-tile--wide .s-learn-tile__art { max-width: 260px; } }
.s-hub-hero { position: relative; }
.s-hub-cast { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin-top: 18px; }
.s-hub-cast svg { width: clamp(84px, 22vw, 130px); height: auto; transform-origin: 50% 100%; animation: s-idle 3s ease-in-out infinite; }
.s-hub-cast .s-bot { animation-delay: -1.5s; }
.s-hub-cast .s-bubble { flex: none; max-width: 260px; margin-bottom: 70px; transform: rotate(-2deg); }
@media (max-width: 599px) { .s-hub-cast { gap: 2px; } .s-hub-cast svg { width: 64px; } .s-hub-cast .s-bubble { flex: 0 1 auto; margin-bottom: 46px; padding: 10px 12px; font-size: 19px; } }   /* phones: the bubble shrinks so both characters stay on screen */

/* ---------- the puzzles page: puzzles side by side on wide screens ---------- */
@media (min-width: 1000px) {
  .s-puzzle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
}

/* ---------- motion ---------- */
@keyframes s-pulse { 0%, 100% { transform: scale(.85) } 50% { transform: scale(1.12) } }
@keyframes s-hop { 0%, 100% { transform: translateY(0) } 40% { transform: translateY(-18%) scale(1.05, .96) } 70% { transform: translateY(0) scale(.96, 1.04) } }
@keyframes s-idle { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-4%) rotate(-3deg) } }
@keyframes s-bounce { 0%, 100% { transform: translateY(0) scale(1, 1) } 35% { transform: translateY(-16%) scale(.96, 1.05) } 70% { transform: translateY(0) scale(1.06, .94) } }
@keyframes s-cheer { 0% { transform: translateY(0) } 40% { transform: translateY(-30%) rotate(-10deg) scale(1.1) } 100% { transform: translateY(0) } }
@keyframes s-shake { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-8%) rotate(-6deg) } 75% { transform: translateX(8%) rotate(6deg) } }
@keyframes s-wiggle { 0%, 90%, 100% { transform: rotate(0) } 93% { transform: rotate(-5deg) } 96% { transform: rotate(5deg) } }
@keyframes s-burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.4) } 70% { opacity: 1 } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--r)) scale(1) } }
@keyframes s-in { from { opacity: 0; transform: translateY(40px) scale(.94) rotate(-1deg) } to { opacity: 1; transform: none } }
/* cards pop in as they scroll into view (browsers without scroll timelines show them at once) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .s-stepper, .s-puzzle, .s-learn-tile, .s-related li, .s-steps > li, .s-faq details, .s-world, .th-world, .s-card:not(.s-learn-tile) { animation: s-in linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* themes */
.th-full { --th-pad: max(18px, calc((100% - 1160px) / 2 + 18px)); margin-top: 8px; }
.th-full .s-worlds__tabs { margin: 0; padding-left: var(--th-pad); padding-right: var(--th-pad); }
.th-full .s-worlds__stage { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; padding-left: var(--th-pad); padding-right: var(--th-pad); padding-top: 22px; padding-bottom: 28px; transition: background-color .6s, color .6s; }
.th-full .s-worlds__img img { max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; }
.th-worlds { display: grid; gap: 24px; margin-top: 18px; }
.th-world { display: grid; gap: 14px; padding: 18px; background: #fff; border: var(--edge); border-radius: 22px; box-shadow: var(--shadow-s); scroll-margin-top: 16px; }
.th-world > img { display: block; width: 100%; height: auto; border-radius: 14px; border: var(--edge); }
.th-world p { margin: 0 0 10px; }
.th-access { color: var(--muted); }
@media (min-width: 700px) { .th-world { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 26px; } .th-world:nth-child(even) > img { order: 2; } }

/* ---------- v3: the visitor's own things (team, stickers, streak), the 6-7 surprise, page-to-page morphs ---------- */
.s-pill--team { cursor: pointer; font-family: var(--marker); } .s-pill--team:hover, .s-pill--team[aria-expanded=true] { background: #ffe8c7; }
.s-pill--stk b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-left: 2px; padding: 0 6px; border: 2px solid var(--ink2); border-radius: 999px; background: var(--yellow); font: 400 15px/1 var(--marker); }
.s-pill--stk:hover { background: #fff0b0; }
.s-pill.is-bump { animation: s-cheer .6s var(--pop); }
/* the team picker */
.s-teamdlg { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 22px 18px 18px; border: var(--edge); border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--ink2); }
.s-teamdlg::backdrop { background: rgba(42,36,56,.45); }
.s-teamdlg[open] { animation: s-in .35s var(--pop); }
.s-teamdlg h2 { margin: 0 0 6px; }
.s-teamdlg > p { margin: 0 0 14px; color: var(--muted); font: 400 20px/1.3 var(--hand); }
.s-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.s-teamcard { display: grid; justify-items: center; gap: 4px; width: 100%; padding: 10px 8px 12px; border: var(--edge); border-radius: 18px; background: #fff; color: var(--ink); box-shadow: var(--shadow-s); cursor: pointer; transition: transform .15s var(--pop); }
.s-teamcard:hover { transform: translateY(-3px) rotate(-1.5deg); }
.s-teamcard[aria-pressed=true] { background: var(--yellow); transform: rotate(-2deg); }
.s-teamcard__art { display: flex; align-items: flex-end; justify-content: center; height: 84px; }
.s-teamcard__art img { width: auto; height: 76px; } .s-teamcard__art img + img { margin-left: -14px; transform: scale(.92); }
.s-teamcard b { font: 400 19px/1.1 var(--marker); text-align: center; }
.s-teamcard__tag { color: var(--muted); font: 400 15px/1.2 var(--hand); }
/* a picked team: its pictures replace the drawn monster and robot (not in the logo) */
.s-tm { display: none; width: 100%; height: auto; }
html[data-site-team]:not([data-site-team=classic]) .s-tm { display: block; }
html[data-site-team]:not([data-site-team=classic]) svg.s-mon:not(.s-logo__mon), html[data-site-team]:not([data-site-team=classic]) svg.s-bot:not(.s-logo__bot) { display: none; }
.s-hub-cast .s-tm, .s-footer__cast .s-tm { width: clamp(70px, 18vw, 120px); transform-origin: 50% 100%; animation: s-idle 3s ease-in-out infinite; }
.s-footer__cast .s-tm { width: 78px; }
/* the sticker book */
.s-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; margin: 8px 0 22px; padding: 0; list-style: none; }
.s-sheet__h { margin-top: 18px; }
.s-stkr { display: grid; justify-items: center; align-content: start; gap: 6px; min-height: 150px; padding: 12px 8px; border: 2.5px dashed rgba(78,72,104,.45); border-radius: 20px; background: rgba(255,255,255,.6); text-align: center; font: 400 16px/1.2 var(--hand); color: var(--muted); }
.s-stkr img { width: 56px; height: 56px; filter: grayscale(1) opacity(.28); }
.s-stkr.is-got { border: var(--edge); border-style: solid; background: #fff; color: var(--ink); box-shadow: var(--shadow-s); transform: rotate(-2deg); }
.s-stkr.is-got:nth-child(even) { transform: rotate(2deg); }
.s-stkr.is-got img { filter: drop-shadow(0 2px 0 rgba(42,36,56,.3)); animation: s-cheer .6s var(--pop); }
.s-streak { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: var(--edge); border-radius: 999px; background: #ffe0c2; box-shadow: var(--shadow-s); font: 400 20px/1.2 var(--marker); }
.s-streak::before { content: ''; width: 26px; height: 26px; -webkit-mask: radial-gradient(circle at 50% 70%, #000 45%, transparent 46%); mask: radial-gradient(circle at 50% 70%, #000 45%, transparent 46%); background: #ff7a1a; }
.s-fly { position: fixed; z-index: 90; width: 56px; height: 56px; pointer-events: none; transition: transform .85s cubic-bezier(.5,-0.2,.4,1), opacity .85s; }
/* the 6-7 surprise */
.s-67 { min-width: 44px; min-height: 44px; margin-left: 6px; padding: 0 8px; border: 2px dashed rgba(78,72,104,.35); border-radius: 12px; background: none; color: rgba(78,72,104,.55); font: 400 15px/1 var(--marker); cursor: pointer; vertical-align: middle; }
.s-67:hover { color: var(--ink); border-color: var(--ink2); transform: rotate(-6deg); }
.s-egg { position: fixed; z-index: 80; left: 50%; bottom: max(70px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 6px; transform: translate(-50%, calc(100% + 90px)); pointer-events: none; }
.s-egg.is-on { animation: s-egg 3.4s var(--pop) both; }
.s-egg img { width: clamp(110px, 28vw, 170px); height: auto; transform-origin: 50% 100%; }
.s-egg.is-on .s-egg__six { animation: s-palms .5s ease-in-out .4s 5; } .s-egg.is-on .s-egg__seven { animation: s-palms .5s ease-in-out .65s 5; }
.s-egg .s-bubble { flex: none; margin-bottom: 90px; font: 400 clamp(22px, 5vw, 30px)/1.1 var(--marker); transform: rotate(-3deg); }
.s-confetti--67 { left: 50%; top: 10%; } .s-confetti--67 i { display: grid; place-items: center; width: 30px; height: 34px; color: var(--ink); font: 400 20px/1 var(--marker); font-style: normal; }
.s-egg.is-on .s-confetti i { animation: s-burst 1.4s cubic-bezier(.2,.8,.4,1) .3s both; }
@keyframes s-egg { 0% { transform: translate(-50%, calc(100% + 90px)) } 14%, 82% { transform: translate(-50%, 0) } 100% { transform: translate(-50%, calc(100% + 90px)) } }
@keyframes s-palms { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-14%) rotate(-5deg) } }
@media (prefers-reduced-motion: reduce) { .s-egg.is-on { transform: translate(-50%, 0); } }
/* page-to-page morphs (View Transitions): the header stays, a lesson's board grows out of its trail stop */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .s-top { view-transition-name: s-top; }
  .s-footer__cast { view-transition-name: s-cast; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
  ::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.3,1.2,.5,1); }
}
/* tiles and steppers lay out by their own width (container queries) */
.s-learn-tile, .s-stepper { container-type: inline-size; }
@container (max-width: 420px) { .s-learn-tile__body { grid-template-columns: minmax(0, 1fr) !important; } .s-stepper__controls { gap: 8px; } .s-ctl { padding: 6px 12px; } }
