/* Cobblemon Trinity — mise en page du site (s'appuie sur tokens.css + composants.css) */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 24px; background: var(--surface); color: var(--encre); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--texte-bleu); }
.conteneur { width: min(1160px, 100% - 2 * var(--space-6)); margin-inline: auto; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lien-evitement { position: absolute; left: var(--space-4); top: -100px; z-index: 100; }
.lien-evitement:focus { top: var(--space-4); }

/* ---------- En-tête ---------- */
.ct-nav { position: sticky; top: 0; z-index: 50; }
.ct-nav__marque img { width: 40px; height: 40px; }
.nav__theme { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: var(--trait-fin) solid var(--trait); background: var(--surface-relief); color: var(--encre); cursor: pointer; }
.nav__theme svg { width: 20px; height: 20px; }
.nav__theme .icone-lune { display: none; }
[data-theme="nuit"] .nav__theme .icone-soleil { display: none; }
[data-theme="nuit"] .nav__theme .icone-lune { display: block; }
.nav__droite { display: flex; align-items: center; gap: var(--space-3); }
@media (max-width: 760px) {
  .ct-nav { flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-4); }
  .ct-nav__marque span { display: none; }
  .ct-nav__liens { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .nav__droite { margin-left: auto; }
  .nav__droite .ct-btn { display: none; }
}

/* ---------- Héros ---------- */
.heros { padding: var(--space-12) 0 var(--space-16); }
.heros__grille { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-12); align-items: center; }
.heros__titre { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 72px; line-height: 72px; letter-spacing: .01em; }
.heros__chapo { margin: var(--space-4) 0 var(--space-8); font-size: 18px; line-height: 28px; color: var(--encre-douce); max-width: 34ch; }
.heros__visuel { position: relative; aspect-ratio: 1 / 1; border: var(--trait-sticker) solid var(--contour); border-radius: var(--radius-lg); box-shadow: var(--ombre-sticker-lg); display: grid; place-items: center; overflow: hidden; }
.heros__visuel img { width: 78%; height: auto; filter: drop-shadow(0 6px 0 rgba(22, 18, 26, .25)); }
.stats { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-8); }
.stat { background: var(--surface-relief); border: var(--trait-sticker) solid var(--trait); border-radius: var(--radius-lg); box-shadow: var(--ombre-sticker); padding: var(--space-3) var(--space-6); min-width: 170px; }
.stat__nb { display: block; font-family: var(--font-display); font-size: 40px; line-height: 44px; }
.stat__libelle { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-douce); }
.point-live { width: 10px; height: 10px; border-radius: 50%; background: var(--rouge-fort); box-shadow: 0 0 0 3px var(--teinte-rouge); }
.evenement { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.evenement__texte { font-family: var(--font-display); font-size: 24px; line-height: 28px; }
.evenement__sous { font-size: 14px; line-height: 20px; color: var(--encre-douce); font-family: var(--font-sans); }
.heros__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-8); }
@media (max-width: 900px) {
  .heros { padding-top: var(--space-8); }
  .heros__grille { grid-template-columns: 1fr; gap: var(--space-8); }
  .heros__visuel { max-width: 360px; width: 100%; margin-inline: auto; order: -1; }
  .heros__titre { font-size: 48px; line-height: 52px; }
}

/* ---------- Sections ---------- */
.section { padding: var(--space-16) 0; border-top: var(--trait-sticker) solid var(--trait); }
.section--creux { background: var(--surface-creux); }
.section__entete { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); }
.section__titre { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 48px; line-height: 52px; }
.section__chapo { margin: var(--space-2) 0 0; color: var(--encre-douce); font-size: 18px; line-height: 28px; max-width: 60ch; }
@media (max-width: 600px) { .section { padding: var(--space-12) 0; } .section__titre { font-size: 32px; line-height: 36px; } }

