/* Remote Stream Base — fixed to viewport, no page scroll */

:root {
  --remote-bg0: #07070a;
  --remote-bg1: #121218;
  --remote-fg: #fafafa;
  --remote-muted: #9ca3af;
  --remote-accent: #fe2c55;
  --remote-accent-soft: rgba(254, 44, 85, 0.18);
  --remote-line: rgba(255, 255, 255, 0.08);
  --remote-panel: rgba(18, 18, 24, 0.92);
  --remote-focus: #facc15;
  --remote-ok: #34d399;
  --remote-warn: #fbbf24;
  --panel: #181822;
  --panel-2: #26262f;
  --text: var(--remote-fg);
  --muted: var(--remote-muted);
  --border: #3a3a44;
  --input-bg: #14141a;
  --accent: var(--remote-accent);
  /* TV browsers often used ~75% page zoom before fullscreen; match that density. */
  --remote-ui-scale: 0.75;
  --remote-safe-x: clamp(0.75rem, 2.2vw, 1.75rem);
  --remote-safe-y: clamp(0.55rem, 1.6vh, 1.15rem);
  --remote-font: "Outfit", system-ui, sans-serif;
  --remote-mono: "Space Grotesk", system-ui, sans-serif;
  --remote-radius: 12px;
  --remote-chrome-h: clamp(2.6rem, 7.2vh, 3.4rem);
  --remote-alert-h: clamp(2.4rem, 6.5vh, 3.2rem);
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
}

html, body {
  margin: 0;
  color: var(--remote-fg);
  font-family: var(--remote-font);
  font-size: clamp(16px, 1.35vw + 0.4vh, 22px);
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(254, 44, 85, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(56, 189, 248, 0.06), transparent 50%),
    linear-gradient(180deg, var(--remote-bg1), var(--remote-bg0));
}

body.remote-body {
  zoom: var(--remote-ui-scale);
  /* Zoom shrinks laid-out height — expand so the 2×2 grid fills the viewport. */
  height: calc(100dvh / var(--remote-ui-scale));
  max-height: calc(100vh / var(--remote-ui-scale));
}

@supports not (zoom: 1) {
  body.remote-body {
    zoom: unset;
    transform: scale(var(--remote-ui-scale));
    transform-origin: top left;
    width: calc(100% / var(--remote-ui-scale));
    height: calc(100dvh / var(--remote-ui-scale));
    max-height: calc(100vh / var(--remote-ui-scale));
  }
}

body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.remote-body {
  height: calc(100dvh / var(--remote-ui-scale));
  max-height: calc(100vh / var(--remote-ui-scale));
  padding: var(--remote-safe-y) var(--remote-safe-x);
  padding-top: max(var(--remote-safe-y), env(safe-area-inset-top, 0px));
  padding-bottom: max(var(--remote-safe-y), env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.remote-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #92400e;
  color: #fef3c7;
  text-align: center;
  padding: 0.4rem 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  border-bottom: 1px solid rgba(253, 230, 138, 0.35);
  pointer-events: none;
}

.remote-banner[hidden] {
  display: none !important;
}

.remote-idle-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: var(--remote-safe-y) var(--remote-safe-x);
  background: rgba(7, 7, 10, 0.88);
  backdrop-filter: blur(8px);
}
.remote-idle-screen[hidden] { display: none !important; }
.remote-portrait-gate { z-index: 100100; }
body.remote-body.is-portrait-blocked { overflow: hidden; }
.remote-portrait-icon {
  margin: 0;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--remote-accent, #7dd3fc);
  transform: rotate(90deg);
}
.remote-idle-card {
  width: min(28rem, 100%);
  background: var(--remote-panel);
  border: 1px solid var(--remote-line);
  border-radius: 16px;
  padding: 1.5rem 1.35rem;
  text-align: center;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}
.remote-idle-card h2 {
  margin: 0;
  font-family: var(--remote-font);
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
}
.remote-idle-card p { margin: 0; max-width: 26ch; line-height: 1.45; }

