/* home.css, owner: track B. Holds: welcome, onboarding, Home, join, resume, record, fun fact, the fan wrapper (DESIGN_SPEC.md 5, 9.1, 9.2, 9.4).
   Load order 4 of 15: base, primitives, frame, home, room, friends, center, table, rails, chat, coach, meld, peek, results, dialogs.
   The page lives in the frame (frame.css): Home is one column under 40 rem of content and two columns from there (a container query on .home),
   so the window band does not decide it. The old room lobby still draws on the generic .lobby shell until track C moves it. */

/* ---- the page: Home and first run keep a glow of the felt over --bg (5); every other page is flat --bg (base.css) ---- */
body[data-screen="home"], body[data-screen="firstrun"] {
  background: radial-gradient(ellipse 60% 48% at 30% 4%, color-mix(in srgb, var(--felt) 75%, transparent), transparent 72%),
    radial-gradient(ellipse 130% 80% at 50% 110%, color-mix(in srgb, var(--ink-0) 60%, transparent), transparent 70%), var(--bg);
  background-attachment: fixed;
}

/* ---- the generic shell (the room lobby, the join card, the spectator page) ---- */
.lobby { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-4); padding: var(--sp-6) 0; }
.teach-toggle { min-width: var(--hit); min-height: var(--hit); padding: var(--sp-1) var(--sp-3); border: 1px solid var(--gold); border-radius: var(--r-lg); background: transparent; color: var(--gold); font: var(--t-caption); cursor: pointer; transition: background-color var(--dur), color var(--dur); }
.teach-toggle.active { background: var(--gold); color: var(--ink-on-gold); }
.lobby-teach-toggle { position: absolute; top: var(--sp-4); right: 0; }
.room-code-input {
  min-width: 0; min-height: var(--field-h); padding: 0 var(--sp-4); border: 1px solid var(--control-line); border-radius: var(--r-lg); background-color: var(--panel-2); color: var(--text);
  font-family: var(--font-mono); font-size: max(1.25rem, 12px); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
}
.room-code-input::placeholder { font: var(--t-body); letter-spacing: 0; text-transform: none; color: var(--text-faint); }
.room-code-input:focus { border-color: var(--gold); }
.landing-join-row { display: flex; gap: var(--sp-2); }
.landing-join-row .room-code-input { flex: 1 1 auto; }
.landing-join-row .btn { flex: none; width: auto; }

/* ---- panels ---- */
.landing-card { min-width: 0; padding: var(--sp-5); border: 1px solid var(--hair); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--e-1); }
.landing-card h3 { font: var(--t-title-3); color: var(--text); }
.landing-card .panel-hint { max-width: none; }

/* ---- Home: the grid. One column in the order of 9.2 (hero, Resume, ways to play, Join, ...), two columns from 40 rem of content ---- */
.lobby.home { --cw-pref: 5.25rem; container: home / inline-size; align-items: stretch; padding: 0; }
@media (min-width: 600px) { .lobby.home { --cw-pref: 5.75rem; } }
@media (min-width: 1024px) { .lobby.home { --cw-pref: clamp(4.25rem, 10vh, 8rem); } }
@media (min-width: 1024px) and (max-height: 800px) { .lobby.home { --cw-pref: clamp(4.25rem, 9.5vh, 8rem); } }
/* The fan's card is the size above, and never so big that the fan (3.75 cards wide) is wider than the page: at a 28 px root a phone would scroll sideways. */
.landing-hero { --cw: min(var(--cw-pref), 25cqw); }
.landing-options { display: flex; flex-direction: column; gap: var(--sp-6); width: 100%; }
.home-start, .home-game { display: contents; }
.landing-hero { order: 1; } .home-install { order: 2; } .continue-card { order: 3; } .home-name { order: 4; } .landing-play { order: 5; } .same-opponents-btn { order: 6; }
.hero-season-toggle { order: 7; } .landing-join { order: 8; } .home-record { order: 9; } .home-friends-slot { order: 10; } .landing-more { order: 11; } .lobby-fact { order: 12; }
/* Larger Text: the saved game comes before the hero, so the primary is in view (AC-07, AC-34). */
.lobby.home.is-large-text .continue-card { order: 0; }
/* Larger Text in one column (a phone, a tablet): the ways to play come before the hero, the rows give up their icon tiles for the room the words need,
   and the Resume card reads title, Continue Game, scores, then the small print, so the button is in view on a 320 wide phone (AC-07, AC-34). */
