/* Players LS RADIO : feuille commune aux 5 radios.
   Chaque page fixe sa couleur avec --brand (couleur du logo). */

:root {
  --brand: #000000;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.68);
  --ink-3: rgba(255, 255, 255, 0.44);
  --veil: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --font: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --cover: min(calc((100vw - 66px) / 1.24), 420px);
  --bars-w: 0.24;       /* largeur des barres, en part de la pochette */

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: inherit; }

html { background: var(--brand); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--brand);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Mise en page ---------- */

.page {
  width: min(1180px, 100%);
  overflow-x: clip;
  margin: 0 auto;
  padding: 20px 22px 40px;
  display: grid;
  gap: 28px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand img { height: 46px; width: auto; }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3);
  transition: background-color 0.3s;
}

body.is-playing .live-dot { background: var(--ink); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.35; } }

.stage {
  display: grid;
  gap: 30px;
  justify-items: start;
}

/* ---------- Pochette et disque ---------- */

.sleeve {
  position: relative;
  width: var(--cover);
  aspect-ratio: 1;
  margin-right: calc(var(--cover) * var(--bars-w) + 22px);
}

.bars {
  position: absolute;
  top: 0;
  left: calc(100% + 14px);
  width: calc(var(--cover) * var(--bars-w));
  height: 100%;
  display: block;
}

.cover {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--brand);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--veil);
}

.cover-logo {
  position: absolute;
  left: 50%; top: 50%;
  width: 62%;
  height: auto;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s;
}

.sleeve.has-cover .cover-logo { opacity: 0; transition-delay: 0.3s; }

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

/* Reflet qui balaie la pochette pendant le changement de titre */
.cover-sweep {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 26%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0.55) 55%, transparent);
  mix-blend-mode: soft-light;
}

/* ---------- Titre en cours ---------- */

.now {
  width: 100%;
  max-width: 34rem;
  display: grid;
  gap: 18px;
}

.title {
  margin: 0;
  font-size: clamp(2.25rem, 9vw, 4.5rem);
  font-weight: 600;
  font-stretch: 78%;
  font-variation-settings: "wdth" 78;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.title.is-long { font-size: clamp(1.75rem, 6.4vw, 3rem); line-height: 1.02; -webkit-line-clamp: 4; }

.artist {
  margin: -6px 0 0;
  font-size: clamp(1.125rem, 3.6vw, 1.5rem);
  line-height: 1.3;
  color: var(--ink-2);
  text-wrap: balance;
}

/* ---------- Encart « Émission en cours » (en-tête) ---------- */

.show {
  position: relative;
  flex: 0 1 25rem;
  min-width: 0;
  height: 3.4rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--veil);
  overflow: hidden;
}

.show .live-dot {
  position: absolute;
  left: 15px; top: 50%;
  margin-top: -4px;
  z-index: 2;
}

.show-slide {
  position: absolute;
  inset: 0;
  padding: 0 16px 0 33px;
  display: grid;
  align-content: center;
  line-height: 1.3;
  visibility: hidden;
}

.show-slide.is-on { visibility: visible; }

/* Chaque ligne : une fenêtre ; le texte trop long y défile doucement */
.show-l1, .show-l2, .show-big {
  display: block;
  overflow: hidden;
  white-space: nowrap;
}

.show-run { display: inline-block; white-space: nowrap; will-change: transform; }

.show-l1.is-overflow, .show-l2.is-overflow, .show-big.is-overflow {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent);
}

.show-l1 { font-size: 0.9375rem; }
.show-l1 b { font-weight: 600; }
.show-l2 { font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.show-big { font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; }

.show.is-flash { animation: flash 1.2s linear; }

.show.is-flash .live-dot { background: currentColor; }

@keyframes flash {
  0%, 22%, 44%, 66% { background: var(--ink); color: var(--brand); }
  11%, 33%, 55%, 100% { background: var(--veil); color: var(--ink); }
}

/* ---------- Changement de radio ---------- */

.curtain, .switch-veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.curtain { display: none; background: var(--brand); }
.arrive .curtain { display: grid; }
.curtain img, .switch-logo { width: min(300px, 56vw); height: auto; }

.arrive .top, .arrive .sleeve, .arrive .now > *, .arrive .lower, .arrive .foot { opacity: 0; }
.arrive.reveal .curtain { animation: curtain-up 0.75s cubic-bezier(0.76, 0, 0.24, 1) 0.12s both; }
.arrive.reveal .curtain img { animation: logo-out 0.45s ease-in both; }
.arrive.reveal .top, .arrive.reveal .now > *, .arrive.reveal .lower, .arrive.reveal .foot {
  opacity: 1;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(0.35s + var(--i, 0) * 0.07s);
}
.arrive.reveal .sleeve { opacity: 1; animation: slide-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both; }

@keyframes curtain-up { to { clip-path: inset(0 0 100% 0); } }
@keyframes logo-out { to { opacity: 0; transform: translateY(-28px) scale(0.92); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-28px) scale(0.97); } }