.remote-screen {
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.remote-screen[hidden] {
  display: none !important;
}

.remote-screen--center {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.35rem, 1.2vh, 0.75rem);
  max-width: 42rem;
  margin: 0 auto;
  overflow: hidden;
}

/* Pair / enable-sounds must sit above battle HUD (z-index 100000) when linking mid-battle. */
body.remote-body[data-screen="pair"] #screenPair,
body.remote-body[data-screen="audio"] #screenAudio {
  position: fixed;
  inset: 0;
  z-index: 100080;
  max-width: none;
  margin: 0;
  padding: var(--remote-safe-y) var(--remote-safe-x);
  padding-top: max(var(--remote-safe-y), env(safe-area-inset-top, 0px));
  padding-bottom: max(var(--remote-safe-y), env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(254, 44, 85, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(56, 189, 248, 0.06), transparent 50%),
    linear-gradient(180deg, var(--remote-bg1), var(--remote-bg0));
}

.remote-brand {
  margin: 0;
  font-size: clamp(1.25rem, 2.8vh + 1vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--remote-fg);
  line-height: 1;
  flex-shrink: 0;
}

.remote-brand-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 0.25rem;
}

.remote-brand-logo {
  width: clamp(72px, 12vh, 112px);
  height: auto;
  object-fit: contain;
}

.remote-brand-logo--sm {
  width: 22px;
  height: 22px;
  margin-right: 0.4rem;
  vertical-align: -0.2em;
  border-radius: 5px;
}

.remote-brand--compact {
  font-size: clamp(0.85rem, 1.8vh, 1.05rem);
  letter-spacing: -0.02em;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
}

.remote-title {
  font-size: clamp(1.35rem, 3.2vh + 0.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.15;
  flex-shrink: 0;
}

.remote-title--dialog {
  font-size: clamp(1.25rem, 2.5vh, 1.75rem);
  margin-bottom: 0.25rem;
}

.remote-hint {
  color: var(--remote-muted);
  font-size: clamp(0.9rem, 1.8vh, 1.05rem);
  line-height: 1.35;
  max-width: 34rem;
  margin: 0;
  flex-shrink: 0;
}

.remote-hint strong { color: var(--remote-fg); font-weight: 700; }

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

.remote-handle {
  color: var(--remote-muted);
  font-weight: 600;
  margin-left: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 18vw;
}

.remote-pin-display {
  font-family: var(--remote-mono);
  font-size: clamp(2rem, 8vh, 4.25rem);
  letter-spacing: 0.18em;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
  min-height: 1.1em;
  color: var(--remote-fg);
  text-shadow: 0 0 40px var(--remote-accent-soft);
  flex-shrink: 0;
}

.remote-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 6.5rem));
  gap: clamp(0.35rem, 1vh, 0.65rem);
  justify-content: center;
  margin: 0;
  flex-shrink: 0;
}

.remote-key {
  min-height: clamp(44px, 7.2vh, 64px);
  font-family: inherit;
  font-size: clamp(1.15rem, 2.8vh, 1.55rem);
  font-weight: 700;
  border: 1px solid var(--remote-line);
  border-radius: var(--remote-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--remote-fg);
  cursor: pointer;
}

.remote-btn {
  min-height: clamp(40px, 5.8vh, 48px);
  min-width: 0;
  padding: 0.35rem 0.85rem;
  font-family: inherit;
  font-size: clamp(0.82rem, 1.5vh + 0.35vw, 0.98rem);
  font-weight: 700;
  border: 1px solid var(--remote-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--remote-fg);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.remote-btn-primary {
  background: var(--remote-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(254, 44, 85, 0.25);
}

.remote-btn-danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
}

.remote-btn-xl {
  min-height: clamp(64px, 12vh, 88px);
  font-size: clamp(1.15rem, 3vh, 1.45rem);
  padding: 0.75rem 1.75rem;
  border-radius: 16px;
}

.remote-btn-wide {
  width: min(22rem, 100%);
}

.remote-key:focus-visible,
.remote-btn:focus-visible,
.remote-panel-head:focus-visible,
.remote-mute-row:focus-visible,
input:focus-visible {
  outline: 3px solid var(--remote-focus);
  outline-offset: 2px;
}

.remote-error {
  color: #fca5a5;
  margin: 0;
  font-weight: 600;
  flex-shrink: 0;
}

/* —— Live chrome (single row, no wrap) —— */
.remote-live {
  flex: 1 1 auto;
  min-height: 0;
  gap: clamp(0.4rem, 1.1vh, 0.7rem);
  width: 100%;
}

.remote-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-height: var(--remote-chrome-h);
}

