/* The home page's Live section (shared/components/home-live-stage.php).
 *
 * A streaming front page for a pool hall: the screen is the stage, lit from
 * under like a table lamp over felt, with a glass side panel for the
 * scoreboard and what else is on. Dark on purpose -- video reads best on
 * near-black.
 */

.ls {
  --ls-red: #ff3b30;
  --ls-felt: #16a34a;
  --ls-glass: rgba(255, 255, 255, 0.045);
  --ls-line: rgba(255, 255, 255, 0.09);
  --ls-dim: rgba(255, 255, 255, 0.55);
  --ls-faint: rgba(255, 255, 255, 0.38);
  --live-red: var(--ls-red);

  position: relative;
  min-width: 0;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid var(--ls-line);
  background:
    radial-gradient(120% 70% at 30% 0%, rgba(22, 163, 74, 0.13), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(44, 117, 255, 0.12), transparent 60%),
    #0a0e15;
  color: #ffffff;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}

/* ---- Head: LIVE chip + count, activity, link ---- */

.ls__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-bottom: 18px;
}

.ls__title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.ls__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.ls__live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 11px;
  border-radius: 8px;
  background: var(--ls-red);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 0 24px -4px rgba(255, 59, 48, 0.7);
}

.ls__live-chip .live-dot {
  background: #ffffff;
}

/* Nothing on: the chip stays, unlit. */
.ls__live-chip.is-off {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ls-dim);
  box-shadow: none;
}

.ls__live-chip.is-off .live-dot {
  background: var(--ls-faint);
  animation: none;
}

.ls__count {
  color: var(--ls-dim);
  font-size: 0.86rem;
  font-weight: 700;
}

.ls__activity {
  display: flex;
  gap: 18px;
  margin: 0;
}

.ls__stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
}

.ls__stat dt {
  color: var(--ls-faint);
  font-size: 0.7rem;
  font-weight: 700;
}

.ls__stat dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ls__stat.is-active dd {
  color: #fbbf24;
}

.ls__all {
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  opacity: 0.8;
}

.ls__all:hover {
  opacity: 1;
}

/* ---- Hero: the screen and its panel ---- */

.ls__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
}

.ls__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #000000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 60px -24px rgba(22, 163, 74, 0.55);
}

.ls__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ls__screen-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(22, 163, 74, 0.35), transparent 70%),
    #07130c;
}

.ls__screen-fallback img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.ls__screen-names {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 900;
}

.ls__screen-names em {
  color: var(--ls-faint);
  font-size: 0.6em;
  font-style: normal;
}

.ls__screen-note {
  position: relative;
  color: var(--ls-dim);
  font-size: 0.84rem;
  font-weight: 700;
}

.ls__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--ls-line);
  background: var(--ls-glass);
  backdrop-filter: blur(10px);
}

.ls__panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--ls-dim);
  font-size: 0.78rem;
  font-weight: 800;
}

.ls__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ls-red);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ls__badge .live-dot {
  width: 7px;
  height: 7px;
  background: #ffffff;
}

.ls__badge--dark {
  background: rgba(255, 255, 255, 0.12);
}

.ls__elapsed {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Scoreboard: names left, big numbers right, like a broadcast bug. */
.ls__scorebug {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 12px;
  overflow: hidden;
}

.ls__side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'name score' 'meta score';
  align-items: center;
  column-gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
}

.ls__side-name {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 900;
}

.ls__side-meta {
  grid-area: meta;
  color: var(--ls-faint);
  font-size: 0.72rem;
  font-weight: 700;
}

.ls__side-score {
  grid-area: score;
  min-width: 2ch;
  text-align: right;
  font-size: 1.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ls__panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--ls-dim);
  font-size: 0.8rem;
  font-weight: 700;
}

.ls__panel-row:empty {
  display: none;
}

.ls__viewers::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ls-red);
  vertical-align: 1px;
}

.ls__watch {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 12px;
  background: var(--ls-felt);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 28px -12px rgba(22, 163, 74, 0.9);
}

.ls__watch:hover {
  background: #15803d;
}

/* Also live: a short channel list, thumbnail + who + score. */
.ls__also {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ls-line);
}

.ls__also-title {
  margin: 0;
  color: var(--ls-faint);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ls__also-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ls__also-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 5px;
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
}

.ls__also-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ls__also-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(22, 163, 74, 0.3), transparent 70%),
    #0b1a10;
}

.ls__also-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ls__also-live {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ls-red);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.ls__also-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ls__also-names {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 800;
}

.ls__also-names em {
  color: var(--ls-faint);
  font-style: normal;
  font-weight: 700;
}

.ls__also-meta {
  color: var(--ls-faint);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ls__also-more {
  color: var(--ls-dim);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

/* ---- Nothing live ---- */

.ls__quiet {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--ls-dim);
  font-size: 0.88rem;
}

.ls__quiet strong {
  color: #ffffff;
}

.ls__quiet a {
  margin-left: auto;
  color: #4ade80;
  font-weight: 800;
  text-decoration: none;
}

/* ---- The just-played row, inside the section ---- */

.ls__rail {
  margin-top: 22px;
}

.ls--quiet .ls__rail {
  margin-top: 16px;
}

.rm.rm--embedded {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

/* Two rows of slightly smaller cards, filled column by column so the
   newest pair leads and the arrows still scroll sideways. More matches in
   view reads as a busier hall. */
.rm--embedded .rm__track {
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: 176px;
  row-gap: 12px;
}

.rm--embedded .rm__track--one-row {
  grid-template-rows: auto;
}

.rm--embedded .rm-card__body {
  padding: 8px 10px 10px;
}

/* With nothing live the rows ARE the section: a touch bigger. */
.ls--quiet .rm--embedded .rm__track {
  grid-auto-columns: 196px;
}

@media (max-width: 980px) {
  .ls__hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .ls {
    padding: 16px;
    border-radius: 22px;
  }

  .ls__head {
    gap: 12px;
  }

  .ls__activity {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .ls__screen {
    border-radius: 14px;
  }

  .ls__quiet a {
    margin-left: 0;
  }

  .rm--embedded .rm__track,
  .ls--quiet .rm--embedded .rm__track {
    grid-auto-columns: 46%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ls__live-chip .live-dot {
    animation: none;
  }
}
