:root {
  /* ── KaboomStreams "Quiet Stadium" tokens ── */
  --bg: #0B0D10;
  --surface: #14171C;
  --surface-hover: #1B1F26;
  --surface-raised: #222731;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --glass: rgba(20, 23, 28, 0.88);
  --glass-strong: rgba(20, 23, 28, 0.96);
  --text: #ECEEF2;
  --text-muted: #8A93A3;
  --text-dim: #5B6372;
  --accent: #3DDC97;
  --accent-hover: #5FE6AB;
  --accent-ink: #06140D;
  --accent-soft: rgba(61, 220, 151, 0.14);
  --accent-line: rgba(61, 220, 151, 0.40);
  --live: #FF4D5E;
  --danger: #EF4444;
  --focus: #FFFFFF;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --radius: var(--r-md);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 150ms;
  --t-panel: 250ms;
  --t-fade: 400ms;

  --font: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Fluid type scale (12 / 14 / 16 / 20 / 28) */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.75rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --sidebar-w-mobile: 100vw;
  --sidebar-w-tablet: 260px;
  --sidebar-w-desktop: 260px;
  --sidebar-w-tv: 260px;
  --sidebar-w: var(--sidebar-w-desktop);

  --sidebar-bg: rgba(20, 23, 28, 0.97);
  --sidebar-border: var(--line);
  --card-bg: var(--surface);
  --card-border: var(--line);
  --card-hover-bg: var(--surface-hover);
  --card-hover-border: var(--accent-line);
}

/* Breakpoint overrides */
@media (max-width: 720px) {
  :root { --sidebar-w: var(--sidebar-w-mobile); }
}
@media (min-width: 721px) and (max-width: 1024px) {
  :root { --sidebar-w: var(--sidebar-w-tablet); }
}
@media (min-width: 1025px) and (max-width: 1280px) {
  :root { --sidebar-w: var(--sidebar-w-desktop); }
}
@media (min-width: 1281px) {
  :root { --sidebar-w: var(--sidebar-w-tv); }
}

/* TV (10-ft) media query — coarse pointer, hover: none */
@media (hover: none) and (pointer: coarse) and (min-width: 1280px) {
  :root {
    --fs-xs: 0.85rem; --fs-sm: 1rem; --fs-base: 1.15rem; --fs-lg: 1.35rem; --fs-xl: 1.7rem;
    --space-1: 8px; --space-2: 12px; --space-3: 16px; --space-4: 24px; --space-5: 36px;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.focusable:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
}

/* =====================================================================
   Edge-to-Edge Zero-Border Multi-Video Stage
   ===================================================================== */
.player-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
  z-index: 10;
}

.video-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.video-row {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 0;
}

.video-slot {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000;
  overflow: hidden;
}

/* Subtle inset active-audio highlight only while UI is awake; fades completely when idle */
.video-slot.audio-active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(61, 220, 151, 0.75);
  z-index: 7;
  transition: opacity 0.25s ease;
}

.player-stage.ui-idle .video-slot.audio-active::after {
  opacity: 0;
}

.slot-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.video-grid.fill-mode .slot-video {
  object-fit: cover;
}

/* Feature A: subtle, non-blocking stall hint shown only at the nudge stage. */
.slot-stall-hint {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

body.is-tv .slot-stall-hint {
  font-size: 1rem;
}

/* Feature B — inline end-of-game replacement. This panel is a child of the
   ended slot, bounded between the top chip row and the bottom Source/Feed
   bar. It is not a floating popup and never overlaps #tvControls. */
.slot-replace-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 56px;
  bottom: 64px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  overflow: auto;
  pointer-events: auto;
}

.slot-replace-title {
  flex: 0 0 auto;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.slot-replace-cards {
  display: flex;
  flex-flow: row wrap;
  gap: 8px;
  min-height: 0;
}

.slot-replace-card {
  flex: 1 1 150px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(24, 28, 38, 0.94);
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.slot-replace-card:hover,
.slot-replace-card:focus-visible {
  border-color: var(--accent);
  background: rgba(32, 44, 52, 0.98);
}

.slot-replace-card-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
}

.slot-replace-card-meta {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.slot-replace-keep {
  flex: 0 0 auto;
  align-self: flex-start;
  min-height: 48px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 18, 26, 0.8);
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.slot-replace-keep:hover,
.slot-replace-keep:focus-visible {
  border-color: var(--accent);
  color: #fff;
}

.slot-loading {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5;
  padding: 16px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Minimal Corner Stream Overlays (Auto-hide completely when ui-idle) */
.slot-overlay-top,
.slot-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  transition: opacity 0.28s ease;
}

.slot-overlay-top {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
}

.slot-overlay-bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0) 100%);
  flex-wrap: wrap;
}

.player-stage.ui-idle .video-slot:not(.slot-loading) {
  cursor: none;
}

.player-stage.ui-idle .video-slot:not(.slot-loading) .slot-overlay-top,
.player-stage.ui-idle .video-slot:not(.slot-loading) .slot-overlay-bottom,
.player-stage.ui-idle .floating-dock,
.player-stage.ui-idle .dock-audio-bar,
.player-stage.ui-idle .cast-active-banner {
  opacity: 0;
  pointer-events: none;
}

.slot-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.slot-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.slot-actions,
.slot-switchers {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.slot-chip {
  appearance: none;
  border: none;
  background: rgba(15, 18, 26, 0.68);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.slot-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.slot-chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.slot-chip-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Arrange chips are present for stable event wiring but stay out of the
   D-pad cycle until Arrange mode is enabled. */
.slot-arrange-chip { display: none; }
.video-grid.arranging .slot-arrange-chip { display: inline-flex; }

.switcher-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.52);
  margin: 0 3px;
}

/* Desktop/mobile: transparent wrapper so the three floating controls keep their
   existing fixed positioning and auto-hide behaviour. TV overrides this below. */
.tv-control-strip { display: contents; }

/* Floating Translucent Glass Command Dock */
.floating-dock {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
  transition: opacity 0.28s ease;
}

.floating-dock::-webkit-scrollbar {
  display: none;
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
}

.dock-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.12s ease;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.dock-btn:active {
  transform: scale(0.96);
}

.dock-btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

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

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

/* Feature C — compact preset picker, floated clear of the TV control strip. */
.layout-picker {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tv-control-zone, 12px) + 96px);
  transform: translateX(-50%);
  z-index: 42;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 8px;
  max-width: min(92vw, 720px);
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.layout-picker.hidden { display: none; }

