/* =========================================================
   YAM'S — Feuille de score
   Ambiance table de jeu : vert très foncé, blanc cassé, or.
   Mobile-first.
   ========================================================= */

:root {
  --vert-950: #041a12;
  --vert-900: #07241a;
  --vert-800: #0b3024;
  --vert-700: #0f3d2e;
  --vert-600: #155039;
  --vert-500: #1d6249;

  --creme: #f4efe3;
  --creme-2: #ddd6c4;
  --creme-doux: rgba(244, 239, 227, 0.66);
  --creme-faible: rgba(244, 239, 227, 0.14);

  --or: #caa54e;
  --or-clair: #e8cb7e;
  --or-fonce: #8f6f28;
  --or-voile: rgba(202, 165, 78, 0.16);

  --danger: #d9826f;
  --danger-fond: #6e2a1f;

  --rayon: 14px;
  --rayon-petit: 10px;
  --ombre: 0 10px 30px rgba(0, 0, 0, 0.35);

  --serif: Georgia, "Times New Roman", "DejaVu Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --tactile: 48px;

  /* Filigrane : opacité réglable ici uniquement */
  --filigrane-opacite: 0.045;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  color: var(--creme);
  background-color: var(--vert-900);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(40, 110, 80, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.45), transparent 60%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

/* ---------- Filigrane Créaprod-JISTA ---------- */
.filigrane {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  background: url("assets/creaprod-jista-monogramme-watermark.png") center / min(96vw, 92vh) auto no-repeat;
  opacity: var(--filigrane-opacite);
}
.ecran { position: relative; z-index: 1; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--or-clair); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tactile);
  padding: 0 20px;
  border-radius: var(--rayon-petit);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn-large { width: 100%; min-height: 56px; font-size: 17px; }
.btn-or {
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: var(--vert-950);
  box-shadow: 0 2px 0 var(--or-fonce);
}
.btn-or:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 var(--or-fonce); }
.btn-or:disabled { opacity: .35; box-shadow: none; }
.btn-contour {
  border: 1.5px solid rgba(232, 203, 126, 0.55);
  color: var(--or-clair);
}
.btn-contour:hover { background: var(--or-voile); }
.btn-danger {
  background: var(--danger-fond);
  border: 1.5px solid var(--danger);
  color: #ffe3dc;
}
.btn-lien {
  min-height: 44px;
  padding: 0 8px;
  color: var(--creme-doux);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 15px;
}
.btn-lien:disabled { opacity: .35; text-decoration: none; }

/* ---------- Cartes ---------- */
.carte {
  background: linear-gradient(180deg, rgba(21, 80, 57, 0.55), rgba(11, 48, 36, 0.75));
  border: 1px solid rgba(202, 165, 78, 0.35);
  border-radius: var(--rayon);
  padding: 20px 18px;
  box-shadow: var(--ombre);
}
.carte-titre {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--or-clair);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.carte-etiquette {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--or);
}

/* =========================================================
   ACCUEIL
   ========================================================= */
