* { box-sizing: border-box; margin: 0; padding: 0; }
:root { color-scheme: dark; }
body {
  background: #0a0a0a;
  min-height: 100vh;
  padding: 80px 24px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.page-shell { width: min(100%, 920px); margin: 0 auto; }
.player-editorial {
  --paper: #f4ede0;
  --paper-soft: #eadfce;
  --ink: #1a1410;
  --sepia: #5c4a3f;
  --muted: rgba(92, 74, 63, 0.72);
  --accent: #a8261c;
  --accent-soft: rgba(168, 38, 28, 0.11);
  --rule: rgba(26, 20, 16, 0.2);
  --rule-strong: rgba(26, 20, 16, 0.34);
  position: relative;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  padding: 56px 48px 46px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.player-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 16%, rgba(168, 38, 28, 0.07), transparent 44%),
    radial-gradient(circle at 82% 76%, rgba(168, 38, 28, 0.05), transparent 50%);
  pointer-events: none;
}
.player-editorial > *:not(.player-bg) { position: relative; }
.ed-header {
  display: grid;
  grid-template-columns: 1fr minmax(132px, 180px);
  gap: 32px;
  align-items: start;
  margin-bottom: 36px;
}
.ed-cover {
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: rgba(26, 20, 16, 0.05);
}
.ed-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.ed-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  max-width: 13ch;
  font-weight: 400;
  margin-bottom: 12px;
}
.ed-artist {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: var(--sepia);
}
.ed-description {
  margin-top: 22px;
  max-width: 58ch;
  color: var(--sepia);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.42;
}
.ed-core { margin-bottom: 34px; }
.ed-waveform {
  width: 100%;
  height: 96px;
  display: block;
  margin-bottom: 12px;
  cursor: pointer;
  background: rgba(26, 20, 16, 0.035);
  border: 1px solid rgba(26, 20, 16, 0.11);
}
.ed-progress {
  height: 1px;
  background: var(--rule);
  position: relative;
  margin-bottom: 12px;
  cursor: pointer;
  outline: none;
}
.ed-progress:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft); }
.ed-progress::before { content: ''; position: absolute; inset: -12px 0; }
.ed-progress-fill {
  position: absolute;
  top: -1px;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  pointer-events: none;
}
.ed-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
}
.ed-times {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--sepia);
  margin-bottom: 26px;
}
.ed-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}
.ed-play, .ed-nav, .ed-pill {
  background: transparent;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--sepia);
}
.ed-play {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background 0.22s, color 0.22s, transform 0.12s;
}
.ed-play:hover { background: var(--ink); color: var(--paper); }
.ed-play:active { transform: scale(0.96); }
.ed-play svg { width: 23px; height: 23px; }
.ed-play.is-paused svg { transform: translateX(2px); }
.ed-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sepia);
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.ed-nav:not(:disabled):hover { border-color: var(--ink); color: var(--ink); }
.ed-nav:disabled { opacity: 0.32; cursor: not-allowed; }
.ed-nav svg { width: 16px; height: 16px; }
.ed-secondary-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sepia);
}
.ed-pill {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--sepia);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.ed-pill[aria-pressed="true"] { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.ed-pill:disabled { opacity: 0.4; cursor: not-allowed; }

/* Pill purement iconique : carré arrondi en pastille */
.ed-pill-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
}
.ed-pill-icon svg { display: block; }

/* Groupe vitesse : 3 pills accolées formant une seule capsule */
.ed-speed {
  display: inline-flex;
  border: 1px solid var(--sepia);
  border-radius: 999px;
  overflow: hidden;
}
.ed-speed .ed-pill-speed {
  border: none;
  border-right: 1px solid var(--sepia);
  border-radius: 0;
  padding: 8px 12px;
  min-width: 48px;
  background: transparent;
  color: var(--sepia);
}
.ed-speed .ed-pill-speed:last-child { border-right: none; }
.ed-speed .ed-pill-speed.is-active {
  background: var(--ink);
  color: var(--paper);
}
/* Surcharge : dans le groupe vitesse, on ignore la règle générique [aria-pressed=true]
   qui mettrait du rouge — on garde le noir encre, plus discret. */
.ed-speed .ed-pill-speed[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: transparent;
}