@container home (max-width: 39.99rem) {
  .lobby.home.is-large-text .landing-hero { order: 6; }
  .lobby.home.is-large-text .hero-fan-wrap { display: none; }   /* the picture is decoration: at Larger Text the name below the ways to play is whole, not a fan and half a title cut by the window's edge (fix round 3 m6) */
  .lobby.home.is-large-text .home-install { order: 7; }
  .lobby.home.is-large-text .landing-play .row__icon { display: none; }
  .lobby.home.is-large-text .resume { padding: var(--sp-4); }
  .lobby.home.is-large-text .resume h3 { order: 1; font: var(--t-title-3); }
  .lobby.home.is-large-text .resume__foot { display: contents; }
  .lobby.home.is-large-text .resume .btn--ink { order: 2; width: 100%; }
  .lobby.home.is-large-text .continue-score { order: 3; }
  .lobby.home.is-large-text .resume__when { order: 4; }
  .lobby.home.is-large-text .resume__forget { order: 5; }
}
@container home (min-width: 40rem) {
  .landing-options { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: var(--sp-7); }
  .home-start, .home-game { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
}
@media (min-width: 1920px) { .landing-options { column-gap: var(--sp-8); } }
@media (min-width: 1024px) and (max-height: 800px) { .landing-options, .home-start, .home-game { row-gap: var(--sp-4); } .hero-greeting { display: none; } }
/* One column on a short window (a small phone): the hero gives up room so the primary stays in view above the tab bar (AC-07). */
@media (max-height: 800px) {
  @container home (max-width: 39.99rem) {
    .landing-hero { --cw-pref: clamp(3rem, 10vh, 5.25rem); }
    .hero-greeting, .hero-tagline { display: none; }
    .landing-options { gap: var(--sp-4); }
    .resume h3 { font: var(--t-title-3); }
  }
}
/* A phone on its side is 393 tall: a small fan and the name, the list under them. */
@media (max-height: 500px) and (orientation: landscape) {
  .lobby.home { --cw-pref: 3.25rem; }
  .hero-greeting, .hero-tagline { display: none; }
  .home-start, .home-game { row-gap: var(--sp-3); }
}

/* ---- the hero: the fan (a button that shuffles it), the name, the line under it ---- */
.landing-hero { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); width: 100%; text-align: center; border-radius: var(--r-2xl); }
.landing-hero[data-look] { background: radial-gradient(ellipse at 50% 30%, var(--gold-wash), transparent 70%); }
.hero-greeting { font: var(--t-title-3); font-style: italic; font-weight: 600; color: var(--gold-strong); }
.hero-title { font: var(--t-display); letter-spacing: -0.01em; color: var(--text); }
@media (max-width: 599.98px) { .hero-title { font: var(--t-title-1); } }   /* "500 Parlor" (build 32) is two words: on a phone it stays on one line, so the page keeps its height */
.hero-tagline { font: var(--t-caption); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.hero-fan-wrap { position: relative; border-radius: var(--r-xl); cursor: pointer; transition: --spread var(--dur) var(--ease-out); }
@property --spread { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@media (hover: hover) and (pointer: fine) { .hero-fan-wrap:hover { --spread: 2.5deg; } }
.hero-fan { position: relative; width: calc(var(--cw, 4rem) * 3.75); height: calc(var(--cw, 4rem) * 1.75); margin-bottom: calc(var(--cw, 4rem) * 0.4); --card-width: var(--cw, 4rem); --card-height: calc(var(--cw, 4rem) * 108 / 76); }
.hero-fan .hero-card {
  position: absolute; bottom: 0; left: 0; right: 0; margin-inline: auto; transform-origin: 50% 100%;
  box-shadow: 0 calc(4px + var(--loose, 0) * 3px) calc(10px + var(--loose, 0) * 5px) rgba(0, 0, 0, 0.35);
  transform: translateX(calc(var(--i) * var(--cw, 4rem) * 0.36 + var(--px, 0px))) translateY(calc(var(--i) * var(--i) * var(--cw, 4rem) * 0.031 + var(--py, 0px))) rotate(calc(var(--i) * (8deg + var(--spread, 0deg)) + var(--pr, 0deg)));
  animation: hero-deal 600ms cubic-bezier(0.23, 1, 0.32, 1) both; animation-delay: calc((var(--i) + 2.5) * 50ms);
}
/* A shuffled hand's cards dissolve in over the ones they replace, while the cards are flying about. */
.hero-fan .hero-card.no-deal { animation: none; }
.hero-fan .hero-card.is-arriving { opacity: 0; transition: opacity var(--swap, 0.14s) ease-out; }
.hero-fan .hero-card.is-arriving.is-here { opacity: 1; }
@keyframes hero-deal { from { opacity: 0; transform: translateX(calc(var(--i) * 2px)) translateY(18px) rotate(calc(var(--i) * 1.5deg)); } }
@media (prefers-reduced-motion: reduce) {
  .hero-fan .hero-card { animation: hero-fade 300ms ease-out both; }
  .hero-fan .hero-card.no-deal { animation: none; }
  .hero-fan-wrap { transition: none; }
  @keyframes hero-fade { from { opacity: 0; } }
}
/* A lucky hand's meld, as the Meld Chart names it, in gold for two seconds. */
.hero-lucky { position: absolute; left: 0; right: 0; top: calc(var(--cw, 4rem) * -0.2); margin: 0; text-align: center; pointer-events: none; font: var(--t-title-3); color: var(--gold-strong); text-shadow: 0 1px 3px var(--scrim); opacity: 0; transition: opacity 250ms ease-out; }
.hero-lucky.is-on { opacity: 1; }
.home-start .hero-season-toggle { align-self: center; font: var(--t-caption); color: var(--text-dim); }

/* ---- the four ways to play: one list; each row's line under its title is its data-sub (so the button's text is just its title) ---- */
.landing-play.list { overflow: visible; }
.landing-play > * + * { border-top: 1px solid var(--hair); }
.landing-play > :first-child, .landing-play > :first-child > .row { border-radius: var(--r-2xl) var(--r-2xl) 0 0; }
.landing-play > :last-child, .landing-play > :last-child > .row { border-radius: 0 0 var(--r-2xl) var(--r-2xl); }
.landing-play .row { position: relative; display: grid; grid-template: "icon title go" auto "icon sub go" auto / auto minmax(0, 1fr) auto; column-gap: var(--sp-4); row-gap: 0; align-items: center; align-content: center; border-top: 0; }
.landing-play .row__icon { grid-area: icon; } .landing-play .row__title { grid-area: title; align-self: end; } .landing-play .row__go { grid-area: go; }
.landing-play .row::after { content: attr(data-sub); grid-area: sub; align-self: start; font: var(--t-caption); color: var(--text-dim); text-wrap: pretty; }
@container home (max-width: 26rem) { .landing-play .row { column-gap: var(--sp-3); padding-inline: var(--sp-4); } }   /* a phone: the line under the title keeps its one line */
.landing-play .row--primary::after { color: var(--ink-on-gold); }
.row--primary:focus-visible { outline-color: var(--text); box-shadow: 0 0 0 2px var(--ink-0); transition: none; }   /* the ring of a gold fill, as base.css draws it for .btn--primary (AC-28) */
@media (forced-colors: active) { .row--primary:focus-visible { outline-color: Highlight; } }
.landing-play .row.is-open .row__go { rotate: 90deg; }
.home-public__body { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--hair); }
.home-public__body .landing-card { padding: 0; border: 0; background: none; box-shadow: none; }
.home-public__body .landing-card > h3 { display: none; }
.same-opponents-btn { flex-direction: column; gap: 0; width: 100%; }
.same-opponents-names { font: var(--t-caption); color: var(--text-dim); }

/* ---- the name, when there is none to use: a field and the avatar; with a name it stays in the page, hidden (Settings changes it) ---- */
.home-name[hidden], .onb-reason[hidden] { display: none; }   /* .field and the rows below set display, which would beat the hidden attribute */
.home-name__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
@media (min-width: 600px) { .home-name__row { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---- Resume: the one gold card ---- */
.resume :focus-visible { outline-color: var(--ink-on-gold); }   /* on the gold card the ring is the card's ink (a gold ring on gold was 1:1: AC-05) */
.resume { display: grid; gap: var(--sp-3); border: 0; border-radius: var(--r-2xl); background: linear-gradient(135deg, var(--gold-strong), var(--gold) 55%, var(--gold-deep)); box-shadow: inset 0 0 0 1px var(--white-edge), var(--glow-resume); color: var(--ink-on-gold); }
.resume h3 { font: var(--t-title-2); color: var(--ink-on-gold); }
.continue-score { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); }
.resume__score { display: grid; }
.resume__num { font-size: max(2rem, 12px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.resume__team { font: var(--t-caption); font-weight: 600; opacity: 0.85; }
.resume__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); }
.resume__when { flex: 1 1 9rem; min-width: 0; max-width: none; color: var(--ink-on-gold); opacity: 0.85; }   /* the words wrap so Continue Game stays at the right of the card's foot */
.resume .resume__forget { justify-self: start; padding-inline: 0; color: var(--ink-on-gold); font: var(--t-caption); text-decoration: underline; }   /* .link-btn (table.css) comes later: one class more */

/* ---- Join a Table: the title and the quiet link on one row, the code and Join under them ---- */
.landing-join { display: grid; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); }
.landing-join__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-1) var(--sp-3); }
.landing-join__words { flex: 1 1 10rem; min-width: 0; }
@container home (max-width: 26rem) { .landing-join__words { flex-basis: 100%; } }   /* a phone: the line of help is whole, the link under it */
@container home (min-width: 40rem) and (max-width: 56rem) { .landing-join__words { flex-basis: 100%; } .landing-options { column-gap: var(--sp-5); } }   /* two narrow columns (1024 wide): the same, and the gap of 9.2 for that width */
.landing-join__help { font: var(--t-caption); color: var(--text-dim); }
.landing-join__head > * { min-width: 0; overflow-wrap: anywhere; }
.landing-join__head .link-btn { flex: none; padding-inline: 0; color: var(--gold-strong); font: var(--t-small); text-decoration: underline; }   /* no side padding: wrapped under the help line it keeps the panel's left edge */

