:root {
  --bg: #0b0910;
  --surface: rgba(23, 19, 31, 0.82);
  --surface-strong: #18141f;
  --surface-soft: #211b2a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f8f5fb;
  --muted: #a7a0af;
  --muted-2: #716a79;
  --pink: #ef5da8;
  --pink-bright: #ff78ba;
  --orange: #ff9f43;
  --violet: #8274ff;
  --green: #1ed760;
  --danger: #ff6969;
  --radius: 26px;
  --font-display: "Manrope", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 48% -15%, rgba(130, 116, 255, 0.14), transparent 34rem),
    linear-gradient(180deg, #0d0a12 0%, var(--bg) 42%, #09080d 100%);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: 20;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.ambient {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.12;
}

.ambient-one { top: 23rem; left: -22rem; background: var(--pink); }
.ambient-two { top: 45rem; right: -24rem; background: var(--violet); }

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.back-link, .guide-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 160ms ease;
}

.back-link span:first-child { font-size: 1.2rem; }
.back-link:hover, .guide-link:hover { color: var(--text); }

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 105px) 0 76px;
  text-align: center;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  color: #c9c3d0;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 13px rgba(30, 215, 96, 0.8);
}

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
  margin: 28px 0 22px;
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 8vw, 6.8rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.068em;
}

.hero h1 em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(105deg, var(--pink-bright), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-copy {
  max-width: 630px;
  margin: 0 auto 35px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
}

.spotify-form { max-width: 760px; margin: 0 auto; }

.input-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 9px 9px 9px 20px;
  background: rgba(30, 25, 38, 0.93);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.35), 0 0 0 7px rgba(255, 255, 255, 0.018);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-shell:focus-within {
  border-color: rgba(239, 93, 168, 0.62);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38), 0 0 0 4px rgba(239, 93, 168, 0.08);
}

.spotify-mark { width: 27px; height: 27px; color: var(--green); }
.spotify-mark svg { display: block; width: 100%; fill: currentColor; }

.input-shell input {
  min-width: 0;
  height: 48px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.96rem;
}

.input-shell input::placeholder { color: #716a79; }

.analyze-button {
  height: 48px;
  padding: 0 18px 0 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #171019;
  background: linear-gradient(120deg, var(--pink-bright), var(--orange));
  border: 0;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(239, 93, 168, 0.24);
  transition: transform 150ms ease, filter 150ms ease;
}

.analyze-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.analyze-button:active { transform: translateY(0); }
.analyze-button:disabled { cursor: wait; opacity: 0.72; }
.button-arrow { font-size: 1.05rem; }

.status-message {
  margin-top: 14px;
  color: #ff8d8d;
  font-size: 0.82rem;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 115px;
}

.panel {
  min-width: 0;
  padding: 26px;
  background: linear-gradient(145deg, rgba(28, 23, 36, 0.94), rgba(19, 16, 25, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--pink-bright);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.panel-heading h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.live-dot {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
}

.live-dot i {
  width: 6px;
  height: 6px;
  background: #6d6772;
  border-radius: 50%;
}

.live-dot.playing { color: #a5f2bf; background: rgba(30, 215, 96, 0.09); }
.live-dot.playing i { background: var(--green); box-shadow: 0 0 8px rgba(30, 215, 96, 0.7); }

.spotify-embed {
  min-height: 152px;
  overflow: hidden;
  background: #121212;
  border-radius: 16px;
}

.spotify-embed iframe { display: block; border-radius: 16px; }

.embed-placeholder {
  min-height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #8b8490;
  font-size: 0.8rem;
}

.mini-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


.timing-heading { margin-bottom: 8px; }
.artist-line { margin: 4px 0 0; color: var(--muted); font-size: 0.77rem; }

.method-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: #ffc6e2;
  background: rgba(239, 93, 168, 0.1);
  border: 1px solid rgba(239, 93, 168, 0.16);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
}

.method-badge.estimate { color: #ffd29d; background: rgba(255, 159, 67, 0.09); border-color: rgba(255, 159, 67, 0.16); }
.method-badge.manual { color: #c7c1ff; background: rgba(130, 116, 255, 0.1); border-color: rgba(130, 116, 255, 0.17); }
.method-badge.waiting { color: var(--muted); background: rgba(255, 255, 255, 0.04); border-color: var(--border); }

.countdown-zone {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 28px;
  padding: 20px 12px 24px 6px;
}

.countdown-ring {
  --ring-progress: 0deg;
  width: 196px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--pink) 0deg, var(--orange) var(--ring-progress), rgba(255, 255, 255, 0.07) var(--ring-progress));
  position: relative;
  box-shadow: 0 0 55px rgba(239, 93, 168, 0.08);
}

.countdown-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface-strong);
}

.countdown-ring::after {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
}

.countdown-core { position: relative; z-index: 1; display: grid; place-items: center; text-align: center; }
.countdown-kicker { color: var(--muted); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.16em; }

.countdown-core strong {
  margin: 5px 0 2px;
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1;
  letter-spacing: -0.06em;
}

.countdown-caption { color: var(--muted-2); font-size: 0.62rem; }

.timing-stats { display: flex; align-items: stretch; gap: 20px; }
.timing-stat { flex: 1; min-width: 0; }
.timing-stat span { display: block; color: var(--muted); font-size: 0.69rem; }

.timing-stat strong {
  display: block;
  margin: 5px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4vw, 2rem);
  letter-spacing: -0.04em;
}

