/**
 * CSS Niveau 2 — Widget Super-Lecteur Projet & Piste (scene-player.css)
 * Supporte le mode simple et le mode complet multi-scènes (ratios 9:16, 16:9, 1:1, 4:5,
 * rail à zones actives néon, graduations scènes, transport-bar, 🎯 Début piste & 🎧 Solo).
 */
.scene-player-widget {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95) 0%, #050811 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.sp-viewport-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #02040a;
  padding: var(--space-2);
}

.scene-player__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #060911;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}

.ratio-9-16 .scene-player__screen {
  aspect-ratio: 9 / 16;
  width: auto;
  height: min(400px, 46vh);
  max-width: 100%;
}

.ratio-1-1 .scene-player__screen {
  aspect-ratio: 1 / 1;
  width: auto;
  height: min(360px, 44vh);
  max-width: 100%;
}

.ratio-4-5 .scene-player__screen {
  aspect-ratio: 4 / 5;
  width: auto;
  height: min(380px, 45vh);
  max-width: 100%;
}

.sp-backdrop {
  position: absolute;
  inset: -18px;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.38);
  pointer-events: none;
  z-index: 1;
}

.sp-phone-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.32);
  z-index: 8;
  pointer-events: none;
}

.scene-player__video,
.scene-player__image {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-player__fallback {
  position: relative;
  z-index: 2;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
}

.sp-scene-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 9;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(6, 9, 17, 0.78);
  border: 1px solid rgba(96, 165, 250, 0.35);
  backdrop-filter: blur(6px);
  color: #e2e8f0;
  font-family: var(--font-family-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.scene-player__overlays {
  position: absolute;
  top: 14%;
  left: 6%;
  right: 6%;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.sp-overlay-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid #00e599;
  color: #00e599;
  font-family: var(--font-family-display);
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.35);
}

.scene-player__subtitles {
  position: absolute;
  bottom: 10%;
  left: 5%;
  right: 5%;
  z-index: 7;
  text-align: center;
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 3px #000;
  pointer-events: none;
}

.sp-sub-word {
  display: inline-block;
  margin: 0 2px;
  transition: color 0.1s ease;
}

.sp-sub-word.is-active {
  color: #f472b6;
}

/* --- Deck Complet Projet & Piste Audio --- */
.sp-controls-deck {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
  background: rgba(10, 15, 28, 0.95);
  border-top: 1px solid var(--color-border);
}

.sp-rail {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.sp-rail__track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sp-rail__segments,
.sp-rail__ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sp-rail__active-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.55) 0%, rgba(217, 38, 248, 0.65) 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.65), inset 0 0 4px rgba(255, 255, 255, 0.35);
  border-radius: 2px;
}

.sp-rail__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.42);
}

.sp-rail__fill {
  position: relative;
  height: 100%;
  background: rgba(96, 165, 250, 0.28);
  pointer-events: none;
}

.sp-rail__playhead {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-brand-pink);
  box-shadow: 0 0 10px rgba(217, 38, 248, 0.85);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sp-track-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: 2px;
}

.sp-track-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sp-track-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
}

.sp-track-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sp-track-btn--solo.is-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 38, 248, 0.32) 100%);
  border-color: #f59e0b;
  color: #fde68a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.sp-dsp-badge {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-family: var(--font-family-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

/* --- Mode Simple Rétrocompatible --- */
.scene-player__transport {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--color-border);
}

.scene-player__btn-play,
.scene-player__btn-loop {
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}

.scene-player__btn-loop.is-active {
  color: var(--color-brand-blue);
}

.scene-player__progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.scene-player__progress-fill {
  height: 100%;
  background: var(--color-brand-blue);
}

.scene-player__time-badge {
  font-family: var(--font-family-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}