

:root {
  --carte-l: 76px;
  --tapis: #0d3532;
  --tapis-bord: #1d5c56;
  --or: #f2c14e;
}

@media (max-width: 899px) { :root { --carte-l: 66px; } }
@media (max-width: 600px) { :root { --carte-l: 54px; } }
@media (max-height: 480px) and (orientation: landscape) { :root { --carte-l: 44px; } }

[hidden] { display: none !important; }


body.page-partie #app { max-width: 920px; padding: 16px 16px 12px; }

body.page-partie #app .jeu-banner { margin: -16px -16px 12px; }

.titre-page-jeu { font-size: 1.05rem; font-weight: 700; color: var(--texte-doux); margin: 4px 0 12px; }


body.en-partie .titre-page-jeu,
body.en-partie footer,
body.en-partie .bandeau-infos-wrap,
body.en-partie .bloc-jeux-une-wrap { display: none !important; }

.ecran-jeu { display: flex; flex-direction: column; gap: 8px; }

.barre-partie {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.86rem;
}
.barre-scores { display: flex; align-items: baseline; gap: 10px; font-weight: 700; white-space: nowrap; }
.barre-scores b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.score-moi b { color: var(--or); }
.score-but { color: var(--texte-faible); font-weight: 600; font-size: 0.78rem; }
.barre-contrat { flex: 1; min-width: 0; text-align: center; color: var(--texte); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-outils { display: flex; gap: 6px; }
.btn-outil {
  min-width: 44px; min-height: 36px; padding: 0 10px;
  font: inherit; font-size: 0.8rem; font-weight: 700;
  color: var(--texte); background: transparent; border: 1px solid var(--line-forte); border-radius: 6px; cursor: pointer;
}
.btn-outil:hover { border-color: var(--color-light); }
.btn-outil[aria-expanded="true"] { background: var(--surface-1); border-color: var(--color-light); }

.bandeau-message {
  min-height: 34px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(125, 211, 200, 0.08); border: 1px solid rgba(125, 211, 200, 0.22);
  color: #ccfbf1; font-size: 0.9rem; font-weight: 600; text-align: center;
}
.bandeau-message.erreur { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); color: #fecaca; }
.bandeau-message.a-moi { background: rgba(242, 193, 78, 0.12); border-color: rgba(242, 193, 78, 0.45); color: #fde9b0; }
.bandeau-message .btn { padding: 6px 12px; font-size: 0.8rem; }


.palette-reactions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  padding: 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-forte);
}
.btn-reaction {
  min-height: 40px; padding: 4px 12px;
  font: inherit; font-size: 0.86rem; font-weight: 700; color: var(--texte);
  background: var(--surface-1); border: 1px solid var(--line-forte); border-radius: 20px; cursor: pointer;
}
.btn-reaction:hover { border-color: #38bdf8; }
.btn-reaction:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }


