/* Shared components: layout shell, buttons, cards, lists, chips, tiers, sheet, toast, tabs, states.
   C4 "Night Technicolor": raised things sit on a hard 3D edge (box-shadow 0 var(--edge) 0 <edge colour>) and press
   down into it. Film colours: cyan Start, red Trick Shot, marigold End (tokens.css). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 600 var(--fs-md)/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app {
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}
.screen {
  padding: calc(var(--s5) + var(--safe-top)) calc(var(--s5) + var(--safe-right)) var(--s8) calc(var(--s5) + var(--safe-left));
  animation: screen-in var(--dur) var(--ease-out);
}
.has-tabs .screen { padding-bottom: calc(var(--tabs-h) + var(--safe-bottom) + var(--s8)); }
.screen.with-footer { padding-bottom: calc(190px + var(--safe-bottom)); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (min-width: 760px) {
  :root { --col: 560px; }
  body { background: radial-gradient(1200px 640px at 50% -12%, #1b2847 0%, var(--bg) 62%) fixed; }
}
@media (min-width: 1200px) {
  :root { --col: 600px; }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--bg); }
}

/* ---------- Type ---------- */
.label {
  font: 800 var(--fs-xs)/1.2 var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.label.accent { color: var(--accent); }
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
}
.h1 { font: 700 var(--fs-2xl)/1.15 var(--font-display); letter-spacing: -.01em; }
.h2 { font: 700 var(--fs-xl)/1.2 var(--font-display); }
.h3 { font: 600 var(--fs-lg)/1.25 var(--font-display); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); }
.accent-text { color: var(--accent); }
.rival-text { color: var(--rival); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.row-flex { display: flex; align-items: center; gap: var(--s3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }

/* ---------- Brand ---------- */
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 6.4vw, 2.1rem);
  line-height: 1;
  letter-spacing: -.01em;
  white-space: nowrap;
}
/* The locked wordmark (web/assets/brand/logo.svg, built by scripts/build-brand.mjs). */
.brand-mark { display: block; height: 44px; width: auto; }
.brand b { color: var(--accent); font-weight: inherit; }

