/* The Ride — projector. The Stitch stage (dark), on a fixed 1440×810 grid scaled to the window. */
html, body { height: 100%; overflow: hidden; background: #000; }
#viewport { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--d-surface-lowest); }
#stage {
  position: relative; width: 1440px; height: 810px; flex: none; overflow: hidden;
  transform: scale(var(--scale, 1)); transform-origin: center;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--d-surface); color: var(--d-on-surface); font-family: var(--f-ui);
}
.muted { color: var(--d-on-surface-variant); }
.pcb { color: var(--pc-bright); }
.saffron { color: var(--lakshmi-bright); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-md); }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.spacer { flex: 1; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pc-bright); flex: none; }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; margin-right: var(--g-xs); }
@keyframes pulse { 50% { opacity: .35; } }

/* Layers cross-fade (the card, the backdrop) */
.layer { transition: opacity var(--enter), transform var(--enter); }
.layer.entering { opacity: 0; transform: translateY(8px); }
.layer.leaving { opacity: 0; position: absolute; pointer-events: none; }
#backdrop .layer.entering { transform: none; }

/* ---------------------------------------------------------------- backdrop: one world (public/js/scenes.js)
   Every backdrop is drawn at 1600×900 (80 px past each side, 45 px above the stage): its horizon lands on
   stage y 455 and its near ground meets the road at y 694. Far and near layers, the sun between them, then one
   grade for every scene: the same contrast, saturation and horizon haze, a light tint toward the stop's persona,
   and a little darker when the room is running late (--late, 0…1). No global scrim: cards carry their own. */
#backdrop {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; --par: 0;
  filter: saturate(.8) contrast(.92) brightness(calc(.96 - var(--late, 0) * .24));
  transition: filter 1.6s ease;
}
#backdrop .layer { position: absolute; inset: 0; transition-duration: 900ms; }
#backdrop .far-wrap, #backdrop .near-wrap { position: absolute; left: -80px; top: -45px; width: 1600px; height: 900px; transition: transform 1.4s var(--glide-ease); }
/* Parallax: when the convoy moves along the stop, the near layer shifts more than the far one */
#backdrop .far-wrap { transform: translateX(calc(var(--par) * -0.015px)); }
#backdrop .near-wrap { transform: translateX(calc(var(--par) * -0.05px)); }
/* Arriving: the new scene settles in from the direction of travel */
#backdrop .layer.entering .far-wrap { transform: translateX(calc(var(--par) * -0.015px + 12px)); }
#backdrop .layer.entering .near-wrap { transform: translateX(calc(var(--par) * -0.05px + 40px)); }
#backdrop .far, #backdrop .near { position: absolute; inset: 0; background-repeat: no-repeat; background-size: 1600px 900px; opacity: 0; transition: opacity 600ms ease; }
#backdrop .far.ok, #backdrop .near.ok { opacity: 1; }
/* Stopped: the scene holds still (nothing competes with the story); the far layer is a touch soft */
#backdrop .far { filter: blur(1px); }
#backdrop .sun { position: absolute; width: 0; height: 0; }
#backdrop .sun::before { content: ""; position: absolute; left: -280px; top: -280px; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--light, #fff) 50%, transparent), color-mix(in srgb, var(--light, #fff) 14%, transparent) 55%, transparent); mix-blend-mode: screen; opacity: .8; }

#backdrop .haze { position: absolute; left: 0; right: 0; top: 330px; height: 250px; background: linear-gradient(transparent, color-mix(in srgb, var(--light, #fff) 20%, transparent) 50%, transparent); mix-blend-mode: screen; pointer-events: none; }
#backdrop .tint { position: absolute; inset: 0; background: var(--pc); opacity: .12; mix-blend-mode: soft-light; }
/* A soft vignette keeps the eye on the card and the convoy */
#backdrop .layer::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 50% 48%, transparent 55%, rgb(10 8 6 / .38)); pointer-events: none; }
#backdrop .dusk { position: absolute; inset: 0; background: #0b1030; opacity: calc(var(--late, 0) * .3); mix-blend-mode: multiply; transition: opacity 1.6s ease; }
/* Riding: the leg's panorama (3840×1080, seamless; one tile is 3200 px here) pans past, far slower than near */
#backdrop .pano .far, #backdrop .pano .near { background-repeat: repeat-x; background-size: auto 900px; }
.riding #backdrop .pano .near { animation: pan 10s linear infinite; }
.riding #backdrop .pano .far { animation: pan 34s linear infinite; }
@keyframes pan { from { background-position: 0 0; } to { background-position: -3200px 0; } }

#hud, #main, #road { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- HUD */
#hud { display: flex; align-items: center; justify-content: space-between; gap: var(--g-md); padding: var(--g-md) var(--section) var(--g-sm); min-height: 72px; background: linear-gradient(rgb(16 14 11 / .5), rgb(16 14 11 / .18) 70%, transparent); }
#hud.lobby { padding-top: var(--g-lg); }
.hud-l { display: flex; flex-direction: column; gap: var(--g-xs); min-width: 0; }
.hud-l.row { flex-direction: row; gap: var(--g-md); }
.hud-l .chapter { color: var(--pc-bright); letter-spacing: 1px; }
.hud-r { display: flex; align-items: center; gap: var(--g-md); flex: none; }
.chip { display: inline-flex; align-items: center; gap: var(--g-sm); padding: var(--g-xs) var(--g-md); border-radius: var(--r-full); background: var(--d-surface-container); border: 1px solid var(--d-outline-variant); white-space: nowrap; }
.chip.big { padding: var(--g-sm) var(--g-lg); gap: var(--g-md); background: rgb(30 27 24 / .95); }
.chip.big .dot { width: 12px; height: 12px; background: var(--crew-bright); }
.chip.big b { color: var(--crew-bright); }
.chip b { font-weight: 500; }
.chip.recap { border-radius: var(--r-md); background: var(--d-surface-low); }
.chip.recap .ic { font-size: 16px; color: var(--pc-bright); }
.chip.recap strong { color: var(--d-on-surface); font-weight: 600; }
.chip.host .dot { background: var(--lakshmi-bright); }
.chip.join { border-radius: var(--r-lg); background: var(--l-surface-lowest); color: var(--l-on-surface); border: 0; padding: var(--g-xs) var(--g-sm); }
.qr-mini { width: 40px; height: 40px; display: block; }
.qr-mini svg, .qr-box svg, .qr-big svg { width: 100%; height: 100%; display: block; }
.join-t { display: flex; flex-direction: column; }
.join-t .mono-md { color: var(--l-on-surface-variant); }

