/* LIVEPLUSTV viewer player — branded chrome.
 *
 * Consumer register (dash/marketing): near-black canvas, pink #ff2d78 accent,
 * LIVEPLUSTV wordmark, mono LIVE badge. Self-contained: system font stacks only
 * (no network fonts — this is a latency-sensitive viewer asset). State is driven
 * off [data-state] / [data-idle] / [data-muted] / [data-fullscreen] on .lptv-player.
 */

:root {
  --lptv-canvas: #050507;
  --lptv-accent: #ff2d78;      /* brand pink — the "live"/play color */
  --lptv-text0: #e8e9ec;
  --lptv-text1: #8b90a0;
  --lptv-border: #2a2d32;
  --lptv-chrome: rgba(8, 8, 10, 0.55);
  --lptv-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --lptv-mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--lptv-canvas);
  color: var(--lptv-text0);
  font-family: var(--lptv-sans);
}

/* ── player shell ────────────────────────────────────────────────────────── */
.lptv-player {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #000;
  overflow: hidden;
  user-select: none;
  outline: none;
}
/* Standalone page: fill the viewport. Embed: fill the iframe (also 100%). */
body > .lptv-player { position: fixed; inset: 0; }

.lptv-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;      /* letterbox — never crop the broadcast frame */
  cursor: pointer;
}

/* ── top bar: wordmark + LIVE pill ───────────────────────────────────────── */
.lptv-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0));
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
}
.lptv-topbar > * { pointer-events: auto; }

.lptv-brand { display: inline-flex; align-items: center; opacity: 0.92; color: var(--lptv-text0); text-decoration: none; }
.lptv-brand svg { height: 18px; width: auto; display: block; }  /* fill=currentColor → text0 */
.lptv-brand:hover { opacity: 1; }
.lptv-brand--embed { opacity: 0.7; }
.lptv-brand[data-brand]:empty::after { content: 'LIVEPLUSTV'; font-weight: 800; letter-spacing: 0.02em; font-size: 15px; }

/* LIVE pill — mono, uppercase, pink dot. Pulses at the live edge; muted when behind. */
.lptv-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--lptv-border);
  border-radius: 2px;
  background: rgba(0,0,0,0.45);
  color: var(--lptv-text0);
  font-family: var(--lptv-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
}
.lptv-live__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lptv-accent);
  box-shadow: 0 0 8px rgba(255,45,120,0.7);
}
.lptv-live[data-atlive="true"] .lptv-live__dot { animation: lptv-pulse 2s ease-in-out infinite; }
.lptv-live[data-atlive="false"] {
  color: var(--lptv-text1);
  cursor: pointer;
}
.lptv-live[data-atlive="false"] .lptv-live__dot {
  background: var(--lptv-text1);
  box-shadow: none;
}
.lptv-live[data-atlive="false"] .lptv-live__txt::after {
  content: ' · GO';
  color: var(--lptv-accent);
}

@keyframes lptv-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── center: spinner + big play + reconnect caption ──────────────────────── */
.lptv-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 2;
  pointer-events: none;
}
.lptv-center > * { pointer-events: auto; }

.lptv-spinner {
  display: none;
  width: 52px; height: 52px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--lptv-accent);
  border-radius: 50%;
  animation: lptv-spin 0.8s linear infinite;
}
@keyframes lptv-spin { to { transform: rotate(360deg); } }

.lptv-bigplay {
  display: none;
  width: 78px; height: 78px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--lptv-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 30px rgba(255,45,120,0.45);
  transition: transform 0.12s ease;
}
.lptv-bigplay svg { width: 34px; height: 34px; margin-left: 4px; }
.lptv-bigplay:hover { transform: scale(1.05); }

/* ── overlay: offline / nochannel / unsupported ──────────────────────────── */
.lptv-overlay {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(120% 120% at 50% 40%, rgba(20,20,24,0.7), rgba(0,0,0,0.9));
  z-index: 4;
}
.lptv-overlay--static { display: flex; }
.lptv-overlay__icon { color: var(--lptv-text1); }
.lptv-overlay__icon svg { width: 40px; height: 40px; }
.lptv-overlay__title { font-size: 18px; font-weight: 600; letter-spacing: 0.01em; }
.lptv-overlay__msg { font-size: 13px; color: var(--lptv-text1); max-width: 320px; }
.lptv-overlay__msg code { font-family: var(--lptv-mono); color: var(--lptv-text0); font-size: 12px; }

.lptv-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 16px;
  border: 1px solid var(--lptv-border);
  border-radius: 4px;
  background: rgba(255,45,120,0.12);
  color: var(--lptv-text0);
  font-family: var(--lptv-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lptv-retry:hover { background: rgba(255,45,120,0.2); border-color: var(--lptv-accent); }
.lptv-retry svg { width: 16px; height: 16px; }

/* ── bottom controls ─────────────────────────────────────────────────────── */
.lptv-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 14px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
}
.lptv-spacer { flex: 1; }