/* ---------- Buttons ---------- */
.btn {
  --btn-edge: #0a1020;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap);
  padding: 0 var(--s5);
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  font: 700 var(--fs-md)/1.1 var(--font-display);
  color: var(--text);
  background: var(--bg-raised);
  text-decoration: none;
  box-shadow: 0 var(--edge-press) 0 var(--btn-edge);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast);
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: translateY(var(--edge-press)); box-shadow: 0 0 0 var(--btn-edge); }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* Solid 3D buttons: a face colour on a darker edge that the button presses down into. */
.btn-primary, .btn-cyan, .btn-red, .btn-green, .btn-cream {
  border: 0;
  box-shadow: 0 var(--edge) 0 var(--btn-edge);
}
.btn-primary:active, .btn-cyan:active, .btn-red:active, .btn-green:active, .btn-cream:active {
  transform: translateY(calc(var(--edge) - var(--edge-press)));
  box-shadow: 0 var(--edge-press) 0 var(--btn-edge);
}
.btn-primary { --btn-edge: var(--gold-edge); background: var(--gold); color: var(--text-inverse); }
.btn-cyan { --btn-edge: var(--cyan-edge); background: var(--cyan); color: var(--text-inverse); }
.btn-red { --btn-edge: var(--red-edge); background: var(--red); color: var(--cream); }
.btn-green { --btn-edge: var(--green-edge); background: var(--green); color: var(--text-inverse); }
.btn-cream { --btn-edge: #b9b09d; background: var(--cream); color: var(--text-inverse); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-lg { min-height: 60px; font-size: var(--fs-xl); border-radius: 18px; padding: 0 var(--s6); }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: var(--tap); padding: 0 var(--s4); font-size: var(--fs-sm); }
.btn svg { width: 22px; height: 22px; flex: none; }
.link-btn {
  min-height: var(--tap);
  display: inline-flex; align-items: center;
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.link-btn.underline { text-decoration: underline; text-underline-offset: 4px; color: var(--text); }
.icon-btn {
  width: var(--tap); height: var(--tap);
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: var(--text);
  flex: none;
}
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { background: var(--bg-inset); }

/* ---------- Footer bar (sticky primary actions in thumb reach) ---------- */
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: var(--s3) calc(var(--s5) + var(--safe-right)) calc(var(--s4) + var(--safe-bottom)) calc(var(--s5) + var(--safe-left));
  background: linear-gradient(to top, var(--bg) 72%, rgba(13, 20, 36, 0));
  border-top: 1px solid var(--line);
  max-width: var(--col); margin: 0 auto;
}
/* Outline buttons get a solid fill here, so list text scrolling under the bar never shows through them. */
.footer-bar .btn:not(.btn-primary):not(.btn-cream) { background: var(--bg); }
.footer-bar .note { text-align: center; color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--s3); }
.footer-bar .duo { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s3); }
.footer-bar .duo .btn-lg { font-size: var(--fs-lg); padding: 0 var(--s4); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--s2);
  min-height: 52px;
  margin: calc(var(--s2) * -1) calc(var(--s2) * -1) var(--s4);
}
.topbar .title { flex: 1; font-size: var(--fs-xl); font-weight: 750; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .title.center { text-align: center; font-size: var(--fs-lg); }
.topbar .right { margin-left: auto; text-align: right; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  box-shadow: var(--panel-shadow);
}
.card.tight { padding: var(--s4); }
.card-link {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s4) var(--s5);
  text-decoration: none;
  min-height: 64px;
  box-shadow: 0 4px 0 #0a1020;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.card-link:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a1020; }
.card-link .grow { flex: 1; min-width: 0; }
.chev { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.callout {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4);
  border-radius: var(--radius);
  background: var(--accent-tint);
  border: 1px solid #6a5420;
  font-size: var(--fs-md);
}
.callout svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.callout.rival { background: var(--rival-tint); border-color: #1f5670; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%;
  min-height: 64px;
  padding: var(--s3) 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.list > li:last-child > .item, .list > .item:last-child { border-bottom: 0; }
button.item:active, a.item:active { background: var(--bg-raised); }
.item .grow { flex: 1; min-width: 0; }
.item .name { font: 600 var(--fs-lg)/1.25 var(--font-display); overflow-wrap: anywhere; }
.item .sub { color: var(--text-2); font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item[aria-disabled="true"] { opacity: .4; }
.avatar {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-inset);
  color: var(--text);
  font-weight: 700; font-size: var(--fs-md);
  letter-spacing: .02em;
  overflow: hidden;
}
.avatar.lg { width: 72px; height: 72px; font-size: var(--fs-xl); }
.avatar.xl { width: 96px; height: 96px; font-size: 2.2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 var(--s4);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line-strong);
  font-weight: 650; font-size: var(--fs-sm);
  white-space: nowrap;
  color: var(--text-2);
}
.pill.hot { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }
.pill.rival { border-color: var(--rival); color: var(--rival); }
.pill.win { border-color: var(--good); color: var(--good); }
.pill.loss { border-color: var(--danger); color: var(--danger); }
.chipset { display: flex; flex-wrap: wrap; gap: var(--s2); }
.facts { display: flex; justify-content: center; align-items: center; gap: 0; color: var(--text); font-size: var(--fs-md); }
.facts > span { padding: 0 var(--s4); }
.facts > span + span { border-left: 1.5px solid var(--line-strong); }

/* ---------- Tier badges (colour + shape) ---------- */
.tier {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font: 700 var(--fs-xs)/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tier svg { width: 11px; height: 11px; flex: none; }
.tier.blockbuster { color: var(--tier-blockbuster); background: var(--tier-blockbuster-bg); }
.tier.cult { color: var(--tier-cult); background: var(--tier-cult-bg); }
.tier.deep_cut { color: var(--tier-deep); background: var(--tier-deep-bg); }
.tier.lost_reel { color: var(--tier-lost); background: var(--tier-lost-bg); }
.tier-shape { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; }

/* ---------- Chain chips ---------- */
.chain { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 10px;
  font-weight: 650; font-size: var(--fs-md);
  line-height: 1.2;
  max-width: 100%;
}
.chip.film { border: 1.5px solid var(--line-strong); color: var(--text); background: transparent; }
.chip.film.trick { border-color: var(--accent); color: var(--accent); }
.chip.film.final { border-color: var(--text); }
.chip.person { background: var(--bg-inset); color: var(--text-2); font-weight: 500; }
.chip.person .pts { font: 600 var(--fs-sm) var(--font-mono); color: var(--text-3); }
.chip.person.cult { background: var(--tier-cult-bg); color: #EBD9A6; }
.chip.person.cult .pts { color: var(--tier-cult); }
.chip.person.deep_cut { background: var(--tier-deep-bg); color: #F3C9B2; }
.chip.person.deep_cut .pts { color: var(--tier-deep); }
.chip.person.lost_reel { background: var(--tier-lost-bg); color: #D9CEFF; }
.chip.person.lost_reel .pts { color: var(--tier-lost); }
.chain.rival .chip.person { background: var(--rival-tint); color: var(--rival); }
.chain.rival .chip.person .pts { color: var(--rival); }
button.chip { position: relative; }
button.chip::after { content: ""; position: absolute; inset: -4px; }
.chip svg { width: 10px; height: 10px; flex: none; }
.chip.enter { animation: chip-in var(--dur-slow) var(--ease-spring); }
@keyframes chip-in { from { opacity: 0; transform: translateX(-14px) scale(.9); } to { opacity: 1; transform: none; } }

/* ---------- Segmented control ---------- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 4px; padding: 5px;
  background: var(--bg-raised);
  border-radius: 16px;
}
.seg button {
  min-height: 48px;
  border-radius: 12px;
  font-weight: 650; font-size: var(--fs-lg);
  color: var(--text-2);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--gold); color: var(--text-inverse); box-shadow: 0 3px 0 var(--gold-edge); }
.filters { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  min-height: var(--tap); padding: 0 var(--s4);
  border-radius: var(--radius-pill); border: 1.5px solid var(--line-strong);
  font-weight: 600; white-space: nowrap; color: var(--text);
}
.filters button[aria-pressed="true"] { background: var(--gold); color: var(--text-inverse); border-color: var(--gold); }

/* ---------- Inputs ---------- */
.search {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 52px;
  padding: 0 var(--s4);
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 22px; height: 22px; color: var(--text-2); flex: none; }
.search input, .field input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  font-size: max(16px, var(--fs-lg));
  color: var(--text);
  min-height: var(--tap);
}
.search input::placeholder, .field input::placeholder { color: var(--text-3); }
.field { display: block; }
.field .label { display: block; margin-bottom: var(--s2); }
.field input {
  width: 100%;
  padding: 0 var(--s4);
  min-height: 52px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.field input:focus { border-color: var(--accent); }
.field .hint, .field .err { display: block; }
.field .hint { margin-top: var(--s2); font-size: var(--fs-sm); color: var(--text-3); }
.field .err { margin-top: var(--s2); font-size: var(--fs-sm); color: var(--danger); }

/* Toggle switch */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
label.setting { cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--bg-inset); border: 1px solid var(--line-strong); transition: background var(--dur-fast); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text-2); transition: transform var(--dur) var(--ease-out), background var(--dur-fast); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--text-inverse); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Radio dot */
.radio { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--text-2); flex: none; display: grid; place-items: center; }
[aria-checked="true"] .radio { border-color: var(--accent); background: var(--accent); }
[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--text-inverse); }
.option[aria-checked="true"] { background: var(--accent-tint); border-radius: var(--radius); }

/* ---------- Sheet ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .62);
  animation: fade-in var(--dur) var(--ease-out);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: var(--col); margin: 0 auto;
  max-height: calc(100dvh - 72px - var(--safe-top));
  display: flex; flex-direction: column;
  /* A sheet without a .sheet-body (forms swapped in, short phones, keyboard up) scrolls as a whole instead of spilling off-screen. */
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-card);
  border-top: 1px solid var(--line-strong);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-sheet);
  padding: var(--s3) calc(var(--s5) + var(--safe-right)) calc(var(--s4) + var(--safe-bottom)) calc(var(--s5) + var(--safe-left));
  animation: sheet-up var(--dur) var(--ease-out);
}
.sheet.closing { animation: sheet-down var(--dur) var(--ease-out) forwards; }
.backdrop.closing { animation: fade-out var(--dur) forwards; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto var(--s4); flex: none; }
.sheet .sheet-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; margin: 0 calc(var(--s5) * -1); padding: 0 var(--s5); }
.sheet .sheet-head { flex: none; }
.sheet > :not(.sheet-body) { flex-shrink: 0; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* Dialog (confirm) */
.dialog {
  position: fixed; z-index: 51; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 380px);
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s6);
  box-shadow: var(--shadow-pop);
  animation: pop-in var(--dur) var(--ease-spring);
}
.dialog .actions { display: grid; gap: var(--s2); margin-top: var(--s5); }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed; left: 0; right: 0; z-index: 60;
  bottom: calc(var(--tabs-h) + var(--safe-bottom) + var(--s4));
  display: grid; justify-items: center; gap: var(--s2);
  pointer-events: none; padding: 0 var(--s4);
}
.toast {
  max-width: min(92vw, 420px);
  background: var(--text); color: var(--text-inverse);
  padding: var(--s3) var(--s5);
  border-radius: var(--radius-pill);
  font-weight: 650;
  box-shadow: var(--shadow-pop);
  animation: toast-in var(--dur) var(--ease-spring);
}
body:has(.footer-bar) .toast-root { bottom: calc(132px + var(--safe-bottom)); }
.toast.err { background: var(--danger); color: var(--text-inverse); }
.toast.leaving { animation: fade-out var(--dur) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ---------- Bottom tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: var(--col); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-bottom));
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: rgba(13, 20, 36, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-2); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 600;
  position: relative;
}
.tabs a svg { width: 26px; height: 26px; }
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs a[aria-current="page"] svg { filter: drop-shadow(0 2px 0 var(--gold-edge)); }
.tabs .dot { position: absolute; top: 9px; left: calc(50% + 10px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }

/* ---------- States: skeleton, empty, error ---------- */
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-raised) 0%, var(--bg-inset) 40%, var(--bg-raised) 80%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-line { height: 14px; margin: 8px 0; }
.skel-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) 0; }
.skel-row .skel.circle { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.skel-row .lines { flex: 1; }
.skel-block { height: 120px; border-radius: var(--radius-lg); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.empty, .error-box {
  text-align: center;
  padding: var(--s8) var(--s4);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text-2);
}
.empty svg, .error-box svg { width: 40px; height: 40px; margin: 0 auto var(--s3); color: var(--text-3); }
.empty .h3, .error-box .h3 { color: var(--text); margin-bottom: var(--s2); }
.empty .btn, .error-box .btn { margin-top: var(--s4); }
.error-box { border-color: #6a2a3c; }

/* ---------- Boards ---------- */
.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid; grid-template-columns: 48px 1fr auto 56px var(--tap); align-items: center; gap: var(--s2);
  min-height: 60px; padding: 0 var(--s1);
  border-bottom: 1px solid var(--line);
}
.board .rank { font: 600 var(--fs-md) var(--font-mono); color: var(--text-2); }
.board .who { font-weight: 650; font-size: var(--fs-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .time { font: 500 var(--fs-sm) var(--font-mono); color: var(--text-3); }
.board .score { font: 700 var(--fs-lg) var(--font-mono); text-align: right; }
.board li.me { background: var(--accent-tint-2); border-radius: var(--radius); border-bottom-color: transparent; margin: 4px calc(var(--s3) * -1); padding: 0 var(--s3); }
.board li.me .who, .board li.me .score { color: var(--accent); }

.board .menu { display: grid; justify-items: end; }

/* ---------- Report and block ---------- */
.more-btn { color: var(--text-2); flex: none; }
.more-btn svg { width: 22px; height: 22px; }
.danger-text, .danger-text svg { color: var(--danger) !important; }
.code-box {
  font: 700 clamp(1.5rem, 7.5vw, 2rem)/1.2 var(--font-mono); letter-spacing: .08em;
  text-align: center; padding: var(--s5) var(--s3); margin: var(--s3) 0;
  border-radius: var(--radius); background: var(--bg-inset); border: 1px dashed var(--accent);
  color: var(--accent); user-select: all; -webkit-user-select: all; overflow-wrap: anywhere;
}
.legal-links { display: flex; justify-content: center; gap: var(--s4); flex-wrap: wrap; }
.legal-links a { display: inline-flex; align-items: center; min-height: var(--tap); font-size: var(--fs-sm); color: var(--text-2); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Progress bars ---------- */
.bar { height: 10px; border-radius: 99px; background: var(--bg-inset); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width var(--dur-slow) var(--ease-out); }

/* ---------- Divider ---------- */
.hr { height: 1px; background: var(--line); margin: var(--s5) 0; border: 0; }

/* ---------- Cinerama screen (web/js/ui/cinerama.js): three curved panels, Start | Trick Shot | End ---------- */
.cine { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 6px; perspective: var(--perspective); align-items: stretch; }
.cine-panel {
  --face: var(--dim); --edgec: #0c1a2c; --ink: var(--dim-text);
  position: relative; min-height: 112px; padding: var(--s3) var(--s2) var(--s3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: var(--face); color: var(--ink);
  border-radius: 14px; box-shadow: 0 var(--edge) 0 var(--edgec);
  transition: background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.cine-panel:first-child { transform: rotateY(var(--cine-angle)); transform-origin: right center; }
.cine-panel:last-child { transform: rotateY(calc(var(--cine-angle) * -1)); transform-origin: left center; }
.cine-panel .slot { font: 800 12px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.cine-panel .film { font: 700 var(--fs-md)/1.12 var(--font-display); overflow-wrap: anywhere; hyphens: auto; }
.cine-panel .year { font: 700 var(--fs-xs)/1 var(--font-body); opacity: .8; }
.cine-panel.lit.opening { --face: var(--cyan); --edgec: var(--cyan-edge); --ink: var(--text-inverse); }
.cine-panel.lit.trick { --face: var(--red); --edgec: var(--red-edge); --ink: var(--cream); }
.cine-panel.lit.final { --face: var(--gold); --edgec: var(--gold-edge); --ink: var(--text-inverse); }
.cine-panel.here { outline: 3px solid var(--cream); outline-offset: 3px; }
.cine.sm .cine-panel { min-height: 72px; padding: var(--s2) 6px; }
.cine.sm .cine-panel .film { font-size: var(--fs-sm); }
@media (prefers-reduced-motion: reduce) { .cine-panel { transition: none; } }

/* ---------- Crew credit (web/js/ui/crew-credit.js): round avatar the height of the text, then the linked line ---------- */
.crew-credit { display: inline-flex; align-items: center; gap: .45em; min-height: var(--tap); color: var(--text-2); font-weight: 700; text-decoration: none; }
.crew-credit:hover, .crew-credit:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.crew-credit > span { max-width: 29ch; text-wrap: balance; text-align: left; } /* two even lines, avatar snug beside them */
.crew-credit .crew-av { width: 1.5em; height: 1.5em; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1.5px var(--line-strong); }
