/* Firup. Design language: flat and simple. Solid charcoal surfaces built on
   the logo's #222222, hairline borders, the logo's orange (#FF9800) as the one
   accent and its red (#F44336) for errors, no gradients or glows, and short,
   quiet transitions. Manrope for display type and DM Sans for text. Both fonts
   are bundled (src/renderer/fonts, SIL Open Font License). */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url(/fonts/dm-sans-latin-wght-normal.woff2) format('woff2-variations');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2-variations');
}

:root {
  /* From the logo (firup-horizontal-logo.svg). */
  --bg: #222222;
  --accent: #ff9800;
  --red: hsl(4, 90%, 58%);
  --text: #ffffff;
  /* Derived from it: solid steps up from the background, and the accent's tints. */
  --inset: #1b1b1b;
  --panel: #2a2a2a;
  --panel-2: #313131;
  --raised: #393939;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --soft: #c6c6c6;
  --muted: #9b9b9b;
  --dim: #737373;
  --accent-hover: #ffa726;
  --accent-ink: #222222;
  --accent-dark: #43341d;
  --accent-soft: rgba(255, 152, 0, .1);
  --accent-line: rgba(255, 152, 0, .4);
  --danger: #ff6e61;
  --danger-hover: #f05245;
  /* the logo's red, lightened to stay readable as text */
  --good: #8ff0a4;
  --warn: #ffd166;
  --radius: 2px;
  --tile-width: 160px;
  --sidebar-width: 248px;
  --gutter: clamp(20px, 3.2vw, 48px);
  --font-display: 'Manrope', 'DM Sans', system-ui, sans-serif;
  /* Older name, still read by a few rules. */
  --panel-solid: var(--panel);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(255, 152, 0, .35);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #464646 transparent;
}

/* ---------- Icons ---------- */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
}

.icon .icon-fill {
  fill: currentColor;
}

.icon .icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Type ---------- */
.eyebrow {
  display: block;
  color: var(--accent);
  font: 700 11px/1.2 var(--font-display);
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.page-title {
  font-family: var(--font-display);
  letter-spacing: -.03em;
}

.muted {
  color: var(--muted);
}

/* ---------- Layout: fixed sidebar, a top bar, and the page ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100vh;
  background: var(--bg);
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* The sidebar is opaque: while VLC plays, the app window is see-through
   wherever the page is transparent. */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 26px 10px 18px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  text-decoration: none;
  color: #fff;
  font: 800 25px/1 var(--font-display);
  letter-spacing: -.05em;
  text-transform: lowercase;
}

/* The logo's mark: an orange and a red wedge (see index.html). */
.logo-mark {
  display: block;
  width: 21px;
  height: 26px;
  flex: none;
}

.nav {
  flex: none;
  display: flex;
  flex-direction: column;
  /* gap: 3px; */
  margin-top: 34px;
  /* background: var(--panel);
  border-radius: 2px;
  border: 1px solid var(--line); */
}

