

:root {
  --carte-l: 62px;
  --carte-h: 87px;
  --comb-l: 40px;
  --comb-h: 56px;
  --tapis: #0b3d29;
  --tapis-bord: #14532d;
  --or: #f2c14e;
  --carte-rouge: #c62828;
  --carte-noir: #15171c;
}

@media (max-width: 899px) { :root { --carte-l: 54px; --carte-h: 76px; --comb-l: 36px; --comb-h: 50px; } }
@media (max-width: 600px) { :root { --carte-l: 46px; --carte-h: 64px; --comb-l: 30px; --comb-h: 42px; } }
@media (max-height: 480px) and (orientation: landscape) { :root { --carte-l: 40px; --carte-h: 56px; --comb-l: 28px; --comb-h: 39px; } }

[hidden] { display: none !important; }


body.page-partie #app { max-width: 960px; 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 .jeu-banner,
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; min-width: 0; flex-wrap: wrap; }
.barre-scores b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.score-moi b { color: #6ee7b7; }
.score-autres { color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.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; }
.rouge { color: #ff6b6b; }
.noir { color: #e8edf3; }

.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; flex-wrap: wrap;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(110, 231, 183, 0.08); border: 1px solid rgba(110, 231, 183, 0.22);
  color: #d1fae5; 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; }


.carte {
  position: relative;
  width: var(--carte-l); height: var(--carte-h);
  flex-shrink: 0;
  border-radius: calc(var(--carte-l) * 0.09);
  background: #fdfdfb;
  border: 1px solid rgba(0, 0, 0, 0.28);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.carte[role="button"] { cursor: pointer; transition: transform 0.12s; }
@media (hover: hover) {
  .carte[role="button"]:hover { transform: translateY(-8px); }
}
.carte[role="button"]:focus { outline: none; }
.carte[role="button"]:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; transform: translateY(-8px); }


.carte.joker { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.carte.joker-rouge { color: #c62828; }
.carte.joker-noir { color: #15171c; }
.joker-coin { position: absolute; top: 2px; left: 4px; font-size: calc(var(--carte-l) * 0.2); line-height: 1; }
.joker-etoile { font-size: calc(var(--carte-l) * 0.5); line-height: 1; }
.joker-mot { font-size: calc(var(--carte-l) * 0.15); font-weight: 900; letter-spacing: 0.04em; }

.carte.sauvage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--or); }

.dos {
  width: calc(var(--carte-l) * 0.8); height: calc(var(--carte-h) * 0.8);
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, #065f46 0 4px, #064e3b 4px 8px);
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.dos.mini { display: inline-block; width: 10px; height: 14px; border-width: 1px; border-radius: 2px; vertical-align: -2px; box-shadow: none; }


.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: var(--surface-1);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 16px rgba(0, 0, 0, 0.35);
}
.main-cartes { display: flex; justify-content: center; flex-wrap: nowrap; max-width: 100%; min-height: var(--carte-h); padding-top: 14px; }
.main-cartes .carte { box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3); }
.main-cartes .carte.entre { animation: main-entre 0.3s ease-out backwards; }
@keyframes main-entre { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.main-cartes .carte.choisie { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--or), 0 4px 10px rgba(0, 0, 0, 0.45); }
@media (hover: hover) { .main-cartes .carte.choisie[role="button"]:hover { transform: translateY(-16px); } }
.main-cartes .carte.piochee { box-shadow: 0 0 0 2px #38bdf8, -2px 0 5px rgba(0, 0, 0, 0.3); }
.carte.conseillee { box-shadow: 0 0 0 3px #38bdf8, 0 0 14px rgba(56, 189, 248, 0.7); }
@media (prefers-reduced-motion: reduce) { .main-cartes .carte.entre { animation: none; } }

.main-cartes.plusieurs-rangees { flex-wrap: wrap; }
.main-cartes .saut-rangee { flex-basis: 100%; height: 0; }
.main-cartes .carte.rangee-suite { margin-top: calc(var(--carte-h) * -0.45); }

.zone-actions { width: 100%; max-width: 720px; text-align: center; }
.actions-aide { font-size: 0.82rem; color: var(--texte-doux); line-height: 1.35; margin-bottom: 6px; }
.actions-prepa { color: #fde9b0; font-weight: 700; }
.actions-sel { color: #fde9b0; }
.actions-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.actions-boutons .btn { min-height: 42px; padding: 8px 14px; font-size: 0.88rem; }
.actions-boutons .btn-outil { min-height: 42px; }



.table-canasta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "haut centre" "bas centre";
  gap: 8px;
  width: 100%; margin: 0 auto;
  padding: 10px;
  border-radius: 22px;
  background: radial-gradient(ellipse at center, #11603f 0%, var(--tapis) 80%);
  border: 2px solid var(--tapis-bord);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}
.tc-haut { grid-area: haut; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tc-bas { grid-area: bas; min-width: 0; }
.tc-places { display: flex; justify-content: space-around; gap: 6px; flex-wrap: wrap; }
.tc-place { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.tc-etiquette {
  position: relative; max-width: 100%;
  padding: 3px 10px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center; line-height: 1.25;
}
.tc-nom { display: block; font-size: 0.82rem; font-weight: 700; color: #ecfdf5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.tc-infos { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 0.72rem; color: #a7d7c0; }
.tc-nb-cartes { font-weight: 700; font-variant-numeric: tabular-nums; color: #ecfdf5; }
.tc-actif .tc-etiquette { border-color: var(--or); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.35); }
.tb-badge { display: inline-block; padding: 0 5px; border-radius: 6px; font-size: 0.64rem; font-weight: 800; white-space: nowrap; background: var(--or); color: #1b1503; }
.tb-badge.tb-absent { background: #64748b; color: #fff; }
.tb-badge.tb-partenaire { background: transparent; border: 1px solid #6ee7b7; color: #d1fae5; }
.tb-badge.tb-seul { background: #7c2d12; color: #fff; }
.tc-bulle {
  position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%);
  z-index: 6; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  padding: 3px 9px; border-radius: 10px;
  background: #fdfdfb; color: #15171c; font-size: 0.76rem; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}


.tc-camps-adverses { display: grid; gap: 6px; }
.tc-camps-adverses.plusieurs { grid-template-columns: 1fr 1fr; }
.tc-camp { padding: 6px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.16); border: 1px solid rgba(255, 255, 255, 0.08); min-width: 0; }
.tc-camp-moi { background: rgba(0, 0, 0, 0.22); border-color: rgba(110, 231, 183, 0.3); }
.tc-camp-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 0.74rem; }
.tc-camp-nom { font-weight: 800; color: #ecfdf5; }
.tc-camp-detail { color: #a7d7c0; }
.tc-combs { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; min-height: calc(var(--comb-h) + 14px); }
.tc-vide { font-size: 0.76rem; color: #7fb39a; font-style: italic; align-self: center; margin: 0; }

.tc-combs:has(.tc-vide) { min-height: 0; }
.tc-comb { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 8px; padding: 2px; }
.tc-comb-cartes { display: flex; }
.tc-comb .carte { width: var(--comb-l); height: var(--comb-h); border-radius: calc(var(--comb-l) * 0.1); box-shadow: -1px 0 3px rgba(0, 0, 0, 0.35); }
.tc-comb .carte.sauvage::after { height: 3px; }
.tc-comb .joker-coin { display: none; }
.tc-comb .joker-etoile { font-size: calc(var(--comb-l) * 0.5); }
.tc-comb .joker-mot { font-size: calc(var(--comb-l) * 0.15); }
.tc-comb .carte.nouvelle { animation: comb-pose 0.35s ease-out; }
@keyframes comb-pose { from { opacity: 0; transform: translateY(-10px) scale(0.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tc-comb .carte.nouvelle { animation: none; } }
.tc-comb-info { font-size: 0.66rem; font-weight: 700; color: #d1fae5; white-space: nowrap; font-variant-numeric: tabular-nums; }

.tc-comb.canasta .tc-comb-cartes { position: relative; padding: 0 4px 4px 0; }
.tc-comb.canasta .carte { box-shadow: 2px 2px 0 #fdfdfb, 4px 4px 0 rgba(0, 0, 0, 0.4); }
.tc-comb.canasta.pure .carte { outline: 2px solid #ef4444; outline-offset: -2px; }
.tc-comb.canasta.mixte .carte { outline: 2px solid #111827; outline-offset: -2px; }
.tc-comb.canasta.pure .tc-comb-info { color: #fecaca; }
.tc-comb.canasta.mixte .tc-comb-info { color: #e5e7eb; }

.tc-comb.cible { cursor: pointer; background: rgba(242, 193, 78, 0.12); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.6); }
.tc-comb.cible:hover, .tc-comb.cible:focus-visible { background: rgba(242, 193, 78, 0.24); outline: none; }

.tc-comb.preparee { background: rgba(56, 189, 248, 0.12); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.6); border-radius: 8px; }
.tc-comb.preparee .tc-comb-info::before { content: 'à poser · '; color: #bae6fd; }
.tc-rouges { display: flex; gap: 2px; align-self: center; }
.tc-rouges .carte.mini { width: calc(var(--comb-l) * 0.7); height: calc(var(--comb-h) * 0.7); }
.tc-place .tc-rouges { margin-top: 2px; }


.tc-centre { grid-area: centre; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; padding: 4px 4px; }
.tc-talon, .tc-defausse { display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 10px; padding: 4px 6px; }
.tc-pile { position: relative; width: var(--carte-l); height: var(--carte-h); display: flex; align-items: center; justify-content: center; }
.tc-pile .dos { width: 100%; height: 100%; }
.tc-pile .carte { position: absolute; inset: 0; }
.tc-pile .carte.dessous { transform: rotate(-7deg) translate(-4px, 2px); filter: brightness(0.9); }

.tc-defausse.gelee .tc-pile::before {
  content: ''; position: absolute; left: -10px; right: -10px; top: 38%; height: 26%;
  background: repeating-linear-gradient(90deg, #bae6fd 0 6px, #7dd3fc 6px 12px); border-radius: 4px; opacity: 0.85; z-index: 0;
}
.tc-vide-pile { width: 100%; height: 100%; border: 1.5px dashed rgba(255, 255, 255, 0.25); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #7fb39a; }
.tc-legende { font-size: 0.72rem; font-weight: 700; color: #d1fae5; white-space: nowrap; }
.tc-defausse.gelee .tc-legende { color: #bae6fd; }
.tc-talon.cible, .tc-defausse.cible { cursor: pointer; box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.7); background: rgba(242, 193, 78, 0.1); }
.tc-talon.cible:hover, .tc-defausse.cible:hover, .tc-talon.cible:focus-visible, .tc-defausse.cible:focus-visible { background: rgba(242, 193, 78, 0.22); outline: 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-canasta { padding: 6px; border-radius: 16px; gap: 6px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "haut" "centre" "bas"; }
  .tc-camps-adverses.plusieurs { grid-template-columns: 1fr; }
  .tc-combs { gap: 6px; }
  .tc-centre { flex-direction: row; align-items: flex-end; gap: 18px; }
  .tc-nom { max-width: 110px; font-size: 0.76rem; }
}


.zone-decision {
  max-width: 720px; 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-canasta,
.ecran-jeu[data-phase="termine"] .table-canasta { 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; }


.decompte { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 0.84rem; }
.decompte th, .decompte td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.decompte th:first-child { text-align: left; font-weight: 600; color: var(--texte-doux); }
.decompte thead th { color: var(--texte); font-weight: 700; }
.decompte .moi { color: #6ee7b7; }
.decompte tr.total th, .decompte tr.total td { border-top: 2px solid var(--line-forte); font-weight: 800; color: #f1f5f9; }
.decompte tr.total td.moi, .decompte tr.cumul td.moi { color: #6ee7b7; }
.decompte tr.cumul td { font-weight: 800; }
.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; }
.table-defilante { overflow-x: auto; }


.panneau-pli, .zone-aides {
  max-width: 720px; 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; }
.aides-titre { font-size: 0.76rem; color: var(--texte-faible); margin-bottom: 4px; }
.aides-defausse { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.passage-carte { display: inline-block; min-width: 30px; margin: 1px; padding: 1px 5px; border-radius: 4px; background: #fdfdfb; font-weight: 800; font-size: 0.8rem; }
.passage-carte.rouge { color: var(--carte-rouge); }
.passage-carte.noir { color: var(--carte-noir); }
.passage-carte.joker { color: #b45309; }


.overlay .overlay-box { position: relative; max-width: 560px; 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.6rem; font-weight: 800; font-variant-numeric: tabular-nums; 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: #6ee7b7; font-weight: 700; }
.fin-donnes tr.total td { border-top: 2px solid var(--line-forte); font-weight: 800; }
.panneau-infos .fin-donnes { margin: 0; }
.fin-pourquoi { font-size: 0.92rem; color: var(--texte); line-height: 1.45; margin: 0 0 8px; }
.fin-pourquoi:empty, .fin-decompte:empty { display: none; }
.fin-decompte { margin-top: 12px; }
.fin-decompte-titre { font-size: 0.86rem; font-weight: 700; color: #f1f5f9; margin: 0 0 4px; }
.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 { display: list-item; padding: 4px 8px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.fin-podium li.moi { color: #6ee7b7; 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: 720px; 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 (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; }
}
@media (max-width: 600px) and (orientation: portrait) {
  body.page-partie.en-partie #app { padding-left: 6px; padding-right: 6px; }
}
.colonne-joueur { display: contents; }


@media (max-height: 500px) and (orientation: landscape) {
  body.en-partie { padding: 46px 4px 0; }
  body.en-partie #app { padding: 2px 6px; }
  .ecran-jeu {
    display: grid; gap: 4px 8px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: calc(100dvh - 52px);
  }
  .barre-partie, .bandeau-message { grid-column: 1 / -1; }
  .barre-partie { padding: 3px 8px; }
  .bandeau-message { min-height: 0; padding: 3px 10px; font-size: 0.8rem; }
  .panneau-infos { grid-column: 1; grid-row: 3; }
  .table-canasta { grid-column: 1; grid-row: 4; min-height: 0; overflow-y: auto; padding: 6px; gap: 6px; }
  .colonne-joueur {
    display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
    grid-column: 2; grid-row: 3 / 5; min-height: 0; overflow-y: auto;
  }
  .zone-main { position: static; background: none; box-shadow: none; border-top: 0; padding: 2px 0 max(4px, env(safe-area-inset-bottom)); }
  .actions-aide { font-size: 0.74rem; margin-bottom: 4px; }
  .actions-boutons .btn, .actions-boutons .btn-outil { min-height: 38px; padding: 6px 10px; font-size: 0.8rem; }
  .ecran-jeu > .regles-table { display: none; }
  
  .ecran-jeu[data-phase="fin_manche"] .colonne-joueur,
  .ecran-jeu[data-phase="termine"] .colonne-joueur { grid-column: 1 / -1; justify-content: flex-start; }
}


@media (max-width: 420px) and (max-height: 700px) and (orientation: portrait) {
  :root { --carte-l: 42px; --carte-h: 59px; }
  .zone-main { gap: 3px; padding-top: 4px; }
  .main-cartes { padding-top: 10px; }
  .actions-aide {
    font-size: 0.72rem; line-height: 1.3; margin-bottom: 4px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  }
  .actions-boutons { gap: 4px; }
  .actions-boutons .btn, .actions-boutons .btn-outil { min-height: 38px; padding: 6px 9px; font-size: 0.8rem; }
}


@media (min-width: 601px) and (max-height: 820px) {
  .zone-aides { padding: 6px 10px; }
  .zone-aides .aides-boutons { margin-bottom: 4px; }
  .aides-titre { display: inline; margin-right: 6px; }
  .aides-defausse { display: inline-flex; }
  .zone-main { padding-top: 4px; gap: 4px; }
}