/* ---- Your Record ---- */
.home-record { container: record / inline-size; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.home-record__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-1) var(--sp-3); }   /* (wraps: at Larger Text on a 320 px phone the title and Your Stats do not fit side by side, fix round 2 M1) */
.home-record__head .link-btn { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--gold-strong); font: var(--t-small); }
.home-record__empty { font: var(--t-small); color: var(--text-dim); }
.home-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); }
@container record (min-width: 24rem) { .home-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.home-stat dd { font-size: max(1.5rem, 12px); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-stat dt { font: var(--t-caption); color: var(--text-dim); }

/* ---- a saved game by code or file, the install row, the fun fact ---- */
.landing-more { padding: 0; }
.landing-more > summary { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; padding: var(--sp-3) var(--sp-5); font: var(--t-label); color: var(--text-dim); list-style: none; cursor: pointer; }
.landing-more > summary::-webkit-details-marker { display: none; }
.landing-more__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding: 0 var(--sp-5) var(--sp-5); }
.landing-more__hint { font: var(--t-small); color: var(--text-dim); }
.landing-more__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.landing-more__actions .btn { width: auto; max-width: 100%; white-space: normal; text-align: center; }
.home-install { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3); }
.home-install__text { flex: 1; min-width: 0; font: var(--t-small); }
.home-install .btn { width: auto; }