.ecran-accueil {
  max-width: 480px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.accueil-entete { text-align: center; padding: 8px 0 4px; }
.accueil-des { color: var(--or); font-size: 26px; letter-spacing: 0.12em; }
.accueil-titre {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.05;
  color: var(--creme);
  margin-top: 6px;
}
.accueil-sous-titre { color: var(--creme-doux); margin-top: 4px; }

.carte-reprendre { display: flex; flex-direction: column; gap: 10px; }
.reprendre-resume { color: var(--creme); font-size: 15px; }

.champ-groupe { border: 0; margin-bottom: 18px; }
.champ-libelle {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--creme-doux);
  margin-bottom: 8px;
}
.choix-nombre { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.btn-nombre {
  min-height: 56px;
  border-radius: var(--rayon-petit);
  border: 1.5px solid var(--creme-faible);
  background: rgba(4, 26, 18, 0.45);
  font-family: var(--serif);
  font-size: 26px;
  color: var(--creme);
}
.btn-nombre[aria-pressed="true"] {
  border-color: var(--or);
  background: var(--or-voile);
  color: var(--or-clair);
  box-shadow: inset 0 0 0 1px var(--or);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Choix des joueurs connus */
.bloc-joueurs { margin-bottom: 20px; }
.compteur-joueurs { float: right; color: var(--or-clair); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.liste-joueurs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}
.liste-joueurs:empty { display: none; }
.puce-joueur {
  position: relative;
  min-height: 52px;
  padding: 0 12px 0 14px;
  border-radius: var(--rayon-petit);
  border: 1.5px solid var(--creme-faible);
  background: rgba(4, 26, 18, 0.55);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--creme);
  text-align: left;
}
.puce-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.puce-joueur[aria-pressed="true"] {
  border-color: var(--or);
  background: var(--or-voile);
  color: var(--or-clair);
  box-shadow: inset 0 0 0 1px var(--or);
}
.puce-ordre {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: var(--vert-950);
  font-size: 13px;
  font-weight: 800;
}
.btn-nouveau-joueur {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border-radius: var(--rayon-petit);
  border: 1.5px dashed rgba(232, 203, 126, 0.55);
  color: var(--or-clair);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.btn-nouveau-joueur:disabled { opacity: .35; }
.nouveau-joueur { display: flex; gap: 8px; margin-top: 8px; }
.nouveau-joueur input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border-radius: var(--rayon-petit);
  border: 1.5px solid var(--or);
  background: rgba(4, 26, 18, 0.55);
  color: var(--creme);
  font: inherit;
  font-size: 18px;
}
.nouveau-joueur input::placeholder { color: rgba(244, 239, 227, 0.35); }
.nouveau-joueur input:focus { outline: none; box-shadow: 0 0 0 3px var(--or-voile); }
.nouveau-joueur .btn { min-height: 52px; padding: 0 16px; }

/* =========================================================
   JEU
   ========================================================= */
.ecran-jeu {
  height: 100vh;
  height: 100dvh;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  gap: 8px;
}

.barre-jeu,
.suivi-scores,
.barre-fin { flex-shrink: 0; }
.barre-jeu {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
}
.barre-droite { display: flex; gap: 6px; }
.btn-outil {
  min-width: var(--tactile);
  min-height: var(--tactile);
  padding: 4px 6px;
  border-radius: var(--rayon-petit);
  border: 1px solid var(--creme-faible);
  background: rgba(4, 26, 18, 0.45);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 20px;
  line-height: 1;
  color: var(--creme);
}
.btn-outil-texte { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--creme-doux); }
.btn-outil:disabled { opacity: .3; }

