.live-screen { display: block; width: 100%; }

.lv-rail { grid-area: filters; }
/* The rail sits in this wrapper rather than being the grid item itself, so hiding the rail is
   not enough — the empty wrapper would keep its track and its gap. */
@media (min-width: 641px) {
  [data-rail-layout].is-rail-collapsed .lv-rail { display: none; }
}
.lv-main { grid-area: main; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.lv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}
.lv-card {
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.lv-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.lv-board { position: relative; }
.lv-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 100px;
  background: var(--porphyry); color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.lv-card.is-mine { border-color: var(--bronze); }
.lv-mine {
  position: absolute; top: 8px; right: 8px;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 100px;
  background: var(--bronze-gradient); color: var(--on-bronze);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.lv-mini { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.lv-mini.is-blank { background: var(--bg-2); }
.lv-mini-grid {
  display: grid;
  grid-template-columns: repeat(var(--lv-n, 16), 1fr);
  width: 100%; height: 100%;
}
/* box-shadow halo fills 1px pixel-rounding gaps between cells. */
.lv-mini-grid i { display: block; aspect-ratio: 1; box-shadow: 0 0 0 1px currentColor; }
.lv-piece {
  position: absolute;
  width: calc(100% / var(--lv-n, 16) * 0.78);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.lv-piece-p1 { background: radial-gradient(circle at 35% 30%, var(--p1-2), var(--p1)); }
.lv-piece-p2 { background: radial-gradient(circle at 35% 30%, var(--p2-2), var(--p2)); }
.lv-piece-strat { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

.lv-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.lv-seat { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lv-name {
  font-weight: 600; color: var(--ink); font-size: 0.88rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lv-elo { font-size: 0.76rem; color: var(--ink-3); }
.lv-vs { font-size: 0.68rem; color: var(--ink-4); }
.lv-bot {
  margin-left: 5px; font-size: 0.58rem; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  background: color-mix(in srgb, var(--lapis-2) 18%, transparent); color: var(--lapis-2);
}

.lv-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 6px; font-size: 0.72rem; color: var(--ink-3);
}
.lv-meta-2 { margin-top: 2px; justify-content: space-between; }
.lv-fmt {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--ink-2);
}
.lv-fmt-campaign { color: var(--lapis-2); border-color: color-mix(in srgb, var(--lapis-2) 40%, transparent); }
.lv-fmt-skirmish { color: var(--laurel-2); border-color: color-mix(in srgb, var(--laurel-2) 40%, transparent); }
.lv-fmt-agon     { color: var(--bronze-2); border-color: color-mix(in srgb, var(--bronze-2) 40%, transparent); }
.lv-fmt-bullet   { color: var(--porphyry-2); border-color: color-mix(in srgb, var(--porphyry-2) 45%, transparent); }
.lv-stake { margin-left: auto; }
.lv-views { font-variant-numeric: tabular-nums; }
.lv-watch { width: 100%; margin-top: 10px; justify-content: center; padding: 8px 12px; font-size: 0.85rem; }

.lv-more { display: flex; justify-content: center; padding: 6px 0 4px; }
.lv-more .btn { min-width: 14em; justify-content: center; }

/* The strip above the board. The seat names it used to carry are gone — the player bar already
   names both sides — so it holds the watching count and the controls. */
.spectator-bar {
  /* Count on the left, controls on the right; with no count the controls stay right. */
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  width: 100%; box-sizing: border-box;
  padding: 9px 14px; margin-bottom: 8px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-m);
}
.spec-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-left: auto; }
.spec-count { font-size: 0.78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.spec-right .btn,
.spec-right .btn-rotate-board {
  height: 32px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
}
.spec-right .rotate-board-control { margin: 0; }
.spec-right .btn-rotate-board { width: 34px; padding: 0; }
.spec-right .btn-rotate-board svg { width: 16px; height: 16px; }
/* Icon-only at EVERY width, the phone form kept everywhere: the bar has to hold two usernames
   of unknown length, and the labels are what pushed them off it. title + aria-label carry the word. */
.spec-btn { gap: 6px; width: 34px; padding: 0; }
/* Every mark on this strip is a stroked svg on currentColor, so the whole row wears one ink —
   the watching count's, which is the only other thing on it. Two classes, or the base
   .btn:hover:not(…) at (0,3,0) repaints them on hover. An emoji glyph cannot take `color` at
   all, which is why the link and exit marks are UI_ICONS svgs. */
.btn.spec-btn {
  color: var(--ink-3);
  border-color: var(--border-strong);
}
.btn.spec-btn:hover:not(:disabled) {
  color: var(--ink);
  background: var(--bg-hover);
  border-color: var(--bronze);
}
.spec-btn-ico { display: inline-flex; font-size: 0.95rem; line-height: 1; }
.spec-btn-ico svg { width: 16px; height: 16px; }
.spec-btn-label { display: none; }

@media (max-width: 640px) {
  .lv-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
}
