:root {
  --ink: #f3ece0;
  --dim: rgba(243, 236, 224, .72);
  --gold: #e3bd7a;
  --GO: #ffc46b; --POS: #ff8fa8; --REC: #6fdcff; --CHA: #ff7a3c; --PED: #b79cff;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #05070c; color: var(--ink); overflow: hidden; }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#roll { position: fixed; left: 0; right: 0; bottom: 46px; width: 100%; height: 96px; pointer-events: none;
  opacity: 0; transition: opacity 1.6s; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
body.playing canvas#roll { opacity: .9; }
body.explore canvas#roll { opacity: 0; }

/* ---------- titles ---------- */
section { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; z-index: 20;
  background: radial-gradient(ellipse at 50% 38%, rgba(26, 24, 40, .5), rgba(3, 4, 7, .96) 72%);
  transition: opacity 1.8s ease, visibility 1.8s; }
section.gone { opacity: 0; visibility: hidden; pointer-events: none; }
section[hidden] { display: none; }
.inner { max-width: 680px; padding: 24px; }
.over { font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--gold); margin: 0 0 22px; }
h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(56px, 11vw, 128px); letter-spacing: .1em;
  margin: 0; line-height: .95; background: linear-gradient(180deg, #fff8ea 20%, #c79a55 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.4vw, 26px); color: var(--dim); margin: 14px 0 44px; }
.fine { font-size: 12.5px; line-height: 1.7; color: rgba(243, 236, 224, .6); margin-top: 34px; }
#load { width: 220px; height: 1px; margin: 0 auto 14px; background: rgba(255, 255, 255, .14); overflow: hidden; }
#loadBar { height: 100%; width: 0; background: var(--gold); transition: width .25s; }
#loadTxt { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); margin: 0 0 30px; min-height: 1.2em; }
section button { font: 500 12px var(--sans); letter-spacing: .34em; text-transform: uppercase; color: var(--ink);
  background: transparent; border: 1px solid rgba(227, 189, 122, .6); padding: 16px 44px 16px 48px; cursor: pointer;
  transition: all .5s; border-radius: 40px; }
section button:hover:not(:disabled) { background: var(--gold); color: #120d06; box-shadow: 0 0 60px rgba(227, 189, 122, .35); }
section button:disabled { opacity: .25; cursor: default; }
.row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- captions ---------- */
#caption { position: fixed; left: 6vw; bottom: 172px; max-width: min(600px, 62vw); pointer-events: none; z-index: 5;
  opacity: 0; transform: translateY(10px); transition: opacity 1.1s ease, transform 1.4s ease; }
body.playing #caption.on { opacity: 1; transform: none; }
/* a soft shadow behind the words, which comes and goes with them */
#caption::before { content: ''; position: absolute; inset: -70px -110px -80px -140px; z-index: -1;
  background: radial-gradient(ellipse at 42% 52%, rgba(0, 0, 0, .62), rgba(0, 0, 0, .3) 45%, transparent 72%); }
body.explore #caption { display: none; }
#caption .kicker { font-size: 11.5px; font-weight: 500; letter-spacing: .38em; text-transform: uppercase; color: #f2cf8e; margin-bottom: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .85); }
#caption .line { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 3.1vw, 42px); line-height: 1.14; color: #fffaf0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 2px 22px rgba(0, 0, 0, .95), 0 0 60px rgba(0, 0, 0, .7); }
#caption .line em { color: #f5d394; font-style: italic; }

/* ---------- registration: the stops that are drawn, by division; the whole stop list when you play yourself ---------- */
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 1.6s;
  background: linear-gradient(0deg, rgba(0, 0, 0, .62), transparent 30%), linear-gradient(270deg, rgba(0, 0, 0, .66), rgba(0, 0, 0, .34) 15%, transparent 34%); }
body.playing::before { opacity: 1; }
#stops { position: fixed; right: max(18px, 2.4vw); top: max(18px, 3vh); width: 340px; z-index: 6; opacity: 0; transition: opacity 1.6s;
  pointer-events: none; max-height: calc(100vh - 170px); display: flex; flex-direction: column; align-items: flex-end; }