/* ---- phone and tablet: the links the sidebar carries on a laptop, then the legal line, left on the page's edge (AC-14) ---- */
.landing-links, .landing-legal { display: flex; flex-wrap: wrap; align-items: center; align-self: stretch; }
.landing-links { gap: 0 var(--sp-4); margin-top: var(--sp-5); }
.landing-legal a { display: inline-flex; align-items: center; min-width: var(--hit); min-height: var(--hit); color: var(--text-dim); font: var(--t-caption); text-decoration: underline; }
.landing-legal a:hover { color: var(--text); }
.landing-legal-dot { padding: 0 var(--sp-2); color: var(--text-faint); font: var(--t-caption); }
@media (min-width: 1024px) { .landing-links, .landing-legal { display: none; } }

/* ---- join by link, watch pending, the spectator page ---- */
.arrival { display: grid; gap: var(--sp-4); width: min(100%, 28rem); padding: var(--sp-6); }
.arrival__title { font: var(--t-title-1); }
.arrival__lead { font: var(--t-body); color: var(--text-dim); }
.arrival .btn { width: 100%; }
.arrival__avatar { justify-content: flex-start; height: var(--field-h); }
.arrival__wait { display: flex; align-items: center; gap: var(--sp-3); }
.arrival__offline { display: flex; align-items: center; gap: var(--sp-2); font: var(--t-small); color: var(--gold-strong); }
.arrival__offline[hidden] { display: none; }
.arrival .btn .spinner { margin-right: var(--sp-2); }
@media (max-height: 500px) and (orientation: landscape) {
  .arrival { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); width: min(100%, 40rem); padding: var(--sp-4) var(--sp-5); }
  .arrival > :is(.arrival__title, .arrival__lead, .arrival__wait, .arrival__offline, .btn--ghost) { grid-column: 1 / -1; }
  .arrival > :is(.field, .arrival__avatar) { align-self: end; }
  .join-page { padding-block: 0; }
}
.spectator-page { align-items: flex-start; justify-content: flex-start; gap: var(--sp-5); padding: 0; }
.spectator-page .page-head__title { flex: none; }   /* the frame's title grows to fill its row: here the row is the page */
.spectator-lobby-view { display: grid; gap: var(--sp-4); max-width: 34rem; }
.spectator-lobby-view__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.spectator-lobby-view .btn { width: auto; }
.spectator-teach-note { font: var(--t-small); color: var(--text-dim); }