.table-familles {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 12px 10px 14px;
  border-radius: 24px;
  background: radial-gradient(ellipse at center, #155a53 0%, var(--tapis) 78%);
  border: 2px solid var(--tapis-bord);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}
.tf-adversaires { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.tf-adversaires[data-nb="1"] { grid-template-columns: minmax(0, 280px); justify-content: center; }
.tf-place {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 0; padding: 6px 4px 8px;
  border-radius: 14px; border: 2px solid transparent;
}
.tf-etiquette {
  position: relative; max-width: 100%;
  padding: 3px 9px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center; line-height: 1.25;
}
.tf-nom { display: block; font-size: 0.82rem; font-weight: 700; color: #f0fdfa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-infos { display: block; font-size: 0.7rem; color: #a7d8d0; }
.tf-badge { display: inline-block; margin: 1px 2px 0; padding: 0 5px; border-radius: 6px; font-size: 0.66rem; font-weight: 800; white-space: nowrap; }
.tf-badge.tf-absent { background: #64748b; color: #fff; }
.tf-badge.tf-discret { background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: #ccfbf1; }


.tf-main { display: flex; justify-content: center; min-height: 34px; }
.tf-main .sf-dos.tf-dos { --sf-taille: 24px; border-width: 1px; }
.tf-main .sf-dos + .sf-dos { margin-left: -14px; }
.tf-poses { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 0; }
.tf-poses .sf-pastille { width: 20px; height: 20px; }
.tf-poses .sf-pastille svg { width: 13px; height: 13px; }

.tf-actif .tf-etiquette { border-color: var(--or); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.35); }
.tf-choisissable { cursor: pointer; border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); }
.tf-choisissable:hover { border-color: rgba(242, 193, 78, 0.6); }
.tf-choisissable:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.tf-cible { border-color: var(--or); background: rgba(242, 193, 78, 0.14); }


.tf-bulle {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  z-index: 6; white-space: nowrap;
  padding: 3px 9px; border-radius: 10px;
  background: #fffbf2; color: #1f2937; font-size: 0.76rem; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.tf-adversaires .tf-bulle { bottom: auto; top: calc(100% + 2px); }
.tf-bulle.tf-bulle-non { background: #1f2937; color: #fde68a; }
.tf-bulle.tf-bulle-oui { background: #dcfce7; color: #14532d; }
.tf-bulle.tf-bulle-bonne { background: var(--or); color: #1b1503; font-size: 0.86rem; }
.tf-bulle.tf-bulle-famille { background: #fef3c7; color: #78350f; border: 2px solid var(--or); }
.tf-bulle.tf-bulle-reaction { background: #e0f2fe; color: #0c4a6e; border: 2px solid #38bdf8; font-size: 0.84rem; }


.tf-astuce {
  position: absolute; right: 12px; bottom: 4px; margin: 0;
  font-size: 0.68rem; font-weight: 600; color: rgba(204, 251, 241, 0.7);
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.ecran-jeu[data-phase="animation"] .tf-astuce { opacity: 1; }
.ecran-jeu[data-phase="animation"] .table-familles { cursor: pointer; }


.tf-centre { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: calc(var(--carte-l) * 1.4 + 26px); }
.tf-pioche { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tf-tas { position: relative; width: calc(var(--carte-l) * 0.8 + 6px); height: calc(var(--carte-l) * 1.12 + 6px); }
.tf-tas .sf-dos { --sf-taille: calc(var(--carte-l) * 0.8); position: absolute; left: 0; top: 0; }
.tf-tas .sf-dos:nth-child(2) { left: 3px; top: -3px; }
.tf-tas .sf-dos:nth-child(3) { left: 6px; top: -6px; }
.tf-tas.vide { border: 1.5px dashed rgba(255, 255, 255, 0.25); border-radius: 6px; }
.tf-pioche-n { font-size: 0.72rem; font-weight: 700; color: #a7d8d0; white-space: nowrap; }

.tf-action { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 120px; text-align: center; }
.tf-action-titre { font-size: 0.8rem; font-weight: 700; color: #ccfbf1; }
.tf-carte-centre { --sf-taille: calc(var(--carte-l) * 0.95); animation: tf-pose 0.25s ease-out; }
.tf-verdict { font-size: 0.95rem; font-weight: 800; color: #fde68a; }
.tf-action.ok .tf-verdict { color: #86efac; }
.tf-action.non .tf-verdict { color: #fca5a5; }
.tf-action.bonne .tf-verdict { color: var(--or); font-size: 1.1rem; }
.tf-action.bonne .tf-carte-centre { box-shadow: 0 0 0 3px var(--or), 0 0 18px rgba(242, 193, 78, 0.8); }
.tf-famille-posee { display: flex; justify-content: center; }
.tf-famille-posee .sf-carte { --sf-taille: calc(var(--carte-l) * 0.62); animation: tf-pose 0.3s ease-out backwards; }
.tf-famille-posee .sf-carte + .sf-carte { margin-left: calc(var(--carte-l) * -0.3); }
.tf-famille-posee .sf-carte:nth-child(2) { animation-delay: 60ms; }
.tf-famille-posee .sf-carte:nth-child(3) { animation-delay: 120ms; }
.tf-famille-posee .sf-carte:nth-child(4) { animation-delay: 180ms; }
.tf-famille-posee .sf-carte:nth-child(5) { animation-delay: 240ms; }
.tf-famille-posee .sf-carte:nth-child(6) { animation-delay: 300ms; }
.tf-action.famille .tf-action-titre { color: var(--or); font-size: 0.9rem; }
@keyframes tf-pose { from { opacity: 0; transform: translateY(-10px) scale(0.92); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tf-carte-centre, .tf-famille-posee .sf-carte { animation: none; } }

@media (max-width: 600px) {
  .barre-contrat { display: none; }
  .barre-partie { flex-wrap: wrap; row-gap: 4px; padding: 6px 8px; }
  .barre-outils { margin-left: auto; }
  .btn-outil { padding: 0 8px; white-space: nowrap; }
  .table-familles { padding: 8px 6px 10px; border-radius: 18px; gap: 6px; }
  .tf-adversaires { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px; }
  .tf-adversaires[data-nb="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tf-adversaires[data-nb="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-etiquette { padding: 2px 6px; }
  .tf-nom { font-size: 0.74rem; }
  .tf-place { padding: 4px 2px 6px; }
  .tf-centre { gap: 12px; }
}


.zone-decision {
  max-width: 760px; width: 100%; margin: 0 auto;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-forte);
  text-align: center;
}
.ecran-jeu[data-phase="fin_manche"] .table-familles,
.ecran-jeu[data-phase="termine"] .table-familles { display: none; }
.decision-titre { font-size: 0.92rem; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; }
.decision-texte { font-size: 0.82rem; color: var(--texte-doux); margin-bottom: 8px; line-height: 1.4; }
.decision-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.decision-boutons .btn { min-height: 44px; }

.dm-cibles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 12px; }
.dm-cible {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 96px; min-height: 48px; padding: 4px 12px;
  font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--texte);
  background: var(--surface-1); border: 2px solid var(--line-forte); border-radius: 10px; cursor: pointer;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.dm-cible small { font-size: 0.7rem; font-weight: 600; color: var(--texte-faible); }
.dm-cible:hover { border-color: var(--color-light); }
.dm-cible[aria-pressed="true"] { border-color: var(--or); background: rgba(242, 193, 78, 0.16); color: #fff; }
.dm-cible.conseillee { box-shadow: 0 0 0 3px #38bdf8; }
.dm-cible:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }


.dm-familles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 10px; }
.dm-famille {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 4px 10px 4px 6px;
  font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--texte);
  background: var(--surface-1); border: 2px solid var(--line-forte); border-radius: 22px; cursor: pointer;
}
.dm-famille small { font-size: 0.74rem; font-weight: 700; color: var(--texte-faible); }
.dm-famille:hover { border-color: var(--sf-coul, var(--color-light)); }
.dm-famille[aria-pressed="true"] { border-color: var(--or); background: rgba(242, 193, 78, 0.16); color: #fff; }
.dm-famille[aria-pressed="true"] small { color: #fde9b0; }
.dm-famille.conseillee { box-shadow: 0 0 0 3px #38bdf8; }
.dm-famille:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.dm-membres { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dm-carte {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 64px; padding: 4px 4px 6px;
  font: inherit; color: var(--texte);
  background: var(--surface-1); border: 2px solid var(--line-forte); border-radius: 10px; cursor: pointer;
  --carte-l: 50px; transition: transform 0.12s;
}
.dm-carte-nom { font-size: 0.84rem; font-weight: 700; white-space: nowrap; }
.dm-carte:disabled { cursor: not-allowed; opacity: 0.6; }
@media (hover: hover) { .dm-carte:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--or); } }
.dm-carte:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.dm-carte.conseillee { border-color: #38bdf8; box-shadow: 0 0 0 2px #38bdf8, 0 0 14px rgba(56, 189, 248, 0.6); }
.dm-aide { margin: 8px 0 0; }
@media (max-width: 600px) {
  .dm-famille { min-height: 40px; padding: 3px 8px 3px 4px; font-size: 0.82rem; gap: 4px; }
  .dm-carte { min-width: 58px; --carte-l: 34px; padding: 3px 3px 4px; gap: 2px; }
  .dm-carte-nom { font-size: 0.78rem; }
  .dm-cibles { margin-bottom: 8px; }
  .dm-cible { min-height: 44px; min-width: 84px; }
  .dm-familles { margin-bottom: 6px; gap: 4px; }
  .dm-aide { margin-top: 4px; }
}


.zone-rappel {
  max-width: 760px; width: 100%; margin: 0 auto;
  padding: 6px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--texte-doux); text-align: left;
}
.rappel-titre { font-weight: 700; color: var(--texte); margin: 0 0 2px; }
.rappel-liste { list-style: none; margin: 0; padding: 0; line-height: 1.7; }
.rappel-liste li.ok { color: #bbf7d0; }
.rappel-liste li.bonne { color: #fde9b0; }


.decompte { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 0.86rem; }
.decompte th, .decompte td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.decompte th { font-weight: 600; color: var(--texte-doux); }
.decompte thead th { color: var(--texte); }
.decompte td.total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; color: #f1f5f9; }
.decompte thead th:last-child { text-align: right; }
.decompte tr.moi th, .decompte tr.moi td.total { color: var(--or); }
.decompte-pastilles .sf-pastille { width: 20px; height: 20px; margin-right: 2px; }
.decompte-pastilles .sf-pastille svg { width: 13px; height: 13px; }
.decompte-phrase { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.decompte-phrase.bon { color: #86efac; }
.decompte-phrase.mauvais { color: #fca5a5; }
.decompte-note { font-size: 0.78rem; color: var(--texte-doux); margin: 0 0 8px; }


.zone-main {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 6px max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--surface-1) 18%);
}
.zone-moi { position: relative; display: flex; justify-content: center; width: 100%; border-radius: 10px; }
.zone-moi .tf-bulle { bottom: calc(100% + 4px); }
.mes-familles { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 24px; }
.mes-familles-titre { font-size: 0.78rem; font-weight: 700; color: var(--texte-doux); margin-right: 4px; }
.zone-moi.tf-actif .mes-familles-titre { color: var(--or); }
.main-cartes { display: flex; justify-content: center; flex-wrap: nowrap; max-width: 100%; min-height: calc(var(--carte-l) * 1.4); }
.main-cartes .sf-carte { box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3); }
.main-cartes .sf-carte[role="button"] { cursor: pointer; transition: transform 0.12s; }
@media (hover: hover) { .main-cartes .sf-carte[role="button"]:hover { transform: translateY(-8px); } }
.main-cartes .sf-carte[role="button"]:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; transform: translateY(-8px); }
.main-cartes .sf-carte.vue { transform: translateY(-8px); }
.main-cartes .sf-carte.entre { animation: main-entre 0.3s ease-out backwards; }
.main-cartes .sf-carte.arrive { animation: carte-arrive 0.45s ease-out backwards; box-shadow: 0 0 0 3px var(--or), -2px 0 5px rgba(0, 0, 0, 0.3); }
@keyframes main-entre { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes carte-arrive { from { opacity: 0; transform: translateY(-60px) scale(0.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .main-cartes .sf-carte.entre, .main-cartes .sf-carte.arrive { animation: none; } }


@media (orientation: portrait) and (max-width: 1099px) {
  .ecran-jeu { min-height: calc(100dvh - var(--haut-jeu, 180px)); }
  .zone-main { margin-top: auto; }
  
  .dm-membres { scroll-margin-bottom: calc(var(--carte-l) * 1.4 + 70px); }
}
@media (orientation: portrait) and (max-width: 600px), (orientation: portrait) and (max-height: 700px) {
  .ecran-jeu { --haut-jeu: 60px; }
}


.main-cartes.deux-rangees { flex-wrap: wrap; row-gap: 4px; --carte-l: 54px; }
.main-cartes.deux-rangees .saut-rangee { flex-basis: 100%; height: 0; }


.panneau-pli, .zone-aides {
  max-width: 760px; width: 100%; margin: 0 auto;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  text-align: center;
}
.panneau-titre { font-size: 0.86rem; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; }
.aides-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 8px; }
.aides-conseil { font-size: 0.86rem; color: #bae6fd; margin-bottom: 8px; line-height: 1.4; }
.aides-conseil:empty { display: none; }
.memoire { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; text-align: left; }
.memoire-joueur { padding: 6px 8px; border-radius: 8px; background: var(--surface-1); border: 1px solid var(--line); }
.memoire-nom { font-size: 0.84rem; font-weight: 800; color: var(--texte); margin-bottom: 4px; }
.memoire-ligne { font-size: 0.78rem; color: var(--texte-doux); margin: 3px 0; line-height: 1.8; }
.memoire-ligne .sf-pastille { width: 18px; height: 18px; vertical-align: middle; }
.memoire-ligne .sf-pastille svg { width: 12px; height: 12px; }
.memoire-quoi { font-weight: 700; color: var(--texte); }
.memoire-vide { font-style: italic; }
.puce {
  display: inline-block; margin: 0 3px 2px 0; padding: 0 6px; border-radius: 6px;
  font-size: 0.74rem; font-weight: 700; line-height: 1.6; white-space: nowrap;
  border: 1.5px solid var(--sf-coul); color: #fff; background: var(--sf-coul);
}
.puce.non { background: transparent; color: var(--texte-doux); text-decoration: line-through; }
.tombees-legende { font-size: 0.72rem; color: var(--texte-faible); margin-top: 6px; }


.overlay .overlay-box { position: relative; max-width: 520px; width: 100%; max-height: calc(100dvh - 90px); overflow-y: auto; }
.overlay-fermer {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px;
  font-size: 1.5rem; line-height: 1; color: var(--texte-doux);
  background: transparent; border: none; cursor: pointer; border-radius: 6px;
}
.overlay-fermer:hover { color: #fff; background: var(--surface-2); }
.fin-titre { font-family: var(--font-display); font-size: 1.5rem; margin: 6px 40px 10px; }
.fin-titre.victoire { color: #86efac; }
.fin-titre.defaite { color: #fca5a5; }
.fin-score { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.fin-familles { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 8px; }
.fin-resume { display: block; font-size: 0.84rem; color: var(--texte-doux); margin-bottom: 10px; }
.fin-rang { font-size: 0.92rem; font-weight: 700; color: #fde9b0; margin: 8px 0; }
.fin-rang:empty { display: none; }
.fin-lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--color-light); font-weight: 700; font-size: 0.88rem; text-decoration: none; }
.fin-lien:hover { text-decoration: underline; }
.fin-donnes { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 0.8rem; }
.fin-donnes th, .fin-donnes td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.fin-donnes th:first-child, .fin-donnes td:first-child { text-align: left; }
.fin-donnes th { color: var(--texte-doux); font-weight: 600; }
.fin-donnes .moi { color: var(--or); font-weight: 700; }
.fin-donnes tr.total td { border-top: 2px solid var(--line-forte); font-weight: 800; }
.fin-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 0.86rem; font-weight: 700; color: var(--color-light); }
.fin-compte { margin: 10px 0; padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.86rem; }
.fin-compte p { margin-bottom: 8px; }
.overlay-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.fin-podium { list-style: decimal inside; margin: 4px auto 10px; padding: 0; max-width: 320px; text-align: left; }
.fin-podium li { padding: 4px 8px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.fin-podium li.moi { color: var(--or); font-weight: 700; }
.fin-podium-nom { display: inline-block; min-width: 9em; }
.fin-podium-score { float: right; font-variant-numeric: tabular-nums; }
body:has(.overlay.visible) .recomp-toasts { top: auto; bottom: 12px; transform: translateX(-50%); }


.regles-table { max-width: 760px; width: 100%; margin: 6px auto 0; font-size: 0.86rem; color: var(--texte-doux); text-align: left; }
.regles-table summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--color-light); }
.regles-liste { padding-left: 18px; line-height: 1.55; }
.regles-liste li { margin-bottom: 6px; }


@media (min-width: 1100px) and (min-height: 600px) {
  body.page-partie.en-partie #app { max-width: 1220px; }
  .ecran-jeu { display: grid; grid-template-columns: minmax(0, 1fr) 420px; column-gap: 12px; align-items: start; }
  .barre-partie, .bandeau-message, .panneau-infos, .palette-reactions { grid-column: 1 / -1; }
  .regles-table { grid-column: 1; grid-row: 7; }
  .table-familles { grid-column: 1; grid-row: 4; }
  .zone-main { grid-column: 1; grid-row: 5; }
  .zone-rappel { grid-column: 1; grid-row: 6; }
  .zone-decision { grid-column: 2; grid-row: 4 / span 2; max-height: calc(100vh - 170px); overflow-y: auto; }
  .zone-aides { grid-column: 2; grid-row: 6; }
  
  .ecran-jeu[data-phase="fin_manche"] .zone-decision, .ecran-jeu[data-phase="termine"] .zone-decision { grid-column: 1 / -1; grid-row: 4; max-height: none; }
}


@media (max-width: 600px), (max-height: 700px) {
  body.en-partie { padding-top: 50px; }
  body.en-partie #app { padding-top: 8px; }
  body.en-partie .jeu-banner { display: none; }
  .zone-decision { padding: 8px 10px; }
  .decision-titre { font-size: 0.86rem; margin-bottom: 6px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  body.page-partie.en-partie #app { padding-left: 6px; padding-right: 6px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  body.en-partie { padding: 64px 4px 0; }
  body.en-partie #app { padding: 2px 8px; }
  body.page-partie.en-partie #app { max-width: none; }
  .ecran-jeu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 42%); column-gap: 8px; row-gap: 4px; align-items: start; }
  .barre-partie, .bandeau-message, .panneau-infos, .palette-reactions { grid-column: 1 / -1; }
  .barre-partie { padding: 2px 8px; }
  .table-familles { grid-column: 1; grid-row: 3; padding: 4px 6px 6px; gap: 2px; border-radius: 14px; }
  .tf-adversaires, .tf-adversaires[data-nb] { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 2px; }
  .tf-main { display: none; }
  .tf-place { padding: 2px; gap: 2px; }
  .tf-centre { min-height: calc(var(--carte-l) * 1.4 + 18px); gap: 10px; }
  .zone-main { grid-column: 1; grid-row: 4; padding: 2px 0 max(2px, env(safe-area-inset-bottom)); gap: 2px; }
  .zone-decision { grid-column: 2; grid-row: 3 / span 3; max-height: calc(100dvh - 140px); overflow-y: auto; padding: 6px 8px; }
  .zone-rappel, .zone-aides, .regles-table { grid-column: 1 / -1; }
  .bandeau-message { min-height: 26px; padding: 2px 8px; font-size: 0.8rem; }
  .tf-astuce { display: none; }
  
  .overlay { padding-top: 66px; align-items: flex-start; }
  .overlay .overlay-box { display: flex; flex-direction: column; max-height: calc(100dvh - 74px); padding: 10px 14px; }
  .overlay .overlay-box > * { order: 2; }
  .overlay .fin-titre, .overlay .fin-score, .overlay .fin-familles, .overlay .overlay-fermer { order: 0; }
  .overlay .overlay-btns { order: 1; margin-top: 4px; }
  .fin-titre { font-size: 1.2rem; margin: 0 40px 4px; }
  .fin-score { font-size: 1.15rem; }
}
