:root {
  --bg: #08080c;
  --bg-card: #12131a;
  --bg-elev: #1a1b24;
  --border: #23242f;
  --border-strong: #2e303d;
  --text: #f3f4f6;
  --text-dim: #8b8d9b;
  --text-mute: #5a5c6b;
  --accent: #ff3b5c;
  --accent-soft: rgba(255, 59, 92, 0.15);
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* ===================================================
   NETFLIX-STYLE BROWSE VIEW
   =================================================== */
body.nf {
  background: #0a0a0c;
  overflow-x: hidden;
}

.nf-browse {
  min-height: 100vh;
  opacity: 0;
  animation: nf-fade-in 0.5s ease-out forwards;
}
@keyframes nf-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Nav */
.nf-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  transition: background 0.3s ease;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
}

.nf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.nf-logo-dot {
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(255, 59, 92, 0.6));
  font-size: 22px;
}

.nf-nav-right { display: flex; align-items: center; gap: 10px; }
.nf-search {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  width: 200px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nf-search:focus { border-color: var(--accent, #8a4bff); background: rgba(255,255,255,0.1); }
.nf-sort {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
@media (max-width: 640px) {
  .nf-search { width: 120px; font-size: 12px; padding: 6px 10px; }
  .nf-sort { font-size: 11px; padding: 5px 8px; }
}

.nf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: all 0.25s ease;
}
.nf-pill.on {
  color: #fff;
  background: rgba(255, 59, 92, 0.2);
  border-color: var(--accent);
}

/* Hero */
.nf-hero {
  position: relative;
  height: 88vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 0 48px 80px;
}

.nf-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(138, 75, 255, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 85% 50%, rgba(76, 59, 255, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 20% 30%, rgba(255, 59, 92, 0.25) 0%, transparent 55%),
    linear-gradient(135deg, #0d0d1f 0%, #141335 50%, #1a0e28 100%);
  background-size: cover;
  transform: scale(1.02);
  transition: transform 6s ease-out, filter 0.4s ease;
  animation: bg-breathe 18s ease-in-out infinite alternate;
}
@keyframes bg-breathe {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

.nf-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 30% 50%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 70% 20%, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px, 90px 90px;
  opacity: 0.6;
}

/* Decorative trophy-ish glyph */
.nf-hero-bg::after {
  content: '';
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(180, 200, 255, 0.15) 0%, transparent 70%);
  filter: blur(20px);
  animation: trophy-glow 4s ease-in-out infinite alternate;
}
@keyframes trophy-glow {
  from { opacity: 0.6; transform: translateY(-50%) scale(1); }
  to { opacity: 1; transform: translateY(-50%) scale(1.1); }
}

.nf-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  animation: nf-fade-in 1.2s ease-out;
}

.nf-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.nf-hero.previewing .nf-hero-img { opacity: 0; transition: opacity 0.5s ease; }

.nf-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nf-hero.previewing .nf-hero-video {
  opacity: 1;
}
.nf-hero.previewing .nf-hero-bg {
  opacity: 0;
}

.nf-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, rgba(10,10,12,0.7) 80%, #0a0a0c 100%),
    linear-gradient(90deg, rgba(10,10,12,0.85) 0%, rgba(10,10,12,0.2) 50%, transparent 100%);
  pointer-events: none;
}

.nf-hero-content {
  position: relative;
  max-width: 620px;
  z-index: 2;
  animation: nf-slide-in 0.8s ease-out 0.2s both;
}
@keyframes nf-slide-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.nf-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.nf-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  transition: all 0.25s ease;
}
.nf-live-badge.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.nf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-mute);
}
.nf-live-badge.on .nf-dot {
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
  animation: nf-pulse 1.3s infinite;
}
@keyframes nf-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.8); }
  70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.nf-tag {
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.8);
}

.nf-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}

