/* ==========================================================================
   The Allowance Adventure — one stylesheet, no JavaScript anywhere.
   ========================================================================== */

:root {
  --cream:   #fdf7ec;
  --paper:   #ffffff;
  --ink:     #1c1a17;
  --ink-soft:#5b554c;
  --line:    #1c1a17;

  --mint:    #10b981;
  --mint-dk: #0b8f66;
  --coral:   #ff6b53;
  --sun:     #ffd166;
  --grape:   #7c5cff;

  --bg:      var(--cream);
  --surface: var(--paper);
  --tint:    #eafaf3;
  --text:    var(--ink);
  --muted:   var(--ink-soft);
  --border:  var(--line);
  --accent:  var(--mint);
  --accent-ink: #1c1a17;      /* text on a mint face: 6.8:1 (white was 2.5:1) */
  --accent-text: #0a7a57;     /* mint used AS text on white/tint: 5.3:1 */
  --grape-deep: #6a47f0;      /* grape card face: white text 5.6:1 */

  --radius:  18px;
  --radius-sm: 10px;
  --shadow:  5px 5px 0 var(--border);
  --shadow-lg: 8px 8px 0 var(--border);
  --bw: 2.5px;

  --measure: 68ch;
  --wrap: 1080px;
  --wrap-wide: 1320px;

  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Semibold", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #15141a;
    --surface: #201e28;
    --tint:    #1c2a26;
    --text:    #f3efe6;
    --muted:   #a9a2b5;
    --border:  #423e50;
    --accent:  #2ee6a8;
    --accent-ink: #10231c;
    --accent-text: #2ee6a8;
    --shadow:  5px 5px 0 var(--border);
    --shadow-lg: 8px 8px 0 var(--border);
  }
}

/* --------------------------------------------------------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--sun) 22%, transparent) 0, transparent 38%),
    radial-gradient(circle at 88% 4%, color-mix(in srgb, var(--mint) 18%, transparent) 0, transparent 34%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; background: color-mix(in srgb, var(--border) 18%, transparent); padding: .1em .4em; border-radius: 5px; }

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 4px; }
/* The skip link moves focus to <main>; that is not something to draw a ring around. */
main:focus { outline: none; }

.muted { color: var(--muted); }
.fineprint { font-size: .8rem; color: var(--muted); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--accent); color: var(--accent-ink); padding: .7rem 1.1rem; font-weight: 700;
}
.skip:focus { left: .5rem; top: .5rem; }

/* --------------------------------------------------------- header -------- */

.site-head {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; }
.brand__coin { width: 2rem; height: 2rem; display: inline-block; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.brand:hover .brand__coin { transform: rotate(-18deg) scale(1.15); }

/* Picture and SVG icons that stand in next to text (they used to be emoji). */
.icon { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -.25em; }
.chip__icon, .btn__icon { width: 1.5em; height: 1.5em; vertical-align: middle; }
.site-foot__logo { width: 1.1em; height: 1.1em; vertical-align: -.15em; }

/* The numbered steps are the site's main nav: top-right of the header, or
   left-aligned under the title once there's no room beside it. */
.stepper {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.stepper__item a {
  display: flex; align-items: center; gap: .45rem;
  min-height: 2.75rem;
  text-decoration: none;
  padding: .3rem .8rem .3rem .3rem;
  border: var(--bw) solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700; font-size: .9rem;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stepper__item a:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--border); }
.stepper__num {
  flex: none;
  width: 1.55rem; height: 1.55rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--border) 15%, transparent);
  font-size: .8rem;
}
.stepper__item.is-current a { background: var(--accent); color: var(--accent-ink); box-shadow: 3px 3px 0 var(--border); }
.stepper__item.is-current .stepper__num { background: color-mix(in srgb, var(--accent-ink) 25%, transparent); }
.stepper__item.is-done a { background: var(--tint); }
.stepper__item.is-done .stepper__num { color: transparent; position: relative; }
/* Done steps swap the number for a check; a mask keeps it in the text colour in both themes. */
.stepper__item.is-done .stepper__num::after {
  content: ""; position: absolute; inset: 18%;
  background: var(--text);
  -webkit-mask: url("/assets/icons/check.svg") center / contain no-repeat;
          mask: url("/assets/icons/check.svg") center / contain no-repeat;
}