/* ---------------------------------------------------------------- the stage card */
#main { padding: var(--g-md) var(--section); display: grid; align-items: center; }
#main > .layer { grid-area: 1 / 1; min-width: 0; }
.card {
  width: 100%; padding: var(--g-xl); border-radius: var(--r-xl); background: rgb(30 27 24 / .9); border: 1px solid var(--d-outline-variant); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  /* A soft local scrim: the card darkens only the scene right around it */
  box-shadow: 0 0 0 1px rgb(0 0 0 / .2), 0 24px 140px 56px rgb(12 10 8 / .42);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; gap: var(--g-xl); transform-origin: center;
}
.col-main { grid-column: span 8; display: flex; flex-direction: column; gap: var(--g-md); min-width: 0; }
.card.wide .col-main, .card.sites-look .col-main, .card.palace .col-main, .card.arrive, .card.ride { grid-column: 1 / -1; }
.panel { grid-column: span 4; display: flex; justify-content: flex-end; min-width: 0; }
.card.side:has(.panel.empty) .col-main { grid-column: 1 / -1; }
.panel.empty { display: none; }
.story.solo { font: 600 26px/34px var(--f-ui); color: var(--d-on-surface); }
.story.twist { color: var(--pc-bright); }
.story:empty, [data-head]:empty, .after:empty, .guessed:empty, .status:empty { display: none; }
.after { color: var(--d-on-surface-variant); }

/* Panel box (vote timer + QR, think timer) */
.panel-box { width: 100%; max-width: 320px; padding: var(--g-md); border-radius: var(--r-xl); background: var(--d-surface-container); border: 1px solid var(--d-outline-variant); display: flex; flex-direction: column; align-items: center; gap: var(--g-sm); }
.panel-box .ph { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--g-sm); }
.panel-box .ph .label-lg { display: inline-flex; align-items: center; gap: var(--g-xs); }
.qr-box { width: 144px; height: 144px; padding: var(--g-sm); border-radius: var(--r-lg); background: var(--l-surface-lowest); }
.qr-box.small { width: 96px; height: 96px; }
.meter { width: 100%; height: 8px; border-radius: var(--r-full); background: var(--d-surface-highest); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--pc-bright); transform-origin: left; transition: transform 250ms linear; }
.hands { display: flex; flex-direction: column; align-items: center; gap: var(--g-sm); padding: var(--g-md) 0; text-align: center; }
.hands .ic { font-size: 56px; }
[data-clock].paused { animation: pulse 1.2s ease-in-out infinite; }
.status { display: inline-flex; align-items: center; gap: var(--g-md); }
.status .label-lg { display: inline-flex; align-items: center; gap: var(--g-xs); }

/* Answers with live results */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--g-sm); transition: opacity var(--enter); }
.opts.n3, .opts.n9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.n4.travellers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--g-md); }
[data-beat="think"] .opts:not(.travellers), [data-beat="listen"] .opts { visibility: hidden; opacity: 0; }
[data-beat="listen"] .opts { display: none; }
.opt { padding: var(--g-md); border-radius: var(--r-lg); background: var(--d-surface-container); border: 1px solid var(--d-outline-variant); display: flex; flex-direction: column; gap: var(--g-xs); transition: border-color var(--state), box-shadow var(--state); }
.opt-top { display: flex; align-items: center; justify-content: space-between; gap: var(--g-sm); }
.opt .t { flex: 1; color: var(--d-on-surface); }
.opt .key { color: var(--d-outline); width: 16px; flex: none; }
.opt .pct { color: var(--d-on-surface-variant); flex: none; }
.opt .bar { display: block; width: 100%; height: 8px; border-radius: var(--r-full); background: var(--d-surface-highest); overflow: hidden; }
.opt .bar i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--d-outline); transition: width var(--glide); }
.opt.top { border: 2px solid var(--pc-bright); padding: calc(var(--g-md) - 1px); }
.opt.top .t { font-weight: 600; }
.opt.top .pct, .opt.picked .pct { color: var(--pc-bright); }
.opt.top .bar i, .opt.picked .bar i { background: var(--pc-bright); }
.opts.n9 .opt { padding: var(--g-sm); }
.opts.n9 .opt.top { padding: calc(var(--g-sm) - 1px); }
/* The four travellers (Q7): each card in its persona's colour */
.opt.trav { border: 2px solid var(--pc); padding: calc(var(--g-md) - 1px); }
.opt.trav[data-p="ravi"] { border-color: var(--pc-bright); }
.opt.trav .who { display: inline-flex; align-items: center; gap: var(--g-xs); color: var(--pc-bright); }
.opt.trav .who .ic { font-size: 20px; }
.opt.trav .pct { color: var(--pc-bright); }
.opt.trav .bar i { background: var(--pc-bright); }
.opt.trav.top { border-color: var(--pc-bright); box-shadow: 0 0 0 3px rgb(255 255 255 / .08), 0 0 24px -4px var(--pc-bright); }
[data-beat="gather"] .opt.trav .bar, [data-beat="think"] .opt.trav .bar { visibility: hidden; }

/* Info cards (Stop 3) */
.info-card { width: 100%; max-width: 384px; padding: var(--g-md); border-radius: var(--r-xl); background: var(--d-surface-container); border: 1px solid color-mix(in srgb, var(--pc-bright) 60%, transparent); display: flex; flex-direction: column; gap: var(--g-sm); animation: rise var(--enter) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.tokens { display: flex; flex-direction: column; gap: var(--g-xs); }
.tok { display: flex; justify-content: space-between; padding: var(--g-xs) var(--g-sm); border-radius: var(--r-sm); background: var(--d-surface-low); }
.tok .to { opacity: 0; transform: translateX(-8px); transition: opacity var(--enter), transform var(--enter); transition-delay: calc(var(--k) * 500ms); }
.swapped .tok .to { opacity: 1; transform: none; }
.link-row { display: flex; align-items: center; gap: var(--g-md); }

/* ---------------------------------------------------------------- lobby */
#main[data-layout="lobby"] { padding: var(--g-md) var(--section); }
.lobby { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--g-xl); align-items: center; }
.lobby-l { grid-column: span 8; display: flex; flex-direction: column; gap: var(--g-md); }
.qr-card { grid-column: 9 / -1; justify-self: end; padding: var(--g-lg); border-radius: var(--r-xl); background: var(--l-surface-lowest); color: var(--l-on-surface); border: 1px solid var(--l-outline-variant); display: flex; flex-direction: column; align-items: center; gap: var(--g-sm); text-align: center; }
.qr-big { width: 208px; height: 208px; padding: var(--g-sm); border-radius: var(--r-lg); border: 1px solid var(--l-outline-variant); }
.qr-card.hands { padding: var(--g-xl); max-width: 320px; }
.qr-card.hands > .ic { font-size: 96px; color: var(--crew); }

