/* KARAOKE LIVE — shared skin for karaoke-live*.html.
   Stage dark, rival stands, one sweeping lyric. Every value here is a custom
   property so karaoke-theme.js can repaint the whole module from the per-game
   back-office JSON; the values below are only what shows before that lands. */

:root {
  --stage:  #0B0A14;
  --riser:  #141126;
  --dim:    #241F3A;
  --ink:    #F2EFFF;
  --mute:   #8B84A8;

  --fill-base: #FF2D77;   /* overridden by intro.primary_color */
  --hot:    var(--fill-base);
  --amber:  #FFB020;
  --cyan:   #34E2E4;   /* editor accents only */

  --display: ui-sans-serif, "Helvetica Neue", "Arial Narrow", system-ui, sans-serif;
  --body:    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --data:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gap: clamp(12px, 2.2vw, 28px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--stage);
  color: var(--secondary-color);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Per-game background image, when the JSON carries one. */
body.has-bg {
  background-image: var(--brand-bg-image, none);
  background-size: cover;
  background-position: center;
}

/* ---- the lyric ----------------------------------------------------------
   Same construction as the classic karaoke's big-text mode: two identical
   layers, the sung one clipped left-to-right over the unsung one. A clip-path
   over solid text stays crisp at any size, which background-clip on a gradient
   does not — and at jumbotron sizes that difference is the whole legibility of
   the module. The font size is not set here: fitLyrics() measures the widest
   row and scales the block to fill the stage. */
.lyricbox {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.lyric {
  position: relative;
  width: 100%;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.05;
}

.lyric__base,
.lyric__fill {
  width: 100%;
  padding: 0.06em 0;
  box-sizing: border-box;
  white-space: nowrap;
  text-align: center;
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.lyric__base { position: relative; color: var(--secondary-color); opacity: 0.30; }

.lyric__fill {
  position: absolute;
  top: 0; left: 0;
  color: var(--fill, var(--fill-base));
  /* --wipe is a percentage; the sung part is revealed from the left. */
  clip-path: inset(0 calc(100% - var(--wipe, 0%)) 0 0);
  transition: clip-path 0.1s linear;
}

/* Lines not being sung yet: present for reading ahead, never competing. */
.lyric--ahead .lyric__base { opacity: 0.16; }
.lyric--ahead .lyric__fill { display: none; }

/* Off-screen ruler fitLyrics() measures a row's natural width against. */
.lyric-ruler {
  position: absolute;
  left: -9999px;
  top: 0;
  white-space: nowrap;
  visibility: hidden;
  pointer-events: none;
}

/* ---- the sync bar: visible proof every screen shares one clock ----------- */
.sync {
  height: 3px;
  background: var(--dim);
  position: relative;
  overflow: hidden;
}
.sync i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--wipe, 0%);
  background: var(--fill, var(--fill-base));
  box-shadow: 0 0 14px var(--fill, var(--fill-base));
}

.eyebrow {
  font-family: var(--data);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

.btn {
  font: 600 15px/1 var(--body);
  color: var(--secondary-color);
  background: var(--riser);
  border: 1px solid var(--dim);
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  min-height: 46px;
}
.btn:hover  { border-color: var(--mute); }
.btn:active { transform: translateY(1px); }
.btn--go    { background: var(--fill-base); border-color: var(--fill-base); color: #12000A; font-weight: 800; }
.btn--stop  { background: transparent; border-color: var(--fill-base); color: var(--fill-base); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.num { font-family: var(--data); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