.lptv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--lptv-text0);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.lptv-btn:hover { background: rgba(255,255,255,0.1); }
.lptv-btn svg { width: 22px; height: 22px; }
.lptv-btn--wide {
  font-family: var(--lptv-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--lptv-text1);
}
.lptv-btn--wide .lptv-live__dot { width: 7px; height: 7px; }
.lptv-btn--wide[data-atlive="true"] { color: var(--lptv-text0); }
.lptv-btn--wide[data-atlive="true"] .lptv-live__dot { background: var(--lptv-accent); box-shadow: 0 0 6px rgba(255,45,120,0.7); }
.lptv-btn--wide[data-atlive="false"] .lptv-live__dot { background: var(--lptv-text1); }

/* Volume slider — accent-filled track. */
.lptv-volume {
  -webkit-appearance: none; appearance: none;
  width: 78px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
}
.lptv-volume::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--lptv-accent); border: none;
}
.lptv-volume::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--lptv-accent); border: none;
}

/* ── state-driven visibility ─────────────────────────────────────────────── */
/* spinner: loading / buffering / reconnecting */
.lptv-player[data-state="loading"] .lptv-spinner,
.lptv-player[data-state="buffering"] .lptv-spinner,
.lptv-player[data-state="reconnecting"] .lptv-spinner { display: block; }

/* reconnect caption */
.lptv-player[data-state="reconnecting"] .lptv-center::after {
  content: 'Reconnecting…';
  font-family: var(--lptv-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--lptv-text1);
}

/* big play: paused only */
.lptv-player[data-state="paused"] .lptv-bigplay { display: inline-flex; }

/* overlay: offline / unsupported / nochannel */
.lptv-player[data-state="offline"] .lptv-overlay,
.lptv-player[data-state="unsupported"] .lptv-overlay { display: flex; }

/* hide controls when there's no stream to control */
.lptv-player[data-state="offline"] .lptv-controls,
.lptv-player[data-state="unsupported"] .lptv-controls,
.lptv-player[data-state="nochannel"] .lptv-controls,
.lptv-player[data-state="loading"] .lptv-controls { opacity: 0; pointer-events: none; }

/* auto-hide chrome while playing + idle */
.lptv-player[data-idle="true"][data-state="playing"] .lptv-controls { opacity: 0; transform: translateY(6px); pointer-events: none; }
.lptv-player[data-idle="true"][data-state="playing"] .lptv-topbar { opacity: 0; }
.lptv-player[data-idle="true"][data-state="playing"] .lptv-video { cursor: none; }

/* ── quality selector popover ────────────────────────────────────────────── */
.lptv-quality {
  position: absolute;
  right: 12px;
  bottom: 62px;
  z-index: 6;
  min-width: 132px;
  max-height: 244px;
  overflow-y: auto;
  background: #0e0f12;
  border: 1px solid var(--lptv-border);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 12px 44px rgba(0,0,0,0.6);
}
.lptv-quality[hidden] { display: none; }
.lptv-quality__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px 8px 8px;
  border: none;
  background: transparent;
  color: var(--lptv-text0);
  font-family: var(--lptv-sans);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 4px;
}
.lptv-quality__row:hover { background: rgba(255,255,255,0.08); }
.lptv-quality__row[aria-checked="true"] { color: var(--lptv-accent); }
.lptv-quality__check { display: inline-flex; width: 16px; flex: 0 0 16px; }
.lptv-quality__check svg { width: 15px; height: 15px; }

/* ── right-click brand menu ──────────────────────────────────────────────── */
.lptv-ctx {
  position: absolute;
  z-index: 10;
  background: #0e0f12;
  border: 1px solid var(--lptv-border);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 12px 44px rgba(0,0,0,0.6);
}
.lptv-ctx[hidden] { display: none; }
.lptv-ctx__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--lptv-text0);
  white-space: nowrap;
}
.lptv-ctx__item:hover { background: rgba(255,45,120,0.14); }
.lptv-ctx__item:hover .lptv-ctx__brand { color: #fff; }
.lptv-ctx__by {
  font-family: var(--lptv-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--lptv-text1);
}
.lptv-ctx__brand svg { height: 17px; width: auto; display: block; }  /* fill=currentColor */

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .lptv-brand img { height: 16px; }
  .lptv-bigplay { width: 64px; height: 64px; }
  .lptv-bigplay svg { width: 28px; height: 28px; }
  .lptv-volume { width: 56px; }
  .lptv-topbar { padding: 10px 12px; }
  .lptv-controls { padding: 10px 10px 12px; gap: 6px; }
}
