/* laterro /play/: the game page's skin (RFC 0002 §6.6; the look: D1 "Morning road"). Loaded after ui.css by the page
   laterro/pages.sh builds from the client release's index.html (the ragnarok repo's web/), which keeps a plain look
   of its own without this file.

   The page's structure is the client contract's "Page structure and skin" (docs/client-contract.md §4):
     html[data-ro-phase]   boot signin pick wait login error | game (web/view.js)
     #front                the login screen over the game until the hand-over: its background (here: our own painted
                           world map, assets/art/map-*, laterro/site/art/build.py), #front-window and .ro-bar
     #front-window         the RO window: #accounts.win (web/autologin.js) with .acct-row, .win-note, the create form
     .ro-bar               the loading bar (web/loader.js): .ro-bar-label, .ro-bar-track > .ro-bar-fill, .ro-bar-note
     #opt-btn, #options    Options (web/view.js): a .win with role=tablist .tabs and .opt rows
     #signed-out           the "Signed out" window over the game (web/autologin.js)
     #exitbox .win, #game-stopped, #net-error, #gpu-lost   the other windows over the game (web/ro.js, web/loader.js)
     #sound-btn            "Turn on sound" (web/audio.js), a .ro-btn
     #guest-end .win, #guest-timer   the guest demo (RFC 0031, web/autologin.js): its end screen and the time left
     #bar                  the status bar (Options > Diagnostics), #log the game log
   The map replaces the plain parchment of RFC 0002 §6.6.2 (Q2): owner's choice of D1 on 2026-10-27, with art made
   for LaterRO (no game art). Use only ui.css tokens (laterro/site/dev/check-shared.mjs checks it). */

/* ---------- the page: the game's black, ui.css's body layout off ---------- */
/* The client's own page sets `html, body { font: 13px/1.4 ... }`, so every rem was 13/16 of its size (the shared
   header came out 19% small). The root is pinned to 16 px for the skin's rem-based sizes; the game's own 13 px body
   stays (all of its sizes are px). */
html[data-ro-phase] { font-size: 16px; }
html[data-ro-phase] body {
  display: block; min-height: 0; background: #000;
  font: 13px/1.4 var(--l-sans); color: var(--l-ink);
}

/* ---------- the shared header, over the login screen; gone with it ---------- */
/* Sticky, not fixed: the header then sits below the test server's banner when staging puts one at the top of the page
   (a fixed header would start at the viewport top and the banner would cover it). Without a banner it is at the top
   as before; the login screen does not scroll the page (`#front` is fixed). */
html[data-ro-phase] .site-header {
  position: sticky; top: 0; z-index: 30; line-height: 1.6;
}
html[data-ro-phase="game"] .site-header, html[data-ro-phase="game"] .skip { display: none; }

/* ---------- the login screen: the world map, a light shade toward the bar (a dusk veil in the dark theme) ---------- */
#front {
  color: var(--l-ink); font: 15px/1.5 var(--l-sans);
  background-color: var(--l-sky-a);
  background-image: linear-gradient(var(--l-art-dim), var(--l-art-dim)),
    linear-gradient(180deg, rgba(20,30,50,.04), rgba(20,30,50,.3)), url(art/map-1600.webp);
  background-image: linear-gradient(var(--l-art-dim), var(--l-art-dim)),
    linear-gradient(180deg, rgba(20,30,50,.04), rgba(20,30,50,.3)),
    image-set(url(art/map-1600.avif) type("image/avif"), url(art/map-1600.webp) type("image/webp"));
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
@media (max-width: 760px) {
  #front {
    background-image: linear-gradient(var(--l-art-dim), var(--l-art-dim)),
      linear-gradient(180deg, rgba(20,30,50,.04), rgba(20,30,50,.3)), url(art/map-960.webp);
    background-image: linear-gradient(var(--l-art-dim), var(--l-art-dim)),
      linear-gradient(180deg, rgba(20,30,50,.04), rgba(20,30,50,.3)),
      image-set(url(art/map-960.avif) type("image/avif"), url(art/map-960.webp) type("image/webp"));
  }
}
@media (min-width: 1700px), (min-width: 1100px) and (min-resolution: 1.5dppx) {
  #front {
    background-image: linear-gradient(var(--l-art-dim), var(--l-art-dim)),
      linear-gradient(180deg, rgba(20,30,50,.04), rgba(20,30,50,.3)), url(art/map-2048.webp);
    background-image: linear-gradient(var(--l-art-dim), var(--l-art-dim)),
      linear-gradient(180deg, rgba(20,30,50,.04), rgba(20,30,50,.3)),
      image-set(url(art/map-2048.avif) type("image/avif"), url(art/map-2048.webp) type("image/webp"));
  }
}
#front-window { padding: 84px 16px 24px; align-items: center; }
#front-window:focus { outline: none; }

