/* Phones (2026-10-11, js/phone.mjs). Nothing in this file applies to tablets held sideways or to computers.
   html.phone       = a phone (touch screen, short side under 600px)
   html.edge-fill   = a phone held sideways: the 1600x900 stage sits inside the safe area (notch / camera hole / home
                      bar) and every screen's backdrop runs out to the real screen edges, so there are no dark bars.
                      --edge-l/r/t/b = the band between the stage and each screen edge, in stage px;
                      --room-l/r/t/b = the same band minus the notch / home bar (room for buttons).
   html.turn-ask    = held upright: the full-screen "Turn your phone sideways" card is showing. */

/* env(safe-area-inset-*) read by js/phone.mjs */
.safe-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
/* the stage box follows the browser's toolbars as they come and go (dynamic viewport units, with a fallback) */
html.phone #viewport { height: 100%; height: 100dvh; bottom: auto; }

/* ------------------------------------------------------------------ "Turn your phone sideways" */
.turn { position: fixed; inset: 0; z-index: 9500; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  background: radial-gradient(ellipse 120% 80% at 50% 34%, #2E9E62 0%, #17643F 55%, #1E3A2C 100%); color: #FFFFFF; text-align: center;
  font-family: var(--font-ui); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.turn[hidden] { display: none; }
/* a few soft stars */
.turn::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: radial-gradient(circle at 14% 18%, #FDD782 0 3px, transparent 4px), radial-gradient(circle at 86% 12%, #FFFFFF 0 2px, transparent 3px),
    radial-gradient(circle at 78% 82%, #FDD782 0 3px, transparent 4px), radial-gradient(circle at 20% 88%, #FFFFFF 0 2px, transparent 3px),
    radial-gradient(circle at 92% 50%, #FFFFFF 0 2px, transparent 3px), radial-gradient(circle at 7% 56%, #FDD782 0 2px, transparent 3px); }
.turn-art { position: relative; width: min(66vw, 42vh, 400px); width: min(66vw, 42dvh, 400px); aspect-ratio: 1; flex: none; margin-bottom: min(5vh, 36px); }
.turn-spin { position: absolute; inset: 0; display: grid; place-items: center; animation: turnSpin 3.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.turn-phone { width: 44%; height: auto; overflow: visible; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .2)); }
.turn-pal { position: absolute; left: 50%; top: 50%; width: 23%; height: auto; transform: translate(-50%, -42%);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .25)); animation: turnPal 3.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.turn-arrow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; animation: turnArrow 3.4s ease-in-out infinite; }
.turn-title { margin: 0; max-width: 11em; font-size: clamp(30px, 9vw, 54px); line-height: 1.08; font-weight: 700; letter-spacing: -.01em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.turn-sub { margin: 12px 0 0; font-size: clamp(20px, 5.8vw, 34px); line-height: 1.2; font-weight: 700; color: #FDD782; }
.turn-keep { margin-top: 36px; padding: 12px 28px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .45); background: transparent;
  color: rgba(255, 255, 255, .82); font-size: 20px; font-weight: 700; cursor: pointer; }
/* the phone turns sideways, its friend stays standing and grows (there's more room now), then it turns back */
@keyframes turnSpin { 0%, 22% { transform: rotate(0deg); } 42%, 78% { transform: rotate(90deg); } 96%, 100% { transform: rotate(0deg); } }
@keyframes turnPal { 0%, 22% { transform: translate(-50%, -42%) rotate(0deg) scale(1); } 42%, 78% { transform: translate(-50%, -42%) rotate(-90deg) scale(1.2); } 96%, 100% { transform: translate(-50%, -42%) rotate(0deg) scale(1); } }
/* the arrow always shows; it dims while the phone is sideways and comes back bright before the next turn */
@keyframes turnArrow { 0%, 22% { opacity: 1; } 40%, 80% { opacity: .3; } 96%, 100% { opacity: 1; } }
/* phones: the card fades in over the stage the moment the phone turns upright (js/phone.mjs, 2026-11-01 bug hunt) */
.turn.turn-soon { animation: turnIn .35s ease-out both; }
@keyframes turnIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .turn.turn-soon { animation: none; }
  /* still: the upright phone under its arrow reads as "turn me" */
  .turn-spin { animation: none; }
  .turn-pal { animation: none; }
  .turn-arrow { animation: none; }
}
/* nothing behind the card needs painting */
html.turn-ask #viewport { visibility: hidden; }
/* hosted mode: the grown-up buttons wait for the phone to come back sideways (sign-in pages still show on top) */
html.turn-ask :is(.membership-entry, .admin-toggle, .account-parent-toggle, .account-save-status) { visibility: hidden; }

/* ------------------------------------------------------------------ sideways: backdrops reach the screen edges */
html.edge-fill #viewport { overflow: hidden; }
html.edge-fill #stage { overflow: visible; }

/* 1. Each screen paints its own backdrop under a transparent border that reaches the screen edges. Its content box is
      still exactly the 1600x900 stage and it still clips its content there, so nothing inside moves or peeks out. */
html.edge-fill .screen {
  inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l));
  border: 0 solid transparent;
  border-width: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l);
  background-origin: border-box !important;
  /* already a stacking context in practice (its fade-in animation keeps opacity applied); made explicit so the edge
     copies in 3. always stay inside their own screen */
  isolation: isolate;
}

/* 2. Pure backdrop layers inside a screen: position:fixed is measured from the (scaled) stage but escapes the screen's
      clipping, so they can be stretched out to the screen edges. Blurred / faded pictures, so a little extra zoom is
      invisible. */
html.edge-fill :is(.hub-veil, .bk-desk, .finale-hall .fh-bg, .finale-hall .fh-light, .wg-tiers-shade, .rw-sky, .ss-night) {
  position: fixed; inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l)); }
html.edge-fill .hub-bg {
  position: fixed; inset: calc(-30px - var(--edge-t)) calc(-30px - var(--edge-r)) calc(-30px - var(--edge-b)) calc(-30px - var(--edge-l)); }
html.edge-fill .player::before {
  position: fixed; inset: calc(-20px - var(--edge-t)) calc(-20px - var(--edge-r)) calc(-20px - var(--edge-b)) calc(-20px - var(--edge-l)); }
html.edge-fill .tracer::before {
  position: fixed; inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l)); }
