/* =====================================================================
   Don't Break the Budget: storybook course
   Look: cut-paper storybook. Thick ink outlines and hard "sticker" shadows,
   taken straight from the workbook illustrations. Cover yellow, sky, grass.
     .track-kids     Bucket's Budget (8–12): the full storybook look
     .track-teens    (13–17): risograph zine, ink + lime + fluoro pink
     .track-teacher  calmer storybook for grown-ups
     .track-public   landing and sign-in pages
   Every color is a token so high-contrast mode can swap them in one place.
   ===================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/fonts/atkinson-hyperlegible-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(/fonts/fredoka-latin-wght-normal.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/fonts/space-grotesk-latin-wght-normal.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fredoka", "Atkinson Hyperlegible", system-ui, sans-serif;
  --display-weight: 650;

  --paper: #FFF8E7;
  --paper-2: #FBEBCB;
  --card: #FFFFFF;
  --ink: #231A15;
  --ink-soft: #5B4A3E;
  --sun: #FFD93B;
  --sun-soft: #FFF1B0;
  --grass: #2F8A42;
  --grass-soft: #D6F0C9;
  --sky: #8AD4F6;
  --sky-soft: #DFF4FD;
  --berry: #D8344A;
  --berry-ink: #A61B2E;
  --berry-soft: #FCDDE1;
  --plum: #8E4FB8;
  --plum-soft: #EEDDF8;
  --wood: #C98B4F;
  --link: #A61B2E;
  --focus: #6D28D9;

  --bw: 3px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-color: var(--ink);
  --shadow: 4px 4px 0 var(--shadow-color);
  --shadow-lg: 7px 7px 0 var(--shadow-color);
  --shadow-sm: 2px 2px 0 var(--shadow-color);

  --header-bg: var(--sun);
  --header-ink: var(--ink);
  --button-bg: var(--sun);
  --button-ink: var(--ink);
  --kicker: var(--berry-ink);

  /* clubhouse room */
  --room-sky: #8AD4F6;
  --room-leaf: #4CAF50;
  --room-outer: #A86B3C;
  --room-wall: #F6CF8E;
  --room-plank: #E3AF68;
  --room-floor: #B87A43;
  --room-floor-line: #8F5A2E;
  --room-window: #CDEEFC;
  --room-trim: #FFF8E7;
  --room-sign: #F6CF8E;
}

.track-teacher {
  --header-bg: var(--card);
  --shadow: 3px 3px 0 var(--shadow-color);
  --radius: 14px;
}

.track-teens {
  --font-display: "Space Grotesk", "Atkinson Hyperlegible", system-ui, sans-serif;
  --display-weight: 700;
  --paper: #F2EEE4;
  --paper-2: #E6E0D2;
  --card: #FFFDF8;
  --ink: #15172E;
  --ink-soft: #484B68;
  --sun: #C8F135;
  --sun-soft: #EEFBC4;
  --grass: #007A55;
  --grass-soft: #CDEFE2;
  --sky: #2F5BFF;
  --sky-soft: #DCE3FF;
  --berry: #FF4F8B;
  --berry-ink: #C2185B;
  --berry-soft: #FFDCE8;
  --plum: #6E44FF;
  --plum-soft: #E4DCFF;
  --link: #2F5BFF;
  --focus: #2F5BFF;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-color: var(--berry);
  --shadow: 5px 5px 0 var(--berry);
  --shadow-lg: 8px 8px 0 var(--sky);
  --shadow-sm: 3px 3px 0 var(--berry);
  --header-bg: var(--ink);
  --header-ink: var(--paper);
  --button-bg: var(--sun);
  --kicker: var(--berry-ink);

  --room-sky: #1C2050;
  --room-leaf: #1F4E4A;
  --room-outer: #3A2D52;
  --room-wall: #5A4A82;
  --room-plank: #4B3C70;
  --room-floor: #2E2440;
  --room-floor-line: #1E1830;
  --room-window: #2A3170;
  --room-trim: #C8F135;
  --room-sign: #C8F135;
}

/* ---------- User settings ---------- */
.text-large { font-size: 118%; }
.text-xlarge { font-size: 140%; }

.high-contrast body {
  --paper: #FFFFFF; --paper-2: #FFFFFF; --card: #FFFFFF; --ink: #000000; --ink-soft: #000000;
  --sun: #FFE500; --sun-soft: #FFFFFF; --grass: #005A1E; --grass-soft: #FFFFFF; --sky-soft: #FFFFFF;
  --berry: #9B0000; --berry-ink: #9B0000; --berry-soft: #FFFFFF; --plum-soft: #FFFFFF;
  --link: #0000CC; --focus: #0000EE; --shadow-color: #000000; --kicker: #000000;
  --header-bg: #FFFFFF; --header-ink: #000000; --button-bg: #FFE500; --button-ink: #000000;
  background-image: none !important;
}
.high-contrast body.track-teens {
  --paper: #000000; --paper-2: #000000; --card: #000000; --ink: #FFFFFF; --ink-soft: #FFFFFF;
  --sun-soft: #000000; --grass-soft: #000000; --sky-soft: #000000; --berry-soft: #000000; --plum-soft: #000000;
  --link: #FFFF00; --focus: #FFFF00; --shadow-color: #FFFFFF; --header-bg: #000000; --header-ink: #FFFFFF;
  --button-bg: #FFFF00; --kicker: #FFFFFF; --berry-ink: #FFFFFF;
}
.high-contrast .mark, .high-contrast .chip { background: var(--card) !important; color: var(--ink) !important; }
.simple .clubhouse-frame, .simple .confetti, .simple .celebrate-art, .simple .hero-art,
.simple .up-next-art, .simple .stop-cover, .simple .module-art, .simple .shop-tile, .simple .game-tile { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* soft paper speckle */
  background-image: radial-gradient(rgba(35, 26, 21, .045) 1px, transparent 1.3px);
  background-size: 18px 18px;
}
.track-teens {
  background-image:
    linear-gradient(rgba(21, 23, 46, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 46, .05) 1px, transparent 1px);
  background-size: 28px 28px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.12; margin: 1.4em 0 .45em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.4rem); margin-top: .3em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
.track-teens h1, .track-teens h2 { letter-spacing: -.03em; }
p, li { max-width: 68ch; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 700; }
code, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
code { background: var(--paper-2); padding: .1em .4em; border-radius: 6px; }
kbd { border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 6px; padding: 0 .35em; background: var(--card); }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.page-body { padding-bottom: 4rem; }
main:focus { outline: none; }
.lead { font-size: 1.22em; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.kicker {
  font-family: var(--font-display); font-weight: 600; font-size: .95rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--kicker); margin: 0 0 .2rem;
}
.hl { background: linear-gradient(transparent 58%, var(--sun) 58%, var(--sun) 92%, transparent 92%); padding: 0 .08em; }
.track-teens .hl { background: var(--sun); }

:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
h1:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -120px; z-index: 20; background: var(--card); color: var(--ink);
  border: var(--bw) solid var(--ink); padding: .7rem 1.1rem; border-radius: var(--radius-sm); font-weight: 700; box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); color: var(--header-ink); border-bottom: var(--bw) solid var(--ink); position: relative; z-index: 5; }