.remote-chrome-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 0 1 auto;
}

.remote-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(0.9rem, 2vh, 1.05rem);
  font-weight: 700;
  min-width: 0;
}

.remote-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #52525b;
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.25);
  flex-shrink: 0;
}
.remote-dot.on {
  background: var(--remote-ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}
.remote-dot.warn {
  background: var(--remote-warn);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
}

.remote-tts-denied-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: rgba(20, 20, 28, 0.94);
  color: #f8fafc;
  font-size: clamp(0.95rem, 2.2vh, 1.15rem);
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: min(92vw, 26rem);
  text-align: center;
}

.remote-tts-denied-toast[hidden] {
  display: none !important;
}

.remote-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.remote-last-alert {
  border: 1px solid var(--remote-line);
  border-left: 4px solid var(--remote-accent);
  border-radius: var(--remote-radius);
  background: var(--remote-panel);
  padding: 0.45rem 0.9rem;
  font-size: clamp(0.95rem, 2.2vh, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  height: var(--remote-alert-h);
  min-height: 0;
  max-height: var(--remote-alert-h);
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.remote-last-alert.is-idle {
  border-left-color: rgba(255, 255, 255, 0.2);
  color: var(--remote-muted);
  font-weight: 600;
}

/* 2×2 fills remaining viewport */
.remote-grid {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(0.4rem, 1vh, 0.75rem);
  overflow: hidden;
  align-content: stretch;
}

.remote-panel {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--remote-line);
  border-radius: var(--remote-radius);
  background: var(--remote-panel);
  overflow: hidden;
}

.remote-chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--remote-line);
  background: rgba(255, 255, 255, 0.03);
}
.remote-chat-head .remote-panel-head {
  border-bottom: 0;
  background: transparent;
  flex: 0 0 auto;
}
.remote-chat-head .cohost-open-btn {
  border: 1px solid rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.14);
  color: inherit;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}