html.edge-fill .ss-ground { position: fixed; left: calc(-40px - var(--edge-l)); right: calc(-40px - var(--edge-r)); bottom: calc(-1 * var(--edge-b)); }
html.edge-fill .vx-bg {
  position: fixed; inset: calc(-40px - var(--edge-t)) calc(-40px - var(--edge-r)) calc(-40px - var(--edge-b)) calc(-40px - var(--edge-l)); }

/* 3. Full-screen overlays (dimmers, celebrations, the loading screen, videos) are edged by the page-level edge shield
      (js/phone.mjs watchOverlays, "edge shield" at the end of this file). v23 painted a ring here from inside each
      overlay with position:fixed; iPhone Safari clipped it, so the screen behind showed at both sides. */

/* 4. Games: the painted world carries on past the stage edges as its own mirror image (js/games/worldkit.mjs adds the
      mirrored copies; seamless at the edge because a mirror matches itself there). */
.wg-mirror { display: none; }
html.edge-fill .wg-bg {
  position: fixed; width: auto; height: auto;
  inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l));
  border: 0 solid transparent; border-width: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l);
  background-origin: border-box !important;
}
html.edge-fill .wg-bg .wg-mirror { display: block; pointer-events: none; }
.wg-bg img.wg-ml { transform: translateX(-1600px) scaleX(-1); }
.wg-bg img.wg-mr { transform: translateX(1600px) scaleX(-1); }
.wg-bg img.wg-mb { transform: translateY(900px) scaleY(-1); }
.wg-bg img.wg-mbl { transform: translate(-1600px, 900px) scale(-1, -1); }
.wg-bg img.wg-mbr { transform: translate(1600px, 900px) scale(-1, -1); }
/* world backgrounds are drawn 5% larger (games.css .wg-bg-world img), so their mirrors fold about the same edges */
.wg-bg-world img.wg-ml { transform: translateX(-1600px) scale(-1.05, 1.05); }
.wg-bg-world img.wg-mr { transform: translateX(1600px) scale(-1.05, 1.05); }
.wg-bg-world img.wg-mb { transform: translateY(900px) scale(1.05, -1.05); }
.wg-bg-world img.wg-mbl { transform: translate(-1600px, 900px) scale(-1.05, -1.05); }
.wg-bg-world img.wg-mbr { transform: translate(1600px, 900px) scale(-1.05, -1.05); }

/* 5. Home. The teal sidebar hugs the left screen edge (its tabs keep their size, just inside the notch), and the tab
      area runs from the sidebar to the right screen edge. On the map the painted worlds continue on both sides as their
      mirror image (js/map.mjs adds .world-mirror strips); the other tabs keep their content exactly where it was and
      paint their backdrop under transparent edge borders. */
html.edge-fill .screen.home { overflow: visible; } /* its only big children are the sidebar and the tab area, which clips itself */
html.edge-fill .home .rail {
  left: calc(-1 * var(--edge-l)); top: calc(-1 * var(--edge-t));
  width: calc(244px + var(--edge-l) - var(--room-l)); height: calc(900px + var(--edge-t) + var(--edge-b));
  border: 0 solid transparent; border-width: var(--edge-t) 0 var(--edge-b) calc(var(--edge-l) - var(--room-l)); background-origin: border-box; }
html.edge-fill .home .home-content { left: calc(244px - var(--room-l)); width: calc(1356px + var(--room-l) + var(--edge-r));
  top: calc(-1 * var(--edge-t)); height: calc(900px + var(--edge-t) + var(--edge-b)); } /* to the top edge too: 4:3 and square phones showed an empty band over the map (2026-10-22 layout audit) */
html.edge-fill .home .topbar-sound { left: calc(286px - var(--room-l)); }
html.edge-fill .home .topbar-right { right: calc(30px - var(--room-r)); }
/* the map: same place on the stage as before, with mirrored painting either side */
html.edge-fill .home .map-canvas { left: var(--room-l); }
html.edge-fill .home .chest-btn { left: calc(30px + var(--room-l)); bottom: calc(26px + var(--edge-b)); }
html.edge-fill .home .flash-btn { right: calc(60px + var(--edge-r) - var(--room-r)); bottom: calc(26px + var(--edge-b)); } /* .home-content runs out to the screen edge (edge-r past the stage): 30px in from the safe area, not past the screen (2026-10-22 device sweep) */
/* Isaiah 2026-10-30: phone parity: with no band on the right (a 16:9 phone like the iPhone SE sideways) that put the
   flashcard buttons 30px further in than on a computer, over Dot the ladybug; there they keep the computer's place */