.bandeau-tour {
  text-align: center;
  padding: 6px 8px;
  border-radius: var(--rayon-petit);
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: var(--vert-950);
  min-width: 0;
  box-shadow: 0 2px 0 var(--or-fonce);
}
.bandeau-etiquette {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: .8;
}
.bandeau-nom {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bandeau-tour.termine {
  background: var(--vert-700);
  color: var(--or-clair);
  border: 1px solid var(--or);
  box-shadow: none;
}

/* Suivi des scores */
.suivi-scores {
  list-style: none;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.suivi-scores::-webkit-scrollbar { display: none; }
.suivi-scores li {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 6px;
  border-radius: var(--rayon-petit);
  border: 1px solid var(--creme-faible);
  background: rgba(4, 26, 18, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  font-size: 13px;
  text-align: center;
}
.suivi-nom { max-width: 100%; }
.suivi-pts { font-size: 15px; }
.suivi-scores li.actif { border-color: var(--or); background: var(--or-voile); }
.suivi-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--creme-doux); }
.suivi-scores li.actif .suivi-nom { color: var(--or-clair); font-weight: 700; }
.suivi-pts { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Tableau */
.tableau-conteneur {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--rayon);
  border: 1px solid rgba(202, 165, 78, 0.35);
  background: rgba(11, 48, 36, 0.86); /* laisse deviner le filigrane */
  box-shadow: var(--ombre);
}
.tableau {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.tableau col.col-combinaison { width: 128px; }
.tableau col.col-joueur { width: auto; min-width: 54px; }

.tableau th,
.tableau td {
  height: 44px;
  padding: 0;
  border-bottom: 1px solid rgba(244, 239, 227, 0.08);
  border-left: 1px solid rgba(244, 239, 227, 0.08);
  text-align: center;
  vertical-align: middle;
}

/* En-tête (prénoms) collant en haut */
.tableau thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 46px;
  padding: 0 4px;
  background: var(--vert-950);
  color: var(--creme);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid rgba(202, 165, 78, 0.5);
}
.tableau thead th.actif {
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: var(--vert-950);
}

/* Colonne « Combinaison » collante à gauche */
.tableau .cellule-combinaison {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  padding: 0 8px 0 10px;
  background: var(--vert-900);
  border-left: 0;
  border-right: 1px solid rgba(202, 165, 78, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}
.tableau thead .cellule-combinaison {
  z-index: 3;
  background: var(--vert-950);
  color: var(--creme-doux);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.de {
  display: inline-block;
  width: 1.2em;
  margin-right: 4px;
  font-size: 22px;
  line-height: 1;
  vertical-align: -3px;
  color: var(--or-clair);
}

/* Colonne active */
.tableau td.actif { background: rgba(202, 165, 78, 0.07); }

/* Cases jouables */
.case-libre {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 44px;
  border-radius: 0;
  position: relative;
}
.case-libre::after {
  content: "";
  position: absolute;
  inset: 6px 8px;
  border: 1.5px dashed rgba(232, 203, 126, 0.55);
  border-radius: 8px;
}
.case-libre:hover::after,
.case-libre:focus-visible::after { background: var(--or-voile); border-style: solid; }
.case-libre:active::after { background: rgba(202, 165, 78, 0.3); }

.valeur-jouee { font-size: 18px; font-weight: 700; color: var(--creme); }
.valeur-zero { color: var(--creme-doux); }

/* Lignes calculées */
.ligne-calcul td,
.ligne-calcul th { background: rgba(4, 26, 18, 0.55); }
.ligne-calcul .cellule-combinaison {
  background: var(--vert-950);
  color: var(--creme-doux);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ligne-calcul td { color: var(--creme-2); font-weight: 600; }
/* Suivi du bonus (ligne Bonus) */
.bonus-suivi {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  padding: 2px 1px;
}
.bonus-valeur { font-size: 15px; font-weight: 700; }
.bonus-etat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bonus-manque { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bonus-possible { color: var(--creme-2); }
.bonus-possible .bonus-etat { color: var(--creme-doux); font-weight: 600; }
.bonus-obtenu { color: var(--or-clair); }
.bonus-impossible { color: rgba(244, 239, 227, 0.45); }
.bonus-impossible .bonus-etat { color: var(--danger); }

.ligne-total td,
.ligne-total th { height: 52px; border-bottom: 0; border-top: 1px solid var(--or); }
.ligne-total .cellule-combinaison {
  background: var(--vert-950);
  color: var(--or-clair);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.12em;
}
.ligne-total td { color: var(--or-clair); font-size: 20px; font-weight: 800; }

.ligne-separation td,
.ligne-separation th { border-bottom: 1px solid rgba(202, 165, 78, 0.4); }

.barre-fin { display: flex; }
.barre-fin .btn { width: 100%; }

/* =========================================================
   FIN DE PARTIE
   ========================================================= */
.ecran-fin {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.carte-fin { text-align: center; }
.fin-trophee { font-size: 52px; line-height: 1; }
.fin-titre {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--or-clair);
  margin: 10px 0 18px;
}
.fin-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.fin-secondaire { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 14px; }

.fin-record {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border-radius: var(--rayon-petit);
  background: var(--or-voile);
  border: 1px solid var(--or);
  color: var(--or-clair);
  font-weight: 700;
}

/* Classement (fin + fenêtre) */
.classement { list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.classement li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 14px;
  border-radius: var(--rayon-petit);
  background: rgba(4, 26, 18, 0.45);
  border: 1px solid var(--creme-faible);
}
.classement li.premier { border-color: var(--or); background: var(--or-voile); }
.classement-rang { font-family: var(--serif); font-size: 24px; color: var(--or-clair); text-align: center; }
.classement-nom { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classement-exaequo {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--or);
}
.classement-pts { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.classement-pts small { font-size: 13px; font-weight: 600; color: var(--creme-doux); }

/* =========================================================
   HISTORIQUE & RECORDS
   ========================================================= */
.ecran-historique {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.historique-entete { display: flex; align-items: center; gap: 12px; }
.historique-titre {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  color: var(--creme);
}
.carte-record { text-align: center; border-color: var(--or); }
.record-etiquette {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--or);
}
.record-nom {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--creme);
  overflow-wrap: anywhere;
}
.record-score {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--or-clair);
  font-variant-numeric: tabular-nums;
}
.record-score span { font-size: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.record-date { margin-top: 4px; color: var(--creme-doux); }
.record-vide { margin-top: 8px; color: var(--creme-doux); }

.section-titre {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--creme-doux);
  margin-top: 4px;
}
.liste-historique { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.partie-historique {
  padding: 10px 14px;
  border-radius: var(--rayon-petit);
  background: rgba(4, 26, 18, 0.45);
  border: 1px solid var(--creme-faible);
}
.partie-date { font-size: 13px; color: var(--or); font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.partie-joueurs { list-style: none; }
.partie-joueurs li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  font-size: 16px;
  color: var(--creme-doux);
}
.partie-joueurs li.gagnant { color: var(--creme); font-weight: 700; }
.partie-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partie-nom em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--or); }
.partie-pts { font-variant-numeric: tabular-nums; white-space: nowrap; }
.historique-vide { color: var(--creme-doux); text-align: center; padding: 12px 0; }

/* =========================================================
   FENÊTRES MODALES
   ========================================================= */
.modale {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modale-haute { z-index: 60; }
.modale-fond { position: absolute; inset: 0; background: rgba(2, 12, 8, 0.72); }
.modale-boite {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--vert-700), var(--vert-800));
  border: 1px solid rgba(202, 165, 78, 0.5);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 22px 18px max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
.modale-titre {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--or-clair);
  margin-bottom: 14px;
  text-align: center;
}
.modale-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.modale-actions .btn { min-height: 56px; }
.modale-actions-une { grid-template-columns: 1fr; }

/* Saisie : choix du score par boutons */
.saisie-titre {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 10px;
  text-align: center;
}
.saisie-joueur {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--or-clair);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saisie-tiret { color: var(--or); font-size: 20px; }
.saisie-combinaison { font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.saisie-combinaison .de { font-size: 24px; }
.saisie-libelle {
  display: block;
  text-align: center;
  margin: 10px 0 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--creme-doux);
}
.grille-scores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}
.btn-score {
  min-height: 52px;
  border-radius: var(--rayon-petit);
  border: 1.5px solid rgba(232, 203, 126, 0.4);
  background: rgba(4, 26, 18, 0.55);
  color: var(--creme);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.btn-score:hover { border-color: var(--or); }
.btn-score-zero { border-style: dashed; }
.btn-score[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  border: 1.5px solid var(--or-clair);
  border-style: solid;
  color: var(--vert-950);
  box-shadow: 0 0 0 3px var(--or-voile);
}

/* Menu */
.menu-liste { display: flex; flex-direction: column; gap: 10px; }
.menu-note { margin-top: 14px; text-align: center; font-size: 13px; color: var(--creme-doux); }

.confirmation-message { text-align: center; color: var(--creme); }

/* Message bref */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--vert-950);
  border: 1px solid var(--or);
  color: var(--creme);
  font-size: 15px;
  box-shadow: var(--ombre);
  text-align: center;
}

