/* Only Connect — jeu musical quotidien. Charte omniaamplecti (papier / or),
   même palette que Songoku (catégorie Musique). Le bandeau et le pied de page
   viennent de /assets/site.css : ne rien redéfinir ici pour eux. */
:root {
  --ink: #1a1814;
  --paper: #f2f5fa;
  --paper-dark: #e6ecf6;
  --gold: #b89a5a;
  /* Gris de la charte éclairci par le fond bleuté : #7a7060 ne donne que 4,45:1
     sur --paper, sous le seuil AA. Cette nuance passe à 4,7:1 partout. */
  --muted: #6e6659;
  --brand: #1d3a5f;
  --nav-h: 72px;
  --line: rgba(184, 154, 90, 0.28);
  /* Or lisible : l'or de la charte (#b89a5a) ne donne que 2,5:1 sur fond clair,
     insuffisant pour du texte. Cette variante sert dès qu'il s'agit de mots. */
  --gold-txt: #7a5d22;
  --ok: #4f8a5b;
  --ko: #b5544b;
}
* { box-sizing: border-box; }
/* [hidden] doit gagner contre les display:flex ci-dessous */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Montserrat', sans-serif; font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ── EN-TÊTE ── */
.entete { max-width: 900px; margin: 0 auto; padding: calc(var(--nav-h) + 2.5rem) 1.5rem 1rem; text-align: center; }
.eyebrow { font-size: .66rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-txt); margin: 0 0 .7rem; }
.entete h1 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; margin: 0; color: var(--brand); }
.accroche { max-width: 580px; margin: .9rem auto 0; font-size: .92rem; line-height: 1.6; color: var(--muted); }
.meta { margin: 1rem 0 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.meta b { color: var(--ink); }
.filet { width: 56px; height: 1px; background: var(--gold); margin: 1.3rem auto 0; }

/* ── BANDEAU DE SCORE ── */
/* Quatre colonnes égales : les compteurs tiennent sur UNE ligne à toute
   largeur, y compris sur téléphone (d'où minmax(0,1fr) et min-width:0). */
.compteurs { max-width: 620px; margin: 0 auto 1.4rem; padding: 0 1rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.compteur { min-width: 0; padding: .5rem .3rem; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.compteur b { display: block; font-family: 'Cormorant Garamond', serif; font-size: clamp(1.1rem, 4.6vw, 1.5rem); line-height: 1.15; color: var(--brand); white-space: nowrap; }
.compteur span { display: block; font-size: clamp(.58rem, 2.1vw, .6rem); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* ── DIFFICULTÉ DU JOUR ── */
.difficulte { max-width: 620px; margin: 0 auto .7rem; padding: 0 1rem; text-align: center;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.difficulte b { color: var(--brand); font-size: .82rem; }
.difficulte .jauge { color: var(--gold-txt); letter-spacing: .18em; font-size: .8rem; }

/* ── LES QUATRE CHANSONS ── */
.chansons { list-style: none; max-width: 620px; margin: 0 auto 1.3rem; padding: 0 1rem; display: grid; gap: .7rem; }
.chanson { display: flex; align-items: center; gap: .85rem; padding: .7rem .85rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.chanson.cachee { background: var(--paper-dark); border-style: dashed; color: var(--muted); }
.rang { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; background: var(--paper-dark); border: 1px solid var(--line); }
.chanson.devoilee .rang { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.pochette { width: 54px; height: 54px; flex: 0 0 54px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: var(--paper-dark); }
.infos { flex: 1; min-width: 0; }
.titre { display: block; font-weight: 500; font-size: .93rem; line-height: 1.35; color: var(--ink); }
.artiste { display: block; font-size: .8rem; color: var(--muted); }
.lien-complet { font-size: .68rem; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.cachee-txt { flex: 1; font-size: .85rem; font-style: italic; }
.ecouter { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; border: 1px solid var(--gold-txt); background: #fff; color: var(--gold-txt); font-size: .95rem; transition: background .15s, color .15s; }
.ecouter:hover, .ecouter.joue { background: var(--gold); color: var(--ink); }
.ecouter[disabled] { opacity: .35; cursor: default; }

/* ── PROPOSITION ── */
.proposition { max-width: 620px; margin: 0 auto; padding: 0 1rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.proposition input {
  flex: 1 1 100%; padding: .8rem .9rem; font-family: 'Montserrat', sans-serif; font-size: .95rem;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
.proposition input:focus { border-color: var(--gold-txt); }
.btn {
  padding: .8rem 1.3rem; cursor: pointer; border-radius: 6px; font-family: 'Montserrat', sans-serif;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.proposition .btn { flex: 1 1 0; }
.btn.secondaire { background: #fff; color: var(--brand); border-color: var(--line); }
.btn.secondaire:hover { background: var(--paper-dark); color: var(--ink); border-color: var(--gold); }
.btn[disabled] { opacity: .45; cursor: default; }

.valeur { max-width: 620px; margin: .9rem auto 0; padding: 0 1rem; text-align: center; font-size: .82rem; color: var(--muted); }
.valeur b { color: var(--gold-txt); font-size: .98rem; }
.retour { max-width: 620px; margin: .7rem auto 0; padding: 0 1rem; min-height: 1.5em; text-align: center; font-size: .9rem; }
.retour.faux { color: var(--ko); }

/* ── FIN DE PARTIE ── */
.resultat { max-width: 620px; margin: 1.6rem auto 0; padding: 1.4rem 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.resultat h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.7rem; margin: 0 0 .3rem; color: var(--brand); }
.resultat .theme { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.3rem; color: var(--gold-txt); margin: .2rem 0 .6rem; }
.resultat .score { font-size: 1rem; margin: .3rem 0; }
.resultat .score b { color: var(--brand); font-size: 1.15rem; }
.resultat .detail { font-size: .8rem; color: var(--muted); margin: .35rem 0; }
.carres { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; letter-spacing: .12em; margin: .7rem 0 .2rem; }
.share-row { max-width: 620px; margin: 1rem auto 0; padding: 0 1rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

/* ── AIDE ── */
.help { max-width: 680px; margin: 1.6rem auto; padding: 0 1rem; font-size: .88rem; color: var(--muted); }
.help summary { cursor: pointer; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-txt); }
.help p { line-height: 1.65; }
.help b { color: var(--ink); font-weight: 500; }

@media (max-width: 640px) {
  .entete { padding-top: calc(var(--nav-h) + 1.6rem); }
  .compteurs { gap: .35rem; padding: 0 .6rem; }
  .compteur { padding: .45rem .15rem; }
  .compteur span { letter-spacing: .04em; }
  .pochette { width: 44px; height: 44px; flex-basis: 44px; }
  .proposition input { flex: 1 1 100%; }
  .proposition .btn { flex: 1; }
}

/* ── Aide en tête de page ── */
.help.haut { margin: 0 auto 1.4rem; }
.help.haut details { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem; }
.help.haut summary { padding: .2rem 0; }
.help.haut p:last-child { margin-bottom: .4rem; }

/* ── Chanson jouée mais non identifiée (pendant la partie) ── */
.pochette-vide { display: grid; place-items: center; color: var(--gold-txt); font-size: 1.5rem; border-style: dashed; }
.chanson.masquee .titre { color: var(--muted); font-weight: 400; }
.chanson.masquee .artiste { font-style: italic; }

/* ── Accessibilité ── */
/* Texte réservé aux lecteurs d'écran (invisible mais lu). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Anneau de focus visible partout au clavier. */
.proposition input:focus-visible,
.btn:focus-visible,
.ecouter:focus-visible,
.help summary:focus-visible,
.lien-complet:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Le résultat reçoit le focus en fin de partie : on le signale sans agressivité. */
.resultat:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.resultat:focus:not(:focus-visible) { outline: none; }

/* ── Statistiques du jour, tous joueurs ── */
.communaute { margin: 1.1rem auto 0; padding-top: .9rem; border-top: 1px solid var(--line); text-align: left; }
.comm-titre { margin: 0 0 .3rem; font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-txt); text-align: center; }
.comm-total { margin: 0 0 .7rem; font-size: .85rem; color: var(--muted); text-align: center; }
.comm-total b { color: var(--brand); font-size: .95rem; }
.comm-barres { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.comm-barres li { display: flex; align-items: center; gap: .55rem; font-size: .78rem; color: var(--muted); }
.comm-lab { flex: 0 0 46px; text-align: right; }
.comm-barre { flex: 1; height: 12px; background: var(--paper-dark); border-radius: 6px; overflow: hidden; }
.comm-barre i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.comm-n { flex: 0 0 34px; text-align: left; color: var(--ink); font-weight: 500; }