/* ---------- Lives ---------- */
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); margin-bottom: var(--space-8); }
.outils .ct-input { flex: 1 1 220px; max-width: 320px; }
.legende { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 20px; color: var(--encre-douce); }
.legende li { display: inline-flex; align-items: center; gap: var(--space-2); }
.legende__carre { width: 14px; height: 14px; border-radius: 4px; border: var(--trait-fin) solid var(--contour); }
.outils .ct-btn { margin-left: auto; }
.grille-joueurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: var(--space-6) var(--space-4); }
.joueur { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: center; min-width: 0; }
.joueur[hidden] { display: none; }
.joueur__cadre { position: relative; width: 104px; height: 104px; border-radius: var(--radius-lg); border: 5px solid var(--etat, var(--trait)); box-shadow: var(--ombre-sticker); background: var(--surface-creux); transition: transform .12s ease; }
.joueur__cadre img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.joueur:hover .joueur__cadre { transform: translate(-2px, -2px) rotate(-2deg); }
.joueur:focus-visible { outline: none; }
.joueur:focus-visible .joueur__cadre { outline: 3px solid var(--focus); outline-offset: 3px; }
.joueur[data-etat="minecraft"] { --etat: var(--statut-ok); }
.joueur[data-etat="autre"] { --etat: var(--or); }
.joueur[data-etat="hors"] .joueur__cadre img { filter: grayscale(1); opacity: .75; }
.joueur__viewers { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); white-space: nowrap; font-weight: 700; font-size: 12px; line-height: 16px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--contour); color: var(--halo); border: var(--trait-fin) solid var(--halo); }
.joueur__nom { margin-top: var(--space-2); font-weight: 700; font-size: 14px; line-height: 20px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.joueur__jeu { font-size: 12px; line-height: 16px; color: var(--encre-douce); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }
.message-vide { text-align: center; color: var(--encre-douce); padding: var(--space-8) 0; }
.maj { margin-top: var(--space-8); font-size: 14px; color: var(--encre-douce); text-align: center; }
@media (max-width: 500px) {
  .grille-joueurs { grid-template-columns: repeat(3, 1fr); gap: var(--space-6) var(--space-2); }
  .joueur__cadre { width: 88px; height: 88px; border-width: 4px; }
  .joueur__nom, .joueur__jeu { max-width: 96px; }
  .outils .ct-btn { margin-left: 0; }
}
.squelette { width: 104px; height: 104px; border-radius: var(--radius-lg); background: var(--surface-creux); border: 5px solid var(--trait); opacity: .5; margin-inline: auto; }

/* ---------- Pop-up joueur ---------- */
.modale { width: min(1280px, 100% - 2 * var(--space-4)); max-height: calc(100% - 2 * var(--space-4)); padding: 0; border: var(--trait-sticker) solid var(--contour); border-radius: var(--radius-lg); background: var(--surface-relief); color: var(--encre); box-shadow: var(--ombre-sticker-lg); overflow: auto; }
.modale::backdrop { background: rgba(22, 18, 26, .7); backdrop-filter: blur(6px); }
.modale__entete { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: var(--trait-sticker) solid var(--trait); }
.modale__avatar { width: 56px; height: 56px; border-radius: var(--radius-md); border: var(--trait-fin) solid var(--contour); object-fit: cover; }
.modale__nom { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 32px; }
.modale__infos { flex: 1; min-width: 0; }
.modale__titre { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--encre-douce); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modale__fermer { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--radius-md); border: var(--trait-fin) solid var(--trait); background: var(--surface-creux); color: var(--encre); cursor: pointer; }
.modale__fermer svg { width: 22px; height: 22px; }
.modale__corps { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-4); padding: var(--space-4) var(--space-6); }
.modale__lecteur { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--radius-md); background: #000; }
.modale__chat { width: 100%; height: 100%; min-height: 360px; border: 0; border-radius: var(--radius-md); background: var(--surface-creux); }
.modale__hors-ligne { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; border-radius: var(--radius-md); padding: var(--space-6); color: var(--contour); }
.modale__hors-ligne p { margin: 0; font-family: var(--font-display); font-size: 24px; line-height: 28px; background: var(--surface-relief); color: var(--encre); padding: var(--space-3) var(--space-6); border-radius: var(--radius-md); border: var(--trait-sticker) solid var(--contour); }
.modale__pied { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: 0 var(--space-6) var(--space-6); }
@media (max-width: 900px) { .modale__corps { grid-template-columns: 1fr; } .modale__chat { display: none; } }

/* ---------- Formulaire ---------- */
.formulaire { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-6); padding: var(--space-8); }
.formulaire .plein { grid-column: 1 / -1; }
.formulaire fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-6); }
.formulaire legend { font-family: var(--font-display); font-size: 24px; line-height: 28px; margin-bottom: var(--space-4); padding: 0; }
.ct-field { min-width: 0; }
.case { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 16px; }
.case input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--rouge-fort); flex: none; }
.piege { position: absolute; left: -5000px; }
.retour { padding: var(--space-4) var(--space-6); border-radius: var(--radius-md); font-weight: 500; }
.retour[hidden] { display: none; }
.retour--ok { background: var(--teinte-ok); color: var(--statut-ok); }
.retour--erreur { background: var(--teinte-rouge); color: var(--texte-rouge); }
@media (max-width: 700px) { .formulaire, .formulaire fieldset { grid-template-columns: 1fr; padding: var(--space-6); } .formulaire fieldset { padding: 0; } }

/* ---------- Règlement ---------- */
.regles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-6); list-style: none; margin: 0; padding: 0; counter-reset: regle; }
.regle { position: relative; padding: var(--space-6); padding-top: var(--space-8); }
.regle__num { position: absolute; top: -14px; left: var(--space-6); font-family: var(--font-display); font-size: 18px; line-height: 20px; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--or-clair); color: var(--contour); border: var(--trait-fin) solid var(--contour); }
.regle .ct-card__texte { color: var(--encre); }
.regle ul { margin: var(--space-2) 0 0; padding-left: 1.2em; color: var(--encre); }
.factions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.sanctions { margin-top: var(--space-8); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--teinte-rouge); color: var(--encre); border: var(--trait-fin) solid var(--texte-rouge); }
.sanctions h3 { margin: 0 0 var(--space-2); font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 28px; color: var(--texte-rouge); }
.sanctions p { margin: 0; }