.track-public .site-header { background: var(--paper); }
.page-landing .site-header { background: var(--sun); border-bottom: 0; }
.header-row {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav coins";
  align-items: center; gap: .6rem 1.4rem; padding: .7rem 0;
}
.brand { grid-area: brand; }
.site-nav { grid-area: nav; }
.coin-badge { grid-area: coins; }
@media (max-width: 1000px) {
  .header-row { grid-template-columns: 1fr auto; grid-template-areas: "brand coins" "nav nav"; }
  .site-nav { margin-left: 0; justify-content: space-between; }
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--sky-soft);
  object-fit: cover; box-shadow: var(--shadow-sm); flex: none;
}
.track-teens .brand-mark {
  display: grid; place-items: center; border-radius: 4px; background: var(--sun); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; border-color: var(--sun); box-shadow: 3px 3px 0 var(--berry);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.brand-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; opacity: .75; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .3rem 1rem; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.site-nav form { margin: 0; }
.nav-main a {
  display: inline-block; padding: .45rem 1rem; border-radius: 999px; text-decoration: none; color: inherit;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; border: var(--bw) solid transparent;
}
.nav-main a:hover { background: rgba(255, 255, 255, .55); }
.nav-main a[aria-current="page"] { background: var(--card); color: var(--ink); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.track-teens .nav-main a { border-radius: 4px; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; }
.track-teens .nav-main a:hover { background: rgba(255, 255, 255, .1); }
.track-teens .nav-main a[aria-current="page"] { background: var(--sun); border-color: var(--sun); box-shadow: 3px 3px 0 var(--berry); }
.nav-quiet {
  background: none; border: 0; box-shadow: none; padding: .4rem .5rem; min-height: 0; cursor: pointer;
  font: inherit; font-size: .95rem; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: .2em; opacity: .85;
}
.nav-quiet:hover { opacity: 1; transform: none; box-shadow: none; }
.coin-badge {
  display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .9rem .3rem .4rem; border-radius: 999px;
  background: var(--card); color: var(--ink); text-decoration: none; border: var(--bw) solid var(--ink); box-shadow: var(--shadow-sm);
  font-weight: 700;
}
.coin-badge strong { font-family: var(--font-display); font-size: 1.15em; }
.coin { width: 26px; height: 26px; flex: none; }
.coin-lg { width: 44px; height: 44px; }
.coin-xl { width: 96px; height: 96px; }
.icon { width: 28px; height: 28px; flex: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: var(--bw) solid var(--ink); background: var(--paper-2); color: var(--ink-soft); font-size: .95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding: 1.1rem 0 1.6rem; }
.footer-row p { margin: 0; }

/* ---------- Buttons ---------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.2; letter-spacing: .01em;
  cursor: pointer; text-decoration: none; text-align: center;
  background: var(--button-bg); color: var(--button-ink); border: var(--bw) solid var(--ink);
  padding: .65rem 1.35rem; border-radius: 999px; box-shadow: var(--shadow); min-height: 48px;
  transition: transform .12s ease, box-shadow .12s ease;
}
button:hover, .button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow-color); }
button:active, .button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow-color); }
.button.secondary, button.secondary { background: var(--card); }
button.big, .button.big { font-size: 1.25rem; padding: .8rem 1.8rem; min-height: 56px; }
button.wide { width: 100%; }
button.danger { background: var(--berry); color: #fff; }
.track-teens button, .track-teens .button { border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; font-size: 1rem; }

/* ---------- Cards, chips, notices ---------- */
.card, .panel {
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; box-shadow: var(--shadow); position: relative;
}
.panel { margin: 1.8rem 0; }
.card h2, .card h3, .panel h2 { margin-top: .1em; }
.cards { display: grid; gap: 1.2rem; list-style: none; padding: 0; margin: 1.2rem 0; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards.three { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: .15rem .75rem; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--card); font-weight: 700; font-size: .9rem; width: fit-content;
}
.chip-complete { background: var(--grass-soft); }
.chip-in-progress, .chip-not-started { background: var(--sun); }
.chip-locked { background: var(--paper-2); }
.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.notice, .error-box, .warning-box {
  border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); padding: .8rem 1.1rem; box-shadow: var(--shadow-sm);
  font-weight: 700; margin: 1.3rem 0 0;
}
.notice { background: var(--grass-soft); }
.error-box { background: var(--berry-soft); margin: 1rem 0; }
.warning-box { background: var(--sun-soft); font-weight: 400; }
.error-box p, .warning-box p { margin: 0; }

/* ---------- Forms ---------- */
.form .field { margin: 0 0 1.1rem; }
.form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem 1rem; margin: 1rem 0; }
.form.inline .field { margin: 0; }
label, legend { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; display: block; margin-bottom: .3rem; }
.hint { margin: 0 0 .35rem; color: var(--ink-soft); font-size: .95rem; }
input[type=text], input[type=email], input[type=password], select, textarea {
  font: inherit; color: var(--ink); background: var(--card); width: 100%;
  border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); padding: .6rem .85rem; min-height: 50px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 4px var(--sun); outline-offset: 2px; }
