/* ============================================================
   songbaston.css — Styles spécifiques SongBaston
   Anciennement /assets/css/main.css

   Ce fichier ajoute UNIQUEMENT les composants propres à
   SongBaston. Le design system commun (variables --bg, --surface,
   --text, --muted, --green, --gold, --twitch, --red ; reset, fonts,
   body, .btn--*, .badge--*, .input, .flex, .gap-*, .mt-*,
   .text-muted, .text-center, .hidden, etc.) est chargé séparément
   par /assets/css/design-system.css via pg_page_start().

   Naming legacy SongBaston :
   - .btn-primary, .btn-twitch, .btn-ghost, .btn-sm, .btn-danger…
     (sans BEM, vs .btn--primary du DS partagé)
   - .badge-accent, .badge-green, .badge-gold, .badge-muted
     (vs .badge--ready/live/soon/admin du DS partagé)
   Ces classes ne sont PAS migrées vers la nomenclature BEM du DS
   pour éviter de casser le HTML de SongBaston (3 pages, 2300+ lignes).
   ============================================================ */


/* === Variables locales SongBaston ===
   On ne redéfinit que les variables QUI N'EXISTENT PAS dans
   /assets/css/design-system.css (ou avec une valeur différente
   utile au look SongBaston). */
:root {
  --surface2: #1c1c2e;   /* surface imbriquée SongBaston (proche de --surface-2 du DS) */
  --accent:   #ff3c6e;   /* alias historique de --red, utilisé partout dans le HTML SongBaston */
  --radius:   12px;      /* radius générique SongBaston (le DS expose --radius-md=12px aussi) */
}

/* === Header local legacy ===
   .header / .logo : ces deux classes datent d'avant le header partagé.
   Si plus aucune page ne les utilise, à supprimer dans une passe
   future. Pour l'instant on les garde pour éviter une régression. */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--accent);
}
.logo span { color: var(--text); }


/* === Boutons legacy (naming sans BEM) === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover  { opacity: .85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-twitch  { background: var(--twitch); color: #fff; }
.btn-primary { background: var(--accent);  color: #fff; }
.btn-green   { background: var(--green);   color: #0a0a0f; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm      { padding: .35rem .8rem; font-size: .8rem; }
.btn-danger  { background: #ff3c3c; color: #fff; }


/* === Cartes génériques === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}


/* === Avatar === */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}


/* === Badges legacy (naming sans BEM) === */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}
.badge-accent { background: var(--accent); color: #fff; }
.badge-green  { background: var(--green);  color: #0a0a0f; }
.badge-gold   { background: var(--gold);   color: #0a0a0f; }
.badge-muted  { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }


/* === Formulaires legacy (sélecteurs sur balises) ===
   Le DS partagé propose .input/.textarea/.select. Ici on cible
   directement les balises HTML pour le rendu legacy SongBaston. */
input[type=text], input[type=url], input[type=number], select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }


/* === Timer bar === */
.timer-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s linear, background .5s;
  background: var(--green);
}


/* === Vote bars === */
.vote-bars { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.vote-bar-wrap { flex: 1; }
.vote-label { font-size: .8rem; color: var(--muted); margin-bottom: .3rem; font-family: 'DM Mono', monospace; }
.vote-count { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; }


/* === Thumbnail === */
.thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface2);
}


/* === Phase label === */
.phase-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}


/* === Utilitaires SongBaston-flavored ===
   Le DS partagé fournit déjà : .flex, .gap-2, .gap-4, .mt-4, .mt-6,
   .text-muted, .text-center, .hidden, .flex-col, .gap-6.
   On ajoute ici uniquement ceux qui MANQUENT au DS partagé. */
.items-center { align-items: center; }
.mt-2         { margin-top: .5rem; }
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-gold    { color: var(--gold); }
.font-mono    { font-family: 'DM Mono', monospace; }
.title        { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: 1px; }
.w-full       { width: 100%; }


/* === Song card === */
.song-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.song-card img.thumb-sm {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--border);
}
.song-card .info { flex: 1; min-width: 0; }
.song-card .song-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card .song-user  { font-size: .78rem; color: var(--muted); }


/* === Alert === */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.alert-error   { background: rgba(255,60,60,.15); border: 1px solid rgba(255,60,60,.4); color: #ff8080; }
.alert-success { background: rgba(60,255,180,.1); border: 1px solid rgba(60,255,180,.3); color: var(--green); }