.layout-preset {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm, 8px);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.layout-preset.active { background: var(--accent); color: var(--accent-ink); }
.layout-preset.unavailable { opacity: 0.4; }

body.is-tv .layout-preset {
  min-height: 48px;
  min-width: 48px;
  padding: 0 16px;
  font-size: 1rem;
}

.dock-audio-bar {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top, 12px)) + 44px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
  transition: opacity 0.28s ease;
}

.dock-audio-bar::-webkit-scrollbar {
  display: none;
}

.dock-audio-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 4px 0 6px;
  white-space: nowrap;
}

.dock-audio-pill {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dock-audio-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.dock-audio-pill.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.games-loading-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cast-active-banner {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  max-width: calc(100vw - 24px);
  transition: opacity 0.28s ease;
}

/* =====================================================================
   Minimalist Borderless Game Browser & Overlay Drawer
   ===================================================================== */
.catalog-drawer {
  position: relative;
  z-index: 30;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.catalog-drawer.is-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.84);
  backdrop-filter: blur(22px);
  overflow-y: auto;
}

.catalog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 20px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex-shrink: 0;
}

.brand-accent {
  color: var(--accent);
}

.device-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  padding: 3px 9px;
  border-radius: 999px;
}

.search-form {
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  max-width: 420px;
  background: var(--surface);
  border: none;
  border-radius: 999px;
  padding: 2px 8px 2px 16px;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 4px;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

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

.pill-btn,
.icon-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
  background: var(--surface);
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.icon-btn {
  padding: 7px 11px;
  background: transparent;
  color: var(--text-muted);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pill-btn:hover {
  background: var(--surface-hover);
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.pill-btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.pill-btn-accent:hover {
  background: var(--accent-hover);
}

.filters-bar {
  padding: 4px 20px 8px;
}

.sports-pills,
.provider-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}

.sports-pills::-webkit-scrollbar,
.provider-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  appearance: none;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pill.active {
  background: var(--text);
  color: #050507;
  font-weight: 700;
}

.pill-sm {
  padding: 5px 11px;
  font-size: 0.74rem;
}

.pill-sm.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.subfilters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.subfilters-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.games-status {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.catalog-main {
  flex: 1;
  padding: 8px 20px 36px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.game-card {
  position: relative;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.game-card:hover {
  background: var(--surface-hover);
}

.game-card:active {
  transform: scale(0.99);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-sport-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.92rem;
  line-height: 1;
  flex-shrink: 0;
}


.game-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.live-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--live);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.live-dot-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
}

.game-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text);
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-sources-mini {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-solo-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.game-solo-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

/* =====================================================================
   Borderless Modal & Toast
   ===================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--glass-strong);
  border: none;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.modal-section {
  margin-bottom: 14px;
}

.modal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-section-head .modal-label {
  margin-bottom: 0;
}

.cast-devices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.cast-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
}

.cast-device-row.casting {
  background: var(--accent-soft);
}

.cast-device-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.cast-device-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 8px 6px 12px;
}

.link-code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font-size: 0.82rem;
  color: var(--accent);
  white-space: nowrap;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--glass-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

@media (max-width: 767px) {
  .catalog-header {
    padding: 12px 14px 8px;
  }

  .search-form {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }

  .filters-bar {
    padding: 4px 14px 8px;
  }

  .catalog-main {
    padding: 6px 14px 28px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .device-tag {
    display: none;
  }
}

@media (min-width: 1440px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  }
}

/* =====================================================================
   Header / Dock Accent Buttons for Box Scores & Bleacher Report
   ===================================================================== */
.dock-btn-active {
  background: rgba(61, 220, 151, 0.24);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.45);
}

.pill-btn-glass.active {
  background: rgba(61, 220, 151, 0.2);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.45);
}

.pill-btn-br {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}

.pill-btn-br:hover {
  background: rgba(245, 158, 11, 0.24);
}

.pill-btn-br.active {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #160d00;
  font-weight: 700;
  box-shadow: none;
}

/* =====================================================================
   Cycling Grid Box Score Widget (Side Bar Card)
   ===================================================================== */
.boxscore-section {
  margin-bottom: 0;
}

.boxscore-widget {
  background: linear-gradient(135deg, rgba(13, 21, 36, 0.92) 0%, rgba(16, 26, 46, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  overflow: hidden;
}

.bs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.bs-header-left,
.bs-header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.bs-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.36);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.bs-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 8px #f43f5e;
  animation: bsPulse 1.6s ease-in-out infinite;
}

@keyframes bsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.bs-mode-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.bs-slot-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.bs-slot-pill {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bs-slot-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.bs-slot-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.bs-counter {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  padding: 0 4px;
}

.boxscore-progress-track {
  height: 2px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.boxscore-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
}

.boxscore-card-body {
  padding: 10px 10px;
}

.bs-loading-state {
  text-align: center;
  padding: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.boxscore-widget.is-compact .bs-grid {
  grid-template-columns: 1fr;
}

.boxscore-widget.is-compact .bs-col-team {
  display: none;
}

.bs-col-matchup,
.bs-col-team {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bs-matchup-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.bs-league-tag {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.14);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.bs-status-pill {
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.bs-status-pill.is-live {
  background: rgba(244, 63, 94, 0.2);
  color: var(--live);
}

.bs-status-pill.is-final {
  background: rgba(61, 220, 151, 0.16);
  color: var(--accent);
}

.bs-network-tag {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-teams-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bs-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  border-left: 3px solid var(--team-color, #10b981);
}

.bs-team-row.is-winner {
  background: rgba(61, 220, 151, 0.08);
}

.bs-team-id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.bs-team-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.bs-team-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bs-team-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-possession-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  flex-shrink: 0;
}

.bs-team-record {
  font-size: 0.69rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bs-team-score {
  font-size: 1.45rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  min-width: 34px;
  text-align: right;
}

.bs-linescore-wrap {
  overflow-x: auto;
  scrollbar-width: none;
}

.bs-linescore-table,
.bs-player-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.bs-linescore-table th,
.bs-linescore-table td {
  padding: 3px 5px;
  text-align: center;
  font-size: 0.71rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bs-linescore-table th {
  color: var(--text-muted);
  font-weight: 700;
}

.bs-linescore-table td:first-child,
.bs-linescore-table th:first-child {
  text-align: left;
  font-weight: 800;
  padding-left: 2px;
}

.bs-linescore-table td:last-child,
.bs-linescore-table th:last-child {
  font-weight: 800;
  color: #fff;
}

.bs-situation-bar {
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(245, 247, 250, 0.85);
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  padding: 5px 8px;
}

.bs-col-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.bs-col-team-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.bs-col-team-title img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.bs-team-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.bs-stat-chip {
  font-size: 0.67rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 5px;
}

.bs-stat-chip strong {
  color: var(--text);
  margin-left: 2px;
}

.bs-player-table th {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bs-player-table td {
  font-size: 0.73rem;
  text-align: right;
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.bs-player-table th:first-child,
.bs-player-table td:first-child {
  text-align: left;
  font-weight: 700;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-leaders-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 6px;
  padding: 0 2px;
}

.bs-leaders-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.bs-leaders-badge.is-season {
  background: rgba(0, 229, 255, 0.1);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.bs-leaders-badge.is-live {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bs-leaders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bs-leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}

.bs-leader-cat {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  min-width: 34px;
}

.bs-leader-name {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-leader-val {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bs-unmatched-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bs-unmatched-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bs-ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.bs-ticker-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Bleacher Report Live Feed & Article Reader Modal
   ===================================================================== */
.br-feed-section {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.br-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.br-header-left,
.br-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.br-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #160d00;
}

.br-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.br-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.br-filter-pills::-webkit-scrollbar {
  display: none;
}

.br-feed-list.mode-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.br-feed-list.mode-carousel .br-card {
  flex: 0 0 295px;
  scroll-snap-align: start;
}

.br-feed-list.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.br-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(15, 20, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.br-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(24, 31, 48, 0.92);
}

.br-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #161e2e 0%, #0d1320 100%);
  overflow: hidden;
}

.br-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.br-card:hover .br-card-media img {
  transform: scale(1.03);
}

.br-media-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: rgba(245, 158, 11, 0.35);
  letter-spacing: 0.08em;
}

.br-kind-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(5, 8, 15, 0.82);
  color: #fff;
  backdrop-filter: blur(6px);
}

.br-kind-badge.kind-video {
  background: rgba(244, 63, 94, 0.88);
}

.br-kind-badge.kind-tweet {
  background: rgba(14, 165, 233, 0.88);
}

.br-grid-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(61, 220, 151, 0.92);
  color: var(--accent-ink);
}

.br-card-body {
  padding: 10px 12px 11px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 8px;
}

.br-card-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.69rem;
  font-weight: 700;
  color: #fcd34d;
  text-transform: uppercase;
}

.br-card-tag-logo {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.br-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.br-card-snippet {
  margin: 0;
  font-size: 0.77rem;
  line-height: 1.38;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.br-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.br-card-stats {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.br-article-modal-card {
  max-width: 720px;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
}

.br-article-body {
  overflow-y: auto;
  padding-right: 4px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.br-article-hero {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
}

.br-article-headline {
  margin: 0 0 8px;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.25;
}

.br-article-byline {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.br-article-para {
  margin: 0 0 12px;
  color: rgba(245, 247, 250, 0.9);
}

@media (max-width: 767px) {
  .br-feed-list.mode-carousel .br-card {
    flex: 0 0 250px;
  }
}

/* =====================================================================
   Dedicated Right Companion Sidebar (Box Scores + Polymarket + B/R)
   ===================================================================== */
.companion-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 35;
  background: rgba(8, 11, 18, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
}

.sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  flex-shrink: 0;
}

.sidebar-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sidebar-tabs::-webkit-scrollbar {
  display: none;
}

.sidebar-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sidebar-tab.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.sidebar-topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.companion-sidebar .br-feed-section,
.companion-sidebar .boxscore-section {
  margin-bottom: 0;
}

.companion-sidebar .br-feed-section {
  padding: 10px 10px;
}

.companion-sidebar .bs-header {
  padding: 8px 10px;
  gap: 6px 8px;
}

.br-feed-list.mode-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.br-feed-list.mode-sidebar-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.br-feed-list.mode-sidebar-compact .br-card {
  flex-direction: row;
  align-items: stretch;
}

.br-feed-list.mode-sidebar-compact .br-card-media {
  width: 96px;
  flex-shrink: 0;
  aspect-ratio: 16 / 10;
}

.br-feed-list.mode-sidebar-compact .br-card-snippet {
  display: none;
}

.app-shell.sidebar-open .player-stage {
  width: calc(100vw - var(--sidebar-w));
  right: var(--sidebar-w);
}

.app-shell.sidebar-open .catalog-drawer {
  width: calc(100vw - var(--sidebar-w));
  margin-right: var(--sidebar-w);
}

.app-shell.sidebar-open .catalog-drawer.is-overlay {
  right: var(--sidebar-w);
  width: calc(100vw - var(--sidebar-w));
  margin-right: 0;
}

.app-shell.sidebar-open .floating-dock,
.app-shell.sidebar-open .dock-audio-bar,
.app-shell.sidebar-open .cast-active-banner {
  left: calc((100vw - var(--sidebar-w)) / 2);
  max-width: calc(100vw - var(--sidebar-w) - 24px);
}

/* =====================================================================
   Polymarket Live Odds Cards & Box Score Strip
   ===================================================================== */
.poly-section {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 14px;
  padding: 10px 11px;
}

.poly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.poly-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.poly-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  color: #fff;
}

.poly-live-pill {
  font-size: 0.68rem;
  font-weight: 800;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 7px;
  border-radius: 999px;
}

.poly-live-pill.is-ws {
  color: var(--accent);
  background: rgba(61, 220, 151, 0.16);
  border-color: rgba(61, 220, 151, 0.45);
  box-shadow: 0 0 12px rgba(61, 220, 151, 0.22);
}

.poly-score-chip {
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 6px;
  border-radius: 5px;
}

.poly-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.poly-card {
  background: rgba(11, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.poly-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(16, 23, 40, 0.95);
}

.poly-card.is-active-slot {
  border-color: rgba(61, 220, 151, 0.65);
  box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.3), 0 8px 24px rgba(61, 220, 151, 0.14);
}

.poly-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.69rem;
}

.poly-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.poly-slot-badge {
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(61, 220, 151, 0.2);
  color: var(--accent);
}

.poly-vol {
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.poly-ext-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.69rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
}

.poly-ext-link:hover {
  background: rgba(56, 189, 248, 0.22);
}

.poly-outcomes {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.poly-outcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.poly-outcome-team {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.poly-outcome-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.poly-outcome-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poly-outcome-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.poly-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.poly-cents-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.poly-cents-pill.tick-up,
.bs-poly-pill.tick-up {
  background: rgba(61, 220, 151, 0.38);
  border-color: rgba(61, 220, 151, 0.75);
  color: #ecfdf5;
  transform: scale(1.06);
}

.poly-cents-pill.tick-down,
.bs-poly-pill.tick-down {
  background: rgba(244, 63, 94, 0.38);
  border-color: rgba(244, 63, 94, 0.75);
  color: #fff1f2;
  transform: scale(1.06);
}

.poly-prob-bar {
  height: 5px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.08);
}

.poly-prob-seg {
  height: 100%;
  transition: width 0.35s ease;
}

.poly-submarkets {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poly-sub-chip {
  font-size: 0.69rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact Polymarket strip inside the Cycling Box Score widget */
.bs-poly-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
}

.bs-poly-label {
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 0.03em;
}

.bs-poly-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bs-poly-pill {
  font-weight: 700;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.14);
  padding: 1px 6px;
  border-radius: 5px;
}


.game-live-score {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.28);
  color: #ecfdf5;
}

.game-live-score.is-final {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.game-card-actions-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.game-add-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.game-add-btn:hover {
  background: rgba(56, 189, 248, 0.34);
  color: #fff;
}


/* ==========================================================================
   Crispy Modern UI Redesign — Companion Sidebar & Mobile/TV Responsiveness
   ========================================================================== */

.sidebar-drag-handle {
  display: none;
  justify-content: center;
  padding: var(--space-2) 0 var(--space-1);
}

.drag-pill {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.companion-sidebar {
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease;
}

.sidebar-tab {
  font-size: var(--fs-xs);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.boxscore-widget,
.poly-card,
.br-card {
  background: var(--card-bg);
  border-color: var(--card-border);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.poly-card:hover,
.br-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
}

@media (max-width: 720px) {
  .sidebar-drag-handle {
    display: flex;
  }

  .companion-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    max-height: 78vh;
    border-left: none;
    border-top: 1px solid var(--sidebar-border);
    border-radius: 18px 18px 0 0;
    z-index: 60;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .companion-sidebar,
  .sidebar-tab,
  .boxscore-widget,
  .poly-card,
  .br-card {
    transition: none !important;
  }
}

#btnCommentaryMic.recording {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--live);
  color: #fff;
}




/* ==========================================================================
   KABOOMSTREAMS — MODERN SLEEK REDESIGN (v2)
   Architectural dark UI: slim vertical sport rail, hairline schedule rows,
   compact calendar view, flush borderless sidebar, TV-ready D-pad focus.
   ========================================================================== */

:root {
  --bg: #090A0E;
  --bg-rail: #0C0E13;
  --surface: #11141B;
  --surface-hover: #171B24;
  --surface-raised: #1C212C;
  --line: rgba(255, 255, 255, 0.065);
  --line-strong: rgba(255, 255, 255, 0.12);
  --glass: rgba(14, 16, 22, 0.9);
  --glass-strong: rgba(14, 16, 22, 0.97);
  --text: #F2F4F8;
  --text-muted: #8B93A5;
  --text-dim: #5A6273;
  --accent: #3DDC97;
  --accent-hover: #5BE5A9;
  --accent-ink: #05160E;
  --accent-soft: rgba(61, 220, 151, 0.12);
  --accent-line: rgba(61, 220, 151, 0.36);
  --live: #FF4D5E;
  --danger: #EF4444;
  --focus: #FFFFFF;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --rail-w: 68px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 140ms;
  --t-panel: 220ms;
  --t-fade: 360ms;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  color-scheme: dark;
  scrollbar-color: #242936 transparent;
  scrollbar-width: thin;
}
html, body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222733; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2F3646; }

.ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-xs { width: 12px; height: 12px; flex-shrink: 0; }

.focusable:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

/* ==========================================================================
   3-Zone Catalog Shell: Left Vertical Sport Rail + Main Schedule Column
   ========================================================================== */
.catalog-drawer {
  display: flex;
  flex-direction: row;
  min-height: 100dvh;
  background: var(--bg);
  backdrop-filter: none;
}
.catalog-drawer.is-overlay {
  background: rgba(9, 10, 14, 0.96);
  overflow: hidden;
}

/* Slim Vertical Sport Rail */
.sport-rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  width: var(--rail-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-rail);
  border-right: 1px solid var(--line);
  padding: 12px 0;
  z-index: 25;
}

.rail-brand {
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.rail-sports {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 6px 16px;
  scrollbar-width: none;
}
.rail-sports::-webkit-scrollbar { display: none; }

.rail-btn {
  position: relative;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  width: 100%;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.rail-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.rail-btn.active {
  color: var(--text);
  background: var(--surface);
}
.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.rail-ico {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-btn.active .rail-ico { color: var(--accent); }
.rail-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main Content Column */
.catalog-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Minimal Top Bar */
.catalog-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 58px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  background: rgba(9, 10, 14, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}
.device-tag { display: none; }

/* Clean Segmented View Switcher: Today | Calendar */
.view-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.view-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.view-tab:hover { color: var(--text); }
.view-tab.active {
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 600;
}
.view-tab-count {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.view-tab.active .view-tab-count { color: var(--accent); }

/* LIVE / ALL EVENTS scope switcher */
.scope-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.scope-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.scope-tab:hover { color: var(--text); }
.scope-tab.active {
  background: var(--surface-raised);
  color: var(--text);
}
.scope-tab.active .live-dot { background: var(--live); }
.scope-count {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* Sleek Command-Style Search Input */
.search-form {
  flex: 1 1 220px;
  max-width: 380px;
  height: 36px;
  padding: 0 12px;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.search-form:focus-within {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.search-ico { width: 15px; height: 15px; color: var(--text-dim); }
.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0;
  outline: none;
}
.search-input::placeholder { color: var(--text-dim); }

/* Top-Right Subtle Icon Actions */
.catalog-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.games-status {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.icon-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.active { color: var(--accent); background: var(--surface); }

.btn-subtle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn-subtle:hover { background: var(--surface-hover); border-color: var(--line-strong); }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }

.btn-return {
  appearance: none;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-left: 6px;
}
.btn-return:hover { background: var(--accent-hover); }

/* Overflow Menu */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu[open] > summary { background: var(--surface-hover); color: var(--text); }
.more-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 200px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.menu-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.06); }
#btnCommentaryMic.recording { background: rgba(255, 77, 94, 0.2); color: #fff; }

/* ==========================================================================
   Main Feed: Category Header, Live Broadcast Tiles, Hairline Schedule Rows
   ========================================================================== */
.catalog-main {
  flex: 1;
  padding: 24px 28px 56px;
  max-width: 1120px;
  width: 100%;
}

.catalog-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.category-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}
.category-subtitle {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.section-header-row:first-child { padding-top: 0; }

.section-heading {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
  flex-shrink: 0;
  animation: ks-pulse 2s ease-in-out infinite;
}
@keyframes ks-pulse { 50% { opacity: 0.3; } }

/* Live Now — Sleek Broadcast Feature Tiles */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  padding: 16px 0 8px;
}

.live-tile {
  background: linear-gradient(180deg, #131720 0%, #0F1219 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.live-tile:hover,
.live-tile:focus-visible {
  background: linear-gradient(180deg, #181D29 0%, #131720 100%);
  border-color: var(--line-strong);
}

.live-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.live-tile-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--live);
}
.live-clock {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.live-matchup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.live-team-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.live-team-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}
.live-team-score {
  font-size: 1.1875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.live-event-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.015em;
}

.live-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.watch-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
}
.live-tile:hover .watch-hint,
.live-tile:focus-visible .watch-hint { color: var(--accent); }

.row-icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.row-icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* Today & Calendar — Sleek Hairline Schedule Rows (NO tacky boxy cards) */
.schedule-list {
  display: flex;
  flex-direction: column;
}

.schedule-row {
  display: grid;
  grid-template-columns: 76px 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.schedule-row:hover,
.schedule-row:focus-visible {
  background: var(--surface);
}

.row-time {
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}
.row-247 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.row-league {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-matchup {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 8px;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}
.row-team {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-vs {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}
.row-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-left: 4px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.45;
  transition: opacity var(--t-fast) var(--ease);
}
.schedule-row:hover .row-actions,
.schedule-row:focus-within .row-actions {
  opacity: 1;
}

.row-add-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.row-add-btn:hover { background: var(--surface-raised); color: var(--text); border-color: var(--line-strong); }

.row-watch-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-hover);
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.schedule-row:hover .row-watch-btn,
.row-watch-btn:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.show-more-btn { margin: 18px auto 0; }

/* Ended / Final cards: visible in ALL scope but clearly inert. */
.final-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  padding: 2px 7px;
}
.is-ended {
  opacity: 0.48;
  cursor: default !important;
  filter: saturate(0.55);
}
.is-ended .live-dot { animation: none; background: var(--text-dim); }
.is-ended:focus, .is-ended:focus-visible { outline: none !important; box-shadow: none !important; }
.is-ended .card-action { display: none !important; }
.cal-event-chip.is-ended { opacity: 0.5; cursor: default; }
.rail-count {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--live);
  color: #07110b;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rail-count:empty { display: none; }

.calendar-footer-link {
  appearance: none;
  margin-top: 24px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.calendar-footer-link:hover { background: var(--surface-hover); border-color: var(--line-strong); color: var(--text); }
.cal-link-cta { color: var(--accent); font-weight: 600; }

.today-empty-callout {
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ==========================================================================
   Calendar View: Sleek Day Strip + Compact Mini-Month Calendar
   ========================================================================== */
.calendar-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.cal-day-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cal-day-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: var(--r-md);
  padding: 10px 14px;
  min-width: 82px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cal-day-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--line-strong); }
.cal-day-btn.active {
  background: var(--surface-raised);
  border-color: var(--accent-line);
  color: var(--text);
}
.cal-day-wd { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.cal-day-num { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--text); }
.cal-day-meta { font-size: 0.6875rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cal-day-btn.active .cal-day-meta { color: var(--accent); }

.cal-month-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.cal-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.cal-month-hint { font-weight: 400; color: var(--text-dim); }
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-wd-head {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 4px 0;
}
.cal-cell {
  position: relative;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  height: 28px;
  border-radius: var(--r-xs);
  font-family: inherit;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cal-cell.has-events { color: var(--text); cursor: pointer; font-weight: 500; }
.cal-cell.has-events:hover { background: var(--surface-hover); }
.cal-cell.is-today { color: var(--accent); font-weight: 600; }
.cal-cell.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cal-dot {
  position: absolute;
  bottom: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-cell.active .cal-dot { background: var(--accent-ink); }
.cal-empty { color: var(--text-muted); font-size: 0.875rem; }

/* ==========================================================================
   Sleek Right Companion Sidebar — Flush, Borderless, Focused Tabs
   ========================================================================== */
.companion-sidebar {
  background: var(--bg-rail);
  border-left: 1px solid var(--line);
}

.sidebar-topbar {
  height: 58px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.sidebar-tabs {
  display: flex !important;
  align-items: center;
  gap: 4px;
}
.sidebar-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active {
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
}

.sidebar-scroll {
  padding: 14px 16px 28px;
  gap: 16px;
}

/* Flush Box Score Widget (no tacky nested boxes) */
.boxscore-widget {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.bs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 10px;
  border: none;
  background: transparent;
}
.bs-header-left { display: flex; align-items: center; gap: 8px; }
.bs-mode-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.bs-counter { font-size: 0.75rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.bs-header-nav { display: flex; align-items: center; gap: 4px; }
.bs-nav-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bs-nav-btn.active {
  border-color: var(--accent-line);
  color: var(--accent);
}
.bs-nav-btn:hover { color: var(--text); background: var(--surface-hover); }
.boxscore-progress-track { height: 2px; background: var(--line); border-radius: 0; margin-bottom: 12px; }
.boxscore-progress-fill { background: var(--accent); }
.boxscore-card-body { padding: 0; }
.bs-scoreboard,
.bs-team-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
}
.bs-loading-state {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8125rem;
}

/* Flush Polymarket Odds */
.poly-section { background: transparent; border: none; padding: 0; }
.poly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.section-micro-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.poly-live-status {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--accent);
}
.poly-list { gap: 0; }
.poly-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 2px;
  box-shadow: none;
}
.poly-card:hover { background: transparent; border-color: var(--line); }
.poly-cents-pill { display: none; }
.poly-pct { font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.poly-prob-bar { height: 3px; border-radius: 2px; background: var(--surface-raised); }
.poly-ext-link { color: var(--text-dim); font-size: 0.75rem; text-decoration: none; }
.poly-ext-link:hover { color: var(--text); }

/* Flush Compact Editorial News (NO giant clickbait graphics) */
.br-feed-section { background: transparent; border: none; padding: 0; }
.br-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
}
.br-filter-pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  scrollbar-width: none;
}
.br-filter-pills::-webkit-scrollbar { display: none; }
.br-filter-pills .pill-sm {
  background: transparent;
  border: none;
  border-radius: var(--r-xs);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
}
.br-filter-pills .pill-sm:hover { color: var(--text); background: var(--surface); }
.br-filter-pills .pill-sm.active { color: var(--text); background: var(--surface-raised); box-shadow: none; }

.br-feed-list { display: flex; flex-direction: column; gap: 0; }
.br-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}
.br-card:hover { background: transparent; border-color: var(--line); }
.br-card:hover .br-card-title { color: var(--accent); }
.br-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.br-row-meta { font-size: 0.6875rem; color: var(--text-dim); font-weight: 500; }
.br-card-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--t-fast) var(--ease);
}
.br-thumb {
  width: 64px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.br-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ==========================================================================
   Player Stage Dock & Overlays
   ========================================================================== */
.video-grid:has(.video-slot + .video-slot),
.video-grid:has(.video-row + .video-row) { gap: 2px; background: #000; }
.video-row:has(.video-slot + .video-slot) { gap: 2px; }
.video-slot.audio-active::after { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55); }

.floating-dock {
  top: auto;
  bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.dock-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  background: transparent;
  color: var(--text);
}
.dock-btn:hover { background: var(--surface-hover); }
.dock-btn-primary { background: transparent; color: var(--text); font-weight: 500; }
.dock-btn-active { background: var(--surface-raised); color: var(--accent); }
.dock-btn-danger:hover { background: var(--danger); color: #fff; }
.dock-audio-bar {
  top: auto;
  bottom: calc(max(22px, calc(env(safe-area-inset-bottom, 0px) + 14px)) + 52px);
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
}

/* Modals & Toast */
.modal-backdrop { background: rgba(5, 6, 9, 0.78); backdrop-filter: none; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.modal-advanced { border-top: 1px solid var(--line); padding-top: 12px; }
.modal-advanced-summary {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.modal-advanced-summary:hover { color: var(--text); }
.modal-advanced-body { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.link-code { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 0.75rem; }

.toast {
  bottom: 88px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ==========================================================================
   Responsive Mobile (<= 720px)
   ========================================================================== */
@media (max-width: 900px) {
  .calendar-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell.sidebar-open .catalog-drawer,
  .app-shell.sidebar-open .catalog-drawer.is-overlay,
  .app-shell.sidebar-open .player-stage { width: 100vw; right: 0; margin-right: 0; }
  .app-shell.sidebar-open .floating-dock,
  .app-shell.sidebar-open .dock-audio-bar { left: 50%; max-width: calc(100vw - 24px); }

  .catalog-drawer { flex-direction: column; }
  .sport-rail {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 6px 10px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .rail-brand { display: none; }
  .rail-sports {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    gap: 4px;
  }
  .rail-btn { width: auto; min-width: 54px; padding: 6px 8px; }
  .rail-btn.active::before { left: 8px; right: 8px; top: auto; bottom: -6px; width: auto; height: 2px; border-radius: 2px; }

  .catalog-header {
    height: auto;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .header-left { flex: 1; justify-content: space-between; gap: 10px; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; }
  .games-status { display: none; }

  .catalog-main { padding: 16px 16px 40px; }
  .schedule-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 4px;
    margin: 0;
  }
  .row-league { display: none; }
  .row-actions { opacity: 1; }
  .companion-sidebar { max-height: 65vh !important; }
}

/* ==========================================================================
   Android TV (body.is-tv) — Overscan Safe, Crisp D-pad Focus, Zero Blur
   ========================================================================== */
body.is-tv { --rail-w: 84px; font-size: 18px; }
body.is-tv *,
body.is-tv *::before,
body.is-tv *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

body.is-tv .tv-hide,
body.is-tv #btnDownloadApk,
body.is-tv #btnModalDownloadApk,
body.is-tv #btnCopyLan,
body.is-tv #btnCopyM3u,
body.is-tv #btnCopyApk,
body.is-tv .sidebar-drag-handle { display: none !important; }

body.is-tv .sport-rail { padding: max(32px, 4vh) 0; }
body.is-tv .rail-btn { padding: 12px 4px; gap: 6px; }
body.is-tv .rail-ico { width: 24px; height: 24px; }
body.is-tv .rail-label { font-size: 0.75rem; }

body.is-tv .catalog-header { padding: max(28px, 4vh) 4vw 14px; height: auto; }
body.is-tv .catalog-main { padding: 20px 4vw max(44px, 5vh); max-width: none; }
body.is-tv .schedule-row { min-height: 68px; font-size: 1.125rem; }
body.is-tv .row-actions { opacity: 1; }
body.is-tv .row-add-btn { width: 42px; height: 42px; font-size: 1.25rem; }
body.is-tv .row-watch-btn { height: 42px; padding: 0 18px; font-size: 0.95rem; }

/* TV remote: one focus stop per card. Nested action buttons stay available
   to mouse users on desktop but are not D-pad stops on TV. */
body.is-tv .rail-btn,
body.is-tv .view-tab,
body.is-tv .scope-tab { min-height: 48px; }
body.is-tv .card-action,
body.is-tv .more-menu,
body.is-tv #btnCloseDrawer.hidden { display: none !important; }
/* While the catalog is open, the voice FAB is a competing low-value stop. */
body.is-tv:has(#catalogDrawer:not(.hidden)) .voice-fab-wrap { display: none !important; }
body.is-tv .is-ended { opacity: 0.4; }
body.is-tv .final-badge { border-color: var(--text-dim); }

body.is-tv .focusable:focus,
body.is-tv summary:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  background: var(--surface-raised);
  z-index: 2;
}
body.is-tv .floating-dock { bottom: max(36px, 5vh); background: var(--glass-strong); }
body.is-tv .dock-btn { height: 48px; padding: 0 18px; font-size: 1rem; }

/* ---------- Final Polish: Box Score De-Pill, Calendar Rows, Rail Fade & Responsive Header ---------- */
.rail-sports {
  mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
}
.rail-btn { padding: 6px 4px; gap: 3px; }
.rail-btn .rail-ico { color: inherit; }

.schedule-row.no-league { grid-template-columns: 76px minmax(0, 1fr) auto; }
.schedule-row.no-league .row-league { display: none; }

/* De-pill & refine Box Score Sidebar */
.bs-slot-tabs { gap: 4px; padding-top: 4px; }
.bs-slot-pill {
  border-radius: var(--r-xs) !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: var(--text-muted) !important;
  font-size: 0.6875rem !important;
  font-weight: 500 !important;
  padding: 4px 8px !important;
  box-shadow: none !important;
}
.bs-slot-pill:hover { color: var(--text) !important; border-color: var(--line-strong) !important; }
.bs-slot-pill.active {
  background: var(--surface-raised) !important;
  border-color: var(--accent-line) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
}
.bs-team-panel {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 12px 0 4px !important;
}
.bs-team-name { font-size: 0.875rem !important; min-width: 0; }
.bs-league-tag,
.bs-status-pill {
  border-radius: var(--r-xs) !important;
  background: var(--surface-raised) !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-size: 0.625rem !important;
}
.br-filter-pills {
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  padding-right: 28px;
}

/* Prevent header overlap at narrow desktop / tablet widths */
@media (max-width: 1240px) {
  .catalog-header { padding: 0 18px; gap: 10px; }
  .header-left { gap: 12px; flex-shrink: 0; }
  .search-form { flex: 1 1 140px; min-width: 120px; }
  .games-status { display: none; }
  .scope-tab { padding: 5px 9px; }
  .scope-count { display: none; }
}

/* Mobile header clean 2-row grid — zero overlap */
@media (max-width: 720px) {
  .rail-sports {
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    padding-right: 24px;
  }
  .catalog-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 8px;
    padding: 10px 14px;
  }
  .header-left {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .scope-switcher { order: 3; width: 100%; justify-content: center; }
  .search-form {
    grid-column: 1;
    grid-row: 2;
    order: unset;
    width: 100%;
    max-width: none;
  }
  .catalog-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

/* ==========================================================================
   Full-Width Interactive Calendar (Events Inside Cells) + Sport Indicators
   ========================================================================== */
.sport-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.row-league {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.cal-full-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.cal-full-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.cal-full-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-rail);
}
.cal-full-wd {
  padding: 8px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-rail);
}

.cal-day-cell {
  min-height: 126px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--t-fast) var(--ease);
}
.cal-day-cell.is-outside,
.cal-day-cell.is-empty {
  background: rgba(9, 10, 14, 0.55);
}
.cal-day-cell.has-events {
  cursor: pointer;
  background: #0C0E14;
}
.cal-day-cell.has-events:hover {
  background: var(--surface);
}
.cal-day-cell.is-selected {
  background: var(--surface);
  box-shadow: inset 0 2px 0 var(--accent);
}

.cal-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.cal-cell-num {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.cal-day-cell.has-events .cal-cell-num { color: var(--text); }
.cal-day-cell.is-today .cal-cell-num { color: var(--accent); }
.cal-today-tag {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent);
}
.cal-cell-count {
  font-size: 0.625rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-event-chip {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  border-radius: var(--r-xs);
  padding: 3px 5px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 0.6875rem;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: background var(--t-fast) var(--ease);
}
.cal-event-chip:hover {
  background: var(--surface-raised);
}
.cal-ev-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-size: 0.625rem;
  flex-shrink: 0;
}
.cal-ev-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  min-width: 0;
}
.cal-cell-more {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 4px 0;
}
.cal-day-cell.is-selected .cal-cell-more { color: var(--accent); }

@media (max-width: 960px) {
  .cal-full-grid { overflow-x: auto; grid-template-columns: repeat(7, minmax(112px, 1fr)); }
}

/* ==========================================================================
   News Outlet Badges (B/R sidebar)
   ========================================================================== */
.br-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.br-outlet-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ==========================================================================
   Tiny Floating Voice Note Mic + Sender Name + Incoming Voice Banner
   ========================================================================== */
.voice-fab-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 56;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  transition: right var(--t-panel) var(--ease);
}
.app-shell.sidebar-open .voice-fab-wrap {
  right: calc(var(--sidebar-w) + 20px);
}
.voice-fab-wrap > * { pointer-events: auto; }

.voice-fab-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-name-pill {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 27, 0.9);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.voice-fab-wrap:hover .voice-name-pill,
.voice-fab-wrap:focus-within .voice-name-pill {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.voice-name-pill:hover { color: var(--text); border-color: var(--accent-line); }
.voice-name-pill.has-name { color: var(--text); }

.voice-fab {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 27, 0.92);
  backdrop-filter: blur(12px);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.voice-fab:hover,
.voice-fab:focus-visible {
  background: var(--surface-raised);
  color: var(--text);
  border-color: var(--accent-line);
}
.voice-fab.recording {
  background: var(--live);
  border-color: var(--live);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(255, 77, 94, 0.25), 0 10px 28px rgba(0, 0, 0, 0.5);
  animation: vb-rec-pulse 1.2s ease-in-out infinite;
}
@keyframes vb-rec-pulse {
  50% { box-shadow: 0 0 0 11px rgba(255, 77, 94, 0.08), 0 10px 28px rgba(0, 0, 0, 0.5); }
}

.voice-name-pop {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}
.voice-name-input {
  width: 148px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  outline: none;
}
.voice-name-input:focus { border-color: var(--accent-line); }

.voice-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(17, 20, 27, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  font-size: 0.75rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.voice-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.vb-sender { font-weight: 600; color: var(--text); }
.vb-dur { color: var(--text-dim); font-variant-numeric: tabular-nums; }

.vb-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.vb-eq i {
  display: block;
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: var(--accent);
  animation: vb-eq-bar 0.7s ease-in-out infinite alternate;
}
.vb-eq.is-rec i { background: var(--live); }
.vb-eq i:nth-child(2) { animation-delay: 0.15s; height: 10px; }
.vb-eq i:nth-child(3) { animation-delay: 0.3s; height: 7px; }
@keyframes vb-eq-bar {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

@media (max-width: 720px) {
  .app-shell.sidebar-open .voice-fab-wrap { right: 16px; }
  .voice-fab-wrap { right: 16px; bottom: 16px; }
}
body.is-tv .voice-fab-wrap {
  right: max(32px, 4vw);
  bottom: max(32px, 5vh);
}
body.is-tv .voice-fab { width: 52px; height: 52px; }
body.is-tv .voice-name-pill { opacity: 1; transform: none; pointer-events: auto; }

/* ==========================================================================
   Optimized TV Cast Remote Overlay (local video paused while casting to TV)
   ========================================================================== */
.cast-remote-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  background: radial-gradient(circle at 50% 35%, #141926 0%, #090A0E 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}
.cast-remote-card {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.cast-remote-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.cast-remote-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.cast-remote-sub {
  margin: -10px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.cast-remote-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.cast-remote-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8125rem;
  color: var(--text);
}
.cast-remote-slot.is-audio {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.cast-remote-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ---------- Fix Cast Banner Overlap ---------- */
.cast-active-banner {
  top: max(16px, env(safe-area-inset-top, 16px)) !important;
  bottom: auto !important;
  z-index: 30;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Android TV — catalog scrolling
   One scroll container only: .catalog-body. The drawer is pinned to the
   viewport so the document cannot scroll behind it, the header stays sticky,
   and rows below the fold are reachable by wheel, touch or D-pad.
   ========================================================================== */
body.is-tv .catalog-drawer,
body.is-tv .catalog-drawer.is-overlay {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.is-tv .catalog-body {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}
body.is-tv .catalog-header,
body.is-tv .catalog-main {
  flex: 0 0 auto;
}

/* ==========================================================================
   Android TV — one predictable control strip
   Dock, audio switcher and cast banner sit in a SINGLE horizontal row in
   #tvControls. No flex wrapping (the old wrap made remote buttons jump into
   extra rows and overlap), every control is at least 48px, and the strip is
   raised above the companion sidebar so its buttons stay clickable.
   The stage still reserves --tv-control-zone below the slot Source/Feed bars.
   Placed last so it wins over the earlier .cast-active-banner top !important.
   ========================================================================== */
body.is-tv {
  --tv-control-zone: 112px;
}
body.is-tv .player-stage {
  box-sizing: border-box;
  padding-bottom: var(--tv-control-zone);
  /* Let the fixed strip's z-index compete in the root stacking context;
     otherwise the sidebar (z 35) covers buttons at the right of the strip. */
  z-index: auto;
}
body.is-tv .tv-control-strip {
  position: fixed;
  left: 24px;
  /* Leave room at the right for the voice-note FAB; it sits above the strip
     in z-order and used to swallow clicks on the cast banner's buttons. */
  right: 272px;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  z-index: 40;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
body.is-tv .app-shell.sidebar-open .tv-control-strip {
  right: calc(var(--sidebar-w) + 272px);
}
body.is-tv:has(.app-shell.sidebar-open) .voice-fab-wrap {
  right: calc(var(--sidebar-w) + 32px);
}
body.is-tv .tv-control-strip .floating-dock,
body.is-tv .tv-control-strip .dock-audio-bar,
body.is-tv .tv-control-strip .cast-active-banner {
  position: static;
  left: auto;
  right: auto;
  top: auto !important;
  bottom: auto !important;
  transform: none;
  width: auto;
  max-width: none;
  min-width: 0;
  height: 66px;
  box-sizing: border-box;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  opacity: 1 !important;
  pointer-events: auto !important;
}
body.is-tv .tv-control-strip .floating-dock { flex: 0 0 auto; }
body.is-tv .tv-control-strip .dock-audio-bar { flex: 1 1 auto; }
body.is-tv .tv-control-strip .cast-active-banner { flex: 0 0 auto; }
body.is-tv .tv-control-strip .floating-dock::-webkit-scrollbar,
body.is-tv .tv-control-strip .dock-audio-bar::-webkit-scrollbar,
body.is-tv .tv-control-strip .cast-active-banner::-webkit-scrollbar { display: none; }
body.is-tv .tv-control-strip .dock-btn,
body.is-tv .tv-control-strip .dock-audio-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  min-height: 48px;
  min-width: 48px;
  padding: 0 18px;
  font-size: 1rem;
}
body.is-tv .tv-control-strip .dock-brand,
body.is-tv .tv-control-strip .dock-audio-label,
body.is-tv .tv-control-strip #castActiveText {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 6px;
  white-space: nowrap;
}
body.is-tv .tv-control-strip .focusable:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.85);
  z-index: 2;
}
body.is-tv .player-stage.ui-idle .tv-control-strip .floating-dock,
body.is-tv .player-stage.ui-idle .tv-control-strip .dock-audio-bar,
body.is-tv .player-stage.ui-idle .tv-control-strip .cast-active-banner,
body.is-tv .player-stage.ui-idle .video-slot:not(.slot-loading) .slot-overlay-top,
body.is-tv .player-stage.ui-idle .video-slot:not(.slot-loading) .slot-overlay-bottom {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* TV remote: every interactive control gets a >=48px hit target. */
body.is-tv button.focusable,
body.is-tv summary.focusable,
body.is-tv a.focusable {
  min-height: 48px;
  min-width: 48px;
}
body.is-tv input.focusable { min-height: 48px; }

/* TV remote: every visible control is a full 48px target, including the
   per-slot Source/Feed chips and the voice-note name pill. */
body.is-tv .slot-chip,
body.is-tv .voice-name-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 12px;
  font-size: 0.9rem;
}
/* Higher-specificity override: hidden chips must not consume D-pad stops. */
body.is-tv .slot-arrange-chip { display: none; }
body.is-tv .video-grid.arranging .slot-arrange-chip { display: inline-flex; }

/* Android TV two-decoder cap: parked slots stay in the grid with a hint. */
body.is-tv .video-slot.tv-suspended::after {
  content: "Paused · focus to play";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 10, 15, 0.78);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 6;
}

/* Feature B — TV geometry: the slot already ends above the reserved
   --tv-control-zone; the extra bottom inset keeps the panel clear of a
   two-row Source/Feed bar as well. Cards stay large D-pad targets. */
body.is-tv .slot-replace-panel {
  left: 18px;
  right: 18px;
  top: 76px;
  bottom: 128px;
  padding: 14px 16px;
  gap: 12px;
}

body.is-tv .slot-replace-title { font-size: 1.1rem; }
body.is-tv .slot-replace-cards { gap: 12px; }
body.is-tv button.slot-replace-card { min-height: 64px; padding: 10px 14px; }
body.is-tv .slot-replace-card-title { font-size: 1rem; }
body.is-tv .slot-replace-card-meta { font-size: 0.85rem; }
body.is-tv button.slot-replace-keep { min-height: 52px; font-size: 0.92rem; }

/* Idle overlay auto-hide must NOT swallow the replacement panel: the viewer
   still has to choose with the remote. */
.player-stage.ui-idle .video-slot:not(.slot-loading) .slot-replace-panel,
body.is-tv .player-stage.ui-idle .video-slot:not(.slot-loading) .slot-replace-panel {
  opacity: 1 !important;
  pointer-events: auto !important;
}
