/* Tablatures — thème sombre, accent ambre (corde de guitare). */

:root {
  --bg: #14110d;
  --bg-soft: #1d1914;
  --card: #221d16;
  --border: #3a3226;
  --text: #ede5d8;
  --muted: #a99c87;
  --accent: #e8a83e;
  --accent-soft: #f4c877;
  --danger: #e07a5f;
  --ok: #8ab87a;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -10%, #2a2216 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 6vh 20px 40px;
}

.hidden { display: none !important; }

/* ---- entête ---- */
.hero { text-align: center; margin-bottom: 34px; }
.hero h1 {
  font-size: 2.6rem;
  letter-spacing: .01em;
  margin: 0 0 6px;
}
.logo-icon { filter: drop-shadow(0 2px 8px rgba(232, 168, 62, .35)); }
.tagline {
  color: var(--muted);
  max-width: 34rem;
  margin: 0 auto;
  font-size: 1.02rem;
}

/* ---- cartes ---- */
.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 auto 22px;
  max-width: 620px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.card h2 { margin: 0 0 14px; font-size: 1.15rem; }
.card.error { border-color: rgba(224, 122, 95, .5); }
.card.error h2 { color: var(--danger); }

/* ---- sélecteur de mode ---- */
.segmented {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.seg-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: .95rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg-btn.active {
  background: var(--card);
  color: var(--accent-soft);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

/* ---- formulaire ---- */
.panel { margin-bottom: 14px; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; }

input[type="url"], input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 168, 62, .18);
}
input::placeholder { color: #6d6353; }

.btn-primary {
  width: 100%;
  padding: 13px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c1508;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { filter: grayscale(.6) brightness(.75); cursor: wait; }

.btn-secondary {
  padding: 10px 16px;
  font-size: .95rem;
  color: var(--accent-soft);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(232, 168, 62, .12); }
.btn-secondary:disabled { opacity: .5; cursor: wait; }

.btn-ghost {
  display: block;
  margin: 18px auto 0;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: .92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-ghost:hover { color: var(--text); }

.btn-new {
  display: block;
  margin: 26px auto 0;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 600;
}

/* ---- étapes ---- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
}
.steps li.done::before {
  content: "✓";
  color: var(--ok);
  font-weight: 700;
  width: 18px;
  text-align: center;
}
.steps li.current { color: var(--text); }
.steps li.current::before {
  content: "";
  width: 14px;
  height: 14px;
  margin: 0 2px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- preview des variantes ---- */
.preview-title { text-align: center; font-size: 1.4rem; margin: 8px 0 4px; }
.preview-hint { text-align: center; color: var(--muted); margin: 0 0 18px; }

.variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.variant {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.variant:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(232, 168, 62, .12);
}
.variant .v-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.variant .v-label { font-weight: 600; }
.variant iframe {
  width: 100%;
  height: 430px;
  border: 0;
  background: #fff;
}
.variant .v-foot { padding: 12px 16px; }
.variant .v-foot .btn-primary { font-size: .98rem; padding: 11px 14px; }

.audio-cta { text-align: center; margin-top: 20px; }
.audio-error { color: var(--danger); margin: 10px 0 0; }

/* ---- historique ---- */
.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.history li:last-child { border-bottom: 0; }
.history .h-title { font-weight: 600; }
.history .h-artist { color: var(--muted); font-size: .92rem; }
.history .h-open {
  color: var(--accent-soft);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: .92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ---- pied ---- */
.foot {
  text-align: center;
  color: #756a58;
  font-size: .85rem;
  margin-top: 34px;
}

@media (max-width: 560px) {
  .hero h1 { font-size: 2rem; }
  .row { flex-direction: column; }
  .variant iframe { height: 360px; }
}
