:root {
  --room: #0d0c0b;
  --ink: #f3ede4;
  --dim: #9b948a;
  --faint: #5d5850;
  --line: rgba(243, 237, 228, .12);
  --glass: rgba(20, 18, 16, .72);
  --honey: #ffb547;
  --signal: #46e6ff;
  --hit: #ff5d5d;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--room); color: var(--ink); font-family: var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* One warm lamp over the specimen, falling off to the room. */
.lamp { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 50% 45%, transparent 40%, rgba(13,12,11,.55) 75%, rgba(13,12,11,.92) 100%); }
body::before { content: ''; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 60% 55% at 50% 42%, #2a241d 0%, #16130f 55%, var(--room) 100%); }
/* Light studio stage: the look of the published renders. UI stays dark glass. */
body.light { background: #ece9f3; }
body.light::before { background: radial-gradient(ellipse 70% 65% at 50% 42%, #fbfaff 0%, #eeebf6 55%, #dcd8e6 100%); }
body.light .lamp { background: radial-gradient(ellipse 70% 70% at 50% 45%, transparent 55%, rgba(60,50,90,.10) 100%); }
body.light .bar { background: linear-gradient(rgba(236,233,243,.9), transparent); }
body.light .brand, body.light .count, body.light .link { color: #1d1b22; }
body.light .count b { color: #0088c7; }
body.light #modes { background: rgba(29,27,34,.06); border-color: rgba(29,27,34,.14); }
body.light #modes button { color: #5d5850; }
body.light #modes button.on { background: #1d1b22; color: #f3ede4; }
body.light .center b { text-shadow: 0 2px 24px rgba(255,255,255,.9); }
body.light .loading { color: #5d5850; }
#leaders { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#callouts { position: fixed; inset: 0; pointer-events: none; }
.callout { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; white-space: nowrap;
  font: 500 11px var(--mono); letter-spacing: .04em; color: var(--ink); background: var(--glass); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; backdrop-filter: blur(8px); transition: opacity .3s; }
.callout small { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0; margin-top: 1px; }

.bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 22px; padding: 14px 20px; z-index: 3;
  background: linear-gradient(var(--room), transparent); }
.brand { font: 400 28px var(--serif); text-decoration: none; letter-spacing: -.01em; }
.brand i { color: var(--honey); }
#modes { display: flex; gap: 4px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
#modes button { background: none; border: 0; border-radius: 999px; padding: 7px 16px; font-weight: 600; font-size: 14px; color: var(--dim); }
#modes button.on { background: var(--ink); color: var(--room); }
#modes button:not(.on):hover { color: var(--ink); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.count { font-size: 12px; color: var(--dim); }
.count b { color: var(--signal); font-weight: 500; }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.link:hover { color: var(--ink); }

.door { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 0 20px 7vh; text-align: center; background: linear-gradient(transparent 30%, rgba(13,12,11,.85) 72%); transition: opacity .5s; }
.door.gone { opacity: 0; pointer-events: none; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--honey); margin: 0 0 10px; }
.door h1 { font: 400 clamp(40px, 6.4vw, 80px)/0.98 var(--serif); margin: 0 0 14px; letter-spacing: -.02em; }
.door h1 i { color: var(--honey); }
.lede { max-width: 560px; color: #cfc7bb; font-size: 16px; line-height: 1.5; margin: 0 0 24px; }
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 250px)); gap: 12px; }
.doorbtn { text-align: left; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  transition: .2s; display: flex; flex-direction: column; gap: 6px; }
.doorbtn:hover { border-color: var(--honey); background: rgba(255,181,71,.07); transform: translateY(-2px); }
.doorbtn b { font: 400 30px var(--serif); line-height: 1; }
.doorbtn span { color: var(--dim); font-size: 13.5px; line-height: 1.4; }
.doorbtn em { font: 11px var(--mono); color: var(--honey); font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.doorbtn.first { border-color: rgba(255,181,71,.55); }
.loading { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 3; color: var(--dim); font-size: 12px; }
.howto { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(13,12,11,.55); backdrop-filter: blur(3px); }
.choose-card { width: min(1180px, calc(100% - 32px)); text-align: center; }
.choose-card h2 { font: 400 clamp(36px, 5vw, 56px)/1 var(--serif); margin: 0 0 20px; color: var(--ink); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; text-align: left; }
.choices button { background: #16130f; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; transition: .2s; }
.choices button:hover { border-color: var(--honey); transform: translateY(-2px); }
.choices b { font: 400 32px/1 var(--serif); color: var(--ink); }
.choices span { font-size: 14px; line-height: 1.45; color: #cfc7bb; }
@media (max-width: 820px) { .choices { grid-template-columns: 1fr; } }
.howto-card { width: min(460px, calc(100% - 32px)); background: #16130f; border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; }
.howto-card h2 { font: 400 40px/1 var(--serif); margin: 0 0 12px; }
.howto-card ol { margin: 0 0 12px; padding-left: 20px; color: #cfc7bb; line-height: 1.5; font-size: 15px; }
.howto-card li { margin-bottom: 6px; }
.howto-card .small { font: 11px var(--mono); color: var(--dim); margin: 0 0 16px; }
.howto-card .btn { font-size: 15px; padding: 10px 22px; }

.hud { position: fixed; top: 76px; left: 20px; width: 300px; z-index: 2; display: flex; flex-direction: column; gap: 10px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 16px; backdrop-filter: blur(12px); }
.hud h2 { font: 400 32px/1 var(--serif); margin: 0; }
.hud p { margin: 0; color: #cfc7bb; font-size: 13.5px; line-height: 1.45; }
.hud .small { font: 11px var(--mono); color: var(--dim); line-height: 1.5; }
.score { display: flex; align-items: baseline; gap: 10px; }
.score b { font: 400 56px/1 var(--serif); white-space: nowrap; }
.score span { font: 12px var(--mono); color: var(--dim); }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--honey); color: #1b1408; border-color: var(--honey); }
.btn.on { border-color: var(--signal); color: var(--signal); }
.btn small { font: 10px var(--mono); color: var(--dim); font-weight: 400; margin-left: 4px; }
.btn.primary small { color: #5b4012; }
canvas.map { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.tours { display: flex; flex-direction: column; gap: 6px; }
.tour { text-align: left; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tour b { display: block; font-size: 14px; }
.tour span { font-size: 12px; color: var(--dim); }
.tour.on, .tour:hover { border-color: var(--signal); }

.center { position: fixed; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(.94); opacity: 0; z-index: 2; pointer-events: none;
  text-align: center; transition: .25s; }
.center.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.center b { display: block; font: 400 clamp(44px, 7vw, 88px)/1 var(--serif); text-shadow: 0 4px 40px rgba(0,0,0,.7); }
.center small { display: inline-block; margin-top: 8px; font: 12.5px var(--mono); color: var(--ink); background: var(--glass); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; }
.center.escaped b { color: var(--signal); } .center.hit b { color: var(--hit); } .center.win b { color: var(--honey); }

/* The signal strip: what just happened, node by node, left to right. */
.strip { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; width: min(1100px, calc(100% - 32px));
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 12px; backdrop-filter: blur(12px); }
.strip-title { font-size: 10px; letter-spacing: .14em; color: var(--dim); margin-bottom: 8px; display: flex; justify-content: space-between; }
.strip-row { display: flex; align-items: stretch; gap: 14px; }
.node { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; transition: border-color .15s, background .15s; position: relative; }
.node + .node::before { content: '→'; position: absolute; left: -8px; top: 50%; transform: translate(-50%, -50%); color: var(--faint); font-size: 12px; }
.node small { display: block; font: 10px var(--mono); color: var(--dim); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node b { display: block; font: 500 17px var(--mono); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node i { display: block; font: 10.5px var(--mono); color: var(--faint); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.lit { border-color: var(--signal); background: rgba(70,230,255,.08); }
.node.lit b { color: var(--signal); }
.node.hot { border-color: var(--honey); background: rgba(255,181,71,.12); }
.node.hot b { color: var(--honey); }
.node canvas { width: 100%; height: 26px; display: block; margin-top: 3px; }

.swatter { position: fixed; pointer-events: none; z-index: 3; width: 120px; height: 220px; margin: -54px 0 0 -60px; transform-origin: 50% 25%; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.swatter.miss { transition: opacity .35s; opacity: 0; }
.hand { position: fixed; pointer-events: none; z-index: 1; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.55), transparent 70%); transition: opacity .2s; }

.neuron-card { position: fixed; z-index: 5; width: 340px; right: 20px; top: 76px; background: #1a1714; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.neuron-card h4 { margin: 0; font: 400 26px var(--serif); }
.neuron-card p { margin: 3px 0; font-size: 12px; color: var(--dim); }
.neuron-card code { font-family: var(--mono); color: var(--ink); }
.neuron-card .row { display: flex; gap: 6px; margin-top: 8px; }
.neuron-card .row button { flex: 1; font-size: 12px; padding: 7px 8px; }
.neuron-card .result { margin-top: 10px; color: #cfc7bb; font-size: 12.5px; line-height: 1.45; border-top: 1px solid var(--line); padding-top: 8px; }
.neuron-card b { color: var(--ink); }
.neuron-card .x { position: absolute; top: 4px; right: 8px; background: none; border: 0; font-size: 18px; color: var(--dim); }
.toast { position: fixed; z-index: 6; left: 50%; top: 76px; transform: translate(-50%, -8px); opacity: 0; transition: .3s; pointer-events: none;
  background: #1a1714; border: 1px solid var(--line); border-radius: 12px; padding: 9px 16px; font-size: 13px; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast a { color: var(--honey); pointer-events: auto; }

dialog { background: #16130f; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; max-width: 640px; padding: 22px 26px; line-height: 1.55; }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
dialog h3 { margin-top: 0; font: 400 30px var(--serif); }
dialog p { font-size: 14px; color: #cfc7bb; }
dialog a { color: var(--honey); }
dialog button { background: var(--ink); color: var(--room); border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 700; }

@media (max-width: 820px) {
  .bar { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .brand { font-size: 22px; }
  .count { display: none; }
  #modes button { padding: 6px 11px; font-size: 13px; }
  .doors { grid-template-columns: 1fr; width: 100%; max-width: 420px; }
  .doorbtn { padding: 12px 14px; }
  .doorbtn b { font-size: 24px; }
  .door { padding-bottom: 4vh; }
  .door h1 { font-size: 40px; }
  .lede { font-size: 14px; margin-bottom: 14px; }
  .hud { top: auto; bottom: 150px; left: 10px; right: 10px; width: auto; padding: 10px 12px; gap: 6px; max-height: 30vh; overflow-y: auto; }
  .hud h2 { font-size: 24px; }
  .hud > p, .hud canvas.map { display: none; }
  .hud .tours { flex-direction: row; overflow-x: auto; }
  .hud .tour { min-width: 150px; }
  .score b { font-size: 36px; }
  .strip { bottom: 8px; padding: 8px; }
  .strip-row { overflow-x: auto; }
  .node { min-width: 92px; }
  .node b { font-size: 14px; }
}

.hud .follow { font-size: 14px; line-height: 1.5; color: var(--ink); min-height: 1em; margin: 2px 0 0; }
.hud .follow:empty { display: none; }
.hud .follow .btn { margin-top: 8px; display: inline-block; }

.grip { cursor: grab; user-select: none; font: 10px var(--mono); color: var(--faint); letter-spacing: .1em; margin: -4px 0 4px; }
.grip:active { cursor: grabbing; }
.hud .grip { margin: -8px 0 0; }
.neuron-card .how { margin-top: 10px; font: 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.neuron-card .clock { font: 500 20px var(--mono); color: var(--signal); margin-bottom: 4px; }
.neuron-card .clock small { font-size: 10px; color: var(--dim); margin-left: 6px; }
.neuron-card .red { color: #ff5d68; font-weight: 600; }
.neuron-card .result .btn { margin-top: 8px; font-size: 12px; padding: 5px 9px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.blue { background: #0aa0f0; } .dot.amber { background: #ff9a1a; }
/* Live captions change length every frame: reserve room for the longest one
   so the panel doesn't jump. */
.hud [data-k=live] { min-height: calc(1.5em * 5); display: block; }
/* The panel never runs into the signal strip; long panels scroll. */
.hud { max-height: calc(100vh - 200px); overflow-y: auto; }

/* Label leader lines: ink on the light stage, cream on the dark one. */
#leaders line { stroke: #f3ede4; stroke-width: 1.5; }
#leaders line.halo { stroke: rgba(13,12,11,.55); stroke-width: 4; }
#leaders circle { fill: #ffb547; stroke: #0d0c0b; stroke-width: 1.5; }
#leaders circle.halo { fill: rgba(13,12,11,.4); stroke: none; }
body.light #leaders line { stroke: #1d1b22; }
body.light #leaders line.halo { stroke: rgba(255,255,255,.8); }
body.light #leaders circle { fill: #ff7a00; stroke: #fff; }
body.light #leaders circle.halo { fill: rgba(255,255,255,.7); }
.callout em { display: block; font-style: normal; font-size: 9.5px; color: var(--honey); margin-top: 3px; letter-spacing: .04em; }
.callout:hover { border-color: var(--honey); }
.neuron-card.learn { width: 380px; max-height: calc(100vh - 110px); overflow-y: auto; }
.neuron-card.learn h4 { font-size: 30px; margin-bottom: 2px; }
.neuron-card .lead { color: var(--honey); font-size: 14px; margin: 0 0 8px; }
.neuron-card .body p { color: #d8d1c6; font-size: 13.5px; line-height: 1.55; margin: 0 0 10px; }
.neuron-card .try { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; color: var(--ink); }
.neuron-card .try b { color: var(--signal); }
.neuron-card .role { color: var(--ink); font-size: 13.5px; line-height: 1.5; margin: 6px 0; }
.neuron-card .explain { font-size: 11.5px; color: var(--dim); line-height: 1.4; margin: 2px 0 8px; }
/* Watch TV */
.tv-frame { position: fixed; z-index: 1; border: 0; background: #000; }
.hud .yt { display: flex; gap: 6px; }
.hud .yt input { flex: 1; min-width: 0; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); font: 13px var(--sans); }
.hud .small a { color: var(--honey); }
.tv-share { border: 1px solid var(--honey); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tv-share p { margin: 0; font-size: 13px; }
.tv-share small { font: 11px var(--mono); color: var(--dim); line-height: 1.4; }
.tvstats { display: flex; flex-direction: column; gap: 8px; }
.tvstats .score b { font-size: 40px; }
label.btn { cursor: pointer; }

/* Flappy Fly: the fly's-eye view fills the screen centre */
.fly-eye-view { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(80vw, 1100px); height: auto; z-index: 1;
  border-radius: 24px; background: #0d0c0b; box-shadow: 0 30px 80px rgba(0,0,0,.35); pointer-events: none; }
.hud .views .btn { padding: 6px 10px; font-size: 12px; }

.tap-hint { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  background: #1d1b22; color: #fff; border-radius: 999px; padding: 12px 22px; font-size: 17px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
  animation: tapPulse 1.1s ease-in-out infinite; }
.tap-hint b { color: #ffb547; }
@keyframes tapPulse { 50% { transform: translateX(-50%) scale(1.06); } }
/* "Seattle killed the fruit fly" */
.city-death { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 3; pointer-events: none; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px; animation: deathIn .35s ease-out; }
.city-death span { font-size: 56px; line-height: 1; }
.city-death b { font: 400 clamp(38px, 5.5vw, 76px)/1 var(--serif); color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.45), 0 0 2px #000; }
.city-death small { font: 14px var(--mono); color: #fff; background: rgba(20,18,16,.7); border-radius: 999px; padding: 6px 14px; }
@keyframes deathIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.95); } }

/* Fruit Fly Airlines: passport, stamps, bests */
.hud .passport { font-size: 15px; line-height: 1.5; letter-spacing: 1px; }
.hud .passport b { display: block; font: 500 11px var(--mono); letter-spacing: .08em; color: var(--dim); text-transform: uppercase; margin-bottom: 2px; }
.hud .passport span { filter: grayscale(1); opacity: .35; }
.hud .passport span.got { filter: none; opacity: 1; }
.hud .bests { margin: 0; padding-left: 20px; font-size: 12.5px; color: #cfc7bb; }
.hud .bests b { color: var(--ink); }
.stamp { position: fixed; right: 40px; top: 170px; z-index: 3; pointer-events: none; transform: rotate(-8deg); border: 3px solid #e0404a; color: #e0404a;
  border-radius: 12px; padding: 8px 16px; background: rgba(255,255,255,.85); display: flex; flex-direction: column; align-items: center; animation: stampIn .25s ease-out; }
.stamp span { font-size: 30px; } .stamp b { font: 700 20px var(--sans); text-transform: uppercase; } .stamp small { font: 10px var(--mono); }
@keyframes stampIn { from { transform: rotate(-8deg) scale(2); opacity: 0; } }

/* Fruit Fly Airlines: the signal strip sits compact at the top right, so the
   whole scene, bottom included, stays visible. */
body.flyer .strip { top: 70px; bottom: auto; left: auto; right: 16px; transform: none; width: min(560px, calc(100% - 360px)); padding: 6px 10px 8px; }
body.flyer .strip-title { margin-bottom: 4px; font-size: 9px; }
body.flyer .strip-row { gap: 10px; }
body.flyer .node { padding: 4px 6px; }
body.flyer .node b { font-size: 13px; } body.flyer .node small { font-size: 8.5px; } body.flyer .node i { display: none; }
body.flyer .hud { max-height: calc(100vh - 96px); }
body.flyer .tap-hint { bottom: 60px; }

/* Fruit Fly Airlines: splat, scoring, name entry, share, learning */
.splat { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; animation: splat-in .12s ease-out; }
@keyframes splat-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.hud .score > span { font: 12px var(--mono); color: var(--dim); } .hud .score > span b { font: inherit; color: var(--ink); }
.hud .enter { display: flex; gap: 6px; margin: 8px 0; }
.hud .enter input { flex: 1; min-width: 0; font: 14px var(--sans); padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(243,237,228,.25); background: rgba(243,237,228,.08); color: var(--ink); }
.hud .share { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 8px 0; font: 11px var(--mono); color: var(--dim); }
.hud .share .btn { padding: 5px 9px; font-size: 12px; }
.hud .btn.tiny { padding: 1px 7px; font-size: 10px; margin-left: 6px; }
.hud .enter.hidden, .hud .share.hidden, .hud .learn.hidden, .hud .hidden { display: none; }
.lightning { position: fixed; inset: 0; background: #eef3ff; opacity: 0; pointer-events: none; z-index: 1; mix-blend-mode: screen; }
.hud .keys b { color: var(--ink); font-weight: 600; }
body.flyer .hud { z-index: 4; } /* the splat is on the glass, but the scoreboard stays readable */
.hud .wx { font: 11px var(--mono); color: #ffb547; }
body.flyer .hud > * { flex-shrink: 0; } /* scroll the panel rather than squash lines into each other */
.hud .brainchart { width: 100%; height: 150px; display: block; border-radius: 10px; }
.hud .brainsays { font-size: 13px; line-height: 1.4; min-height: 2.8em; margin: 0; color: var(--ink); }
/* Brain cam: the frame and label over the corner where the brain close-up is drawn */
.braincam { position: fixed; right: 20px; bottom: 20px; width: 200px; height: 200px; border-radius: 14px; z-index: 3; pointer-events: none;
  border: 1.5px solid rgba(243,237,228,.28); box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: border-color .4s, box-shadow .4s; }
.braincam.hidden { display: none; }
.braincam b { position: absolute; left: 10px; top: 8px; font: 600 9.5px var(--mono); letter-spacing: .08em; color: #f3ede4; }
.braincam span { position: absolute; left: 10px; bottom: 8px; font: 10px var(--mono); color: #46e6ff; }
.braincam.loom { animation: bc-loom .8s ease-out; } .braincam.jump { animation: bc-jump .8s ease-out; }
@keyframes bc-loom { from { border-color: #ffb547; box-shadow: 0 0 24px #ffb547aa; } }
@keyframes bc-jump { from { border-color: #ff5d5d; box-shadow: 0 0 30px #ff5d5dcc; } }
@media (max-width: 700px) { .braincam { width: 130px; height: 130px; right: 12px; bottom: 12px; } }

/* Swat it: where to click, the swing log, the labelled blind-spot map */
.swat-ring { position: fixed; width: min(62vh, 520px); height: min(62vh, 520px); transform: translate(-50%, -50%); border: 2px dashed rgba(58,160,232,.55); border-radius: 50%; pointer-events: none; z-index: 1; }
.swat-ring span { position: absolute; font: 600 12px var(--mono); color: #2a86c7; background: rgba(255,255,255,.75); padding: 2px 8px; border-radius: 999px; }
.swat-ring .t { top: -12px; left: 50%; transform: translateX(-50%); } .swat-ring .b { bottom: -12px; left: 50%; transform: translateX(-50%); }
.swat-ring .l { left: -40px; top: 50%; transform: translateY(-50%); } .swat-ring .r { right: -36px; top: 50%; transform: translateY(-50%); }
.swat-ring i { position: absolute; bottom: 14%; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 14px var(--sans); color: #1d5e8c; background: rgba(255,255,255,.8); padding: 4px 12px; border-radius: 999px; }
.hud .swings { margin: 0; padding-left: 0; list-style: none; font-size: 12.5px; color: #cfc7bb; display: grid; gap: 3px; }
.hud .swings b { color: var(--ink); }
.hud .blindmap { position: relative; padding: 16px 44px; }
.hud .blindmap span { position: absolute; font: 10px var(--mono); color: var(--dim); }
.hud .blindmap .t { top: 0; left: 50%; transform: translateX(-50%); } .hud .blindmap .b { bottom: 0; left: 50%; transform: translateX(-50%); }
.hud .blindmap .l { left: 0; top: 50%; transform: translateY(-50%); } .hud .blindmap .r { right: 0; top: 50%; transform: translateY(-50%); }
.hud .blindmap canvas { width: 100%; }
.center, .strip, .hud { z-index: 4; } /* above the splat on the glass */
.hud .brainchart { height: 128px; }
.hud .tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(243,237,228,.14); }
.hud .tabs button { flex: 1; font: 12px var(--sans); color: var(--dim); background: none; border: 0; padding: 6px 2px; border-bottom: 2px solid transparent; cursor: pointer; }
.hud .tabs button.on { color: var(--ink); border-bottom-color: #ffb547; }
.hud .tabs button:last-child { flex: 0 0 34px; }
.hud .tabview { overflow: hidden; contain: content; }
.hud .tabtrack { display: flex; transition: transform .35s cubic-bezier(.3,.7,.2,1); will-change: transform; }
.hud .tab { flex: 0 0 100%; min-width: 0; max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.hud .tabs button { white-space: nowrap; font-size: 11.5px; }
/* Scoring popups, and the scores tab */
.pop { position: fixed; z-index: 4; pointer-events: none; transform: translate(-50%, 0); font: 600 18px var(--mono); color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); animation: pop-up 1.3s ease-out forwards; white-space: nowrap; }
.pop.big { font-size: 24px; color: #ffcf6a; }
@keyframes pop-up { from { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } to { opacity: 0; transform: translate(-50%, -70px); } }
.hud .seg { display: flex; gap: 4px; }
.hud .seg button { flex: 1; font: 12px var(--sans); padding: 5px; border-radius: 999px; border: 1px solid rgba(243,237,228,.2); background: none; color: var(--dim); cursor: pointer; }
.hud .seg button.on { background: rgba(255,181,71,.18); color: var(--ink); border-color: #ffb547; }
.hud .bests li { margin: 2px 0; } .hud .bests li small { display: block; color: var(--dim); font-size: 11px; }
.hud .bests li.me { color: #ffcf6a; } .hud .bests li.empty { list-style: none; margin-left: -20px; color: var(--dim); }
/* Say hello */
.hud .btn.big { font-size: 17px; padding: 12px 18px; width: 100%; }
.hud .reaction { font-size: 14px; line-height: 1.45; min-height: 4.4em; margin: 0; }
.fly-bubble { position: fixed; z-index: 3; transform: translate(-50%, -100%); pointer-events: none; font: 600 20px var(--sans); color: #1b1916;
  background: #fff; padding: 8px 14px; border-radius: 18px; box-shadow: 0 6px 24px rgba(0,0,0,.18); animation: bubble-in .25s ease-out; }
.fly-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.fly-bubble.hidden { display: none; }
@keyframes bubble-in { from { transform: translate(-50%, -80%) scale(.7); opacity: 0; } }
.hud .btn.primary.on { color: #1b1916; }

/* Phones: the game gets the screen. */
.mscore, .hud .sheet-toggle { display: none; }
@media (max-width: 700px) {
  body.flyer .strip { display: none; }
  body.flyer .hud { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 55vh; border-radius: 18px 18px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); gap: 8px; }
  body.flyer .hud .grip, body.flyer .hud h2 { display: none; }
  body.flyer .hud .sheet-toggle { display: block; position: absolute; right: 12px; top: 10px; font: 12px var(--mono); color: var(--dim); background: none; border: 1px solid rgba(243,237,228,.2); border-radius: 999px; padding: 4px 10px; }
  body.flyer:not(.sheet-open) .hud .brainchart, body.flyer:not(.sheet-open) .hud .brainsays, body.flyer:not(.sheet-open) .hud .tabs, body.flyer:not(.sheet-open) .hud .tabview { display: none; }
  body.flyer.ff-playing .hud { display: none; }
  body.flyer.ff-playing .mscore { display: block; position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 4; white-space: nowrap;
    font: 12px var(--mono); color: #fff; background: rgba(20,18,16,.6); backdrop-filter: blur(8px); padding: 6px 12px; border-radius: 999px; }
  body.flyer.ff-playing .mscore b { font-size: 15px; }
  body.flyer.ff-playing header, body.flyer.ff-playing #modes, body.flyer.ff-playing .top { visibility: hidden; }
  body.flyer .braincam { width: 92px; height: 92px; top: calc(52px + env(safe-area-inset-top)); bottom: auto; right: 10px; border-radius: 10px; }
  body.flyer .braincam b { font-size: 7px; left: 6px; top: 5px; } body.flyer .braincam span { display: none; }
  body.flyer .tap-hint { bottom: auto; top: 58%; }
  body.flyer .city-death { top: 12%; width: 92vw; } body.flyer .city-death span { font-size: 40px; }
  body.flyer .stamp { top: 150px; right: 8px; transform: rotate(-8deg) scale(.5); transform-origin: top right; }
  .pop { font-size: 15px; } .pop.big { font-size: 19px; }
}
@media (max-width: 700px) { body.flyer:not(.ff-playing) .braincam { display: none; } }
/* Fruit Fly Airlines: the signal strip slides out to the right, leaving a tab. */
body.flyer .strip { transition: transform .35s cubic-bezier(.3,.7,.2,1), opacity .35s; }
body.flyer.strip-closed .strip { transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.strip-tab { display: none; }
body.flyer .strip-tab { display: block; position: fixed; top: 82px; right: 0; z-index: 5; cursor: pointer; font: 600 10px var(--mono); letter-spacing: .08em;
  color: var(--ink); background: rgba(20,18,16,.72); backdrop-filter: blur(8px); border: 1px solid rgba(243,237,228,.18); border-right: 0; border-radius: 10px 0 0 10px; padding: 8px 8px 8px 10px; transition: background .2s; }
body.flyer .strip-tab:hover { background: rgba(20,18,16,.9); }
body.flyer:not(.strip-closed) .strip-tab { right: calc(min(560px, 100% - 360px) + 16px); top: 86px; padding: 8px 6px; }
@media (max-width: 700px) { body.flyer .strip-tab { display: none; } }
/* Fruit Fly Airlines: the left panel slides out too, leaving a tab and a score pill. */
@media (min-width: 701px) {
  body.flyer .hud { transition: transform .35s cubic-bezier(.3,.7,.2,1), opacity .35s; }
  body.flyer.hud-closed .hud { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
  body.flyer .hud-tab { display: block; position: fixed; top: 82px; left: 0; z-index: 5; cursor: pointer; font: 600 12px var(--sans);
    color: var(--ink); background: rgba(20,18,16,.72); backdrop-filter: blur(8px); border: 1px solid rgba(243,237,228,.18); border-left: 0; border-radius: 0 10px 10px 0; padding: 8px 10px 8px 8px; }
  body.flyer .hud-tab:hover { background: rgba(20,18,16,.9); }
  body.flyer:not(.hud-closed) .hud-tab { left: 320px; top: 92px; }
  body.flyer.hud-closed .mscore { display: block; position: fixed; top: 128px; left: 16px; z-index: 4; white-space: nowrap;
    font: 13px var(--mono); color: #fff; background: rgba(20,18,16,.6); backdrop-filter: blur(8px); padding: 7px 14px; border-radius: 999px; }
  body.flyer.hud-closed .mscore b { font-size: 16px; }
}
.hud-tab { display: none; }
/* Meet the fly: the guided intro */
.hud .guide, .hud .free { display: flex; flex-direction: column; gap: 10px; }
.hud .guide h3 { margin: 0; font: 400 30px/1.1 var(--serif); color: var(--ink); }
.hud .guide p { margin: 0; }
.hud .guide [data-k=step] { color: #ffb547; }
.hud .guide .btns .btn.big { width: 100%; }
.hud .linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--dim); text-decoration: underline; cursor: pointer; align-self: flex-start; }
.hud .linkish:hover { color: var(--ink); }
/* Fruit Fly Airlines: sparks around the points, and a bigger take-off hint */
.spark { position: fixed; z-index: 4; width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; background: #ffb547; border: 1.5px solid #7a3b00; box-shadow: 0 0 10px #ffb547;
  animation: spark .75s cubic-bezier(.2,.7,.3,1) forwards; }
.spark.big { width: 12px; height: 12px; background: #ff5d8f; border-color: #6d0f2c; box-shadow: 0 0 14px #ff5d8f; }
.spark.big:nth-child(3n) { background: #46e6ff; border-color: #0b4a58; box-shadow: 0 0 14px #46e6ff; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
body.flyer .tap-hint { bottom: auto; top: 60%; font-size: 21px; padding: 14px 28px; }
.city-death em.bye { font: italic 500 clamp(16px, 2vw, 24px)/1.3 var(--sans); color: #fff; background: rgba(216,53,43,.85); padding: 6px 16px; border-radius: 999px; margin-top: 4px; }
.city-death em.bye span { font-style: normal; opacity: .8; font-size: .8em; }
.city-death em.bye { display: inline-flex; flex-direction: column; align-items: center; font-style: normal; font-weight: 700; background: rgba(168,52,40,.86); }
.city-death em.bye small { font: italic 400 .7em var(--sans); background: none; padding: 0; opacity: .85; color: #fff; }
/* Fruit Fly Airlines: pause and sound, the arrival banner, the retry hint after a death */
.ff-controls { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 6px; }
.ff-controls button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(243,237,228,.2); background: rgba(20,18,16,.55); backdrop-filter: blur(8px); color: #fff; font-size: 15px; cursor: pointer; }
.ff-controls button:hover { background: rgba(20,18,16,.8); }
.ff-paused { position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(10,10,20,.35); backdrop-filter: blur(3px); cursor: pointer; color: #fff; }
.ff-paused.hidden { display: none; }
.ff-paused > b { font: 400 64px var(--serif); } .ff-paused span { font: 14px var(--mono); opacity: .85; } .ff-paused span b { color: #ffb547; }
.ff-arrive { position: fixed; top: 120px; left: 50%; transform: translate(-50%, -8px); z-index: 3; pointer-events: none; opacity: 0; transition: opacity .45s, transform .45s;
  display: flex; align-items: baseline; gap: 10px; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.45); white-space: nowrap; }
.ff-arrive.on { opacity: 1; transform: translate(-50%, 0); }
.ff-arrive span { font-size: 30px; } .ff-arrive b { font: 400 44px var(--serif); } .ff-arrive i { font: 14px var(--mono); font-style: normal; opacity: .9; }
body.flyer .tap-hint.low { top: auto; bottom: 36px; }
@media (max-width: 700px) {
  .ff-controls { top: calc(52px + env(safe-area-inset-top)); left: 12px; transform: none; } .ff-controls button { width: 34px; height: 34px; }
  .ff-arrive { top: calc(96px + env(safe-area-inset-top)); flex-direction: column; align-items: center; gap: 0; } .ff-arrive b { font-size: 32px; } .ff-arrive span { font-size: 24px; }
}
body:not(.flyer) .ff-controls, body:not(.flyer) .ff-arrive { display: none; }

/* Its brain as a thought bubble by the fly's head: the round backdrop is drawn in 3D; these are the thought dots. */
body.flyer .braincam { border: 0; box-shadow: none; border-radius: 50%; animation: none; }
body.flyer .braincam span { left: 50%; transform: translateX(-50%); bottom: -18px; font-size: 9px; color: rgba(255,255,255,.85); text-shadow: 0 1px 4px rgba(0,0,0,.6); white-space: nowrap; }
body.flyer .braincam::before, body.flyer .braincam::after { content: ''; position: absolute; border-radius: 50%; background: rgba(14,16,30,.8); border: 1px solid rgba(255,255,255,.35); }
body.flyer .braincam::before { width: 14px; height: 14px; left: 4%; bottom: -4%; }
body.flyer .braincam::after { width: 8px; height: 8px; left: -8%; bottom: -16%; }
body.flyer .braincam.loom { animation: none; box-shadow: 0 0 22px 4px rgba(255,181,71,.55); } body.flyer .braincam.jump { animation: none; box-shadow: 0 0 26px 6px rgba(255,93,93,.6); }
@media (max-width: 700px) { body.flyer .braincam, body.flyer:not(.ff-playing) .braincam { display: block; } body.flyer .braincam.hidden { display: none; } }

/* The arrival banner sits top right, over the open sky the cities fly in from. */
.ff-arrive { left: auto; right: 44px; top: 160px; transform: translateY(-8px); justify-content: flex-end; }
.ff-arrive.on { transform: none; }
@media (max-width: 700px) { .ff-arrive { right: auto; left: 50%; transform: translate(-50%, -8px); } .ff-arrive.on { transform: translate(-50%, 0); } }
.ff-controls button.off { opacity: .45; filter: grayscale(1); }
/* Fruit Fly Airlines: tagline, today's route, and the share card */
.hud .tagline { margin: -6px 0 0; font: italic 400 15px var(--serif); color: var(--dim); }
.hud .daily { margin: 0; } .hud .daily.hidden { display: none; }
.hud [data-a=sharepass].hidden { display: none; }
.ffa-share { position: fixed; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; background: rgba(10,10,16,.55); backdrop-filter: blur(6px); padding: 16px; }
.ffa-share.hidden { display: none; }
.ffa-share .card { position: relative; width: min(380px, 100%); max-height: 100%; overflow: auto; background: #1b1916; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.ffa-share .pass canvas { width: 100%; height: auto; border-radius: 12px; display: block; }
.ffa-share .msg { margin: 0; font: italic 400 17px/1.35 var(--serif); color: #f3ede4; }
.ffa-share .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ffa-share .row button { padding: 9px 4px; border-radius: 12px; border: 1px solid rgba(243,237,228,.18); background: rgba(243,237,228,.06); color: #f3ede4; font: 13px var(--sans); cursor: pointer; }
.ffa-share .row button:hover { background: rgba(243,237,228,.14); }
.ffa-share .row.sites { grid-template-columns: repeat(4, 1fr); }
.ffa-share .row.sites button { padding: 12px 4px; font-weight: 600; background: var(--honey); color: #1b1916; border-color: transparent; }
.ffa-share .row.sites button:hover { background: #ffc56d; }
.ffa-share .row.extras { grid-template-columns: 1fr 1fr; }
.ffa-share .note { margin: 0; font: 11.5px var(--mono); color: #9b948a; } .ffa-share .note:empty { display: none; }
.ffa-share .x { position: absolute; top: 8px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 18px; cursor: pointer; z-index: 1; }
.ff-vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(10,8,20,.28) 100%); }

/* ---- Into the fly: the zoom film ------------------------------------------ */
body.film::before { background: radial-gradient(ellipse 60% 55% at 50% 45%, #111a2b 0%, #070a12 60%, #030408 100%); }
body.film #hud, body.film #callouts, body.film #leaders { display: none !important; }
#film { position: fixed; inset: 0; z-index: 30; pointer-events: none; color: #eef3ff; font-family: var(--sans); }
#film button { pointer-events: auto; }
.film-top { position: absolute; left: 24px; top: 72px; }
.film-kicker { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: #8fa3c4; }
.film-zoom { margin: 8px 0 0; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #8fa3c4; }
.film-zoom b { color: #fff; font-size: 20px; font-weight: 500; letter-spacing: 0; margin-right: 4px; }
.film-zoom i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff5d5d; margin-right: 8px; vertical-align: 3px; animation: film-rec 2s ease-in-out infinite; }
@keyframes film-rec { 50% { opacity: .35; } }
.film-ladder { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); height: 300px; width: 92px; border-right: 1px solid rgba(160, 185, 230, .28);
  display: flex; flex-direction: column; justify-content: space-between; font: 500 10.5px/1 var(--mono); color: #5f7090; text-align: right; }
.film-ladder p { position: absolute; top: -26px; right: 10px; margin: 0; white-space: nowrap; letter-spacing: .14em; text-transform: uppercase; font-size: 9.5px; }
.film-ladder span { padding-right: 12px; position: relative; transition: color .4s; }
.film-ladder span::after { content: ''; position: absolute; right: 0; top: 50%; width: 6px; border-top: 1px solid currentColor; }
.film-ladder span.on { color: #fff; }
.film-ladder em { position: absolute; right: -5px; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #46e6ff; box-shadow: 0 0 12px #46e6ff; transition: top .15s linear; }
.film-leaders { position: absolute; inset: 0; width: 100%; height: 100%; }
.film-leaders line { stroke: rgba(220, 235, 255, .55); stroke-width: 1; }
.film-leaders circle { fill: #fff; }
.film-tags { position: absolute; inset: 0; }
.film-tag { position: absolute; left: 0; top: 0; padding: 6px 10px; border: 1px solid rgba(200, 220, 255, .28); background: rgba(6, 10, 20, .6); backdrop-filter: blur(6px); border-radius: 4px; white-space: nowrap; }
.film-tag b { display: block; font: 600 12px/1.2 var(--sans); }
.film-tag span { display: block; font: 400 10.5px/1.3 var(--mono); color: #93a4c2; }
.film-tags, .film-leaders { opacity: 0; transition: opacity .8s; }
#film.tags-on .film-tags, #film.tags-on .film-leaders { opacity: 1; }
.film-card { position: absolute; left: 24px; bottom: 30px; max-width: 440px; }
.film-card.in > * { animation: film-in .9s both; }
.film-card.in > :nth-child(3) { animation-delay: .1s; } .film-card.in > :nth-child(4) { animation-delay: .2s; } .film-card.in > :nth-child(5) { animation-delay: .3s; }
@keyframes film-in { from { opacity: 0; transform: translateY(8px); } }
.film-count { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .14em; color: #8fa3c4; display: flex; gap: 12px; align-items: center; }
.film-count .real, .film-count .drawn { font-size: 9.5px; padding: 3px 6px; border-radius: 3px; text-transform: uppercase; }
.film-count .real { color: #7ff0c9; border: 1px solid rgba(127, 240, 201, .4); }
.film-count .drawn { color: #ffcf7a; border: 1px solid rgba(255, 207, 122, .4); }
.film-bar { height: 2px; width: 120px; background: rgba(160, 185, 230, .18); margin: 10px 0 14px; }
.film-bar i { display: block; height: 100%; background: #46e6ff; }
.film-card h2 { margin: 0; font: 700 clamp(24px, 3.4vw, 40px)/1.05 var(--sans); text-transform: uppercase; letter-spacing: -.01em; }
.film-meta { margin: 10px 0 0; font: 500 12px/1.4 var(--mono); color: #46e6ff; }
.film-text { margin: 10px 0 0; font: 400 15px/1.5 var(--sans); color: #c9d4ea; }
.film-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font: 400 12px/1 var(--sans); color: #c9d4ea; }
.film-legend:empty, .film-end:empty { display: none; }
.film-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.film-end { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.film-nav { position: absolute; right: 24px; bottom: 30px; display: flex; gap: 6px; }
.film-nav button { font: 500 14px/1 var(--sans); color: #dfe8fa; background: rgba(12, 18, 32, .7); border: 1px solid rgba(160, 185, 230, .25); border-radius: 999px; min-width: 38px; height: 38px; padding: 0 12px; cursor: pointer; }
.film-nav button:hover { border-color: #46e6ff; }
.film-veil { position: absolute; inset: 0; background: #030408; opacity: 0; transition: opacity .7s ease; }
.film-veil.on { opacity: 1; }
@media (max-width: 700px) {
  .film-top { left: 16px; top: 112px; }
  .film-ladder { right: 12px; top: 36%; height: 170px; width: 56px; font-size: 9px; }
  #film::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(transparent, rgba(3, 4, 8, .85) 55%); }
  .film-ladder p { display: none; }
  .film-card { left: 16px; right: 16px; bottom: 76px; max-width: none; }
  .film-text { font-size: 14px; }
  .film-nav { left: 16px; right: 16px; bottom: 20px; justify-content: flex-end; }
  .film-tag span { display: none; }
}

/* The share button on the death card: fades in once the tapping has stopped. */
.city-death .death-share { margin-top: 10px; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; pointer-events: none; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.city-death .death-share.ready { opacity: 1; transform: none; pointer-events: auto; }

/* Going again after a death: a soft fade over the rebuild. */
.ff-veil { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: #0d0c0b; opacity: 0; transition: opacity .5s ease; }
.ff-veil.on { opacity: .92; transition-duration: .25s; }

/* The postcard: one true titbit about the city that killed it. */
.city-death .titbit { max-width: min(520px, 88vw); margin: 4px 0 0; padding: 10px 16px; border-radius: 14px; background: rgba(251, 248, 242, .94); color: #1b1916; font: 15px/1.45 var(--sans); text-align: left; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.city-death .titbit b { display: block; font: 600 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #9a6a10; margin-bottom: 2px; }
.city-death .titbit .now { font: inherit; }
.city-death .titbit .now:not(:empty)::before { content: ' · '; }

/* Email signup */
.signup { margin-top: 16px; max-width: 420px; }
.signup-title { margin: 0 0 8px; font: 600 15px/1.3 var(--sans); color: inherit; }
.signup-row { display: flex; gap: 8px; }
.signup input { flex: 1; min-width: 0; font: 15px var(--sans); padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(160, 185, 230, .3); background: rgba(8, 12, 22, .6); color: #eef3ff; }
.signup input:focus { outline: none; border-color: #46e6ff; }
.signup-fine { margin: 6px 0 0 4px; font: 12px/1.4 var(--sans); color: #8fa3c4; }
.signup-done { margin: 0; font: 600 15px var(--sans); color: #7ff0c9; }
.signup-title:empty { display: none; }
#updatesbox .signup { max-width: none; margin: 14px 0; }

/* Phones: the film and a signup, nothing else on screen. */
body.phone #modes, body.phone .bar-right, body.phone #hud, body.phone #strip, body.phone #callouts, body.phone #leaders, body.phone #howto, body.phone #choose { display: none !important; }
body.phone .film-top { top: 56px; }
#film.ended .film-ladder { display: none; }

/* The top bar on one line: the counter makes way on narrower windows. */
.brand, #modes button { white-space: nowrap; }
@media (max-width: 1180px) { .bar .count { display: none; } }