.form.inline input, .form.inline select { width: auto; min-width: 13rem; }
textarea { min-height: 9rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.field.check { display: flex; gap: .7rem; align-items: flex-start; }
.field.check label { font-family: var(--font-body); font-weight: 400; font-size: 1.05rem; margin: 0; }
input[type=checkbox], input[type=radio] { width: 1.35em; height: 1.35em; accent-color: var(--ink); flex: none; margin-top: .15em; }
.danger-zone { border-top: 2px dashed var(--ink); padding-top: 1.1rem; }
.form .choice { display: flex; gap: .55rem; align-items: center; font-family: var(--font-body); font-weight: 400; margin: .3rem 0; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table caption { text-align: left; font-family: var(--font-display); font-weight: 600; padding: .5rem 0; }
.data-table th, .data-table td { text-align: left; padding: .75rem 1rem; border-bottom: 2px solid var(--paper-2); vertical-align: middle; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table thead th { background: var(--sun-soft); border-bottom: var(--bw) solid var(--ink); font-family: var(--font-display); font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.progress-row { display: flex; align-items: center; gap: .7rem; margin: .5rem 0; font-weight: 700; }
.progress-row span { white-space: nowrap; font-size: .95rem; }
progress {
  -webkit-appearance: none; appearance: none; flex: 1 1 120px; max-width: 260px; height: 18px;
  border: var(--bw) solid var(--ink); border-radius: 999px; background: var(--card); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--card); }
progress::-webkit-progress-value { background: var(--grass); }
progress::-moz-progress-bar { background: var(--grass); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 1.4rem 0 0; font-size: .95rem; font-weight: 700; }
.breadcrumb li + li::before { content: "→"; margin-right: .4rem; color: var(--ink-soft); }
.shortcuts { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.4rem; }
.shortcuts dt { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.shortcuts dd { margin: 0; }

/* ---------- Page heads ---------- */
.page-head { margin: 2.2rem 0 1.6rem; }
.page-head h1 { margin: .1rem 0 .4rem; }
.page-head .lead { margin: 0; }

/* ---------- Portraits ---------- */
.portrait {
  --size: 64px;
  width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden; flex: none;
  border: var(--bw) solid var(--ink); background: var(--sky-soft); display: inline-grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-bucket { background: var(--sky-soft); }
.portrait-lizzy { background: var(--plum-soft); }
.portrait-foxy { background: var(--sun-soft); }
.portrait-jaxon { background: var(--grass-soft); }
.portrait-initials { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; background: var(--plum-soft); }
.portrait-mystery { border-style: dashed; background: var(--paper-2); box-shadow: none; font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; color: var(--ink-soft); }
.portrait-xl { --size: 132px; box-shadow: var(--shadow); }
.pop { animation: pop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { 0% { transform: scale(.2) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }

/* ---------- Home / clubhouse ---------- */
.home-head { margin: 2rem 0 1.2rem; display: grid; gap: .1rem; }
.home-head h1 { margin: 0; }
.home-head .lead { margin: .2rem 0 0; }
.clubhouse-frame {
  border: var(--bw) solid var(--ink); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--room-sky); line-height: 0;
}
.clubhouse-art { width: 100%; height: auto; max-height: 74vh; display: block; margin: 0 auto; }
.clubhouse-art .sky { fill: var(--room-sky); }
.clubhouse-art .foliage { fill: var(--room-leaf); }
.clubhouse-art .trunk { fill: #8A5A32; }
.clubhouse-art .beam { fill: #B87A43; }
.clubhouse-art .wall-outer { fill: var(--room-outer); }
.clubhouse-art .wall { fill: var(--room-wall); }
.clubhouse-art .plank-line { stroke: var(--room-plank); stroke-width: 3; }
.clubhouse-art .floor { fill: var(--room-floor); }
.clubhouse-art .floor-line { stroke: var(--room-floor-line); stroke-width: 3; fill: none; }
.clubhouse-art .sky-window { fill: var(--room-window); }
.clubhouse-art .trim-line { stroke: var(--room-trim); }
.clubhouse-art .sill { fill: var(--room-outer); }
.clubhouse-art .sign { fill: var(--room-sign); }
.clubhouse-art .sign-text { font-family: var(--font-display); font-weight: 700; font-size: 25px; fill: #231A15; }
.clubhouse-art .frame-bg { fill: #FFF8E7; }
.clubhouse-art .frame-empty { fill: rgba(255, 255, 255, .3); }
.clubhouse-art .frame-initials { font-family: var(--font-display); font-weight: 700; font-size: 26px; fill: #231A15; }
.clubhouse-art .frame-q { font-family: var(--font-display); font-weight: 700; font-size: 34px; fill: rgba(35, 26, 21, .45); }
.clubhouse-art .night { display: none; }
.track-teens .clubhouse-art .day { display: none; }
.track-teens .clubhouse-art .night { display: inline; }
.clubhouse-art .host { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.clubhouse-art .placed { animation: drop-in .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes drop-in { from { opacity: 0; } }

.home-cards { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.4rem; margin: 2rem 0; }
@media (max-width: 820px) { .home-cards { grid-template-columns: 1fr; } }
.up-next { display: grid; grid-template-columns: minmax(140px, 42%) 1fr; gap: 1.3rem; align-items: center; }
.up-next:not(:has(.up-next-art)) { grid-template-columns: 1fr; }
@media (max-width: 560px) { .up-next { grid-template-columns: 1fr; } }
.up-next-art { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); transform: rotate(-1.5deg); }
.up-next h2 { margin: .1rem 0 .3rem; }
.up-next p { margin: .3rem 0 .8rem; }
.coin-jar { background: var(--sun); display: flex; align-items: center; gap: 1.2rem; }
.jar-art { width: 120px; flex: none; transform: rotate(4deg); }
.coin-jar h2 { margin: 0; font-size: 1.4rem; }
.jar-count { margin: .1rem 0 .8rem; font-size: 1.2rem; }
.jar-count strong { font-family: var(--font-display); font-size: 3rem; line-height: 1; display: block; }
.home-section { margin: 2.6rem 0; }
.home-section h2 { margin-bottom: .9rem; }
.friend-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.friend-card { display: flex; gap: 1rem; align-items: center; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); }
.friend-card h3 { margin: 0; }
.friend-card p { margin: .15rem 0 0; color: var(--ink-soft); font-size: 1rem; }
.friend-card.is-waiting { background: transparent; border-style: dashed; box-shadow: none; }

/* ---------- Story path (trail) ---------- */
.trail { list-style: none; padding: 0; margin: 0 0 3rem; position: relative; }
.trail::before {
  content: ""; position: absolute; top: 20px; bottom: 40px; left: calc(50% - 6px); width: 12px; border-radius: 6px;
  background: repeating-linear-gradient(var(--wood) 0 22px, transparent 22px 36px);
}
.track-teens .trail::before { background: repeating-linear-gradient(var(--ink) 0 10px, transparent 10px 20px); width: 4px; left: calc(50% - 2px); }
.stop { display: grid; grid-template-columns: 1fr 84px 1fr; align-items: center; margin-bottom: 1.6rem; position: relative; }
.stop-pin {
  grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sun); border: var(--bw) solid var(--ink); box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
}
.stop-pin .icon { width: 36px; height: 36px; }
.status-complete .stop-pin { background: var(--grass-soft); }
.status-locked .stop-pin { background: var(--paper-2); }
.stop-card, .goal-card { grid-row: 1; grid-column: 1; }
.stop:nth-child(even) .stop-card { grid-column: 3; }
.stop-card {
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); position: relative; transition: transform .15s ease, box-shadow .15s ease;
}
.stop:nth-child(odd) .stop-card { transform: rotate(-.8deg); }
.stop:nth-child(even) .stop-card { transform: rotate(.8deg); }
.stop-card:has(.stretched):hover { transform: rotate(0) translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.stop-cover img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-bottom: var(--bw) solid var(--ink); }
.status-locked .stop-cover img { filter: grayscale(1) contrast(.85); opacity: .7; }
.stop-body { padding: 1rem 1.3rem 1.2rem; }
.stop-body h2 { font-size: 1.45rem; margin: .5rem 0 .3rem; }
.stop-body h2 a { color: inherit; text-decoration: none; }
.stop-body h2 a:hover { text-decoration: underline; }
.stop-body p { margin: .3rem 0; }
.stretched::after { content: ""; position: absolute; inset: 0; }
.stretched:focus-visible { outline: none; }
.stop-card:has(.stretched:focus-visible), .game-card:has(.stretched:focus-visible) { outline: 4px solid var(--focus); outline-offset: 4px; }
.stop-goal .goal-card { grid-column: 1 / -1; grid-row: 2; justify-self: center; text-align: center; margin-top: .8rem; }
.goal-card img { width: min(320px, 80vw); margin: 0 auto; }
.goal-card p { margin: .4rem auto; font-family: var(--font-display); font-size: 1.2rem; }
@media (max-width: 760px) {
  .trail::before { left: 26px; }
  .track-teens .trail::before { left: 30px; }
  .stop { grid-template-columns: 64px 1fr; gap: .8rem; align-items: start; }
  .stop-pin { grid-column: 1; width: 56px; height: 56px; }
  .stop-card, .stop:nth-child(even) .stop-card { grid-column: 2; transform: none; }
  .stop:nth-child(odd) .stop-card { transform: none; }
  .stop-goal .goal-card { grid-column: 2; grid-row: 1; justify-self: start; text-align: left; margin-top: 0; }
}

/* ---------- Module overview ---------- */
.module-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.2rem; align-items: center; margin: 1.6rem 0 2.4rem; }
.module-hero:not(:has(.module-art)) { grid-template-columns: 1fr; }
@media (max-width: 760px) { .module-hero { grid-template-columns: 1fr; } }
.module-art { border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); transform: rotate(-1.5deg); width: 100%; }
.module-intro h1 { margin: .1rem 0 .4rem; }
.step-list { list-style: none; padding: 0; display: grid; gap: .6rem; max-width: 760px; }
.step-row > a, .step-row > .step-locked {
  display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem; border: var(--bw) solid var(--ink); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
}
.step-row > a:hover { background: var(--sun-soft); }
.step-row > .step-locked { opacity: .6; box-shadow: none; border-style: dashed; }
.step-row.is-current > a { background: var(--sun); }
.step-num { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: var(--paper); flex: none; }
.step-row.is-done .step-num { border: 0; background: none; }
.step-row.is-done .step-num .icon { width: 36px; height: 36px; }
.step-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.step-type { margin-left: auto; color: var(--ink-soft); font-size: .95rem; text-align: right; }

/* ---------- Step pages ---------- */
.page-step .page-body { max-width: 900px; }
.step-head { margin: 1.4rem 0 1.4rem; }
.step-head h1 { margin: .4rem 0 .7rem; }
.step-head .kicker { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.type-tag { display: inline-block; padding: .15rem .7rem; border-radius: 999px; border: 2px solid var(--ink); color: var(--ink); letter-spacing: .06em; background: var(--sky-soft); }
.type-learn, .type-review { background: var(--grass-soft); }
.type-sort { background: var(--plum-soft); }
.type-order { background: var(--berry-soft); }
.type-quiz { background: var(--sun); }
.stones { display: flex; gap: .5rem; align-items: center; }
.stone { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); }
.stone.done { background: var(--grass); }
.stone.here { width: 26px; height: 26px; background: var(--sun); box-shadow: var(--shadow-sm); }

.step {
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius);
  padding: clamp(1.2rem, 3.5vw, 2.4rem); box-shadow: var(--shadow-lg);
}
.prompt { font-size: 1.2rem; font-weight: 700; margin-top: 0; }
.step-nav { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.4rem; border-top: 2px dashed var(--ink); }

.story-figure { margin: 0 0 1.6rem; }
.story-figure img { width: 100%; border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); }
.story-text { font-size: 1.3rem; line-height: 1.75; }
.story-text p:first-child::first-letter {
  font-family: var(--font-display); font-weight: 700; float: left; font-size: 3.4em; line-height: .85;
  margin: .08em .1em 0 0; color: var(--berry);
}
.learn-page { display: flow-root; }
.learn-page .story-figure { float: right; width: min(42%, 320px); margin: 0 0 1rem 1.5rem; transform: rotate(2deg); }
.learn-page .story-figure img { box-shadow: var(--shadow); background: var(--card); }
@media (max-width: 600px) { .learn-page .story-figure { float: none; width: 100%; margin: 0 0 1rem; transform: none; } }
.learn-text { font-size: 1.2rem; }

.guide-says { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1.8rem; }
.guide-face { --size: 92px; margin-top: .4rem; }
.bubble {
  position: relative; flex: 1; background: var(--sky-soft); border: var(--bw) solid var(--ink); border-radius: 24px;
  padding: 1rem 1.4rem; box-shadow: var(--shadow-sm);
}
.bubble::before {
  content: ""; position: absolute; left: -15px; top: 34px; width: 24px; height: 24px; background: var(--sky-soft);
  border-left: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink); transform: rotate(45deg);
}
.bubble h2 { font-size: 1.35rem; margin: 0 0 .4rem; }
.bubble ul { margin: 0; padding-left: 1.3rem; }
.bubble li { margin: .3rem 0; }
.bubble li::marker { color: var(--berry); font-size: 1.2em; }
.track-teens .bubble { border-radius: 6px; background: var(--sun-soft); }
.track-teens .bubble::before { background: var(--sun-soft); }

/* questions and sorting */
.question, .sort-item {
  border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: 1.1rem 1.3rem 1.2rem; margin-bottom: 1.3rem; background: var(--paper);
}
.question legend, .sort-item legend { float: left; width: 100%; padding: 0; margin-bottom: .8rem; }
.q-num { display: block; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--kicker); }
.q-text { font-size: 1.35rem; }
.choices { clear: both; display: grid; gap: .7rem; }
.choices-tf, .chips { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.choice {
  position: relative; display: flex; gap: .8rem; align-items: center; margin: 0; cursor: pointer;
  padding: .75rem 1rem; border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); background: var(--card);
  box-shadow: var(--shadow-sm); font-family: var(--font-body); font-weight: 400; font-size: 1.15rem;
  transition: transform .1s ease, background-color .1s ease;
}
.choice:hover { transform: translate(-1px, -1px); background: var(--sun-soft); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice:has(input:focus-visible) { outline: 4px solid var(--focus); outline-offset: 3px; }
.choice:has(input:checked) { background: var(--sun); transform: translate(2px, 2px); box-shadow: none; }
.choice:has(input:checked) .letter { background: var(--ink); color: var(--card); }
.choice:has(input:disabled) { cursor: default; }
.letter {
  width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-weight: 700; background: var(--paper);
}
.track-teens .letter { border-radius: 4px; }
.chips .choice { justify-content: center; font-family: var(--font-display); font-weight: 600; }
.chips .choice::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); flex: none;
}
.chips .choice:has(input:checked)::before { background: var(--ink); box-shadow: inset 0 0 0 3px var(--card); }
.is-ok { background: var(--grass-soft); }
.is-bad { background: var(--berry-soft); }
.feedback { margin: .9rem 0 0; font-size: 1.05rem; }
.mark { display: inline-block; font-family: var(--font-display); font-weight: 700; padding: .1rem .7rem; border-radius: 999px; border: 2px solid var(--ink); margin-right: .3rem; }
.mark-ok { background: var(--grass); color: #fff; }
.mark-bad { background: var(--berry-ink); color: #fff; }

/* ordering */
.order-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.order-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem 1rem;
  border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow-sm);
}
.order-item select {
  width: 4.6rem; min-height: 54px; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; text-align: center;
  background: var(--sun); border-radius: 50%; padding: 0 .4rem; flex: none; cursor: pointer;
}
.track-teens .order-item select { border-radius: 4px; }
.order-item label { flex: 1 1 220px; margin: 0; font-family: var(--font-body); font-weight: 400; font-size: 1.2rem; }
.order-item .feedback { margin: 0; }

/* review */
.review-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.review-list li { display: flex; gap: .9rem; align-items: flex-start; font-size: 1.25rem; padding: .7rem 1rem; background: var(--grass-soft); border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); }
.tick { width: 28px; height: 28px; border-radius: 50%; background: var(--grass); border: 2.5px solid var(--ink); flex: none; position: relative; margin-top: .1rem; }
.tick::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid #fff; border-width: 0 3.5px 3.5px 0; transform: rotate(45deg); }

/* ---------- Celebration ---------- */
.celebrate { text-align: center; position: relative; padding: 2rem 0 1rem; }
.celebrate h1 { margin: .2rem 0 .3rem; font-size: clamp(2.6rem, 7vw, 4.4rem); }
.celebrate .lead { margin: 0 auto 1.6rem; }
.celebrate p { margin-inline: auto; }
.celebrate-art { width: min(640px, 100%); margin: 2.4rem auto 1rem; border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); transform: rotate(1.2deg); }
.rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; margin-bottom: 2rem; }
.reward-sticker, .reward-friend {
  display: flex; align-items: center; gap: .8rem; padding: .8rem 1.3rem; border: var(--bw) solid var(--ink);
  border-radius: 999px; box-shadow: var(--shadow); background: var(--sun); font-size: 1.15rem;
}
.reward-sticker { transform: rotate(-3deg); }
.reward-friend { background: var(--card); transform: rotate(2deg); }
.reward-sticker p, .reward-friend p { margin: 0; }
.reward-sticker strong { font-family: var(--font-display); font-size: 1.6rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.confetti { position: absolute; inset: 0 0 auto 0; height: 100vh; pointer-events: none; overflow: hidden; z-index: 2; }
.celebrate > :not(.confetti) { position: relative; z-index: 1; }
.confetti .c { position: absolute; top: -20px; width: 12px; height: 18px; border: 2px solid #231A15; border-radius: 3px; animation: fall 3.6s linear forwards; }
.confetti .c0 { background: #FFD93B; }
.confetti .c1 { background: #D8344A; border-radius: 50%; width: 14px; height: 14px; }
.confetti .c2 { background: #8AD4F6; }
.confetti .c3 { background: #2F8A42; }
.confetti .c4 { background: #8E4FB8; border-radius: 50%; width: 12px; height: 12px; }
.confetti .c5 { background: #FFFFFF; }
.confetti .c6 { background: #F28C38; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(90vh) rotate(540deg); opacity: 0; }
}
.confetti .c:nth-child(1) { left: 32.4%; animation-delay: 0.21s; animation-duration: 3.97s; }
.confetti .c:nth-child(2) { left: 8.8%; animation-delay: 0.75s; animation-duration: 3.46s; }
.confetti .c:nth-child(3) { left: 7.5%; animation-delay: 0.71s; animation-duration: 2.87s; }
.confetti .c:nth-child(4) { left: 42.8%; animation-delay: 0.10s; animation-duration: 2.96s; }
.confetti .c:nth-child(5) { left: 41.9%; animation-delay: 1.16s; animation-duration: 3.02s; }
.confetti .c:nth-child(6) { left: 23.0%; animation-delay: 0.88s; animation-duration: 4.51s; }
.confetti .c:nth-child(7) { left: 56.2%; animation-delay: 0.56s; animation-duration: 4.56s; }
.confetti .c:nth-child(8) { left: 6.4%; animation-delay: 1.20s; animation-duration: 3.32s; }
.confetti .c:nth-child(9) { left: 15.6%; animation-delay: 0.16s; animation-duration: 3.36s; }
.confetti .c:nth-child(10) { left: 78.7%; animation-delay: 0.25s; animation-duration: 3.85s; }
.confetti .c:nth-child(11) { left: 62.1%; animation-delay: 0.52s; animation-duration: 3.79s; }
.confetti .c:nth-child(12) { left: 7.9%; animation-delay: 0.08s; animation-duration: 3.17s; }
.confetti .c:nth-child(13) { left: 66.0%; animation-delay: 0.60s; animation-duration: 3.37s; }
.confetti .c:nth-child(14) { left: 57.0%; animation-delay: 0.63s; animation-duration: 3.34s; }
.confetti .c:nth-child(15) { left: 76.7%; animation-delay: 0.98s; animation-duration: 3.24s; }
.confetti .c:nth-child(16) { left: 56.0%; animation-delay: 0.74s; animation-duration: 4.38s; }
.confetti .c:nth-child(17) { left: 70.6%; animation-delay: 0.40s; animation-duration: 4.56s; }
.confetti .c:nth-child(18) { left: 13.1%; animation-delay: 0.59s; animation-duration: 4.16s; }
.confetti .c:nth-child(19) { left: 16.3%; animation-delay: 0.68s; animation-duration: 2.87s; }
.confetti .c:nth-child(20) { left: 64.8%; animation-delay: 1.07s; animation-duration: 3.83s; }
.confetti .c:nth-child(21) { left: 84.3%; animation-delay: 0.44s; animation-duration: 4.05s; }
.confetti .c:nth-child(22) { left: 57.9%; animation-delay: 0.81s; animation-duration: 3.62s; }
.confetti .c:nth-child(23) { left: 81.0%; animation-delay: 1.32s; animation-duration: 3.65s; }
.confetti .c:nth-child(24) { left: 64.4%; animation-delay: 0.08s; animation-duration: 4.06s; }
.confetti .c:nth-child(25) { left: 62.8%; animation-delay: 1.39s; animation-duration: 4.28s; }
.confetti .c:nth-child(26) { left: 28.8%; animation-delay: 0.54s; animation-duration: 4.00s; }
.confetti .c:nth-child(27) { left: 4.1%; animation-delay: 0.65s; animation-duration: 3.10s; }
.confetti .c:nth-child(28) { left: 13.0%; animation-delay: 0.08s; animation-duration: 4.18s; }

/* ---------- Shop ---------- */
.shop-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.wallet {
  display: inline-flex; align-items: center; gap: .7rem; margin: 0; padding: .6rem 1.3rem .6rem .7rem;
  background: var(--sun); border: var(--bw) solid var(--ink); border-radius: 999px; box-shadow: var(--shadow); font-size: 1.15rem;
}
.wallet strong { font-family: var(--font-display); font-size: 1.3em; }
.shop-grid { list-style: none; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.shop-item {
  display: flex; flex-direction: column; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius);
  padding: 1rem 1rem 1.2rem; box-shadow: var(--shadow); position: relative;
}
.shop-item:nth-child(3n+1) { transform: rotate(-.6deg); }
.shop-item:nth-child(3n+2) { transform: rotate(.5deg); }
.shop-tile {
  height: 160px; display: grid; place-items: center; position: relative; border: var(--bw) solid var(--ink); border-radius: var(--radius-sm);
  background-color: var(--sky-soft); background-image: radial-gradient(rgba(35, 26, 21, .1) 1.5px, transparent 1.6px); background-size: 14px 14px;
}
.shop-item:nth-child(4n+2) .shop-tile { background-color: var(--sun-soft); }
.shop-item:nth-child(4n+3) .shop-tile { background-color: var(--grass-soft); }
.shop-item:nth-child(4n+4) .shop-tile { background-color: var(--berry-soft); }
.deco-art { max-width: 78%; max-height: 120px; width: auto; height: 120px; }
.shop-item h2 { font-size: 1.35rem; margin: .9rem 0 .15rem; }
.shop-blurb { margin: 0 0 .7rem; color: var(--ink-soft); font-size: 1rem; flex: 1; }
.price { display: flex; align-items: center; gap: .45rem; margin: 0 0 .9rem; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.shop-item form button { width: 100%; }
.shop-note { margin: 0; padding: .65rem; text-align: center; font-weight: 700; border: 2px dashed var(--ink); border-radius: 999px; color: var(--ink-soft); }
.shop-item.is-short .shop-tile { filter: saturate(.55); }
.shop-item.is-owned .shop-note { border: 0; padding: .4rem 0; text-align: left; color: var(--grass); }
.shop-item.is-owned .shop-note::before { content: "✓ "; }
.stamp {
  position: absolute; top: 10px; right: 10px; transform: rotate(10deg); padding: .1rem .6rem; font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem; color: var(--berry-ink); border: 3px solid var(--berry-ink); border-radius: 8px;
  background: rgba(255, 255, 255, .85); text-transform: uppercase; letter-spacing: .06em;
}

/* ---------- Games ---------- */
.game-grid { list-style: none; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.game-card { display: grid; grid-template-columns: 150px 1fr; gap: 1.2rem; align-items: center; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); position: relative; }
.game-tile { background: var(--sky-soft); border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); position: relative; padding: .6rem; }
.game-art-text { font-family: var(--font-display); font-weight: 700; font-size: 48px; fill: #231A15; }
.game-body h2 { font-size: 1.4rem; margin: 0 0 .3rem; }
.game-body p { margin: .3rem 0; }
.game-card.is-soon .game-tile { filter: saturate(.7); }

/* ---------- Landing ---------- */
.hero { background: var(--sun); border-bottom: var(--bw) solid var(--ink); padding: 2.5rem 0 4rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; margin: .2rem 0 1rem; }
.hero .hl { background: var(--card); border: var(--bw) solid var(--ink); border-radius: 14px; padding: 0 .25em; box-shadow: var(--shadow-sm); display: inline-block; transform: rotate(-2deg); }
.hero .lead { color: var(--ink); font-size: 1.3rem; }
.hero .kicker { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.6rem; }
.hero-art img { border: 4px solid var(--ink); border-radius: 22px; box-shadow: 10px 10px 0 var(--ink); transform: rotate(3deg); max-height: 560px; width: auto; margin: 0 auto; }
.band { padding: 4.2rem 0; }
.band h2 { margin-top: 0; }
.band-gang { background: var(--sky-soft); border-bottom: var(--bw) solid var(--ink); }
.gang { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem 1.5rem; text-align: center; }
.gang li { display: flex; flex-direction: column; align-items: center; }
.gang li:nth-child(odd) .portrait { transform: rotate(-4deg); }
.gang li:nth-child(even) .portrait { transform: rotate(3deg); }
.gang h3 { margin: .9rem 0 .2rem; font-size: 1.5rem; }
.gang p { margin: 0; color: var(--ink-soft); }
.how { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.6rem; }
.how li { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.how img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: var(--bw) solid var(--ink); background: var(--sky-soft); }
.how h3 { display: flex; align-items: center; gap: .6rem; margin: 1rem 1.2rem .3rem; font-size: 1.4rem; }
.how p { margin: 0 1.2rem 1.3rem; }
.how-num { width: 36px; height: 36px; border-radius: 50%; background: var(--sun); border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.band-courses { background: var(--paper-2); border-block: var(--bw) solid var(--ink); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.6rem; }
.course { border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: 1.6rem 1.8rem; box-shadow: var(--shadow); }
.course h3 { font-size: 2rem; margin: .2rem 0 .4rem; }
.course p { margin: .2rem 0; }
.course-kids { background: var(--sun); }
.course-teens { background: #15172E; color: #F2EEE4; border-radius: 6px; box-shadow: 7px 7px 0 #FF4F8B; }
.course-teens h3 { font-family: "Space Grotesk", sans-serif; letter-spacing: -.03em; }
.course-teens .kicker { color: #C8F135; }
.band-access { background: var(--grass-soft); border-bottom: var(--bw) solid var(--ink); }
.access-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem 3rem; align-items: center; }
@media (max-width: 760px) { .access-grid { grid-template-columns: 1fr; } }
.access-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.access-list li { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius-sm); padding: .8rem 1.1rem; box-shadow: var(--shadow-sm); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem 3rem; justify-content: center; }
.cta img { width: min(340px, 80vw); }
.cta h2 { font-size: clamp(2rem, 4vw, 2.8rem); }

/* ---------- Sign in ---------- */
.page-auth { background-color: var(--sky-soft); }
.auth-card {
  max-width: 480px; margin: 3rem auto 4rem; background: var(--card); border: var(--bw) solid var(--ink);
  border-radius: 24px; padding: 2rem clamp(1.3rem, 4vw, 2.4rem); box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: .2rem 0 .3rem; font-size: 2.4rem; }
.auth-card .lead { margin-top: 0; }
.auth-student { margin-top: 7rem; text-align: center; }
.auth-student .form { text-align: left; }
.auth-art { width: 260px; margin: -8.5rem auto .2rem; animation: bob 3.2s ease-in-out infinite; }
.auth-foot { font-size: 1rem; color: var(--ink-soft); margin: 1.2rem 0 0; }

/* ---------- Settings ---------- */
.settings-card { max-width: 620px; }
.settings-card .form { margin: 0; }

/* ---------- Teacher ---------- */
.track-teacher .page-body > h1 { margin-top: 1.4rem; }
.track-teacher .cards.three .card h2 { font-size: 1.4rem; }
.track-teacher .cards.three .card h2 a { color: var(--ink); }

/* ---------- Print: login cards ---------- */
.print-only { display: none; }
@media print {
  .site-header, .site-footer, .no-print, .warning-box, .data-table, .page-body > p, h1, .breadcrumb { display: none !important; }
  .print-only { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; }
  .login-card { border: 2px dashed #000; padding: 12px; break-inside: avoid; font-size: 14pt; }
  .lc-name { font-size: 18pt; font-weight: 800; }
  body { background: #fff !important; color: #000; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
.reduce-motion .confetti { display: none; }

/* Landing: keep a flash message inside the yellow hero area */
.page-landing main > .wrap:first-child { width: auto; margin: 0; padding: 1rem max(1.25rem, calc((100% - 1120px) / 2)) 0; background: var(--sun); }
.page-landing main > .wrap:first-child .notice { margin: 0; }
.notice-try { background: var(--sun-soft); }

/* =====================================================================
   v3: top bar with profile menu, full-screen clubhouse, decorating
   ===================================================================== */

/* ---------- Top bar ---------- */
.header-row { grid-template-columns: 1fr auto; grid-template-areas: "brand right" ". back"; row-gap: .3rem; }
.header-right { grid-area: right; display: flex; align-items: center; gap: .8rem; }
.site-nav { grid-area: right; }
.back-link {
  grid-area: back; justify-self: end; display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .8rem; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink);
  text-decoration: none; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-sm);
}
.back-link:hover { background: var(--sun-soft); }
.track-teens .back-link { border-radius: 4px; background: var(--sun); border-color: var(--sun); }

.profile { position: relative; }
.profile-button {
  list-style: none; cursor: pointer; width: 54px; height: 54px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; border: var(--bw) solid var(--ink); background: var(--sky-soft); box-shadow: var(--shadow-sm);
}
.profile-button::-webkit-details-marker { display: none; }
.profile-button::marker { content: ""; }
.profile-button img { width: 100%; height: 100%; object-fit: cover; }
.profile-button:hover { transform: rotate(-4deg); }
.profile[open] .profile-button { background: var(--sun); }
.profile-initials { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.track-teens .profile-button { border-radius: 6px; background: var(--sun); border-color: var(--sun); }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + .6rem); min-width: 210px; z-index: 30; padding: .5rem;
  background: var(--card); color: var(--ink); border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.profile-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin: .2rem .6rem .4rem; }
.profile-menu ul { list-style: none; margin: 0; padding: 0; }
.profile-menu a, .profile-menu .menu-button {
  display: flex; width: 100%; justify-content: flex-start; padding: .55rem .7rem; border-radius: 10px; border: 0; box-shadow: none;
  background: none; color: var(--ink); text-decoration: none; font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; min-height: 0;
}
.profile-menu a:hover, .profile-menu .menu-button:hover { background: var(--sun-soft); transform: none; box-shadow: none; }

button.small, .button.small { font-size: .95rem; padding: .35rem .9rem; min-height: 40px; box-shadow: var(--shadow-sm); }

/* ---------- Home: the clubhouse fills the screen ---------- */
.clubhouse-stage { position: relative; width: min(1240px, 100% - 1.5rem); margin: 1rem auto 3.8rem; }
.page-home .clubhouse-art { max-height: calc(100vh - 205px); min-height: 300px; }
.room-hello {
  position: absolute; top: 14px; left: 16px; z-index: 2; margin: 0; font-size: clamp(1.25rem, 3vw, 1.9rem);
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: 999px; padding: .2rem 1.1rem;
  box-shadow: var(--shadow-sm); transform: rotate(-2deg);
}
.track-teens .room-hello { border-radius: 6px; transform: none; }
.dock { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); display: flex; align-items: center; gap: 1rem; z-index: 3; }
.dock-btn {
  display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap;
  background: var(--card); color: var(--ink); text-decoration: none; border: var(--bw) solid var(--ink); border-radius: 999px;
  padding: .6rem 1.3rem .6rem .9rem; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.dock-btn:hover { transform: translateY(-3px); box-shadow: 4px 7px 0 var(--shadow-color); }
.dock-btn:active { transform: translateY(2px); box-shadow: 1px 1px 0 var(--shadow-color); }
.dock-main { background: var(--sun); font-size: 1.5rem; padding: .85rem 2rem .85rem 1.2rem; }
.dock-label { display: flex; flex-direction: column; line-height: 1.05; }
.dock-label small { font-family: var(--font-body); font-weight: 700; font-size: .85rem; opacity: .8; margin-top: .15rem; }
.dock-icon { width: 34px; height: 34px; flex: none; }
.dock-main .dock-icon { width: 48px; height: 48px; }
.track-teens .dock-btn { border-radius: 6px; }
@media (max-width: 680px) {
  .dock { position: static; transform: none; margin-top: 1rem; justify-content: center; flex-wrap: wrap; }
  .dock-main { order: -1; width: 100%; justify-content: center; }
  .page-home .clubhouse-art { max-height: none; min-height: 0; }
}
.room-summary { margin-bottom: 3rem; }
.room-summary details { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: .6rem 1.2rem; box-shadow: var(--shadow-sm); }
.room-summary summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.room-summary h3 { font-size: 1.1rem; margin: 1rem 0 .3rem; }
.room-links { margin: 1rem 0 0; font-weight: 700; }

/* ---------- Decorate ---------- */
.decorate-room { margin-bottom: 1rem; }
.decorate-room .thing { cursor: grab; }
.decorate-room .thing:hover { filter: drop-shadow(0 0 6px rgba(255, 217, 59, .95)); }
.decorate-room .thing.lifted { opacity: .3; }
.decorate-room svg { touch-action: pan-y; }
.spot-target { fill: transparent; pointer-events: none; }
.is-dragging .spot-target.allowed { fill: rgba(255, 217, 59, .38); stroke: #231A15; stroke-width: 3; stroke-dasharray: 9 7; }
.is-dragging .spot-target.hover { fill: rgba(47, 138, 66, .5); stroke-dasharray: none; }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
.drag-ghost { position: fixed; z-index: 100; width: 120px; height: 120px; transform: translate(-50%, -50%) rotate(-5deg); pointer-events: none; filter: drop-shadow(5px 5px 0 rgba(35, 26, 21, .45)); }
.drag-ghost svg { width: 100%; height: 100%; }

.stuff h3 { margin: 2rem 0 .8rem; }
.stuff-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.stuff-item { display: flex; flex-direction: column; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow-sm); }
.stuff-item.is-away { background: var(--paper); border-style: dashed; box-shadow: none; }
.stuff-item.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 50% { background: var(--sun); } }
.stuff-tile {
  height: 112px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: var(--radius-sm); cursor: grab; touch-action: none;
  background-color: var(--sky-soft); background-image: radial-gradient(rgba(35, 26, 21, .1) 1.5px, transparent 1.6px); background-size: 14px 14px;
}
.stuff-tile svg { width: auto; height: 94px; max-width: 82%; }
.stuff-item h4 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: .6rem 0 0; }
.stuff-where { margin: .1rem 0 .6rem; color: var(--ink-soft); font-size: .95rem; }
.stuff-item.is-away .stuff-where { font-style: italic; }
.move-form { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: .4rem; align-items: end; }
.move-form label { grid-column: 1 / -1; margin: 0; font-family: var(--font-body); font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.move-form select { min-height: 42px; padding: .3rem .5rem; font-size: .95rem; }
.shop { margin-top: 3rem; padding-top: 2rem; border-top: 3px dashed var(--ink); }
.shop .shop-head h2 { margin: 0; }
.shop .shop-head .lead { margin: .2rem 0 0; }
.shop-grid { margin-top: 1.4rem; }
.shop-item h3 { font-size: 1.3rem; margin: .9rem 0 .15rem; }
.shop-item.is-locked .shop-tile svg { filter: grayscale(1); opacity: .55; }
.lock-badge { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--card); border: 2px solid var(--ink); border-radius: 50%; }

/* ---------- Settings: profile picture ---------- */
.avatar-form { max-width: 620px; margin-bottom: 1.5rem; }
.avatar-form legend h2, .settings-card > h2 { margin: 0 0 .6rem; font-size: 1.5rem; }
.avatar-choices { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: .6rem; }
.avatar-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; }
.avatar-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-choice .portrait { --size: 84px; }
.avatar-choice:has(input:checked) .portrait { box-shadow: 0 0 0 4px var(--card), 0 0 0 8px var(--grass); }
.avatar-choice:has(input:focus-visible) .portrait { outline: 4px solid var(--focus); outline-offset: 8px; }

/* ---------- Game page ---------- */
.page-game .page-body { max-width: 1180px; }
.coin-win { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; background: var(--sun); border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: .5rem .8rem; }
.move-form { grid-template-columns: 1fr auto; }
.move-form select { grid-column: 1 / -1; }
.move-form button { grid-column: 2; }

/* Back link sits on the left, right after the logo */
.header-row { grid-template-columns: auto auto 1fr auto; grid-template-areas: "brand back . right"; column-gap: 1.2rem; }
.back-link { justify-self: start; }
@media (max-width: 640px) {
  .header-row { grid-template-columns: 1fr auto; grid-template-areas: "brand right" "back back"; }
}

/* =====================================================================
   Decorate v2: the room and the drawer side by side, drag anywhere on a snap grid
   ===================================================================== */
.decorate-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.2rem; align-items: start;
  width: min(1500px, 100% - 1.5rem); margin: 1rem auto 3rem;
}
.decorate-stage { position: sticky; top: .8rem; }
.decorate-stage .room-hello { top: 12px; left: 14px; }
.page-decorate .decorate-room { margin: 0; }
.page-decorate .clubhouse-art { max-height: calc(100vh - 150px); touch-action: none; }
.drag-tip { margin: .6rem 0 0; text-align: center; font-weight: 700; color: var(--ink-soft); }
.room-toolbar {
  position: absolute; left: 50%; bottom: 3rem; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: .7rem;
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: 999px; padding: .35rem .5rem .35rem 1.1rem; box-shadow: var(--shadow);
}
.room-toolbar[hidden] { display: none; }
.room-toolbar-name { font-family: var(--font-display); font-weight: 700; }
.room-toolbar-tip { font-size: .85rem; color: var(--ink-soft); padding-right: .6rem; }
@media (hover: none) { .room-toolbar-tip { display: none; } }

.drawer {
  position: sticky; top: .8rem; max-height: calc(100vh - 1.6rem); overflow: auto; overscroll-behavior: contain;
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 .9rem .9rem;
  transition: background-color .15s ease;
}
.drawer.drop-away { background: var(--berry-soft); }
.drawer.drop-away::before {
  content: "Drop here to put it away"; position: sticky; top: 3.6rem; z-index: 3; display: block; text-align: center; margin: .5rem 0;
  padding: .5rem; border: 3px dashed var(--ink); border-radius: var(--radius-sm); background: var(--card); font-family: var(--font-display); font-weight: 700;
}
.drawer-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: .4rem; padding: .8rem 0 .6rem; background: inherit; }
.drawer-tab { flex: 1; box-shadow: none; background: var(--paper); min-height: 44px; }
.drawer-tab[aria-selected="true"] { background: var(--sun); box-shadow: var(--shadow-sm); }
.drawer-panel h3 { font-size: 1rem; margin: 1rem 0 .5rem; text-transform: uppercase; letter-spacing: .08em; color: var(--kicker); }
.drawer-panel .wallet { margin: .4rem 0 .8rem; font-size: 1rem; padding: .35rem 1rem .35rem .5rem; }
.tile-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.tile-item {
  display: flex; flex-direction: column; align-items: stretch; gap: .2rem; padding: .45rem; position: relative;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-sm);
}
.tile-item.in-room { background: var(--grass-soft); }
.tile-art {
  height: 78px; display: grid; place-items: center; border-radius: 9px; cursor: grab; touch-action: none; position: relative;
  background-color: var(--card); background-image: radial-gradient(rgba(35, 26, 21, .09) 1.3px, transparent 1.4px); background-size: 12px 12px;
}
.tile-art svg { width: auto; height: 64px; max-width: 86%; pointer-events: none; }
.tile-art:hover svg { transform: scale(1.08) rotate(-3deg); transition: transform .12s ease; }
.tile-name { margin: .2rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: .9rem; line-height: 1.15; }
.tile-state, .tile-price { margin: 0; font-size: .78rem; color: var(--ink-soft); font-weight: 700; display: flex; align-items: center; gap: .3rem; }
.tile-price .coin { width: 18px; height: 18px; }
.tile-form { margin-top: auto; }
.tile-btn { width: 100%; font-size: .82rem; min-height: 32px; padding: .2rem .4rem; box-shadow: none; background: var(--card); }
.tile-btn.buy { background: var(--sun); }
.tile-item.is-locked .tile-art svg { filter: grayscale(1); opacity: .5; }
.tile-item.is-short .tile-art svg { filter: saturate(.5); }
.tile-item .lock-badge { width: 32px; height: 32px; top: 4px; right: 4px; }
.tile-item .lock-badge .icon { width: 20px; height: 20px; }

/* Things in the room while decorating */
.decorate-room .thing { cursor: grab; }
.decorate-room .thing:hover { filter: drop-shadow(0 0 5px rgba(255, 217, 59, .95)); }
.decorate-room .thing.selected { filter: drop-shadow(0 0 0 #231A15) drop-shadow(0 0 6px rgba(255, 217, 59, 1)) drop-shadow(0 0 2px rgba(255, 217, 59, 1)); }
.decorate-room .thing.lifted { filter: drop-shadow(6px 10px 0 rgba(35, 26, 21, .35)); cursor: grabbing; }
.decorate-room .thing.invalid { filter: drop-shadow(0 0 6px rgba(216, 52, 74, 1)) drop-shadow(0 0 2px rgba(216, 52, 74, 1)); opacity: .8; }
.decorate-room .thing.away { opacity: .35; }
.room-grid { opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.show-grid .room-grid { opacity: 1; }
.drag-ghost { width: 96px; height: 96px; }

@media (max-width: 1000px) {
  .decorate-layout { grid-template-columns: 1fr; }
  .decorate-stage { top: 0; z-index: 5; background: var(--paper); padding-top: .4rem; }
  .page-decorate .clubhouse-art { max-height: 44vh; }
  .drag-tip { display: none; }
  .drawer { position: static; max-height: none; }
  .room-toolbar { bottom: .6rem; }
}
.room-toolbar { left: auto; right: 14px; top: 12px; bottom: auto; transform: none; white-space: nowrap; padding: .25rem .35rem .25rem .9rem; gap: .5rem; }
.room-toolbar .small { min-height: 34px; padding: .2rem .8rem; }
@media (max-width: 1000px) { .room-toolbar { top: auto; bottom: .6rem; right: .6rem; } .room-toolbar-tip { display: none; } }
