.modal-overlay {
  position: fixed; inset: 0;
  /* Solid dim only — backdrop-filter over Twitch/video is very expensive and causes long jank while open */
  background: rgba(0,0,0,0.82);
  z-index: 100;
  display: flex;
  align-items: center;
  align-items: safe center;
  justify-content: center;
  /* When config zoom fills the screen, allow scrolling the overlay instead of clipping */
  overflow-y: auto;
  overflow-x: hidden;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease-out;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-divider { height: 1px; background: var(--border); }

.modal-rate-limit .modal-title {
  color: var(--amber-ghost);
}

/* Twitch rate limit — same modal shell, purple accent (vs amber for Riot). */
.modal-rate-limit.modal-rate-limit--twitch .modal-title {
  color: #c4b5fd;
}
.modal-rate-limit.modal-rate-limit--twitch .rate-limit-lead {
  color: #ddd6fe;
}
.modal-rate-limit.modal-rate-limit--twitch .rate-limit-lead strong {
  color: #a78bfa;
}
.modal-rate-limit.modal-rate-limit--twitch .info-box {
  border-color: rgba(167, 139, 250, 0.5);
  color: #e9d5ff;
  background: rgba(88, 28, 135, 0.2);
}

/*
 * Config modal: zoom from ui.js (see computeConfigModalZoom). Fixed authored width keeps the original
 * layout ratio; resolution-based zoom scales width and height together (not extra CSS width).
 */
.modal.modal--config {
  width: min(calc(100vw - 24px), calc(56rem * 1.1));
  max-height: min(86dvh, calc(100dvh - 40px));
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.config-modal__header {
  flex-shrink: 0;
  padding: 14px 18px 0;
}
.config-modal__header .modal-divider {
  margin-top: 12px;
}
/* Config copy: same blue-gray as sidebar “STREAMERS” (`.section-label.streamers-heading`). */
.modal.modal--config .config-modal__header .modal-title {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal.modal--config .modal-close {
  color: var(--text-secondary);
}
.modal.modal--config .modal-close:hover {
  color: var(--text-primary);
}
.config-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 18px 6px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.config-modal__body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.config-modal__sweep-intro {
  flex-shrink: 0;
  margin: 0 0 14px;
  padding: 10px 12px 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  background: var(--bg-card);
  box-shadow: none;
}
/* Direct child of column grid: vertical rhythm from grid gap only */
.config-modal__grid > .config-modal__sweep-intro {
  margin: 0;
}
/* Same scale as other section labels; accent color so it stays the focal heading. */
.config-modal__sweep-intro__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
  padding-bottom: 7px;
  line-height: 1.3;
  border-bottom: 1px solid var(--border);
}
.config-modal__sweep-intro__copy {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
/* Match config .info-box emphasis (accent) without heavier weight */
.config-modal__sweep-intro__copy strong {
  color: var(--accent);
  font-weight: 400;
}
.config-modal__sweep-intro__copy hr {
  border: 0;
  height: 1px;
  margin: 10px 0;
  background: var(--border);
}
/* Nested “How sweeping works” shell (e.g. Swap priority): field-group already spaces sections. */
#cfgSwapPriorityGroup {
  margin-bottom: 10px;
}
#cfgSwapPriorityGroup .config-modal__sweep-intro {
  margin: 0;
}
.config-modal__field-inline--ui-scale-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 0;
}
.config-modal__field-inline--ui-scale-row .field-label {
  flex: 0 1 auto;
  margin: 0;
  padding-right: 0;
}
.config-modal__field-inline--ui-scale-row .config-bool-toggle--triple {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.config-modal__field-inline--swap-select select {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 11.5rem;
  width: auto;
}
.modal--config .config-modal__swap-prompt-select {
  color: var(--accent);
}
.modal--config .config-modal__swap-prompt-select option {
  color: var(--text-primary);
  background: var(--bg-card);
}
.info-box__paren {
  color: var(--text-dim);
  font-weight: 400;
}
.modal--config .field-label .field-label__paren {
  color: var(--text-dim);
}
.config-modal__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 18px max(16px, env(safe-area-inset-bottom, 0px));
  min-height: 52px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.14);
}
.config-modal__save-feedback {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 2px 8px 0 0;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.42;
  white-space: pre-line;
  color: var(--text-secondary);
  align-self: flex-end;
}
.config-modal__save-feedback--ok {
  color: var(--green-live);
}
/*
 * Grid + min-height: content wins when tall; when short, row is at least ~40dvh so the divider reads full-height
 * without flex-basis:0 (which capped the row and hid overflow from body scroll).
 */