/* ---------- Votes ---------- */

.votes {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.votes[hidden] { display: none; }

.vote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}

.vote:hover { border-color: rgba(255, 255, 255, 0.5); }
.vote:active { transform: scale(0.95); }
.vote[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--brand); }

.vote svg, .h-vote svg { width: 20px; height: 20px; overflow: visible; }
.vote .h, .h-vote .h { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.vote .crack, .h-vote .crack { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.vote[aria-pressed="true"] .h, .h-vote[aria-pressed="true"] .h { fill: currentColor; }
.vote[aria-pressed="true"] .crack { stroke: var(--ink); stroke-width: 2.2; }

.vote.pop svg { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.3); } }

.progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.progress[hidden] { display: none; }

.bar {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 1s linear;
}

.controls {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 6px;
}

.play {
  position: relative;
  flex: none;
  width: 76px; height: 76px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brand);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s;
}

.play:hover { transform: scale(1.04); }
.play:active { transform: scale(0.97); }

.play svg { width: 30px; height: 30px; fill: currentColor; }
.play .i-play { margin-left: 4px; }
.play .i-pause, .play .i-stop { display: none; }
body.is-playing .play .i-play { display: none; }
body.is-playing .play .i-pause { display: block; }

.play::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s;
}

body.is-loading .play::after { opacity: 1; animation: spin 0.9s linear infinite; }

.volume {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume[hidden] { display: none; }

.mute {
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.mute:hover { color: var(--ink); }
.mute svg { width: 22px; height: 22px; fill: currentColor; }
.mute .i-muted { display: none; }
.mute[aria-pressed="true"] .i-muted { display: block; }
.mute[aria-pressed="true"] .i-sound { display: none; }

.volume input {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 20px;
  background: transparent;
  cursor: pointer;
  --fill: 100%;
}

.volume input::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--fill), var(--line) var(--fill));
}

.volume input::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--fill), var(--line) var(--fill));
}

.volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
}

.volume input::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
}

.status {
  margin: 0;
  min-height: 1.5em;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- Déjà diffusés et autres radios ---------- */

.lower {
  display: grid;
  gap: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.lower h2 {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}

.history[hidden] { display: none; }

.history ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.history li {
  display: grid;
  grid-template-columns: 3.25rem 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.history time {
  font-size: 0.875rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.h-cover {
  width: 44px; height: 44px;
  border-radius: 3px;
  background: var(--veil) center / cover no-repeat;
}

.h-text { min-width: 0; line-height: 1.3; }

@media (max-width: 480px) {
  .history li { grid-template-columns: 2.6rem 44px minmax(0, 1fr) auto; gap: 10px; }
}

.h-title, .h-artist {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-title { font-weight: 600; }

.h-votes { display: flex; gap: 2px; }

.h-vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 44px;
  height: 36px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.h-vote:hover { color: var(--ink); background: var(--veil); }
.h-vote[aria-pressed="true"] { color: var(--ink); }
.h-vote svg { width: 17px; height: 17px; }
.h-vote[aria-pressed="true"] .crack { stroke: var(--brand); stroke-width: 2.2; }
.h-artist { color: var(--ink-2); font-size: 0.9375rem; }

.radios ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 132px;
  padding: 14px;
  border-radius: 10px;
  background: var(--tile);
  border: 1px solid var(--line);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.tile:hover { border-color: rgba(255, 255, 255, 0.5); transform: translateY(-2px); }

.tile-logo { height: 30px; width: auto; }

.tile-now {
  align-self: end;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.tile-cover {
  width: 40px; height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.tile-cover img { width: 100%; height: 100%; object-fit: cover; }

.tile-text { min-width: 0; line-height: 1.25; }

.tile-title, .tile-artist {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-title { font-weight: 600; font-size: 0.9375rem; }
.tile-artist { font-size: 0.8125rem; color: var(--ink-2); }

.tile.is-new .tile-now { animation: tile-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes tile-in { from { opacity: 0; transform: translateY(8px); } }

.foot {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ---------- Grand écran ---------- */

@media (min-width: 900px) {
  :root {
    --cover: min(36vw, 430px);
    --bars-w: 0.4;
  }

  .page { padding: 32px 48px 48px; gap: 40px; }

  .brand img { height: 58px; }
  .show { height: 3.6rem; }

  .stage {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 24px;
    min-height: min(62vh, 560px);
  }


  .lower {
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
    align-items: start;
  }

}

@media (min-width: 1200px) {
  .title { font-size: 5rem; }
  .title.is-long { font-size: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  body.is-playing .live-dot, .vote.pop svg, .show.is-flash { animation: none; }
  .curtain { display: none !important; }
  body.is-loading .play::after { animation-duration: 2.5s; }
}

/* L'encart d'en-tête prend la place restante, le logo garde sa taille */
.brand { flex: none; }
@media (max-width: 480px) {
  .show-l1 { font-size: 0.875rem; }
  .show-l2 { font-size: 0.75rem; }
  .show-big { font-size: 0.9375rem; }
}