/* ---- first visit: Welcome, What Should We Call You?, New to Pinochle (9.1). The root is a container: the pages split in two by their own width, and a short window (max-height 800) splits them sooner ---- */
.onboarding { --cw: clamp(4.25rem, 22vw, 6rem); container: onb / inline-size; display: flex; flex: 1; flex-direction: column; gap: var(--sp-4); width: 100%; margin-inline: auto; }
@media (min-width: 1024px) { .onboarding { --cw: clamp(6.5rem, 12vw, 11rem); } }
@media (max-height: 800px) { .onboarding { --cw: clamp(4.25rem, 14vh, 8rem); gap: var(--sp-2); } .frame--bare .page { padding-block: var(--sp-3); } }
.onb-top { position: fixed; top: var(--moved-banner-h, 0px); right: var(--page-pad); z-index: var(--z-bar); display: flex; align-items: center; gap: var(--sp-2); height: var(--bar-h); }
@media (max-width: 599.98px) { .onb-top .onb-rules { display: none; } }
.onb-step { font: var(--t-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); text-align: center; }
.onb-page { display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); width: min(100%, 34rem); margin: auto; }
.onb-hero { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; }
.onb-body { display: flex; flex-direction: column; gap: var(--sp-4); width: 100%; }
.onb-title { font: var(--t-display); }
@media (max-width: 599.98px) { .onb-title { font: var(--t-title-1); } }
.onb-lines { display: grid; gap: var(--sp-4); list-style: none; }
.onb-line { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--sp-3); }
.onb-line .row__icon { grid-row: span 2; }
.onb-line strong { align-self: end; font: var(--t-label); }
.onb-line span:not(.row__icon) { align-self: start; font: var(--t-small); color: var(--text-dim); text-wrap: pretty; }
.onb-fine { font: var(--t-caption); color: var(--text-dim); }
.onboarding .onb-cta { width: 100%; }
.onb-panel { display: grid; gap: var(--sp-2); width: 100%; padding: var(--sp-4); border: 1px solid var(--hair); border-radius: var(--r-xl); background: var(--panel); text-align: left; }
.onb-note { font: var(--t-caption); color: var(--text-dim); }
.onb-note.is-bad { color: var(--bad); }
.onb-label { font: var(--t-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.onb-avatars { max-height: calc(100dvh - 12rem); overflow-y: auto; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(var(--ink-0) calc(100% - 2rem), transparent); mask-image: linear-gradient(var(--ink-0) calc(100% - 2rem), transparent); }
.onb-group { margin: var(--sp-3) 0 var(--sp-1); font: var(--t-caption); font-weight: 600; color: var(--text-dim); }
.onb-group:first-child { margin-top: 0; }
.onb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--hit), 1fr)); gap: var(--sp-2); overflow: visible; }
.onb-grid .avatar-cell { width: 100%; height: var(--hit); min-height: var(--hit); }
.onb-grid .avatar-cell.is-on { background: var(--gold-wash); border-color: var(--gold-line); }
.onb-avatar { display: grid; place-items: center; flex: none; width: 5.5rem; height: 5.5rem; border: 2px solid var(--gold-line); border-radius: 50%; background: var(--panel-2); font-size: max(3rem, 12px); line-height: 1; }
.onb-pic { position: relative; }
.onb-avatar.is-corner { position: absolute; right: calc(var(--sp-1) * -1); bottom: var(--sp-4); width: 3.5rem; height: 3.5rem; font-size: max(2rem, 12px); }
.onb-fan.is-small { margin-top: calc(var(--sp-5) * -1); }
.onb-heading { display: flex; flex-direction: column; gap: 0.125rem; font: var(--t-title-1); color: var(--text); }
.onb-text { font: var(--t-lead); color: var(--text); text-align: center; }
.onb-reason { font: var(--t-small); color: var(--gold-strong); }
.onb-reveal { animation: onb-rise 0.55s var(--ease-out) 0.35s both; }
.onb-reveal.is-late { animation-delay: 0.5s; }
@keyframes onb-rise { from { opacity: 0; transform: translateY(12px); } }
/* A phone on its side has the height for the field and the pictures, not for the big face above them: the pictures show the pick. */
@media (max-height: 500px) and (orientation: landscape) {
  .onb-hero > .onb-avatar { display: none; } .onb-heading { font: var(--t-title-2); } .onboarding .onb-page { gap: var(--sp-3); } .onb-panel { padding: var(--sp-3); }
}
/* The page's primary: the foot of a phone's window (so it is always in view), the bottom of its column everywhere else. */
.onb-bar, .onb-actions { display: grid; gap: var(--sp-2); width: 100%; }
.onb-bar .onb-continue { width: 100%; }
@media (max-width: 599.98px) {
  .frame--bare:has(.onboarding) .page-foot { display: none; }   /* the bar is the foot of the window: no legal row under it */
  .frame--bare:has(.onboarding) .page { padding-bottom: 0; }
  .onb-page { flex: 1; margin-block: 0; }
  .onb-page > :is(:first-child, .onb-bar) { margin-top: auto; }   /* the free room is shared above the page's first block and above the bar, so the bar is the foot of the window and the rest sits in the middle */
  .onb-bar { position: sticky; bottom: 0; width: calc(100% + 2 * var(--page-pad)); margin: 0 calc(var(--page-pad) * -1); padding: var(--sp-3) var(--page-pad) calc(var(--sp-3) + var(--safe-b)); border-top: 1px solid var(--hair); background: var(--ink-0); }
}
/* From 36 rem of room the name and the pictures sit side by side: the field and Continue in one column, the avatars a scroller beside it. */
@container onb (min-width: 36rem) {
  .onboarding[data-step="profile"] .onb-page { display: grid; grid-template: auto auto auto 1fr / repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--sp-5); width: min(100%, 56rem); }
  .onboarding[data-step="profile"] :is(.onb-hero, .onb-name-panel, .onb-bar) { grid-column: 1; }
  .onb-avatar-panel { grid-column: 2; grid-row: 1 / span 4; }
}
/* The hero beside the copy: the welcome from 56 rem, and the welcome and the last page in a short window. */
@container onb (min-width: 56rem) {
  .onboarding[data-step="welcome"] .onb-page { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: var(--sp-8); row-gap: var(--sp-4); width: 100%; }
  .onboarding[data-step="welcome"] .onb-hero { grid-row: 1 / span 2; }
  .onboarding[data-step="welcome"] :is(.onb-body, .onb-bar) { grid-column: 2; max-width: 30rem; }
  .onboarding[data-step="welcome"] .onb-body { align-self: end; }
  .onboarding[data-step="welcome"] .onb-bar { align-self: start; }
}
@media (max-height: 800px) {
  @container onb (min-width: 36rem) {
    .onboarding:is([data-step="welcome"], [data-step="new"]) .onb-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: var(--sp-6); row-gap: var(--sp-4); width: min(100%, 56rem); }
    .onboarding:is([data-step="welcome"], [data-step="new"]) .onb-hero { grid-row: 1 / span 2; }
    .onboarding:is([data-step="welcome"], [data-step="new"]) :is(.onb-body, .onb-bar) { grid-column: 2; }
    .onboarding:is([data-step="welcome"], [data-step="new"]) .onb-body { align-self: end; }
    .onboarding:is([data-step="welcome"], [data-step="new"]) .onb-bar { align-self: start; }
  }
}