.nav-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 48px;
  padding: 0 13px;
  border-radius: 2px;
  color: #8f8f8f;
  text-decoration: none;
  font-weight: 600;
  font-size: 15.5px;
  transition: color .12s, background .12s;
  margin: 3px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.nav-link.active {
  color: var(--accent-ink);
  background: var(--accent);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -18px;
  width: 3px;
  height: 24px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-link.active .icon {
  color: var(--accent-ink);
}

.nav-live {
  margin-left: auto;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

/* Bottom-left corner: the group hub (in a room), Invite friends and the profile. */
/* The hub scrolls when the window is too short for the whole room. */
.sidebar-bottom {
  margin-top: auto;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.side-btn {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #8f8f8f;
  cursor: pointer;
  text-align: left;
  font-size: 14.5px;
  transition: color .12s, background .12s;
}

.side-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.side-btn.danger:hover {
  color: var(--danger);
}

.profile {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  min-width: 0;
}

.profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.profile-text strong {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-text small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-more {
  color: #777777;
  font-size: 12px;
  letter-spacing: 1px;
}

.profile:hover .profile-more {
  color: var(--text);
}

.avatar {
  --hue: 260;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: hsl(var(--hue) 30% 38%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.hub {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  padding: 2px 4px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.hub>* {
  flex: none;
}

.hub>.hub-scroll {
  flex: 0 1 auto;
  min-height: 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 -4px;
  padding: 0 4px;
}

.hub-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hub-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.hub-live.offline {
  background: var(--inset);
}

.hub-room {
  font: 700 15px/1.25 var(--font-display);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.hub-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--soft);
  font: 600 12px ui-monospace, Consolas, monospace;
  cursor: pointer;
}

.hub-code:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.hub-line .badge {
  margin: 0;
}

.hub-media {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
}

.hub-media:hover {
  border-color: var(--accent-line);
}

.hub-media-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-media .np-timeline {
  margin: 4px 0 0;
  height: 3px;
}

.hub-media .np-meta {
  font-size: 11.5px;
}

.hub-members {
  flex: none;
}

.hub .member-list {
  margin: 0;
}

.hub .member-list li {
  gap: 9px;
  padding: 6px 0;
  border: 0;
}

.hub .member-name {
  font-size: 13px;
  font-weight: 600;
}

.member-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.hub .member-status {
  margin: 0;
  font-size: 11.5px;
}

.side-btn.invite-code {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invite-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  flex: 1;
  min-width: 0;
}

.invite-text small {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.invite-text strong {
  font: 800 15px var(--font-display);
  letter-spacing: .14em;
  color: var(--accent);
}

.invite-copy {
  font-size: 11.5px;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.side-btn.invite-code:hover .invite-copy {
  color: var(--text);
  border-color: var(--accent);
}

.invite-input {
  text-transform: uppercase;
  letter-spacing: .12em;
}

.member-device {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.badge-warn {
  background: color-mix(in srgb, var(--red, #f44336) 22%, transparent);
  color: #ff8a80;
}

.hub .member-list .badge {
  padding: 1px 6px;
  font-size: 10px;
}

.member-action {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  opacity: 0;
}

.member-list li:hover .member-action,
.member-action:focus-visible {
  opacity: 1;
}

.member-action:hover {
  color: var(--accent);
}

.member-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.member-kick:hover {
  color: var(--danger, #ff6e61);
}

.hub-alone {
  margin: 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.hub-actions {
  display: grid;
  gap: 4px;
}

.hub-actions .btn {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

/* Watching Together: the redesign of sidebar-bottom / hub */
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* padding: 11px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  margin-bottom: 8px; */
  position: relative;
}

.hub-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hub-header-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.hub-host-label {
  font: 700 10.5px/1.2 var(--font-display);
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.hub-room-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  color: var(--accent);
  font: 800 13.5px/1.25 var(--font-display);
  letter-spacing: .02em;
  text-transform: uppercase;
  min-width: 0;
  max-width: 100%;
}

.hub-room-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-room-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: color .15s, transform .15s;
}

.hub-room-icon .icon {
  width: 13px;
  height: 13px;
}

.hub-room-btn:hover {
  color: var(--accent-hover);
}

.hub-room-btn:hover .hub-room-icon {
  color: var(--accent);
  transform: translateY(1px);
}

/* Three action button slots on top-right */
.hub-actions-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.hub-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: background .12s, border-color .12s, transform .1s, color .12s;
  position: relative;
}

.hub-icon-btn .icon {
  width: 16px;
  height: 16px;
}

.hub-icon-btn:hover {
  background: var(--panel-2);
  border-color: var(--accent-line);
  color: var(--text);
}

.hub-icon-btn:active {
  transform: scale(.95);
}

.hub-icon-btn.danger {
  background: var(--danger);
  border-color: transparent;
  color: var(--inset);
}

.hub-icon-btn.danger .icon {
  color: var(--inset);
}

.hub-icon-btn.danger:hover {
  background: var(--danger-hover);
  color: var(--inset);
}

/* Inner subcard: Active (NOW PLAYING) vs Idle */
.hub-subcard {
  display: flex;
  flex-direction: column;
  gap: 0px;
  padding: 8px 8px;
  padding-top: 0px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 2px;
  min-width: 0;
}

.hub-subcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hub-now-playing-label {
  font: 800 11px/1 var(--font-display);
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hub-subcard-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
  min-width: 0;
}

.hub-subcard-title {
  font: 700 13.5px/1.3 var(--font-display);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .06s;
}

.hub-subcard-title-link:hover .hub-subcard-title {
  color: var(--accent);
}

.hub-now-playing-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
}

.hub-now-playing-bottom .np-status {
  font: 500 11px var(--font-display);
  color: var(--soft);
  white-space: nowrap;
  flex: none;
}

.hub-now-playing-bottom .np-timeline {
  flex: 1 1 auto;
  height: 3.5px;
  background: var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  min-width: 30px;
  margin: 0;
}

.hub-now-playing-bottom .np-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.hub-now-playing-bottom .np-times {
  font: 500 11px var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}

/* Idle state in subcard */
.hub-subcard.idle {
  gap: 8px;
  padding: 10px 11px;
}

.hub-idle-msg {
  font: 500 12.5px var(--font-display);
  color: var(--muted);
  line-height: 1.3;
}

/* Avatars & Stacking */
.hub-avatar-stack {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex: none;
  padding: 3px 0;
}

.hub-avatar-item {
  position: relative;
  flex: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.04s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.04s ease, opacity 0.04s ease;
  user-select: none;
}

/* In active state: compact stacked avatars */
.hub-avatar-stack:not(.idle) .hub-avatar-item:not(:first-child) {
  margin-left: -8px;
}

.hub-avatar-stack:not(.idle) .hub-avatar-circle {
  width: 24px;
  height: 24px;
  font-size: 9.5px;
}

/* In idle state: larger, more spread out avatars */
.hub-avatar-stack.idle .hub-avatar-item:not(:first-child) {
  margin-left: -4px;
}

.hub-avatar-stack.idle .hub-avatar-circle {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}

.hub-avatar-circle {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--inset);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: border-color .15s ease;
}

/* Presence state: greyed out / translucent when not in player */
.hub-avatar-item.out-of-player {
  opacity: .45;
  filter: grayscale(80%);
}

.hub-avatar-item.in-player {
  opacity: 1;
  filter: none;
}

/* Host Crown Indicator */
.hub-avatar-crown {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  color: var(--accent);
  pointer-events: none;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-avatar-crown .icon {
  width: 12px;
  height: 12px;
}

/* Avatar Hover Micro-Interactions & Push Physics */
.hub-avatar-item:hover {
  z-index: 10 !important;
  transform: scale(1.1) !important;
}

.hub-avatar-item:hover .hub-avatar-circle,
.hub-avatar-circle:hover {
  border-color: var(--accent);
}

/* CSS-based sibling push */
.hub-avatar-item:has(~ .hub-avatar-item:hover) {
  transform: translateX(-8px);
}

.hub-avatar-item:hover~.hub-avatar-item {
  transform: translateX(8px);
}

/* Stop button confirmation tooltip directly above button */



.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 2px;
}

/* Toggle switch inside card menu */
.hub-toggle-switch {
  width: 32px;
  height: 18px;
  border-radius: 2px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background .15s, border-color .15s;
  flex: none;
  margin-left: auto;
}

.hub-toggle-switch.active {
  background: var(--accent);
  border-color: var(--accent);
}

.hub-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  transition: transform .15s;
}

.hub-toggle-switch.active .hub-toggle-thumb {
  transform: translateX(14px);
  background: var(--accent-ink);
}

.hub-menu-tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--inset);
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: auto;
}

/* ---------- Top bar: the search, centered ---------- */
/* It floats over the page (the Board's featured title runs under it) and
   turns solid once the page scrolls. */
.topbar {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px) minmax(0, 1fr);
  align-items: center;
  height: 72px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background .12s, border-color .12s;
}

.topbar.scrolled {
  background: var(--bg);
  border-bottom-color: var(--line);
}

.topbar .back {
  display: none;
  grid-column: 1;
  justify-self: start;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.topbar .back .back-label {
  font: 600 13px var(--font-display);
}

body[data-route="detail"] .topbar .back,
body:has(.detail-page) .topbar .back {
  display: inline-flex;
}

.search {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  color: #aaaaaa;
  transition: border-color .12s, background .12s;
}

.search {
  position: relative;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  -webkit-app-region: no-drag;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 2px;
  color: var(--text);
  text-decoration: none;
}

.suggest-item:hover,
.suggest-item.active {
  background: rgba(255, 255, 255, .06);
}

.suggest-item.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.suggest-art {
  position: relative;
  flex: none;
  width: 34px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px;
  background: hsl(var(--hue, 200) 12% 30%);
}

.suggest-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.suggest-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.suggest-text strong {
  font: 600 14px var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggest-text small {
  font-size: 12px;
  color: var(--muted);
}

.suggest-all,
.suggest-none {
  display: block;
  padding: 9px 10px 5px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.suggest-none {
  color: var(--muted);
}

.search:focus-within {
  border-color: var(--accent-line);
  background: var(--panel-2);
}

.search .icon {
  width: 18px;
  height: 18px;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.search input::placeholder {
  color: #888888;
}

.search input::-webkit-search-cancel-button {
  filter: grayscale(1) brightness(1.4);
}

.view {
  flex: 1;
  overflow-y: auto;
  padding: 80px var(--gutter) 72px;
  outline: none;
}

/* ---------- Page headings ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 18px 0 32px;
}

.page-heading {
  min-width: 0;
}

.page-title {
  margin: 10px 0 0;
  font: 700 clamp(36px, 4vw, 48px)/1 var(--font-display);
  letter-spacing: -.055em;
}

.page-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 60ch;
}

.page-head>.page-title {
  margin: 0;
}

.section-title {
  margin: 30px 0 12px;
  font: 600 19px/1.25 var(--font-display);
  letter-spacing: -.03em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 12px;
}

.section-head .section-title {
  margin: 0;
}

/* ---------- Loading ----------
   No "Loading…" text: pages show their shape (skeletons) while they fill in,
   and a page that takes a moment to start shows a small spinner, which only
   fades in after a short delay so quick pages never flash it. */
.page-loading {
  display: grid;
  place-items: center;
  min-height: 50vh;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 152, 0, .16);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite, fade-in .2s ease .25s both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.skeleton {
  display: block;
  border-radius: 2px;
  background: var(--raised);
  animation: blink 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {

  .skeleton,
  .spinner {
    animation-duration: 0s, .2s;
  }
}

.skeleton-line {
  height: 11px;
  width: 80%;
  margin-top: 8px;
}

.skeleton-line.short {
  width: 50%;
}

.skeleton-title {
  height: 44px;
  width: min(420px, 80%);
  margin-top: 14px;
  border-radius: 2px;
}

.skeleton-text {
  height: 54px;
  width: min(640px, 100%);
  margin-top: 18px;
}

.skeleton-button {
  display: inline-block;
  height: 40px;
  width: 130px;
  border-radius: 2px;
}

.skeleton-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.skeleton-row .skeleton-card {
  flex: 0 0 clamp(240px, 23vw, 300px);
  height: 110px;
  border-radius: 2px;
}

.detail-loading .poster.skeleton {
  aspect-ratio: 2 / 3;
}

.skeleton-tiles.list {
  display: grid;
  gap: 10px;
}

.skeleton-tiles.list .skeleton-tile {
  display: grid;
  grid-template-columns: 64px 1fr;
  column-gap: 14px;
}

.skeleton-tiles.list .skeleton-poster {
  grid-row: span 2;
}

.skeleton-tile {
  flex: 0 0 var(--tile-width);
  width: var(--tile-width);
}

.skeleton-tiles.list .skeleton-tile {
  width: auto;
}

.skeleton-poster {
  aspect-ratio: 2 / 3;
  border-radius: 2px;
}

/* Stream cards still on their way (an addon is still looking). */
.skeleton-card {
  cursor: default;
  pointer-events: none;
}

.skeleton-card .skeleton-badge {
  width: 56px;
  height: 28px;
}

.skeleton-card .skeleton-line {
  margin-top: 4px;
}

.skeleton-card .skeleton-chips {
  height: 16px;
  width: 70%;
  margin-top: 6px;
}

.stream-list[data-layout="list"] .skeleton-card,
.stream-list[data-layout="grid"] .skeleton-card {
  height: var(--card-rows-height);
}

.stream-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 12px;
  font: 500 12.5px 'DM Sans', system-ui, sans-serif;
  letter-spacing: 0;
  color: var(--muted);
  vertical-align: middle;
}

.stream-status:empty {
  display: none;
}

.spinner-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 152, 0, .2);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

.stream-note {
  padding: 18px 0;
}

.btn.busy {
  cursor: progress;
}

.btn.busy .icon {
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: .4;
  }
}

.empty {
  color: #d0d0d0;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 2px;
  padding: 60px 24px;
}

.empty p {
  margin: 0;
}

.error-state {
  color: var(--danger);
  padding: 60px 0;
}

/* ---------- Segmented controls and filters ---------- */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 2px;
  background: var(--inset);
  border: 1px solid var(--line);
}

.segment {
  appearance: none;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #8f8f8f;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.segment:hover {
  color: var(--text);
}

.segment[aria-pressed="true"],
.segment[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  font: 700 10.5px var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #828282;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: -4px 0 14px;
  line-height: 1.55;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--soft);
  font-size: 14px;
}

.check input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.stack {
  display: grid;
  gap: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.settings-form {
  max-width: 760px;
}

.settings-form .panel {
  margin-bottom: 0;
}

.settings-form .field {
  margin-bottom: 14px;
}

/* ---------- Board: featured title ---------- */
.hero {
  position: relative;
  overflow: hidden;
  height: min(560px, 62vh);
  min-height: 400px;
  margin: -80px calc(var(--gutter) * -1) 0;
  border-bottom: 0;
}

.hero-art {
  position: absolute;
  inset: 0;
  background: var(--panel);
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: saturate(.7) contrast(1.06);
}

.hero-art.poster-only img {
  width: 46%;
  margin-left: auto;
  display: block;
  object-position: center 20%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 34, 34, .74);
}

.hero-content {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  bottom: 96px;
  width: min(600px, 62%);
}

.hero h1 {
  margin: 16px 0 16px;
  font: 700 clamp(44px, 5vw, 76px)/.95 var(--font-display);
  letter-spacing: -.055em;
  text-wrap: balance;
}

.hero-desc {
  margin: 0;
  color: #c4c4c4;
  font-size: 15px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  color: #e0e0e0;
  font-size: 13px;
}

.hero-meta .boxed {
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 2px;
  padding: 1px 6px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-index {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: 104px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: 600 15px var(--font-display);
  cursor: pointer;
}

.hero-index:hover span {
  color: var(--accent);
}

.hero-index span {
  color: #7a7a7a;
  font-size: 11px;
}

.hero+.row {
  position: relative;
  z-index: 3;
  margin-top: -58px;
}

.hero-actions .fav-btn[aria-pressed="true"] {
  color: var(--danger);
}

.board-browse {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 22px;
}

.board-browse .eyebrow+h2 {
  margin: 6px 0 0;
  font: 600 24px var(--font-display);
  letter-spacing: -.03em;
}

/* ---------- Rows, grids and tiles ---------- */
.row {
  margin-bottom: 44px;
}

.row-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.row-head h2 {
  margin: 6px 0 0;
  font: 600 22px/1.15 var(--font-display);
  letter-spacing: -.03em;
}

.row-more {
  margin-left: auto;
  color: #9e9e9e;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.row-more::after {
  content: none;
}

.row-more:hover {
  color: var(--text);
}

.row-placeholder {
  padding: 16px 0;
}

.row-items {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.row-items>.tile {
  flex: 0 0 var(--tile-width);
  width: var(--tile-width);
}

/* A horizontal list's frame: arrows at its ends on hover (see horizontalScroller). No scroll snapping:
   it fought a touchpad's swipe, jumping back to the nearest card. */
.hscroll {
  position: relative;
  min-width: 0;
}

.hscroll-btn {
  position: absolute;
  top: 0;
  bottom: 12px;
  z-index: 3;
  width: 44px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  border-radius: 2px;
}

.hscroll-btn.prev {
  left: -6px;
  background: linear-gradient(90deg, rgba(20, 20, 20, .92), rgba(20, 20, 20, 0));
}

.hscroll-btn.next {
  right: -6px;
  background: linear-gradient(270deg, rgba(20, 20, 20, .92), rgba(20, 20, 20, 0));
}

.hscroll-btn .icon {
  width: 26px;
  height: 26px;
}

.hscroll:hover>.hscroll-btn:not([hidden]) {
  opacity: 1;
}

.hscroll-btn:hover .icon {
  transform: scale(1.15);
}

@media (hover: none) {
  .hscroll-btn {
    display: none;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-width), 1fr));
  gap: 30px 16px;
}

/* Tiles have fixed text heights so posters always line up, whatever the titles. */
.tile {
  position: relative;
  min-width: 0;
}

.tile-link {
  display: block;
  text-decoration: none;
  border-radius: 2px;
  outline-offset: 3px;
}

.tile-title {
  margin-top: 11px;
  font: 600 14px/20px var(--font-display);
  height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-sub {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 18px;
  height: 18px;
  color: #858585;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster {
  --hue: 90;
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: hsl(var(--hue) 10% 28%);
}

.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.75);
  transition: filter .12s;
}

.poster-initials {
  font: 800 30px var(--font-display);
  letter-spacing: 1px;
  color: #ffffffc0;
}

.tile-link:hover .poster img,
.list-link:hover .poster img {
  filter: saturate(.95) brightness(.85);
}

.media-type {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 9px;
  padding: 3px 6px;
  border-radius: 2px;
  background: rgba(34, 34, 34, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #dedede;
  font: 700 9px var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hover-play {
  position: absolute;
  z-index: 1;
  inset: 0;
  margin: auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  opacity: 0;
  transition: opacity .12s;
}

.hover-play .icon {
  width: 28px;
  height: 28px;
}

.tile-link:hover .hover-play,
.tile-link:focus-visible .hover-play {
  opacity: 1;
}

.progress {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #414141;
}

.progress>span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.fav-btn {
  appearance: none;
  cursor: pointer;
  color: #fff;
  border: 0;
}

.fav-btn:hover {
  color: var(--danger);
}

.tile>.fav-btn,
.list-item>.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(34, 34, 34, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  opacity: 0;
  transition: opacity .12s;
}

.tile:hover>.fav-btn,
.tile:focus-within>.fav-btn,
.fav-btn[aria-pressed="true"],
.list-item:hover>.fav-btn,
.list-item:focus-within>.fav-btn {
  opacity: 1;
}

.fav-btn[aria-pressed="true"] {
  color: var(--danger);
}

.fav-btn[aria-pressed="true"] .icon-stroke {
  fill: currentColor;
}

.fav-btn .icon {
  width: 18px;
  height: 18px;
}

/* Continue watching: wide cards. */
.row-items>.tile-continue {
  flex: 0 0 268px;
  width: 268px;
}

.tile-continue .poster {
  aspect-ratio: 16 / 9;
  border-radius: 2px;
}

.tile-continue .poster img {
  object-position: center 22%;
  filter: brightness(.78) saturate(.8);
}

.tile-continue .tile-link:hover .poster img {
  filter: brightness(1) saturate(.95);
}

/* .tile-continue .hover-play {
  width: 40px;
  height: 40px;
  background: rgba(34, 34, 34, .88);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
} */

.continue-caption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 19px;
  height: 38px;
  color: #8b8b8b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.continue-caption strong {
  color: var(--text);
  font: 600 13.5px var(--font-display);
}

.continue-timing {
  color: var(--accent);
}

.tile-remove {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: rgba(34, 34, 34, .88);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}

.tile-remove .icon {
  width: 16px;
  height: 16px;
}

.tile:hover>.tile-remove,
.tile:focus-within>.tile-remove {
  opacity: 1;
}

.tile-remove:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.tile-remove:focus-visible {
  opacity: 1;
}

/* Detailed list layout */
.media-list {
  display: flex;
  flex-direction: column;
}

.list-item {
  position: relative;
}

.list-link {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 12px 60px 12px 6px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.list-link:hover {
  background: rgba(255, 152, 0, .03);
}

.list-link .poster {
  border-radius: 2px;
}

.list-link .poster-initials {
  font-size: 18px;
}

.list-title {
  font: 600 16px var(--font-display);
  letter-spacing: -.02em;
}

.list-facts {
  font-size: 12.5px;
  color: #858585;
  margin-top: 2px;
}

.list-desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: #b2b2b2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item>.fav-btn {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

/* ---------- Buttons and inputs ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 2px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}

.btn:hover {
  background: rgba(255, 255, 255, .14);
}

.btn:disabled {
  opacity: .5;
  cursor: default;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--accent-ink) !important;
}

.btn-ghost:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #fff;
}

.btn-danger,
.btn-danger:hover {
  color: var(--danger);
}

.input,
.select {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #303030;
  color: var(--text);
  font-size: 14px;
}

.select {
  min-width: 210px;
  padding-right: 30px;
  color: #cecece;
}

.input::placeholder {
  color: #7c7c7c;
}

.input:focus,
.select:focus {
  outline: 0;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, .08);
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  max-width: 760px;
}

.inline-form .input {
  flex: 1;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font: 600 17px var(--font-display);
  letter-spacing: -.02em;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
}

.panel-head .btn {
  margin-left: auto;
}

.folder-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.folder-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.folder-list li:last-child {
  border-bottom: 0;
}

.folder-path {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
  color: var(--soft);
}

.addon-list {
  display: grid;
  gap: 12px;
}

.addon {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 0;
}

.addon-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.addon-name {
  font: 700 16px var(--font-display);
  letter-spacing: -.02em;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 2px;
  vertical-align: 2px;
  background: var(--accent-dark);
  color: var(--accent);
  font: 700 10px var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badge-error {
  background: rgba(244, 67, 54, .16);
  color: var(--danger);
}

.badge-muted {
  background: #393939;
  color: var(--muted);
}

.addon-url {
  font-size: 12px;
  color: #828282;
  overflow-wrap: anywhere;
}

/* ---------- Watch Together ---------- */
.centered-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100% - 20px);
  padding: 20px 0 40px;
}

.centered-page .page-title {
  margin: 14px 0 12px;
}

.centered-page>p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.glow-orb {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.glow-orb .icon {
  width: 38px;
  height: 38px;
}

.create-room {
  margin-top: 26px;
  padding: 13px 26px;
  font-size: 14px;
}

.join-room {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  width: min(420px, 100%);
}

.join-room .input {
  flex: 1;
  text-align: center;
  letter-spacing: .06em;
}

.room-options {
  margin-top: 18px;
  width: min(420px, 100%);
  text-align: left;
}

.room-options summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  list-style: none;
}

.room-options summary::-webkit-details-marker {
  display: none;
}

.room-options summary::after {
  content: ' ▾';
}

.room-options[open] summary::after {
  content: ' ▴';
}

.room-options summary:hover {
  color: var(--text);
}

.room-options .stack {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
}

.centered-page>.server-note {
  max-width: 520px;
  margin-top: 34px;
  font-size: 12.5px;
  color: #828282;
}

/* In a room without anything to show yet: the empty screen of the player. */
.party-stage {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 40px;
  text-align: center;
  background: var(--inset);
}

.party-stage-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 520px;
}

.party-stage h2 {
  margin: 0;
  font: 700 34px/1.05 var(--font-display);
  letter-spacing: -.045em;
}

.party-stage p {
  margin: 0;
  color: var(--muted);
}

.party-stage .now-playing-card {
  text-align: left;
  width: min(460px, 100%);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.stage-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: blink 1.6s ease-in-out infinite;
}

.invite {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  margin: 12px 0;
}

.invite-label {
  font: 700 10px var(--font-display);
  color: #828282;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.invite-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  overflow-wrap: anywhere;
  color: var(--accent);
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.member-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.member-list li:last-child {
  border-bottom: 0;
}

.member-list .btn {
  margin-left: auto;
  padding: 4px 10px;
}

.member-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-status {
  font-size: 12px;
  color: var(--muted);
}

.member-good {
  color: var(--good);
}

.member-busy {
  color: var(--warn);
}

.member-bad {
  color: var(--danger);
}

.now-playing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.now-playing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.now-playing-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  flex: 1 1 380px;
  max-width: 640px;
}

.now-playing-card .poster {
  border-radius: 2px;
}

.now-playing-card .poster-initials {
  font-size: 22px;
}

.now-playing-card.compact {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  margin: 6px 10px 10px;
}

.now-playing-card.compact .poster-initials {
  font-size: 14px;
}

.np-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.np-kicker {
  font: 700 10px var(--font-display);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
}

.np-title {
  font: 600 17px var(--font-display);
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact .np-title {
  font-size: 14px;
}

.np-episode {
  color: var(--soft);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-source {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-timeline {
  position: relative;
  height: 3px;
  margin: 9px 0 3px;
  border-radius: 2px;
  background: #414141;
  overflow: hidden;
}

.np-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  transition: width .5s linear;
}

.np-timeline.unknown .np-fill {
  display: none;
}

.np-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.np-status.playing {
  color: var(--accent);
}

.wait-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 2px;
  background: rgba(255, 209, 102, .1);
  color: var(--warn);
  border: 1px solid rgba(255, 209, 102, .27);
}

/* ---------- Title details ---------- */
.detail-page {
  position: relative;
}

.detail-backdrop {
  position: absolute;
  z-index: 0;
  top: -80px;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  height: 560px;
  overflow: hidden;
  pointer-events: none;
}

/* Pictures cross-fade: a new one (an episode's) fades in over the old once loaded (see detailBackdrop). */
.detail-backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: saturate(.7) brightness(.8);
  opacity: 0;
  transition: opacity .35s ease, filter .35s ease;
}

.detail-backdrop img.shown {
  opacity: 1;
}

.detail-backdrop img.poster-only {
  filter: blur(28px) saturate(.6) brightness(.55);
  transform: scale(1.2);
}

/* Spoiler protection: an unwatched episode's picture stays blurred here too. */
.detail-backdrop img.spoiler {
  filter: blur(26px) saturate(.6) brightness(.6);
  transform: scale(1.15);
}

.detail-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(34, 34, 34, .82);
}

.detail-page> :not(.detail-backdrop) {
  position: relative;
  z-index: 1;
}

.back {
  margin: 4px 0 26px;
  /* padding-left: 8px; */
}

.detail {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  max-width: 1180px;
}

.detail .eyebrow {
  margin-top: 6px;
}

.detail h1 {
  margin: 14px 0 0;
  font: 700 clamp(40px, 4.4vw, 62px)/.98 var(--font-display);
  letter-spacing: -.055em;
  text-wrap: balance;
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  color: #e0e0e0;
  font-size: 13px;
}

.detail-facts .boxed {
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 2px;
  padding: 1px 6px;
}

/* The whole synopsis, always (never shortened). */
.detail-desc {
  max-width: 64ch;
  margin: 18px 0 0;
  color: #bebebe;
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-line;
}

.detail-desc.muted {
  color: var(--muted);
}

/* A series' page with an episode picked: the series' name stays (smaller), the episode's comes first. */
.detail-page.episode-mode .detail-facts,
.detail-page.episode-mode .detail-actions {
  display: none;
}

.detail-page.episode-mode .detail h1 {
  margin-top: 8px;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -.03em;
  color: var(--soft);
}

.detail-episode {
  margin-top: 14px;
}

.detail-episode-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.episode-indicator {
  padding: 3px 9px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 14px var(--font-display);
  letter-spacing: .03em;
}

.detail-episode-facts {
  color: #e0e0e0;
  font-size: 13px;
}

.detail-episode-title {
  margin: 10px 0 0;
  font: 700 clamp(30px, 3.4vw, 48px)/1.02 var(--font-display);
  letter-spacing: -.045em;
  text-wrap: balance;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 8px;
}

.detail-poster {
  display: grid;
  gap: 10px;
  align-content: start;
}

/* Continue Watching: the time on the poster, centred just above the progress bar. */
.poster .poster-time {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 3px 10px;
  border-radius: 2px;
  background: rgba(17, 17, 17, .78);
  color: #fff;
  font: 600 12px var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.poster .poster-time.up-next {
  color: var(--accent);
}


.info-row {
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.info-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.info-row dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.info-row dd {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.detail-poster .poster {
  border-radius: 2px;
}

.poster-progress {
  display: grid;
  gap: 6px;
}

.poster-progress-bar {
  position: relative;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: #414141;
}

.poster-progress-bar>span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.poster-progress-text {
  font-size: 12.5px;
  color: var(--soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.episode-code {
  font: 600 12.5px var(--font-display);
  color: #828282;
}

.episode-name {
  font: 600 14px var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Streams (on the title details page) ----------
   Compact cards in one of three layouts (horizontal list, vertical list,
   grid), with addon filters and layout buttons above them. */
.stream-row:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stream-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.detail>.muted {
  grid-column: 1 / -1;
}

.stream-section .section-title {
  margin: 0 0 14px;
}

.stream-list {
  display: grid;
  /* One column never wider than the page: a long row of seasons scrolls in itself, not the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.stream-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  margin-right: auto;
}

.stream-filters {
  min-width: 0;
  flex: 0 1 auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  display: flex;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
}

.stream-filter.segment {
  padding: 7px 14px;
  border: 1px solid var(--line);
  /* border-radius: 2px; */
  background: var(--inset);
  color: #979797;
  font-size: 12.5px;
  white-space: nowrap;
}

.stream-filter.segment[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.stream-filter.segment:hover,
.stream-filter.segment:focus-visible {
  /* background: var(--accent-dark); */
  filter: brightness(1.1);
  /* color: #fff; */
}

.stream-layouts {
  flex: none;
}

.stream-layout.segment {
  display: grid;
  place-items: center;
  width: 32px;
  height: 29px;
  padding: 0;
}

.stream-layout.segment[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.stream-layout .icon {
  width: 18px;
  height: 18px;
}

.stream-rows {
  list-style: none;
  margin: 0;
  padding: 2px 2px 10px;
  min-width: 0;
}

.stream-item {
  display: flex;
  min-width: 0;
}

.stream-item[hidden] {
  display: none;
}

.stream-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: background .12s, border-color .12s;
}

.stream-row:hover {
  background: var(--panel-2);
  border-color: rgba(255, 152, 0, .3);
}

.stream-row.highlighted {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(255, 152, 0, .12);
}

/* Row 1: the resolution badge, the headline and the play button. */
.stream-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stream-res {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 26px;
  padding: 0 8px;
  border-radius: 2px;
  font: 800 13px var(--font-display);
  letter-spacing: .02em;
  color: #fff;
  background: var(--raised);
}

/* Solid, darkened steps of the logo's red and orange (white text stays readable). */
.stream-res.res-uhd {
  background: #b3261e;
}

.stream-res.res-qhd,
.stream-res.res-fhd {
  background: #8f4f00;
}

.stream-res.res-hd {
  background: #5c4a33;
}

.stream-headline {
  flex: 1;
  min-width: 0;
  font: 600 13px/1.35 var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-go {
  flex: none;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #575757;
  color: var(--accent);
  transition: background .12s, color .12s;
}

.stream-go .icon {
  width: 15px;
  height: 15px;
}

.stream-row:hover .stream-go,
.stream-row:focus-visible .stream-go {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.stream-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 10px var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Row 2: what the stream is and where it's from, on one line, shortened with "…". */
.stream-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 18px;
}

.stream-sub-text {
  min-width: 0;
  font-size: 12px;
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rows 3 and 4: the facts as pills, wrapping onto two rows at most (room for both is always kept). */
.stream-pills {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  height: 46px;
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 20px;
  padding: 0 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  background: #3b3b3b;
  border: 1px solid rgba(255, 255, 255, .07);
  color: #c3c3c3;
  white-space: nowrap;
}

.chip>span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip .icon {
  width: 12px;
  height: 12px;
  color: #888888;
}

.chip-good {
  color: var(--good);
}

.chip-good .icon {
  color: var(--good);
}

.chip-warn {
  color: var(--warn);
}

.chip-warn .icon {
  color: var(--warn);
}

.chip-hdr {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  letter-spacing: .03em;
}

/* Four rows of content: header, subtitle, two rows of pills (an episode: header, two lines of overview, air date). */
.stream-list {
  --card-rows-height: 124px;
}

/* Horizontal list (default): one scrolling row. */
.stream-list[data-layout="row"] .stream-rows {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding: 3px;
}

.stream-list[data-layout="row"] .stream-item {
  flex: 0 0 clamp(240px, 23vw, 300px);
}

/* The arrows only page the horizontal layout. */
.stream-list:not([data-layout="row"]) .hscroll-btn {
  display: none;
}

/* Vertical list: full-width cards, one under the other, all as tall as an episode's. */
.stream-list[data-layout="list"] .stream-rows {
  display: grid;
  gap: 8px;
}

.stream-list[data-layout="list"] .stream-row {
  height: var(--card-rows-height);
}

.stream-list[data-layout="list"] .stream-row.highlighted {
  box-shadow: inset 3px 0 0 var(--danger);
}

/* Grid. */
.stream-list[data-layout="grid"] .stream-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.stream-list[data-layout="grid"] .stream-row:not(.episode-card) {
  height: var(--card-rows-height);
}

/* A series' episodes: the same cards and layouts as its streams. The
   episode's number sits where a stream's resolution does; in the horizontal
   list and the grid its thumbnail goes on top (hidden in the vertical list). */
.stream-res.res-episode {
  background: var(--panel-2);
  font-size: 12.5px;
}

.episode-card.current .stream-res {
  background: var(--accent);
  color: var(--accent-ink);
}

.episode-card .stream-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.episode-card .stream-body .stream-badge {
  align-self: flex-start;
}

.episode-card .episode-overview {
  font-size: 12px;
  line-height: 18px;
  height: 36px;
  color: #939393;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-card .stream-source {
  font-size: 12px;
  line-height: 16px;
  color: #828282;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* An episode's "Resume · 12:34" shares the air date's line in the list (four rows, like a stream). */
.stream-list[data-layout="list"] .episode-card .stream-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
}

.stream-list[data-layout="list"] .episode-card .episode-overview {
  grid-column: 1 / -1;
  grid-row: 1;
}

.stream-list[data-layout="list"] .episode-card .stream-body .stream-badge {
  grid-row: 2;
}

.episode-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: -4px -5px 0;
  border-radius: 2px;
  background: hsl(var(--hue, 200) 10% 26%);
}

.episode-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-thumb.fallback img {
  opacity: .35;
  filter: saturate(.6);
}

.episode-thumb-code {
  font: 800 22px var(--font-display);
  color: #ffffff59;
}

.episode-thumb.fallback .episode-thumb-code {
  position: relative;
  z-index: 1;
  color: #ffffffb3;
}

/* Horizontal list: compact episode cards, everything over the picture on a dark fade. */
.stream-list[data-layout="row"] .episode-card {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.stream-list[data-layout="row"] .episode-card .episode-thumb {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: inherit;
  aspect-ratio: auto;
}

.stream-list[data-layout="row"] .episode-card .episode-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(12, 12, 12, .35) 0, transparent 30%, transparent 40%, rgba(12, 12, 12, .92) 100%);
}

.stream-list[data-layout="row"] .episode-card .stream-head {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

.stream-list[data-layout="row"] .episode-card .stream-res {
  position: absolute;
  top: 8px;
  left: 8px;
}

.stream-list[data-layout="row"] .episode-card .stream-headline {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.stream-list[data-layout="row"] .episode-card .stream-go,
.stream-list[data-layout="row"] .episode-card .episode-overview,
.stream-list[data-layout="row"] .episode-card .stream-source {
  display: none;
}

.stream-list[data-layout="row"] .episode-card .stream-body {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 30px;
  z-index: 2;
}

.stream-list[data-layout="row"] .episode-card .episode-thumb-code {
  display: none;
}

.stream-list[data-layout="list"] .episode-thumb {
  display: none;
}

/* The resume prompt when picking a stream of something already started. */
.dialog {
  width: min(460px, calc(100% - 32px));
  padding: 24px 26px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 2px;
  background: var(--panel);
  color: var(--text);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .7);
}

.dialog h2 {
  margin: 0 0 6px;
  font: 700 22px var(--font-display);
  letter-spacing: -.03em;
}

.dialog p {
  margin: 0 0 12px;
  color: var(--muted);
}

.resume-progress {
  position: relative;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: #414141;
  margin-bottom: 20px;
}

.resume-progress>span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Player ---------- */
/* Watching alone: the player takes the whole window. In a room it sits next
   to the sidebar, so the group stays in view ("theater"). */
body.is-playing .app {
  grid-template-columns: 1fr;
}

body.is-playing .sidebar,
body.is-playing .topbar,
body.is-theater .topbar {
  display: none;
}

body.is-playing .view,
body.is-theater .view {
  padding: 0;
  overflow: hidden;
}

.player {
  position: relative;
  height: 100%;
  background: #000;
  overflow: hidden;
  color: #fff;
  user-select: none;
}

.player.idle {
  cursor: none;
}

.video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.video::cue {
  background: #000000b3;
  color: #fff;
  font-size: clamp(16px, 2.6vw, 34px);
  line-height: 1.3;
}

.player-top,
.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  transition: opacity .15s;
  z-index: 2;
}

.player.idle .player-top,
.player.idle .player-controls {
  opacity: 0;
  pointer-events: none;
}

.player-top {
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(34, 34, 34, .92);
}

.player-heading {
  flex: 1;
  min-width: 0;
}

.player-title {
  font: 700 18px var(--font-display);
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-source {
  font-size: 12.5px;
  color: #ffffffa0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-badge {
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 10.5px var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  /* Display only: not a link or a button. */
  cursor: default;
  user-select: none;
  pointer-events: none;
}

.player-controls {
  bottom: 0;
  padding: 0 20px 5px;
  background: rgba(34, 34, 34, .92);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.spacer {
  flex: 1;
}

.ctl {
  appearance: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.ctl:hover {
  background: #ffffff1c;
}

.ctl:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.ctl.active {
  color: var(--accent);
}

.ctl .icon {
  width: 22px;
  height: 22px;
}

.button-row>.ctl:first-child {
  background: var(--accent);
  color: var(--accent-ink);
  margin-right: 6px;
}

.button-row>.ctl:first-child:hover {
  background: var(--accent-hover);
}

.button-row>.ctl:first-child:disabled {
  background: #ffffff26;
  color: #fff;
}

.time {
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  color: #ffffffd9;
  margin-left: 8px;
  white-space: nowrap;
}

/* Range inputs paint their fill from custom properties set by player.js.
   The "gradients" here are hard stops: two solid segments (played and the
   rest), the only way a range input can paint its fill. */
.seek,
.volume {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.seek {
  width: 100%;
  height: 18px;
  display: block;
}

.seek:disabled {
  cursor: not-allowed;
}

.seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, var(--accent) var(--played, 0%), transparent var(--played, 0%)),
    linear-gradient(90deg, #ffffff59 var(--buffered, 0%), #ffffff22 var(--buffered, 0%));
  transition: height .1s;
}

.seek:hover::-webkit-slider-runnable-track {
  height: 5px;
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -5px;
}

.seek:hover::-webkit-slider-thumb {
  margin-top: -4px;
}

.volume-group {
  display: flex;
  align-items: center;
}

.volume {
  width: 0;
  opacity: 0;
  height: 18px;
  transition: width .12s, opacity .12s;
}

.volume-group:hover .volume,
.volume:focus-visible {
  width: 90px;
  opacity: 1;
  margin-right: 6px;
}

.volume::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff var(--level, 100%), #ffffff40 var(--level, 100%));
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4px;
}

/* Buffering: matches the player's loading stage (stage-content), with the shade over the video. */
.player-spinner {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .3s;
}

.player-spinner[hidden] {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.player-notice {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(720px, calc(100% - 32px));
  padding: 8px 8px 8px 16px;
  border-radius: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
}

.sync-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 2px;
  background: rgba(34, 34, 34, .9);
  border: 1px solid var(--line);
  font-size: 14px;
}

.sync-note-btn {
  padding: 3px 11px;
  min-height: 0;
  font-size: 12.5px;
}

.player-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: min(480px, calc(100% - 32px));
  padding: 24px 26px;
  text-align: center;
  color: var(--text);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 2px;
}

.player-error p {
  margin: 0 0 16px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.player-unavailable {
  display: grid;
  place-items: center;
}

/* Floating menus anchored above the control bar. */
.player-menu {
  position: absolute;
  bottom: 84px;
  z-index: 4;
  width: 300px;
  max-height: calc(100% - 180px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 2px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text);
}

.menu-heading {
  padding: 9px 10px 5px;
  font: 700 10px var(--font-display);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
}

.menu-hint {
  margin: 4px 10px 10px;
  font-size: 13px;
  color: var(--muted);
}

.menu-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover:not(:disabled) {
  background: #ffffff10;
}

.menu-item:disabled {
  opacity: .5;
  cursor: default;
}

.menu-check {
  width: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.menu-check .icon {
  width: 16px;
  height: 16px;
}

.menu-label {
  display: grid;
  min-width: 0;
}

.menu-label small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-wide {
  width: calc(100% - 20px);
  margin: 4px 10px;
}

.player-menu .invite {
  margin: 6px 10px;
}

.player-menu .member-list {
  margin: 6px 10px;
}

/* Episode drawer */
.episode-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: min(380px, 90%);
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  color: var(--text);
  animation: slide-in .15s ease-out;
}

.episode-drawer {
  width: min(460px, 92%);
}

.drawer-back {
  padding: 6px 10px;
}

.drawer-kicker {
  font: 700 11px var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.drawer-episode {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font: 600 15px var(--font-display);
}

.drawer-streams {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-streams .stream-row {
  width: 100%;
}

.drawer-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 12px 0;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-title {
  font: 700 16px var(--font-display);
  letter-spacing: -.02em;
}

.episode-item {
  appearance: none;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.episode-item:hover:not(:disabled) {
  background: rgba(255, 152, 0, .04);
}

.episode-item:disabled {
  cursor: default;
}

.episode-item.current {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

@keyframes slide-in {
  from {
    transform: translateX(12px);
    opacity: 0;
  }
}

/* Next episode popup */
.next-popup {
  position: absolute;
  right: 24px;
  bottom: 110px;
  z-index: 4;
  width: 320px;
  padding: 18px;
  border-radius: 2px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text);
  animation: popup-in .15s ease-out;
}

.next-kicker {
  font: 700 10px var(--font-display);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
}

.next-title {
  font: 700 16px var(--font-display);
  letter-spacing: -.02em;
  margin: 6px 0 14px;
}

.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@keyframes popup-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  z-index: 10;
}

.toast {
  max-width: 380px;
  padding: 11px 15px;
  border-radius: 2px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-size: 14px;
  transition: opacity .15s;
}

.toast-error {
  border-left-color: var(--danger);
}

/* Keep toasts clear of the player's control bar. */
body.is-playing .toasts,
body.is-theater .toasts {
  bottom: 96px;
}

.toast.leaving {
  opacity: 0;
}

/* ---------- Settings: stream format ---------- */
.textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 9px 11px;
}

.format-actions {
  display: flex;
  gap: 6px;
}

.format-preview {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 2px;
  background: var(--inset);
  border: 1px dashed var(--line);
}

/* ---------- Player with VLC ----------
   VLC's picture is a native window right behind the (transparent) app window,
   under .vlc-surface. While it shows (body.vlc-showing), the page between it
   and the player's controls is see-through; otherwise that area is black,
   never whatever is behind the app. Controls and menus overlay it as usual. */
body.vlc-showing,
body.vlc-showing .app,
body.vlc-showing .main,
body.vlc-showing .view,
body.vlc-showing .player.engine-vlc,
.player.engine-vlc .vlc-surface.surface-on {
  background: transparent;
}

.player.engine-vlc .vlc-surface {
  background: #000;
}

/* In fullscreen the browser paints a black backdrop behind the player, which
   would hide VLC's picture behind the window: keep it see-through too. */
body.vlc-showing .player.engine-vlc:fullscreen::backdrop {
  background: transparent;
}

/* …so in true fullscreen (body.is-fullscreen) whatever is under the player,
   such as the sidebar next to a Watch Together player, is hidden: it would
   otherwise show through the see-through video area. A maximized window is
   not fullscreen and keeps its sidebar. */
body.is-fullscreen .sidebar,
body.is-fullscreen .topbar,
body.is-fullscreen .resize-edge {
  visibility: hidden;
}

body.is-fullscreen::after {
  display: none;
}

/* ---------- Frameless window ----------
   Windows' own minimize/maximize/close buttons are drawn in the top-right
   corner (titleBarOverlay, 40px tall); the top bars leave room for them and
   drag the window. The window has no native border, shadow or resize frame,
   so it gets a hairline border and thin resize edges (see setupWindowFrame). */
:root {
  --wco-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, calc(100vw - 140px)));
}

/* Same space on both sides, so the search stays centered in the bar. */
body.framed .topbar {
  -webkit-app-region: drag;
  /* padding-left: max(var(--gutter), calc(16px + var(--wco-right)));
  padding-right: max(var(--gutter), calc(16px + var(--wco-right))); */
  gap: 70px;
}

body.framed .brand {
  -webkit-app-region: drag;
}

body.framed .sidebar {
  padding-top: 34px;
}

body.framed .topbar form,
body.framed .topbar a,
body.framed .topbar button,
body.framed .topbar input {
  -webkit-app-region: no-drag;
}

body.framed .episode-drawer {
  padding-top: 52px;
}

body.framed .player-top {
  -webkit-app-region: drag;
  padding-right: calc(20px + var(--wco-right));
}

body.framed .player-top .ctl,
body.framed .player-top a,
body.framed .player-top button {
  -webkit-app-region: no-drag;
}

body.framed::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  border: 1px solid #ffffff1f;
}

body.framed.window-maximized::after,
body.framed.window-fullscreen::after {
  display: none;
}

.resize-edge {
  position: fixed;
  z-index: 101;
  -webkit-app-region: no-drag;
  display: none;
}

body.framed:not(.window-maximized):not(.window-fullscreen) .resize-edge {
  display: block;
}

.resize-n {
  top: 0;
  left: 10px;
  right: 10px;
  height: 5px;
  cursor: ns-resize;
}

.resize-s {
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 5px;
  cursor: ns-resize;
}

.resize-e {
  right: 0;
  top: 10px;
  bottom: 10px;
  width: 5px;
  cursor: ew-resize;
}

.resize-w {
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 5px;
  cursor: ew-resize;
}

.resize-ne {
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: nesw-resize;
}

.resize-sw {
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nesw-resize;
}

.resize-nw {
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nwse-resize;
}

.resize-se {
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: nwse-resize;
}

/* ---------- Settings: Firup account ---------- */
.account-wrap {
  margin-bottom: 14px;
}

.account-panel .muted {
  margin: 0 0 16px;
}

.account-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.account-note:empty {
  display: none;
}

.account-note {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
}

.account-user {
  margin: 0 0 4px;
}

.account-status {
  margin: 0 0 6px;
  color: var(--soft);
  font-size: 14px;
}

.account-status.error {
  color: var(--danger);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.link-device {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.link-device h3 {
  margin: 0 0 8px;
  font: 600 15px var(--font-display);
}

.link-row {
  display: flex;
  gap: 10px;
  max-width: 420px;
}

.code-input {
  flex: 1;
  font-family: var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.code-input::placeholder {
  letter-spacing: .12em;
}

.link-confirm p {
  margin: 14px 0 10px;
}

/* ---------- Window sizes ----------
   Laid out for windows from 1280x720 up to 4K; bigger windows also scale the
   whole UI up a little (src/main/uiScale.js). On very wide windows (21:9,
   32:9) the pages keep to a centered column instead of running from edge to
   edge: the gutter grows to center it, and what bleeds to the window's edges
   (the Board's featured title, a title's backdrop) still does, since it
   reaches out by the gutter. */
:root {
  --content-max: 2200px;
  --gutter: max(clamp(20px, 3.2vw, 48px), calc((100vw - var(--sidebar-width) - var(--content-max)) / 2));
}

/* Short windows (720p): a lower featured title, so the first row shows. */
.hero {
  height: min(560px, 56vh);
  min-height: 340px;
}

/* Wide windows: the title details (and the streams and episodes in them)
   use the room; the description keeps its own line length. */
.detail {
  max-width: 1720px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Narrower than the app's minimum window (900px), i.e. in a browser: an icon-only sidebar. */
@media (max-width: 860px) {
  :root {
    --sidebar-width: 76px;
    --tile-width: 140px;
  }

  .sidebar {
    padding-left: 13px;
    padding-right: 13px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand-name,
  .nav-link span,
  .nav-live,
  .side-btn span,
  .profile-text,
  .profile-more,
  .hub-detail {
    display: none;
  }

  .nav-link,
  .side-btn {
    justify-content: center;
    padding: 0;
  }

  .nav-link.active::before {
    left: -13px;
  }

  .profile {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .hub {
    align-items: center;
  }

  .hub .member-list li {
    justify-content: center;
  }

  .hub .member-text,
  .hub .member-action {
    display: none;
  }

  .hub-actions.hub-detail {
    display: grid;
  }

  .hub-actions .btn {
    font-size: 0;
    gap: 0;
    padding: 8px;
  }

  .hub-actions .btn:not(:last-child) {
    display: none;
  }

  .hero-content {
    width: auto;
    right: var(--gutter);
  }

  .detail {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 26px;
  }
}

@media (max-width: 700px) {
  .detail {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 200px;
  }

  .topbar {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .volume-group:hover .volume {
    width: 60px;
  }

  .button-row .ctl {
    width: 36px;
  }

  .stream-list[data-layout="row"] .stream-item {
    flex-basis: 75vw;
  }

}

/* ---------- Watched ---------- */

.watched-badge {
  position: absolute;
  z-index: 1;
  /* Bottom left: the type badge has the top left, the Library heart the top right. */
  bottom: 9px;
  left: 9px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(27, 27, 27, .9);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  pointer-events: none;
}

.watched-badge svg,
.episode-watched svg {
  width: 20px;
  height: 20px;
}

.episode-watched {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(27, 27, 27, .88);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}

/* A watched episode's card is a little quieter than the ones still to watch. */
.episode-card.watched .stream-headline {
  color: var(--soft);
}

/* Spoiler protection: unwatched episodes' pictures stay blurred. */
.episode-thumb.spoiler img {
  filter: blur(16px) brightness(.75);
  transform: scale(1.15);
}

.watched-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.watched-toggle[aria-pressed="false"] svg {
  opacity: .55;
}

/* ---------- Quick Play ---------- */

.quick-tags {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.tag-group {
  display: grid;
  gap: 7px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--inset);
  color: var(--soft);
  font: 600 13px var(--font-display);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}

.tag-toggle:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.tag-tick {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}

.tag-tick svg {
  width: 11px;
  height: 11px;
  opacity: 0;
}

.tag-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.tag-toggle[aria-pressed="true"] .tag-tick {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tag-toggle[aria-pressed="true"] .tag-tick svg {
  opacity: 1;
}

.quick-miss {
  color: var(--warn);
}

.quick-miss-view h2 {
  margin: 0 0 6px;
  font: 700 20px var(--font-display);
}

/* ---------- Dynamic banner (Settings → Appearance) ---------- */
/* At the top of the Board while it scrolls (under the search bar), restrained in height.
   Sticky offsets count from inside the view's 80px top padding: -8px puts it just under the 72px bar. */
.dyn-banner {
  position: sticky;
  top: -8px;
  z-index: 5;
  height: clamp(170px, 26vh, 250px);
  margin: 0 0 26px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--inset);
  border: 1px solid var(--line);
}

.dyn-art,
.dyn-shade {
  position: absolute;
  inset: 0;
}

.dyn-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  opacity: 0;
  transition: opacity .3s;
}

.dyn-art img.shown {
  opacity: 1;
}

.dyn-shade {
  background: linear-gradient(90deg, rgba(34, 34, 34, .96) 0%, rgba(34, 34, 34, .8) 45%, rgba(34, 34, 34, .2) 100%);
}

.dyn-content {
  position: absolute;
  z-index: 1;
  left: 28px;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 720px;
}

.dyn-content h1 {
  margin: 6px 0 8px;
  font: 700 clamp(26px, 2.6vw, 40px)/1.05 var(--font-display);
  letter-spacing: -.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dyn-desc {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .dyn-art img {
    transition: none;
  }
}

/* ---------- The player's loading stage ---------- */
.player-stage {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #141414;
  overflow: hidden;
  transition: opacity .45s;
}

.player-stage.done {
  opacity: 0;
  pointer-events: none;
}

.stage-art {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  opacity: .5;
  filter: blur(10px) saturate(.85);
}

.stage-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 20, 20, .4) 0%, rgba(20, 20, 20, .7) 55%, rgba(20, 20, 20, .97) 100%),
    linear-gradient(90deg, rgba(20, 20, 20, .8) 0%, transparent 60%);
}

.stage-content {
  position: absolute;
  left: clamp(24px, 5vw, 72px);
  bottom: clamp(28px, 9vh, 72px);
  max-width: min(760px, 80%);
}

.stage-title {
  margin: 6px 0 0;
  font: 800 clamp(30px, 4vw, 54px)/1.05 var(--font-display);
  letter-spacing: -.04em;
}

.stage-sub {
  margin-top: 8px;
  color: var(--soft);
  font-size: 17px;
}

/* Firup's loading line: sharp, skewed orange-and-red blocks crossing a faint track. */
.stage-line {
  position: relative;
  width: min(360px, 60vw);
  height: 6px;
  /* Slightly thicker so the angled split reads clearly */
  margin-top: 24px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .15);
  overflow: hidden;
}

.stage-line span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34%;
  /* Hard color stops create solid blocks with a crisp gap in the middle */
  background: linear-gradient(90deg,
      var(--accent) 0%,
      var(--accent) 48%,
      transparent 48%,
      transparent 52%,
      var(--red) 52%,
      var(--red) 100%);
  /* Slants the outer edges and the center split to match the icon's angle */
  transform: skewX(-35deg);
  animation: stage-sweep 1.4s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes stage-sweep {
  from {
    left: -38%;
  }

  to {
    left: 104%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-line span {
    animation: none;
    left: 33%;
    width: 34%;
    opacity: .85;
  }
}

.stage-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Watch Together: this player's seek ---------- */
.seek-note {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 2px;
  background: rgba(34, 34, 34, .93);
  border: 1px solid var(--accent-line);
  font-size: 14px;
  font-weight: 600;
}

.seek-note[data-state="failed"] {
  border-color: rgba(255, 110, 97, .6);
}

.seek-note svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* ---------- Settings additions ---------- */
.catalog-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 4px 20px;
}

.catalog-check small {
  font-size: 12px;
}

.field-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.field-pair .field {
  flex: 1 1 200px;
}

.support-panel {
  margin-top: 18px;
}

.support-body {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.support-body>div {
  flex: 1 1 320px;
}

.support-url {
  margin: 8px 0 2px;
  font-size: 12.5px;
}

/* Big enough for a phone to scan from the screen. */
.support-qr {
  width: 168px;
  height: 168px;
  border-radius: 2px;
  flex: 0 0 auto;
}

img.support-qr {
  background: #fff;
  padding: 8px;
}

.support-qr.placeholder {
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--inset);
  border: 2px dashed var(--raised);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Recent searches (the search bar, empty) ---------- */
.suggest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
  color: var(--muted);
  font: 700 11px var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.suggest-head .link-btn {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.recent-icon {
  display: grid;
  place-items: center;
  background: none !important;
  aspect-ratio: auto;
  height: 24px;
  color: var(--muted);
}

.recent-icon svg {
  width: 16px;
  height: 16px;
}

/* ---------- Quick Play: the closest stream when none has every preference ---------- */
.quick-closest-card {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--panel-2);
  text-align: left;
}

.quick-closest-title {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.quick-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
}

.quick-row-label {
  padding-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-tags-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-tag {
  padding: 2px 9px;
  border: 1px solid;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
}

.quick-tag small {
  font-size: 11px;
  opacity: .85;
}

.quick-tag-has {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.quick-tag-missing {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 60%, transparent);
  background: color-mix(in srgb, var(--red) 14%, transparent);
}

.quick-miss-view .quick-closest-card {
  max-width: 520px;
  margin-inline: auto;
}

/* ---------- Devices: Settings → Devices, Quick Play on a target, Devices & sessions ---------- */
.quick-target-row,
.quick-target {
  display: grid;
  gap: 8px;
}

.quick-target {
  margin-left: 28px;
}

.devices-panel .btn,
.devices-page>.format-actions .btn {
  justify-self: start;
}

.session-card {
  display: grid;
  gap: 6px;
}

.session-card.current {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.session-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.session-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.session-facts {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.badge-accent {
  color: var(--accent-ink);
  background: var(--accent);
}

/* A red trash button (removing an addon). */
.btn.icon-danger {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  color: var(--red);
}

.btn.icon-danger:hover,
.btn.icon-danger:focus-visible {
  color: #fff;
  background: color-mix(in srgb, var(--red) 85%, transparent);
}

.btn.icon-danger svg {
  width: 20px;
  height: 20px;
}

/* Settings → Appearance → Dim watched items: watched posters and episodes fade back a little (not in the Library). */
body.dim-watched:not([data-route="library"]) .poster.is-watched>img,
body.dim-watched:not([data-route="library"]) .poster.is-watched>.poster-initials,
body.dim-watched:not([data-route="library"]) .episode-card.watched {
  opacity: .5;
  filter: grayscale(.4);
  transition: opacity .15s, filter .15s;
}

body.dim-watched:not([data-route="library"]) .episode-card.watched:hover,
body.dim-watched:not([data-route="library"]) .episode-card.watched:focus-visible {
  opacity: .85;
  filter: none;
}

/* ---------- Settings: tabs, settings with a subtitle and (?) ---------- */
.settings-tabs {
  position: sticky;
  top: -8px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 8px 0;
  background: var(--bg);
}

.settings-tab {
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--soft);
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.settings-tab:hover {
  color: var(--text);
  background: var(--panel-2);
}

.settings-tab[aria-selected="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.settings-tab:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.setting-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-check .check {
  flex: 1;
}

.check-text {
  display: grid;
  gap: 2px;
}

.check-text strong {
  color: var(--text);
  font-weight: 600;
}

.check-text small {
  color: var(--muted);
  font-size: 13px;
}

.help-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.help-btn:hover,
.help-btn:focus-visible {
  color: var(--text);
  background: var(--panel-2);
}

.help-btn svg {
  width: 20px;
  height: 20px;
}

.help-text {
  max-width: 440px;
  color: var(--soft);
  line-height: 1.5;
}

/* Settings → stream title format: the preview's lines. */
.format-preview .stream-subline {
  font-size: 12.5px;
  color: var(--soft);
  overflow-wrap: anywhere;
}

/* ---------- A card's actions (right-click; the TV's "hold OK" menu) ---------- */
.card-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 220px;
  max-width: 340px;
  padding: 6px;
  background: rgba(38, 38, 38, .98);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 2px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

.card-menu-title {
  padding: 4px 8px 6px;
  font: 700 13px var(--font-display);
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--soft);
  font: 600 13.5px var(--font-display);
  text-align: left;
  cursor: pointer;
}

.card-menu-item .icon {
  width: 18px;
  height: 18px;
}

.card-menu-item:hover,
.card-menu-item:focus-visible {
  background: var(--raised);
  color: var(--text);
  outline: none;
}

.card-menu-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--text);
}

.card-menu-item:hover .icon,
.card-menu-item:focus-visible .icon {
  color: var(--accent);
}

.card-menu-item.danger,
.card-menu-item.danger .icon {
  color: var(--danger);
}

/* The player's room menu: Rejoin beside Leave room. */
.menu-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 10px;
}

/* "Don't ask again" under the missing-preferences question. */
.quick-miss-off {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0 2px;
  font-size: 13.5px;
  cursor: pointer;
}

.quick-miss-off input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Discover: the dropdowns wrap onto more lines when they don't fit. */
.discover-filters {
  flex-wrap: wrap;
  align-items: flex-end;
}

.discover-reset {
  align-self: flex-end;
}

.discover-count {
  margin: -6px 0 14px;
  font-size: 13px;
}
/* ---------- Firup Supporter, permanent rooms ---------- */
.supporter-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 2px;
  background: var(--accent-dark); color: var(--accent); font-size: 12px; font-weight: 700; vertical-align: middle;
}
.supporter-badge svg { width: 12px; height: 12px; }
.supporter-perks { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.supporter-perks li { display: flex; gap: 10px; align-items: flex-start; }
.supporter-perks svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 1px; }
.supporter-panel.is-supporter { border-color: var(--accent-dark); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.permanent-fields { padding-left: 26px; }
.my-rooms { width: min(760px, 100%); margin-top: 22px; text-align: left; }
.my-rooms h2 { font-size: 15px; margin: 0 0 8px; }
.my-rooms-list { display: grid; gap: 6px; }
.my-room { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); }
.my-room-row { display: flex; align-items: center; gap: 8px; }
.my-room-row .my-room { flex: 1; min-width: 0; }
.my-room-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.saved-room-avatars { margin-left: auto; }
.my-room.frozen { opacity: .6; }
.my-room-text { flex: 1; min-width: 0; display: grid; }
.my-room-text strong, .my-room-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-bans { display: grid; gap: 4px; max-height: 160px; overflow: auto; }
.room-ban { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-subhead { font-size: 14px; margin: 14px 0 6px; }
.room-description { color: var(--muted); max-width: 46ch; }
.lobby-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.lobby-person { display: grid; justify-items: center; gap: 4px; }

/* ---------- The sidebar's rooms: one expanded, the others collapsed rows ---------- */
.hub-rooms { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; margin-bottom: 8px; }
.hub-room-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--inset); color: var(--text);
  cursor: pointer; text-align: left; font: inherit;
}
.hub-room-row:hover, .hub-room-row:focus-visible { border-color: var(--line-strong); }
.hub-room-row.here { border-color: var(--accent-dark); }
.hub-row-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.hub-row-dot.live { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.hub-row-text { flex: 1; min-width: 0; display: grid; }
.hub-row-text strong { font: 800 12px/1.3 var(--font-display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-row-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-row-kind { flex: none; color: var(--muted); font: 800 9px/1 var(--font-display); letter-spacing: .06em; }
.hub-row-kind .icon { width: 12px; height: 12px; color: var(--accent); }
.hub-room-row .hub-room-icon { transform: rotate(-90deg); }
.hub-room-icon.is-open { transform: rotate(180deg); }
.hub-saved-body { padding-top: 8px; gap: 6px; }
.hub-saved-desc { color: var(--soft, var(--text)); font-size: 12px; line-height: 1.35; }
.hub-saved-status { color: var(--muted); font-size: 11.5px; }
.hub-saved-status.live { color: var(--accent); }
.hub-join-btn { align-self: stretch; justify-content: center; }
.permanent-code { font: 800 28px/1.2 var(--font-display); letter-spacing: .18em; text-align: center; color: var(--accent); padding: 12px; margin: 6px 0 10px; border: 1px dashed var(--accent-dark); border-radius: 2px; user-select: all; }
.my-room.is-hidden .my-room-text { opacity: .65; }
.my-room .hub-row-dot { margin-left: 2px; }
.my-rooms h2 small { font-weight: 500; margin-left: 4px; }

/* The player's Watch Together menu: the account's empty permanent rooms to start with this video. */
.menu-room { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.menu-room span { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-room small { color: var(--muted); font-weight: 500; }
.menu-room .icon { width: 14px; height: 14px; color: var(--accent); flex: none; }