/* Phones: the pills drop under the title, stay on one line, and stack the number
   over the label so every one is a comfortable (48px) touch target down to 320px. */
@media (max-width: 620px) {
  .site-nav { width: 100%; }
  .stepper { flex-wrap: nowrap; gap: .3rem; }
  .stepper__item { flex: 1 1 0; min-width: 0; }
  .stepper__item a {
    flex-direction: column; justify-content: center; gap: .1rem;
    min-height: 3rem; height: 100%;
    padding: .3rem .2rem;
    border-radius: 16px;
    font-size: clamp(.68rem, 3.1vw, .85rem); line-height: 1.15;
    text-align: center; white-space: normal;
  }
  .stepper__num { width: 1.3rem; height: 1.3rem; font-size: .72rem; }
}

/* --------------------------------------------------------- layout ------- */

main { min-height: 40vh; }

.band {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2.75rem clamp(1rem, 4vw, 2.5rem);
}
.band--wide { max-width: var(--wrap-wide); }
.band--tint {
  max-width: none;
  background: var(--tint);
  border-top: var(--bw) solid var(--border);
  border-bottom: var(--bw) solid var(--border);
  margin: 2rem 0;
  /* Keep the text lined up with the rest of the page while the tint runs full-bleed. */
  padding-inline: max(
    clamp(1rem, 4vw, 2.5rem),
    calc((100% - var(--wrap)) / 2 + clamp(1rem, 4vw, 2.5rem))
  );
}

.section-title { margin-bottom: .35em; }
.section-title--sm { font-size: 1.25rem; }
.section-lede { max-width: var(--measure); color: var(--muted); font-size: 1.05rem; margin-bottom: 2rem; }

.eyebrow {
  font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .6rem;
}
.eyebrow a { color: inherit; }

/* --------------------------------------------------------- hero --------- */

.hero {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2.5rem) 3rem;
  text-align: center;
  overflow: hidden;
}
.hero__title { margin-bottom: .4em; }
.hero__lede {
  max-width: 46ch; margin: 0 auto 2rem;
  font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem);
  color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

.hero__coins { position: absolute; inset: 0; pointer-events: none; }
.coin { position: absolute; width: 3rem; height: 3rem; opacity: .8; animation: bob 5s ease-in-out infinite; }
.coin--1 { left: 6%;  top: 18%; animation-delay: 0s;   }
.coin--2 { right: 9%; top: 12%; animation-delay: .8s;  width: 3.6rem; height: 3.6rem; }
.coin--3 { right: 5%; bottom: 22%; animation-delay: 1.6s; }
.coin--4 { left: 11%; bottom: 16%; animation-delay: 2.4s; width: 2.4rem; height: 2.4rem; }
@media (max-width: 780px) { .hero__coins { display: none; } }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-14px) rotate(8deg); }
}

.squiggle {
  height: 22px;
  background-repeat: repeat-x;
  background-size: 44px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='22' viewBox='0 0 44 22'%3E%3Cpath d='M0 15 Q11 2 22 15 T44 15' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: .8;
}

/* --------------------------------------------------------- buttons ------ */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 2.75rem;
  padding: .7rem 1.3rem;
  border: var(--bw) solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .13s ease, box-shadow .13s ease, background .13s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--big { font-size: 1.05rem; padding: .9rem 1.7rem; }
.btn--sm { font-size: .85rem; padding: .45rem .95rem; min-height: 2.75rem; box-shadow: 3px 3px 0 var(--border); }

/* --------------------------------------------------------- how it works - */