.add-form.config-modal__columns {
  flex: 0 1 auto;
  min-height: max(min-content, 40dvh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  column-gap: 20px;
  align-items: stretch;
}
.config-modal__col {
  min-width: 0;
  min-height: 0;
}
.config-modal__vdivider {
  width: 1px;
  margin: 0;
  background: var(--border);
}
.config-modal__grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.config-modal__grid .field-group {
  min-width: 0;
}
.config-modal__grid .info-box {
  margin-top: 4px;
  line-height: 1.45;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-secondary);
}
.modal--config .field-label {
  font-size: 13px;
  letter-spacing: 0.09em;
  color: var(--text-secondary);
}
.modal--config .field-label--plain {
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.modal--config .config-modal__toggle-row .field-label {
  color: var(--text-secondary);
}
.modal--config input[type='text'] {
  color: var(--text-secondary);
}
.config-modal__field-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.config-modal__field-inline .field-label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  padding-right: 4px;
  margin: 0;
  cursor: default;
}
.config-modal__field-inline--poll-mode .config-bool-toggle {
  flex-shrink: 0;
}
.modal--config .config-modal__input-narrow {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 2.6rem;
  min-width: 2.6rem;
  max-width: 2.6rem;
  font-size: 12px;
  padding: 4px 4px;
  text-align: center;
}
.modal--config .config-poll-interval-auto-line {
  margin: 8px 0 0 0;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.45;
  font-weight: inherit;
  color: var(--text-secondary);
}
.modal--config .config-poll-interval-auto-line__label {
  margin-right: 6px;
}
.modal--config .config-poll-interval-auto-line strong {
  color: var(--accent);
  font-weight: 500;
}
.config-poll-interval-manual-wrap {
  margin-top: 10px;
}
/* Floating value tracks native range thumb (position set in JS from layout + thumb width). */
.config-range-slider-rail {
  position: relative;
  padding-top: 22px;
  margin-bottom: 2px;
}
.config-range-slider-val {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-secondary);
  pointer-events: none;
  white-space: nowrap;
}
.modal--config .config-range-slider-rail input[type='range'] {
  width: 100%;
  max-width: 100%;
  display: block;
}
.modal--config input[type='range'] {
  max-width: 100%;
  color: var(--text-secondary);
}
.modal--config .slider-val {
  font-size: 14px;
  color: var(--text-secondary);
}
.modal--config .slider-endpoints {
  font-size: 10px;
  margin-top: 4px;
  color: var(--text-secondary);
}
.modal--config .config-bool-toggle__opt {
  font-size: 12px;
  padding: 6px 15px;
  min-width: 48px;
  color: var(--text-secondary);
}
.modal--config .config-modal__footer .btn {
  font-size: 14px;
  padding: 8px 18px;
  color: var(--text-secondary);
}
.modal--config .config-modal__footer .btn.primary {
  color: var(--accent);
}
.field-label--plain {
  text-transform: none;
  letter-spacing: 0.04em;
}
.config-modal__toggle-row {
  margin-bottom: 0;
  gap: 12px;
  align-items: center;
}
.config-modal__toggle-row .field-label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  padding-right: 4px;
}
.config-api-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.config-api-status__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
.config-api-status__label--riot {
  color: var(--accent);
}
.config-api-status__label--twitch {
  color: var(--purple-variety);
}
.config-api-status__val {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .add-form.config-modal__columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
  }
  .config-modal__vdivider {
    display: none;
  }
  .config-modal__col--left {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .config-modal__field-inline--swap-select select {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }
}
@media (max-width: 560px) {
  .modal.modal--config {
    width: min(100vw - 16px, calc(56rem * 1.1));
    max-height: min(88dvh, calc(100dvh - 32px));
  }
  .config-modal__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .config-modal__save-feedback {
    text-align: left;
    align-self: stretch;
    padding: 0 0 2px 0;
  }
  .config-modal__footer .btn.primary {
    width: 100%;
    text-align: center;
  }
}