/* ---------- the window ---------- */
/* color: the release's built-in look gives .win a fixed dark ink (index.html :where(.win)) and ui.css's .win sets none,
   so without it the window's own text (the create form's intro, labels, legend) stays dark on the dark theme's paper */
#front .win, #signed-out {
  width: min(430px, 100%);
  font: 15px/1.5 var(--l-sans); color: var(--l-ink); box-shadow: var(--l-float);
}
#front .win-body { padding: 14px 16px; }
#front .win-body p, #signed-out .win-body p { margin: 0 0 10px; }
#signed-out .win-body p:last-child { margin: 0; }
/* the windows over the game (web/ro.js, web/loader.js): the login window's type and float shadow */
#exitbox .win, #game-stopped, #net-error, #gpu-lost, #guest-end .win { font: 15px/1.5 var(--l-sans); color: var(--l-ink); box-shadow: var(--l-float); }
#exitbox .win-body p, #game-stopped .win-body p, #net-error .win-body p, #guest-end .win-body p { margin: 0 0 10px; }
#exitbox .win-body p:last-child, #game-stopped .win-body p:last-child, #net-error .win-body p:last-child, #guest-end .win-body p:last-child { margin: 0; }
#exitbox .win-body .field-note { font-size: .82rem; color: var(--l-muted); }
#exitbox .win-foot, #guest-end .win-foot { justify-content: space-between; }   /* Back to the site on the left, the main action on the right */
/* the demo's time left (the release places it top right, the Options button's dark look): the site's type; the last
   minute gets the accent edge */
#guest-timer { font: 700 .85rem/1.3 var(--l-sans); }
#guest-timer[data-last] { border-color: var(--l-accent-hi); }
#sound-btn { box-shadow: var(--l-float); }
/* the test server only: its banner sits at the top of the page, where the release pins these two (top: 12px) */
body:has(.test-banner:not(.in-stage)) #guest-timer, body:has(.test-banner:not(.in-stage)) #sound-btn { top: 48px; }
#front .win-foot .foot-note { font-size: .82rem; color: var(--l-muted); }

/* the account rows: select, then OK (RO's login convention) */
.acct-list { display: grid; gap: 6px; }
.acct-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%;
  padding: 9px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--l-ink);
  background: var(--l-input); border: 1px solid var(--l-line); border-radius: 4px;
}
.acct-row:hover { border-color: var(--l-btn-edge); }
.acct-row[aria-selected="true"] {
  border-color: var(--l-title-b); background: var(--l-sel); box-shadow: inset 4px 0 0 var(--l-title-mid);
}
.acct-row .acct-name { font: 700 1.05rem/1.3 var(--l-sans); overflow-wrap: anywhere; }
.acct-row .acct-detail { font-size: .82rem; color: var(--l-muted); white-space: nowrap; }
.acct-row .ingame { color: var(--l-warn); font-weight: 700; }
.acct-row.add { justify-content: center; margin-top: 4px; border-style: dashed; color: var(--l-muted); font-size: .92rem; }
.acct-row.add:hover { color: var(--l-ink); }

/* notes above the list: server status, another tab, touch */
.win-note {
  margin: 0 0 10px; padding: 7px 10px; font-size: .88rem; line-height: 1.45;
  border-left: 3px solid var(--l-warn); border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--l-warn) 9%, var(--l-paper));
}
.win-note[data-kind="down"] { border-left-color: var(--l-down); background: color-mix(in srgb, var(--l-down) 9%, var(--l-paper)); }
.win-note[data-kind="info"] { border-left-color: var(--l-title-mid); background: color-mix(in srgb, var(--l-title-a) 10%, var(--l-paper)); }
/* the touch notice in the window (web/autologin.js: class "win-note touch-note"): the window's note look, the full
   width of the window (ui.css .touch-note is sized for the site's hero) */
.win-note.touch-note { max-width: none; margin: 0 0 10px; }

/* "Play anyway" on a touch-only device (web/autologin.js: class "ro-btn link"): a small link in the window's foot,
   not a second button next to the computer notice */
