/* Bacteria Battle Royale v2: tokens and components from the approved mock-ups. */
:root {
  --bg: #07110e;
  --surface: #13251d;
  --surface-2: #0d1a15;
  --line: #ffffff19;
  --line-2: #ffffff2e;
  --ink: #edf5ef;
  --muted: #a4b9ad;
  --soft: #cfe0d6;
  --go: #64dfaa;
  --go-ink: #06140e;
  --go-bg: #173a2b;
  --abx: #e98b6d;
  --abx-ink: #f2a58c;
  --abx-bg: #22201a;
  --info: #5ec8e5;
  --info-bg: #10283a;
  --out-bg: #3a2a24;
  /* Bacterial type colours: reserved for resistance, never for players. */
  --t-none: #6f8279;
  --t-A: #edba7a;
  --t-B: #a78bfa;
  --t-C: #5ec8e5;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.go { color: var(--go); }
.num { font-variant-numeric: tabular-nums; }

/* Badges for drugs and type letters. */
.b { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; }
.bA { background: var(--t-A); color: #1a1206; }
.bB { background: var(--t-B); color: #140b2a; }
.bC { background: var(--t-C); color: #05202a; }
.bN { background: #2a3d34; color: var(--soft); }
.lg .b { min-width: 26px; height: 26px; border-radius: 7px; font-size: 14px; padding: 0 6px; }
.fc { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.tag { font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--abx-ink); border: 1px solid var(--abx); border-radius: 999px; padding: 2px 7px; }

/* Player numbers. Players are identified by number, never by colour. */
.n { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--go); color: var(--go-ink); font-size: 13px; font-weight: 800; flex-shrink: 0; }
.n.out { background: var(--out-bg); color: var(--abx-ink); border: 1px solid var(--abx); }
.n.bot { background: #2a3d34; color: var(--soft); }
.n.wait { background: #2a3d34; color: var(--muted); }
.n.imp { background: var(--info); color: #05202a; }

/* Genotype bar: segments by type, 2px gaps. */
.mix { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; font-size: 10px; font-weight: 800; }
.mix > span { display: flex; align-items: center; padding-left: 5px; min-width: 2px; white-space: nowrap; overflow: hidden; }
.mix.sm { height: 16px; border-radius: 5px; }
.mix.xs { height: 14px; border-radius: 4px; }
.g0 { background: var(--t-none); color: var(--bg); }
.g1 { background: var(--t-A); color: #1a1206; }
.g2 { background: var(--t-B); color: #140b2a; }
.g4 { background: var(--t-C); color: #05202a; }
.g3 { background: linear-gradient(90deg, var(--t-A) 50%, var(--t-B) 50%); color: #140b2a; }
.g5 { background: linear-gradient(90deg, var(--t-A) 50%, var(--t-C) 50%); color: #05202a; }
.g6 { background: linear-gradient(90deg, var(--t-B) 50%, var(--t-C) 50%); color: #05202a; }
.g7 { background: linear-gradient(90deg, var(--t-A) 33%, var(--t-B) 33% 66%, var(--t-C) 66%); color: #05202a; }

.meter { height: 6px; border-radius: 3px; background: #ffffff1a; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--go); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.info { display: flex; gap: 10px; align-items: flex-start; background: var(--info-bg); border: 1px solid var(--info); border-radius: 14px; padding: 10px 12px; line-height: 1.4; }
.btn { border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); padding: 9px 16px; font-size: 14px; font-weight: 600; min-height: 40px; }
.btn.primary { background: var(--go); color: var(--go-ink); border-color: var(--go); }
.btn.on { background: var(--go-bg); border-color: var(--go); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; font-weight: 700; min-height: 52px; border: 0; }
.btn.danger { border-color: var(--abx); color: var(--abx-ink); }

/* ---------- Phone ---------- */
.phone { max-width: 480px; min-height: 100dvh; margin: 0 auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.phone header.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.phone header.top .brand { font-weight: 700; color: var(--go); }
.langbtn { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--go); }
.eyebrow.dim { color: var(--muted); }
.phone h1 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 800; }
.phone .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.phone .lineage { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.phone .types { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--soft); }
.zone { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.zone.abx { border-color: var(--abx); background: var(--abx-bg); }
.zone .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zone .name { font-size: 15px; font-weight: 700; }
.zone .odds { margin-left: auto; display: flex; gap: 8px; }
.zone .ctl { display: flex; align-items: center; gap: 10px; }
.zone .food { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.step { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 20px; font-weight: 600; line-height: 1; }
.count { width: 20px; text-align: center; font-size: 19px; font-weight: 800; }
.opt { text-align: left; width: 100%; border-radius: 14px; border: 1px solid #ffffff24; background: var(--surface); padding: 14px 16px; font-size: 15px; font-weight: 500; min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.opt.on { border-color: var(--go); background: var(--go-bg); box-shadow: inset 0 0 0 1px var(--go); }
.opt .was { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fo { border-radius: 16px; border: 1px solid #ffffff24; background: var(--surface); min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 700; }
.fo.on { border-color: var(--go); background: var(--go-bg); box-shadow: inset 0 0 0 1px var(--go); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tbl { padding: 4px 14px 6px; }
.tr { display: grid; align-items: center; gap: 6px; font-size: 14px; padding: 8px 0; border-top: 1px solid #ffffff14; }
.tr:first-child { border-top: 0; font-size: 11px; color: var(--muted); }
.tr.res { grid-template-columns: minmax(0, 1fr) 52px 60px 16px 60px; }
.tr.surv { grid-template-columns: minmax(0, 1fr) 48px 48px 48px; }
.tr.pts { grid-template-columns: minmax(0, 1fr) auto; }
.r { text-align: right; }
.ev { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.ev .ic { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid #ffffff1f; display: flex; align-items: center; justify-content: center; }
.foot { margin-top: auto; text-align: center; font-size: 13px; color: var(--muted); }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.big-rank { font-size: 76px; line-height: 1; font-weight: 800; color: var(--go); }
.center { text-align: center; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select { font: inherit; font-size: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; }
.field input.code { letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.err { color: var(--abx-ink); font-size: 14px; min-height: 1.2em; }
.progress3 { display: flex; gap: 6px; }
.progress3 > span { flex: 1; height: 5px; border-radius: 3px; background: #ffffff22; }
.progress3 > span.on { background: var(--go); }
.pausebar { position: sticky; top: 0; z-index: 5; background: var(--abx-bg); border: 1px solid var(--abx); color: var(--abx-ink); border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--abx); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 20; }
.toast.show { opacity: 1; }

/* ---------- Projector: a 1280 × 720 stage scaled to the window ---------- */
body.proj { overflow: hidden; height: 100vh; display: flex; align-items: center; justify-content: center; }
.stage { width: 1280px; height: 720px; flex-shrink: 0; transform-origin: center center; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.stage .phead { display: flex; align-items: center; justify-content: space-between; padding: 20px 36px 0; }
.stage .phead .k { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--go); }
.stage .phead .t { font-size: 30px; font-weight: 800; }
.stage .body { flex: 1; min-height: 0; padding: 16px 36px 14px; }
.stage .b { min-width: 24px; height: 24px; border-radius: 7px; font-size: 13px; padding: 0 6px; }
.stage .tag { font-size: 12px; font-weight: 800; letter-spacing: .1em; padding: 3px 10px; }
/* Above the pause overlay, so the lecturer can always press Resume. */
.ltbar { position: relative; z-index: 11; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 36px; background: var(--surface-2); border-top: 1px solid var(--line); min-height: 58px; }
.ltbar .note { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.ltbar .note strong { color: var(--ink); }
.ltbar .acts { display: flex; gap: 10px; }
.zt { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; text-align: left; }
.zt.abx { border: 2px solid var(--abx); background: repeating-linear-gradient(135deg, #1f1d17 0 14px, #24211a 14px 28px); }
.zt.sel { border: 2px solid var(--info); }
.prow { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.pbar { flex: 1; height: 10px; border-radius: 5px; background: #ffffff14; overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: inherit; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; display: flex; align-items: center; gap: 14px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 14px; }
.lr { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.lr .who { width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr .cnt { width: 54px; text-align: right; }
.pauseover { position: absolute; inset: 0; background: #07110ecc; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; z-index: 10; }
.qbar { display: grid; grid-template-columns: 230px minmax(0, 1fr) 54px; grid-template-rows: auto auto; align-items: center; column-gap: 16px; row-gap: 6px; font-size: 18px; }
.qbar .v1, .qbar .v2 { height: 16px; border-radius: 0 4px 4px 0; min-width: 2px; }
.qbar .v1 { background: #5b6f66; }
.qbar .v2 { background: var(--soft); }
.rk { display: flex; align-items: center; gap: 12px; font-size: 17px; padding: 8px 0; border-top: 1px solid #ffffff14; }
.hb { flex: 1; display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; font-size: 13px; font-weight: 700; }
.hb > span { display: flex; align-items: center; padding-left: 8px; white-space: nowrap; overflow: hidden; min-width: 2px; }
.o-s { background: #4c5f56; color: var(--ink); }
.o-m { background: var(--soft); color: var(--go-ink); }
.o-p { background: var(--go); color: var(--go-ink); }
.o-i { background: #2c7d61; color: var(--ink); }

/* Reveal animation. Reduced motion shows the end state at once. */
.reveal-card { transition: border-color .4s, background .4s; }
.reveal-card .drug { transition: opacity .35s, transform .35s; }
.reveal-card.pending .drug { opacity: 0; transform: scale(.7); }
.fade-in { animation: fadeIn .4s ease both; }
/* 3D dishes: one canvas over the stage draws into each card's slot. */
.dish3d-canvas { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; pointer-events: none; z-index: 2; }
.reveal-card.has-dish { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.reveal-card.has-dish .zinfo { gap: 7px; }
.reveal-card.has-dish .drug { align-self: flex-start; }
.reveal-card .zinfo { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dslot { position: relative; min-height: 140px; border-radius: 14px; background: radial-gradient(circle at 50% 55%, #10241c 0 60%, transparent 72%); }
.abx-drop { position: absolute; left: 0; right: 0; top: 50%; margin-top: -24px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.abx-drop .disc { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 900; color: #07110e; box-shadow: 0 4px 14px #000a; }
.abx-drop .word { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 6px #000; }
/* Final results: each quiz question, its bars and its answer. */
.qz { display: flex; flex-direction: column; gap: 3px; padding-top: 7px; border-top: 1px solid #ffffff14; }
.qz-q { font-size: 14px; font-weight: 700; line-height: 1.25; }
.qz-a { font-size: 14px; line-height: 1.25; color: var(--go); margin-top: 1px; }
.qz-bar { display: grid; grid-template-columns: 54px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: 13px; }
.qz-bar strong { text-align: right; font-size: 14px; }
.qz-bar .trk { height: 9px; border-radius: 5px; background: #ffffff10; overflow: hidden; }
.qz-bar .trk i { display: block; height: 100%; border-radius: 5px; }
.ended { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.ended h1 { margin: 12px 0 0; font-size: 56px; font-weight: 900; }
.ended p { font-size: 20px; margin: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* ---------- Act 2 ---------- */
.pc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 11px; display: flex; flex-direction: column; gap: 8px; }
.pc.prev { border-style: dashed; }
.opt svg, .pc .ph svg, .fc svg { flex-shrink: 0; }
.pc .ph { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.tg { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--line-2); color: var(--soft); white-space: nowrap; }
.tg.sev { border-color: var(--abx); color: var(--abx-ink); }
.tg.lg { font-size: 13px; padding: 2px 10px; }
.ch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.c { font: inherit; color: var(--ink); background: #0d1a15; border: 1px solid #ffffff24; border-radius: 10px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 13px; font-weight: 800; padding: 0; cursor: pointer; }
.c small { font-size: 9.5px; font-weight: 600; color: var(--muted); }
.c.on { border-color: var(--go); background: var(--go-bg); box-shadow: inset 0 0 0 1px var(--go); }
.c.fail small { color: var(--abx-ink); }
.c:disabled { opacity: .42; cursor: default; }
.c.on:disabled { opacity: .9; }
.testres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; background: var(--info-bg); border-radius: 10px; padding: 6px 8px; }
.testres span { display: inline-flex; align-items: center; gap: 4px; }
.ok-ink { color: var(--go); }
.bad-ink { color: var(--abx-ink); }
.ores { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.ores:first-child { border-top: 0; }
.ores .t { font-weight: 700; font-size: 14px; }
.ores .p { font-weight: 800; font-size: 15px; text-align: right; }
.ores .d { display: flex; gap: 6px; align-items: center; color: var(--soft); }
.rrow { display: grid; grid-template-columns: 22px 44px 18px 44px minmax(0, 1fr); gap: 6px; align-items: center; font-size: 13px; }
.rbar { position: relative; flex: 1; height: 14px; border-radius: 7px; background: #ffffff12; }
.rbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; }
.rbar .line { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--abx); }
.col2 { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cr { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.cr .trk { flex: 1; height: 14px; border-radius: 4px; background: #ffffff10; position: relative; }
.cr .trk i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.vbar { display: grid; grid-template-columns: 260px minmax(0, 1fr) 60px; align-items: center; gap: 16px; font-size: 20px; }
.vbar .trk { height: 30px; border-radius: 8px; background: #ffffff10; position: relative; overflow: hidden; }
.vbar .trk i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--soft); border-radius: 8px; }
.vbar.win .trk i { background: var(--go); }
.audit-wrap { display: flex; align-items: flex-end; gap: 10px; font-size: 11px; }
.audit-wrap > span { line-height: 14px; }
.audit { position: relative; flex: 1; min-width: 0; display: grid; gap: 4px; align-items: end; justify-content: start; }
.audit .med { position: absolute; left: 0; right: 0; border-top: 2px dashed #edf5ef99; pointer-events: none; }
.audit .a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; line-height: 14px; min-width: 0; }
.audit .a b { position: relative; z-index: 1; padding: 0 2px; border-radius: 3px; background: var(--surface); font-weight: 700; color: var(--ink); }
.audit.many .a { font-size: 10px; }
.audit .a i { width: 100%; max-width: 18px; background: #8fa79a; border-radius: 3px 3px 0 0; display: block; }
.audit .a.hi i { background: var(--abx); }

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

/* ---------- Lecturer ---------- */
.host { max-width: 1100px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.host .hgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .host .hgrid { grid-template-columns: 1fr; } }
.host .card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.host h1 { margin: 0; font-size: 24px; }
.host h2 { margin: 0; font-size: 16px; }
.host .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.host .plist { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.host .prow2 { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.host .prow2 .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host .state { font-size: 13px; color: var(--muted); }
.scnote { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.45; color: var(--soft); }
.scnote strong { color: var(--ink); }
.host .note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.5; color: var(--soft); }
.host .seg { display: inline-flex; gap: 6px; }
.chip { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.chip.ok { border-color: var(--go); color: var(--go); }

/* Landing */
.landing { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: 32px 20px; display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.wordmark .gradient-text { background: linear-gradient(90deg, #64dfaa, #5ec8e5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark .gradient-start { stop-color: #64dfaa; } .wordmark .gradient-middle { stop-color: #7fd8c4; } .wordmark .gradient-end { stop-color: #5ec8e5; }
.title { font-size: 40px; line-height: 1.05; font-weight: 800; margin: 0; }

/* ---------- Phone: animated Act 1 result ----------
   Base styles are the end state; .play adds the motion. Reduced motion (above)
   switches animations off, so the end state shows at once. */
.ldish { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px 8px; }
.ld { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ld svg { width: 100%; max-width: 86px; display: block; overflow: visible; }
.ld-name { font-size: 11px; color: var(--soft); text-align: center; line-height: 1.2; }
.ld-tag { min-height: 24px; display: flex; align-items: center; }
.ld.empty { opacity: .45; }
.ld-glass { fill: none; stroke: #b6eee055; stroke-width: 1.5; }
.ld-agar { fill: #164a39; }
.ld-wash { opacity: .18; }
.w-A { fill: var(--t-A); } .w-B { fill: var(--t-B); } .w-C { fill: var(--t-C); }
.ld-pulse { fill: none; stroke: #ffffff; stroke-width: 1.5; opacity: 0; }
.ld-drop { opacity: 0; }
.ld-drop text { font-size: 11px; font-weight: 900; fill: #07110e; font-family: Inter, sans-serif; }
.ld-ripple { fill: none; stroke-width: 2; opacity: 0; }
.r-A { stroke: var(--t-A); } .r-B { stroke: var(--t-B); } .r-C { stroke: var(--t-C); }
.lc { transform-box: fill-box; transform-origin: center; stroke: #07110e88; stroke-width: .5; }
.lc.t-none { fill: var(--t-none); } .lc.t-A { fill: var(--t-A); } .lc.t-B { fill: var(--t-B); } .lc.t-C { fill: var(--t-C); }
.lc.die { opacity: 0; }
.ldish.out .ld-cells { filter: grayscale(1) brightness(.7); }
.ld-stamp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--abx-ink); text-shadow: 0 2px 12px #000; transform: rotate(-8deg); pointer-events: none; }

/* Timeline: arrive 0–0.8s, change 1.0s, grow 1.1–2.0s, antibiotic drops 1.6s and lands 2.1s, die 2.3–3.2s, verdict 3.3s. */
.ldish.play .lc { animation: lcArrive .5s cubic-bezier(.2,.9,.3,1.3) calc(.15s + var(--d)) both; }
.ldish.play .lc.born { animation: lcArrive .5s cubic-bezier(.2,.9,.3,1.3) calc(1.1s + var(--d) * 2) both; }
.ldish.play .lc.die { animation: lcArrive .5s cubic-bezier(.2,.9,.3,1.3) calc(.15s + var(--d)) both, lcDie .7s ease-in calc(2.3s + var(--d) * 1.4) both; }
.ldish.play .lc.change.f-none { animation: lcArrive .5s calc(.15s + var(--d)) both, lcChangeNone 1s ease 1s both; }
.ldish.play .lc.change.f-A { animation: lcArrive .5s calc(.15s + var(--d)) both, lcChangeA 1s ease 1s both; }
.ldish.play .lc.change.f-B { animation: lcArrive .5s calc(.15s + var(--d)) both, lcChangeB 1s ease 1s both; }
.ldish.play .ld-pulse { animation: ldPulse 1s ease-out 1s both; }
.ldish.play .ld-wash { animation: ldWash 1.1s ease 2.1s both; }
.ldish.play .ld-drop { animation: ldDrop .75s cubic-bezier(.5,0,1,.6) 1.6s both; }
.ldish.play .ld-ripple { animation: ldRipple .8s ease-out 2.1s both; }
.ldish.play.out .ld-cells { animation: ldGrey .6s ease 3.2s both; }
.ldish.play .ld-stamp { animation: ldStamp .45s cubic-bezier(.2,.9,.3,1.4) 3.3s both; }
.ldish.play .ld-tag .b { animation: ldTag .35s ease calc(1.9s + var(--z) * .08s) both; }
.res-head.play .verdict { animation: fadeIn .45s ease 3.3s both; }
.evs.play > .ev { animation: fadeIn .4s ease both; }
.evs.play > .ev:nth-of-type(1) { animation-delay: 3.5s; } .evs.play > .ev:nth-of-type(2) { animation-delay: 3.7s; }
.evs.play > .ev:nth-of-type(3) { animation-delay: 3.9s; } .evs.play > .ev:nth-of-type(n+4) { animation-delay: 4.1s; }
@keyframes lcArrive { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes lcDie { from { opacity: 1; scale: 1; } to { opacity: 0; scale: .3; } }
@keyframes lcChangeNone { from { fill: var(--t-none); } 40% { fill: #ffffff; } }
@keyframes lcChangeA { from { fill: var(--t-A); } 40% { fill: #ffffff; } }
@keyframes lcChangeB { from { fill: var(--t-B); } 40% { fill: #ffffff; } }
@keyframes ldPulse { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.1); } }
@keyframes ldWash { 0% { opacity: .5; transform: scale(0); } 45% { opacity: .5; transform: scale(1); } 100% { opacity: .18; transform: scale(1); } }
@keyframes ldDrop { 0% { opacity: 0; transform: translateY(-46px); } 15% { opacity: 1; } 66% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes ldRipple { 0% { opacity: 1; transform: scale(.1); } 70% { opacity: .9; } 100% { opacity: 0; transform: scale(1); } }
@keyframes ldGrey { from { filter: none; } to { filter: grayscale(1) brightness(.7); } }
@keyframes ldStamp { from { opacity: 0; transform: rotate(-8deg) scale(1.6); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes ldTag { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.ld-pulse, .ld-wash, .ld-ripple { transform-box: fill-box; transform-origin: center; }

/* ---------- Phone: how-to-play panels ---------- */
details.help { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
details.help summary { cursor: pointer; padding: 11px 0; font-size: 14px; font-weight: 700; color: var(--go); list-style-position: inside; }
details.help ul { margin: 0 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; line-height: 1.45; color: var(--soft); }
details.help strong { color: var(--ink); }

/* ---------- Lecturer: running order ---------- */
.runorder { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.runorder li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 5px 8px; border-radius: 8px; color: var(--soft); }
.runorder li.done { color: var(--muted); }
.runorder li.now { background: var(--go-bg); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--go); }
.ltbar .note .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.ltbar .acts { flex-shrink: 0; }
.ltbar .btn { white-space: nowrap; flex-shrink: 0; }
.ltbar .note span { font-size: 13px; line-height: 1.35; }

/* ---------- Phone: Access, Watch and Reserve ---------- */
details.help.aware p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--soft); }
details.help.aware ul { list-style: none; padding-left: 0; gap: 10px; }
details.help.aware li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.aware-key { display: flex; flex-direction: column; gap: 8px; }
.aware-key div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }

/* How-to-play videos and the lobby's joining loop (projector only). */
.vlayer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
.vlayer[hidden] { display: none; }
.vlayer video { width: 100%; height: 100%; object-fit: contain; }
.vlayer .vstart { position: absolute; font-size: 22px; padding: 16px 30px; min-height: 0; background: var(--go); color: var(--go-ink); border-color: var(--go); }
.vlayer .vctl { position: absolute; right: 20px; top: 20px; display: flex; gap: 8px; opacity: .3; transition: opacity .2s; }
.vlayer .vctl:hover, .vlayer .vctl:focus-within { opacity: 1; }
.vlayer .vctl[hidden] { display: none; }
.joinslot { width: 680px; height: 383px; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--line); flex-shrink: 0; }
.joinloop { display: block; width: 100%; height: 100%; object-fit: cover; }
