/* PWAPP site shell: "line diagram" wayfinding system. Loaded after every page's own CSS, so it
   re-themes the shared tokens and components without touching page logic. The TV pages do not load it.
   Each app is a transit line with its own ink; the top rail is the line strip. Porcelain panels,
   hairline edges, flat fills, Overpass (Highway-sign lineage) with tabular figures. */
:root {
  --l-todo: #1d5fd8;
  --l-casino: #f3a200;
  --l-map: #0f9a55;
  --l-wulf: #8240e8;
  --l-arcade: #d6336c;

  --bg: #eceff3;
  --surface: #fff;
  --fg: #0e1319;
  --muted: #475160;
  --faint: #566070;
  --line: rgb(14 19 25 / .12);
  --glass: var(--surface);
  --glass-edge: rgb(14 19 25 / .13);
  --glass-shadow: 0 1px 0 rgb(14 19 25 / .04), 0 4px 14px -6px rgb(14 19 25 / .16);
  --shadow-sm: 0 1px 2px rgb(14 19 25 / .12);
  --field: #f4f6f9;
  --card: var(--surface);
  --good: #0d7a40;
  --on-good: #fff;
  --bad: #c62d25;
  --brand: #0e1319;
  --accent-fill: #0e1319;
  --on-accent: #fff;
  --pg: var(--fg);
  --r-card: 14px;
  --r-control: 10px;
  --rail-h: 64px;
  --font: "Overpass", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --l-todo: #6aa4ff;
    --l-casino: #ffbf3d;
    --l-map: #3fdc8a;
    --l-wulf: #b892ff;
    --l-arcade: #ff7aa8;
    --bg: #0b1119;
    --surface: #131b27;
    --fg: #eef2f7;
    --muted: #a8b2c0;
    --faint: #99a4b3;
    --line: rgb(255 255 255 / .12);
    --glass-edge: rgb(255 255 255 / .12);
    --glass-shadow: 0 1px 0 rgb(0 0 0 / .3), 0 6px 18px -8px rgb(0 0 0 / .6);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
    --field: #1b2432;
    --good: #3fdc8a;
    --on-good: #04170c;
    --bad: #ff7a70;
    --brand: #eef2f7;
    --accent-fill: #eef2f7;
    --on-accent: #0b1119;
  }
}
/* The current line colors the page's accent. */
body[data-line="todo"] { --brand: var(--l-todo); --accent-fill: #1d5fd8; --on-accent: #fff; --pg: var(--l-todo); }
body[data-line="casino"] { --brand: var(--l-casino); --accent-fill: #9a5a00; --on-accent: #fff; --pg: var(--l-casino); }
body[data-line="map"] { --brand: var(--l-map); --accent-fill: #0b7a43; --on-accent: #fff; --pg: var(--l-map); }
body[data-line="arcade"] { --brand: var(--l-arcade); --accent-fill: #c2255c; --on-accent: #fff; --pg: var(--l-arcade); }
body[data-line="wulf"] { --brand: var(--l-wulf); --accent-fill: #7335d6; --on-accent: #fff; --pg: var(--l-wulf); }
@media (prefers-color-scheme: dark) {
  body[data-line="todo"] { --accent-fill: #6aa4ff; --on-accent: #08111f; }
  body[data-line="casino"] { --accent-fill: #ffbf3d; --on-accent: #1a1200; }
  body[data-line="map"] { --accent-fill: #3fdc8a; --on-accent: #04170c; }
  body[data-line="arcade"] { --accent-fill: #ff7aa8; --on-accent: #2a0615; }
  body[data-line="wulf"] { --accent-fill: #b892ff; --on-accent: #140a26; }
}

/* Map and Wulf load the casino shell CSS, whose --acc / --btn-bg default to the old app blue.
   Point them at their own line so buttons, icons and tints match the rail. */
body[data-line="map"] { --acc: 15 154 85; --btn-bg: var(--accent-fill); --on-acc: var(--on-accent); }
body[data-line="wulf"] { --acc: 130 64 232; --btn-bg: var(--accent-fill); --on-acc: var(--on-accent); }
@media (prefers-color-scheme: dark) {
  body[data-line="map"] { --acc: 63 220 138; }
  body[data-line="wulf"] { --acc: 184 146 255; }
}
/* Focus rings and drop targets follow the current line, not the old app blue. */
body { --ring: 0 0 0 3px color-mix(in srgb, var(--pg) 32%, transparent); }

/* A stable gutter keeps the rail from shifting sideways between pages that scroll and pages that don't. */
html { scrollbar-color: var(--faint) transparent; scrollbar-gutter: stable; }
::selection { background: color-mix(in srgb, var(--pg) 30%, transparent); }
body, body.cx-body {
  font-family: var(--font);
  font-size: 17px;
  background: var(--bg);
  background-attachment: scroll;
  font-feature-settings: "tnum" 0;
}
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { font-family: var(--font); }

main, main.cx, body.map-body main.cx {
  max-width: 1120px;
  padding: var(--sp-lg) max(var(--sp-md), env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(var(--sp-md), env(safe-area-inset-left));
}
@media (min-width: 760px) { main, main.cx, body.map-body main.cx { padding-inline: var(--sp-lg); padding-bottom: var(--sp-xl); } }

/* ---------- surfaces: flat porcelain, no blur ---------- */
.glass, .panel {
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-card);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
dialog.glass, dialog.sheet { box-shadow: 0 2px 4px rgb(0 0 0 / .1), 0 24px 56px -12px rgb(0 0 0 / .45); }

/* ---------- the rail ---------- */
.rail { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.rail-in { display: flex; align-items: stretch; max-width: 1120px; height: var(--rail-h); margin: 0 auto; padding: 0 max(var(--sp-md), env(safe-area-inset-left)); }
@media (min-width: 760px) { .rail-in { padding-inline: var(--sp-lg); } }
.rail-brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 900; font-size: 19px; letter-spacing: .01em; }
.rail-brand img { width: 32px; height: 32px; border-radius: 8px; }
.rail-lines { display: flex; align-items: stretch; margin-left: auto; }
.rail-link { --c: var(--fg); position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 var(--sp-md); color: var(--muted); font-weight: 700; font-size: 15px; text-decoration: none; transition: color 160ms var(--ease-out); }
.rail-link i { font-size: 20px; }
.rail-link[data-l="todo"] { --c: var(--l-todo); }
.rail-link[data-l="casino"] { --c: var(--l-casino); }
.rail-link[data-l="map"] { --c: var(--l-map); }
.rail-link[data-l="wulf"] { --c: var(--l-wulf); }
.rail-link[data-l="arcade"] { --c: var(--l-arcade); }
/* The line itself: a bar along the rail's bottom edge; the current page gets its station. */
.rail-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 6px; background: var(--c); opacity: .3; transition: opacity 160ms var(--ease-out); }
.rail-link[aria-current="page"] { color: var(--fg); }
.rail-link[aria-current="page"]::after { opacity: 1; }
.rail-link[aria-current="page"]::before { content: ""; position: absolute; left: 50%; bottom: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); transform: translateX(-50%); z-index: 1; }
@media (hover: hover) and (pointer: fine) { .rail-link:hover { color: var(--fg); } .rail-link:hover::after { opacity: .75; } }
.rail-link:focus-visible { outline-offset: -3px; }

@media (max-width: 759px) {
  :root { --rail-h: 52px; }
  .rail-lines { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .rail-link { flex-direction: column; justify-content: center; gap: 2px; padding: 10px 0 8px; font-size: 11px; }
  .rail-link i { font-size: 24px; }
  .rail-link::after { top: -1px; bottom: auto; height: 4px; }
  .rail-link[aria-current="page"]::after { height: 6px; }
  .rail-link[aria-current="page"]::before { display: none; }
}

/* ---------- headings ---------- */
.top, .cx-top { margin-bottom: var(--sp-lg); gap: var(--sp-sm); }
.top h1, .cx-top h1 { font-size: clamp(30px, 4.4vw, 42px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
@media (max-width: 460px) { .cx-top h1 { font-size: 28px; } }
/* Phones: the page's actions take the top row and the title gets a full-width row beneath them, so a long
   game name never runs under the icons. */
@media (max-width: 460px) {
  .cx-top { flex-wrap: wrap; row-gap: var(--sp-sm); }
  html body[data-line] .cx-top > h1 { order: 1; flex-basis: 100%; margin: 0; font-size: 28px; }
  .cx-top > h1 + * { margin-left: auto; }
}
.top .home-link, .cx-top .home-link, .cx-top > a[href="/"], .top > a[href="/"] { display: none; }
/* Sign out lives in the profile menu on the rail; the old per-page buttons stay in the markup for their scripts. */
#signoutBtn, #signout { display: none; }
/* One size for every header action, on every page. */
.top .icon-btn, .cx-top .icon-btn { width: 40px; height: 40px; font-size: 20px; }
@media (pointer: coarse) { .top .icon-btn, .cx-top .icon-btn { width: 44px; height: 44px; } }
h2, h3 { font-weight: 800; letter-spacing: -.01em; }
.cap, .label { font-weight: 800; letter-spacing: .08em; }

/* ---------- controls ---------- */
.btn { border-radius: var(--r-control); font-weight: 700; letter-spacing: .005em; box-shadow: none; background: var(--accent-fill); color: var(--on-accent); transition: transform 160ms var(--ease-out), opacity 160ms, filter 160ms; }
.cx-body .btn { box-shadow: none; }
.btn.ghost, .cx-body .btn.ghost, .btn.plain { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line); }
.cx-body .btn.good { background: var(--good); color: var(--on-good); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--line); } }
.icon-btn { border-radius: var(--r-control); }
a.icon-btn { text-decoration: none; }
.field { background: var(--field); border-radius: var(--r-control); border: 1px solid var(--line); }
.field:focus-visible { border-color: var(--pg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pg) 32%, transparent); }
:focus-visible { outline-color: var(--pg); }
.seg { background: var(--surface); border: 1px solid var(--glass-edge); border-radius: 12px; box-shadow: none; }
.seg button { border-radius: 8px; font-weight: 700; }
.seg button.on, .seg.sliding::before { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; border-radius: 8px; }
.seg.sliding button.on { background: transparent; color: var(--on-accent); }
.composer { padding: var(--sp-sm); }
.list { padding: 2px var(--sp-md); }
.empty i { background: color-mix(in srgb, var(--pg) 16%, transparent); color: var(--accent-fill); border-radius: 16px; }
.person, .avatar, .lb-avatar { background: color-mix(in srgb, var(--pg) 20%, var(--surface)); color: var(--accent-fill); }
.lb-avatar { color: var(--fg); }
.check.on { color: var(--good); }
.check:not(.on):hover { color: var(--pg); }
.chip-sm, .choice { font-weight: 700; }
.cx-pill { background: var(--surface); box-shadow: none; border-color: var(--glass-edge); }
.new { background: var(--accent-fill); color: var(--on-accent); }
.toast { background: var(--fg); color: var(--bg); border: 0; }

/* ---------- sign-in ---------- */
.auth { margin-top: 8dvh; }
.auth img { width: 72px; height: 72px; border-radius: 16px; box-shadow: none; }
.auth h1 { font-size: 34px; font-weight: 900; letter-spacing: -.02em; }
.auth form { padding: var(--sp-lg); }

/* ---------- casino ---------- */
.cx-view.home { grid-template-columns: 1fr; }
.game-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 900px) {
  .cx-view.home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-view.home > .checkin { grid-column: 1 / -1; }
  .cx-view.home > .game-grid { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cx-view.game { max-width: 680px; width: 100%; margin-inline: auto; }
.cx-view.game.wide { max-width: 1000px; }
.g-emoji { border-radius: 12px; }
.banner-card { background: linear-gradient(rgb(var(--acc) / .14), rgb(var(--acc) / .14)), var(--surface); }
.game-card, .banner-card { border-radius: var(--r-card); }
@media (hover: hover) and (pointer: fine) { .game-card:hover, .banner-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(14 19 25 / .08), 0 12px 24px -10px rgb(14 19 25 / .25); } }

/* ---------- to-do: list left, sharing panel right on wide screens ---------- */
@media (min-width: 1000px) {
  body[data-line="todo"] #personal { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: var(--sp-xl); align-items: start; }
  body[data-line="todo"] #personal > * { grid-column: 1; }
  body[data-line="todo"] #personal > #share { grid-column: 2; grid-row: 1 / span 12; position: sticky; top: calc(var(--rail-h) + var(--sp-md)); }
}
body[data-line="todo"] #modes { width: fit-content; }

/* ---------- map: map plus a friends sidebar on wide screens ---------- */
.map { border-radius: var(--r-card); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); }
@media (min-width: 960px) {
  .map-app { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "top top" "map share" "map chips" "map card"; grid-template-rows: auto auto auto 1fr; column-gap: var(--sp-lg); row-gap: var(--sp-md); align-items: start; }
  .map-app > .cx-top { grid-area: top; margin-bottom: 0; }
  .map-app > .share { grid-area: share; }
  .map-app > .map { grid-area: map; height: calc(100dvh - var(--rail-h) - 150px); min-height: 480px; max-height: none; }
  .map-app > .chips { grid-area: chips; flex-direction: column; overflow: visible; }
  .map-app > #card { grid-area: card; }
  .friend-chip { width: 100%; min-height: 44px; border-radius: var(--r-control); justify-content: flex-start; }
  .friend-chip small { margin-left: auto; }
}
.friend-chip { background: var(--surface); }

/* ---------- wulf ---------- */
.wulf-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
@media (min-width: 900px) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .wulf-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.photo { border-radius: var(--r-card); }
body[data-line="wulf"] .cx-view > p.meta { max-width: 65ch; }
/* Wulf background: the group's photos drift behind the page under a flat wash so panels and text stay readable. */
.collage { position: fixed; inset: 0; z-index: 0; display: flex; gap: 12px; padding-inline: 12px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 900ms var(--ease-out); }
.collage.on { opacity: 1; }
.collage::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 66%, transparent); }
.collage-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; will-change: transform; animation: collage-drift var(--dur, 120s) linear infinite; }
.collage-col img { display: block; width: 100%; object-fit: cover; border-radius: var(--r-card); background: var(--line); }
@keyframes collage-drift { to { transform: translateY(calc(-50% - 6px)); } } /* half the column, minus half a gap, is one full set */
body.has-collage main { position: relative; z-index: 1; }
/* Loose text sits on a porcelain chip so it stays readable over any photo. */
body.has-collage .cx-view p.meta:not(.panel *), body.has-collage .wulf-name { background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--r-control); padding: 6px 12px; }
body.has-collage .wulf-name { border-radius: 999px; padding: 1px 10px; }
body.has-collage .cx-view p.meta:not(.panel *) { width: fit-content; max-width: min(65ch, 100%); }
@media (prefers-color-scheme: dark) { .collage::after { background: color-mix(in srgb, var(--bg) 54%, transparent); } } /* photos read darker on night enamel */
@media (prefers-reduced-motion: reduce) { .collage { transition: none; } .collage-col { animation: none; } }
@media (prefers-contrast: more) { .collage { display: none; } }
body[data-line="wulf"] .add-row { max-width: 520px; }
/* A button beside a field matches the field's height. */
.add-row .btn, .composer .line .btn { min-height: 44px; }
.badge { background: var(--accent-fill); color: var(--on-accent); }

/* The rail already links every app, so the per-page cross links are redundant. */
.cx-top > a.icon-btn { display: none; }
body[data-line="wulf"] .cx-view > p.meta { font-size: 15px; }

/* ---------- rail tools: bell + profile, in a slot reserved by rail.js at its final width ---------- */
.rail-tools { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-xs); min-width: 84px; margin-left: var(--sp-sm); }
.rail-tools .rail-bell, .rail-tools .rail-me { margin-left: 0; }
.rail-bell { order: 1; }
.rail-me { order: 2; }
.rail-me.pending { visibility: hidden; }
@media (max-width: 759px) { .rail-tools { margin-left: auto; } }

/* ---------- live alerts (notify.js) ---------- */
.rail-bell { flex: none; align-self: center; display: grid; place-items: center; width: 40px; height: 40px; margin-left: var(--sp-sm); border-radius: var(--r-control); color: var(--muted); font-size: 22px; transition: background-color 160ms, color 160ms, transform 160ms var(--ease-out); }
.rail-bell:active { transform: scale(.92); }
.rail-bell[aria-pressed="true"] { color: var(--fg); }
.rail-bell:disabled { opacity: .45; cursor: default; }
@media (hover: hover) and (pointer: fine) { .rail-bell:not(:disabled):hover { background: var(--line); color: var(--fg); } }
@media (max-width: 759px) { .rail-bell { margin-left: auto; } }
.nf-stack { position: fixed; z-index: 60; top: calc(var(--rail-h) + var(--sp-sm)); left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 24px)); display: grid; gap: var(--sp-sm); pointer-events: none; }
.nf { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-sm); padding: 10px 8px 10px var(--sp-md); background: var(--fg); color: var(--bg); border-radius: var(--r-card); box-shadow: 0 2px 4px rgb(0 0 0 / .15), 0 14px 32px -10px rgb(0 0 0 / .5); animation: nf-in 320ms var(--ease-out) both; transition: opacity 200ms, transform 200ms var(--ease-out); }
.nf.out { opacity: 0; transform: translateY(-8px); }
.nf-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.nf-text strong { font-weight: 800; overflow-wrap: anywhere; }
.nf-text span { font-size: 14px; opacity: .8; overflow-wrap: anywhere; }
.nf-act { flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--r-control); background: var(--bg); color: var(--fg); font-weight: 700; font-size: 14px; }
.nf-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-control); opacity: .7; }
.nf-x:hover { opacity: 1; }
@keyframes nf-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }

/* Avatar photo covers the initial instead of stacking under it (casino leaderboard, map, wulf). */
.lb-avatar { position: relative; }
.lb-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- profile button and sheet (account.js) ---------- */
.lb-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 700; overflow: hidden; flex: none; }
.rail-me { flex: none; align-self: center; display: grid; place-items: center; width: 40px; height: 40px; margin-left: var(--sp-xs); border-radius: 50%; color: var(--muted); font-size: 28px; transition: transform 160ms var(--ease-out); }
.rail-me:active { transform: scale(.92); }
.rail-me .lb-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
@media (max-width: 759px) { .rail-me { margin-left: var(--sp-sm); } }
dialog.acct-dlg { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: var(--sp-lg); color: var(--fg); background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--r-card); box-shadow: 0 2px 4px rgb(0 0 0 / .1), 0 24px 56px -12px rgb(0 0 0 / .45); overscroll-behavior: contain; }
dialog.acct-dlg::backdrop { background: rgb(10 15 25 / .5); }
.acct-head { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-md); }
.acct-head h3 { flex: 1; margin: 0; font-size: 22px; }
.acct-who { display: flex; align-items: center; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.acct-label { display: block; margin: var(--sp-md) 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
dialog.acct-dlg .field { width: 100%; }
.acct-emoji { width: 72px !important; text-align: center; font-size: 28px; }
.acct-text { padding: var(--sp-sm) var(--sp-md); font: inherit; resize: vertical; min-height: 84px; }
.acct-count { margin-top: 4px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acct-err { margin-top: var(--sp-sm); color: var(--bad); font-size: 14px; }
.acct-actions { display: flex; gap: var(--sp-sm); justify-content: flex-end; margin-top: var(--sp-md); }
.acct-out { display: block; margin: var(--sp-md) auto 0; padding: 8px 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Group gate: shown over every page until the signed-in person is in a group (group-gate.js). */
.gate-lead { margin: 0 0 var(--sp-md); color: var(--muted); text-wrap: pretty; }
.gate-invites { display: grid; gap: var(--sp-sm); margin-bottom: var(--sp-md); }
.gate-invite { display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md); border: 1px solid var(--line); border-radius: var(--r-card); }
.gate-invite-text { flex: 1; min-width: 0; display: grid; overflow-wrap: anywhere; }
.gate-invite-text span { font-size: 13px; color: var(--muted); }
.gate-create { display: grid; gap: 6px; margin-bottom: var(--sp-md); }
.gate-create .acct-label { margin: 0; }
.gate-create .btn { justify-self: end; margin-top: var(--sp-xs); }
dialog.acct-dlg > .btn.small { display: block; margin: 0 auto; }

/* Idle screensaver (screensaver.js): the same collage, over the whole page, unwashed. Any input dismisses it. */
.collage.saver { z-index: 9000; background: #05070b; pointer-events: auto; cursor: none; transition-duration: 1400ms; }
.collage.saver::after { display: none; }

/* Switching sections: the browser keeps the rail still and the page slides and fades in the direction you
   are travelling along the line (rail.js sets forward/backward). Same-origin navigations only. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .rail { view-transition-name: rail; }
  .rail-lines { view-transition-name: rail-lines; }
  :root { --vt-dx: 0px; }
  :root:active-view-transition-type(forward) { --vt-dx: 28px; }
  :root:active-view-transition-type(backward) { --vt-dx: -28px; }
  ::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
  ::view-transition-old(root) { animation: vt-out 300ms var(--ease-out) both; }
  ::view-transition-new(root) { animation: vt-in 320ms var(--ease-out) both; }
  ::view-transition-group(rail), ::view-transition-group(rail-lines) { animation-duration: 220ms; animation-timing-function: var(--ease-out); }
  @keyframes vt-out { 60% { opacity: 1; } to { opacity: 0; transform: translateX(calc(var(--vt-dx) * -.4)); } }
  @keyframes vt-in { from { opacity: 0; transform: translateX(var(--vt-dx)); } }
}
