/* live-player base styles. Structure only; every colour, font and radius comes from a theme
   (themes/<brand>.css) through the --lp-* custom properties below. */
@property --lp-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.lp {
  --lp-bg: #000;
  --lp-fg: #fff;
  --lp-mute: rgba(255, 255, 255, .64);
  --lp-accent: #e33;
  --lp-accent-2: #fa3;
  --lp-grad: linear-gradient(100deg, var(--lp-accent), var(--lp-accent-2));
  --lp-frame: conic-gradient(from var(--lp-angle), var(--lp-accent), var(--lp-accent-2), transparent 40%, transparent 60%, var(--lp-accent));
  --lp-frame-w: 1.5px;
  --lp-font: system-ui, sans-serif;
  --lp-display: var(--lp-font);
  --lp-radius: 16px;
  --lp-glass: rgba(14, 12, 16, .55);
  --lp-glass-line: rgba(255, 255, 255, .12);
  --lp-ambient: .55;
  --lp-ease: cubic-bezier(.2, .7, .1, 1);
  --lp-pad: clamp(10px, 2.2vw, 22px);

  position: relative; isolation: isolate;
  color: var(--lp-fg); font-family: var(--lp-font);
  outline: none; -webkit-tap-highlight-color: transparent;
}
.lp:focus-visible .lp-stage { box-shadow: 0 0 0 2px var(--lp-accent-2); }
.lp [hidden] { display: none !important; }

/* ambient glow: the picture, 48x27 px, blurred out behind the frame */
.lp-ambient {
  position: absolute; inset: 4% 2%; width: 96%; height: 92%; z-index: -1; pointer-events: none;
  filter: blur(clamp(40px, 7vw, 90px)) saturate(1.5); opacity: 0; transform: scale(1.08);
  transition: opacity 1.6s var(--lp-ease);
}
.lp[data-state="live"] .lp-ambient { opacity: var(--lp-ambient); }

.lp-stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: clip;
  border-radius: var(--lp-radius); background: var(--lp-bg);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.lp.is-fs .lp-stage { aspect-ratio: auto; height: 100%; border-radius: 0; }
.lp.is-fs { width: 100%; height: 100%; background: #000; }

/* animated hairline frame */
.lp-frame {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  padding: var(--lp-frame-w); background: var(--lp-frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .9; animation: lp-orbit 14s linear infinite;
}
@keyframes lp-orbit { to { --lp-angle: 360deg; } }
.lp.is-fs .lp-frame { display: none; }

.lp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .9s var(--lp-ease); }
.lp[data-state="live"] .lp-video { opacity: 1; }
.lp-veil { position: absolute; inset: auto 0 0 0; height: 46%; z-index: 2; pointer-events: none; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); opacity: 0; transition: opacity .35s var(--lp-ease); }