body.playing #stops { opacity: 1; }
#section { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin-bottom: 14px; min-height: 44px; }
#secNo { font-size: 10.5px; font-weight: 500; letter-spacing: .3em; color: rgba(243, 236, 224, .82); text-transform: uppercase; text-shadow: 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, .85); }
#secName { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 28px; font-weight: 500; line-height: 1; white-space: nowrap; color: #fffaf0; text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 2px 18px #000; }
#stopList { overflow: hidden; text-align: right; }
#stopList.many { column-count: 2; column-gap: 18px; }
.div { margin-bottom: 9px; break-inside: avoid; max-height: 400px; transition: opacity .8s, max-height .8s, margin .8s; }
.div h4 { margin: 0 0 3px; font: 600 9px var(--sans); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; color: var(--c); opacity: .8; transition: opacity .6s;
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .9); }
.div.live h4 { opacity: 1; text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .9), 0 0 16px var(--c); }
.div.sel h4::after { content: ' ●'; }
.stop { font: 500 11.5px/1.5 var(--sans); letter-spacing: .02em; white-space: nowrap; color: var(--c); color: color-mix(in srgb, var(--c) 76%, #fff);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 9px rgba(0, 0, 0, .9);
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .7s ease, opacity .9s ease; }
.stop b { font-weight: 500; display: inline-block; min-width: 24px; text-align: right; opacity: .85; }
.stop.on { max-height: 18px; opacity: 1; }
body:not(.explore) .div.empty { max-height: 0; opacity: 0; margin: 0; overflow: hidden; }
#tools { display: none; margin-top: 10px; text-align: right; }
body.explore #stops { pointer-events: auto; width: 540px; max-height: calc(100vh - 70px); padding: 12px 12px 12px 22px; right: 8px; top: 8px; border-radius: 10px;
  background: linear-gradient(90deg, transparent, rgba(4, 5, 8, .78) 14%); }
body.explore #stopList, body.explore #stopList.many { column-count: 3; column-gap: 16px; overflow-y: auto; }
body.explore #tools { display: block; }
body.explore .stop { cursor: pointer; max-height: 18px; opacity: 1; color: rgba(243, 236, 224, .55); text-shadow: 0 1px 2px #000; }
body.explore .stop:hover { color: var(--ink); }
body.explore .stop.on { color: var(--c); color: color-mix(in srgb, var(--c) 76%, #fff); text-shadow: 0 1px 2px #000, 0 0 12px var(--c); }
body.explore .div h4 { cursor: pointer; }
#tools .row { justify-content: flex-end; gap: 5px; margin-bottom: 6px; }
#tools button { font: 500 9.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: rgba(10, 10, 14, .55);
  border: 1px solid rgba(227, 189, 122, .35); border-radius: 20px; padding: 5px 9px; cursor: pointer; }
#tools button:hover, #tools button.on { background: var(--gold); color: #120d06; }
.hint { font-size: 11px; line-height: 1.6; color: var(--dim); margin: 8px 0 0; text-shadow: 0 1px 6px #000; }
kbd { font: inherit; border: 1px solid rgba(255, 255, 255, .3); border-radius: 3px; padding: 0 3px; }

/* ---------- transport ---------- */
#hud { position: fixed; left: 0; right: 0; bottom: 0; height: 46px; display: flex; align-items: center; gap: 14px;
  padding: 0 max(18px, 3vw); z-index: 10; opacity: 0; transition: opacity .8s; pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent); }
body.playing #hud { pointer-events: auto; opacity: .5; }
body.playing #hud:hover, body.playing.idle-off #hud, body.explore #hud { opacity: 1; }
#hud button { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; display: grid; place-items: center; opacity: .8; }
#hud button:hover, #hud button.on { opacity: 1; color: var(--gold); }
#hud button svg { width: 18px; height: 18px; fill: currentColor; }
#hud button.txt { font: 500 10px var(--sans); letter-spacing: .26em; text-transform: uppercase; padding: 6px 8px; white-space: nowrap; }
#seek { flex: 1; height: 18px; position: relative; cursor: pointer; }
#seek::before { content: ''; position: absolute; left: 0; right: 0; top: 8.5px; height: 1px; background: rgba(255, 255, 255, .22); }
#seekFill { position: absolute; left: 0; top: 8px; height: 2px; width: 0; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
#seekMarks i { position: absolute; top: 6px; width: 1px; height: 6px; background: rgba(255, 255, 255, .3); }
#clock, #meter { font: 400 11px var(--sans); letter-spacing: .12em; color: var(--dim); min-width: 34px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#meter b { font-weight: 500; color: var(--gold); display: inline-block; min-width: 26px; text-align: right; }
body.explore #seek { visibility: hidden; } body.explore #btnPlay, body.explore #clock { display: none; }
#err { position: fixed; inset: auto 20px 20px 20px; z-index: 99; background: #3a0d0d; color: #ffd9d0; font: 12px/1.5 ui-monospace, monospace;
  padding: 12px 14px; border-radius: 6px; white-space: pre-wrap; }
@media (max-width: 720px), (max-height: 560px) { body:not(.explore) #stopList { display: none; } #caption { max-width: 88vw; bottom: 150px; } #meter { display: none; } }
@media (max-width: 700px) { body.explore #stops { width: 300px; } body.explore #stopList, body.explore #stopList.many { column-count: 2; } .stop { font-size: 10.5px; } #hud { gap: 8px; } }