.rate-limit-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.rate-limit-snooze {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.rate-limit-snooze input {
  margin: 2px 0 0;
  flex-shrink: 0;
}
.rate-limit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Focus-column minis: grab only on .cell-bar; paused overlay + host stay default (bar z-index can overlap). */
.stream-cell.side-stream {
  cursor: default;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay,
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .twitch-embed-host {
  cursor: default;
}
.stream-cell.side-stream:hover { border-color: var(--border); }

/* Drag-over: color only (1px border). No outline — inset outline + overflow:hidden + pause/iframe painted odd corner slivers. */
.stream-cell.side-stream.stream-cell--drop-target,
.stream-cell.stream-cell--drop-target:not(.side-stream) {
  border: 1px solid var(--accent-drag-target);
}
.stream-unified--focused .stream-cells-plane .stream-cell.focused .stream-cell-body.stream-cell--drop-target {
  border: 1px solid var(--accent-drag-target);
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { color: var(--text-primary); }

/* Header toggle: hit target fits scaled SVG; uniform scale keeps 34:32 proportions vs 32px radar (non-scaling-stroke). */
.sidebar-toggle--header {
  flex-shrink: 0;
  width: clamp(36px, 11vw, 46px);
  height: clamp(26px, 8vw, 32px);
  min-height: clamp(26px, 8vw, 32px);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle--header:hover {
  color: var(--accent);
  background: transparent;
}
.sidebar-toggle-tab-icon {
  display: block;
  overflow: visible;
  width: clamp(26px, 8vw, 32px);
  height: clamp(26px, 8vw, 32px);
  flex-shrink: 0;
  transform: scale(1.4);
  transform-origin: center center;
}
.sidebar-toggle-icon-outline,
.sidebar-toggle-icon-divider {
  fill: none;
}
.sidebar-toggle-icon-chevron {
  transition: opacity 0.2s ease, transform 0.22s ease;
}
.sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--collapse {
  opacity: 1;
  transform: translateX(0);
}
.sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--expand {
  opacity: 0;
  transform: translateX(5px);
}
.sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--collapse {
  opacity: 0;
  transform: translateX(-5px);
}
.sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--expand {
  opacity: 1;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-toggle-icon-chevron {
    transition: opacity 0.1s ease;
  }
  .sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--collapse,
  .sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--expand {
    transform: none;
  }
  .sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--expand,
  .sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--collapse {
    transform: none;
  }
}

.info-box {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.6;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
  margin-top: 4px;
}
.info-box strong { color: var(--accent); font-weight: 500; }
.info-box i {
  font-style: italic;
  color: var(--text-dim);
}
/* Same 1px color as .config-modal__vdivider between config columns */
.info-box hr {
  border: 0;
  height: 1px;
  margin: 10px 0;
  background: var(--border);
}

.slider-endpoints {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Selection slot button in sidebar streamer cards */
.select-slot-btn {
  min-width: 26px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border-bright);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 6px;
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.select-slot-btn:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--text-primary); background: rgba(232,52,74,0.06); }
.select-slot-btn.slot-selected:hover:not(:disabled) {
  color: #fff;
}
.select-slot-btn.slot-selected {
  border-color: var(--accent-dim);
  color: #fff;
  background: rgba(232, 52, 74, 0.08);
}
.select-slot-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Focused-stream selector button in focus mode (crosshair icon) */
.focus-slot-btn {
  min-width: 26px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 5px;
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.focus-slot-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.focus-slot-btn.slot-focused {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,52,74,0.15);
}

/* Enter / exit focus — square control tucked in the bar corner (32px bar → 24×24 + 4px inset). */
.exit-focus-btn,
.focus-swap-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 0;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  z-index: 1;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.exit-focus-btn svg,
.focus-swap-btn svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
/* Stroke caps on the exit brackets read slightly left in the box; nudge for optical center. */
.exit-focus-btn svg {
  transform: translateX(1px);
}
.exit-focus-btn:hover,
.focus-swap-btn:hover {
  color: var(--accent);
  background: transparent;
}

/* Play-to-load overlay inside each selected stream cell */
.play-overlay {
  position: absolute;
  inset: 0;
  bottom: calc(32px * var(--ui-scale, 1.25)); /* above scaled cell-bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-card);
  z-index: 2;
  box-sizing: border-box;
  /* Tight 16×9 tiles (focus main): centered block can exceed height; without clip the Watch button’s
     accent border paints a thin line above the bar (bar z-index wins except the top edge). */
  padding: 6px 10px;
  overflow: hidden;
  zoom: var(--ui-scale, 1.25);
}

.stream-unified-layout.stream-unified--focused .stream-cells-plane > .stream-cell.focused:not(.side-stream) .play-overlay {
  zoom: calc(var(--ui-scale, 1.25) * var(--focus-main-paused-scale, 1));
}

.play-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-bright);
  opacity: 0.85;
}
.play-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.play-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.play-panel-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, calc(10px * 1.25 / var(--ui-scale, 1.25)), 11px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
  max-width: 100%;
  line-height: 1.35;
  padding: 0 4px;
  box-sizing: border-box;
}
.play-panel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
}
.play-panel-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.play-panel-row--primary {
  width: 100%;
  container-type: inline-size;
  container-name: playpanel;
}
.play-panel-row--stats {
  margin-top: 2px;
}
.play-panel-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  justify-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
}
.play-panel-primary-left {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-self: end;
}
.play-panel-primary-right {
  min-width: 0;
  white-space: nowrap;
  justify-self: start;
}
.play-panel-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  justify-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.play-panel-stats-left {
  justify-self: end;
}
.play-panel-stats-right {
  justify-self: start;
}
.play-panel-rank-slot {
  flex: 0 0 auto;
  min-width: 0;
}
.play-panel-acc {
  color: #9aa3b2;
}
.play-panel-region {
  display: inline-block;
  color: var(--text-secondary);
  opacity: 0.88;
  margin-left: 0.35em;
  vertical-align: baseline;
}
.play-panel-sep {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.88;
  margin: 0 5px;
}
.play-panel-sep--center {
  justify-self: center;
  margin: 0 6px;
}
.play-panel-rank {
  font-weight: 400;
}
.play-panel-rank .play-panel-rank-pending,
.play-panel-rank-pending {
  color: #8a93a6;
  font-weight: 400;
}
.play-panel-rank .play-panel-rank-unranked,
.play-panel-rank-unranked {
  color: #8c8c8c;
  font-weight: 400;
}
.play-panel-rank-tier {
  font-weight: 500;
}
.play-panel-rank-tier--lb {
  position: relative;
}
.play-panel-rank-paren {
  color: var(--text-secondary);
  opacity: 0.88;
}
.play-panel-rank-tier + .play-panel-rank-paren {
  margin-left: 0.35em;
}
.play-panel-rank-lb {
  font-weight: 400;
}
.play-panel-rank-lb-group {
  margin-left: 0.35em;
}
.play-panel-rank-lb--rest {
  color: var(--text-secondary);
  opacity: 0.9;
}
.play-panel-rank-lb--gold {
  color: #e8c547;
  text-shadow: 0 0 12px rgba(232, 197, 71, 0.22);
}
.play-panel-rank-lb--silver {
  color: #c5cedd;
  text-shadow: 0 0 10px rgba(197, 206, 221, 0.18);
}
.play-panel-rank-lb--bronze {
  color: #d18b52;
  text-shadow: 0 0 10px rgba(209, 139, 82, 0.2);
}
.play-panel-rank--adaptive .play-panel-rank__abbr {
  display: none;
}
@container playpanel (max-width: 440px) {
  .play-panel-rank--adaptive .play-panel-rank__verbose {
    display: none;
  }
  .play-panel-rank--adaptive .play-panel-rank__abbr {
    display: inline;
  }
}
@container playpanel (max-width: 360px) {
  /* JS priority cuts handle LB -> WR -> region in overflow order. */
}
.play-panel-rank-lb-cut {
  display: none;
}
.play-panel-row--primary.play-panel-row--primary--cut-lb .play-panel-rank-lb-group {
  display: none;
}
.play-panel-row--primary.play-panel-row--primary--cut-wr .play-panel-wr-group {
  display: none;
}
.play-panel-row--primary.play-panel-row--primary--cut-region .play-panel-region {
  display: none;
}
.play-panel-row--primary.play-panel-row--primary--cut-region .play-panel-sep:first-of-type {
  margin-left: 0.2em;
}
.play-panel-rank--adaptive {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}
.play-panel-wr {
  flex-shrink: 0;
  font-weight: 400;
  font-size: 1em;
}
.play-panel-wr--wr-na {
  color: #6b7280;
  font-weight: 400;
}
.play-panel-wr--wr-bad {
  color: #b86b70;
}
.play-panel-wr--wr-near50 {
  color: #9aa3b2;
}
.play-panel-wr--wr-fiftys {
  color: #89b4e8;
}
.play-panel-wr--wr-green {
  color: #7dcea0;
}
.play-panel-wr--wr-yellow {
  color: #e8d55d;
}
.play-panel-wr--wr-gold {
  color: #d4a84b;
}
.play-panel-wr-paren {
  color: var(--text-secondary);
  opacity: 0.88;
  margin-left: 0.2em;
}
.play-panel-wr-group {
  display: inline-flex;
  align-items: baseline;
}
.play-panel-wr-suffix {
  color: var(--text-secondary);
  opacity: 0.9;
  margin-left: 0.2em;
}
.play-panel-wl {
  flex-shrink: 0;
  font-weight: 400;
  font-size: 1em;
}
.play-panel-stat-wins {
  color: #6bcf7f;
  font-weight: 500;
}
.play-panel-stat-losses {
  color: #e07070;
  font-weight: 500;
}
.play-panel-wl-sep {
  color: var(--text-secondary);
  opacity: 0.9;
  font-weight: 600;
  margin: 0 1px;
}
.play-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  background: rgba(232,52,74,0.1);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.play-btn:hover { background: rgba(232,52,74,0.22); }