/* ---------- idle card (upcoming / waiting / offline / ended / connecting) ---------- */
.lp-card {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; text-align: center;
  padding: var(--lp-pad); transition: opacity .9s var(--lp-ease), visibility 0s linear 0s;
}
.lp[data-state="live"] .lp-card { opacity: 0; visibility: hidden; transition: opacity .9s var(--lp-ease), visibility 0s linear .9s; }
.lp-card__art { position: absolute; inset: -6%; background: center / cover no-repeat; filter: blur(22px) brightness(.38) saturate(1.2); transform: scale(1.05); }
.lp-card__inner { position: relative; display: grid; justify-items: center; gap: clamp(6px, 1.4vw, 14px); max-width: 44em; }
.lp-card__mark { width: clamp(28px, 4.6vw, 54px); height: auto; }
.lp-card__kicker { margin: 0; font-size: clamp(10px, 1.15vw, 13px); font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--lp-mute); }
.lp-card__title { margin: 0; font-family: var(--lp-display); font-weight: 800; font-size: clamp(20px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.lp-card__status {
  margin: 0; display: inline-flex; align-items: center; gap: .6em; padding: .45em 1em .45em .85em;
  border-radius: 999px; background: var(--lp-glass); border: 1px solid var(--lp-glass-line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: clamp(10px, 1.1vw, 12.5px); font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.lp-card__body { margin: 0; color: var(--lp-mute); font-size: clamp(12px, 1.35vw, 15px); max-width: 34em; }
.lp-card__body:empty { display: none; }
.lp-card__when { margin: 0; color: var(--lp-mute); font-size: clamp(11px, 1.25vw, 14px); font-weight: 500; }
.lp-count { display: flex; gap: clamp(6px, 1.2vw, 14px); }
.lp-count > div { display: grid; justify-items: center; min-width: clamp(46px, 8vw, 92px); padding: clamp(6px, 1.1vw, 12px) 0; border-radius: 12px; background: var(--lp-glass); border: 1px solid var(--lp-glass-line); }
.lp-count b { font-family: var(--lp-display); font-weight: 800; font-size: clamp(20px, 4.2vw, 50px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lp-count span { margin-top: .35em; font-size: clamp(9px, 1vw, 11px); letter-spacing: .2em; text-transform: uppercase; color: var(--lp-mute); }

.lp-dot { width: .62em; height: .62em; border-radius: 50%; background: var(--lp-mute); flex: none; }
.lp[data-state="waiting"] .lp-card__status .lp-dot,
.lp[data-state="connecting"] .lp-card__status .lp-dot,
.lp[data-state="reconnecting"] .lp-card__status .lp-dot { background: var(--lp-accent-2); animation: lp-breathe 2.4s ease-in-out infinite; }
.lp[data-state="upcoming"] .lp-card__status .lp-dot { background: var(--lp-accent); }
@keyframes lp-breathe { 50% { opacity: .35; } }

/* ---------- overlays on the picture ---------- */
.lp-big {
  position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: .6em; padding: .9em 1.5em .9em 1.2em; border: 0; border-radius: 999px; cursor: pointer;
  color: #fff; background: var(--lp-grad); font: 700 clamp(13px, 1.6vw, 17px) var(--lp-font); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 14px 40px -12px var(--lp-accent);
}
.lp-big .lp-ico { width: 1.5em; height: 1.5em; }
.lp-sound {
  position: absolute; z-index: 5; left: var(--lp-pad); top: var(--lp-pad);
  display: inline-flex; align-items: center; gap: .55em; padding: .6em 1em .6em .75em; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--lp-glass-line); color: var(--lp-fg); background: var(--lp-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font: 600 clamp(11px, 1.2vw, 13px) var(--lp-font); letter-spacing: .08em; text-transform: uppercase;
  animation: lp-rise .6s var(--lp-ease) both;
}
.lp-sound .lp-ico { width: 1.35em; height: 1.35em; }
@keyframes lp-rise { from { opacity: 0; transform: translateY(-6px); } }

.lp-spin { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .3s; }
.lp-spin i { width: clamp(34px, 5vw, 56px); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 25%, var(--lp-accent), var(--lp-accent-2)); -webkit-mask: radial-gradient(closest-side, transparent 78%, #000 80%); mask: radial-gradient(closest-side, transparent 78%, #000 80%); animation: lp-turn .9s linear infinite; }
@keyframes lp-turn { to { transform: rotate(1turn); } }
.lp[data-state="live"].is-buffering .lp-spin { opacity: 1; transition-delay: .4s; }
.lp[data-state="connecting"] .lp-spin, .lp[data-state="reconnecting"] .lp-spin { opacity: .9; }
.lp[data-state="connecting"] .lp-card__status, .lp[data-state="reconnecting"] .lp-card__status { margin-top: clamp(56px, 8vw, 90px); }

/* ---------- control chrome ---------- */
.lp-chrome {
  position: absolute; inset: auto 0 0 0; z-index: 5; padding: 0 var(--lp-pad) var(--lp-pad);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .35s var(--lp-ease), transform .35s var(--lp-ease);
}
.lp[data-state="live"].is-awake .lp-chrome, .lp[data-state="live"].is-paused .lp-chrome, .lp[data-state="live"]:has(.lp-chrome :focus-visible) .lp-chrome { opacity: 1; transform: none; pointer-events: auto; }
.lp[data-state="live"].is-awake .lp-veil, .lp[data-state="live"].is-paused .lp-veil { opacity: 1; }
.lp[data-state="live"]:not(.is-awake):not(.is-paused) { cursor: none; }

.lp-bar {
  display: flex; align-items: center; gap: clamp(2px, .6vw, 8px); min-width: 0;
  padding: 6px 8px; border-radius: 14px; background: var(--lp-glass); border: 1px solid var(--lp-glass-line);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
.lp-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0; border: 0; border-radius: 10px;
  color: var(--lp-fg); background: transparent; cursor: pointer; transition: background .2s;
}
.lp-btn:hover { background: rgba(255, 255, 255, .1); }
.lp-ico { width: 22px; height: 22px; fill: currentColor; }
.lp-pp .is-play, .lp.is-paused .lp-pp .is-pause, .lp-mute .is-vol, .lp.is-muted .lp-mute .is-vol, .lp-fs .is-unfull, .lp.is-fs .lp-fs .is-full { display: none; }
.lp.is-paused .lp-pp .is-play, .lp:not(.is-muted) .lp-mute .is-vol, .lp.is-fs .lp-fs .is-unfull { display: block; }
.lp:not(.is-muted) .lp-mute .is-mute { display: none; }

.lp-vol { display: flex; align-items: center; }
.lp-vol__range { --v: 1; width: 0; opacity: 0; transition: width .3s var(--lp-ease), opacity .3s; }
.lp-vol:hover .lp-vol__range, .lp-vol:focus-within .lp-vol__range { width: 76px; opacity: 1; margin-right: 6px; }
.lp input[type="range"] { -webkit-appearance: none; appearance: none; height: 18px; margin: 0; background: transparent; cursor: pointer; }
.lp input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--lp-fg) calc(var(--v, 0) * 100%), rgba(255, 255, 255, .25) 0); }
.lp input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--lp-fg); }
.lp input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); }
.lp input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--lp-fg); }
.lp input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--lp-fg); }