.timing-stat small { color: var(--muted-2); font-size: 0.62rem; }
.timing-stat.hot strong { color: var(--pink-bright); }
.timing-divider { width: 1px; background: var(--border); }

.timeline-card {
  padding: 17px 18px 14px;
  background: rgba(9, 8, 13, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.timeline-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 0.62rem; font-variant-numeric: tabular-nums; }

.energy-track {
  height: 72px;
  margin-top: 4px;
  position: relative;
  overflow: visible;
}

.energy-curve { width: 100%; height: 72px; overflow: visible; }
.energy-line { fill: none; stroke: url(#curveGradient); stroke-width: 2; vector-effect: non-scaling-stroke; }
.energy-area { fill: url(#areaGradient); }

.timeline-fill {
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.timeline-marker {
  position: absolute;
  top: 0;
  bottom: 4px;
  left: 0;
  width: 1px;
  color: var(--text);
  background: currentColor;
  opacity: 0;
}

.timeline-marker i { position: absolute; bottom: -3px; left: -3px; width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.timeline-marker b { position: absolute; top: -3px; left: 6px; font-size: 0.55rem; font-weight: 800; white-space: nowrap; }
.cue-marker { color: #c6bfff; }
.climax-marker { color: var(--pink-bright); }

.timeline-playhead {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 8px;
  height: 8px;
  transform: translateX(-4px);
  background: #fff;
  border: 2px solid #2b2631;
  border-radius: 50%;
  opacity: 0;
}

.moment-span {
  position: absolute;
  top: 0;
  bottom: 4px;
  background: linear-gradient(180deg, rgba(239, 93, 168, 0.26), rgba(239, 93, 168, 0.05));
  border-left: 1px solid var(--pink-bright);
  border-right: 1px solid rgba(239, 93, 168, 0.45);
  border-radius: 3px;
  pointer-events: none;
}

.moment-span b {
  position: absolute;
  top: -3px;
  left: 5px;
  color: var(--pink-bright);
  font-size: 0.55rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Le principal se voit d'un coup d'œil ; les autres s'effacent d'un cran. */
.moment-span.bonus {
  background: linear-gradient(180deg, rgba(130, 116, 255, 0.2), rgba(130, 116, 255, 0.04));
  border-left-color: var(--violet);
  border-right-color: rgba(130, 116, 255, 0.4);
}

.moment-span.bonus b { color: #c6bfff; }

.moment-span.alternative {
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0 5px, transparent 5px 11px);
  border-left: 1px dashed rgba(255, 255, 255, 0.4);
  border-right: 1px dashed rgba(255, 255, 255, 0.2);
}

.moment-span.alternative b { color: var(--muted); }

.cue-marker.bonus { color: #a89dff; }
.cue-marker.alternative { color: var(--muted-2); }


.mark-flag {
  position: absolute;
  top: 2px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid #7ee7c7;
  transform: translateX(-4px);
}

.hero-options {
  display: grid;
  gap: 10px;
  width: min(760px, 100%);
  margin: 26px auto 0;
  text-align: left;
}

.hero-options .lead-control {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.hero-options .option-check { margin-top: 0; }

@media (min-width: 720px) {
  .hero-options { grid-template-columns: 1fr 1fr; }
  .hero-options .lead-control { grid-column: 1 / -1; }
}

.option-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 16px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}

.option-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--violet); cursor: pointer; }
.option-check b { display: block; font-size: 0.76rem; font-weight: 700; }
.option-check small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 0.66rem; line-height: 1.45; }

.moment-span.unreachable { opacity: 0.45; }

.mark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }

.mark-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 17px;
  color: #d8fff2;
  background: rgba(126, 231, 199, 0.1);
  border: 1px solid rgba(126, 231, 199, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.mark-button:hover { background: rgba(126, 231, 199, 0.18); border-color: rgba(126, 231, 199, 0.5); }
.mark-note { color: var(--muted-2); font-size: 0.66rem; }




.analysis-note { margin: 8px 0 0; color: var(--muted-2); font-size: 0.66rem; line-height: 1.45; }
.source-note { margin: 5px 0 0; color: var(--muted-2); font-size: 0.62rem; line-height: 1.45; }
.source-note a { color: #c6bfff; }

.lead-control > span { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 10px; font-size: 0.72rem; }
.lead-control b { font-weight: 700; }
.lead-control output { color: var(--pink-bright); font-weight: 800; }

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border-radius: 999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  appearance: none;
  background: #fff;
  border: 4px solid var(--pink);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #fff;
  border: 4px solid var(--pink);
  border-radius: 50%;
  cursor: grab;
}



.how-it-works { margin-bottom: 100px; }
.section-intro { max-width: 650px; margin-bottom: 32px; }

.section-intro h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.steps-grid article {
  min-height: 210px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.step-number { color: var(--pink-bright); font-family: var(--font-display); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; }
.steps-grid h3 { margin: 42px 0 10px; font-family: var(--font-display); font-size: 1.05rem; }
.steps-grid p { margin-bottom: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.65; }


.safety-note {
  max-width: 780px;
  margin: 0 auto 70px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.safety-note h2 {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.safety-note p { margin: 0 0 9px; color: var(--muted); font-size: 0.78rem; line-height: 1.65; }
.safety-note a { display: inline-flex; gap: 7px; color: #c6bfff; font-size: 0.75rem; font-weight: 600; text-decoration: none; }

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 25px 0 45px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.6;
}

footer p { margin-bottom: 4px; }

.spotify-browser-note {
  max-width: 780px;
  margin-top: 12px;
  padding: 10px 13px;
  color: var(--muted);
  background: rgba(30, 215, 96, 0.06);
  border: 1px solid rgba(30, 215, 96, 0.18);
  border-radius: 12px;
  font-size: 0.74rem;
  line-height: 1.55;
}

.spotify-browser-note strong { color: var(--text); }

.cue-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  text-align: center;
  background: rgba(9, 5, 12, 0.94);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.cue-overlay > span { position: relative; color: var(--pink-bright); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.28em; }
.cue-overlay > strong { position: relative; margin: 6px 0 12px; font-family: var(--font-display); font-size: clamp(4rem, 15vw, 10rem); line-height: 1; letter-spacing: -0.075em; }
.cue-overlay > p { position: relative; color: var(--muted); }
.cue-overlay > p b { color: var(--text); }
.cue-overlay .overlay-rank { margin-top: 6px; color: var(--pink-bright); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; }

.cue-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40vmin;
  height: 40vmin;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(239, 93, 168, 0.45);
  border-radius: 50%;
  animation: cuePulse 1.55s ease-out infinite;
}

@keyframes cuePulse {
  0% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.3); }
}

.cue-close {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 43px;
  height: 43px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}

.hidden { display: none !important; }
.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; }

@media (max-width: 900px) {
  .analysis-layout { grid-template-columns: 1fr; }
  .player-panel { order: 0; }
  .timing-panel { order: 1; }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid article { min-height: 0; }
  .steps-grid h3 { margin-top: 26px; }
}

@media (max-width: 620px) {
  .topbar, main, .safety-note {
  max-width: 780px;
  margin: 0 auto 70px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.safety-note h2 {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.safety-note p { margin: 0 0 9px; color: var(--muted); font-size: 0.78rem; line-height: 1.65; }
.safety-note a { display: inline-flex; gap: 7px; color: #c6bfff; font-size: 0.75rem; font-weight: 600; text-decoration: none; }

footer { width: min(calc(100% - 26px), 1180px); }
  .guide-link { font-size: 0; }
  .guide-link span { font-size: 1rem; }
  .hero { padding-top: 45px; }
  .hero h1 { font-size: clamp(2.8rem, 12.5vw, 4.4rem); letter-spacing: -0.062em; }
  .hero-copy { font-size: 0.94rem; }
  .input-shell { grid-template-columns: auto 1fr; padding: 11px 13px 11px 16px; }
  .analyze-button { grid-column: 1 / -1; width: 100%; }
  .panel { padding: 19px; border-radius: 20px; }
  .countdown-zone { grid-template-columns: 1fr; justify-items: center; padding-top: 22px; }
  .timing-stats { width: 100%; }
  @media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
