/* v15 The Metro Line: tokens, type, buttons, the LED + split-flap boards, the doors, the mute button. */
:root {
  --paper: #f2efe6;
  --paper-2: #e7e2d4;
  --ink: #14161c;
  --ink-2: #4a4f5c;
  --line: #1747d1;          /* the Pro Line */
  --line-dk: #0e2f93;
  --hazard: #ffd000;        /* door edges, platform edge */
  --amber: #ffb31a;         /* LED */
  --led-bg: #0b0c0f;
  --night: #0d1220;         /* inside the train */
  --good: #12a150;
  --warn: #f08c00;
  --bad: #e5322d;
  --sign: 'DIN Alternate', 'DIN Condensed', 'Avenir Next Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --cond: 'DIN Condensed', 'Avenir Next Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font: 16px/1.4 var(--body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
body[data-phase=play], body[data-phase=reveal] { background: var(--night); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- the stage + the screens ---------- */
.stage { position: fixed; inset: 0; z-index: 1; }
.stage.is-window { z-index: 12; pointer-events: none; opacity: 0; transition: opacity .8s ease, clip-path .6s var(--ease); }
.stage.is-window.is-live { opacity: 1; }
.screen {
  position: fixed; inset: 0; z-index: 10; overflow-x: clip; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--st) + 14px) 16px calc(var(--sb) + 16px);
}
.screen > section { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .55s var(--ease); }
.screen.is-in > section { opacity: 1; transform: none; }

/* a faint map in the paper: other lines crossing far away */
.screen::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .55;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(20,22,28,.05) 0) 0 0 / 28px 28px,
    linear-gradient(0deg, transparent calc(100% - 1px), rgba(20,22,28,.05) 0) 0 0 / 28px 28px;
}