.lp-live {
  display: inline-flex; align-items: center; gap: .5em; height: 26px; padding: 0 .8em 0 .65em; flex: none; margin-left: 4px;
  border: 0; border-radius: 999px; cursor: pointer; color: #fff; background: var(--lp-grad);
  font: 800 11.5px var(--lp-font); letter-spacing: .16em; text-transform: uppercase;
}
.lp-live .lp-dot { background: #fff; animation: lp-breathe 2.4s ease-in-out infinite; }
.lp.is-behind .lp-live { background: rgba(255, 255, 255, .14); color: var(--lp-fg); }
.lp.is-behind .lp-live .lp-dot { background: var(--lp-mute); animation: none; }
.lp-time { flex: none; margin-left: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--lp-mute); }
.lp-title { min-width: 0; margin-left: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: var(--lp-fg); }
.lp-spacer { flex: 1 1 auto; }
.lp-viewers { display: inline-flex; align-items: center; gap: .45em; flex: none; margin-right: 4px; font-size: 12.5px; color: var(--lp-mute); font-variant-numeric: tabular-nums; }
.lp-viewers .lp-ico { width: 17px; height: 17px; }

.lp-q { position: relative; flex: none; }
.lp-q__btn { width: auto; padding: 0 8px; gap: 6px; grid-auto-flow: column; }
.lp-q__now { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--lp-mute); }
.lp-q__menu {
  position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 140px; padding: 6px; display: grid;
  border-radius: 12px; background: rgba(14, 12, 16, .9); border: 1px solid var(--lp-glass-line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.lp-q__menu button { text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; cursor: pointer; color: var(--lp-fg); background: none; font: 500 13px var(--lp-font); }
.lp-q__menu button:hover { background: rgba(255, 255, 255, .08); }
.lp-q__menu button[aria-checked="true"]::after { content: ""; float: right; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--lp-grad); }

/* DVR timeline */
.lp-seek { position: relative; height: 18px; margin: 0 6px 6px; display: grid; align-items: center; }
.lp-seek input { position: relative; z-index: 1; width: 100%; opacity: 0; }
.lp-seek::before, .lp-seek__fill { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: rgba(255, 255, 255, .22); transition: height .2s, margin .2s; }
.lp-seek__fill { background: var(--lp-grad); transform-origin: left; transform: scaleX(1); }
.lp-seek:hover::before, .lp-seek:hover .lp-seek__fill { height: 6px; margin-top: -3px; }


/* ---------- portrait pan mode: one third of the 16:9 frame, full height ---------- */
.lp-pan { display: none; }
.lp--pan .lp-stage { aspect-ratio: 640 / 1080; }
.lp--pan .lp-video { object-fit: cover; touch-action: pan-y; }
.lp--pan .lp-stage { touch-action: pan-y; }
.lp-video.is-gliding { transition: opacity .9s var(--lp-ease), object-position .5s var(--lp-ease); }
.lp--pan[data-state="live"] .lp-pan { display: block; }
.lp-pan__dots {
  position: absolute; z-index: 5; left: 50%; top: var(--lp-pad); translate: -50% 0;
  display: grid; grid-template-columns: repeat(3, 1fr); width: 84px; height: 22px; padding: 0 4px; gap: 3px; align-items: center;
  border-radius: 999px; background: var(--lp-glass); border: 1px solid var(--lp-glass-line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
/* the three thirds of the frame; the lit window follows the pan continuously */
.lp-pan__dots button { height: 10px; padding: 0; border: 0; border-radius: 3px; background: rgba(255, 255, 255, .16); cursor: pointer; }
.lp-pan__dots::after {
  content: ""; position: absolute; top: 6px; height: 10px; border-radius: 3px; pointer-events: none;
  width: calc((100% - 14px) / 3); left: calc(4px + var(--lp-pan, .5) * (100% - 8px - (100% - 14px) / 3));
  background: var(--lp-grad); box-shadow: 0 0 12px var(--lp-accent);
}
.lp-pan__tilt {
  position: absolute; z-index: 5; right: var(--lp-pad); top: var(--lp-pad); height: 30px; padding: 0 12px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--lp-glass-line); color: var(--lp-fg); background: var(--lp-glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font: 700 10.5px var(--lp-font); letter-spacing: .16em; text-transform: uppercase;
}
.lp-pan__tilt[aria-pressed="true"] { border-color: transparent; background: var(--lp-grad); color: #fff; }
.lp-pan__hint {
  position: absolute; z-index: 4; left: 50%; top: 50%; translate: -50% -50%; margin: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: .9em; padding: .7em 1.2em; white-space: nowrap;
  border-radius: 999px; background: rgba(10, 9, 11, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 600 12px var(--lp-font); letter-spacing: .12em; text-transform: uppercase;
  animation: lp-hint 5.5s var(--lp-ease) 1.2s both;
}
.lp-pan__hint span { font-size: 18px; line-height: 0; color: var(--lp-accent-2); animation: lp-nudge 1.4s ease-in-out infinite alternate; }
.lp-pan__hint span:last-child { animation-direction: alternate-reverse; }
@keyframes lp-hint { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes lp-nudge { to { transform: translateX(-4px); } }
.lp--panned .lp-pan__hint { display: none; }
.lp--pan .lp-sound { top: calc(var(--lp-pad) + 38px); }
.lp--pan.is-panning .lp-chrome { opacity: 0 !important; }

/* small players: keep the essentials */
@container lp (max-width: 560px) { .lp-title, .lp-time, .lp-q__now { display: none; } }
.lp { container: lp / inline-size; }
@container lp (max-width: 420px) { .lp-viewers span, .lp-pip, .lp-theater { display: none; } .lp-btn { width: 34px; height: 34px; } }

@media (prefers-reduced-motion: reduce) {
  .lp *, .lp *::before, .lp *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .lp-spin i { animation: lp-turn 1.6s linear infinite !important; }
}