/* Paused overlay × — match sidebar + / ☆ / Edit */
.play-overlay-remove-btn,
.stream-cell-playing-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 5;
  /* Fallback when cqw unavailable — box unchanged; larger × via font-size only */
  width: 25px;
  height: 25px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  color: var(--text-secondary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.12s ease;
}
.play-overlay-remove-btn {
  background: rgba(255, 255, 255, 0.04);
}
.play-overlay-remove-btn:hover,
.stream-cell-playing-remove:hover {
  border-color: var(--accent);
  color: #fff;
  background: rgba(232, 52, 74, 0.28);
}
/* Tile-aware scaling — capped lower so wide focus / grid tiles don’t get an oversized × */
@supports (width: 1cqw) {
  .play-overlay-remove-btn,
  .stream-cell-playing-remove {
    width: clamp(24px, calc(3.6cqw + 6px), 30px);
    height: clamp(24px, calc(3.6cqw + 6px), 30px);
    font-size: clamp(20px, calc(2.85cqw + 8px), 24px);
    top: clamp(3px, calc(0.55cqw + 2px), 7px);
    right: clamp(3px, calc(0.55cqw + 2px), 7px);
    border-radius: clamp(3px, 0.65cqw, 5px);
  }
}

/* Compact overlay + bar chrome for mini side streams in focus layout. */
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay {
  gap: 8px;
  padding: 6px 8px;
  zoom: calc(var(--ui-scale, 1.25) * var(--focus-mini-paused-scale, 0.82));
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-avatar {
  width: 56px;
  height: 56px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-name {
  font-size: 14px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-status {
  font-size: 9px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-panel-meta {
  font-size: 9px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-panel-sep {
  font-size: 10px;
  margin: 0 3px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-panel-wr {
  font-size: 9px;
}
/* Pause overlay on focus minis: full rank for readability (cell bar still uses adaptive/abbrev via its own CQ). */
.stream-unified--focused .stream-cells-plane .stream-cell:not(.focused) .play-panel-rank--adaptive .play-panel-rank__verbose {
  display: inline;
}
.stream-unified--focused .stream-cells-plane .stream-cell:not(.focused) .play-panel-rank--adaptive .play-panel-rank__abbr {
  display: none;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-btn {
  padding: 7px 14px;
  font-size: 11px;
  gap: 6px;
}
/* Minis: slightly smaller base + milder cqw (overlay zoom still shrinks the panel) */
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay-remove-btn,
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .stream-cell-playing-remove {
  width: 26px;
  height: 26px;
  top: 3px;
  right: 3px;
  font-size: 22px;
  font-weight: 500;
  /* Zoom + Rajdhani × reads right/low in minis — optical center */
  line-height: 0;
  transform: translate(-0.65px, -0.45px);
}
@supports (width: 1cqw) {
  .stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay-remove-btn,
  .stream-unified--focused .stream-cells-plane .stream-cell.side-stream .stream-cell-playing-remove {
    width: clamp(24px, calc(7.5cqw + 4px), 34px);
    height: clamp(24px, calc(7.5cqw + 4px), 34px);
    font-size: clamp(20px, calc(5.25cqw + 7px), 26px);
    top: clamp(3px, calc(0.95cqw + 1px), 7px);
    right: clamp(3px, calc(0.95cqw + 1px), 7px);
  }
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .stream-cell-playing-remove {
  zoom: calc(var(--ui-scale, 1.25) * var(--focus-mini-paused-scale, 0.82));
}

/* Live embed: hide × until cell hover or × itself :focus-visible (not :focus-within on .stream-cell — pause / bar controls would keep × stuck after click). */
.stream-cell-playing-remove {
  opacity: 0;
  pointer-events: none;
  /* Match visual size of .play-overlay-remove-btn (overlay uses zoom: var(--ui-scale)). */
  zoom: var(--ui-scale, 1.25);
  /* Opaque chip on video; :hover still uses sidebar-style accent above */
  background: rgba(10, 10, 14, 0.94);
  color: rgba(248, 248, 252, 0.96);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.12s ease,
    box-shadow 0.15s ease;
}
body:not(.stream-cell-dragging) .stream-cell:not(.focused):hover .stream-cell-playing-remove,
body:not(.stream-cell-dragging) .stream-cell:not(.focused) .stream-cell-playing-remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
/* Focus main tile: outer cell is taller than the video (grid spacers); only body is the hover target */
body:not(.stream-cell-dragging) .stream-cell.focused .stream-cell-body:hover .stream-cell-playing-remove,
body:not(.stream-cell-dragging) .stream-cell.focused .stream-cell-playing-remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar {
  zoom: var(--cell-bar-zoom, 1);
  gap: 4px;
  --cell-bar-gap-hit: 4px;
  --cell-bar-pad-x: 8px;
  padding: 0 8px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.focus-swap-btn),
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.exit-focus-btn) {
  padding-right: 28px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-meta {
  font-size: 10px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-status {
  font-size: 10px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.focus-swap-btn) .cell-status,
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.exit-focus-btn) .cell-status {
  padding-right: 2px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-pause-btn {
  font-size: 10px;
  padding: 0 1px;
  margin: 0;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .focus-swap-btn,
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .exit-focus-btn {
  transform: translateY(calc(-50% - 1.5px));
}