html.edge-fill .home .flash-btn { right: calc(min(60px - var(--room-r), 30px) + var(--edge-r)); }
html.edge-fill .map-sky { left: calc(-1 * var(--room-l)); width: calc(1356px + var(--room-l) + var(--edge-r)); }
.world-mirror { display: none; }
html.edge-fill .world-mirror { display: block; position: absolute; height: 2034px; overflow: hidden; z-index: 1; pointer-events: none;
  -webkit-mask-image: linear-gradient(transparent 0, #000 110px, #000 calc(100% - 110px), transparent 100%);
  mask-image: linear-gradient(transparent 0, #000 110px, #000 calc(100% - 110px), transparent 100%); }
html.edge-fill .world-mirror.r { left: 1354px; width: calc(var(--edge-r) + 2px); }  /* folds 2px inside the edge: no hairline */
html.edge-fill .world-mirror.l { left: calc(-1 * var(--room-l)); width: calc(var(--room-l) + 2px); }
html.edge-fill .world-mirror.solid { -webkit-mask-image: none; mask-image: none; }
html.edge-fill .world-mirror.join { -webkit-mask-image: linear-gradient(#000 calc(100% - 220px), transparent 100%); mask-image: linear-gradient(#000 calc(100% - 220px), transparent 100%); }
html.edge-fill .world-mirror.ahead-world { filter: none; }
.world-mirror img { position: absolute; top: 0; width: 1356px; height: 2034px; transform: scaleX(-1); user-select: none; }
.world-mirror.r img { left: -1356px; transform-origin: 100% 50%; }  /* folds about the map's right edge */
.world-mirror.l img { left: calc(var(--room-l) + 2px); transform-origin: 0 50%; } /* folds about the map's left edge */
/* books, games, videos and friends tabs: content stays put, backdrop reaches the sidebar and the right screen edge */
html.edge-fill .home :is(.bt, .gt) { width: calc(1356px + var(--room-l) + var(--edge-r)); height: calc(900px + var(--edge-t) + var(--edge-b));
  border-top: var(--edge-t) solid transparent; }
/* Isaiah 2026-10-30: phone parity: the top border is the band above the stage (.home-content starts at the top screen
   edge). It was 0 here, which also cancelled the border-top above, so on screens taller than 16:9 (phones kept upright,
   foldables) every tab's content sat up in the top band, under the "Best played sideways" pill and the corner buttons */
html.edge-fill .home :is(.bt, .gt, .vid-scroll, .fb, .tab-soon) {
  border: 0 solid transparent; border-width: var(--edge-t) var(--edge-r) var(--edge-b) var(--room-l); background-origin: border-box; }
/* the friend card's dimmer covers the whole tab area too (the card itself stays centred where it was); the top band
   too (Isaiah 2026-10-30, phone parity: upright phones and foldables) */
html.edge-fill .home .fb-card-wrap {
  position: fixed; left: calc(244px - var(--room-l)); right: calc(-1 * var(--edge-r)); top: calc(-1 * var(--edge-t)); bottom: calc(-1 * var(--edge-b));
  border: 0 solid transparent; border-width: var(--edge-t) var(--edge-r) var(--edge-b) var(--room-l); background-origin: border-box; }
/* the friend counter keeps clear of the Adult Guide button, which now sits at the right safe edge */
html.edge-fill .home .fb-progress { right: calc(30px + max(0px, 150px - var(--room-r))); }
/* Isaiah 2026-10-30: phone parity: an open lesson card's clear cover runs out to the screen edges (transparent borders
   over the bands, so the card stays exactly where it was). On a computer it covers the sidebar and a tap beside the card
   closes it; on phones the sidebar runs on into the side band, and a tap there switched tabs with the card still open */
html.edge-fill .lesson-card-wrap { inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l));
  border: 0 solid transparent; border-width: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l); }

/* 6. Corner buttons move out to the safe screen edges, so the wide phone feels made for them. position:fixed keeps
      the same stage coordinates (measured from the stage) but lets them sit outside the stage box; they only ever
      move away from the middle, into the bands, so they can't land on anything. */
html.edge-fill :is(.player > .trail-back, .player > .act-title, .hub > .hub-map) { position: fixed; }
html.edge-fill :is(.player > .trail-back, .player > .act-title, .hub > .hub-map) { left: calc(34px - var(--room-l)); }
/* (the video's X stays inside the stage: the bands around a playing video belong to the edge shield) */
html.edge-fill :is(.player > .tips-pill, .hub > .info-pill) { position: fixed; right: calc(34px - var(--room-r)); }
html.edge-fill .player > .nav { position: fixed; right: calc(34px - var(--room-r)); bottom: calc(30px - var(--room-b)); }
html.edge-fill .player > .buddy { position: fixed; left: calc(20px - var(--room-l)); bottom: calc(-12px - var(--room-b)); }
html.edge-fill .g-view > .g-back { position: fixed; left: calc(40px - var(--room-l)); }
/* 2026-10-30 real iPhone 14 (BrowserStack): iPhone Safari clips position:fixed children of the game's overflow:hidden .g-view
   at the stage, so the arrow moved out into the band vanished and no game had a way out. On iPhones it stays in the game's own
   top-left corner, where it sits on a computer */
html.ios-phone.edge-fill .g-view > .g-back { position: absolute; left: 40px; }
/* Isaiah 2026-10-30 (compat audit, same iPhone Safari clip): the backdrops that reach the screen edges from inside an extra
   overflow:hidden wrapper (.wg-bg, .g-title-veil, .wg-tiers-shade and .g-view::before in every game's title / levels / play
   screen, .bk-desk in every book, .br-scene::before on the bridge) were cut at the stage, so wide iPhones showed the plain
   screen colour in the side bands. On iPhones those wrappers don't clip: the .screen around them (and, for the Books tab's
   reader, the edge shield over the bands) still stops everything else at the stage, so nothing else shows out there */
html.ios-phone.edge-fill :is(.g-view, .bk-root, .spell.bridge .br-scene) { overflow: visible; }

/* 7. Live site (signed in), sideways phones. The page-level grown-up buttons stay clear of the notch and rounded corners.
      Inside lessons and games the "Grown-ups" button steps aside like the join bar and admin gear already do (its
      corner holds the Next / Done button there); it's on every home tab. "Progress saved" keeps off the
      sidebar's Friends tab: on the home screen it sits bottom-centre, over the map. */
html.edge-fill .account-save-status { left: max(12px, env(safe-area-inset-left, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
html.edge-fill:has(.screen.home) .account-save-status { left: 50%; translate: -50% 0; }
html.edge-fill .account-parent-toggle { right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
html.edge-fill .membership-entry:not(.is-active) { right: max(8px, env(safe-area-inset-right, 0px)); bottom: calc(54px + max(8px, env(safe-area-inset-bottom, 0px))); }
html.edge-fill .membership-entry.in-lesson ~ .account-parent-toggle { display: none; }
/* inside lessons "Progress saved" also steps aside (a failed save still shows its message) */
html.edge-fill:has(.membership-entry.in-lesson) .account-save-status:not(.save-error) { display: none; }

/* 8. Sign-in on a sideways phone: welcome on the left, the form on the right, so the card fits the short screen.
      (Held upright, grown-ups get the normal one-column page; the turn card waits underneath it.) */
html.edge-fill .account-overlay { padding: max(10px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
html.edge-fill .account-card:has(> form):not(.account-parent) { width: min(100%, 860px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 34px; align-items: start; padding: 18px 28px; }
html.edge-fill .account-card:has(> form):not(.account-parent) > * { grid-column: 1; }
html.edge-fill .account-card:has(> form):not(.account-parent) > form { grid-column: 2; grid-row: 1 / span 12; align-self: center; }
html.edge-fill .account-card:has(> form):not(.account-parent) > .account-logo { width: 64px; margin: 0 0 8px; }
html.edge-fill .account-card:has(> form):not(.account-parent) > h1 { font-size: 27px; margin: 4px 0 8px; }
html.edge-fill .account-card:has(> form):not(.account-parent) > p { margin: 6px 0; }
html.edge-fill .account-card:has(> form):not(.account-parent) label { margin: 8px 0; }
@media (max-height: 420px) {
  html.edge-fill .account-card:has(> form):not(.account-parent) { padding: 12px 24px; font-size: 15px; line-height: 1.45; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > .account-logo { width: 52px; margin: 0 0 4px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > h1 { font-size: 24px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) label { margin: 6px 0; }
  html.edge-fill .account-card:has(> form):not(.account-parent) input { min-height: 44px; padding-block: 8px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) .account-link { margin-top: 6px; min-height: 40px; }
}
@media (max-height: 380px) {
  html.edge-fill .account-card:has(> form):not(.account-parent) { column-gap: 24px; padding: 10px 22px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > .account-logo { width: 44px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > p { font-size: 14px; margin: 4px 0; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > h1 { font-size: 22px; margin: 2px 0 4px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) .account-link { font-size: 14px; }
}
/* Isaiah 2026-10-30: phone parity: an iPhone SE held sideways (568x320) had to scroll to reach "Sign in and continue"
   and "New here? Try the whole curriculum free for 7 days"; on the shortest screens the welcome column tightens up so the card fits */
@media (max-height: 340px) {
  html.edge-fill .account-card:has(> form):not(.account-parent) > .account-logo { width: 36px; margin: 0 0 2px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > .account-kicker { font-size: 11px; letter-spacing: .05em; line-height: 1.3; }
  html.edge-fill .account-card:has(> form):not(.account-parent) .account-link { margin-top: 2px; min-height: 36px; padding-inline: 0; font-size: 13px; }
  html.edge-fill .account-card:has(> form):not(.account-parent) > .account-fine { margin: 2px 0 0; font-size: 12px; }
}
/* ------------------------------------------------------------------ overlays (js/phone.mjs watchOverlays)
   html.overlay-up = a full-screen overlay is up inside the stage (video, loading screen, celebration, pop-up).
   On every device the page-level grown-up buttons step aside, so nothing sits on a playing video's controls
   (a failed save still shows its message). */
html.overlay-up :is(.membership-entry, .admin-toggle, .account-parent-toggle, .account-save-status:not(.save-error)) { visibility: hidden; }
/* Sideways phones: the edge shield paints the four bands around the stage in the overlay's own edge colour
   (--shield-t/r/b/l, picture backdrops get each edge's own colour), so the screen behind never shows at the sides, the top or the bottom. Page-level and plain
   position:fixed, so no browser clips it; under the turn card, sign-in pages and the grown-up buttons. */
.edge-shield { position: fixed; inset: 0; z-index: 1500; pointer-events: none; visibility: hidden; opacity: 0; transition: opacity .2s, visibility 0s .2s; }
html.edge-fill .edge-shield.on { visibility: visible; opacity: 1; transition: opacity .15s; }
html:not(.edge-fill) .edge-shield { display: none; }
.edge-shield i { position: absolute; display: block; background: #0F3B26; pointer-events: auto; }
.edge-shield:not(.on) i { pointer-events: none; } /* its 0.2 s fade-out kept swallowing taps after an overlay closed (2026-10-27) */
.edge-shield .t { left: 0; right: 0; top: 0; height: var(--sy, 0px); background: var(--shield-t, #0F3B26); }
.edge-shield .b { left: 0; right: 0; top: calc(var(--sy, 0px) + var(--sh, 0px)); bottom: 0; background: var(--shield-b, #0F3B26); }
.edge-shield .l { left: 0; top: var(--sy, 0px); height: var(--sh, 0px); width: var(--sx, 0px); background: var(--shield-l, #0F3B26); }
.edge-shield .r { left: calc(var(--sx, 0px) + var(--sw, 0px)); right: 0; top: var(--sy, 0px); height: var(--sh, 0px); background: var(--shield-r, #0F3B26); }

/* ------------------------------------------------------------------ iPhone Safari: "Play full screen" tip (once) */
.home-tip { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(20, 14, 51, .62);
  padding: max(10px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  font-family: var(--font-ui, system-ui); }
.home-tip-card { position: relative; width: min(100%, 640px); max-height: 100%; overflow: auto; box-sizing: border-box; padding: 16px 22px 16px; border-radius: 24px;
  background: #FFFFFF; color: #1E3A2C; box-shadow: 0 10px 0 rgba(0, 0, 0, .18); text-align: left; }
.home-tip-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.home-tip-head img { flex: none; width: 56px; height: 56px; border-radius: 14px; }
.home-tip-head h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.home-tip-head p { margin: 4px 0 0; font-size: 15px; line-height: 1.35; color: var(--adult, #3E8044); } /* grown-up green, was purple-grey (2026-10-31) */
.home-tip-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-tip-steps li { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 14px; background: #EEF8F0; font-size: 14px; line-height: 1.3; font-weight: 700; }
.home-tip-steps b { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #22B46A; color: #FFFFFF; font-size: 13px; }
.home-tip-steps small { display: block; margin-top: 2px; font-weight: 400; color: #5E5590; }
.home-tip-icon { display: inline-grid; vertical-align: -5px; width: 22px; height: 22px; color: #2F6FEB; }
.home-tip-icon svg { width: 100%; height: 100%; }
.home-tip-ok { display: block; margin: 14px auto 0; min-width: 160px; min-height: 46px; padding: 8px 28px; border: 0; border-radius: 999px; background: #22B46A;
  color: #FFFFFF; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #12804A; }
.home-tip-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #EEF8F0; color: #1E3A2C;
  font-size: 26px; line-height: 1; cursor: pointer; }
@media (max-height: 360px) {
  .home-tip-card { padding: 12px 18px; }
  .home-tip-head img { width: 44px; height: 44px; }
  .home-tip-head h2 { font-size: 19px; }
  .home-tip-head p { font-size: 13.5px; }
  .home-tip-steps { margin-top: 10px; }
  .home-tip-steps li { padding: 8px; font-size: 13px; }
  .home-tip-ok { margin-top: 10px; min-height: 42px; font-size: 16px; }
}
/* in-app browsers (Google app, Instagram...): "Play full screen" card with an open-in-browser link (2026-10-22) */
.inapp-tip a.home-tip-ok { display: block; text-align: center; text-decoration: none; }
.inapp-row { display: flex; gap: 10px; margin-top: 10px; }
.inapp-row button { flex: 1; min-height: 44px; border: 0; border-radius: 14px; background: #E6F5EA; color: #1E3A2C; font: 700 15px/1.2 var(--font-ui, system-ui); cursor: pointer; overflow-wrap: anywhere; }

/* 2026-10-22 mobile pass: close/back buttons keep a finger-sized target (~44px) even when the stage is shrunk into a
   thin strip (in-app browsers); --tap-boost is set by js/app.mjs fit() */
html.phone :is(.vf-x, .close-x, .back-arrow, .info-x, .bk-x, .gate-x, .bk-lib-x, .bkr-back, .hub-map, .ip-x) { scale: var(--tap-boost, 1); }
/* buttons on the left edge grow from their left side, so the bigger tap target never pokes past the screen (2026-10-30 real
   Galaxy S23 / iPhone SE upright: the trail's Map button sat 3 px off the left edge) */
html.phone :is(.hub-map, .back-arrow, .bkr-back) { transform-origin: 0 50%; }
/* 2026-10-22 mobile pass: full-screen pages that sit on top of a lesson (story word screen, help guide, sight-word
   deck) paint their own background out to the real screen edges on sideways phones, so the side bands never show the
   screen underneath; a backdrop layer only (pointer-events: none), so buttons in the bands, like Trail, stay tappable */
html.edge-fill :is(.bk-reader, .help, .sw-wrap, .flash-wrap)::before { content: ''; position: fixed; z-index: -1; pointer-events: none; background: inherit;
  inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l)); }
html.edge-fill :is(.help, .sw-wrap) { z-index: 470; isolation: isolate; }
/* the two flashcard decks open from the map: their side bands also stop taps reaching the map, sidebar and Ava chip
   behind (2026-10-22 layout audit: the map showed and stayed tappable either side of the Sound Flashcards) */
html.edge-fill .flash-wrap { isolation: isolate; }
html.edge-fill :is(.flash-wrap, .sw-wrap, .help)::before { pointer-events: auto; } /* .help too (2026-10-27): band taps reached the sidebar and the trail's Map behind it */
/* 3. game screens (title, level picker, play) paint their own colour out to the screen edges, so the back arrow in the
      band sits on the game's colour instead of a flat navy band */
html.edge-fill .g-view { isolation: isolate; }
html.edge-fill .g-view::before { content: ''; position: fixed; z-index: -1; pointer-events: none; background: inherit;
  inset: calc(-1 * var(--edge-t)) calc(-1 * var(--edge-r)) calc(-1 * var(--edge-b)) calc(-1 * var(--edge-l)); }
/* 4. pictures that already reach the screen edges themselves (lesson-complete sky, finale hall, tracer, book opener)
      show through the edge shield on Android; it still blocks taps. iPhone keeps the painted bands, because Safari
      clips those pictures at the stage (js/phone.mjs watchOverlays) */
.edge-shield.see-through i { background: transparent !important; }

/* 2026-10-22 mobile audit, sign-in on phones: inputs at 16px (iOS zooms into smaller ones), the main button stays in
   view at the bottom of a short sideways screen, two columns only when there is room, a reachable close X */
html.phone .account-card input, html.phone .account-card select { font-size: 16px; }
/* 2026-10-30 real Galaxy S23 (BrowserStack, 705x280 sideways): the sticky Create account button sat ON the Password box.
   The button stays in the form's flow now and the card scrolls instead; 'safe' centring keeps the top of a tall card reachable */
html.edge-fill .account-overlay { place-items: safe center; }
/* (one column below 540px wide: every phone held upright, keyboard up or not; Isaiah 2026-10-30, phone parity: was 600,
   which also stacked an iPhone SE held sideways, 568 wide, into one tall column that needed scrolling) */
@media (max-width: 539px) { html.edge-fill .account-card:has(> form):not(.account-parent) { display: block; } }
html.phone .account-overlay .membership-close { position: fixed; z-index: 10001; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }

/* 2026-10-22 touch audit (844x390 phone, stage scale .43): the video controls measured 18 px (pause), 25x16 (Skip) and a
   4 px scrub bar, and kid buttons 28-36 px. Phones get bigger video controls, and an invisible hit area round each small
   button (the look is unchanged; a tap just lands from further away). Elements with no position of their own get relative. */
html.phone .video-full .vf-controls { scale: 1.4; transform-origin: 0 100%; }
html.phone .video-full :is(.vf-toggle, .vf-skip) { position: relative; }
html.phone .video-full .vf-toggle::after { content: ''; position: absolute; inset: -16px; }
html.phone .video-full .vf-skip::after { content: ''; position: absolute; inset: -14px -6px; }
html.phone .video-full .vf-bar::before { content: ''; position: absolute; inset: -26px -4px; }
html.phone .video-full .vf-x::after { content: ''; position: absolute; inset: -16px; }
/* 2026-10-31 phone tap sizes (iPhone with Safari bars, 734x271: stage scale .30): Pause took 22x30 px and Skip 38x28 with
   their rings. The bar sits a little up from the screen's bottom edge and in from its side (the rings were cut there),
   Pause is a little bigger and stands a little further from the scrub bar (whose knob sits at the bar's left end at
   0:00; the bar keeps its length), so both rings reach about 40 px: Pause's towards the screen edge and up to half the
   gap to the knob (the bar's own ring no longer reaches left over Pause), Skip's over the clock (which takes no taps) */
html.phone .video-full .vf-controls { left: 40px; bottom: 30px; width: 396px; }
html.phone .video-full .vf-toggle { width: 50px; height: 50px; margin-right: 16px; }
html.phone .video-full .vf-toggle svg { width: 26px; height: 26px; }
html.phone .video-full .vf-toggle::after { inset: -24px -3px -24px -36px; }
html.phone .video-full .vf-bar::before { left: 0; }
html.phone .video-full .vf-skip::after { inset: -29px -12px -29px -10px; }
/* 2026-11-01 phone findings: with those rings, at a .30 stage Pause still measured 37x41 px, Skip 42x41 and the X 39x39
   (Apple asks for 44 px; a real iPhone tab plays real videos in its own player, but the drawn videos, the Home Screen app
   and Android phones use these). On the smallest stages each ring grows to 44 px (--tap44: the stage px of 44 screen px,
   js/phone.mjs placeStage); min() keeps every ring at least as big as before, so Pause and Skip are unchanged on bigger
   phones. The stage's left edge cuts Pause's ring and the screen's bottom edge is just under it, so it grows up over the
   picture (a tap on a real video's picture pauses or plays it anyway) and right: the scrub bar starts a little further
   from Pause for that,
   so the knob keeps its own reach. Skip grows up and past its right end; the X down and right (the stage's corner cuts
   it above and left, on bigger phones too, where it grows a little: 46 -> 51 px at 844x390) */
html.phone .video-full .vf-toggle { margin-right: max(16px, calc(var(--tap44, 0px) / 1.4 - 70px)); }
html.phone .video-full .vf-toggle::after { top: min(-24px, calc(72px - var(--tap44, 0px) / 1.4)); right: min(-3px, calc(86px - var(--tap44, 0px) / 1.4)); }
html.phone .video-full .vf-skip::after { top: min(-29px, calc(65px - var(--tap44, 0px) / 1.4)); right: min(-12px, calc(84px - var(--tap44, 0px) / 1.4)); }
html.phone .video-full .vf-x::after { right: min(-16px, calc(75px - var(--tap44, 0px) / var(--tap-boost, 1))); bottom: min(-16px, calc(75px - var(--tap44, 0px) / var(--tap-boost, 1))); }
html.phone :is(.sound-btn, .gg-btn, .reader-chip, .fb-dot) { position: relative; }
html.phone :is(.trail-back, .hub-map, .tips-pill, .info-pill, .gg-btn, .bk-x)::after { content: ''; position: absolute; inset: -12px; }
html.phone .sound-btn::after { content: ''; position: absolute; inset: -20px; }
/* 2026-11-01 phone findings (734x271, stage .30): Sound measured 32x32 px with its ring and Full screen beside it 17x20:
   it had no ring, and Sound's ring lay over its left edge on every phone. Sound's ring now stops half way to Full screen
   and grows left instead (up to the menu rail, which is drawn above it), Full screen gets its own ring growing right over
   the map's corner. Where the stage is small (--tap44) both grow to 44 px: the rail leaves Sound only 40 stage px on its
   left, so Full screen steps a little further right to make room. The Adult Guide button (35x35) grows to 44 all round.
   The grown-ups' pills in the corner, Adult guide in a stop and Adult Guide on the trail (86x34), grow down to 44 px
   (the screen's top edge cuts them above) */
html.phone .full-btn { position: relative; margin-left: max(14px, calc(var(--tap44, 0px) - 93px)); }
html.phone .sound-btn::after { inset: min(-20px, calc((64px - var(--tap44, 0px)) / 2)) min(-7px, calc(100px - var(--tap44, 0px))) min(-20px, calc((64px - var(--tap44, 0px)) / 2)) min(-20px, calc(71px - var(--tap44, 0px))); }
html.phone .full-btn::after { content: ''; position: absolute; inset: min(-12px, calc((64px - var(--tap44, 0px)) / 2)) min(-12px, calc(71px - var(--tap44, 0px))) min(-12px, calc((64px - var(--tap44, 0px)) / 2)) -7px; }
html.phone .gg-btn::after { inset: min(-12px, calc((88px - var(--tap44, 0px)) / 2)); }
html.phone :is(.tips-pill, .info-pill)::after { inset: min(-12px, calc((84px - var(--tap44, 0px)) / 2)) -12px min(-12px, calc(114px - var(--tap44, 0px))); }
html.phone :is(.reader-chip, .bk-tips-btn)::after { content: ''; position: absolute; inset: -18px -6px; }
/* Isaiah 2026-10-30: phone parity: with no band on the right (iPhone SE sideways, phones kept upright) the name chip
   stays in its computer place over the map, and this ring's lower half took taps meant for Flit the butterfly (World 10).
   There the ring stops at the chip's bottom edge (a step: 0 with under 30px of band, the full 18px with one) */
html.phone .reader-chip::after { bottom: clamp(-18px, (var(--room-r, 30px) - 30px) * -1000, 0px); }
html.phone .fb-dot::after { content: ''; position: absolute; inset: -30px -6px; }
/* a long press on a picture opened the browser's Save image / Share menu in the middle of a game */
img { -webkit-touch-callout: none; }
/* games on phones: the back arrow and the end-card buttons get an invisible tap area too (32 px and 26-39 px measured) */
html.phone .g-back::after { content: ''; position: absolute; inset: -16px; }
html.phone .g-end-btn { position: relative; }
html.phone .g-end-btn::after { content: ''; position: absolute; inset: -12px -4px; }

/* phones held upright (Isaiah 2026-10-22): the card explains sideways is best and offers Keep it upright; kept upright, a
   small pill at the top brings the card back */
.turn-note { margin: 18px 0 0; max-width: 21em; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.35; font-weight: 700; color: rgba(255, 255, 255, .78); }
.turn-note + .turn-keep { margin-top: 18px; }
.turn-lock { margin: 14px 0 0; max-width: 22em; padding: 10px 16px; border-radius: 14px; background: rgba(0, 0, 0, .22); font-size: clamp(14px, 3.9vw, 17px); line-height: 1.35; font-weight: 700; color: #FFFFFF; }
.turn-lock[hidden] { display: none; }
.turn-lock + .turn-keep { margin-top: 16px; }
/* 2026-10-30 real iPhone SE held upright (375x548 between Safari's bars): the card ran taller than the screen and Keep it
   upright sat under the toolbar, out of reach. Short screens get a smaller picture and tighter text, so all of it fits */
/* Isaiah 2026-10-30 mobile run: a foldable's big inner screen held upright is nearly square (Galaxy Z Fold 707x753,
   Pixel Fold 701x771): too tall for the max-height rule, but its vw sizes all hit their maxima, so Keep it upright hung
   ~10px off the bottom and the picture off the top. Nearly square upright screens get the same compact card. */
@media (max-height: 700px), (orientation: portrait) and (min-aspect-ratio: 4/5) {
  .turn-art { width: min(52vw, 28vh, 300px); width: min(52vw, 28dvh, 300px); margin-bottom: 12px; }
  .turn-title { font-size: clamp(26px, 7.5vw, 40px); }
  .turn-sub { margin-top: 6px; font-size: clamp(18px, 5vw, 26px); }
  .turn-note { margin-top: 10px; font-size: clamp(14px, 3.8vw, 17px); }
  .turn-lock { margin-top: 10px; padding: 8px 14px; }
  .turn-note + .turn-keep, .turn-lock + .turn-keep { margin-top: 12px; }
}
.upright-hint { position: fixed; z-index: 1600; left: 50%; translate: -50% 0; top: max(10px, env(safe-area-inset-top, 0px));
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 0; border-radius: 999px;
  background: rgba(20, 52, 36, .82); color: #FFFFFF; font: 700 15px/1 var(--font-ui); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; }
.upright-hint span { font-size: 19px; color: #FDD782; }
.upright-hint { white-space: nowrap; }
.upright-hint[hidden] { display: none; }
/* 2026-10-23 review: the lesson's Next and back buttons measured about 43 / 40 px on small phones; an invisible tap
   area brings them past 44 px without changing the look */
/* 2026-10-27 mobile sweep: 'Skip writing' (with its phone tap area) covered where the first stroke of D, F, H, T and ten
   Build & Write words begins, so a near-miss on the star skipped the writing; on phones it sits up by the back/next buttons */
/* 2026-11-01 phone fit: up there it still took only 73x20 px (iPhone with Safari bars, stage .30), and it could not grow:
   the stars of 7 letters and 10 words sat within a first touch's reach of it (trace.mjs down(): 133 stage px at .30).
   Phones keep it in the empty top-left corner instead, level with Back and Next and bigger (36 px words), its tap area
   from the stage's top edge down to 152 px: 46 px tall at a .30 stage, 54 on an iPhone SE. Every stroke of every letter
   and Build & Write word starts on or under the top line (294), so that is 142 stage px clear of every star, past that
   reach. The tracer's Adult says card centres in the room left between it and Back */
html.phone .tracer .tr-skip { left: 28px; right: auto; top: 28px; height: 92px; padding: 0 22px 0 30px; border-radius: 46px; font-size: 36px; }
html.phone .tracer .tr-skip svg { width: 34px; height: 34px; }
html.phone .tracer .tr-skip::before { inset: -28px -16px -32px -28px; }
html.phone .tracer .tr-script { left: 340px; right: 248px; }
html.phone .nav-row :is(.go-btn, .step-back) { position: relative; } /* only the in-flow nav buttons: the book's Done (.go-btn.bk-done) is absolutely placed */
html.phone :is(.go-btn, .step-back)::after { content: ''; position: absolute; inset: -14px; }
/* 2026-11-01 phone findings: at a .30 stage (iPhone with Safari bars) those rings gave Next 76x41 px and Back 33x38 (its
   right side lay under Next's ring). On the smallest stages both grow to 44 px tall (--tap44, js/phone.mjs placeStage;
   there is room down to the screen's edge), the gap between them is shared half and half, and Back grows left, where
   nothing takes a tap, to 44 px wide */
html.phone .nav-row .go-btn::after { top: min(-14px, calc((104px - var(--tap44, 0px)) / 2)); bottom: min(-14px, calc((104px - var(--tap44, 0px)) / 2)); }
html.phone .nav-row .step-back + .go-btn::after { left: -8px; }
html.phone .nav-row .step-back::after { inset: min(-14px, calc((96px - var(--tap44, 0px)) / 2)) -8px min(-14px, calc((96px - var(--tap44, 0px)) / 2)) min(-14px, calc(104px - var(--tap44, 0px))); }

/* 2026-10-24 iOS audit: body has touch-action none (no double-tap zoom), so every scroller says how it may be dragged
   (WebKit doesn't always reset it at a scroll box); the sign-in overlay must not pinch-zoom the whole app either */
.help, .xc-panels, .home-tip-card, .account-overlay { touch-action: pan-y; }
.sw-strip { touch-action: pan-x; }
/* iPhone: no second grey clear button inside the Help search box (it has its own) */
.hp-q { -webkit-appearance: none; appearance: none; }
.hp-q::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
/* iPhone: a tapped sign-in button keeps its hover colour, so the hover look is for mice only */
@media (hover: none) { .account-primary:hover { background: #ffd341; } }

/* 2026-10-27 mobile sweep, iPhones (html.ios-phone, js/phone.mjs). At the iPhone's 3x pixel density WebKit painted
   nothing for a CSS filter on a large or clipped layer: the closed book (drop-shadow), the blurred world behind the
   lesson trail, the book desk, the sound path and the bridge canyon came out blank ("give the book a tap" with no book).
   Those backdrops use small pre-blurred pictures instead (softImg), so they need no live filter; the closed book gets
   its own layer, which WebKit does paint. */
html:is(.ios-phone, .ios-pad) :is(.hub-bg, .bk-world, .vx-letterintro.v2 .vx-bg) { filter: none; } /* iPads too (2026-10-30: blank book pages after a turn) */
html:is(.ios-phone, .ios-pad) .player::before { filter: none; }
/* (2026-11-01 autofix bug-93: the world's own blur, js/spell.mjs --br-blur; a fixed canyon here put orange canyon bands around the castle and every other world's bridge) */
html.ios-phone.edge-fill .spell.bridge .br-scene::before { background-image: var(--br-blur, url(../assets/bridge/canyon-blur.webp)); filter: none; }
html.ios-phone .bk-open-btn .bk-book { transform: translateZ(0); }
html.ios-phone .bk-open-btn:active .bk-book { transform: translateZ(0) scale(.98); }
/* phones, first screen: "plays best on a big screen, or get the app" (js/phone.mjs phoneWelcome, 2026-10-28); above sign-in and the turn card */
.home-tip, .welcome-tip { z-index: 10050; }   /* every install card sits above sign-in (z 10000): "Get the app" opens its steps before sign-in */
.welcome-tip .home-tip-head { padding-right: 0; }
.welcome-places { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.welcome-places li { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: #EEF8F0; font-size: 14px; line-height: 1.3; font-weight: 700; }
.welcome-places span { flex: none; font-size: 22px; line-height: 1; }
.welcome-get { min-width: min(100%, 300px); }
.welcome-stay { display: block; margin: 8px auto 0; min-height: 44px; padding: 6px 16px; border: 0; background: none; color: #12804A; font: 700 15px/1.2 var(--font-ui, system-ui); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
@media (orientation: portrait) { .welcome-places, .home-tip-steps { grid-template-columns: 1fr; gap: 8px; } }
@media (max-height: 360px) { .welcome-places { margin-top: 10px; } .welcome-places li { padding: 8px; font-size: 13px; } .welcome-stay { margin-top: 4px; min-height: 40px; } }
/* 2026-10-31 iPhone memory (mobile-debug run, OPTIONAL): on a small iPhone (lite) a fading screen gets its own GPU layer
   the size of the whole stage at 3x (~75 MB) for the length of the fade, right when the new screen's pictures decode.
   Screens there appear at once (behind the loading screen it looks the same; trail <-> stop is a cut instead of a fade). */
html.lite.ios-phone .screen.enter { animation: none; }
/* 2026-11-01 grown-up text you can read on a phone (js/player.mjs phoneRows): at an iPhone's .30 stage the Adult says
   card was 7-13 screen px. Phones set the card, the Adult tip line and the bottom tip at about 13.5 screen px (in stage
   px, from the stage scale) and as wide as their row; the sound chips and Hear it buttons inside keep in proportion
   with the words around them, never smaller than before */
html.phone .player .step-host .script-card .sound-chip { font-size: max(30px, .94em); }
html.phone .player .step-host .script-card .hear-btn { font-size: max(31px, .8em); }
html.phone .player .step-host > .hint .sound-chip { font-size: max(30px, .88em); }
/* books on phones (2026-11-01 adult-text): the Story Talk question for the grown-up and its answer and the reading
   screen's Adult tip read at about 13.5 screen px (--read-px, js/phone.mjs placeStage), never
   smaller than before; the question gets the width of its box, the reading tip a wider card that opens under Back to book */
html.phone .bkq-talk { font-size: max(34px, var(--read-px, 34px)); max-width: 1180px; }
html.phone .bkq-answer { font-size: max(26px, var(--read-px, 26px)); }
html.phone .hint.bkr-hint { font-size: max(32px, min(40px, var(--read-px, 32px))); width: 760px; top: 146px; } /* (40 px at most: the longest tip, ~240 letters, then ends above Next / Back on the smallest stages; 2026-11-01 v115 review) */ /* (under Back to book, which phones draw up to 1.4x bigger) */
html.edge-fill .home .cb-note { left: calc(30px + var(--room-l)); bottom: calc(150px + var(--edge-b)); }

/* family plans (2026-11-14): the Switch reader button gets the same bigger invisible tap area as the name chip */
html.phone .reader-switch { position: relative; }
html.phone .reader-switch::after { content: ''; position: absolute; inset: -18px -6px; }

/* 2026-11-15: the child picker is a play screen, so the turn-sideways card covers it too (grown-up screens stay usable) */
html.turn-ask .account-who { z-index: 9400; }

/* ===== the turn card, 2026-11-15 (Isaiah: "the most important thing they see ... make it look aesthetically pleasing"):
   the explorer fills the card (Codex art, assets/ui/turn-bg.webp: the kid at the top, deep green below), the words sit at the
   bottom over the green, a small turning phone above the title, and a "Before you start" box ranking the screens. */
.turn { justify-content: flex-end; background: linear-gradient(180deg, #02362400 0%, #02362400 30%, #023624b8 48%, #023624f0 62%, #023624 100%),
  url(../assets/ui/turn-bg.webp) center top / 100% auto no-repeat, #023624; }
/* phones: the explorer already holds his screen sideways, so the little turning phone (which sat on his tablet) steps aside */
@media (max-width: 600px) { .turn .turn-art { display: none; } }
.turn-content { position: relative; display: flex; flex-direction: column; align-items: center; width: min(100%, 460px); }
.turn .turn-art { width: clamp(76px, 22vw, 116px); margin: 0 0 6px; }
.turn .turn-phone { width: 46%; }
.turn .turn-title { font-size: clamp(28px, 8.4vw, 46px); text-shadow: 0 3px 14px rgba(0, 0, 0, .45); }
.turn .turn-sub { margin-top: 6px; font-size: clamp(19px, 5.4vw, 28px); text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.turn-best { box-sizing: border-box; width: 100%; margin: 16px 0 0; padding: 12px 14px 12px; border-radius: 20px; background: rgba(4, 30, 17, .62);
  box-shadow: inset 0 0 0 1.5px rgba(253, 215, 130, .5); text-align: left; }
.turn-best-h { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #FDD782; text-align: center; }
.turn-best ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.turn-best li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border-radius: 14px; background: rgba(255, 255, 255, .08);
  font-size: clamp(15px, 4.3vw, 18px); line-height: 1.2; }
.turn-best li i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #FDD782; color: #3d2a00; font-style: normal; font-weight: 800; font-size: 15px; }
.turn-best li b { font-weight: 800; color: #FFFFFF; }
.turn-best li span { font-weight: 700; color: #cdeedb; text-align: right; }
.turn-best li:first-child { background: rgba(253, 215, 130, .18); box-shadow: inset 0 0 0 1.5px rgba(253, 215, 130, .55); }
.turn-best li:first-child span { color: #FDD782; }
.turn-best li:last-child span { font-size: .9em; }
.turn .turn-note { margin: 10px 0 0; max-width: none; font-size: clamp(13.5px, 3.8vw, 16px); text-align: center; color: rgba(255, 255, 255, .82); }
.turn .turn-lock { width: 100%; box-sizing: border-box; }
@media (max-height: 700px) {
  .turn .turn-art { width: 70px; margin-bottom: 2px; }
  .turn .turn-title { font-size: clamp(24px, 7.2vw, 34px); }
  .turn .turn-sub { margin-top: 2px; font-size: clamp(17px, 4.8vw, 22px); }
  .turn-best { margin-top: 10px; padding: 9px 11px; }
  .turn-best-h { margin-bottom: 5px; font-size: 12px; }
  .turn-best ol { gap: 4px; }
  .turn-best li { padding: 5px 10px 5px 6px; font-size: 14.5px; grid-template-columns: 26px 1fr auto; }
  .turn-best li i { width: 26px; height: 26px; font-size: 13px; }
  .turn .turn-note { margin-top: 6px; font-size: 13px; }
}
