/* CXO, K1 edition: one stylesheet for every view.
   K1's identity, from k1.com and the 2025 Year in Review: the brick mark with
   its white peak, night-indigo sky with lilac-to-coral alpenglow, wide heavy
   caps (Archivo standing in for K1's licensed Interstate), tracked-caps
   labels. Fonts and art are self-hosted so a flaky venue network can't leave
   the projector half-styled. */
@font-face { font-family: 'Archivo K1'; src: url('/fonts/archivo-wdth.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Host Grotesk'; src: url('/fonts/host-grotesk.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }

:root {
  /* K1 brand colors (k1.com): near-black ground, K1 obsidian / graphite
     surfaces, K1 light grey text, K1 reds. Brick #6f1100 and #8e1b11 are the
     logo, #a30000 is K1 cherry; --volt is one lifted step of that red so it
     still reads on near-black (big numerals, borders, lit peaks). Small accent
     text stays white: K1's reds are too dark to read small on black. */
  --ink: #111113;
  --ink-1: #1d1d1f;
  --ink-2: #252528;
  --ink-3: #2e2e32;
  --line: #333338;
  --line-2: #3c3c41;
  --paper: #f5f5f7;
  --mute: #a1a1a6;
  --dim: #6e6e73;
  --brick: #6f1100;
  --brick-2: #8e1b11;
  --cherry: #a30000;
  --volt: #c8261a;
  --volt-ink: #ffffff;
  --volt-soft: rgba(200, 38, 26, 0.16);
  --amber: #ffc145;
  --red: #ff5c5c; /* errors */
  --glow: linear-gradient(90deg, var(--brick), var(--volt)); /* progress + score lines */
  --alpen: linear-gradient(180deg, #e04a3c 0%, var(--cherry) 55%, var(--brick) 100%); /* lit peaks */
  --display: 'Archivo K1', 'Arial Black', 'Segoe UI', sans-serif;
  --sans: 'Host Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --caps: 'Archivo K1', 'Segoe UI', sans-serif;
  --r: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --surface-rgb: 29 29 31;
  --surface2-rgb: 37 37 40;
  --scrim: rgba(8, 8, 10, 0.72);
  --snow: #ffffff;
  --sel-glow: drop-shadow(0 0 14px rgba(200, 38, 26, 0.55));
  --qr-bg: #f5f5f7;
  --grain: 0.05;
  --range-img: url('/img/range-grey-1600.webp');
  --range-opacity: 0.32;
  --sky:
    radial-gradient(1.2px 1.2px at 23px 41px, rgba(255, 255, 255, 0.55), transparent 100%) 0 0 / 173px 173px,
    radial-gradient(1px 1px at 91px 127px, rgba(255, 255, 255, 0.4), transparent 100%) 0 0 / 241px 241px,
    radial-gradient(1.4px 1.4px at 151px 63px, rgba(255, 255, 255, 0.35), transparent 100%) 0 0 / 307px 307px,
    radial-gradient(1100px 520px at 12% -14%, rgba(245, 245, 247, 0.06), transparent 62%),
    radial-gradient(1400px 620px at 60% 118%, rgba(163, 0, 0, 0.24), transparent 62%),
    linear-gradient(180deg, #0e0e10 0%, #121214 58%, #18181b 100%);
  color-scheme: dark;
}

/* Light: k1.com's own look. White and K1 grey, K1 near-black text, and K1
   brick red used the way it was designed (dark red on white). The host picks
   the theme per session; every phone and the projector follow. */
:root[data-theme='light'] {
  --ink: #f5f5f7;
  --ink-1: #ffffff;
  --ink-2: #f0f0f2;
  --ink-3: #e5e5ea;
  --line: #e3e3e8;
  --line-2: #d2d2d7;
  --paper: #1d1d1f;
  --mute: #6e6e73;
  --dim: #8e8e93;
  --volt: #6f1100;
  --volt-ink: #ffffff;
  --volt-soft: rgba(111, 17, 0, 0.07);
  --red: #d70015;
  --glow: linear-gradient(90deg, var(--brick), var(--cherry));
  --alpen: linear-gradient(180deg, #c8261a 0%, var(--cherry) 50%, var(--brick) 100%);
  --surface-rgb: 255 255 255;
  --surface2-rgb: 255 255 255;
  --scrim: rgba(29, 29, 31, 0.32);
  --snow: #ffffff;
  --sel-glow: drop-shadow(0 0 0.6px rgba(29, 29, 31, 0.55)) drop-shadow(0 8px 14px rgba(111, 17, 0, 0.3));
  --qr-bg: #ffffff;
  --grain: 0.025;
  --range-img: url('/img/range-ink-1600.webp');
  --range-opacity: 0.2;
  --sky:
    radial-gradient(1100px 520px at 12% -14%, rgba(255, 255, 255, 0.9), transparent 62%),
    radial-gradient(1400px 620px at 60% 118%, rgba(111, 17, 0, 0.07), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #f7f7f9 60%, #efeff2 100%);
  color-scheme: light;
}
:root[data-theme='light'] .qr-card { box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px -30px rgba(29, 29, 31, 0.28); }
:root[data-theme='light'] .d-art .summit { opacity: 0.72; }
:root[data-theme='light'] .display:has(#d-board:not([hidden])) .d-art .summit { opacity: 0.4; }
:root[data-theme='light'] .phone-summit { opacity: 0.6; }
:root[data-theme='light'] .card { box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04), 0 8px 30px -12px rgba(29, 29, 31, 0.12); }
:root[data-theme='light'] .toast { box-shadow: 0 10px 40px rgba(29, 29, 31, 0.25); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  font-stretch: 112%; /* widens Archivo everywhere it's used; Host Grotesk has no width axis */
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* Night sky: faint stars, a lilac haze above, alpenglow along the horizon. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--sky);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
::selection { background: var(--volt); color: var(--volt-ink); }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

/* K1 art layers: the summit (cut-out photo) and the wireframe range. */
.range {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42vh;
  pointer-events: none;
  background: var(--range-img) center bottom / cover no-repeat;
  opacity: var(--range-opacity);
  mask-image: linear-gradient(to top, transparent 0%, #000 30%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 30%, #000 70%, transparent 100%);
}
.summit {
  position: absolute;
  pointer-events: none;
  user-select: none;
  mask-image: linear-gradient(to top, transparent 0%, #000 34%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 34%);
  filter: saturate(0.85);
}

/* ---------------------------------------------------------------- atoms */

.label {
  font-family: var(--caps);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}
.label b { color: var(--paper); font-weight: 700; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-decoration: none;
  line-height: 1;
}
.mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: block;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92); /* K1 sets the mark with a white keyline on dark photos */
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--volt);
  flex: none;
  margin-left: -4px;
  animation: beat 2s var(--ease) infinite;
}
[data-conn='connecting'] .dot { background: var(--amber); animation: blink 0.9s steps(2) infinite; }
[data-conn='offline'] .dot { background: var(--red); animation: none; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(200, 38, 26, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(200, 38, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 38, 26, 0); }
}
@keyframes blink { 50% { opacity: 0.25; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: rgb(var(--surface2-rgb) / 0.7);
  font-family: var(--caps);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
  user-select: none;
}
.btn:hover { border-color: var(--mute); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.volt { background: var(--cherry); border-color: var(--volt); color: var(--volt-ink); }
.btn.volt:hover { background: var(--volt); }
.btn.ghost { background: transparent; }
.btn.small { height: 34px; padding: 0 12px; font-size: 11px; border-radius: 8px; letter-spacing: 0.06em; font-stretch: 100%; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn .kbd {
  font-size: 10px;
  opacity: 0.55;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0;
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: rgb(var(--surface-rgb) / 0.8);
  font-size: 17px;
  transition: border-color 0.15s, background 0.15s;
}
textarea.input { height: auto; min-height: 52px; padding: 14px 16px; resize: vertical; line-height: 1.4; }
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--volt); background: var(--ink-2); }

.card {
  background: rgb(var(--surface-rgb) / 0.84);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 900;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s var(--ease);
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.toast-action { font-family: var(--caps); font-weight: 800; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: underline; color: inherit; flex: none; }
.toast.bad { background: var(--red); color: #1a0000; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--volt);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  text-align: center;
  background: var(--amber);
  color: #1d1200;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
}
[data-conn='connecting'] .banner.show, [data-conn='offline'] .banner.show {
  transform: none;
  visibility: visible;
  transition: transform 0.3s var(--ease) 1.2s, visibility 0s linear 1.2s; /* blips under 1.2s never flash it */
}
[data-conn='offline'] .banner { background: var(--red); }

/* Histogram, used on the host's category cards */
.hist {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  align-items: end;
  height: 120px;
}
.hcol { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; }
.hbar {
  position: relative;
  flex: none;
  height: calc((100% - 20px) * var(--h, 0)); /* the 1-5 label + gap below take 20px */
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: var(--alpen);
  transition: height 0.45s var(--ease);
}
.hbar::after {
  content: attr(data-v);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--caps);
  font-weight: 600;
  font-size: 11px;
  color: var(--paper);
}
.hcol.zero .hbar { background: var(--ink-3); }
.hcol.zero .hbar::after { color: var(--dim); }
.hn { font-family: var(--caps); font-weight: 600; font-size: 10px; line-height: 14px; color: var(--mute); text-align: center; }

/* ---------------------------------------------------------------- landing */

.landing {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 0;
  max-width: 1160px;
  margin: 0 auto;
}
.landing header { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.landing header a.label { text-decoration: none; }
.landing header a.label:hover { color: var(--paper); }
.hero { position: relative; z-index: 2; margin-top: clamp(48px, 12vh, 140px); max-width: 620px; }
.kicker { margin-bottom: 18px; animation: rise 0.7s var(--ease) both; }
.mega {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(44px, 9vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  animation: rise 0.7s var(--ease) both;
}
.mega em { font-style: normal; color: var(--volt); }
.hero p.lede { margin-top: 22px; color: var(--mute); font-size: 18px; max-width: 440px; animation: rise 0.7s 0.08s var(--ease) both; }
.join-form { margin-top: 36px; display: flex; gap: 10px; max-width: 480px; animation: rise 0.7s 0.16s var(--ease) both; }
.code-input {
  flex: 1;
  min-width: 0;
  height: 64px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.16em;
  text-align: center;
}
.join-form .btn { height: 64px; padding: 0 28px; font-size: 14px; }
.hosted { margin-top: 40px; max-width: 480px; animation: rise 0.7s 0.24s var(--ease) both; }
.hosted ul { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.hosted a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgb(var(--surface-rgb) / 0.6);
  text-decoration: none;
  transition: border-color 0.15s;
}
.hosted a:hover { border-color: var(--volt); }
.hosted a span:last-child { font-family: var(--caps); font-weight: 600; color: var(--mute); font-size: 13px; letter-spacing: 0.1em; }
.landing .summit {
  position: fixed;
  right: -6vw;
  bottom: 0;
  width: min(1180px, 112vw);
  z-index: 1;
  opacity: 0.92;
  animation: summit-in 1.6s var(--ease) both;
  /* the photo's snow runs to its own edge: fade the bottom and the left side into the sky */
  mask-image: linear-gradient(to top, transparent 0%, #000 34%), linear-gradient(to right, transparent 0%, #000 26%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 34%), linear-gradient(to right, transparent 0%, #000 26%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}
@keyframes summit-in { from { opacity: 0; transform: translateY(40px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 640px) {
  .landing .summit { opacity: 0.45; right: -20vw; width: 150vw; }
}

/* ---------------------------------------------------------------- participant */

.play {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px max(24px, env(safe-area-inset-bottom));
}
body:has(.play) .range { opacity: 0.18; } /* keep the wireframe behind the voting rows quiet */
.phone-summit {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 150vw;
  max-width: 900px;
  transform: translateX(-50%);
  opacity: 0.4;
  transition: opacity 0.5s var(--ease);
}
body:has(#v-live:not([hidden])) .phone-summit,
body:has(#v-board:not([hidden])) .phone-summit { opacity: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  flex: none;
  padding-top: env(safe-area-inset-top);
}
.topbar .who {
  font-family: var(--caps);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar button.who:hover { color: var(--paper); }
.view { flex: 1; display: flex; flex-direction: column; }
.center { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-bottom: 8vh; }
.center.middle { align-items: center; text-align: center; }

.join-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.join-form-col { display: grid; gap: 10px; margin-top: 10px; }
.join-form-col .btn { height: 56px; font-size: 14px; }

/* Lobby: the K1 peak with a slow pulse of alpenglow behind it */
.rings { position: relative; width: 120px; height: 120px; margin-bottom: 16px; }
.rings i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--volt);
  animation: ring 2.4s var(--ease) infinite;
  opacity: 0;
}
.rings i:nth-child(2) { animation-delay: 0.8s; }
.rings i:nth-child(3) { animation-delay: 1.6s; }
.rings b {
  position: absolute;
  inset: 36px;
  background: url('/img/k1-mark.svg') center / cover;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92), 0 0 40px rgba(200, 38, 26, 0.35);
}
@keyframes ring { 0% { transform: scale(0.35); opacity: 0.9; } 100% { transform: scale(1); opacity: 0; } }
.lobby-big { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 36px; line-height: 1; text-transform: uppercase; }
.muted { color: var(--mute); }

.slide { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 12px; }
.slide.enter-r { animation: in-r 0.42s var(--ease); }
.slide.enter-l { animation: in-l 0.42s var(--ease); }
@keyframes in-r { from { opacity: 0; transform: translateX(28px); } }
@keyframes in-l { from { opacity: 0; transform: translateX(-28px); } }

.p-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(24px, 7vw, 36px);
  line-height: 1.02;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  margin-top: 8px;
}
.p-presenter { color: var(--mute); font-size: 16px; margin-top: -6px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.status[data-s='saved'] { color: var(--paper); }
.status[data-s='saved']::before { background: var(--volt); }
.status[data-s='partial'] { color: var(--paper); }
.status[data-s='partial']::before { background: var(--volt); }
.status[data-s='sending']::before { background: var(--amber); animation: blink 0.6s steps(2) infinite; }
.status[data-s='queued'] { color: var(--amber); }
.status[data-s='queued']::before { background: var(--amber); }
.status[data-s='closed']::before { background: var(--dim); }

/* Three stacked rows, each a range of five peaks climbing to the summit */
.ratings { display: grid; margin-top: -6px; }
.rating { display: grid; gap: 8px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.rating:first-child { border-top: 1px solid var(--line); }
.rating-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.rating-label { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 17px; line-height: 1; text-transform: uppercase; letter-spacing: 0.04em; }
.rating-hint { color: var(--mute); font-size: 13px; margin-top: 5px; }
.rating-side { text-align: right; flex: none; }
.rating-val { display: inline-flex; align-items: flex-end; gap: 3px; font-family: var(--display); font-weight: 800; line-height: 0.85; }
.rating-val b { font-size: 34px; font-stretch: 125%; color: var(--volt); font-weight: 800; }
.rating-val small { font-size: 13px; color: var(--dim); padding-bottom: 2px; }
.rating-val.empty b { color: var(--ink-3); }
.rating-val b.bump { animation: bump 0.28s var(--ease); display: inline-block; }
@keyframes bump { 40% { transform: scale(1.12); } }
.rating-room { font-family: var(--caps); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); margin-top: 6px; }

.meter5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  height: clamp(78px, 10.4vh, 108px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.meter5 .col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; padding: 0; transition: filter 0.2s; }
/* Each step is a peak, shaped after the K1 mark: a ridge climbing to a
   summit left of centre, then a long slope down to the right. */
.meter5 .bar {
  display: block;
  flex: none;
  height: calc((100% - 24px) * (0.34 + var(--i) * 0.165)); /* the number + gap below take 24px */
  clip-path: polygon(0% 100%, 0% 64%, 16% 46%, 30% 34%, 44% 0%, 54% 7%, 72% 32%, 100% 60%, 100% 100%);
  background: linear-gradient(180deg, var(--line-2) 0%, var(--ink-2) 100%);
  transition: background 0.18s var(--ease) calc(var(--i) * 18ms), transform 0.16s var(--ease);
  transform-origin: bottom;
}
.meter5 .n { font-family: var(--caps); font-weight: 700; font-size: 12px; line-height: 18px; color: var(--dim); text-align: center; transition: color 0.15s; }
.meter5 .col.on .bar { background: var(--alpen); }
.meter5 .col.on .n { color: var(--paper); }
/* The chosen peak gets a snowcap and an alpenglow halo. */
.meter5 .col.sel .bar { background: linear-gradient(180deg, var(--snow) 0%, var(--snow) 17%, #e04a3c 30%, var(--cherry) 68%, var(--brick) 100%); transform: scaleY(1.04); }
.meter5 .col.sel { filter: var(--sel-glow); }
.meter5 .col.sel .n { color: var(--paper); }
.ratings.closed .meter5 { pointer-events: none; }
.ratings.closed .col .bar { opacity: 0.55; }
.ratings.closed .col.on .bar { background: linear-gradient(180deg, var(--mute), var(--dim)); }
.ratings.closed .col.sel { filter: none; }
.ratings.closed .rating-val b { color: var(--mute); }

.room-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.room-line .label b { font-size: 13px; letter-spacing: 0.06em; }

.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { flex: 1; min-height: 52px; max-height: 140px; resize: none; }
.comment-form .btn { height: 52px; width: 52px; padding: 0; flex: none; font-size: 20px; letter-spacing: 0; }
.charcount { font-family: var(--caps); font-weight: 600; font-size: 10px; letter-spacing: 0.1em; color: var(--dim); text-align: right; margin-top: -10px; }
.mine { list-style: none; display: grid; gap: 6px; }
.mine li {
  font-size: 14px;
  color: var(--mute);
  padding: 10px 12px;
  border-left: 2px solid var(--volt);
  background: rgb(var(--surface-rgb) / 0.8);
  border-radius: 0 8px 8px 0;
  animation: rise 0.3s var(--ease);
  overflow-wrap: anywhere;
}

.board-list { list-style: none; display: grid; gap: 8px; margin-top: 18px; }
.board-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(var(--surface-rgb) / 0.84);
  animation: rise 0.45s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms);
}
.board-row.top { border-color: var(--volt); background: linear-gradient(90deg, var(--volt-soft), rgb(var(--surface-rgb) / 0.84) 70%); }
.board-row .rank { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 20px; line-height: 1; color: var(--mute); }
/* The winner's rank sits in the K1 brick square. */
.board-row.top .rank { width: 40px; height: 40px; display: grid; place-items: center; background: var(--brick); color: #fff; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92); font-size: 17px; }
.board-row .t { min-width: 0; }
.board-row .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .t small { display: block; color: var(--mute); font-size: 13px; }
.board-row .v { text-align: right; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 22px; line-height: 1; }
.board-row.top .v { color: var(--volt); }
.board-row .v small { display: block; font-family: var(--caps); font-weight: 600; font-stretch: 112%; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); margin-top: 5px; }

/* ---------------------------------------------------------------- host */

.host-create { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 24px 16px 60px; }
.host-create .center { min-height: calc(100dvh - 100px); }

.dash {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr) 340px;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 14px;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
.dash-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 6px 4px 4px;
}
.dash-title {
  flex: 1;
  min-width: 200px;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 8px;
  height: 40px;
}
.dash-title:hover { border-color: var(--line); }
.dash-title:focus { outline: none; border-color: var(--volt); }
.joincode { display: flex; align-items: baseline; gap: 10px; }
.joincode b { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 22px; letter-spacing: 0.1em; color: var(--volt); }
.online { display: flex; gap: 16px; }
.online span { font-family: var(--caps); font-weight: 600; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.online b { color: var(--paper); font-weight: 800; font-size: 17px; margin-right: 5px; letter-spacing: 0; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.plist { list-style: none; display: grid; gap: 4px; align-content: start; }
.prow {
  display: grid;
  grid-template-columns: 22px 22px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px 8px 2px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.prow.editing { display: block; padding: 0; }
.prow.dragging { background: var(--ink-2); border-color: var(--volt); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.55); position: relative; z-index: 2; }
.prow.added { animation: added 1.4s var(--ease); }
@keyframes added { 0%, 30% { background: var(--volt-soft); border-color: var(--volt); } }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.handle {
  width: 22px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--dim);
  line-height: 0;
  cursor: grab;
  touch-action: none;
}
.handle:hover, .handle:focus-visible { color: var(--paper); background: var(--ink-3); }
.ptext { min-width: 0; cursor: default; }
.prow:hover { background: var(--ink-2); }
.prow.live { border-color: var(--volt); background: var(--volt-soft); }
.pidx { font-family: var(--caps); font-weight: 700; font-size: 11px; color: var(--dim); }
.prow.live .pidx { color: var(--paper); }
.ptext b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptext small { display: block; color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip { font-family: var(--caps); font-weight: 600; font-size: 11px; color: var(--mute); text-align: right; white-space: nowrap; }
.pchip b { color: var(--paper); font-weight: 800; }
.pact { display: flex; align-items: center; gap: 2px; opacity: 0.6; transition: opacity 0.15s; }
.prow:hover .pact, .prow:focus-within .pact, .prow.live .pact { opacity: 1; }
.pact .go { color: var(--volt); }
.pact .go:hover { background: var(--volt); color: var(--volt-ink); }
.live-tag {
  font-family: var(--caps);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--volt-ink);
  background: var(--volt);
  padding: 4px 8px;
  border-radius: 999px;
  margin-right: 2px;
}
.pact button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--mute);
  font-size: 14px;
  display: grid;
  place-items: center;
}
.pact button:hover { background: var(--ink-1); color: var(--paper); }
.pact button.del:hover { color: var(--red); }
.pedit { display: grid; gap: 6px; padding: 8px; }
.pedit .input { height: 40px; font-size: 14px; }
.pedit div { display: flex; gap: 6px; justify-content: flex-end; }
.quick-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.quick-add #add-title { grid-column: 1 / -1; }
.quick-add .input { height: 42px; font-size: 14px; }
.quick-add .btn { height: 42px; padding: 0 18px; }
.plist-hint { font-size: 12px; color: var(--dim); line-height: 1.5; }
.plist-hint b { color: var(--volt); font-weight: 700; }
.linkish { color: var(--volt); text-decoration: underline; font-weight: 600; padding: 0; }

/* paste-a-list window */
.modal.paste { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.modal textarea.paste-input { min-height: 190px; font-size: 14px; resize: vertical; white-space: pre; tab-size: 18; }
.paste-summary { color: var(--paper); }
.paste-preview { list-style: none; display: grid; gap: 2px; max-height: 240px; overflow-y: auto; }
.paste-preview:empty { display: none; }
.paste-preview li { display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1fr) 96px; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 6px; background: var(--ink-2); font-size: 14px; }
.paste-preview li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-preview li span:not(.pidx) { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-preview li .none { color: var(--dim); font-style: italic; }
.paste-preview li em { text-align: right; white-space: nowrap; font-style: normal; font-family: var(--caps); font-weight: 700; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.empty-note { color: var(--mute); font-size: 14px; padding: 14px 6px; line-height: 1.5; }
.empty-note b { color: var(--paper); font-weight: 600; }

.live-panel { padding: 22px 24px; gap: 18px; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.badge {
  font-family: var(--caps);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--mute);
}
.badge.on { border-color: var(--volt); color: var(--paper); background: var(--volt-soft); }
.badge.off { border-color: var(--red); color: var(--red); }
.live-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(26px, 2.9vw, 50px);
  line-height: 1.02;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.live-title.idle { color: var(--dim); }
.live-presenter { color: var(--mute); font-size: 17px; margin-top: -8px; }
.navrow { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.navrow .btn { height: 64px; font-size: 15px; letter-spacing: 0.16em; }
.stats { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 18px 32px; align-items: end; padding: 18px 0 4px; border-top: 1px solid var(--line); }
.stat .big { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 54px; line-height: 0.9; margin-top: 10px; }
.stat .big.volt { color: var(--volt); }
.stat .sub { font-family: var(--caps); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); margin-top: 8px; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.tog {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.tog input { appearance: none; -webkit-appearance: none; width: 30px; height: 18px; border-radius: 999px; background: var(--ink-3); position: relative; transition: background 0.18s; cursor: pointer; flex: none; }
.tog input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--mute); transition: transform 0.18s var(--ease), background 0.18s; }
.tog input:checked { background: var(--cherry); }
.tog input:checked::after { transform: translateX(12px); background: var(--volt-ink); }
.tog:has(input:checked) { border-color: var(--volt); }
.live-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.clist { list-style: none; display: grid; gap: 8px; align-content: start; }
.citem {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
  animation: rise 0.3s var(--ease);
}
.citem header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.citem .cname { font-family: var(--caps); font-weight: 700; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .cmeta { display: flex; align-items: center; gap: 8px; font-family: var(--caps); font-weight: 600; font-size: 10px; color: var(--dim); flex: none; }
.citem p { font-size: 15px; overflow-wrap: anywhere; }
.citem.hidden { opacity: 0.45; }
.citem.hidden p { text-decoration: line-through; }
.citem .hide { font-family: var(--caps); font-weight: 700; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line-2); }
.citem .hide:hover { color: var(--paper); border-color: var(--mute); }
.citem .cfor { font-size: 11px; color: var(--dim); font-family: var(--caps); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; }
.seg button { font-family: var(--caps); font-weight: 700; font-size: 10px; font-stretch: 100%; letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 9px; border-radius: 6px; color: var(--mute); }
.seg button.on { background: var(--ink-3); color: var(--paper); }

.results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.results-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.results-table td:first-child { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 15px; color: var(--mute); width: 34px; }
.results-table tr:first-child td:first-child { color: var(--paper); }
.results-table td.num { text-align: right; font-family: var(--caps); font-weight: 700; font-size: 12px; font-stretch: 100%; white-space: nowrap; }
.results-table td.t b { display: block; font-weight: 600; }
.results-table td.t small { display: block; color: var(--mute); }

.side-stack { display: grid; grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; min-height: 0; }

.modal-bg { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 700; padding: 16px; }
.modal { width: min(520px, 100%); padding: 22px; display: grid; gap: 14px; }
.modal code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--ink-2); padding: 10px; border-radius: 8px; border: 1px solid var(--line); }

@media (min-width: 1101px) {
  .dash { height: 100dvh; }
  .dash > .panel, .side-stack { min-height: 0; overflow: hidden; }
}
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; grid-template-rows: none; }
  .side-stack { grid-template-rows: none; }
  .scroll { max-height: 60vh; }
  .live-panel { order: -1; }
  .dash-top { order: -2; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .crit-grid { grid-column: 1 / -1; }
}

.archive-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.archive-status { display: inline-flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--mute); line-height: 1.4; flex: 1; min-width: 160px; }
.archive-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; transform: translateY(-1px); }
.archive-status[data-s='ok'] { color: var(--paper); }
.archive-status[data-s='ok']::before { background: #34c759; }
.archive-status[data-s='error'] { color: var(--amber); }
.archive-status[data-s='error']::before { background: var(--amber); }

/* ---------------------------------------------------------------- display (projector) */

.display {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 3.2vh 3.6vw;
  overflow: hidden;
}
.display > * { position: relative; z-index: 1; }
.display > .d-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.display.idle-cursor, .display.idle-cursor * { cursor: none !important; }
.d-art .summit {
  left: 50%;
  bottom: 0;
  width: min(150vh, 92vw);
  transform: translateX(-50%);
  opacity: 0.5;
  transition: opacity 0.8s var(--ease);
  mask-image: linear-gradient(to top, transparent 0%, #000 34%), linear-gradient(to right, transparent 0%, #000 16%, #000 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 34%), linear-gradient(to right, transparent 0%, #000 16%, #000 84%, transparent 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}
.d-art .range { position: absolute; opacity: 0; transition: opacity 0.8s var(--ease); }
/* Join screen + results: the K1 summit. While presenting: the quieter wireframe range. */
.display:has(#d-live:not([hidden])) .d-art .summit { opacity: 0; }
.display:has(#d-live:not([hidden])) .d-art .range { opacity: 0.3; }
.display:has(#d-board:not([hidden])) .d-art .summit { opacity: 0.32; }
.d-top { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.d-top .wordmark { font-size: clamp(13px, 1.1vw, 22px); gap: clamp(10px, 0.9vw, 18px); }
.d-top .mark { width: clamp(28px, 2.3vw, 48px); height: clamp(28px, 2.3vw, 48px); }
.d-top .dot { width: 0.5vw; height: 0.5vw; min-width: 7px; min-height: 7px; }
.d-session { font-family: var(--caps); font-weight: 600; font-size: clamp(10px, 0.85vw, 17px); letter-spacing: 0.24em; text-transform: uppercase; color: var(--mute); }
.d-join { display: flex; align-items: center; gap: 1vw; font-family: var(--caps); font-weight: 600; font-size: clamp(11px, 0.95vw, 19px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.d-join b { color: var(--paper); font-weight: 800; }
.d-join b.code { color: var(--paper); letter-spacing: 0.14em; }
.d-stage { min-height: 0; position: relative; }
.d-stage > section { position: absolute; inset: 0; }
.d-label { font-family: var(--caps); font-weight: 600; font-size: clamp(10px, 0.9vw, 18px); letter-spacing: 0.26em; text-transform: uppercase; color: var(--mute); }

.d-lobby { display: grid; grid-template-columns: 1.25fr 1fr; gap: 4vw; align-items: center; }
.d-lobby h1 { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(34px, 4.8vw, 124px); line-height: 1; text-transform: uppercase; margin-top: 2vh; overflow-wrap: anywhere; }
.d-lobby .d-url { margin-top: 4.5vh; font-family: var(--display); font-weight: 600; font-size: clamp(15px, 1.6vw, 34px); letter-spacing: 0.02em; }
.d-lobby .d-url b { color: var(--volt); font-weight: 800; }
.d-lobby .d-code { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(44px, 6.4vw, 160px); line-height: 1; color: var(--volt); letter-spacing: 0.06em; margin-top: 1.2vh; }
.qr-card { background: var(--qr-bg); border-radius: 1.2vw; padding: 2.4vw; aspect-ratio: 1; width: min(32vw, 56vh); justify-self: end; display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6), 0 30px 120px -30px rgba(200, 38, 26, 0.45); animation: rise 0.8s var(--ease) both; }
.qr-card img { width: 100%; height: 100%; display: block; }
.names { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 0.6vw; max-height: 14vh; overflow: hidden; align-content: flex-end; }
.names span { font-family: var(--caps); font-weight: 700; font-size: clamp(10px, 0.85vw, 17px); letter-spacing: 0.1em; text-transform: uppercase; padding: 0.45vw 1vw; border-radius: 999px; border: 1px solid var(--line-2); background: rgb(var(--surface-rgb) / 0.7); color: var(--paper); animation: pop 0.4s var(--ease) both; }
.names span:first-child { border-color: var(--volt); background: var(--volt-soft); }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }

.d-live { display: grid; grid-template-columns: 1.45fr 1fr; gap: 4vw; align-items: center; }
.d-live.enter-r { animation: in-r 0.55s var(--ease); }
.d-live.enter-l { animation: in-l 0.55s var(--ease); }
.d-index { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(24px, 3vw, 72px); line-height: 1; margin-top: 1.6vh; color: var(--volt); }
.d-index span { color: var(--dim); font-size: 0.6em; margin-left: 0.2em; }
.d-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: calc(clamp(32px, 4.4vw, 112px) * var(--fit, 1));
  line-height: 1.02;
  text-transform: uppercase;
  margin-top: 2.2vh;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.d-presenter { font-size: clamp(16px, 1.7vw, 36px); color: var(--mute); margin-top: 2.6vh; }
.d-side { display: flex; flex-direction: column; gap: 3.2vh; }
.d-votes { display: flex; align-items: flex-end; gap: 1.2vw; }
.d-count { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(54px, 6.4vw, 168px); line-height: 0.85; }
.d-of { font-family: var(--caps); font-weight: 600; font-size: clamp(10px, 0.95vw, 19px); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); padding-bottom: 0.8vh; }
.d-progress { height: 0.9vh; min-height: 6px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.d-progress i { display: block; height: 100%; width: 0; background: var(--glow); border-radius: inherit; transition: width 0.6s var(--ease); }
.d-results { display: grid; gap: 2.8vh; }
.d-avg { display: flex; align-items: flex-end; gap: 1vw; }
.d-avg b { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(48px, 5.4vw, 142px); line-height: 0.85; color: var(--volt); }
.d-sealed {
  border: 1px dashed var(--line-2);
  border-radius: 1vw;
  padding: 3vh 2vw;
  font-family: var(--caps);
  font-weight: 600;
  font-size: clamp(10px, 0.9vw, 18px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  background: rgb(var(--surface-rgb) / 0.5);
}
.d-closed { color: var(--red); }

.d-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 2vw; min-height: 6vh; }
.d-ticker { display: flex; gap: 1vw; min-width: 0; flex: 1; justify-content: flex-end; overflow: hidden; }
.d-ticker div {
  max-width: 30vw;
  padding: 1.2vh 1.2vw;
  border-radius: 0.8vw;
  background: rgb(var(--surface2-rgb) / 0.88);
  border: 1px solid var(--line);
  font-size: clamp(13px, 1.1vw, 22px);
  animation: rise 0.4s var(--ease);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.d-ticker div b { font-family: var(--caps); font-weight: 700; color: var(--mute); font-size: 0.72em; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 0.7em; }
.d-mini { display: flex; align-items: center; gap: 1vw; flex: none; }
.d-mini .qr-mini { background: var(--qr-bg); border-radius: 0.4vw; padding: 0.5vw; width: 7vh; height: 7vh; min-width: 48px; min-height: 48px; }
.d-mini .qr-mini img { width: 100%; height: 100%; display: block; }
.d-mini span { font-family: var(--caps); font-weight: 600; font-size: clamp(10px, 0.95vw, 19px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.d-mini b { color: var(--paper); font-weight: 800; letter-spacing: 0.04em; text-transform: none; }

.d-board { display: flex; flex-direction: column; padding-top: 3vh; }
.d-board h1 { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(30px, 3.6vw, 92px); line-height: 1; text-transform: uppercase; margin-top: 1.4vh; }
.d-board ol { list-style: none; display: grid; gap: 1.1vh; margin-top: 3.4vh; flex: 1; align-content: start; min-height: 0; }
.d-row {
  display: grid;
  grid-template-columns: 5vw minmax(0, 1.3fr) minmax(0, 1fr) 7vw;
  align-items: center;
  gap: 1.6vw;
  padding: 1.1vh 1.4vw;
  border-radius: 0.8vw;
  background: rgb(var(--surface-rgb) / 0.86);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 260ms);
}
.d-row .rank { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(18px, 1.9vw, 46px); line-height: 1; color: var(--mute); }
.d-row .t b { display: block; font-weight: 600; font-size: clamp(15px, 1.5vw, 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-row .t small { display: block; color: var(--mute); font-size: clamp(11px, 1vw, 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-row .track { height: 1.4vh; min-height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.d-row .track i { display: block; height: 100%; background: var(--mute); border-radius: inherit; transform-origin: left; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i) * 260ms + 250ms); }
.d-row .v { text-align: right; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(18px, 2vw, 50px); line-height: 1; }
.d-row .v small { display: block; font-family: var(--caps); font-weight: 600; font-stretch: 112%; font-size: clamp(8px, 0.65vw, 13px); color: var(--mute); letter-spacing: 0.16em; text-transform: uppercase; margin-top: 0.6vh; }
.d-row.top { border-color: var(--volt); background: linear-gradient(90deg, var(--volt-soft), rgb(var(--surface-rgb) / 0.86) 70%); padding-top: 1.8vh; padding-bottom: 1.8vh; }
/* The winner's rank sits in the K1 brick square. */
.d-row.top .rank { width: clamp(38px, 3.4vw, 80px); height: clamp(38px, 3.4vw, 80px); display: grid; place-items: center; background: var(--brick); color: #fff; box-shadow: 0 0 0 0.12vw rgba(255, 255, 255, 0.92); font-size: clamp(16px, 1.5vw, 36px); }
.d-row.top .v { color: var(--volt); }
.d-row.top .track i { background: var(--glow); }
.d-row.top .t b { font-size: clamp(18px, 2vw, 44px); }
@keyframes grow { from { transform: scaleX(0); } }

.d-hint {
  position: fixed;
  left: 50%;
  bottom: 2vh;
  transform: translateX(-50%);
  font-family: var(--caps);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  transition: opacity 0.6s;
  z-index: 50;
}
.d-hint.gone { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------- rating categories */

/* phone leaderboard + host results: per-category line under the title */
.board-row .t small.subs, .results-table td.t small.subs { font-family: var(--caps); font-weight: 600; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }

/* host: one card per category */
.crit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; grid-column: 1 / -1; }
.crit { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 8px; display: grid; gap: 10px; min-width: 0; }
.crit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.crit-head .label { font-size: 10px; }
.crit-avg { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 24px; line-height: 1; color: var(--volt); }
.crit-grid .hist { height: 70px; gap: 6px; margin-top: 16px; }
.crit-grid .hbar::after { font-size: 10px; }

/* projector: a lilac-to-coral line per category, out of 5 */
.d-crits { display: grid; gap: 2.6vh; }
.d-crit { display: grid; grid-template-columns: minmax(0, 11vw) 1fr 5vw; align-items: center; gap: 1.2vw; }
.d-crit .track { height: 1.2vh; min-height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.d-crit .track i { display: block; height: 100%; width: 0; background: var(--glow); border-radius: inherit; transition: width 0.6s var(--ease); }
.d-crit b { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(18px, 1.9vw, 48px); line-height: 1; text-align: right; }

/* projector leaderboard: three thin category lines per row */
.d-row .subs { display: grid; gap: 0.6vh; }
.d-row .sub { display: grid; grid-template-columns: 3.8vw 1fr 2.8vw; align-items: center; gap: 0.8vw; }
.d-row .sub .track { height: 0.7vh; min-height: 4px; }
.sub-l { font-family: var(--caps); font-weight: 600; font-size: clamp(8px, 0.68vw, 14px); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.sub-v { font-family: var(--caps); font-weight: 700; font-size: clamp(9px, 0.8vw, 16px); text-align: right; color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