.nf-desc {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  max-width: 500px;
  margin-bottom: 28px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.nf-desc strong { color: #fff; }

.nf-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nf-play-btn, .nf-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nf-play-btn {
  background: #fff;
  color: #000;
}
.nf-play-btn:hover {
  background: rgba(255,255,255,0.85);
  transform: scale(1.02);
}
.nf-info-btn {
  background: rgba(109,109,110,0.7);
  color: #fff;
}
.nf-info-btn:hover {
  background: rgba(109,109,110,0.5);
  transform: scale(1.02);
}

/* Row */
.nf-row {
  padding: 40px 48px;
  margin-top: -80px;
  position: relative;
  z-index: 3;
}

.nf-row-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.nf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.nf-card {
  cursor: pointer;
  transition: transform 0.3s ease, z-index 0s linear 0.3s;
  position: relative;
}
.nf-card:hover {
  transform: scale(1.08);
  z-index: 10;
  transition: transform 0.3s ease, z-index 0s;
}

.nf-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a28;
}
.nf-card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(138, 75, 255, 0.5) 0%, transparent 60%),
    linear-gradient(135deg, #0d0d1f 0%, #141335 50%, #1a0e28 100%);
}
.nf-card-thumb.ph {
  background: linear-gradient(120deg, #15161e 0%, #1c1d28 50%, #15161e 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ Branded cards (iptv channels — no proper artwork) ============ */
/* These render a deterministic gradient with the channel name as the big visual.
   The actual channel logo, when available, sits as a small badge bottom-left
   (Netflix-style channel attribution).
*/
.nf-card--branded .nf-card-thumb {
  display: flex;
  align-items: stretch;
  background: #14152b;
}
.nf-card--branded .nf-card-watermark {
  position: absolute;
  bottom: -18px;
  right: -12px;
  font-size: 130px;
  line-height: 1;
  opacity: 0.18;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
  pointer-events: none;
  user-select: none;
}
.nf-card--branded .nf-card-brand-title {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.nf-card--branded .nf-card-brand-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 95%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.nf-card--branded .nf-card-brand-sub {
  margin-top: 6px;
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 3px 7px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  backdrop-filter: blur(4px);
  text-transform: uppercase;
}
/* Tiny logo badge top-left when iptv-org supplies one */
.nf-card--branded .nf-card-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: rgba(0,0,0,0.55);
  border-radius: 6px;
  padding: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
}
/* Subtle vignette on top so the LIVE badge stays readable */
.nf-card--branded .nf-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 25%, transparent 60%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
/* Hover: lift effect */
.nf-card--branded:hover .nf-card-watermark { opacity: 0.28; transform: scale(1.05); transition: 0.3s; }
.nf-card--branded:hover .nf-card-brand-title h3 { transform: translateY(-2px); transition: 0.2s; }

/* ============ Status badge (top-right corner of channel cards) ============ */
.nf-card-status {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  z-index: 3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.nf-card-status.st-playable {
  background: #2bd17e;
  color: #06301a;
}
.nf-card-status.st-vpn {
  background: rgba(255, 196, 0, 0.95);
  color: #2a1e00;
}
.nf-card-status.st-sub {
  background: rgba(138, 75, 255, 0.95);
  color: #fff;
}
.nf-card-status.st-app {
  background: rgba(64, 156, 255, 0.95);
  color: #001432;
}
.nf-card-status.st-unknown {
  background: rgba(120, 120, 120, 0.7);
  color: #fff;
}

/* Channel cards dim themselves when not playable to signal "info-only" */
.nf-card--channel.st-subscription .nf-card-thumb,
.nf-card--channel.st-free-app    .nf-card-thumb {
  filter: saturate(0.85);
}
.nf-card--channel.st-subscription:hover .nf-card-thumb,
.nf-card--channel.st-free-app:hover    .nf-card-thumb {
  filter: saturate(1);
}

/* ============ Match cards with channel chips ============ */
/* A "match card" is an event (Real Madrid vs Barcelona) that may be carried
   on multiple channels. The card shows the match title big, and chips at the
   bottom for each channel. User picks their channel/language. */
.nf-card--match .nf-card-meta { padding-bottom: 10px; }
.nf-match-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.nf-match-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  color: #d6d8e0;
  font: 600 11px/1 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.nf-match-chip:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-1px);
}
.nf-match-chip.st-playable { border-color: rgba(43,209,126,0.55); background: rgba(43,209,126,0.12); color: #b5ffd9; }
.nf-match-chip.st-vpn      { border-color: rgba(255,196,0,0.5); background: rgba(255,196,0,0.10); color: #ffe4a3; }
.nf-match-chip.st-sub      { border-color: rgba(138,75,255,0.5); background: rgba(138,75,255,0.10); color: #d6c3ff; }
.nf-match-chip.st-app      { border-color: rgba(64,156,255,0.5); background: rgba(64,156,255,0.10); color: #b5d8ff; }
.chip-flag { opacity: 0.75; font-size: 10px; letter-spacing: 0.05em; }
.chip-name { font-weight: 700; }

.nf-card-live {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.nf-card-live.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.nf-card-live.on .nf-dot {
  background: #fff;
  animation: nf-pulse 1.3s infinite;
}

.nf-card-meta {
  padding: 8px 0;
}
.nf-card-meta h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.nf-card-sub {
  color: var(--text-dim);
  font-size: 12px;
}

.nf-card.placeholder {
  pointer-events: none;
  opacity: 0.5;
}
.nf-card.offline { cursor: default; opacity: 0.5; pointer-events: none; }
#favBtn.on { color: #ffcc33; }

.nf-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  background: #000;
}
.nf-card.previewing .nf-card-video { opacity: 1; }
.nf-card.previewing .nf-card-img { opacity: 0; }
.nf-card.previewing .nf-card-bg { opacity: 0; }
.nf-card-img, .nf-card-bg { transition: opacity 0.35s ease; }

.nf-card-viewers {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  background: rgba(0,0,0,0.65);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
}
.nf-card-uptime {
  position: absolute;
  bottom: 8px;
  right: 10px;
  padding: 3px 7px;
  background: rgba(0,0,0,0.65);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.nf-foot {
  padding: 60px 48px 40px;
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
}

/* ===================================================
   WATCH VIEW (fullscreen player)
   =================================================== */
.watch-view {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
  animation: watch-in 0.3s ease-out;
}
@keyframes watch-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.stream-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  z-index: 1;
}
.watch-view.theater .stream-frame {
  inset: 40px 60px 80px;
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
}
.watch-view video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.top-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 10;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}
.back-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.live-pill.on {
  color: #fff;
  background: rgba(255,59,92,0.2);
  border-color: var(--accent);
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-mute);
}
.live-pill.on .live-dot {
  background: var(--accent);
  animation: nf-pulse 1.3s infinite;
}

.net-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
  color: rgba(255,255,255,0.85);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-left: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.net-badge .net-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.net-badge[data-level="good"] .net-dot { background: #3fd38a; box-shadow: 0 0 6px rgba(63,211,138,0.6); }
.net-badge[data-level="fair"] .net-dot { background: #f7b84c; box-shadow: 0 0 6px rgba(247,184,76,0.6); }
.net-badge[data-level="bad"]  .net-dot { background: #ff4d6c; box-shadow: 0 0 8px rgba(255,77,108,0.7); }

.bottom-hud {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%);
  z-index: 10;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.bottom-hud.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Play/pause icon toggle — show one or the other based on .playing state */
.ctrl .icon-pause { display: none; }
.ctrl.playing .icon-play { display: none; }
.ctrl.playing .icon-pause { display: inline-flex; }

/* Mute icon toggle */
.ctrl .icon-muted { display: none; }
.ctrl.muted .icon-sound { display: none; }
.ctrl.muted .icon-muted { display: inline-flex; }

/* While the watch view has the .controls-active class, keep HUD visible */
.watch-view.controls-active .bottom-hud,
.watch-view.controls-active .top-hud {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.watch-view .top-hud {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.watch-view.controls-active { cursor: default; }
.watch-view:not(.controls-active) { cursor: none; }

.ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ctrl:hover { background: rgba(255,255,255,0.12); }
.bottom-hud .spacer { flex: 1; }
.bottom-hud .now-watching {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  padding-left: 8px;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  background: rgba(20,20,28,0.95);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.reconnect-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translate(-50%, -8px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(20,20,28,0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 12;
}
.reconnect-banner.visible { opacity: 1; transform: translate(-50%, 0); }

.stats-overlay {
  position: absolute;
  top: 72px;
  right: 20px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.78);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: rgba(255,255,255,0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12;
}
.stats-overlay.visible { opacity: 1; }
.stats-grid { display: grid; grid-template-columns: auto auto; gap: 2px 14px; }
.stats-grid > div { display: flex; justify-content: space-between; gap: 10px; }
.stats-grid b { color: rgba(255,255,255,0.55); font-weight: 600; margin-right: 10px; }

.upnext-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 24px;
}
.upnext-overlay.visible { display: flex; }
.upnext-card {
  max-width: 420px;
  width: 100%;
  background: rgba(20,20,28,0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  color: #f0f0f6;
  text-align: center;
}
.upnext-kicker { color: rgba(255,255,255,0.6); font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 12px; }
.upnext-thumb { aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #1a1a28; margin-bottom: 12px; }
.upnext-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upnext-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.upnext-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.upnext-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.upnext-btn:hover { background: rgba(255,255,255,0.16); }
.upnext-btn.primary { background: var(--accent, #8a4bff); }
.upnext-btn.primary:hover { background: #9b63ff; }

.shortcuts-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.shortcuts-overlay.visible { display: flex; }
.shortcuts-card {
  background: rgba(20,20,28,0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 26px 32px;
  min-width: 320px;
  color: #f0f0f6;
}
.shortcuts-title { font-size: 14px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 18px; }
.shortcuts-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.shortcuts-grid > div { display: contents; }
.shortcuts-grid kbd {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 3px 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  min-width: 20px;
  text-align: center;
  margin-right: 4px;
}

.reactions-layer {
  position: absolute;
  bottom: 70px;
  left: 0;
  width: 260px;
  height: 60vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 9;
}
.reaction-float {
  position: absolute;
  bottom: 0;
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: reaction-rise 2.5s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes reaction-rise {
  0%   { transform: translate(0, 0) scale(0.7); opacity: 0; }
  10%  { opacity: 1; transform: translate(0, -10px) scale(1.1); }
  25%  { transform: translate(calc(var(--drift, 0px) * 0.4), -25vh) scale(1); }
  60%  { transform: translate(var(--drift, 0px), -45vh) scale(1); opacity: 0.9; }
  100% { transform: translate(calc(var(--drift, 0px) * 1.1), -58vh) scale(0.95); opacity: 0; }
}

.reaction-bar {
  position: absolute;
  bottom: 76px;
  left: 20px;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(20,20,28,0.72);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 11;
}
.reaction-bar button {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  border-radius: 50%;
  transition: background 0.15s ease, transform 0.15s ease;
}
.reaction-bar button:hover { background: rgba(255,255,255,0.12); transform: scale(1.15); }
.reaction-bar button:active { transform: scale(0.9); }

.chat-panel {
  position: absolute;
  top: 72px;
  right: 20px;
  bottom: 76px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(14,14,22,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  z-index: 10;
}
.chat-feed {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: #e6e6ee;
  scrollbar-width: thin;
}
.chat-feed::-webkit-scrollbar { width: 4px; }
.chat-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.chat-line {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 6px 8px;
  animation: chat-in 0.25s ease;
  word-break: break-word;
}
.chat-line.self { background: rgba(138,75,255,0.22); border: 1px solid rgba(138,75,255,0.4); }
.chat-line.mentions-me { background: rgba(255,200,60,0.12); border: 1px solid rgba(255,200,60,0.4); }
.chat-mention { color: #c9baff; font-weight: 700; }
.chat-mention.me { color: #ffd95c; background: rgba(255,200,60,0.12); padding: 0 4px; border-radius: 4px; }
.chat-line.broadcaster {
  background: rgba(255,200,60,0.1);
  border: 1px solid rgba(255,200,60,0.35);
}
.chat-crown {
  margin-right: 4px;
  color: #ffd95c;
}

.chat-link {
  color: #c9baff;
  text-decoration: underline;
  word-break: break-all;
}
.chat-link:hover { color: #e4d7ff; }

body.is-fullscreen .chat-panel,
body.is-fullscreen .other-streams,
body.is-fullscreen .reaction-bar,
body.is-fullscreen .reactions-layer,
body.is-fullscreen .chat-reopen-btn {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .nf-card { transition: none !important; }
  .nf-card:hover { transform: none !important; }
  .reaction-float { animation-duration: 0.01s !important; opacity: 0 !important; }
  .nf-card-thumb.ph { animation: none; background: #15161e; }
  .chat-line { animation: none !important; }
  .chat-jump-btn { animation: none; }
  .reconnect-banner .spinner { animation-duration: 3s; }
  .mention-flash, .chat-panel.mention-flash { animation: none !important; }
  .live-pill.on .live-dot, .nf-live-badge.on .nf-dot, .nf-card-live.on .nf-dot { animation: none !important; }
}
.chat-panel.mention-flash { animation: mention-flash 1.2s ease; }
@keyframes mention-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,200,60,0); border-color: rgba(255,255,255,0.08); }
  30%     { box-shadow: 0 0 0 6px rgba(255,200,60,0.28); border-color: rgba(255,200,60,0.6); }
}
.chat-who { font-weight: 700; font-size: 11px; color: #c9baff; margin-right: 6px; }
.chat-body { color: #f0f0f6; }
@keyframes chat-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.chat-handle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}
.chat-handle-label { letter-spacing: 0.08em; text-transform: uppercase; }
.chat-handle-btn {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.2);
  color: #c9baff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.chat-handle-btn:hover { background: rgba(255,255,255,0.08); }

.chat-collapse-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.chat-collapse-btn:hover { background: rgba(255,255,255,0.14); }

.chat-jump-btn {
  align-self: center;
  padding: 6px 12px;
  background: var(--accent, #8a4bff);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  animation: chat-jump-in 0.2s ease;
}
@keyframes chat-jump-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.chat-reopen-btn {
  position: absolute;
  top: 72px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14,14,22,0.8);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-reopen-btn:hover { background: rgba(30,30,44,0.9); }

body.chat-hidden .chat-panel { display: none !important; }

.mini-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  max-width: 40vw;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  z-index: 50;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
}
.mini-player video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}
.mini-btn {
  width: 28px; height: 28px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-btn:hover { background: rgba(0,0,0,0.85); }
.mini-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
@media (max-width: 640px) {
  .mini-player { width: 200px; bottom: 12px; right: 12px; }
}
.embed-mode .mini-player { display: none !important; }

.chat-form { display: flex; gap: 6px; align-items: stretch; }
#chatInput {
  flex: 1;
  padding: 9px 12px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
#chatInput:focus { border-color: var(--accent, #8a4bff); }
.chat-send {
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #8a4bff);
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.chat-send:hover { background: #9b63ff; }
@media (max-width: 900px) {
  .chat-panel { display: none; }
}

.other-streams {
  position: absolute;
  top: 72px;
  left: 20px;
  width: 220px;
  max-height: 40vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(14,14,22,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.other-streams.visible { opacity: 1; pointer-events: auto; transform: translateX(0); }
.other-streams-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}
.other-streams-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.other-stream-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.other-stream-row:hover { background: rgba(255,255,255,0.08); border-color: rgba(138,75,255,0.4); transform: translateX(2px); }
.other-stream-thumb {
  width: 56px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a28;
  flex-shrink: 0;
}
.other-stream-thumb img { width: 100%; height: 100%; object-fit: cover; }
.other-stream-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.other-stream-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.other-stream-viewers {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
}
@media (max-width: 900px) {
  .other-streams { display: none; }
}
@media (max-width: 640px) {
  .reaction-bar { bottom: 72px; left: 12px; }
  .reaction-bar button { width: 32px; height: 32px; font-size: 18px; }
  .reactions-layer { bottom: 56px; width: 200px; }
  .reaction-float { font-size: 28px; }
}
.reconnect-banner .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent, #8a4bff);
  border-radius: 50%;
  animation: nf-spin 0.9s linear infinite;
}
@keyframes nf-spin { to { transform: rotate(360deg); } }

#volSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#volSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
}
#volSlider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
}

.overlay-tap {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 20;
}
.tap-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 32px;
  background: rgba(255,59,92,0.95);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 12px 40px rgba(255,59,92,0.4);
}
.tap-play:hover { transform: scale(1.04); }

/* ===================================================
   STUDIO (broadcaster) - unchanged
   =================================================== */
body.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 16px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.pill[data-tone="good"] { color: var(--good); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); }
.pill[data-tone="warn"] { color: var(--warn); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.pill[data-tone="bad"] { color: var(--bad); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }

.warn-banner {
  background: rgba(245,158,11,0.1);
  color: #fbbf24;
  padding: 12px 24px;
  font-size: 13px;
  border-bottom: 1px solid rgba(245,158,11,0.25);
}
.warn-banner strong { color: #fff; }

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 900px) { .stage { grid-template-columns: 1fr; } }

.preview-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 1px solid var(--border);
}
.preview-wrap video { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
}
.ph-icon { font-size: 48px; opacity: 0.5; }

.side-panel { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 4px; }
.card h3 { font-size: 14px; margin-bottom: 10px; }
.muted { color: var(--text-dim); font-size: 13px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat { background: var(--bg-elev); border-radius: 8px; padding: 10px 12px; }
.stat-label { display: block; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { display: block; font-size: 20px; font-weight: 700; margin-top: 2px; }

.field { margin: 14px 0 12px; }
.field label { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.field select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.field select:focus { border-color: var(--accent); }

.controls { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #ff4d6c; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elev); }
.btn-block { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-icon { font-size: 10px; line-height: 1; }

.rec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9b2;
  margin-right: 8px;
  vertical-align: middle;
  transition: background 0.2s ease;
}
#recordBtn.recording { border-color: #ff4d6c; color: #ff4d6c; }
#recordBtn.recording .rec-dot {
  background: #ff4d6c;
  box-shadow: 0 0 0 0 rgba(255,77,108,0.7);
  animation: rec-pulse 1.2s infinite;
}
@keyframes rec-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,77,108,0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(255,77,108,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,108,0); }
}

.tip ul { list-style: none; padding: 0; margin: 0; }
.tip li { padding: 6px 0; color: var(--text-dim); font-size: 13px; border-bottom: 1px dashed var(--border); }
.tip li:last-child { border-bottom: none; }
.tip li strong { color: var(--text); }

/* Lock screen */
.lock-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a28 0%, #0a0a0f 70%);
  z-index: 100;
}
.lock-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.lock-icon {
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(255,59,92,0.4));
}
.lock-card h2 { font-size: 20px; margin-bottom: 6px; }
.lock-card .muted { margin-bottom: 20px; }
#lockForm input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  font-family: inherit;
}
#lockForm input:focus { border-color: var(--accent); }
.lock-error { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

@media (max-width: 640px) {
  .nf-nav, .nf-hero, .nf-row { padding-left: 20px; padding-right: 20px; }
  .nf-hero { min-height: 440px; padding-bottom: 60px; }
  .nf-title { font-size: 34px; }
  .nf-desc { font-size: 14px; }
  .nf-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .nf-card-viewers, .nf-card-uptime { font-size: 10px; padding: 2px 6px; }
  .bottom-hud { padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .bottom-hud .now-watching { max-width: 100%; order: -1; flex: 1 1 100%; padding-left: 0; padding-bottom: 4px; }
  #volSlider { width: 80px; }
  .top-hud { padding: 12px; }
  .reconnect-banner { top: 60px; font-size: 12px; padding: 8px 12px; }
}

.nf-card:focus-visible {
  outline: 2px solid var(--accent, #8a4bff);
  outline-offset: 3px;
  border-radius: 6px;
}
.ctrl:focus-visible, .nf-play-btn:focus-visible, .nf-info-btn:focus-visible, .tap-play:focus-visible {
  outline: 2px solid var(--accent, #8a4bff);
  outline-offset: 2px;
}

/* ========== Theater + audio-only ========== */
.theater-mode .other-streams,
.theater-mode .chat-panel,
.theater-mode .reaction-bar {
  opacity: 0.2;
  transition: opacity 0.25s ease;
}
.theater-mode .other-streams:hover,
.theater-mode .chat-panel:hover,
.theater-mode .reaction-bar:hover {
  opacity: 1;
}

.audio-only-mode #player {
  opacity: 0;
  background: #000;
}
.audio-only-mode #watchView::before {
  content: "Audio only";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  z-index: 1;
  pointer-events: none;
}
.audio-only-mode #audioOnlyBtn { color: var(--accent, #8a4bff); }

/* ========== Embed mode (?embed=1): minimal player chrome ========== */
.embed-mode .nf-browse,
.embed-mode .nf-foot,
.embed-mode .reaction-bar,
.embed-mode .other-streams,
.embed-mode .chat-panel,
.embed-mode #shareBtn,
.embed-mode #embedBtn {
  display: none !important;
}
.embed-mode .top-hud .back-btn { display: none; }
.embed-mode #watchView { background: #000; }

/* ============ Match cards (live sports feed) ============ */
.match-card .match-thumb { position: relative; padding: 14px 14px 18px; min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; }
.match-status { font: 700 11px/1 -apple-system, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px; background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.85); border-radius: 4px; align-self: flex-start; max-width: fit-content; }
.match-status.live { background: #e91e3a; color: #fff; }
.match-status.final { background: rgba(0,0,0,0.4); }
.match-teams { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px 0; }
.match-name { color: #fff; font: 700 14px/1.15 -apple-system, sans-serif; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-vs { color: rgba(255,255,255,0.55); font: 400 11px/1 -apple-system, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.match-logo { width: 28px; height: 28px; object-fit: contain; background: rgba(255,255,255,0.04); border-radius: 50%; padding: 2px; }
.match-score { color: #fff; font: 800 22px/1 -apple-system, sans-serif; text-align: center; margin-top: 6px; letter-spacing: 0.03em; }
.match-broadcasts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.match-tv { font: 600 10px/1 -apple-system, sans-serif; padding: 2px 6px; background: rgba(138,75,255,0.18); color: #c8b3ff; border-radius: 3px; border: 1px solid rgba(138,75,255,0.35); }
.nf-card--channel.live-now::before { content: '🔴 LIVE'; position: absolute; top: 6px; left: 6px; z-index: 2; font: 700 10px/1 -apple-system, sans-serif; padding: 3px 6px; background: #e91e3a; color: #fff; border-radius: 3px; letter-spacing: 0.05em; }
.match-tv-here { background: #2dbb6a; color: #fff; border-color: #2dbb6a; }
.match-watch-on { margin-top: 6px; color: #c8d1ff; font: 600 12px/1.3 -apple-system, sans-serif; padding: 5px 8px; background: rgba(46,187,106,0.14); border-left: 3px solid #2dbb6a; border-radius: 0 4px 4px 0; }
.match-watch-on strong { color: #fff; }