/* ---------- Pied de page ---------- */
.pied { padding: var(--space-8) 0; background: var(--contour); color: var(--halo); }
.pied .conteneur { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.pied__marque { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-display); font-size: 20px; }
.pied__marque img { width: 40px; height: 40px; }
.pied a { color: var(--or-clair); font-weight: 700; }
.pied p { margin: 0; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Ajustements */
.ct-btn--fantome.ct-btn--sm { box-shadow: none; }
.regle { overflow: visible; gap: var(--space-2); }
.legende__carre { border-color: var(--encre-douce); }
@media (max-width: 600px) {
  .heros__visuel { max-width: 220px; }
  .stats { flex-wrap: nowrap; gap: var(--space-3); }
  .stat { min-width: 0; flex: 1; padding: var(--space-3) var(--space-4); }
  .stat__nb { font-size: 32px; line-height: 36px; }
}

/* ---------- Bandeau cookies ---------- */
.bandeau-cookies { position: fixed; z-index: 90; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); max-width: 760px; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding: var(--space-4) var(--space-6); background: var(--surface-relief); color: var(--encre); border: var(--trait-sticker) solid var(--contour); border-radius: var(--radius-lg); box-shadow: var(--ombre-sticker-lg); }
.bandeau-cookies[hidden] { display: none; }
.bandeau-cookies__texte { flex: 1 1 320px; }
.bandeau-cookies__titre { margin: 0 0 var(--space-1); font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 24px; }
.bandeau-cookies p { margin: 0; font-size: 14px; line-height: 20px; }
.bandeau-cookies__boutons { display: flex; gap: var(--space-3); }
.bandeau-cookies .bouton-choix { min-width: 120px; box-shadow: var(--ombre-sticker); border-color: var(--contour); }
[data-theme="nuit"] .bandeau-cookies .bouton-choix { border-color: var(--trait); }

/* ---------- Lecteur Twitch bloqué ---------- */
.consentement-twitch { grid-column: 1 / -1; display: grid; place-items: center; text-align: center; padding: var(--space-8) var(--space-6); border-radius: var(--radius-md); }
.consentement-twitch__boite { max-width: 520px; background: var(--surface-relief); color: var(--encre); border: var(--trait-sticker) solid var(--contour); border-radius: var(--radius-lg); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); align-items: center; }
.consentement-twitch__boite h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 28px; }
.consentement-twitch__boite p { margin: 0; color: var(--encre-douce); }
.consentement-twitch__boutons { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }

/* ---------- Pages de texte (légal, accessibilité) ---------- */
.page-texte { padding: var(--space-12) 0 var(--space-16); }
.page-texte .conteneur { max-width: 780px; }
.page-texte h1 { margin: 0 0 var(--space-2); font-family: var(--font-display); font-weight: 400; font-size: 48px; line-height: 52px; }
.page-texte .maj-page { margin: 0 0 var(--space-8); color: var(--encre-douce); font-size: 14px; }
.page-texte h2 { margin: var(--space-12) 0 var(--space-3); font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 32px; }
.page-texte h3 { margin: var(--space-6) 0 var(--space-2); font-size: 18px; line-height: 26px; }
.page-texte p, .page-texte li { font-size: 16px; line-height: 26px; }
.page-texte ul { padding-left: 1.2em; }
.page-texte table { width: 100%; border-collapse: collapse; margin: var(--space-4) 0; font-size: 15px; line-height: 22px; }
.page-texte th, .page-texte td { text-align: left; vertical-align: top; padding: var(--space-3); border: var(--trait-fin) solid var(--trait); }
.page-texte th { background: var(--surface-creux); }
.page-texte .tableau-defile { overflow-x: auto; }
.encadre { margin: var(--space-6) 0; padding: var(--space-4) var(--space-6); border-radius: var(--radius-md); background: var(--teinte-bleu); color: var(--encre); border: var(--trait-fin) solid var(--texte-bleu); }
.a-completer { background: var(--or-clair); color: var(--contour); padding: 0 6px; border-radius: 4px; font-weight: 700; }
@media (max-width: 600px) { .page-texte h1 { font-size: 36px; line-height: 40px; } }

/* ---------- Pied de page : liens ---------- */
.pied__liens { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pied__liens a, .pied__liens button { color: var(--halo); font-weight: 500; font-size: 14px; }
.pied__liens button { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; text-decoration: underline; }
.pied .conteneur { align-items: flex-start; }
.pied__bas { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,.2); }