/* ---------- the brand pill ---------- */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 56px; min-height: 44px; }
.brand__pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--line); color: #fff;
  font: 700 15px/1 var(--sign); letter-spacing: .06em; text-transform: uppercase; padding: 8px 14px 7px 8px; border-radius: 999px;
}
.brand__pill i { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 5px var(--line), 0 0 0 0 #fff; position: relative; }
.brand__pill i::after { content: ''; position: absolute; left: -4px; right: -4px; top: 8px; height: 4px; background: #fff; border-radius: 2px; }
.brand__pill--s { font-size: 12px; padding: 6px 10px 5px 6px; }
.brand__pill--s i { width: 15px; height: 15px; box-shadow: inset 0 0 0 4px var(--line); }
.brand__pill--s i::after { top: 6px; height: 3px; }
.brand__by { font: 700 11px/1 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- the forward button (a big transit button) ---------- */
.go {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  min-height: 62px; padding: 0 10px 0 22px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--line); color: #fff; font: 700 21px/1 var(--sign); letter-spacing: .01em; text-align: left;
  box-shadow: 0 4px 0 var(--line-dk), 0 10px 24px rgba(23,71,209,.28);
  transition: transform .14s ease, box-shadow .14s ease, background .25s ease, opacity .25s ease;
}
.go__t { padding-top: 3px; }
.go__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--hazard); color: var(--ink); display: grid; place-items: center; flex: none; transition: transform .3s var(--spring); }
.go__ic svg { width: 24px; height: 24px; }
.go:not(:disabled):hover .go__ic { transform: translateX(3px); }
.go:not(:disabled):active, .go.is-pressed { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-dk), 0 4px 10px rgba(23,71,209,.2); }
.go:disabled { cursor: default; background: #9aa0ad; box-shadow: 0 4px 0 #7d8390; }
.go:disabled .go__ic { background: rgba(255,255,255,.35); color: #fff; }
.go[aria-busy=true] .go__ic svg { animation: busy 1s ease-in-out infinite; }
@keyframes busy { 0% { transform: translateX(-6px); opacity: .2; } 50% { opacity: 1; } 100% { transform: translateX(6px); opacity: .2; } }
.go.is-ready:not(:disabled) { animation: ready .6s var(--spring) both; }
@keyframes ready { 0% { transform: scale(.96); } 100% { transform: none; } }
.go.is-pulse:not(:disabled) { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 4px 0 var(--line-dk), 0 0 0 0 rgba(255,208,0,.0); } 50% { box-shadow: 0 4px 0 var(--line-dk), 0 0 0 8px rgba(255,208,0,.45); } }

/* ---------- LED / split-flap boards ---------- */
.flap { display: inline-flex; gap: 4px; }
.flap__c {
  position: relative; display: inline-grid; place-items: center; font-style: normal;
  width: .74em; height: 1.12em; padding-top: .08em; border-radius: .09em;
  background: linear-gradient(#1b1d22 0 50%, #15171b 50% 100%); color: var(--amber);
  font-family: var(--cond); font-weight: 700; line-height: 1; text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.05);
}
.flap__c::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.75); }
.flap__c.is-sp { background: transparent; box-shadow: none; width: .32em; }
.flap__c.is-sp::after { display: none; }
.flap__c.is-spin { color: #b88426; }
.flap__c.is-set { animation: flapset .22s ease-out; }
@keyframes flapset { 0% { transform: perspective(160px) rotateX(70deg); color: #fff3c4; } 100% { transform: none; } }
.flap--xl { font-size: 64px; gap: 6px; }
.flap--l { font-size: clamp(34px, 10vw, 58px); gap: 3px; }
.flap--bad .flap__c { color: #ff6a5c; }

/* ---------- the train doors ---------- */
.doors { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.doors.is-gone { visibility: hidden; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50.5%; will-change: transform;
  background: linear-gradient(180deg, #c9ccd3 0%, #b4b8c1 100%);
  transition: transform .56s cubic-bezier(.65, 0, .35, 1);
}
.door--l { left: 0; transform: translateX(-101%); }
.door--r { right: 0; transform: translateX(101%); }
.doors.is-shut .door { transform: none; }
.doors.no-anim .door { transition: none; }
.door__win {
  position: absolute; top: 16%; height: 38%; width: 62%; border-radius: 18px;
  background: linear-gradient(160deg, #2a3550 0%, #121828 60%, #1d2740 100%);
  box-shadow: inset 0 0 0 6px #8e939e, inset 0 0 0 7px rgba(0,0,0,.25);
}
.door__win::after { content: ''; position: absolute; inset: 12px; border-radius: 12px; background: linear-gradient(120deg, rgba(255,255,255,.14) 0 18%, transparent 18% 100%); }
.door--l .door__win { right: 14%; }
.door--r .door__win { left: 14%; }
.door__edge { position: absolute; top: 0; bottom: 0; width: 12px; background: var(--hazard); box-shadow: inset 0 0 0 3px #191b20; }
.door--l .door__edge { right: 0; }
.door--r .door__edge { left: 0; }
.door::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: calc(var(--sb) + 8%); height: 14px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 12px, #191b20 12px 24px); opacity: .9;
}
.doors__sign {
  position: absolute; left: 50%; bottom: calc(var(--sb) + 8% + 30px); transform: translateX(-50%);
  font: 700 15px/1 var(--sign); letter-spacing: .22em; text-transform: uppercase; color: #fff; background: var(--ink);
  padding: 9px 14px 7px; border-radius: 6px; opacity: 0; transition: opacity .2s ease;
}
.doors.is-shut .doors__sign { opacity: 1; transition-delay: .45s; }

/* ---------- mute ---------- */
.mute {
  position: fixed; z-index: 50; top: calc(var(--st) + 14px); right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; display: grid; place-items: center; cursor: pointer; background: var(--ink); color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: transform .15s ease;
}
.mute:active { transform: scale(.92); }
.mute svg { width: 20px; height: 20px; }
.mute .mute__off, .mute.is-muted .mute__on { display: none; }
.mute.is-muted .mute__off { display: block; }
body[data-phase=play] .mute, body[data-phase=reveal] .mute { background: rgba(255,255,255,.12); top: calc(var(--st) + 12px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