/* Bouton partage : icône + texte */
.ed-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ed-share svg { display: block; }

.ed-volume { display: inline-flex; align-items: center; gap: 10px; }
.ed-volume input { width: 96px; accent-color: var(--accent); }
.ed-active-note {
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  padding: 18px 20px 18px;
  margin: 4px 0 30px;
}
.ed-note-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.ed-active-note h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 8px;
}
.ed-active-note p, .ed-list p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.38;
  color: var(--sepia);
}
.ed-active-note img {
  max-width: 100%;
  margin-top: 16px;
  border: 1px solid var(--rule);
}

/* ─── Paroles synchronisées (vue déroulante) ─────────────────────────────── */
.ed-lyrics {
  margin: 8px 0 30px;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}
.ed-lyrics-viewport {
  position: relative;
  height: 220px;
  overflow: hidden;
  /* Fondu haut/bas pour que les lignes périphériques s'estompent */
  mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 75%, transparent 100%);
}
.ed-lyrics-inner {
  /* Translation appliquée en JS pour faire défiler les lignes */
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  text-align: center;
}
.ed-lyrics-line {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(92, 74, 63, 0.35);
  padding: 0 12px;
  cursor: pointer;
  transition: color 0.32s, opacity 0.32s, font-weight 0.32s;
  user-select: none;
  /* Hauteur de ligne FIXE pour que la translation JS soit prévisible.
     La typo varie (taille, poids) à l'intérieur du conteneur sans modifier
     les positions de chacune des lignes du flow. */
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ed-lyrics-line:empty::before {
  content: '·';
  color: rgba(92, 74, 63, 0.2);
}
.ed-lyrics-line.is-prev-2, .ed-lyrics-line.is-next-2 {
  opacity: 0.45;
  font-size: 15px;
}
.ed-lyrics-line.is-prev-1, .ed-lyrics-line.is-next-1 {
  opacity: 0.7;
  color: rgba(92, 74, 63, 0.55);
  font-size: 16px;
}
.ed-lyrics-line.is-current {
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
  font-style: italic;
  opacity: 1;
  height: 44px;
}
.ed-lyrics-line:hover {
  color: var(--accent);
}
@media (max-width: 460px) {
  .ed-lyrics-viewport { height: 180px; }
  .ed-lyrics-line { height: 32px; }
  .ed-lyrics-line.is-current { font-size: 18px; height: 38px; }
}

.ed-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 28px;
}
.ed-panel, .ed-meta {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.ed-panel-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.ed-list { list-style: none; display: grid; gap: 8px; }
.ed-list button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.ed-list button:hover, .ed-list button.is-active {
  background: rgba(26, 20, 16, 0.045);
  border-color: var(--rule);
}
.ed-list button.is-active { border-left-color: var(--accent); }
.ed-list .line {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 3px;
}
.ed-list time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  min-width: 42px;
  letter-spacing: 0.08em;
}
.ed-list strong {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
}
.ed-list p { font-size: 16px; padding-left: 54px; }
.ed-meta dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.45;
}
.ed-meta dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.ed-meta dd { color: var(--ink); }
.ed-status {
  min-height: 16px;
  margin-top: 20px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ed-quality {
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ed-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  z-index: 50;
}
.ed-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.player-editorial.is-loading #time-current::after { content: ' · chargement'; color: var(--accent); }
@media (max-width: 760px) {
  body { padding: 28px 14px; }
  .player-editorial { padding: 38px 26px 34px; }
  .ed-header { grid-template-columns: 1fr; gap: 24px; }
  .ed-cover { width: 132px; }
  .ed-panels { grid-template-columns: 1fr; }
  .ed-meta dl { grid-template-columns: 1fr; gap: 3px 0; }
  .ed-meta dd { margin-bottom: 8px; }
}
@media (max-width: 460px) {
  .player-editorial { padding: 32px 20px 30px; }
  .ed-eyebrow { font-size: 10px; letter-spacing: 0.2em; }
  .ed-title { font-size: 38px; }
  .ed-play { width: 64px; height: 64px; }
  .ed-controls { gap: 18px; }
  .ed-secondary-controls { justify-content: flex-start; }
  .ed-list p { padding-left: 0; }
}
