/* Styles du module « Rencontres et imports » (rencontres). PROPRIÉTAIRE : l'équipe du module.
   Classes préfixées « re- ». Couleurs : jetons de app.css (clair et sombre) ; le ton d'un type de rendez-vous
   (--ag-ton) vient des classes « ag-type-… » du socle, posées sur les cartes. */

/* Tons lisibles sur fond sombre : --ok / --alerte du socle sont pensés pour un fond clair. Pour le TEXTE des pastilles
   et des messages du module, ils sont éclaircis en thème sombre (les aplats gardent les jetons du socle). */
:root { --re-ok: var(--ok); --re-alerte: var(--alerte); }
@media (prefers-color-scheme: dark) {
  :root { --re-ok: color-mix(in srgb, var(--ok) 48%, #fff); --re-alerte: color-mix(in srgb, var(--alerte) 42%, #fff); }
}
.re-puces .pastille.ok, .re-etat .pastille.ok, .re-resume .pastille.ok, .re-section .pastille.ok, .re-import .message.ok, .re-puce-enfant.re-ok { color: var(--re-ok); }
.re-resume .pastille.alerte, .re-section .pastille.alerte, .re-carte > .pastille.alerte, .re-alertes, .re-a-enregistrer { color: var(--re-alerte); }

/* ---------- page Rencontres : filtres, tours, semaines, cartes ---------- */
.re-filtres { justify-content: flex-start; margin-bottom: 0; }
.re-filtres select { width: auto; max-width: 240px; min-height: 40px; padding: 7px 10px; }
.re-bascule { display: inline-flex; border: 1px solid var(--trait-fort); border-radius: var(--rayon-petit); overflow: hidden; background: var(--surface); align-self: flex-start; }
.re-bascule button { min-height: 38px; border: 0; border-radius: 0; background: none; color: var(--doux); padding: 6px 14px; }
.re-bascule button + button { border-left: 1px solid var(--trait-fort); }
.re-bascule button[aria-pressed=true] { background: var(--teinte); color: var(--encre); }
.re-bascule button:hover { filter: none; color: var(--encre); }

.re-blocs { display: flex; flex-direction: column; gap: 14px; }
.re-tour { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; font-size: 1.1rem; padding-bottom: 6px; border-bottom: 1px solid var(--trait); white-space: normal; }
.re-tour:first-child { margin-top: 0; }
.re-tour .doux { font-weight: 500; font-size: .85rem; }
.re-semaine { display: flex; flex-direction: column; gap: 8px; }
.re-titre-semaine { margin: 0; font-size: .85rem; font-weight: 650; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; }
.re-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.re-carte { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 13px; background: var(--surface); border: 1px solid var(--trait); border-left: 3px solid var(--ag-ton, var(--club)); border-radius: var(--rayon); box-shadow: var(--ombre); }
.re-date { display: grid; place-items: center; width: 52px; min-height: 58px; padding: 4px 0; flex: none; border-radius: 12px; background: color-mix(in srgb, var(--ag-ton, var(--club)) 12%, var(--surface)); line-height: 1.1; }
.re-date small { font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.re-date strong { font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.re-ouvrir { all: unset; cursor: pointer; display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 3px; }
.re-ouvrir:focus-visible { outline: 2px solid var(--club); outline-offset: 3px; border-radius: 6px; }
.re-ouvrir > strong { font-size: 1rem; }
.re-ouvrir:hover > strong { text-decoration: underline; }
.re-ligne2 { color: var(--doux); font-size: .9rem; }
.re-puces { margin-top: 3px; }
.re-puces .puce, .re-puces .pastille { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-puce-enfant { background: var(--surface-2); }
.re-puce-enfant.re-ok { background: var(--ok-fond); color: var(--re-ok); }
.re-score { font-variant-numeric: tabular-nums; font-weight: 750; }
.re-pastille { background: color-mix(in srgb, var(--ag-ton, var(--club)) 12%, var(--surface)); color: var(--encre); border-color: transparent; }
.re-annule .re-ouvrir > strong { text-decoration: line-through; color: var(--doux); }
.re-annule .re-date { opacity: .55; }

/* tableau de bord */
.re-liste-panneau { padding: 6px 16px 16px; }
.re-liste-panneau .re-carte { box-shadow: none; }
.re-rien { padding: 6px 20px 18px; margin: 0; }

/* ---------- fiche d'une rencontre ---------- */
.re-faits, .re-enfants { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.re-faits li, .re-enfants li { display: flex; align-items: flex-start; gap: 10px; }
.re-faits .icone, .re-enfants .icone { color: var(--doux); margin-top: 2px; flex: none; }
.re-faits li > span, .re-enfants li > span { display: flex; flex-direction: column; min-width: 0; }
.re-libelle { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.re-valeur { white-space: pre-wrap; overflow-wrap: anywhere; }
.re-remarques { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); }
.re-enfants { padding: 10px 12px; border-radius: var(--rayon-petit); background: var(--teinte); }
.re-actions { margin: 4px 0; }
.re-aide { font-weight: 400; }

/* ---------- réglages : tours, résultats, messages types ---------- */
.re-tours { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.re-rangee-tour { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px 34px; gap: 8px; align-items: center; }
.re-rangee-tour input { min-width: 0; width: 100%; }
.re-case-resultats { align-items: center; white-space: nowrap; }
.re-case-resultats input { margin-top: 0; }
.lignes > li > .re-icones { width: auto; padding-left: 0; flex-wrap: nowrap; }
.re-variables { display: flex; flex-direction: column; gap: 6px; }
.re-variable { min-height: 28px; padding: 2px 9px; font-size: .78rem; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); color: var(--encre); border: 1px solid var(--trait); border-radius: 999px; }
.re-variable:hover { background: var(--teinte); filter: none; }

/* ---------- équipes du jour ---------- */
.re-etat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; color: var(--doux); }
.re-a-enregistrer { color: var(--re-alerte); font-size: .9rem; }
.re-outils { margin: 0; }
.re-mode-emploi { margin: 0; }
.re-plateau { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.re-colonne { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); min-width: 0; }
.re-colonne.re-banc { background: var(--surface-2); border-style: dashed; border-color: var(--trait-fort); box-shadow: none; }
.re-colonne.re-cible { border-color: var(--club); box-shadow: 0 0 0 3px color-mix(in srgb, var(--club) 25%, transparent); }
.re-tete-colonne { display: flex; flex-direction: column; gap: 8px; }
.re-tete-colonne h2 { margin: 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-banc .re-tete-colonne, .re-tete-colonne:not(:has(input)) { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.re-nom-equipe { display: flex; align-items: center; gap: 6px; }
.re-nom-equipe input { flex: 1; min-width: 0; font-weight: 700; min-height: 38px; padding: 6px 10px; }
.re-tete-colonne select, .re-tete-colonne > input { min-height: 36px; padding: 5px 8px; font-size: .88rem; width: 100%; min-width: 0; }
.re-joueurs { display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.re-vide { margin: 0; padding: 10px 0; text-align: center; }
.re-joueur { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; min-height: 44px; padding: 6px 12px; text-align: left; background: var(--surface-2); color: var(--encre); border: 1px solid var(--trait); border-radius: var(--rayon-petit); font-weight: 600; line-height: 1.25; }
.re-banc .re-joueur { background: var(--surface); }
button.re-joueur { cursor: grab; }
button.re-joueur:hover { filter: none; border-color: var(--trait-fort); }
.re-joueur > span { max-width: 100%; }
.re-joueur small { font-weight: 500; font-size: .76rem; }
.re-joueur.re-choisi { border-color: var(--club); background: var(--teinte); box-shadow: 0 0 0 2px color-mix(in srgb, var(--club) 30%, transparent); }
.re-joueur.re-glisse { opacity: .5; }
.re-joueur.re-non-convoque { border-style: dashed; color: var(--doux); }
.re-placer { align-self: stretch; overflow: hidden; text-overflow: ellipsis; }

/* ---------- convocation ---------- */
.re-convocation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.re-section { display: flex; flex-direction: column; gap: 12px; }
.re-section > h2 { margin: 0; font-size: 1.05rem; }
.re-section > p { margin: 0; }
.re-modes { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.re-modes .case, .re-cases-joueurs .case { align-items: center; }
.re-modes input, .re-cases-joueurs input { margin-top: 0; }
.re-modes input[type=radio] { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--club); }
.re-modes .case { white-space: nowrap; width: auto; }
.re-cases-joueurs { max-height: 320px; overflow-y: auto; }
.re-apercu-message { margin: 0; padding: 12px 14px; border-radius: var(--rayon-petit); background: var(--surface-2); border: 1px solid var(--trait); font: inherit; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- imports ---------- */
.re-import { display: flex; flex-direction: column; gap: 16px; }
.re-import form { display: flex; flex-direction: column; gap: 14px; }
.re-import form > button[type=submit] { align-self: flex-start; }
.re-import input[type=file] { padding: 8px; }
.re-modele { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; padding-top: 12px; border-top: 1px solid var(--trait); }
.re-minimisation { display: flex; align-items: flex-start; gap: 10px; }
.re-minimisation .icone { flex: none; margin-top: 2px; color: var(--doux); }
.re-minimisation span { overflow-wrap: anywhere; }
.re-resume { margin: 0; }
.re-alertes { list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; border-radius: var(--rayon-petit); background: var(--alerte-fond); color: var(--re-alerte); }
.re-alertes li { display: flex; align-items: flex-start; gap: 8px; }
.re-alertes .icone { flex: none; margin-top: 2px; }
.re-colonnes { border: 1px solid var(--trait); border-radius: var(--rayon-petit); padding: 12px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 12px; }
.re-colonnes legend { font-weight: 700; font-size: .85rem; padding: 0 4px; }
.re-colonnes label { font-size: .82rem; min-width: 0; }
.re-colonnes select { min-height: 38px; padding: 6px 8px; min-width: 0; width: 100%; }
.re-import .tableau-donnees .re-raison { display: block; margin-top: 3px; white-space: normal; overflow: visible; min-width: 170px; max-width: 300px; }
/* première colonne : un numéro de ligne ou une case à cocher, pas un nom (le socle lui réserve 240 px) */
.re-import .tableau-donnees td:first-child, .re-import .tableau-donnees th:first-child { min-width: 0; width: 1%; max-width: none; }
.re-type { min-height: 34px; padding: 4px 8px; width: auto; }
.re-cellule-titre { max-width: 260px; }
.re-action-ignorer td:not(:last-child), .re-action-inchange td:not(:last-child) { color: var(--doux); }
.re-import .tableau-donnees td { padding: 8px 12px; }
.re-import .tableau-donnees input[type=checkbox] { margin: 0; }
.re-notre-nom { align-items: flex-end; }
.re-notre-nom label { flex: 1; min-width: 200px; }

@media (max-width: 860px) {
  .re-filtres select { flex: 1; min-width: 0; }
  .re-filtres .re-bascule { width: 100%; }
  .re-bascule button { flex: 1; }
  .re-carte { gap: 10px; padding: 10px 12px 10px 9px; }
  .re-date { width: 46px; }
  .re-masquable { display: none; }
  .re-liste-panneau { padding: 4px 12px 12px; }
  .re-convocation { grid-template-columns: minmax(0, 1fr); }
  .re-plateau { grid-template-columns: minmax(0, 1fr); }
  .re-rangee-tour { grid-template-columns: minmax(0, 1fr) 76px 76px 34px; gap: 6px; }
  .re-import form > button[type=submit] { align-self: stretch; }
  .re-outils button { flex: 1 1 auto; }
  .re-import .tableau-donnees td, .re-import .tableau-donnees th { padding: 8px 9px; }
  .re-cellule-titre { max-width: 170px; }
}
.re-import form p[role=status]:empty { display: none; }