.ro-btn.link {
  padding: 4px 6px; border: 0; background: none; box-shadow: none; text-shadow: none;
  font-weight: 400; color: var(--l-link); text-decoration: underline; text-underline-offset: 2px;
}
.ro-btn.link:hover { color: var(--l-ink); background: none; }

/* More options in the create form (web/autologin.js: details.more, ui.css styles the summary) */
#front .win details.more { margin: 12px 0 0; }
#front .win details.more summary { font-size: .88rem; }

/* the create form */
#front .win label { margin: 12px 0 3px; font-size: .88rem; }
#front .win label.inline { margin: 0 18px 0 6px; }
#front .win fieldset { margin: 12px 0 0; }
#front .win legend { font-size: .88rem; }
#front .win input[type=text], #front .win input[type=date] { padding: 7px 9px; }
.field-error { margin: 4px 0 0; font-size: .86rem; color: var(--l-down); font-weight: 700; }
#acct-new-err:not([hidden]) {
  margin: 0 0 10px; padding: 7px 10px; border-left: 3px solid var(--l-down); border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--l-down) 8%, var(--l-paper));
}

/* ---------- the loading bar: the game's dark blue loading band, a brass-framed track ---------- */
.ro-bar {
  font: 14px/1.45 var(--l-sans); padding: 10px max(150px, calc(50% - 320px)) 12px; color: var(--l-bar-ink); text-shadow: none;
  background: linear-gradient(180deg, var(--l-bar-a), var(--l-bar-b));
  border-top: 1px solid color-mix(in srgb, var(--l-bar-a) 60%, white);
  box-shadow: 0 -8px 20px -10px rgba(0,0,0,.5);
}
.ro-bar-label { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.ro-bar-track {
  height: 12px; padding: 0; border: 1px solid var(--l-metal); border-radius: 7px; overflow: hidden;
  background: rgba(0,0,0,.45); box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
.ro-bar-fill { border-radius: 7px; background: linear-gradient(180deg, var(--l-accent-hi), var(--l-accent-mid)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.ro-bar-note { font-size: .82rem; color: var(--l-bar-muted); opacity: 1; }
.ro-bar[data-state="error"] .ro-bar-label { color: #ffc2b8; }

/* ---------- Options: the corner button and the window ---------- */
#opt-btn {
  font: 700 .85rem/1.3 var(--l-sans); padding: 5px 12px; border-radius: 5px; cursor: pointer;
  color: var(--l-btn-ink); border: 1px solid var(--l-btn-edge); background: linear-gradient(180deg, var(--l-btn-hi), var(--l-btn-lo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 rgba(0,0,0,.25);
}
#opt-btn:focus-visible { outline: 3px solid var(--l-focus); outline-offset: 2px; }
#options { position: fixed; font: 14px/1.5 var(--l-sans); color: var(--l-ink); box-shadow: var(--l-float); }   /* fixed as in the release (ui.css makes .win relative) */
#options .tabs { margin: 5px 5px 0; padding: 6px 8px 0; background: var(--l-foot); border: 1px solid var(--l-inner); border-bottom-color: var(--l-line); border-radius: 3px 3px 0 0; }
#options .tabs + .win-body, #options .tabs ~ .win-body { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; }
#options .tabs button { color: var(--l-ink); background: var(--l-bg-deep); border-color: var(--l-line); }
#options .tabs button[aria-selected="true"] { background: var(--l-paper); }
#options .opt { border-bottom-color: var(--l-line); font-size: .92rem; }
#options select { width: auto; height: auto; padding: 3px 6px; font-size: .88rem; }
#options a:not(.ro-btn) { color: var(--l-link); }
#options .field-note { font-size: .84rem; color: var(--l-muted); }

/* ---------- the status bar (Options > Diagnostics) ---------- */
#bar { max-width: none; padding: 4px 10px; background: #0b0d14; }
#statusline { font: 12px/1.4 var(--l-mono); color: #b9bfd6; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  #front-window { padding: 116px 16px 16px; }
  .ro-bar { padding: 10px 16px 46px; }   /* Options sits under the text */
  .ro-bar-label { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  #front { transition: none; }
}

/* the test server's line inside the game's stage, seen only in fullscreen (the page's own .test-banner is outside the
   fullscreen element): staging builds only (laterro/pages.sh --env staging puts the element there) */
.test-banner.in-stage { display: none; }
#stage:fullscreen .test-banner.in-stage { display: block; position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