.howto {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  counter-reset: howto;
}
/* four cards: one row on a laptop, a tidy 2 x 2 on a tablet (not 3 + 1) */
@media (min-width: 560px) and (max-width: 899px) { .howto { grid-template-columns: repeat(2, 1fr); } }
.howto__step {
  position: relative;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
}
.howto__num {
  position: absolute; top: -1.1rem; left: 1.2rem;
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  border: var(--bw) solid var(--border);
  border-radius: 50%;
  background: var(--sun);
  color: #1c1a17;
  font-family: var(--font-display);
  font-weight: 800;
}
.howto__step:nth-child(2) .howto__num { background: var(--coral); color: #1c1a17; }
.howto__step:nth-child(3) .howto__num { background: var(--grape-deep); color: #fff; }
.howto__step h3 { margin-bottom: .35em; }
.howto__step p { margin: 0; color: var(--muted); font-size: .96rem; }

/* --------------------------------------------------------- chips -------- */

.chips { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 2.75rem;
  padding: .5rem 1rem;
  border: var(--bw) solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: transform .13s ease, background .13s ease;
}
.chip:hover { transform: translateY(-2px); background: var(--tint); }

/* --------------------------------------------------------- video -------- */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: #0d0d10;
  margin: 0 0 2rem;
}
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player--empty { background: var(--surface); display: grid; place-items: center; }
.player--soon > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player__veil {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center;
  text-align: center; color: #fff;
  background: rgba(12, 12, 16, .58);
  backdrop-filter: blur(2px);
}
.player__veil p { margin: 0; }
.player__veil strong {
  display: inline-block;
  padding: .4rem 1.1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  border: 2px solid rgba(255, 255, 255, .45);
}
.player--soon .player__reel { width: 3rem; height: 3rem; }
.player__placeholder { text-align: center; padding: 1.5rem; }
.player__placeholder p { margin: .2rem 0; }
.player__reel { width: 3.5rem; height: 3.5rem; display: block; margin: 0 auto .5rem; animation: bob 6s ease-in-out infinite; }
/* "Video not playing?" line under a real player: a fallback for a school filter or an old browser. */
.player + .player__note { margin: -1.25rem 0 2rem; font-size: .9rem; color: var(--muted); }

/* --------------------------------------------------------- page heads --- */

.pagehead {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 0;
}
.pagehead .hero__lede { margin-left: 0; text-align: left; }
.lesson__icon { width: 1.15em; height: 1.15em; margin-right: .15em; vertical-align: -.15em; }
.lesson__duration { color: var(--muted); font-weight: 600; }

/* --------------------------------------------------------- thumbnails --- */

/* Shared by lesson cards and game cards. Drop a `thumb` path in the data file and
   the image takes over; leave it empty and the entry's icon fills the panel. */
.thumb {
  display: block;
  overflow: hidden;
  background: var(--tint);
  border: var(--bw) solid var(--border);
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb--icon { display: grid; place-items: center; }
.thumb__icon { width: 45%; height: auto; max-height: 80%; }

.thumb--lesson {
  flex: none;
  width: 15rem;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  font-size: 3rem;
}
@media (max-width: 640px) {
  .lesson-card__link { flex-direction: column; }
  .thumb--lesson { width: 100%; }
}

.thumb--game {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-bottom: var(--bw) solid var(--border);
  font-size: 4rem;
}

/* --------------------------------------------------------- lesson list -- */

.lesson-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; counter-reset: lesson; }
.lesson-card__link {
  position: relative;
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.lesson-card__link:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); background: var(--tint); }
.lesson-card__link:hover .lesson-card__go, .game-card__link:hover .game-card__go { text-decoration: underline; text-underline-offset: 3px; }
.lesson-card__body { min-width: 0; }
.lesson-card__meta { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lesson-card__title, .game-card__title { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.2; }
.lesson-card__title { margin: .15rem 0 .3rem; }
.lesson-card__desc { margin: 0; color: var(--muted); font-size: .96rem; max-width: var(--measure); }
.lesson-card__go { display: inline-block; margin: .7rem 0 0; font-weight: 700; color: var(--accent-text); }

/* A card has one link, its title. The title's ::after stretches over the whole card so all of it
   is clickable, while a screen reader hears just the title. */
.lesson-card__title a, .game-card__title a { color: inherit; text-decoration: none; }
.lesson-card__title a::after, .game-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.lesson-card__title a:focus-visible, .game-card__title a:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; }
@supports selector(:has(*)) {
  .lesson-card__title a:focus-visible, .game-card__title a:focus-visible { outline: none; }
  .lesson-card__link:has(a:focus-visible), .game-card__link:has(a:focus-visible) { outline: 3px solid var(--grape); outline-offset: 3px; }
}

/* --------------------------------------------------------- lesson page -- */

.lesson__cols {
  display: grid; gap: 1.5rem;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 780px) { .lesson__cols { grid-template-columns: 1fr; } }
.lesson__desc p { max-width: var(--measure); }

