/* The wall's control bar: one form on the classic wall and in every room.
   The bar is a capsule of glass inside a lit edge. Its keys are round lights without boxes: a key wakes under the
   pointer, the play key is the one filled light, sound on is a lit ring, and the reconnect key keeps its turning
   ring and its red count. Choices (the collection, the two walls, the rooms) are capsules of their own. A room
   lends the bar its own colours through its --rm-* values; the classic wall uses the form's (holo.css).
   The bar stands at the top in every room and on the classic wall; no room moves it.
   Every rule carries an id in :not() so it outweighs the older layers of the classic wall and the rooms. */

body.broadcast-page {
  --cb-accent: var(--holo-accent); --cb-ink: var(--holo-ink); --cb-dim: var(--holo-dim); --cb-line: var(--holo-line);
  --cb-glass: color-mix(in srgb, var(--holo-space, #030a24) 72%, transparent); --cb-glow: var(--holo-blue, var(--holo-accent));
  --cb-on: var(--holo-on-accent, #02121d); --cb-font: var(--holo-font); --cb-red: #ff5d73;
  /* The icons' light: the room's own colour, brightened, flowing into a violet twin. */
  --ico-a: color-mix(in srgb, var(--cb-accent) 78%, #fff); --ico-b: color-mix(in oklab, var(--cb-accent) 16%, #a855ff);
}
html[data-room] body.broadcast-page {
  --cb-accent: var(--rm-accent); --cb-ink: var(--rm-ink); --cb-dim: var(--rm-dim); --cb-line: var(--rm-line);
  --cb-glass: var(--rm-glass); --cb-glow: var(--rm-glow); --cb-on: var(--rm-bg, #02121d); --cb-font: var(--rm-font, var(--holo-font));
}

/* ---------- The capsule ---------- */
html:root body.broadcast-page:not(#cb) .topbar.topbar {
  gap: 6px !important; padding: 6px !important; border: 1px solid transparent !important; border-radius: 28px !important;
  background:
    linear-gradient(var(--cb-glass), var(--cb-glass)) padding-box,
    linear-gradient(100deg, var(--ico-a) 0%, color-mix(in srgb, var(--ico-a) 18%, transparent) 30%,
      color-mix(in srgb, var(--ico-b) 18%, transparent) 70%, var(--ico-b) 100%) border-box !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: inset 0 1px 0 #ffffff1f, 0 18px 46px -24px #000, -18px 0 34px -20px var(--ico-a), 18px 0 34px -20px var(--ico-b) !important;
  color: var(--cb-ink);
}
html[data-room] body.broadcast-page:not(#cb) .topbar.topbar { height: 54px !important; }
html:not([data-room]) body.broadcast-page:not(#cb) .workspace .topbar.topbar { min-height: 54px; }
html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.topbar-lead, .topbar-actions, .audio-dock, .audio-controls) { gap: 4px !important; }

/* ---------- Round keys ---------- */
html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn {
  place-items: center; position: relative;
  width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important; background: transparent !important; color: var(--cb-ink) !important;
  box-shadow: none !important; opacity: 1; transition: background-color .2s ease, color .2s ease, box-shadow .25s ease, transform .15s ease;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn svg { width: 22px !important; height: 22px !important; stroke-width: 2; }
html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--cb-accent) 16%, transparent) !important; color: var(--cb-accent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cb-accent) 50%, transparent), 0 0 18px -4px var(--cb-accent) !important;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn:focus-visible { outline: 2px solid var(--cb-accent); outline-offset: 2px; }
html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn:active { transform: scale(.9); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn:disabled { opacity: .4; }
/* Play and pause: the one filled light of the bar. */
html:root body.broadcast-page:not(#cb) .topbar.topbar #pauseBtn {
  width: 44px !important; height: 44px !important; min-width: 44px !important;
  background: linear-gradient(135deg, var(--cb-accent), color-mix(in srgb, var(--cb-accent) 55%, var(--cb-glow))) !important;
  color: var(--cb-on) !important; box-shadow: inset 0 1px 0 #ffffff73, 0 0 22px -4px var(--cb-accent) !important;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar #pauseBtn:is(:hover, :focus-visible) { color: var(--cb-on) !important; filter: brightness(1.12); box-shadow: inset 0 1px 0 #ffffff73, 0 0 30px -2px var(--cb-accent) !important; }
/* Sound on: a lit ring. */
html:root body.broadcast-page:not(#cb) .topbar.topbar #muteBtn[aria-pressed=false] {
  background: color-mix(in srgb, var(--cb-accent) 20%, transparent) !important; color: var(--cb-accent) !important;
  box-shadow: inset 0 0 0 1.5px var(--cb-accent), 0 0 18px -5px var(--cb-accent) !important;
}
/* Reconnect keeps its turning ring while it works and its red count of offline screens. */
html:root body.broadcast-page:not(#cb) .topbar.topbar #goLiveBtn { overflow: visible; }
html:root body.broadcast-page:not(#cb) .topbar.topbar #goLiveBtn.has-offline { color: var(--cb-red) !important; box-shadow: inset 0 0 0 1.5px var(--cb-red), 0 0 16px -5px var(--cb-red) !important; }
html:root body.broadcast-page:not(#cb) .topbar.topbar #goLiveBtn .reconnect-badge {
  top: -3px !important; right: auto !important; inset-inline-end: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px !important;
  background: var(--cb-red) !important; color: #fff !important; font: 700 10.5px/18px var(--cb-font) !important; letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--cb-glass), 0 0 12px var(--cb-red) !important;
}

/* ---------- Capsule choices ---------- */
html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.collection-btn, .rm-bar-btn) {
  align-items: center; gap: 8px; height: 40px !important; min-height: 40px !important; padding: 0 14px !important;
  border: 1px solid color-mix(in srgb, var(--cb-ink) 14%, transparent) !important; border-radius: 999px !important;
  background: color-mix(in srgb, var(--cb-ink) 6%, transparent) !important; color: var(--cb-ink) !important; box-shadow: none !important;
  font: 600 13px/1 var(--cb-font) !important; letter-spacing: .02em !important; text-transform: none !important;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.collection-btn, .rm-bar-btn):is(:hover, :focus-visible, [aria-expanded=true]) {
  border-color: color-mix(in srgb, var(--cb-accent) 60%, transparent) !important; color: var(--cb-accent) !important;
  background: color-mix(in srgb, var(--cb-accent) 12%, transparent) !important; box-shadow: 0 0 16px -6px var(--cb-accent) !important;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.collection-btn, .rm-bar-btn) svg { width: 16px; height: 16px; color: var(--cb-accent); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .collection-btn > span[data-icon] svg { color: var(--cb-dim); }
/* The two walls: one capsule whose current side is filled. */
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tabs {
  display: inline-flex; gap: 2px !important; padding: 3px !important; border: 1px solid color-mix(in srgb, var(--cb-ink) 14%, transparent) !important;
  border-radius: 999px !important; background: color-mix(in srgb, var(--cb-ink) 6%, transparent) !important; box-shadow: none !important;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; min-height: 32px; padding: 0 14px !important; border: 0 !important;
  border-radius: 999px !important; background: transparent !important; color: var(--cb-dim) !important; box-shadow: none !important;
  font: 600 13px/1 var(--cb-font) !important; letter-spacing: .02em !important; text-transform: none !important; opacity: 1;
  transition: background-color .25s ease, color .2s ease, box-shadow .25s ease;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab:is(:hover, :focus-visible) { color: var(--cb-ink) !important; }
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab[aria-pressed=true] {
  background: linear-gradient(135deg, var(--cb-accent), color-mix(in srgb, var(--cb-accent) 55%, var(--cb-glow))) !important;
  color: var(--cb-on) !important; box-shadow: inset 0 1px 0 #ffffff66, 0 0 16px -5px var(--cb-accent) !important;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab[data-tab=live] { --dot: var(--holo-live); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab[data-tab=economy] { --dot: var(--holo-economy); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab-twitch { --dot: var(--holo-violet); text-decoration: none; }
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab .site-tab-dot {
  width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dot, var(--cb-accent));
  box-shadow: 0 0 8px var(--dot, var(--cb-accent)); opacity: 1; animation: none;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .site-tab[aria-pressed=true] .site-tab-dot { background: var(--cb-on); box-shadow: none; }

/* ---------- Dividers, volume and clock ---------- */
html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.rm-bar-sep, .dock-divider) {
  width: 1px !important; height: 24px !important; margin: 0 4px !important; flex: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--cb-ink) 30%, transparent), transparent) !important;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--cb-dim); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control input[type=range] {
  -webkit-appearance: none; appearance: none; width: 84px; height: 24px; margin: 0; background: none; cursor: pointer;
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--ico-a), var(--ico-b) var(--v, 70%), color-mix(in srgb, var(--cb-ink) 20%, transparent) var(--v, 70%));
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 2px solid #fff; border-radius: 50%; background: linear-gradient(135deg, var(--ico-a), var(--ico-b));
  box-shadow: 0 0 10px var(--ico-a), 0 0 16px color-mix(in srgb, var(--ico-b) 60%, transparent);
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--cb-ink) 20%, transparent); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--ico-a), var(--ico-b)); }
html:root body.broadcast-page:not(#cb) .topbar.topbar .volume-control input[type=range]::-moz-range-thumb {
  width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: linear-gradient(135deg, var(--ico-a), var(--ico-b)); box-shadow: 0 0 10px var(--ico-a), 0 0 16px color-mix(in srgb, var(--ico-b) 60%, transparent);
}
html:root body.broadcast-page:not(#cb) .topbar.topbar .utc-clock {
  margin: 0 6px; font: 600 12px/1 var(--cb-font); letter-spacing: .08em; color: var(--cb-dim) !important; font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.icon-btn, .collection-btn, .rm-bar-btn, .site-tab) { transition: none; }
  html:root body.broadcast-page:not(#cb) .topbar.topbar .icon-btn:active { transform: none; }
}
@media (forced-colors: active) {
  html:root body.broadcast-page:not(#cb) .topbar.topbar, html:root body.broadcast-page:not(#cb) .topbar.topbar :is(.icon-btn, .collection-btn, .rm-bar-btn, .site-tabs) { border: 1px solid CanvasText !important; }
}
/* Right-to-left pages are written in joined scripts: the bar's words are not spaced apart there. */
:root[dir=rtl] body.broadcast-page:not(#cb) .topbar.topbar :is(.collection-btn, .rm-bar-btn, .site-tab, .utc-clock) { letter-spacing: 0 !important; }

/* ---------- Neon icons ----------
   The shared gradient #ico-tone (app.js) draws the icons of the bar, the desk links and the screens' captions: the
   line runs from the room's light into its violet twin and glows. The play key and a filled choice keep their dark
   icon on their own light. */
.ico-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
#ico-tone stop:first-child { stop-color: var(--ico-a, #8ff8ff); }
#ico-tone stop:last-child { stop-color: var(--ico-b, #9d6bff); }
html:root body.broadcast-page:not(#cb) :is(.topbar.topbar .icon-btn:not(#pauseBtn), .topbar.topbar .collection-btn, .topbar.topbar .rm-bar-btn, .sidebar-actions span[data-icon], #wall .tile-btn) svg {
  overflow: visible; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ico-a) 80%, transparent)) drop-shadow(0 0 9px color-mix(in srgb, var(--ico-b) 55%, transparent));
  transition: filter .25s ease;
}
html:root body.broadcast-page:not(#cb) :is(.topbar.topbar .icon-btn:not(#pauseBtn), .topbar.topbar .collection-btn, .topbar.topbar .rm-bar-btn, .sidebar-actions span[data-icon], #wall .tile-btn) svg :not([stroke="none"]) { stroke: url(#ico-tone); }
html:root body.broadcast-page:not(#cb) :is(.topbar.topbar .icon-btn:not(#pauseBtn), .topbar.topbar .collection-btn, .topbar.topbar .rm-bar-btn, .sidebar-actions span[data-icon], #wall .tile-btn) svg [fill="currentColor"] { fill: url(#ico-tone); }
html:root body.broadcast-page:not(#cb) :is(.topbar.topbar .icon-btn:not(#pauseBtn), .topbar.topbar .collection-btn, .topbar.topbar .rm-bar-btn, #wall .tile-btn):is(:hover, :focus-visible) svg {
  filter: drop-shadow(0 0 5px var(--ico-a)) drop-shadow(0 0 14px color-mix(in srgb, var(--ico-b) 60%, transparent)) brightness(1.15);
}
/* An offline count turns the reconnect key's light red. */
html:root body.broadcast-page:not(#cb) .topbar.topbar #goLiveBtn.has-offline svg :not([stroke="none"]) { stroke: var(--cb-red); }
@media (forced-colors: active) {
  html:root body.broadcast-page:not(#cb) :is(.topbar.topbar, .sidebar-actions, #wall) svg { filter: none; }
  html:root body.broadcast-page:not(#cb) :is(.topbar.topbar, .sidebar-actions, #wall) svg :not([stroke="none"]) { stroke: currentColor; }
  html:root body.broadcast-page:not(#cb) :is(.topbar.topbar, .sidebar-actions, #wall) svg [fill="currentColor"] { fill: currentColor; }
}

/* A Twitch screen (app.js TwitchPlayer): Twitch's player where the screen is at least 400 by 300 pixels, the
   streamer's live picture where it is smaller; a press on the picture opens the screen full screen. */
.player-host .twitch-box { position: absolute; inset: 0; background: #0e0e10; }
.twitch-box .twitch-mount, .twitch-box .twitch-mount iframe { display: block; width: 100%; height: 100%; border: 0; }
.twitch-box .twitch-still { position: absolute; inset: 0; display: none; width: 100%; height: 100%; padding: 0; border: 0; background: #0e0e10; cursor: zoom-in; }
.twitch-box .twitch-still img { display: block; width: 100%; height: 100%; object-fit: cover; }
.twitch-box[data-fit=picture] .twitch-still { display: block; }
.twitch-box[data-fit=picture] .twitch-mount { display: none; }

/* The collection picker speaks of streamers on the Twitch tab and of broadcasters elsewhere. */
.twitch-only { display: none; }
body[data-section=twitch] .twitch-only { display: inline; }
body[data-section=twitch] .not-twitch { display: none; }

/* Twitch starts a player by itself only when nothing on the page is drawn over it. A screen's frame glow reaches
   past its edges onto its neighbours, and its caption bar starts at the picture's lower edge, so a screen that holds a
   Twitch player is drawn above the other screens and its player above its own caption bar. */
body.broadcast-page:not(#tw) #wall > .tile:has(.twitch-box[data-fit=player]) { z-index: 3 !important; }
body.broadcast-page:not(#tw) .tile-media > .player-host:has(.twitch-box[data-fit=player]) { z-index: 2 !important; }
/* The screens' frame glow reaches about 26 px past their edges, onto neighbouring screens; while Twitch players are
   on the wall it reaches about 6 px, so no screen covers another. The frame line stays. */
html[data-room] body.broadcast-page:has(.twitch-box[data-fit=player]):not(#tw) #wall > .tile::before { box-shadow: 0 0 0 1px var(--rm-line), 0 0 10px -4px var(--rm-glow) !important; }
html[data-room] body.broadcast-page:has(.twitch-box[data-fit=player]):not(#tw) #wall > .tile.listening::before { box-shadow: 0 0 0 1px var(--rm-accent), 0 0 10px -4px var(--rm-accent) !important; }
html[data-room] body.broadcast-page:has(.twitch-box[data-fit=player]):not(#tw) #wall > .tile.rm-cursor::before { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rm-accent) !important; }
/* Icon glows (two drop shadows) reach about 35 px; inside the screens they rest while Twitch players are on the wall. */
html body.broadcast-page:has(.twitch-box[data-fit=player]):not(#tw) #wall .tile :is(svg, svg *) { filter: none !important; }
/* The control bar's shadow and glows reach below it onto the room's top screens; while a Twitch player is on the
   wall, the bar keeps only its inner edge and its buttons their rings. */
html:root body.broadcast-page:has(.twitch-box[data-fit=player]):not(#cb) .topbar.topbar { box-shadow: inset 0 1px 0 #ffffff1f !important; }
html:root body.broadcast-page:has(.twitch-box[data-fit=player]):not(#cb) .topbar.topbar :is(*, #pauseBtn, #goLiveBtn),
html:root body.broadcast-page:has(.twitch-box[data-fit=player]):not(#cb) .topbar.topbar :is(*, #pauseBtn, #goLiveBtn)::before,
html:root body.broadcast-page:has(.twitch-box[data-fit=player]):not(#cb) .topbar.topbar :is(*, #pauseBtn, #goLiveBtn)::after { box-shadow: none !important; filter: none !important; text-shadow: none !important; }
html:root body.broadcast-page:has(.twitch-box[data-fit=player]):not(#cb) .topbar.topbar input[type=range]::-webkit-slider-thumb { box-shadow: none !important; }
