/* Live — the Live Feed as the whole page's background. Same palette as ../credits/credits.css so it
   reads as one site. */

:root {
  --bg: #151816;
  --line: #3a413b;
  --ink: #e4e8e1;
  --muted: #99a397;
  --link: #8cc45e;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  color: var(--ink); font: 16px/1.6 var(--sans);
  background: linear-gradient(180deg, rgba(21,24,22,.55), rgba(21,24,22,.92) 70%, var(--bg)),
              url("../support/backdrops/ride-07.webp") center 30% / cover fixed, var(--bg);
}
a { color: var(--link); }
.in { position: relative; z-index: 1; width: 100%; padding: 0 24px; }
main { flex: 1; display: flex; flex-direction: column; padding-top: 12px; pointer-events: none; }
main a { pointer-events: auto; }

.kicker { margin: 0 0 2px; text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
.kicker a { text-decoration: none; }
h1 {
  margin: 0; font-size: clamp(32px, 5vw, 48px); font-weight: 700; line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* The screen fills the window behind everything; the stream covers it (off air it is transparent,
   so the ride photo above shows through). The shade keeps the nav, heading and caption readable. */
.screen { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.screen video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.6s ease;
}
.screen video.on { opacity: 1; }
/* Off air: the last 10 s of the newest stream, looping in black and white behind the note. */
.screen video.replay { filter: grayscale(1); }
/* Fit: the whole frame inside the window, dark bars instead of the ride photo around it. */
.screen.fit video { object-fit: contain; }
.screen.fit:has(video.on) { background: #0b0d0c; }
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,13,12,.7), rgba(11,13,12,0) 26%, rgba(11,13,12,0) 72%, rgba(11,13,12,.75));
}
.screen-note {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 20px; text-align: center;
  /* Layered dark glow: readable even over a white stream frame. */
  text-shadow: 0 0 3px #000, 0 0 12px #000, 0 0 30px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 0, 0, 0.85);
}
/* A wide soft dark pool behind the note (~a third of the stage or more), fading out at its edges. */
.screen-note::before {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; pointer-events: none;
  width: max(65%, 520px); height: max(60%, 260px); transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.2) 75%, transparent);
}
.note-title { margin: 0; font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.note-sub { margin: 0; color: var(--muted); }
.play {
  margin-top: 14px; padding: 10px 22px; border: 1px solid var(--link); border-radius: 8px;
  background: rgba(140, 196, 94, 0.15); color: var(--ink); font: 600 16px/1 var(--sans); cursor: pointer;
}
.play:hover, .play:focus-visible { background: rgba(140, 196, 94, 0.3); }
.play:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Bottom row over the stream: the caption on the left, the Fit/Fill button on the right. It wraps
   (upwards, it sits at the bottom) rather than run under the chat panel when the pills don't fit. */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; }
.caption {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; margin: 0; color: var(--ink); font-size: 15px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
/* Two Streams (live.js): "+ Name is also live" in the caption in a single view, and the picker pill:
   Side by side (default) | Stream 1 | Stream 2. */
.caption .second-note { opacity: 0.85; }
.view {
  display: inline-flex; border: 1px solid var(--link); border-radius: 999px; overflow: hidden;
  background: rgba(11, 13, 12, 0.55); pointer-events: auto;
}
.view button {
  padding: 6px 12px; border: 0; background: transparent; color: var(--ink); font: 600 14px/1 var(--sans);
  cursor: pointer; white-space: nowrap;
}
.view button + button { border-left: 1px solid rgba(140, 196, 94, 0.4); }
.view button[aria-pressed="true"] { background: rgba(140, 196, 94, 0.3); }
.view button:hover, .view button:focus-visible { background: rgba(140, 196, 94, 0.2); }
.view button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
/* Side by side: the first screen keeps the left half, the second (hidden otherwise) takes the right;
   each half follows the Fit/Fill choice like the single view (cover, or the whole frame with .fit),
   the note centred over the whole window. Phones stack them. */
.screen-2 { display: none; }
body.side .screen { inset: 0 50% 0 0; }
body.side .screen-2 { display: block; inset: 0 0 0 50%; border-left: 2px solid rgba(255, 255, 255, 0.12); }
body.side .screen.fit:has(video.on) { background: #0b0d0c; }
body.side .screen-note { position: fixed; }
@media (max-width: 760px) {
  body.side .screen { inset: 0 0 50% 0; }
  body.side .screen-2 { inset: 50% 0 0 0; border-left: 0; border-top: 2px solid rgba(255, 255, 255, 0.12); }
}
/* A single view with two up: the other stream as a card at the top right (live.js: body.card). It shows
   once its picture is up, always fills its 16:9 box (Fit/Fill is for the main picture), and a click
   watches that stream instead. Clear of the chat panel while it is open. */
.card-name { display: none; }
body.card .screen-2:has(video.on) {
  display: block; inset: 76px 16px auto auto; z-index: 3; width: clamp(200px, 22vw, 360px); aspect-ratio: 16 / 9;
  border: 2px solid rgba(255, 255, 255, 0.55); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  background: #0b0d0c; cursor: pointer; transition: border-color 0.15s ease;
}
body.card .screen-2.fit video { object-fit: cover; }
body.card .screen-2::after { display: none; }
body.card .screen-2:hover, body.card .screen-2:focus-visible { border-color: var(--link); outline: none; }
body.card .card-name {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 14px 8px 5px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--ink); font: 600 13px/1.2 var(--sans); text-shadow: 0 1px 4px #000;
  background: linear-gradient(180deg, rgba(11, 13, 12, 0), rgba(11, 13, 12, 0.8));
}
body.card.chat-open .screen-2:has(video.on) { right: calc(min(340px, calc(100vw - 32px)) + 28px); }
@media (max-width: 760px) {
  body.card .screen-2:has(video.on) { top: 64px; right: 12px; width: 38vw; min-width: 140px; }
  body.card.chat-open .screen-2:has(video.on) { right: 12px; }
}
.fit-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  padding: 0; border: 1px solid var(--link); border-radius: 999px;
  background: rgba(11, 13, 12, 0.55); color: var(--ink); cursor: pointer;
  pointer-events: auto;
}
/* Icon-only: live.js sets data-icon to the mode a click switches to. */
.fit-icon { width: 20px; height: 20px; }
.fit-toggle:not([data-icon="fill"]) .icon-fill, .fit-toggle[data-icon="fill"] .icon-fit { display: none; }
.fit-toggle:hover, .fit-toggle:focus-visible { background: rgba(140, 196, 94, 0.3); }
.fit-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
/* The viewer pill beside the caption, and its "where from" popover above it (live.js). Opens on hover,
   on keyboard focus, and on a tap (.open — phones have no hover). */
.audience { position: relative; flex-shrink: 0; pointer-events: auto; }
.audience-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(11, 13, 12, 0.55); color: var(--ink); font: 600 14px/1 var(--sans);
  cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.audience-pill:hover, .audience.open .audience-pill { border-color: var(--link); }
.audience-pill:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.audience-eye { font-size: 13px; }
.audience-pop {
  position: absolute; left: var(--pop-dx, 0px); bottom: calc(100% + 8px); z-index: 3; min-width: 168px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(11, 13, 12, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s, visibility 0.12s;
}
.audience:hover .audience-pop, .audience:focus-within .audience-pop, .audience.open .audience-pop {
  opacity: 1; visibility: visible; transform: none;
}
.audience-head { margin: 0 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.audience-rows { margin: 0; padding: 0; list-style: none; }
.audience-row { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; color: var(--ink); font-size: 14px; }
.audience-row.none { color: var(--muted); opacity: 0.6; }
.audience-n { font-weight: 600; font-variant-numeric: tabular-nums; }
/* The TV wearers' names under "In game": indented, scrolls past ~8 names. */
.audience-names { padding: 0 0 4px 10px; border-left: 2px solid var(--line); margin: 0 0 4px 2px; }
.audience-names-head { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.audience-names ul { margin: 2px 0 0; padding: 0; list-style: none; max-height: 10em; overflow-y: auto; }
.audience-names li { color: var(--ink); font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.audience-names li.audience-names-more { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .audience-pop { transition: none; } }
.foot { padding: 8px 24px 18px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* The stream's chat room, Twitch-style, down the right of the window over the picture (live-chat.js).
   Clickable through main (which is pointer-events: none). Hidden → a small Chat button, bottom right. */
.chat {
  position: fixed; z-index: 2; right: 16px; top: 76px; bottom: 60px; width: min(340px, calc(100vw - 32px));
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(11, 13, 12, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: auto; overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; flex: 1; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.chat-hide, .chat-logout {
  border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.chat-hide:hover, .chat-hide:focus-visible, .chat-logout:hover, .chat-logout:focus-visible { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
/* The 🌐 toggle: the reader's language; pressed = lines show `original (translation)`, own lines go out in English. */
.chat-translate {
  border: 1px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
  padding: 2px 8px; border-radius: 999px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-translate:hover, .chat-translate:focus-visible { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.chat-translate[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
/* Two Streams: which stream's chat room the reader is in (a row of its own under the head). */
.chat-rooms { display: flex; margin: 8px 12px 0; border: 1px solid var(--link); border-radius: 999px; overflow: hidden; }
.chat-rooms[hidden] { display: none; }
.chat-rooms button {
  flex: 1 1 0; min-width: 0; padding: 6px 10px; border: 0; background: transparent; color: var(--ink);
  font: 600 13px/1.2 var(--sans); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-rooms button + button { border-left: 1px solid rgba(140, 196, 94, 0.4); }
.chat-rooms button[aria-pressed="true"] { background: rgba(140, 196, 94, 0.3); }
.chat-rooms button:hover, .chat-rooms button:focus-visible { background: rgba(140, 196, 94, 0.2); }
.chat-rooms button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.chat-setup {
  margin-left: 4px; border: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 12px;
  cursor: pointer; padding: 1px 8px; border-radius: 999px;
}
.chat-setup:hover, .chat-setup:focus-visible { background: rgba(255, 255, 255, 0.08); }
/* A translated line: a small mark after it; a click hides or shows its bracketed translation. */
.chat-lines .line.translated .text, .chat-lines .line.untranslated .text { cursor: pointer; }
.chat-lines .line.translated .text::after { content: " \1F310"; font-size: 11px; opacity: 0.55; }
.chat-note { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 14px; }
.chat-lines {
  flex: 1; margin: 0; padding: 6px 12px; list-style: none; overflow-y: auto; overscroll-behavior: contain;
  font-size: 14px; line-height: 1.45; word-break: break-word; scrollbar-width: thin;
}
.chat-lines .line { padding: 3px 0; }
.chat-lines .moment-photo { display: block; max-width: min(100%, 320px); max-height: 240px; margin: 4px 0 2px; }
.chat-lines .name { font-weight: 700; color: #5bc8e0; }
.chat-lines .name::after { content: ":"; color: var(--muted); font-weight: 400; }
.chat-lines .line.moment .name::after { content: none; }
.chat-lines .game .name { color: var(--link); }
.chat-lines .twitch .name { color: #c89bff; }
.chat-lines .system { opacity: 0.8; font-style: italic; }
.chat-lines .system .name { display: none; }
.chat-lines .system a { color: var(--link); text-decoration: underline; }
.chat-lines .poll { font-weight: 600; }
.chat-lines .poll .name { display: none; }
.chat-lines .info { opacity: 0.9; }
.chat-lines .info .name { display: none; }
.chat-lines .private { white-space: pre-wrap; border-left: 2px dashed currentColor; padding-left: 6px; opacity: 0.9; }
.chat-lines .web .name { color: #f0c36a; }
.chat-lines .src { display: inline-block; width: 1.15em; text-align: center; font-size: 0.95em; line-height: 1; vertical-align: -0.1em; }
.chat-lines .src svg { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.1em; }
.chat-lines .discord .src { color: #5865f2; }
.chat-lines .twitch .src { color: #9146ff; }
.chat-notice { margin: 0; padding: 6px 12px; color: #f0c36a; font-size: 13px; border-top: 1px solid var(--line); }
.chat-foot { padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form { display: flex; gap: 8px; }
.chat-input {
  flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(21, 24, 22, 0.8); color: var(--ink); font: 14px/1.3 var(--sans);
}
.chat-input:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.chat-input:disabled { color: var(--muted); }
.chat-send {
  padding: 9px 14px; border: 1px solid var(--link); border-radius: 8px; background: rgba(140, 196, 94, 0.15);
  color: var(--ink); font: 600 14px/1.3 var(--sans); cursor: pointer;
}
.chat-send:hover:not(:disabled), .chat-send:focus-visible { background: rgba(140, 196, 94, 0.3); }
.chat-send:disabled, .chat-send[aria-disabled="true"] { opacity: 0.5; cursor: default; }
/* Logged out: the Log in button stands where Send does, same size, same look. */
.chat-login { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.chat-login[aria-disabled="true"] { pointer-events: none; }
.chat-who { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.chat-who strong { color: var(--ink); }
/* The emoji button beside the box, and its picker floating above the foot (live-chat.js). */
.chat-foot { position: relative; }
.chat-emoji {
  flex: none; width: 38px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(21, 24, 22, 0.8);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.chat-emoji:hover:not(:disabled), .chat-emoji:focus-visible, .chat-emoji[aria-expanded="true"] { background: rgba(255, 255, 255, 0.1); }
.chat-emoji:disabled { opacity: 0.5; cursor: default; }
.chat-picker {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 5; max-height: 260px; overflow-y: auto;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #151816; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
/* Commands: the list that opens after `/`, and the confirm strip before one runs (live-chat.js). */
.chat-cmds {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 6; padding: 4px;
  border: 1px solid var(--line); border-radius: 10px; background: #151816; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.chat-cmd {
  display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; background: none; color: var(--ink);
  font: 14px/1.3 var(--sans); text-align: left; cursor: pointer;
}
.chat-cmd[aria-selected="true"], .chat-cmd:hover { background: rgba(255, 255, 255, 0.1); }
.chat-cmd-args { color: var(--muted); }
.chat-cmd-desc { display: block; color: var(--muted); font-size: 12px; }
/* The box: a see-through copy of the input's text laid over it, the `/word` wrapped in a chip. */
.chat-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.chat-input-wrap .chat-input { width: 100%; }
.chat-input-mirror {
  position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; white-space: pre;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; color: transparent; font: 14px/1.3 var(--sans);
}
.chat-input-chip { border-radius: 4px; box-shadow: 0 0 0 2px var(--link); background: rgba(140, 196, 94, 0.2); }
.chat-input-wrap.is-command .chat-input { border-color: var(--link); }
.chat-input-wrap.is-unknown .chat-input-chip { box-shadow: 0 0 0 2px #e5706b; background: rgba(229, 112, 107, 0.18); }
.chat-input-wrap.is-unknown .chat-input { border-color: #e5706b; }
.chat-cmd-hint { margin: 0 0 6px; color: var(--link); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-foot:has(.is-unknown) .chat-cmd-hint { color: #e5706b; }
.picker-title { margin: 0 0 6px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.picker-recent { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.pick {
  aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; background: none; font-size: 20px; line-height: 1; cursor: pointer;
}
.pick:hover, .pick:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.pick-custom { display: flex; align-items: center; justify-content: center; }
.pick-custom img { width: 22px; height: 22px; object-fit: contain; }
/* Reactions under a line, and the React button that shows on hover / focus (always, faintly, on touch). */
.chat-lines .line { position: relative; }
.chat-lines .react-add {
  display: none; position: absolute; right: 0; top: 0; padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px;
  background: #151816; color: var(--ink); font-size: 12px; line-height: 1.4; cursor: pointer; opacity: 0;
}
.chat.can-react .react-add { display: inline-block; }
.chat-lines .line:hover .react-add, .chat-lines .react-add:focus-visible { opacity: 1; }
@media (hover: none) { .chat.can-react .react-add { position: static; margin-left: 6px; opacity: 0.6; } }
.chat-lines .reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chat-lines .reacts[hidden] { display: none; }
.chat-lines .chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); color: var(--ink); font: 12px/1.5 var(--sans); cursor: pointer;
}
.chat-lines .chip:hover, .chat-lines .chip:focus-visible { background: rgba(255, 255, 255, 0.12); }
.chat-lines .chip[aria-pressed="true"] { border-color: #5865f2; background: rgba(88, 101, 242, 0.25); }
.chat-lines .chip .emo { font-size: 14px; }
.chat-lines .chip img { width: 16px; height: 16px; object-fit: contain; }
.chat-lines .chip .count { color: var(--muted); font-weight: 600; }
.chat-lines .chip[aria-pressed="true"] .count { color: var(--ink); }
/* Hidden chat: a Chat pill in the bottom row, beside Fit/Fill — never on top of it. */
.chat-open {
  margin-left: auto; padding: 6px 14px; border: 1px solid var(--link); border-radius: 999px;
  background: rgba(11, 13, 12, 0.55); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer;
  pointer-events: auto;
}
/* The pills sit together at the right: only the first one showing takes the free space. */
.chat-open:not([hidden]) ~ .fit-toggle, .chat-open:not([hidden]) ~ .sound,
.sound:not([hidden]) ~ .fit-toggle { margin-left: 0; }
/* Sound: icon-only mute toggle (live.js); hover or keyboard focus pops a vertical volume slider up above
   it, Twitch-style. The pop's bottom padding bridges the gap so the pointer can travel up to it. */
.sound { position: relative; margin-left: auto; display: inline-flex; pointer-events: auto; }
.sound-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--link); border-radius: 999px; background: rgba(11, 13, 12, 0.55); color: var(--ink); cursor: pointer;
}
.sound-toggle:hover, .sound-toggle:focus-visible { background: rgba(140, 196, 94, 0.3); }
.sound-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.sound-icon { width: 20px; height: 20px; }
.sound-toggle[aria-pressed="true"] .icon-muted, .sound-toggle[aria-pressed="false"] .icon-on { display: none; }
.sound-pop {
  position: absolute; bottom: 100%; left: 18px; transform: translateX(-50%); padding-bottom: 8px;
  visibility: hidden; opacity: 0; transition: opacity 0.12s, visibility 0.12s;
}
.sound:hover .sound-pop, .sound:focus-within .sound-pop, .sound.open .sound-pop { visibility: visible; opacity: 1; }
/* iOS: the page can't set the loudness (hardware buttons do), so no slider — the button only mutes. */
.sound.no-volume .sound-pop { display: none; }
.sound-pop-box {
  padding: 12px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(11, 13, 12, 0.85);
}
.sound-volume {
  display: block; width: 20px; height: 110px; margin: 0;
  writing-mode: vertical-lr; direction: rtl; accent-color: var(--link); cursor: pointer;
}
.sound-volume:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.chat-open:hover, .chat-open:focus-visible { background: rgba(140, 196, 94, 0.3); }
/* The bottom row keeps clear of the open panel. */
body.chat-open .bar { padding-right: calc(min(340px, calc(100vw - 32px)) + 8px); }
/* --kb (live-chat.js, from visualViewport): how much of the window an on-screen keyboard covers. The
   phone panel rides up above it, and shrinks so its head stays on screen. */
@media (max-width: 760px) {
  .chat {
    left: 12px; right: 12px; top: auto; bottom: max(56px, calc(var(--kb, 0px) + 8px)); width: auto; height: 42vh;
    max-height: calc(100vh - var(--kb, 0px) - 84px); max-height: calc(100dvh - var(--kb, 0px) - 84px);
  }
  body.chat-open .bar { padding-right: 0; padding-bottom: calc(42vh + 8px); }
  .chat-picker { max-height: calc(42vh - 120px); } /* stays inside the shorter phone panel */
  /* Phone: the Chat pill is just its icon, a circle like the sound and Fit/Fill buttons. */
  .chat-open { width: 36px; height: 36px; padding: 0; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
  .chat-open-text { display: none; }
}

/* The streamer's name in the caption is a link to their own Twitch channel when they linked one (live.js). */
.caption .streamer-channel { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.45); text-underline-offset: 2px; }
.caption .streamer-channel:hover, .caption .streamer-channel:focus-visible { text-decoration-color: currentColor; }

/* Mic badge beside the streamer's name (live.js, from the status's `mic`): "mic" while it is on, a
   struck-through mic while it is enabled but off. */
.mic-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border: 1px solid var(--link); border-radius: 999px;
  background: rgba(140, 196, 94, 0.25); color: var(--ink); font: 700 11px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em;
}
.mic-icon { width: 14px; height: 14px; }
.mic-badge[data-mic="on"] .mic-slash, .mic-badge[data-mic="off"] .mic-text { display: none; }
.mic-badge[data-mic="off"] { padding: 2px 4px; border-color: var(--line); background: rgba(11, 13, 12, 0.55); color: var(--muted); }
/* Mic mute: a round icon like the sound toggle. Muted: struck through, amber. Faded while the whole stream
   is silent, still clickable, so the two read as muted together. */
.mic-toggle { flex-shrink: 0; pointer-events: auto; transition: opacity 0.15s; }
.mic-toggle .mic-icon { width: 20px; height: 20px; }
.mic-toggle[aria-pressed="false"] .mic-slash { display: none; }
.mic-toggle[aria-pressed="true"] { border-color: #d9a441; background: rgba(217, 164, 65, 0.2); }
.mic-toggle.faded { opacity: 0.45; }
.mic-toggle.faded:hover, .mic-toggle.faded:focus-visible { opacity: 0.75; }
/* Mute <name>: small, beside the name and in the audience pop-up. */
.mute-streamer, .audience-mute, .muted-unmute, .muted-clear {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(11, 13, 12, 0.55);
  color: var(--ink); font: 600 12px/1 var(--sans); cursor: pointer; white-space: nowrap; pointer-events: auto;
}
.mute-streamer:hover, .audience-mute:hover, .muted-unmute:hover, .muted-clear:hover,
.mute-streamer:focus-visible, .audience-mute:focus-visible, .muted-unmute:focus-visible, .muted-clear:focus-visible { border-color: var(--link); }
.mute-streamer:focus-visible, .audience-mute:focus-visible, .muted-unmute:focus-visible, .muted-clear:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.mute-streamer[aria-pressed="true"], .audience-mute[aria-pressed="true"] { border-color: #d9a441; background: rgba(217, 164, 65, 0.2); }
.audience-mute { display: block; width: 100%; margin-top: 8px; }
.sound { gap: 6px; align-items: center; }
.sound-toggle:disabled, .sound-volume:disabled { opacity: 0.5; cursor: not-allowed; }
/* Muted players: a pill in the bar; its list pops up above it, like the audience pop-up. */
.muted { position: relative; flex-shrink: 0; pointer-events: auto; }
.muted > summary {
  list-style: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(11, 13, 12, 0.55);
  color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; white-space: nowrap;
}
.muted > summary::-webkit-details-marker { display: none; }
.muted[open] > summary, .muted > summary:hover { border-color: var(--link); }
.muted > summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.muted-pop {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 3; min-width: 200px; max-width: calc(100vw - 32px); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(11, 13, 12, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.muted-rows { margin: 0 0 8px; padding: 0; list-style: none; max-height: 12em; overflow-y: auto; }
.muted-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