.remote-chat-head .cohost-connect-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem 0.25rem 0;
  flex: 1 1 auto;
  min-width: 0;
}
.cohost-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid color-mix(in srgb, var(--cohost-accent, #14b8a6) 55%, transparent);
  background: color-mix(in srgb, var(--cohost-accent, #14b8a6) 16%, transparent);
  color: inherit;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.cohost-connect-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cohost-connect-btn.is-listening {
  background: color-mix(in srgb, var(--cohost-accent, #14b8a6) 30%, transparent);
}
.cohost-connect-dot {
  width: 0.4rem; height: 0.4rem; border-radius: 50%;
  background: var(--cohost-accent, #14b8a6);
}
.cohost-picker-card {
  width: min(28rem, calc(100vw - 2rem));
  max-height: min(70vh, 32rem);
  display: flex;
  flex-direction: column;
}
.cohost-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: auto;
  min-height: 0;
}
.cohost-picker-empty {
  margin: 0.35rem 0;
  font-size: 0.85rem;
  opacity: 0.75;
  line-height: 1.4;
}
.cohost-picker-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.cohost-picker-row:disabled { opacity: 0.65; cursor: default; }
.cohost-picker-row.is-active { border-color: rgba(20, 184, 166, 0.55); }
.cohost-picker-av {
  width: 1.85rem; height: 1.85rem; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.cohost-picker-av--ph {
  display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700;
  background: rgba(148, 163, 184, 0.35);
}
.cohost-picker-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cohost-picker-name { font-weight: 700; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cohost-picker-handle { font-size: 0.72rem; opacity: 0.7; }
.cohost-picker-action { font-size: 0.72rem; font-weight: 700; opacity: 0.85; flex-shrink: 0; }
.guest-presence-strip {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  padding: 0.25rem 0.45rem;
  border-bottom: 1px solid var(--remote-line);
  font-size: 0.7rem;
  max-height: 4.5rem;
  overflow-y: auto;
}
.guest-presence-label {
  opacity: 0.7;
  font-weight: 700;
  flex-shrink: 0;
  padding-top: 0.15rem;
}
.guest-presence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  flex: 1 1 auto;
  min-width: 0;
}
.guest-presence-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  border-radius: 999px; padding: 0.08rem 0.4rem 0.08rem 0.12rem;
  background: rgba(148, 163, 184, 0.16);
}
.guest-presence-strip.is-crowded .guest-presence-chip {
  padding: 0.06rem;
  border-radius: 50%;
}
.guest-presence-strip.is-crowded .guest-presence-name { display: none; }
.guest-presence-av {
  width: 1.05rem; height: 1.05rem; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.guest-presence-av--ph {
  display: inline-grid; place-items: center; font-size: 0.6rem; font-weight: 700;
  background: rgba(148, 163, 184, 0.35);
}
.guest-presence-name {
  max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.remote-feed .event-row--cohost {
  position: relative;
  background: color-mix(in srgb, var(--cohost-accent, #14b8a6) 16%, transparent);
  border-color: color-mix(in srgb, var(--cohost-accent, #14b8a6) 70%, transparent) !important;
  border-left-width: 5px !important;
  border-left-color: var(--cohost-accent, #14b8a6) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cohost-accent, #14b8a6) 22%, transparent);
}
.remote-feed .event-row--cohost .event-label {
  color: var(--cohost-accent, #14b8a6);
  font-weight: 750;
}
.remote-feed .cohost-badge {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0.04rem 0.35rem;
  border-radius: 999px;
  font-size: 0.7em;
  font-weight: 800;
  background: var(--cohost-accent, #14b8a6);
  color: #041016;
}
.remote-feed .cohost-msg-prefix {
  display: inline-block;
  margin-right: 0.28rem;
  padding: 0.02rem 0.3rem;
  border-radius: 6px;
  font-size: 0.78em;
  font-weight: 800;
  background: color-mix(in srgb, var(--cohost-accent, #14b8a6) 28%, transparent);
  color: var(--cohost-accent, #14b8a6);
}
html.light-mode .remote-feed .cohost-badge {
  color: #fff;
}

.remote-panel .chat-feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem 0.15rem;
  flex-shrink: 0;
}
.remote-panel .chat-feed-filters[hidden] { display: none !important; }
.remote-panel .chat-feed-filter-btn {
  appearance: none;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.25;
}
.remote-panel .chat-feed-filter-btn.is-active {
  border-color: color-mix(in srgb, var(--cohost-accent, #3b82f6) 55%, transparent);
  background: color-mix(in srgb, var(--cohost-accent, #3b82f6) 18%, transparent);
}
.remote-feed .event-row[data-chat-room][hidden] {
  display: none !important;
}

.remote-panel-head {
  flex-shrink: 0;
  margin: 0;
  padding: 0.28rem 0.55rem;
  font-family: inherit;
  font-size: clamp(0.68rem, 1.35vh, 0.8rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--remote-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  border-bottom: 1px solid var(--remote-line);
  cursor: pointer;
}

.remote-panel-head:focus-visible {
  color: var(--remote-fg);
}

/* Spotlight: one large panel + three smaller, all visible */
.remote-live.spotlight-on .remote-grid {
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(0.3rem, 0.8vh, 0.55rem);
}

.remote-live.spotlight-on .remote-panel.is-spotlight {
  grid-column: 1;
  grid-row: 1 / -1;
  border-color: rgba(254, 44, 85, 0.55);
  box-shadow: 0 0 0 1px rgba(254, 44, 85, 0.2);
  display: flex;
}

.remote-live.spotlight-on .remote-panel:not(.is-spotlight) {
  display: flex;
  grid-column: 2;
}

.remote-live.spotlight-on .remote-panel.is-spotlight .remote-panel-head {
  color: var(--remote-fg);
  border-bottom-color: rgba(254, 44, 85, 0.35);
}

.remote-feed {
  margin: 0;
  padding: 0.35rem 0.4rem 0.45rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.remote-feed > * + * {
  margin-top: 0.35rem;
}

.remote-feed .empty-state {
  color: var(--remote-muted);
  text-align: center;
  padding: 0.85rem 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.remote-feed .avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 2.15em;
  height: 2.15em;
}

.remote-feed .avatar,
.remote-feed .avatar-placeholder {
  width: 2.15em;
  height: 2.15em;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a35;
  display: block;
}

.remote-feed .avatar-badges {
  position: absolute;
  right: -0.2em;
  bottom: -0.15em;
  display: flex;
  gap: 0.1em;
}

.remote-feed .member-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05em;
  height: 1.05em;
  padding: 0 0.15em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.58em;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.remote-feed .member-badge.fan-club { background: #c026d3; }
.remote-feed .member-badge.super-fan { background: #f5c542; color: #1a1200; }

.remote-feed .gift-icon {
  width: 2.2em;
  height: 2.2em;
  object-fit: contain;
  flex-shrink: 0;
}

.remote-feed .emote-inline {
  height: 1.35em;
  width: auto;
  max-width: 1.35em;
  max-height: 1.35em;
  vertical-align: middle;
  object-fit: contain;
  margin: 0 0.08em;
  display: inline-block;
}

.remote-feed .event-row,
.remote-feed .glance-row,
.remote-feed .like-row {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 0.5em;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.55em;
  border: 2px solid var(--remote-line);
  font-size: clamp(0.78rem, 1.55vh, 0.95rem);
  flex-shrink: 0;
  min-width: 0;
}

.remote-feed .event-row.is-latest,
.remote-feed .glance-row.is-latest,
.remote-feed .like-row.is-latest {
  background: rgba(254, 44, 85, 0.12);
  box-shadow: 0 0 0 1px rgba(254, 44, 85, 0.28);
}

.remote-feed .event-body,
.remote-feed .glance-body {
  flex: 1;
  min-width: 0;
}

.remote-feed .event-label,
.remote-feed .glance-type {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--remote-muted);
  font-weight: 700;
}

.remote-feed .glance-type { color: #c084fc; }

.remote-feed .event-text,
.remote-feed .glance-text {
  color: var(--remote-fg);
  line-height: 1.3;
  word-break: break-word;
}

.remote-feed .glance-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remote-feed .event-text strong { color: #93c5fd; font-weight: 650; }

.remote-feed .event-time,
.remote-feed .glance-time {
  font-size: 0.7em;
  color: var(--remote-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  align-self: flex-start;
}

.remote-feed .like-row {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  cursor: pointer;
}

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

.remote-feed .like-count {
  margin-left: auto;
  font-weight: 700;
  color: #22c55e;
  font-variant-numeric: tabular-nums;
}

.remote-feed .border-rainbow {
  border-image: linear-gradient(90deg, #fe2c55, #a855f7, #3b82f6, #22c55e) 1;
}

.remote-feed:empty::before {
  content: "Waiting…";
  display: block;
  color: var(--remote-muted);
  padding: 0.75rem 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

html.light-mode .remote-feed .avatar,
html.light-mode .remote-feed .avatar-placeholder {
  background: #e2e8f0;
}

html.light-mode .remote-feed .event-row,
html.light-mode .remote-feed .glance-row {
  background: rgba(15, 23, 42, 0.04);
}

html.light-mode .remote-feed .like-row {
  background: rgba(34, 197, 94, 0.1);
}

/* —— Settings overlay —— */
.remote-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: var(--remote-safe-y) var(--remote-safe-x);
  z-index: 100090;
  overflow: hidden;
}

.remote-overlay[hidden] {
  display: none !important;
}

.remote-overlay-card {
  background: linear-gradient(165deg, #1a1a22, #101016);
  border: 1px solid var(--remote-line);
  border-radius: 18px;
  padding: 1rem 1.15rem 0.95rem;
  width: min(640px, 100%);
  max-height: min(88dvh, 88vh);
  overflow: hidden;
  overscroll-behavior: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.remote-settings-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(720px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
}

.remote-settings-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.remote-settings-head .remote-title--dialog {
  margin: 0;
}

.remote-settings-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.remote-settings-tab {
  min-height: 44px;
  border: 1px solid var(--remote-line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--remote-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
}

.remote-settings-tab.is-active {
  color: var(--remote-fg);
  border-color: rgba(254, 44, 85, 0.65);
  background: var(--remote-accent-soft);
}

.remote-settings-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.remote-settings-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  padding-right: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.remote-settings-panel::-webkit-scrollbar {
  width: 6px;
}

.remote-settings-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.remote-settings-panel.is-active {
  display: flex;
}

.remote-settings-panel[hidden] {
  display: none !important;
}

.remote-settings-lead {
  margin: 0 0 0.25rem;
  color: var(--remote-muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.remote-settings-note {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  line-height: 1.3;
}

.remote-inline-note {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}

.remote-settings-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--remote-line);
}

.remote-settings-panel .remote-field {
  margin: 0.28rem 0;
  flex-shrink: 0;
}

.remote-settings-panel .remote-settings-lead {
  flex-shrink: 0;
}

#remoteTtsBody {
  min-height: 0;
}

.remote-tts-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 0.75rem;
}

.remote-voice-picker {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
  gap: 0.45rem;
  align-items: stretch;
}

.remote-voice-picker .remote-btn {
  min-width: 0;
  font-size: 1.15rem;
  padding-left: 0;
  padding-right: 0;
}

.remote-voice-current {
  min-width: 0;
  border: 1px solid var(--remote-line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
}

.remote-voice-current strong {
  font-size: 0.95rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-voice-current .remote-muted {
  font-size: 0.78rem;
}

.remote-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.45rem 0;
}

.remote-field-label {
  font-size: 0.95rem;
  font-weight: 650;
}

.remote-mute-heading {
  margin: 0.35rem 0 0.25rem;
  color: var(--remote-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.remote-field input[type="range"] {
  width: 100%;
  min-height: 36px;
  accent-color: var(--remote-accent);
}

.remote-select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--remote-line);
  background: color-mix(in srgb, var(--remote-panel) 82%, transparent);
  color: var(--remote-fg);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
}

.remote-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 40px;
}

.remote-check input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--remote-accent);
  flex-shrink: 0;
}

.remote-stepper {
  display: flex;
  gap: 0.55rem;
}

.remote-stepper .remote-btn {
  min-width: 3.75rem;
  font-size: 1.25rem;
}

.remote-mute-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  min-height: 0;
}

.remote-mute-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  flex: 1 1 auto;
  align-content: start;
}

.remote-mute-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.22rem 0.4rem;
  border: 1px solid var(--remote-line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  color: inherit;
  width: 100%;
  text-align: left;
}

.remote-mute-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-mute-row.on { border-color: rgba(52, 211, 153, 0.55); }
.remote-mute-row.off { opacity: 0.55; }

#remoteTtsBody.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.remote-feed .like-row-anonymous .avatar-placeholder {
  opacity: 0.55;
}

.remote-spotlight-card {
  width: min(520px, 100%);
  max-height: min(88dvh, 88vh);
  overflow: hidden;
}

/* —— Pair page (phone) may scroll; TV remote live does not —— */
.remote-pair-page.remote-body {
  overflow: auto;
  overscroll-behavior: auto;
  max-height: none;
  height: auto;
  min-height: 100dvh;
}

.remote-pair-page .remote-pin-huge {
  font-family: var(--remote-mono);
  font-size: clamp(2.5rem, 10vw, 5rem);
  letter-spacing: 0.18em;
  font-weight: 700;
  margin: 0.75rem 0;
}

.remote-session-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  width: min(40rem, 100%);
}

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

@media (max-width: 600px) {
  .remote-settings-card,
  .remote-spotlight-card {
    width: min(100vw - 1rem, 100%);
    max-height: min(88dvh, 100%);
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }

  .remote-settings-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remote-pair-page.remote-body {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .remote-pair-page .remote-session-list li {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

@media (max-width: 900px) {
  .remote-chrome {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .remote-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-height: 520px) {
  .remote-brand--compact { display: none; }
  .remote-key { min-height: 40px; }
  .remote-btn-xl { min-height: 56px; font-size: 1.1rem; }
}

.remote-theme-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.15rem;
  border-radius: 999px;
  border: 1px solid var(--remote-line);
  background: rgba(0, 0, 0, 0.2);
}

.remote-theme-btn.is-active,
.remote-sound-btn.is-active {
  background: var(--remote-accent);
  border-color: transparent;
  color: #fff;
}

.remote-spotlight-choices {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.5rem 0 1rem;
}

.remote-spotlight-choice {
  width: 100%;
}


html.light-mode {
  --remote-bg0: #d2d2da;
  --remote-bg1: #dedee6;
  --remote-fg: #1a1a22;
  --remote-muted: #52525c;
  --remote-line: rgba(24, 24, 27, 0.14);
  --remote-panel: rgba(226, 226, 234, 0.94);
  --remote-focus: #ca8a04;
  --remote-accent-soft: rgba(254, 44, 85, 0.12);
  --panel: #e2e2ea;
  --panel-2: #ceced8;
  --text: var(--remote-fg);
  --muted: var(--remote-muted);
  --border: #b0b0bc;
  --input-bg: #d6d6de;
  --accent: var(--remote-accent);
}

html.light-mode body,
html.light-mode .remote-body {
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(254, 44, 85, 0.1), transparent 55%),
    linear-gradient(180deg, var(--remote-bg1), var(--remote-bg0));
}

html.light-mode .remote-btn {
  background: rgba(24, 24, 27, 0.05);
  color: var(--remote-fg);
}

html.light-mode .remote-btn-primary {
  background: var(--remote-accent);
  color: #fff;
}

html.light-mode .remote-btn-danger {
  background: rgba(254, 226, 226, 0.9);
  color: #991b1b;
  border-color: rgba(248, 113, 113, 0.55);
}

html.light-mode .remote-key {
  background: rgba(255, 255, 255, 0.85);
}

html.light-mode .remote-panel-head {
  background: rgba(24, 24, 27, 0.03);
}

html.light-mode .remote-theme-toggle {
  background: rgba(255, 255, 255, 0.7);
}

html.light-mode .remote-overlay-card {
  background: linear-gradient(165deg, #ffffff, #f4f4f5);
}

html.light-mode .remote-settings-tab {
  background: rgba(0, 0, 0, 0.04);
}

html.light-mode .remote-settings-tab.is-active {
  background: rgba(254, 44, 85, 0.12);
}

html.light-mode .remote-voice-current {
  background: rgba(0, 0, 0, 0.04);
}

html.light-mode .remote-mute-row {
  background: rgba(24, 24, 27, 0.04);
}

html.light-mode .remote-last-alert.is-idle {
  border-left-color: rgba(24, 24, 27, 0.2);
}

.remote-soft-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0 1rem 0.45rem;
}
.remote-soft-connect[hidden] {
  display: none !important;
}
.remote-desk-timer {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--remote-fg);
  letter-spacing: 0.01em;
}
.remote-setup-live-btn.is-on {
  background: #0f766e;
  color: #ecfdf5;
  border-color: #0f766e;
}
.remote-desk-timer.is-warn {
  color: var(--remote-warn, #fbbf24);
}
.remote-desk-timer[hidden] {
  display: none !important;
}

html.light-mode .remote-desk-timer {
  color: #14141a;
}

/* Battle HUD on TV — slightly larger chrome, keep FAB clear of remote actions */
body.remote-body .bm-fab {
  bottom: 1.25rem;
  right: 1.25rem;
  font-size: 1.05rem;
  padding: 0.7rem 1rem;
}

body.remote-body .bm-badge {
  font-size: 1rem;
}

body.remote-body .bm-timer {
  font-size: clamp(1.35rem, 3.5vh, 1.85rem);
}