.takeaways {
  background: var(--sun);
  color: #1c1a17;
  border: var(--bw) solid #1c1a17;
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 5px 5px 0 #1c1a17;
}
.takeaways--alt { background: var(--grape-deep); color: #fff; border-color: #1c1a17; }
.takeaways--alt :focus-visible { outline-color: #fff; }
.takeaways:not(.takeaways--alt) :focus-visible { outline-color: #1c1a17; }
.takeaways__title { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8em; }
.takeaways ul { margin: 0; padding-left: 1.15rem; }
.takeaways li { margin-bottom: .5rem; }
.takeaways li::marker { content: "→ "; font-weight: 800; }
.takeaways .btn { margin-top: .6rem; background: #fff; color: #1c1a17; border-color: #1c1a17; box-shadow: 3px 3px 0 #1c1a17; }

/* --------------------------------------------------------- games -------- */

.game-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.game-card { display: flex; flex-direction: column; }
.game-card__link {
  position: relative;
  display: flex; flex-direction: column; flex: 1;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card__link:hover { transform: translate(-3px, -3px) rotate(-.5deg); box-shadow: var(--shadow-lg); }
.game-card:nth-child(2n) .thumb--icon { background: color-mix(in srgb, var(--sun) 45%, var(--surface)); }
.game-card:nth-child(3n) .thumb--icon { background: color-mix(in srgb, var(--coral) 30%, var(--surface)); }
.game-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.15rem 1.3rem 1.3rem; }
.game-card__title { margin: 0; }
.game-card__tagline { color: var(--muted); font-size: .95rem; margin: .3rem 0 .9rem; }
.game-card__go { margin: auto 0 0; font-weight: 700; color: var(--accent-text); }

/* Finish page: one row of 2:3 cover posters. A playable game opens in a new tab; a coming-soon
   game (comingSoon.json) has no link, and hover, keyboard focus or a tap (the card is
   focusable) fades in the "Stay tuned!" veil. */
.poster-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) { .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .poster-grid { grid-template-columns: 1fr; } }
.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.poster:hover, .poster:focus-within, .poster--soon:focus { transform: translate(-3px, -3px) rotate(-.5deg); box-shadow: var(--shadow-lg); }
.poster--soon { cursor: default; }
.poster--soon:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; }
.poster__link { display: block; height: 100%; border-radius: inherit; }
.poster__link:focus-visible { outline: none; }
.poster:has(.poster__link:focus-visible) { outline: 3px solid var(--grape); outline-offset: 3px; }
.poster__cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster__play {
  position: absolute; right: .7rem; bottom: .7rem;
  font-weight: 800; font-size: .95rem;
  background: var(--sun); color: #1c1a17;
  border: var(--bw) solid #1c1a17; border-radius: 999px;
  padding: .2em .8em;
  box-shadow: 3px 3px 0 #1c1a17;
  opacity: 0; transition: opacity .2s ease;
}
.poster:hover .poster__play, .poster:focus-within .poster__play { opacity: 1; }
.poster__veil {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; padding: 1rem; text-align: center;
  background: color-mix(in srgb, #1c1a17 72%, transparent);
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
}
.poster--soon:hover .poster__veil, .poster--soon:focus .poster__veil { opacity: 1; }
.poster__veil p { margin: 0; }
.poster__stay {
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1.1;
  background: var(--sun); color: #1c1a17;
  border: var(--bw) solid #1c1a17; border-radius: 999px;
  padding: .25em .75em;
  box-shadow: 3px 3px 0 #1c1a17;
  transform: rotate(-3deg);
}
.poster__when { font-weight: 800; font-size: 1rem; margin-top: .6rem !important; }
.poster__tagline { font-size: .88rem; opacity: .9; max-width: 22ch; }

/* --------------------------------------------------------- game stage --- */

/* The games are built for a window of about 1100x690 and up (see games/shared/tech-standards.md),
   so the iframe is always laid out at least that big. In a smaller box the frame is made
   --f times larger and scaled back down by 1/--f, which keeps every game's layout intact
   instead of squeezing it. --f is stepped by screen width (the box is about 1.16 x the
   window width minus the page margins); phones in portrait get the game's own
   "turn your device sideways" card at a tall 3:4 instead. */
.stage {
  --f: 1;
  position: relative;
  aspect-ratio: 16 / 10;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: .75rem;
}
.stage__frame {
  position: absolute; top: 0; left: 0; display: block; border: 0;
  width: calc(100% * var(--f)); height: calc(100% * var(--f));
  transform: scale(calc(1 / var(--f))); transform-origin: 0 0;
}
@media (max-width: 1180px) { .stage { --f: 1.05; } }
@media (max-width: 1100px) { .stage { --f: 1.15; } }
@media (max-width: 1000px) { .stage { --f: 1.28; } }
@media (max-width: 900px)  { .stage { --f: 1.45; } }
@media (max-width: 800px)  { .stage { --f: 1.65; } }
@media (max-width: 700px) and (orientation: portrait) { .stage { --f: 1; aspect-ratio: 3 / 4; } }
/* A phone held sideways is short as well as narrow: make the game as tall as the screen. */
@media (max-height: 520px) and (orientation: landscape) {
  .stage { --f: 1.9; width: min(100%, calc((100dvh - 1.5rem) * 1.6)); margin-inline: auto; }
}
.stage--empty { display: grid; place-items: center; --f: 1; min-height: 16rem; }
.stage__note { font-size: .9rem; color: var(--muted); margin-bottom: 2rem; }
.mobile-warn { display: none; }
.mobile-warn__icon { flex: none; width: 1.8rem; height: 1.8rem; }
@media (max-width: 700px) {
  .mobile-warn {
    display: flex; gap: .6rem; align-items: flex-start;
    margin-bottom: 1rem; padding: .8rem 1rem;
    border: var(--bw) solid var(--border); border-radius: 14px;
    background: var(--tint); font-size: .9rem;
  }
}

/* --------------------------------------------------------- pager -------- */

.pager {
  max-width: var(--wrap);
  margin: 1rem auto 3rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: grid; gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 620px) { .pager { grid-template-columns: 1fr; } }
.pager__link {
  display: block;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.2rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.pager__link:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); background: var(--tint); }
.pager__link--next { text-align: right; }
.pager__dir { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pager__title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }

/* --------------------------------------------------------- next step ---- */

.nextstep {
  margin-top: 2.5rem;
  padding: 1.75rem;
  text-align: center;
  border: var(--bw) dashed var(--border);
  border-radius: var(--radius);
}
.nextstep__label { font-weight: 700; color: var(--muted); margin-bottom: .8rem; }

/* --------------------------------------------------------- footer ------- */

.site-foot {
  border-top: var(--bw) solid var(--border);
  margin-top: 2rem;
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 3rem;
  text-align: center;
  background: var(--surface);
}
.site-foot__mark { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin-bottom: .2rem; }
.site-foot__nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; justify-content: center; margin: 1rem 0; font-weight: 600; }
.site-foot__nav a { display: inline-block; padding: .65rem .25rem; }

/* --------------------------------------------------------- 404 --------- */

.lost { max-width: var(--wrap); margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem; text-align: center; }
.lost__icon { width: 7rem; height: 7rem; display: block; margin: 0 auto 1rem; animation: bob 6s ease-in-out infinite; }
.lost .hero__lede { margin-inline: auto; text-align: center; }

/* --------------------------------------------------------- print -------- */

@media print {
  :root { --bg: #fff; --surface: #fff; --tint: #fff; --text: #000; --muted: #333; --border: #000; --shadow: none; --shadow-lg: none; }
  body { background: #fff; background-image: none; font-size: 12pt; }
  .skip, .site-nav, .hero__coins, .squiggle, .hero__actions, .player, .player__note, .stage, .mobile-warn, .pager, .nextstep, .site-foot__nav { display: none !important; }
  .site-head, .band, .pagehead, .pager, .hero, .site-foot { max-width: none; padding-inline: 0; }
  .band--tint { border: 0; margin: 0; padding-inline: 0; }
  .takeaways, .takeaways--alt { background: #fff; color: #000; border: 1.5pt solid #000; box-shadow: none; }
  .lesson-card__link, .game-card__link, .howto__step { box-shadow: none; break-inside: avoid; }
  .thumb { display: none; }
  a { text-decoration: none; }
  .lesson__cols, .howto, .game-grid { display: block; }
  .howto__step { margin-bottom: 1rem; }
}
