/* ------------------------------------------------------------------
   PDX: page chrome. Tokens, chamfer and logo mark come from ../core.css
   (docs/STYLE-GUIDE.md). The scene fills the window and has its own
   look, day and night (docs/PDX-SPEC.md sections 1 and 6d); the chrome
   floats over it in the DG//OS look: near-black panels and slips (which read
   on a bright noon and a dark street alike), square corners, mono labels,
   volt for the active thing and for where you are, cyan for information.
   ------------------------------------------------------------------ */

body.pdx {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--screen);
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pdx-stage { position: fixed; inset: 0; }
#view { display: block; width: 100%; height: 100%; }

kbd {
  display: inline-block; min-width: 20px; padding: 3px 5px; margin: 0 2px 0 0;
  border: 1px solid var(--line-2);
  font: 500 11px/1 var(--font-mono); text-align: center; text-transform: uppercase;
  color: var(--text); background: rgba(6, 7, 11, .8);
}

/* ---------- Top bar ---------- */
.pdx-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  height: var(--hud-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(14px, 3vw, 32px);
  font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  pointer-events: none;
}
.pdx-top > * { pointer-events: auto; }
/* The scene is bright: the brand sits on a dark slip so it reads. */
.pdx-top .brand { padding: 6px 12px 6px 6px; background: rgba(6, 7, 11, .78); }
.pdx-toggles { display: flex; gap: 8px; }
.pdx-toggle {
  padding: 9px 11px;
  border: 1px solid var(--line-2); background: rgba(6, 7, 11, .78);
  color: var(--muted); font: inherit; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.pdx-toggle:hover { color: var(--volt); border-color: var(--volt); }
.pdx-toggle[aria-pressed="false"] { color: var(--dim); text-decoration: line-through; }

/* Bottom left, quiet: which map (cyan, information). It sits on the key
   list, whose height game.js keeps in --keys-h (one row about 40px, two
   on a narrower window), and the boarding prompt sits above it. The
   clock is at the top (the wave 12 block at the end). */
.pdx-status {
  position: fixed; left: clamp(14px, 3vw, 32px); right: clamp(14px, 3vw, 32px); bottom: calc(var(--keys-h, 40px) + 6px); z-index: 5;
  display: flex; flex-wrap: wrap-reverse; align-items: flex-end; gap: 6px 8px;
  pointer-events: none;
}
.pdx-where {
  margin: 0; padding: 7px 10px; background: rgba(6, 7, 11, .72);
  font: 500 11px/1 var(--font-mono); text-transform: uppercase;
}
.pdx-where { letter-spacing: .16em; color: var(--cyan); }
.pdx-where:empty { display: none; }

/* ---------- The stop banner ---------- */
.pdx-banner {
  position: fixed; left: 50%; top: 74px; z-index: 6;
  display: grid; justify-items: center; gap: 6px;
  padding: 12px 26px 11px;
  background: rgba(5, 6, 10, .86);
  border: 1px solid var(--volt);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  transform: translate(-50%, -24px); opacity: 0;
  transition: transform .25s steps(4), opacity .25s steps(4);
  pointer-events: none;
}
.pdx-banner.is-on { transform: translate(-50%, 0); opacity: 1; }
.pdx-banner-name { font: 700 clamp(18px, 2.4vw, 26px)/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--volt); }
.pdx-banner-sub { font: 500 10px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* ---------- The boarding prompt ---------- */
.pdx-prompt {
  --c: 12px;
  position: fixed; left: 50%; bottom: calc(var(--keys-h, 40px) + 52px); z-index: 6; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); white-space: nowrap;
  padding: 13px 18px 13px 20px; border: 0;
  background: var(--volt); color: #000; cursor: pointer;
  font: 700 13px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.pdx-prompt kbd { color: #000; background: transparent; border-color: rgba(0, 0, 0, .45); }
.pdx-prompt:hover { background: #fff; }
.pdx-prompt:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--volt), inset 0 0 0 8px #000; }
/* "No service past here yet": information, not an action. */
.pdx-prompt.is-off { background: rgba(5, 6, 10, .86); color: var(--cyan); cursor: default; box-shadow: inset 0 0 0 1px var(--line-2); }
.pdx-prompt.is-off kbd { display: none; }

.pdx-keys {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  padding: 10px 16px 12px;
  font: 500 11px/1.6 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  background: rgba(5, 6, 10, .72);
  pointer-events: none;
}
@media (pointer: coarse) {
  .pdx-keys, .pdx-prompt kbd, .pdx-title-foot .pdx-keyonly { display: none; }
  .pdx-status { bottom: 16px; }
  .pdx-prompt { bottom: 92px; }
}
.pdx-title-foot .pdx-touchonly { display: none; }
@media (pointer: coarse) { .pdx-title-foot .pdx-touchonly { display: inline; } }

.pdx-stick {
  --kx: 0px; --ky: 0px;
  position: fixed; z-index: 20;
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border: 1px solid rgba(230, 255, 43, .6); background: rgba(6, 7, 11, .45);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  pointer-events: none;
}
.pdx-stick i { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; background: var(--volt); opacity: .85; transform: translate(var(--kx), var(--ky)); }

/* ---------- Fade ---------- */
.pdx-fade { position: fixed; inset: 0; z-index: 8; background: var(--screen); opacity: 0; pointer-events: none; visibility: hidden; }
.pdx-fade.is-on { visibility: visible; }

/* ---------- The title card ----------
   While the map builds it sits on a dark backdrop with the progress
   line; once built the backdrop clears, the card stays over the running
   map, and any key or tap puts it away. */
.pdx-title { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(3, 4, 7, .94); transition: background .3s steps(3), opacity .3s steps(3); }
.pdx-title.is-ready { background: rgba(3, 4, 7, .32); cursor: pointer; }
.pdx-title.is-gone { opacity: 0; pointer-events: none; }
.pdx-title-box { --c: 22px; --bd: var(--line-2); padding: 26px 30px 22px; width: min(480px, 100%); }
.pdx-title-eyebrow { margin: 0 0 10px; font: 500 11px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.pdx-title-name { margin: 0 0 12px; font: 700 clamp(24px, 3.4vw, 32px)/1.05 var(--font-display); letter-spacing: .01em; text-transform: uppercase; color: var(--volt); }
.pdx-title-text { margin: 0 0 18px; font: 400 16px/1.55 var(--font-display); color: var(--text); }
.pdx-title-text:empty { display: none; }
.pdx-title-track { height: 6px; background: var(--line); }
.pdx-title-track i { display: block; height: 100%; width: 0; background: var(--volt); transition: width .12s steps(2); }
.pdx-title-stage { margin: 12px 0 0; font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pdx-title:not(.is-ready) .pdx-title-stage::after { content: '_'; animation: pdx-blink 1s steps(1) infinite; }
.pdx-title.is-ready .pdx-title-track, .pdx-title.is-ready .pdx-title-stage { display: none; }
.pdx-title-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font: 500 11px/1.6 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pdx-title-foot[hidden] { display: none; }
@keyframes pdx-blink { 50% { opacity: 0; } }
.pdx-noscript { position: fixed; inset: auto 16px 16px; color: var(--hot); font: 500 13px/1.4 var(--font-mono); }

/* ---------- The ride card ---------- */
.pdx-ride { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .25s steps(3); }
.pdx-ride.is-on { opacity: 1; }
.pdx-ride-box { --c: 22px; --bd: var(--line-2); padding: 24px 30px 22px; width: min(640px, 100%); }
.pdx-ride-eyebrow { margin: 0 0 10px; font: 500 11px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.pdx-ride-title { margin: 0 0 30px; font: 700 clamp(22px, 3vw, 30px)/1.05 var(--font-display); text-transform: uppercase; color: var(--text); }
.pdx-ride-title span { color: var(--volt); }
/* The line: a cyan rule with a tick and a name at each stop; the dot is
   you, riding. Names alternate below and above so neighbours never
   collide. */
.pdx-ride-line { position: relative; height: 2px; margin: 34px 56px 46px; background: var(--cyan); }
.pdx-ride-line ol { list-style: none; margin: 0; padding: 0; }
.pdx-ride-line li {
  position: absolute; top: 14px; width: 120px; transform: translateX(-50%); text-align: center;
  font: 500 10px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.pdx-ride-line li::before { content: ''; position: absolute; left: 50%; top: -19px; width: 2px; height: 12px; margin-left: -1px; background: var(--cyan); }
.pdx-ride-line li:nth-child(even) { top: auto; bottom: 14px; }
.pdx-ride-line li:nth-child(even)::before { top: auto; bottom: -19px; }
.pdx-ride-line li.is-from, .pdx-ride-line li.is-to { color: var(--text); }
.pdx-ride-stage { margin: 0; font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pdx-ride-dot { position: absolute; top: -7px; width: 16px; height: 16px; margin-left: -8px; background: var(--volt); box-shadow: 0 0 12px rgba(230, 255, 43, .6); left: 0; }
@media (max-width: 560px) { .brand-name em { display: none; } .pdx-toggle { padding: 8px; } .pdx-ride-line { margin: 34px 30px 46px; } }
/* A narrow window with a keyboard: the status takes two rows, so the
   prompt goes up one. */
@media (max-width: 700px) and (pointer: fine) { .pdx-prompt { bottom: calc(var(--keys-h, 40px) + 84px); } }
@media (max-width: 460px) {
  .pdx-top { gap: 8px; }
  .pdx-banner { padding: 10px 16px 9px; }
  .pdx-prompt { font-size: 11px; letter-spacing: .08em; padding: 12px 14px; }
  .brand-name { display: none; }
  .pdx-toggles { gap: 4px; }
  .pdx-toggle { padding: 7px 6px; letter-spacing: .06em; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .pdx-banner, .pdx-title, .pdx-ride, .pdx-title-track i { transition: none; }
  .pdx-title:not(.is-ready) .pdx-title-stage::after { animation: none; }
}

/* ---------- Wave 12 A: the clock at the top ----------
   SAT 18 JUL 1998 // 3:00 PM // CLEAR, top centre, always on while
   playing (Dick, 2026-11-11). A chamfered near-black slip like the
   toggles, the time in cyan (information, not an action: volt is the
   player's). In the top bar between the logo and the three buttons
   where it fits: the bar's two ends are about 230 and 300px and the
   clock up to about 430px with the longest label ("Partly cloudy"), so
   below 1100px it drops under the bar, and the stop banner (which
   drops in at top centre) moves down under it. Under the title card
   (z 40) and the ride card's fade (z 8). */
.pdx-clock {
  --c: 8px;
  position: fixed; left: 50%; top: calc((var(--hud-h) - 32px) / 2); z-index: 6;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px); overflow: hidden;
  margin: 0; padding: 10px 16px; height: 32px; box-sizing: border-box;
  background: rgba(6, 7, 11, .82);
  box-shadow: inset 0 0 0 1px var(--line-2);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
  font: 500 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.pdx-clock[hidden] { display: none; }
.pdx-clock i { font-style: normal; color: var(--muted); margin: 0 .6em; }
.pdx-clock .pdx-clock-time { color: var(--cyan); }
@media (max-width: 1100px) {
  .pdx-clock { top: var(--hud-h); }
  .pdx-banner { top: calc(var(--hud-h) + 44px); }
}
@media (max-width: 460px) {
  .pdx-clock { --c: 6px; padding: 10px 10px; font-size: 11px; letter-spacing: .05em; }
  .pdx-clock i { margin: 0 .35em; }
  .pdx-clock { top: calc(var(--hud-h) - 6px); }
  .pdx-banner { top: calc(var(--hud-h) + 36px); }
}
