/* The front door: the signed-out title that scrolls (ui/front/title_more.rs) and the phone page (index.html's #phone).
   Tyler, 9 November 2026: "I like your title screen idea"; "make people go to their computers to play". Every other
   screen keeps the page fixed (kit.css): only these two let it scroll, and only on them does the page's own text
   (#about) stand as a footer at the end instead of lying over the art. Tokens only. */

/* The scene is the first screen; on every other title step it fills the window as before. */
.title-hero { position: absolute; inset: 0; overflow: hidden; }
:is(html, body):has(.title-scrolls), :is(html, body):has(body.phone) { height: auto; min-height: 100%; }
html:has(.title-scrolls), html:has(body.phone) { overflow: hidden auto; }
body:has(.title-scrolls), body.phone { overflow: visible; }
body:has(.title-scrolls) #ui { position: relative; inset: auto; }
.title-screen.title-scrolls { position: relative; inset: auto; overflow: visible; }
.title-scrolls .title-hero { position: relative; height: 100vh; }

/* Under the fold: one column of sections on the night's ink, each centred and no wider than reads well. */
.title-more { display: flex; flex-direction: column; align-items: center; gap: 72px; padding: 72px 24px 88px;
  background: linear-gradient(var(--bg-0), var(--bg-1) 40%, var(--bg-0)); border-top: 2px solid var(--steel-line); }
.title-more h2 { margin: 0; font: 400 var(--t-l)/1.2 var(--font-head); letter-spacing: 2px; text-transform: uppercase; color: var(--you-light); }

/* The cue at the foot of the first screen that there is more under it: a gold chevron that bobs (still with reduced
   motion), and a link to the sections, so a keyboard reaches them too. */
.title-more-cue { position: absolute; top: calc(100vh - 76px); left: 50%; z-index: 3; display: grid; place-items: center; width: 56px; height: 56px;
  margin-left: -28px; color: var(--you-light); text-decoration: none; }
.title-more-cue::before { content: ""; width: 18px; height: 18px; margin-top: -10px; border: solid currentColor; border-width: 0 4px 4px 0; transform: rotate(45deg);
  filter: drop-shadow(0 0 4px var(--bg-0)); animation: title-cue 1.6s ease-in-out infinite; }
.title-more-cue:is(:hover, :focus-visible) { color: var(--you); }
@keyframes title-cue { 50% { translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .title-more-cue::before { animation: none; } }

/* As wide as the fact cards, 16:9, and never so tall that the cards' top edge falls below a 768 px window when the
   loop is scrolled into view (its 20 px frame and the 72 px gap under it). */
.title-loop { width: min(1120px, 100%, calc((100vh - 168px) * 16 / 9)); }
.title-loop-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 10px solid transparent; border-image: url('/c/9cd69333dc17ed5ade6bb46d5efcec31312af5d14fe544a36a658f159be82b62.png') 8 / 16px stretch;
  background: var(--bg-0) padding-box; image-rendering: pixelated; box-shadow: 0 8px 24px var(--shadow); }

.title-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; width: min(1120px, 100%); margin: 0; padding: 0; list-style: none; }
.title-facts li { display: flex; flex-direction: column; gap: 10px; padding: 20px 24px 24px; background: var(--panel-steel); border: 2px solid var(--steel-line); }
.title-facts p { margin: 0; font-size: 20px; line-height: 1.4; color: var(--text); }

/* As many 100px portraits a row as fit, on a band a little wider than the facts' so 22 stand in two rows of eleven
   (Tyler, 18 November 2026: "figure out the grid"; ten a row left two alone on a third). */
.title-roster { display: flex; flex-direction: column; align-items: center; gap: 24px; width: min(1240px, 100%); }
.title-roster ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px 12px; width: 100%; margin: 0; padding: 0; list-style: none; }
.title-roster li { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.title-roster img { width: 96px; height: 96px; margin-bottom: 4px; image-rendering: pixelated; background: var(--bg-0); border: 2px solid var(--steel-line); }
.title-roster b { font-size: var(--t-name); }
.title-roster span { font-size: var(--t-xs); color: var(--text-dim); }

.title-again { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(480px, 100%); text-align: center; }
.title-again p { margin: 0; font-size: var(--t-l); line-height: 1.25; }
.title-again .title-other { font-size: 20px; }
.title-again .btn.big.title-play { width: 100%; height: 76px; padding: 0; font-size: var(--t-l); letter-spacing: 3px; }

/* The page's own text as a footer: after everything, never over the art. */
:is(body:has(.title-scrolls), body.phone) #about { position: static; max-width: none; padding: 28px 24px 36px; border-radius: 0; text-align: center;
  background: var(--bg-0); border-top: 2px solid var(--steel-line); text-shadow: none; }
:is(body:has(.title-scrolls), body.phone) #about p { max-width: 46rem; margin: 0 auto; }
:is(body:has(.title-scrolls), body.phone) #about p + p { margin-top: 8px; }
/* The footer's first paragraph ends "Press Play to start as a guest", and the phone page has no Play: it says what
   the game is itself, and shows only the sign-in and privacy paragraph. The footer's words are the main page's. */
