/* Stage player (player.js): full screen, photos drifting behind the lyrics. */
.stage {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; color: var(--foam); background: #050609; overflow: hidden;
}
.stage::backdrop { background: #000; }
html.stage-open { overflow: hidden; }

/* Background slideshow: slow zoom, cross-fade */
.stage-bg, .stage-slide, .stage-clip { position: absolute; inset: 0; }
.stage-slide { background: center / cover no-repeat; opacity: 0; transition: opacity 2s ease; filter: grayscale(.25) brightness(.55); }
.stage-slide.is-on { opacity: 1; animation: stage-zoom 10s ease-out forwards; }
@keyframes stage-zoom { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.stage-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #050609f2 0%, #050609b3 45%, #05060940 100%); }

/* Song with a clip: the clip plays in the background, darker on the lyrics side */
.stage-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.6); }
.stage.has-clip .stage-bg::after { background: linear-gradient(90deg, #050609e6 0%, #05060999 45%, #05060920 100%); }
/* "Voir le clip": lyrics hidden, clip at full brightness */
.stage.is-watching .stage-body { opacity: 0; pointer-events: none; }
.stage.is-watching .stage-video { filter: none; }
.stage.is-watching .stage-bg::after { background: linear-gradient(#05060900 60%, #050609cc); }
.stage-body { transition: opacity .4s; }

/* Clip mode: the YouTube clip fills the background */
.stage-clip { z-index: 1; background: #000; }
.stage-clip iframe { width: 100%; height: 100%; border: 0; }
.stage.is-clip .stage-body { display: none; }
.stage.is-clip .stage-inner { pointer-events: none; }
.stage.is-clip .stage-head, .stage.is-clip .stage-controls { pointer-events: auto; background: #050609d9; }

.stage-inner {
  position: relative; z-index: 2; height: 100%; display: grid; grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr); /* never wider than the screen, whatever the content */
  padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 6vw, 5rem);
}
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.stage-head > div { min-width: 0; }
.stage-head h2, .stage-lyrics li { overflow-wrap: break-word; }
.stage-kicker { margin: 0 0 .4rem; font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.stage-head h2 { margin: 0; font: 200 clamp(2.2rem, 6vw, 4.5rem)/1.05 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--foam); }
.stage-close { font: 300 2.4rem/1 var(--sans); color: var(--foam); background: none; border: 0; cursor: pointer; padding: 0 .3rem; }

/* Lyrics: one line per row; the line being sung lights up when timings exist */
.stage-body { min-height: 0; display: grid; grid-template-rows: 1fr; max-width: 46rem; padding-top: 1.5rem; }
.stage-lyrics {
  list-style: none; margin: 0; padding: 2rem 0 30vh; overflow-y: auto; scrollbar-width: none;
  mask-image: linear-gradient(transparent, #000 12%, #000 80%, transparent);
  font: 300 clamp(1.25rem, 2.6vw, 1.9rem)/1.55 var(--sans);
}
.stage-lyrics::-webkit-scrollbar { display: none; }
.stage-lyrics li { transition: opacity .4s, color .4s, transform .4s; transform-origin: left center; }
.stage-lyrics .stage-gap { height: 1.2em; }
.stage-lyrics.is-synced li { opacity: .35; }
.stage-lyrics.is-synced li.is-past { opacity: .55; }
/* Karaoke: the line being sung stands out in white, the others stay dimmed */
.stage-lyrics li.is-active { opacity: 1; color: #fff; }

/* Controls */
.stage-controls { display: grid; grid-template-columns: auto 1fr; gap: .8rem 2rem; align-items: center; padding-top: 1rem; }
.stage-buttons { display: flex; gap: .6rem; align-items: center; }
.stage-btn { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; color: var(--foam); background: #ffffff14; border: 1px solid #ffffff2e; cursor: pointer; }
.stage-btn:hover { border-color: var(--gold); color: var(--gold); }
.stage-play { width: 4rem; height: 4rem; background: var(--gold); color: #07080d; border-color: var(--gold); }
.stage-play:hover { color: #07080d; filter: brightness(1.1); }
.stage-progress { display: flex; align-items: center; gap: .8rem; }
.stage-time { font-size: .8rem; font-variant-numeric: tabular-nums; opacity: .75; min-width: 2.6rem; }
.stage-seek { flex: 1; accent-color: var(--gold); }
.stage-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.stage-note { margin: 0; font-size: .85rem; opacity: .8; }
.stage-full { display: flex; gap: .3rem; }
.stage :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 760px) {
  .stage-inner { padding: 1rem 1.1rem; }
  .stage-head h2 { font-size: clamp(1.3rem, 6.2vw, 2.4rem); letter-spacing: .03em; }
  .stage-lyrics { font-size: 1.15rem; }
  .stage-extra .btn { padding: .7rem 1.1rem; }
  .stage-bg::after { background: linear-gradient(#050609e6, #050609b3 50%, #050609e6); }
  .stage-controls { grid-template-columns: 1fr; justify-items: center; }
  .stage-progress { width: 100%; }
  .stage-extra { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-slide.is-on { animation: none; }
  .stage-lyrics li { transition: none; }
}

/* Buttons styled with display must still hide */
.stage [hidden] { display: none !important; }