/* ---------------------------------------------------------------- prologue (cold open, title, who's riding, ignition) */
.tile { padding: var(--g-sm); border-radius: var(--r-lg); background: var(--d-surface-container); border: 1px solid var(--pc); display: flex; align-items: center; gap: var(--g-sm); transition: opacity var(--enter), transform var(--enter), box-shadow var(--enter); }
.tile .ic { font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--g-sm); }
.fact { --pc: var(--crew); --pc-bright: var(--crew-bright); opacity: .25; }
.fact.on { opacity: 1; }
@keyframes rev { 50% { filter: brightness(1.6); transform: scaleY(1.3); } }
/* One line at a time: the prologue and the story beats sit in a compact card, centred over the scene */
.card.prologue { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--g-md); max-width: 1040px; justify-self: center; background: rgb(30 27 24 / .78); }
.prologue [data-title]:empty { display: none; }
.prologue [data-line] { font: 600 36px/46px var(--f-display); color: var(--d-on-surface); }
.prologue [data-title]:not(:empty) + [data-line] { font: 600 26px/34px var(--f-ui); color: var(--d-on-surface-variant); }
.prologue .facts { width: 100%; text-align: left; }
.meter.rev { display: none; width: 360px; height: 12px; }
.meter.rev i { background: var(--crew-bright); transform: none; width: 100%; }
[data-beat="ignite"] .meter.rev, [data-beat="fired"] .meter.rev { display: block; }
[data-beat="ignite"] .meter.rev i { animation: idle-rev 1.2s ease-in-out infinite alternate; }
[data-beat="fired"] .meter.rev i { animation: rev 600ms ease-in-out 3; }
@keyframes idle-rev { from { transform: scaleX(.35); } to { transform: scaleX(.5); } }
.meter.rev i { transform-origin: left; }
[data-beat="listen"] .card.stop, [data-beat="look"] .card.stop:not(.sites-look), [data-beat="handover"] .card.stop:not(.sites-q) { max-width: 1040px; justify-self: center; }
[data-beat="listen"] .card.stop .story.solo { font: 600 30px/40px var(--f-display); }
[data-beat="handover"] .opts { display: none; }
[data-beat="handover"] [data-head] { font: 700 36px/44px var(--f-display); }
.story.twist { font: 600 26px/34px var(--f-ui); }

/* ---------------------------------------------------------------- arrive and ride cards */
.card.arrive { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--g-sm); max-width: 760px; justify-self: center; background: rgb(30 27 24 / .78); }
.card.ride { display: flex; flex-direction: column; align-items: center; gap: var(--g-sm); max-width: 640px; justify-self: center; text-align: center; background: rgb(30 27 24 / .8); }
.card.ride .mono-lg { color: var(--lakshmi-bright); font-size: 32px; line-height: 40px; }
.card.ride .ic { font-size: 40px; }

/* ---------------------------------------------------------------- Stop 1: the two websites */
.card.sites-q .col-main { grid-column: span 6; }
.col-q { grid-column: span 6; display: flex; flex-direction: column; gap: var(--g-md); min-width: 0; }
.sites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--g-md); perspective: 1600px; }
.site-in { position: relative; display: grid; transition: transform 800ms var(--glide-ease); transform-style: preserve-3d; }
.site:nth-child(2) .site-in { transition-delay: 160ms; }
.sites.flipped .site-in { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; padding: var(--g-md); border-radius: var(--r-lg); background: var(--d-surface-container); border: 1px solid color-mix(in srgb, var(--pc-bright) 50%, transparent); display: flex; flex-direction: column; gap: var(--g-sm); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face .ic { font-size: 20px; }
.face.back { transform: rotateY(180deg); background: color-mix(in srgb, var(--pc) 15%, var(--d-surface-container)); border-color: var(--pc-bright); justify-content: flex-start; }
.shot { padding: var(--g-xs); border-radius: var(--r-md); background: var(--d-surface-lowest); border: 1px solid var(--d-outline-variant); display: flex; flex-direction: column; gap: var(--g-xs); }
.shot .row { padding: 0 var(--g-xs) var(--g-xs); }
.frame { height: 160px; border-radius: var(--r-sm); overflow: hidden; background: var(--l-surface-lowest); border: 1px solid var(--d-outline-variant); position: relative; }
.sites.big .frame { height: 250px; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.frame iframe { position: absolute; top: 0; left: 0; width: 1280px; border: 0; transform-origin: 0 0; pointer-events: none; }
.back-in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--g-sm); word-break: break-all; }
.back-in .ic.big { font-size: 48px; }
.back-in dl { align-self: stretch; text-align: left; }
.back-in dl { display: flex; flex-direction: column; gap: var(--g-sm); }
.guessed b { font-weight: 600; }

/* ---------------------------------------------------------------- the road */
#road { display: flex; flex-direction: column; }
#lane { position: relative; height: 148px; z-index: 2; }
/* The verge: roadside grass, stones, kerbs, shrubs and milestones for the region, in the backdrop's own ground
   colour; it overlaps the backdrop above and the asphalt below, so there is no seam */