body.phone #about p:first-child { display: none; }
/* On a touch screen the footer's links are a thumb's height (they were 16 px tall). */
html.touch :is(body:has(.title-scrolls), body.phone) #about a { display: inline-block; padding: 14px 6px; }

/* The phone page: none of the game loads, so neither the canvas nor the interface shows. */
body.phone :is(canvas#game, #ui) { display: none; }
#phone[hidden] { display: none; }
#phone { display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }
#phone .phone-art { display: block; width: calc(100% + 32px); height: auto; margin: 0 -16px 4px; image-rendering: pixelated; }
#phone h2 { margin: 0; font: 400 28px/1.15 var(--font-head); letter-spacing: 1px; text-transform: uppercase; color: var(--you-light); }
#phone p { margin: 0; font-size: var(--t-m); line-height: 1.4; }
#phone .phone-loop { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; background: var(--bg-0); border: 2px solid var(--steel-line); }
#phone .phone-link { padding: 10px 12px; font-weight: 700; overflow-wrap: anywhere; background: var(--bg-1); border: 2px solid var(--steel-line); user-select: all; }
#phone .phone-actions { display: flex; flex-direction: column; gap: 12px; }
#phone .phone-actions .btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 12px 16px;
  font: 700 var(--t-m)/1.2 var(--font-body); letter-spacing: normal; text-transform: none; text-decoration: none; zoom: 1; }
#phone .phone-said { min-height: 1.4em; color: var(--text-dim); }

@media (max-width: 900px) {
  .title-facts { grid-template-columns: minmax(0, 1fr); }
  .title-more { gap: 56px; padding: 56px 16px 72px; }
}
/* A browser without wasm SIMD (index.html's #simd-check, #unsupported): the game's unsupported words, set as the phone
   page is. */
