@font-face{font-family:Series Sans;src:url('assets/fonts/series-noto.woff2?v=1') format('woff2');font-weight:100 900;font-display:swap}
:root{--series-font:'Series Sans','PingFang TC',sans-serif}
.player-header,.player-controls,.series-next,.series-return{font-family:var(--series-font)}
.world-1{--world-color:#215e91;--world-soft:#c9efff;--world-shadow:#6eafcb}
.world-2{--world-color:#a34d29;--world-soft:#ffe0c4;--world-shadow:#cd996c}
.world-3{--world-color:#645497;--world-soft:#e6dcff;--world-shadow:#ab96c8}
.world-4{--world-color:#256977;--world-soft:#c8f2e6;--world-shadow:#79b9b2}
.world-5{--world-color:#a95723;--world-soft:#ffedaf;--world-shadow:#d2b365}
a.series-next{display:flex;flex-direction:column;text-decoration:none;cursor:pointer;transition:transform .15s,box-shadow .15s}
a.series-next:hover{transform:translateY(-2px);outline:2px solid currentColor;outline-offset:3px}
a.next-world.series-next{background:#fff7d899;border-radius:0;padding:0 1.2cqw;color:var(--ink);border:0;border-left:.25cqw solid var(--accent)}
.series-next-arrow{font-style:normal;margin-left:.4em}
.series-return{display:inline-block;color:var(--accent-color,#9b4c24);font-size:1.5cqw;font-weight:750;text-decoration:underline;text-underline-offset:.25em;margin-top:1cqw}
.navigation .arrow-button[data-cross-chapter]{outline:2px dashed currentColor;outline-offset:3px}

/* One overview for the complete adventure, isolated from chapter palettes. */
dialog#overview.series-overview{font-family:var(--series-font);color:#233d53;background:#f3f9f5;width:min(1160px,calc(100vw - 48px));max-width:none;max-height:90dvh;padding:0;border:3px solid #416275;border-radius:16px;box-shadow:0 8px 0 #6b96aa,0 20px 90px #193b5555;overflow:auto;scrollbar-color:#7c9dac #e3eceb;color-scheme:light}
#overview.series-overview::backdrop{background:#17384ccc;backdrop-filter:blur(5px)}
.series-overview .series-overview-top{position:sticky;top:0;z-index:3;padding:22px 28px 18px;background:#f3f9f5f7;border-bottom:2px solid #b8cdd0;backdrop-filter:blur(12px)}
.series-overview .dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0}
.series-overview .series-kicker{display:block;font-size:11px;color:#54728a;margin-bottom:7px;letter-spacing:.06em}
.series-overview .dialog-heading h2{font-size:30px;line-height:1.2;color:#233d53;margin:0;font-weight:850;letter-spacing:-.025em}
.series-overview .series-total{display:block;font-size:15px;color:#506e7c;margin-top:8px}
.series-overview .close-button{flex-shrink:0;width:42px;height:42px;background:#245e83;color:white;border:2px solid #244f6a;border-radius:8px;box-shadow:0 3px 0 #8fb4c5;font-size:22px}
.series-overview .series-jump{display:flex;gap:8px;margin-top:17px;flex-wrap:wrap}
.series-overview .series-jump-button{background:var(--world-soft);color:var(--world-color);font-family:var(--series-font);border:1.5px solid var(--world-shadow);border-radius:8px;font-size:15px;line-height:1.4;padding:8px 11px;font-weight:750}
.series-overview .series-jump-button[aria-pressed=true]{outline:2px solid var(--world-color);outline-offset:2px}
.series-overview .series-jump-button:hover{filter:brightness(.96)}
.series-overview .series-home{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:24px 28px 0;padding:18px 20px;border:2px solid #86adbd;background:#e0f1f6;border-radius:10px;text-decoration:none;color:#28516d}
.series-overview .series-home strong{font-size:20px;color:inherit}
.series-overview .series-home span{font-size:15px;color:#476e80}
.series-overview #overview-grid{display:block;padding:0 28px 30px;margin:0}
.series-overview .series-group{scroll-margin-top:202px;padding-top:30px}
.series-overview .series-group-heading{display:flex;align-items:center;justify-content:space-between;padding:0 0 13px;border-bottom:2px solid var(--world-shadow);margin-bottom:15px}
.series-overview .series-group-title{display:flex;align-items:center;gap:16px;text-decoration:none;color:var(--world-color)}
.series-overview .series-group-title .mono{font-size:12px;white-space:nowrap;background:var(--world-soft);padding:9px 10px;border-radius:6px}
.series-overview .series-group-title h3{font-size:24px;font-weight:800;color:inherit;margin:0}
.series-overview .series-group-count{font-size:15px;font-weight:700;color:var(--world-color);white-space:nowrap}
.series-overview .series-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.series-overview .series-slide{display:grid;grid-template-columns:66px minmax(0,1fr);gap:12px;padding:12px;min-height:144px;text-decoration:none;color:#263e4d;background:#fffef7;border:1.5px solid #bbccd0;border-radius:9px;box-shadow:0 3px 0 #d8e3e3;transition:transform .15s,box-shadow .15s}
.series-overview .series-slide:hover{transform:translateY(-2px);box-shadow:0 5px 0 var(--world-shadow);border-color:var(--world-color)}
.series-overview .series-slide[aria-current=page]{background:var(--world-soft);outline:2px solid var(--world-color);outline-offset:1px}
.series-overview .series-slide-preview{position:relative;height:120px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--world-soft);border-radius:5px}
.series-overview .series-slide-preview img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.series-overview .series-slide-copy{align-self:center;min-width:0}
.series-overview .series-slide-number{font-size:11px;color:var(--world-color);display:block;margin-bottom:8px}
.series-overview .series-slide-copy strong{font-size:16px;line-height:1.55;color:#263e4d;display:block;font-weight:750;overflow-wrap:anywhere}
.series-overview .series-slide-copy small{font-size:12px;color:#617c87;display:block;margin-top:7px;line-height:1.4}
.series-overview .series-text-preview{font-size:11px;color:var(--world-color)}
.series-overview .series-video{position:absolute;bottom:3px;left:3px;right:3px;font-size:10px;color:white;background:#23405bcc;border-radius:3px;padding:3px;text-align:center}
.series-overview :is(a,button):focus-visible{outline:3px solid #226da4;outline-offset:3px}
@media(max-width:1000px){.series-overview .series-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
 dialog#overview.series-overview{width:calc(100vw - 20px);max-height:94dvh;border-width:2px;border-radius:12px}
 .series-overview .series-overview-top{padding:17px 16px 15px}.series-overview .dialog-heading h2{font-size:25px}.series-overview .series-total{font-size:14px}
 .series-overview .series-jump{gap:7px}.series-overview .series-jump-button{font-size:13px;padding:7px 9px}.series-overview .series-kicker{font-size:9px}
 .series-overview .series-home{margin:18px 16px 0;padding:14px;align-items:flex-start;flex-direction:column;gap:4px}.series-overview .series-home strong{font-size:20px}
 .series-overview #overview-grid{padding:0 16px 24px}.series-overview .series-group{scroll-margin-top:243px;padding-top:25px}.series-overview .series-group-title{gap:9px}.series-overview .series-group-title h3{font-size:20px}.series-overview .series-group-title .mono{font-size:9px;padding:7px}.series-overview .series-group-count{font-size:13px}
 .series-overview .series-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.series-overview .series-slide{grid-template-columns:1fr;gap:9px;padding:11px;min-height:0}.series-overview .series-slide-preview{height:106px}.series-overview .series-slide-copy strong{font-size:15px;line-height:1.5}.series-overview .series-slide-copy small{font-size:12px}.series-overview .series-slide-number{margin-bottom:5px;font-size:10px}
 a.next-world.series-next{padding:3cqw 4cqw;border-radius:2cqw;border-width:1px}.series-return{font-size:16px;margin-top:14px}
}
@media(prefers-reduced-motion:reduce){.series-overview .series-slide,a.series-next{transition:none}}

.series-next br{display:initial}

/* Wordmark: brand half links to the site, guide half back to the deck cover. */
.wordmark a{text-decoration:none}
.wordmark-brand{display:flex;align-items:center;gap:inherit}
.wordmark a:hover{text-decoration:underline;text-underline-offset:3px}

/* ---------------------------------------------------------------------------
   Phone fit: one slide = one screen.
   The portrait rules in styles.css reflow a 16:9 slide into a tall stack that
   ran 1.2-1.9x the deck height (worse in chapters 2-5), so every slide had to
   be scrolled. Here the slide fills the deck exactly - fixed top strip,
   flexible content, footer pinned - and slideshow.js shrinks the content block
   (fitSlide) by just enough that it fits.
   Selectors are #deck-prefixed on purpose: this is an override layer, and the
   per-chapter sheets size their screenshots with 3-class selectors such as
   `.big-screen .lesson-screen .shot img` that outrank a bare `.shot img`.
   Images cap with max-height rather than height so a wide graphic keeps its
   own (width-limited) height instead of sitting in a letterboxed slot, while a
   tall phone screenshot is bounded by the screen instead of by how much copy
   sits above it. Tapping one still opens the full-size lightbox.
   Keep `overflow-y:auto` on .slide: if the fit script or `zoom` is
   unavailable, a slide scrolls as it used to instead of clipping.
   --------------------------------------------------------------------------- */
@media(max-width:680px) and (orientation:portrait){
  .player-header{height:46px}
  .player-controls{height:56px}
  #deck{height:calc(100dvh - 108px);overflow:hidden}
  #deck .slide{display:flex;flex-direction:column;height:100%;min-height:0;padding:0 5cqw;overflow-y:auto;overflow-x:hidden}
  /* The #deck prefix above outranks styles.css's `.slide[hidden]{display:none}`,
     so the inactive slides need it restored here or the deck renders as one
     tall stack of every slide. */
  #deck .slide[hidden]{display:none}
  #deck .slide-top{flex:0 0 auto;height:auto;min-height:0;padding:2.5cqw 0 0}
  #deck .content{flex:1 1 auto;min-height:0;padding-top:3cqw}
  #deck .slide-footer{flex:0 0 auto;min-height:0;margin-top:2.5cqw}
  #deck .split,#deck .split.reverse,#deck .dual .split,#deck .cover-layout{gap:3.5cqw}
  #deck .visual{padding:0}
  #deck .visual:before{display:none}
  #deck .shot{gap:1.5cqw}
  #deck .shot img,#deck .shot video{width:auto;height:auto;max-width:100%;max-height:31dvh;object-fit:contain}
  #deck .paired-shots .shot img{width:auto;max-height:27dvh}
  #deck p,#deck .dual p{line-height:1.75;margin:2cqw 0 0}
  #deck .subtitle,#deck .dual .subtitle{margin:2.5cqw 0 3cqw;line-height:1.5}
  #deck .station{min-height:18cqw}
  #deck .loop-arrow{line-height:1}
}

/* Short phones (a 640px-tall Android leaves ~530px for a slide): buy the fit
   back from the chrome and the screenshot before the type has to shrink. */
@media(max-width:680px) and (orientation:portrait) and (max-height:700px){
  .player-header{height:42px}
  .player-controls{height:50px}
  #deck{height:calc(100dvh - 96px)}
  #deck .slide{padding:0 4cqw}
  #deck .shot img,#deck .shot video{max-height:25dvh}
  /* The finale slides put a decorative aria-hidden mascot in the flow, where
     it costs ~120px the copy needs on a short screen. Drop it there rather
     than shrink the type or cut a line of copy; the chapter art elsewhere is
     absolutely positioned and unaffected. */
  #deck .lesson-mascot{display:none}
  /* The chapter-1 game-loop diagram is spacing-bound, not min-height-bound:
     its five stations size to their own text, so the room comes from the
     padding and gaps around them. */
  #deck .station{min-height:16cqw;padding:2cqw 4cqw}
  #deck .loop-stations{gap:1.5cqw}
  #deck .game-loop{margin-top:4cqw}
  #deck .world-map .map-intro{margin-top:4cqw}
  #deck .chapter-road{gap:3cqw;padding-top:3cqw;margin-top:3cqw}
  #deck .paired-shots .shot img{max-height:22dvh}
  #deck .split,#deck .split.reverse,#deck .dual .split,#deck .cover-layout{gap:2.5cqw}
  #deck .slide-footer{margin-top:1.5cqw}
}