#verge { position: absolute; left: 0; right: 0; bottom: -18px; height: 120px; pointer-events: none; }
#verge .layer { position: absolute; inset: 0; background-repeat: repeat-x; background-size: 1440px 120px; transition: opacity 900ms; }
#verge .layer.entering { transform: none; }
.riding #verge .layer { animation: verge 3s linear infinite; }
@keyframes verge { to { background-position: -1440px 0; } }
#convoy { position: absolute; inset: 0; }
/* Riders ride on the asphalt (wheels a third of the way into the road), in front of the verge */
.rider { position: absolute; left: 0; bottom: -36px; width: 176px; display: flex; flex-direction: column; align-items: center; transform: translateX(var(--x, 0)); transition: transform var(--glide), opacity var(--glide); }
.rider.lead { width: 192px; }
.tagrow { display: flex; align-items: center; gap: var(--g-sm); margin-bottom: var(--g-xs); }
.rider .tagrow .tag { margin-bottom: 0; }
.rider.lead .tagrow { align-self: flex-start; margin-left: 12px; }
.bikebox { position: relative; width: 100%; display: block; }
/* Shared light: a rim in the scene's light colour on the lit side, and a soft shadow on the road away from it */
.bike { filter: drop-shadow(calc(var(--lx, 0) * 2.5px) -2px 1.5px color-mix(in srgb, var(--light, #fff) 70%, transparent)) drop-shadow(0 0 6px color-mix(in srgb, var(--light, #fff) 18%, transparent)); }
.rider .shadow { position: absolute; left: 11%; right: 11%; bottom: 2px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / .55), rgb(0 0 0 / .2) 60%, transparent); transform: translateX(calc(var(--lx, 0) * -22px)) scaleX(1.12); filter: blur(1.5px); }
.rider .tag { display: inline-flex; align-items: center; gap: var(--g-xs); padding: var(--g-xs) var(--g-md); border-radius: var(--r-full); background: var(--pc); color: var(--pc-on); white-space: nowrap; transition: background var(--glide), color var(--glide); }
.rider .tag .ic { font-size: 14px; }
.bike { width: 100%; height: 112px; overflow: visible; }
.bike .tank, .bike .jacket { fill: var(--pc); stroke: var(--pc-bright); stroke-width: 2; }
.bike .jacket { stroke-width: 1.5; }
.bike .arm { stroke: var(--pc-bright); }
.bike .helmet { fill: var(--pc-bright); stroke: #161310; }
.bike .beam { opacity: .18; }
.rider.waiting { opacity: .7; transform: translateX(var(--x, 0)) translateY(-10px) scale(.94); }
.rider.waiting .tag { background: var(--d-surface-container); color: var(--pc-bright); border: 1px dashed var(--pc-bright); }
.rider.joined { animation: join 900ms var(--glide-ease); }
@keyframes join { 0% { transform: translateX(var(--x)) translateY(-10px) scale(.94); } 45% { transform: translateX(calc(var(--x) + 40px)) translateY(-18px); } 100% { transform: translateX(var(--x)); } }
#convoy.roll-in .rider { animation: roll 1.4s var(--glide-ease) both; }
@keyframes roll { from { transform: translateX(calc(var(--x) - 1100px)); } }
/* Riding: wheels spin, bodies bob, the beam brightens */
.riding .wheel { animation: spin .45s linear infinite; }
.riding .bike .body { animation: bob .5s ease-in-out infinite alternate; }
.riding .bike .beam { opacity: .3; }
.rider:nth-child(2n) .body { animation-delay: -.2s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { to { transform: translateY(-2px); } }
.rider.rev .bike { animation: shake .09s linear infinite; }
@keyframes shake { 50% { transform: translate(1px, -1px); } }
/* Ambient: the parked convoy breathes a little */
#stage:not(.riding) .rider:not(.waiting) .bike .body { animation: idle 2.4s ease-in-out infinite alternate; }
@keyframes idle { to { transform: translateY(-1px); } }

#sign { position: absolute; right: var(--section); bottom: var(--g-xs); }
#sign.beside { right: auto; left: 0; transform: translateX(var(--x)); }
#sign.arriving { animation: arrive linear both; }
@keyframes arrive { from { transform: translateX(560px); opacity: 0; } 15% { opacity: 1; } to { transform: none; } }
.milestone { padding: var(--g-sm) var(--g-md); border-radius: var(--r-md); background: var(--d-surface-container); border: 1px solid var(--pc-bright); display: flex; flex-direction: column; align-items: center; }
.milestone .mono-md { color: var(--pc-bright); font-weight: 600; }
.milestone .ic { color: var(--pc-bright); font-size: 20px; }

/* The asphalt, leaning a little toward the scene's ground colour, lit faintly at its far edge */
#strip {
  position: relative; z-index: 1; height: 56px; display: flex; align-items: center; padding: 0 var(--g-lg);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--ground, #2d2926) 30%, #34312d) 0, color-mix(in srgb, var(--ground, #2d2926) 22%, #26231f) 100%);
  box-shadow: inset 0 18px 18px -14px color-mix(in srgb, var(--light, #fff) 10%, transparent), inset 0 -2px 0 rgb(255 255 255 / .05);
  transition: background 900ms;
}
#strip i { display: block; width: 100%; height: 3px; margin-top: 10px; background: repeating-linear-gradient(90deg, rgb(251 216 140 / .55) 0 22px, transparent 22px 44px); }
.riding #strip i { animation: dashes .08s linear infinite; }
@keyframes dashes { to { background-position: -44px 0; } }

#foot { display: flex; align-items: center; justify-content: space-between; gap: var(--g-lg); padding: var(--g-md) var(--section); background: rgb(22 19 16 / .95); min-height: 60px; }
#route { display: flex; align-items: center; gap: var(--g-md); min-width: 0; }
#foot.lobby #route { flex: 1; justify-content: space-between; }
.stops { display: flex; align-items: center; gap: var(--g-md); }
.stopname { display: inline-flex; align-items: center; gap: var(--g-xs); color: var(--d-on-surface-variant); white-space: nowrap; }
.stopname .ic { font-size: 16px; }
.stopname.done { color: var(--crew-bright); }
.stopname.now { padding: var(--g-xs) var(--g-md); border-radius: var(--r-full); background: var(--pc); color: var(--pc-on); gap: var(--g-sm); }
.stopname.now .dot { background: var(--pc-on); }
.sep { color: var(--d-outline); }

/* ---------------------------------------------------------------- the PIN dialog (presenter only) */
.modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgb(16 14 11 / .7); }
.modal-box { width: 480px; padding: var(--g-lg); border-radius: var(--r-xl); background: var(--l-surface); color: var(--l-on-surface); display: flex; flex-direction: column; gap: var(--g-sm); }
.modal-box h3 { font: 600 24px/30px var(--f-display); }
.modal-box p { font: 400 15px/22px var(--f-ui); color: var(--l-on-surface-variant); }
.modal-box input { font: 600 24px var(--f-mono); padding: var(--g-sm) var(--g-md); border: 1px solid var(--l-outline); border-radius: var(--r-md); background: var(--l-surface-lowest); }
.modal-box .err { min-height: 20px; color: var(--l-error); font: 600 14px var(--f-ui); }
.modal-box .row { justify-content: flex-end; }
.modal-box button { font: 600 14px var(--f-ui); padding: var(--g-sm) var(--g-lg); border-radius: var(--r-md); border: 1px solid var(--l-outline-variant); background: var(--l-surface-low); min-height: 44px; }
.modal-box button.go { background: var(--l-primary); color: var(--l-on-primary); border-color: var(--l-primary); }
.state-msg { display: flex; flex-direction: column; gap: var(--g-md); }

/* Host mode: the presenter clicks the room's answer on the stage */
[data-beat="vote"] .opt[data-o], [data-beat="locked"] .opt[data-o] { cursor: pointer; }

/* ---------------------------------------------------------------- the presenter's dock (mouse only; auto-hides) */
#viewport:not(.dock-on) { cursor: none; }
#dock {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; max-width: min(1100px, calc(100vw - 32px));
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--g-sm);
  color: var(--d-on-surface); font: 500 14px/20px var(--f-ui);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity var(--enter), transform var(--enter);
}
.dock-on #dock { opacity: 1; transform: none; pointer-events: auto; }
.d-bar { display: flex; align-items: center; gap: var(--g-xs); padding: var(--g-xs); border-radius: var(--r-full); background: rgb(16 14 11 / .92); border: 1px solid var(--d-outline-variant); box-shadow: 0 8px 32px rgb(0 0 0 / .45); }
.d-btn { display: inline-flex; align-items: center; gap: var(--g-xs); min-height: 40px; padding: var(--g-sm) var(--g-md); border-radius: var(--r-full); color: var(--d-on-surface); white-space: nowrap; transition: background var(--state); }
.d-btn .ic { font-size: 20px; }
.d-btn:hover:not(:disabled), .d-btn.on { background: var(--d-surface-highest); }
.d-btn:disabled { opacity: .4; cursor: default; }
.d-btn.go { background: var(--crew); color: #fff; font-weight: 600; padding-right: var(--g-lg); }
.d-btn.go:hover:not(:disabled) { background: #11877e; }
.d-btn.warn, .d-btn.amber { color: var(--lakshmi-bright); }
.d-btn.amber.here { background: rgb(217 119 6 / .2); }
.d-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lakshmi-bright); }
.d-dot.on { background: var(--meera-bright); }
.d-sep { width: 1px; height: 24px; background: var(--d-outline-variant); margin: 0 var(--g-xs); }
.d-toast, .d-flag, .d-panel { padding: var(--g-sm) var(--g-md); border-radius: var(--r-lg); background: rgb(16 14 11 / .92); border: 1px solid var(--d-outline-variant); max-width: 560px; }
.d-flag { border-color: var(--lakshmi); color: var(--lakshmi-bright); }
.d-panel { display: flex; flex-direction: column; gap: var(--g-sm); max-height: 50vh; overflow: auto; }
.d-panel .muted { color: var(--d-on-surface-variant); }
.d-panel ul { display: flex; flex-direction: column; gap: var(--g-xs); }
.d-panel li { display: flex; justify-content: space-between; gap: var(--g-md); }
.d-panel li.here { color: var(--lakshmi-bright); }
.d-panel .mono { font-family: var(--f-mono); color: var(--d-on-surface-variant); }
.d-panel a { color: var(--crew-bright); display: inline-flex; align-items: center; gap: 4px; margin-right: var(--g-md); }

/* ================================================================ the trip (engine.js) */
/* The dashboard on the lead motorcycle: clock face, expected arrival, fuel bill */
.dash { display: none; position: relative; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: var(--r-full); background: rgb(16 14 11 / .9); border: 1px solid var(--d-outline-variant); white-space: nowrap; box-shadow: 0 4px 16px rgb(0 0 0 / .35); }
.trip-on .dash { display: inline-flex; }
.dash .dt { color: var(--meera-bright); font-weight: 600; }
.dash.late .dt { color: var(--lakshmi-bright); }
.dash .df { color: var(--d-on-surface); font-weight: 600; }
.dash .dsep { width: 1px; height: 16px; background: var(--d-outline-variant); margin: 0 2px; }
.dash .dfuel { font-size: 15px; color: var(--lakshmi-bright); }
.dash.bump { animation: bump 700ms var(--glide-ease); }
@keyframes bump { 30% { transform: scale(1.12); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lakshmi-bright) 40%, transparent), 0 4px 16px rgb(0 0 0 / .35); } }
.dchips { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); pointer-events: none; }
.chips.float { flex-wrap: nowrap; animation: floatup 3s var(--glide-ease) forwards; }
@keyframes floatup { 0% { opacity: 0; transform: translateY(10px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.clockface { width: 26px; height: 26px; flex: none; }
.clockface .face { fill: #f6efe6; stroke: #1e1b18; stroke-width: 1.5; }
.clockface .ticks line { stroke: #3e4947; stroke-width: 1.5; stroke-linecap: round; }
.clockface .hh, .clockface .mh { stroke: #1e1b18; stroke-linecap: round; transform-origin: 20px 20px; transition: transform 1.2s cubic-bezier(.3, 0, .2, 1); }
.clockface .hh { stroke-width: 3; }
.clockface .mh { stroke-width: 2; stroke: #c2410c; }
.clockface .pin { fill: #1e1b18; }

/* Effect chips: green = time saved, amber = time added, red-orange = rupees and bolts */
.chips { display: inline-flex; flex-wrap: wrap; gap: var(--g-sm); }
.fx { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: var(--r-full); font: 600 14px/22px var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid; background: rgb(16 14 11 / .9); }
.fx .nut { width: 14px; height: 14px; }
.fx.saved { color: #4ade80; border-color: rgb(74 222 128 / .55); background: color-mix(in srgb, #4ade80 14%, rgb(16 14 11 / .9)); }
.fx.added { color: #fbbf24; border-color: rgb(251 191 36 / .55); background: color-mix(in srgb, #fbbf24 14%, rgb(16 14 11 / .9)); }
.fx.rupees, .fx.bolt { color: #fb8a5a; border-color: rgb(251 138 90 / .6); background: color-mix(in srgb, #fb8a5a 14%, rgb(16 14 11 / .9)); }
.chips.big .fx { font-size: 20px; line-height: 30px; padding: 4px 18px; }
.chips.big .fx .nut { width: 20px; height: 20px; }
.chips.big .fx { animation: chipin 500ms var(--glide-ease) both; }
.chips.big .fx:nth-child(2) { animation-delay: 120ms; }
.chips.big .fx:nth-child(3) { animation-delay: 240ms; }
@keyframes chipin { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.nut { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle; }
.nut .hole { fill: rgb(16 14 11 / .85); }

/* The reveal: the room's answer shows its type, then the effect and the outcome in the persona's colour */
.outcome-row { display: flex; flex-wrap: wrap; gap: var(--g-sm); }
.after .outcome { font: 600 22px/30px var(--f-ui); color: var(--pc-bright); }
.after:has(.outcome) { display: flex; flex-direction: column; gap: var(--g-sm); }
.type-tag { flex: none; padding: 2px 10px; border-radius: var(--r-full); background: var(--d-surface-highest); color: var(--d-on-surface); animation: chipin 500ms var(--glide-ease) both; }
.type-tag[data-t="smart"] { color: #4ade80; }
.type-tag[data-t="careful"] { color: #80d5cb; }
.type-tag[data-t="over-cautious"] { color: #a5b4fc; }
.type-tag[data-t="shortcut"] { color: #fb8a5a; }
.opt.tie { border: 2px dashed var(--lakshmi-bright); padding: calc(var(--g-md) - 1px); }
.tie-note { color: var(--lakshmi-bright); text-align: center; }
.status .tie-note { text-align: left; }
.story.context { color: var(--d-on-surface-variant); font-style: italic; }
.story.kicker { font: 500 14px/20px var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--pc-bright); }
[data-beat="takeaway"] .opts { display: none; }
[data-beat="takeaway"] .card.stop { max-width: 1040px; justify-self: center; }
[data-beat="takeaway"] [data-head] { font: 700 36px/46px var(--f-display); }

/* Loose bolts on the bikes: a gentle wobble; a broken one falls off */
.bolts { position: absolute; left: 36%; top: 30%; display: flex; gap: 4px; }
.boltb { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fed7aa; background: #c2410c; border: 2px solid #fdba74; box-shadow: 0 0 14px rgb(251 138 90 / .65); animation: wobble 1.7s ease-in-out infinite; }
.boltb .nut { width: 16px; height: 16px; }
.boltb .nut .hole { fill: #c2410c; }
@keyframes wobble { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg) translateY(-1px); } }
.boltb.new { animation: boltin 700ms var(--glide-ease) 700ms both, wobble 1.7s ease-in-out 1.4s infinite; }
@keyframes boltin { from { transform: scale(0) rotate(-180deg); opacity: 0; } 70% { transform: scale(1.3); } }
.boltb.falling { animation: boltfall 1.2s cubic-bezier(.45, 0, .9, .45) forwards; }
@keyframes boltfall { 0% { transform: none; } 18% { transform: translateY(-10px) rotate(-30deg); } 100% { transform: translate(-36px, 90px) rotate(-300deg); opacity: 0; } }
.nut.wobble { color: #fb8a5a; animation: wobble 1.7s ease-in-out infinite; }

/* A detour: the convoy stops with a jolt and the sign swings in */
#detour { position: absolute; left: 0; bottom: -6px; width: 132px; height: 150px; transform: translateX(var(--x, 1100px)); opacity: 0; pointer-events: none; transition: opacity 300ms; }
#detour.on { opacity: 1; }
#detour svg { width: 100%; height: 100%; display: block; transform-origin: 50% 100%; filter: drop-shadow(calc(var(--lx, 0) * 2px) -2px 1px color-mix(in srgb, var(--light, #fff) 60%, transparent)); }
#detour.swing svg { animation: swing 1.6s cubic-bezier(.3, 0, .3, 1) 250ms both; }
@keyframes swing { 0% { transform: rotate(-88deg); opacity: 0; } 30% { transform: rotate(14deg); opacity: 1; } 50% { transform: rotate(-7deg); } 68% { transform: rotate(3.5deg); } 84% { transform: rotate(-1.5deg); } 100% { transform: none; } }
#convoy.jolt .bikebox { animation: jolt 600ms cubic-bezier(.3, 0, .2, 1); }
@keyframes jolt { 0% { transform: none; } 18% { transform: translateX(16px) rotate(-3deg); } 38% { transform: translateX(-6px) rotate(1.5deg); } 60% { transform: translateX(3px); } 100% { transform: none; } }

/* ---------------------------------------------------------------- rules */
.card.rules { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--g-lg); max-width: 1000px; justify-self: center; background: rgb(30 27 24 / .82); }
.rule-lines { display: flex; flex-direction: column; gap: var(--g-md); text-align: left; }
.rule-lines li { display: flex; align-items: center; gap: var(--g-md); animation: rise 500ms var(--glide-ease) both; animation-delay: calc(var(--k) * 380ms + 200ms); }
.rule-lines .headline-md { font-weight: 500; }
.rule-ic { width: 32px; height: 32px; font-size: 32px; flex: none; color: var(--lakshmi-bright); }
.rule-ic.nut { color: #fb8a5a; }
.rule-lines li:last-child .headline-md { font-weight: 600; color: var(--crew-bright); }

/* ---------------------------------------------------------------- detour card */
.card.detour { display: flex; flex-direction: column; gap: var(--g-md); max-width: 960px; justify-self: center; border-color: color-mix(in srgb, #f97316 55%, transparent); }
.card.detour .display-md { color: #fb923c; text-transform: uppercase; letter-spacing: 3px; }
.card.detour .msg { font: 600 28px/38px var(--f-display); color: var(--d-on-surface); }
.card.detour .pill .nut { font-size: 16px; }

/* ---------------------------------------------------------------- petrol pump: the bill, large */
.card.dash-card { display: flex; flex-direction: column; gap: var(--g-lg); }
.readouts { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: var(--g-md); }
.readout { display: flex; align-items: center; gap: var(--g-md); padding: var(--g-md) var(--g-lg); border-radius: var(--r-xl); background: var(--d-surface-container); border: 1px solid var(--d-outline-variant); }
.readout > div { display: flex; flex-direction: column; gap: 2px; }
.readout b { font-weight: 700; color: var(--meera-bright); }
.readout.late b { color: var(--lakshmi-bright); }
.readout:nth-child(2) b { color: var(--d-on-surface); }
.readout .big-clock { width: 72px; height: 72px; }
.readout .big-ic { font-size: 56px; color: var(--lakshmi-bright); }
.bolts-box { flex-direction: column; align-items: flex-start; gap: var(--g-sm); }
.bolt-list { display: flex; flex-direction: column; gap: var(--g-sm); }
.bolt-list li { display: flex; align-items: center; flex-wrap: wrap; gap: var(--g-sm); }
.bolt-list li > .nut { font-size: 18px; color: #fb8a5a; }
.bolt-list li.broken > .nut { color: var(--d-outline); }

/* ---------------------------------------------------------------- the trip ledger and the three routes */
.card.ledger, .card.routes { display: flex; flex-direction: column; gap: var(--g-md); padding: var(--g-lg) var(--g-xl); }
.ledger-head { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--g-lg); align-items: end; }
.ledger-head > div { display: flex; flex-direction: column; gap: 2px; }
.ledger-head .ok { color: var(--meera-bright); }
.ledger-head .warn { color: var(--lakshmi-bright); }
.ledger-head .stat b { color: var(--d-on-surface); }
.ledger-rows { display: flex; flex-direction: column; gap: 6px; }
.ledger-rows li { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: var(--g-md); padding: 6px var(--g-md); border-radius: var(--r-md); background: var(--d-surface-container); border-left: 3px solid var(--pc-bright); }
.ledger-rows li.broke { border-left-color: #f97316; background: color-mix(in srgb, #f97316 8%, var(--d-surface-container)); }
.ledger-rows .where { display: inline-flex; align-items: center; gap: 6px; }
.ledger-rows li.broke .where { color: #fb923c; }
.ledger-rows .what b { color: var(--pc-bright); margin-right: 4px; }
.route-chart { width: 100%; height: auto; display: block; }
.route-chart .axis { font: 500 13px var(--f-mono); fill: var(--d-on-surface-variant); }
.route-chart .tick { stroke: var(--d-outline-variant); stroke-dasharray: 2 4; }
.route-chart .ideal { stroke: var(--d-outline); stroke-dasharray: 6 6; }
.route-chart .rt { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; opacity: .85; stroke-dasharray: 2000; animation: draw 1.6s var(--glide-ease) both; }
.route-chart .rt.shortcut { animation-delay: .25s; }
.route-chart .rt.over-cautious { animation-delay: .5s; }
.route-chart .rt.room { stroke-width: 6; opacity: 1; animation-delay: .8s; filter: drop-shadow(0 0 6px rgb(255 255 255 / .45)); }
@keyframes draw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
.rt.optimal { stroke: var(--meera-bright); } .rt-end.optimal, .route-card.optimal .nm { fill: var(--meera-bright); color: var(--meera-bright); }
.rt.shortcut { stroke: #fb8a5a; } .rt-end.shortcut, .route-card.shortcut .nm { fill: #fb8a5a; color: #fb8a5a; }
.rt.over-cautious { stroke: var(--arif-bright); } .rt-end.over-cautious, .route-card.over-cautious .nm { fill: var(--arif-bright); color: var(--arif-bright); }
.rt.room { stroke: #fff8ec; } .rt-end.room { fill: #fff8ec; font-weight: 700; }
.rt-end { font: 600 14px var(--f-mono); }
.route-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--g-md); }
.route-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--g-sm) var(--g-md); border-radius: var(--r-lg); background: var(--d-surface-container); border: 1px solid var(--d-outline-variant); }
.route-card .mono-md { color: var(--d-on-surface-variant); }
.route-card p { margin-top: 4px; color: var(--d-on-surface); }
.route-card.is-room { border: 2px solid #fff8ec; box-shadow: 0 0 20px -4px rgb(255 255 255 / .4); }
.room-tag { position: absolute; top: var(--g-sm); right: var(--g-md); color: #fff8ec; }
.room-key { display: inline-flex; align-items: center; gap: var(--g-sm); color: #fff8ec; }
.room-key i { width: 28px; height: 6px; border-radius: 3px; background: #fff8ec; box-shadow: 0 0 6px rgb(255 255 255 / .5); }

/* ---------------------------------------------------------------- the gathering, closing, sign-off */
.card.gather .opt.trav .t { color: var(--d-on-surface); font-family: var(--f-display); }
.card.gather .opt.trav { animation: rise 500ms var(--glide-ease) both; }
.card.gather .opt.trav:nth-child(2) { animation-delay: .3s; } .card.gather .opt.trav:nth-child(3) { animation-delay: .6s; } .card.gather .opt.trav:nth-child(4) { animation-delay: .9s; }
.card.closing { max-width: 1100px; }
.closing-text { font: 500 24px/36px var(--f-ui); color: var(--d-on-surface); text-align: left; }
.card.signoff h1 { color: var(--crew-bright); }

/* ---------------------------------------------------------------- Insight Out: large, on its own */
.card.insight { display: flex; align-items: center; gap: var(--section); max-width: 1180px; justify-self: center; padding: var(--section); border-color: color-mix(in srgb, var(--crew-bright) 55%, transparent); }
.ins-main { flex: 1; display: flex; flex-direction: column; gap: var(--g-md); }
.ins-main .mono-md { letter-spacing: 2px; }
.ins-main h1 { color: var(--d-on-surface); }
.ins-text { font: 500 28px/40px var(--f-ui); color: var(--d-on-surface); }
.ins-link { display: flex; flex-direction: column; align-items: center; gap: var(--g-sm); flex: none; }
.ins-link .qr-box { width: 220px; height: 220px; }
.ins-link .mono-lg { color: var(--crew-bright); }

/* The routes and the ledger: compact, held at the top of the space above the road */
#main:has(.card.routes), #main:has(.card.ledger) { align-items: start; padding-top: var(--g-sm); }
.card.routes, .card.ledger { transform-origin: top center; gap: var(--g-sm); padding: var(--g-md) var(--g-xl); }
.card.routes .headline-lg { font-size: 28px; line-height: 34px; }
.route-chart { max-height: 210px; }
.route-cards { gap: var(--g-sm); }
.route-card { padding: 6px var(--g-md); display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: var(--g-md); row-gap: 0; }
.route-card .nm { grid-column: 1 / -1; }
.route-card b.headline-lg { font-size: 26px; line-height: 32px; }
.route-card p { grid-column: 1 / -1; margin-top: 0; font-size: 13px; line-height: 18px; color: var(--d-on-surface-variant); }
.route-card.is-room { padding: 5px calc(var(--g-md) - 1px); }

/* The closing: a few phrases, large, arriving one after another */
.closing-lines { display: flex; flex-direction: column; align-items: center; gap: var(--g-md); text-align: center; }
.closing-lines li { font: 600 32px/42px var(--f-display); color: var(--d-on-surface); animation: rise 600ms var(--glide-ease) both; animation-delay: calc(var(--k) * 500ms + 200ms); }
.closing-lines li.last { color: var(--crew-bright); font-size: 38px; line-height: 48px; margin-top: var(--g-sm); }

/* ---------------------------------------------------------------- cold open: four cards, turned one by one */
.card.coldcards { display: flex; flex-direction: column; align-items: center; gap: var(--g-md); padding: var(--g-lg); background: rgb(30 27 24 / .72); }
.cc-grid { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--g-md); perspective: 1400px; }
.cc { position: relative; transition: opacity 500ms ease, filter 500ms ease; }
/* Spotlight while a card turns: the rest of the scene falls back */
.coldcards.focus .cc:not(.just) { opacity: .35; filter: saturate(.3); }
.coldcards.focus .cc-final { opacity: 0; }
.cc-in { position: relative; display: grid; min-height: 330px; transition: transform 1200ms cubic-bezier(.34, 1.4, .5, 1); transform-style: preserve-3d; }
.cc.flipped .cc-in { transform: rotateY(180deg); }
.cc.just { animation: cclift 1500ms cubic-bezier(.3, 0, .2, 1); z-index: 2; }
@keyframes cclift { 0% { transform: none; } 30% { transform: translateY(-28px) scale(1.14); } 75% { transform: translateY(-10px) scale(1.06); } 100% { transform: none; } }
.cc.just .cc-back { animation: ccglow 2000ms ease-out; }
@keyframes ccglow { 0% { box-shadow: 0 0 0 0 transparent; } 35% { box-shadow: 0 0 60px 8px color-mix(in srgb, var(--pc-bright) 55%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.cc.just .cc-line { animation: hook 900ms 700ms var(--glide-ease) both; }
@keyframes hook { from { opacity: 0; transform: scale(1.25); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
/* Both faces share one layout: avatar, name, role (or place), then the hook */
.cc-face { grid-area: 1 / 1; padding: var(--g-lg) var(--g-md); border-radius: var(--r-xl); backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; text-align: center; }
.cc-av { width: 72px; height: 72px; font-size: 34px; margin-bottom: var(--g-xs); }
.cc-name { font: 700 30px/36px var(--f-display); color: var(--d-on-surface); }
.cc-role { color: var(--pc-bright); letter-spacing: 1px; }
.cc-front { background: linear-gradient(160deg, var(--d-surface-high), var(--d-surface-lowest)); border: 1px solid var(--d-outline-variant); }
.cc-front .cc-name { color: var(--d-outline); letter-spacing: 4px; }
.cc-front .cc-role { color: var(--d-on-surface-variant); }
.avatar.mystery { background: var(--d-surface-highest); border: 2px dashed var(--d-outline); color: var(--d-outline); font: 700 44px/1 var(--f-display); }
.cc-bars { display: flex; flex-direction: column; gap: 10px; width: 80%; margin-top: var(--g-md); }
.cc-bars i { height: 12px; border-radius: 6px; background: var(--d-surface-highest); }
.cc-bars i:last-child { width: 60%; align-self: center; }
.cc.next .cc-front { animation: ccwait 2.2s ease-in-out infinite; }
@keyframes ccwait { 50% { border-color: var(--d-outline); box-shadow: 0 0 28px -6px rgb(255 255 255 / .3); } }
/* At rest the turned card is calm: plain dark, a thin border in their colour; the colour flashes only as it turns */
.cc-back { transform: rotateY(180deg); justify-content: center; background: var(--d-surface-container); border: 1.5px solid color-mix(in srgb, var(--pc-bright) 75%, transparent); }
.cc-line { margin-top: var(--g-md); font: 600 24px/32px var(--f-display); color: #fff8ec; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--pc); color: var(--pc-on); font-size: 28px; }
.cc-final { font: 600 30px/40px var(--f-display); text-align: center; color: var(--crew-bright); opacity: 0; transform: translateY(8px); transition: opacity 800ms ease, transform 800ms var(--glide-ease); }
.cc-final.on { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- petrol pump: reflect on time, fuel and bolts */
.breakdown { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: center; gap: var(--g-md); padding: var(--g-sm) var(--g-lg); border-radius: var(--r-lg); background: var(--d-surface-low); border: 1px solid var(--d-outline-variant); }
.bd-cell { display: flex; flex-direction: column; gap: 4px; }
.card.dash-card .prompt { color: var(--d-on-surface); font-family: var(--f-display); font-size: 30px; line-height: 40px; }
.card.dash-card .line { color: var(--pc-bright); font: 500 20px/28px var(--f-ui); }
.card.dash-card { gap: var(--g-md); }

/* The line after the cards, on its own: the four travellers, then the line */
.card.coldline { gap: var(--g-md); padding: var(--g-xl) var(--section); }
.cl-row { display: flex; justify-content: center; gap: var(--section); }
.cl-who { display: flex; flex-direction: column; align-items: center; gap: var(--g-sm); color: var(--d-on-surface); animation: rise 600ms var(--glide-ease) both; animation-delay: calc(var(--k) * 180ms); }
.cl-av { width: 72px; height: 72px; font-size: 36px; }
.cl-line { font: 700 40px/50px var(--f-display); color: #fff8ec; max-width: 1000px; animation: rise 900ms 900ms var(--glide-ease) both; }
/* The room's part: warm, bright and last, so it lands as the point of the whole ride */
.cl-you { font: 800 52px/62px var(--f-display); max-width: 1100px; color: #fff8ec; filter: drop-shadow(0 0 22px rgb(255 248 236 / .35)); animation: youin 1100ms 1900ms var(--glide-ease) both; }
@keyframes youin { 0% { opacity: 0; transform: scale(1.18); filter: blur(6px); } 60% { opacity: 1; transform: scale(.98); filter: drop-shadow(0 0 30px rgb(255 248 236 / .6)); } 100% { transform: none; filter: drop-shadow(0 0 22px rgb(255 248 236 / .35)); } }
.cl-cue { display: inline-flex; align-items: center; gap: var(--g-sm); padding: var(--g-xs) var(--g-lg); border-radius: var(--r-full); background: rgb(255 248 236 / .1); border: 1px solid rgb(255 248 236 / .5); color: #fff8ec; animation: rise 700ms 2900ms var(--glide-ease) both; }
.cl-cue .ic { font-size: 20px; }

/* ---------------------------------------------------------------- Stop 1: one website */
.sites.one { grid-template-columns: minmax(0, 1fr); }
.sites.big.one { max-width: 760px; width: 100%; justify-self: center; align-self: center; }
.sites.big.one .frame { height: 300px; }
.card.sites-look .site { cursor: pointer; transition: transform var(--state); }
.card.sites-look .site:hover { transform: translateY(-3px); }
.card.sites-look .col-main { align-items: center; }

/* The website in the foreground: over the whole stage, scrollable like a browser */
#stage.focus-site #main { position: absolute; inset: 76px 72px 20px; z-index: 6; padding: 0; display: block; }
#stage.focus-site #main > .layer { height: 100%; }
.card.site-focus { height: 100%; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; border-color: var(--crew-bright); box-shadow: 0 30px 120px 30px rgb(0 0 0 / .6); animation: sfin 700ms var(--glide-ease) both; }
@keyframes sfin { from { transform: scale(.6) translateY(40px); opacity: 0; } }
.sf-bar { display: flex; align-items: center; gap: var(--g-md); padding: var(--g-sm) var(--g-md); background: var(--d-surface-high); border-bottom: 1px solid var(--d-outline-variant); }
.sf-dots { display: flex; gap: 6px; }
.sf-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--d-outline); }
.sf-dots i:nth-child(1) { background: #f87171; } .sf-dots i:nth-child(2) { background: #fbbf24; } .sf-dots i:nth-child(3) { background: #4ade80; }
.sf-url { flex: 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px var(--g-md); border-radius: var(--r-full); background: var(--d-surface-lowest); color: var(--d-on-surface); }
.sf-scroll { flex: 1; overflow-y: auto; background: #faf7f2; scrollbar-width: thin; }
.sf-scroll img { display: block; width: 100%; height: auto; }

/* Petrol pump: two (or three) big numbers and one question */
.card.dash-card { max-width: 1000px; justify-self: center; align-items: center; gap: var(--g-xl); padding: var(--section) var(--g-xl); }
.card.dash-card .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.card.dash-card .readouts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card.dash-card .readout { justify-content: center; padding: var(--g-lg); }
.card.dash-card .prompt { font: 600 34px/44px var(--f-display); color: var(--d-on-surface); text-align: center; }
.readout .big-nut { width: 52px; height: 52px; color: #fb8a5a; }

/* Each traveller's role, highlighted: a bold pill in their colour, the thing to remember them by */
.cc-tag { max-width: 100%; text-align: center; margin-top: 2px; padding: 4px 14px; border-radius: var(--r-full); background: color-mix(in srgb, var(--pc-bright) 16%, transparent); border: 1px solid color-mix(in srgb, var(--pc-bright) 60%, transparent); color: var(--pc-bright); font: 600 16px/22px var(--f-ui); }
.cc.just .cc-tag { animation: chipin 600ms 500ms var(--glide-ease) both; }
.cc-tag.sm { margin-top: 2px; padding: 3px 12px; font-size: 14px; line-height: 18px; }
.cl-row { gap: var(--g-xl); }
.cl-who { max-width: 220px; text-align: center; }

/* Lobby: the title and line sit on the game's dark card, readable on any sky */
.lobby-l { padding: var(--g-xl); border-radius: var(--r-xl); background: rgb(30 27 24 / .86); border: 1px solid var(--d-outline-variant); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 24px 140px 56px rgb(12 10 8 / .38); }
.lobby-l .muted { color: var(--d-on-surface); opacity: .85; }
.lobby { align-items: center; }

/* The gathering: the four travellers across the full card */
.card.gather .col-main { grid-column: 1 / -1; }