/* =========================================================
   CÉLÉBRATION D'UN YAM'S
   ========================================================= */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.celebration-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.celebration-message {
  position: relative;
  max-width: 100%;
  padding: 18px 26px 16px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 61, 46, 0.94), rgba(4, 26, 18, 0.94));
  border: 1.5px solid var(--or);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(202, 165, 78, 0.12);
  opacity: 0;
}
.celebration.active .celebration-message { animation: yams-message 2.6s ease-out forwards; }
.celebration-titre {
  font-family: var(--serif);
  font-size: clamp(26px, 8vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--or-clair);
  text-shadow: 0 2px 12px rgba(202, 165, 78, 0.35);
  overflow-wrap: anywhere;
}
.celebration-sous-titre {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--creme);
}
@keyframes yams-message {
  0%   { opacity: 0; transform: scale(0.7); }
  12%  { opacity: 1; transform: scale(1.06); }
  20%  { transform: scale(1); }
  78%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .celebration.active .celebration-message { animation: yams-message-sobre 2.6s linear forwards; }
  @keyframes yams-message-sobre { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
}

/* =========================================================
   TABLETTE / ORDINATEUR
   ========================================================= */
@media (min-width: 600px) {
  .ecran-jeu { padding: 16px; gap: 12px; }
  .btn-outil { min-width: 64px; }
  .btn-outil-texte { font-size: 11px; }
  .bandeau-nom { font-size: 28px; }
  .tableau col.col-combinaison { width: 180px; }
  .tableau th, .tableau td { height: 46px; }
  .tableau .cellule-combinaison { font-size: 16px; padding-left: 14px; }
  .tableau thead th { font-size: 16px; }
  .valeur-jouee { font-size: 20px; }
  .suivi-scores li {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 15px;
    padding: 7px 12px;
  }

  .modale { align-items: center; padding: 16px; }
  .modale-boite { border-radius: 20px; border-bottom: 1px solid rgba(202, 165, 78, 0.5); padding-bottom: 22px; }
}

/* Très petits écrans (≤ 360 px) avec 4 joueurs */
@media (max-width: 420px) {
  .tableau thead th { font-size: 13px; padding: 0 2px; }
  .tableau thead .cellule-combinaison { font-size: 11px; letter-spacing: 0.04em; }
  .ligne-calcul .cellule-combinaison { font-size: 12px; letter-spacing: 0.03em; }
}
@media (max-width: 360px) {
  .tableau col.col-combinaison { width: 122px; }
  .tableau .cellule-combinaison { font-size: 14px; padding-left: 7px; padding-right: 3px; }
  .ligne-calcul .cellule-combinaison { font-size: 11px; letter-spacing: 0.02em; }
  .de { font-size: 20px; margin-right: 3px; }
  .tableau thead th { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