body.unsupported :is(canvas#game, #ui) { display: none; }
#unsupported[hidden] { display: none; }
#unsupported { display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; padding: 48px 16px 32px; }
#unsupported h2 { margin: 0; font: 400 28px/1.15 var(--font-head); letter-spacing: 1px; text-transform: uppercase; color: var(--you-light); }
#unsupported p { margin: 0; font-size: var(--t-m); line-height: 1.4; }

/* The title on a phone held upright (phone council round 0: the wide scene sat letterboxed in a band, 60% of the
   screen empty night, Play halfway up). title_scene.rs crops the scene to the gate and the middle of the line, stands
   it on the menu's room at the foot of the screen and passes its offset across (--scene-x), so the logo and the menu,
   which live in the scene, are placed on the screen's width: Play and Sign in under the champions' feet in the thumb's
   reach, the ground fading into the night under them. Sign in at the top would repeat the one under Play, so it goes. */
@media (max-width: 600px) and (orientation: portrait) {
  html.touch .title-hero .tscene::after { content: ''; position: absolute; left: calc(-1 * var(--scene-x, 0px)); bottom: 0; z-index: 1;
    width: 100vw; height: calc(40 * var(--u)); background: linear-gradient(transparent, var(--bg-0)); pointer-events: none; }
  /* The logo stands in the gate, framed by its arch and fire, just over the champions' heads (round 1, Sol: the tall
     empty arch parted the logo from the champions). */
  html.touch .title-hero .tlogo { z-index: 2; top: calc(93 * var(--u));
    left: calc(50vw - var(--scene-x, 0px) - min(70 * var(--u), 50vw - 20px)); }
  html.touch .title-hero .tlogo img { width: min(calc(140 * var(--u)), calc(100vw - 40px)); }
  html.touch .title-hero .tmenu { z-index: 2; top: calc(266 * var(--u)); left: calc(16px - var(--scene-x, 0px)); width: calc(100vw - 32px); }
  html.touch .title-hero .title-signin-slot { --z: 1; zoom: 1; width: 100%; min-height: 0; align-items: center; text-align: center; }
  html.touch .title-hero .title-signin-slot .title-pitch { margin-bottom: 8px; font-size: var(--t-m); }
  /* The second line (what a match is, the first fifteen minutes' A3) on one line at a phone's width, so the menu stays
     clear of the scroll cue under it (it ran into Sign in after the merge, 18 November). */
  html.touch .title-hero .title-signin-slot .title-facts-line { margin-top: 2px; font-size: var(--t-xs); line-height: 1.25; }
  @media (max-width: 380px) { html.touch .title-hero .title-signin-slot .title-facts-line { font-size: 13px; letter-spacing: -0.1px; } }
  html.touch .title-hero .title-signin-slot .btn.big.title-play { height: 56px; }
  html.touch .title-hero .title-signin-slot .title-other { margin-top: 4px; font-size: var(--t-name); }
  html.touch .title-screen .title-version { left: 0; right: 0; bottom: 4px; zoom: 1; font-size: var(--t-xs); text-align: center; }
  html.touch .title-more-cue { top: calc(100vh - 66px - env(safe-area-inset-bottom, 0px)); }
  html.touch .title-screen .corner-tr { top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; gap: 8px; zoom: 1; }
  html.touch .title-screen .corner-tr .title-signin { display: none; }
  /* The version clears the home bar of a home-screen web app (client.css, The safe area). */
  html.touch .title-screen .title-version { bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
}
/* Touch, either way up: the scroll cue says what is under it, in the words its link is named by (mobile council round
   3, Opus: a bare chevron did not say what was below). The chevron follows them, a thumb's height. */
html.touch .title-more-cue { left: 50%; width: auto; height: 44px; margin-left: 0; padding: 0 10px; translate: -50% 0;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; white-space: nowrap; }
html.touch .title-more-cue::before { width: 12px; height: 12px; margin-top: -6px; border-width: 0 3px 3px 0; }
html.touch .title-more-cue::after { content: "More about the game"; color: var(--text); font: 700 var(--t-s)/1 var(--font-body); text-shadow: 0 1px 3px var(--bg-0); }
html.touch .title-more-cue:is(:hover, :focus-visible)::after { color: var(--you-light); }
/* Touch, either way up: the corner's buttons a thumb's size (phone council round 0: they were drawn at the HUD's
   scale, about 23 px tall). */
html.touch .title-screen .corner-tr .btn { min-height: 44px; padding-inline: 14px; font-size: var(--t-s); }
/* Settings is the gear alone on a phone (title.rs), a square beside Feedback, as in the menu bar. */
html.touch .title-screen .corner-tr .btn.icon { min-width: 44px; padding: 6px; }
/* Sign in under Play is a thumb's height wherever it stands, and the hero's words never fall below 12 px, though the
   slot is drawn at the HUD's scale on its side (about a half on an iPhone with its bars). */
html.touch .title-screen .title-other-action { display: inline-flex; align-items: center; min-height: calc(44px / var(--z, 1)); vertical-align: middle; }
html.touch .title-signin-slot { --z: var(--ui-scale, 1); }
html.touch .title-signin-slot .title-pitch { font-size: max(24px, calc(13px / var(--z))); }
html.touch .title-signin-slot .title-other { font-size: max(20px, calc(12px / var(--z))); }
html.touch .title-screen .title-version { zoom: 1; font-size: var(--t-xs); }
@media (orientation: landscape) and (max-width: 1099.98px) {
  /* Clear of the Dynamic Island of a home-screen web app on its side (client.css, The safe area). */
  html.touch .title-screen .corner-tr { top: 12px; right: max(16px, env(safe-area-inset-right, 0px)); gap: 10px; zoom: 1; }
  /* The scroll cue and its words stand in the left column under Sign in, at the menu's left, the version under them:
     at the right their words lay over the champions. --cue-u is the scene's scale (title_scene.rs cover), the menu at
     19 of its px from the scene's left (pages.css). */
  html.touch .title-screen { --cue-u: min(calc(100vw / 480), calc(100vh / 266)); }
  html.touch .title-more-cue { top: calc(100vh - 86px); left: calc((100vw - 480 * var(--cue-u)) / 2 + 19 * var(--cue-u)); padding: 0; translate: none; }
  html.touch .title-screen .title-version { left: calc((100vw - 480 * var(--cue-u)) / 2 + 19 * var(--cue-u)); bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  /* Sign in stands under Play, as upright (round 1, both judges: it showed twice). */
  html.touch .title-screen .corner-tr .title-signin { display: none; }
  /* The logo leads the left column, as wide as Play under it, and the column sits lower, so the name and Play fill the
     night rather than float under a small logo (mobile council round 2, Sol and Opus). */
  html.touch .title-screen .tlogo { top: calc(14 * var(--u)); }
  html.touch .title-screen .tlogo img { width: calc(158 * var(--u)); }
  html.touch .title-screen .tmenu { top: calc(94 * var(--u)); }
}
/* The first view (index.html #door): the title's scene and line while the game loads, with a bar in Play's place that
   fills gold as the bytes arrive (scorecard A1, A2). The title's own rules draw the scene; these draw the bar. The
   page's footer waits for the title, which shows it at the end of its scroll. */
#door { position: fixed; inset: 0; z-index: var(--z-hud); }
#door[hidden] { display: none; }
body.door-open #about { display: none; }
.door-bar { position: relative; display: flex; align-items: center; justify-content: center; height: 76px; overflow: hidden;
  background: var(--bg-1); box-shadow: var(--steel-edge); }
.door-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--face-gold); transition: width 400ms linear; }
.door-said { position: relative; font: 400 var(--t-l)/1 var(--font-head); letter-spacing: 3px; text-transform: uppercase;
  color: var(--text); text-shadow: 0 2px 0 var(--bg-0); }
#door .door-help { margin: 14px 0 0; font-size: 20px; line-height: 1.25; text-shadow: 0 1px 2px var(--bg-0), 0 0 8px var(--bg-0); }
#door .door-help[hidden] { display: none; }
.door-failed .door-fill { background: var(--steel-line); }
@media (prefers-reduced-motion: reduce) { .door-fill { transition: none; } }
/* The title's second line under its pitch: what a match is (scorecard A3). */
.title-facts-line { display: block; margin-top: 6px; font-size: 18px; color: var(--text-dim); }
