

body {
  --gm-fond: #141a29; --gm-case: #232c44; --gm-case-bord: #313c5b;
  --gm-moi: #3b61d0; --gm-moi-bord: #7d9cff; --gm-autre: #bf3d36; --gm-autre-bord: #ff8f86;
  --gm-or: #f2b84b; --gm-vert: #5fd3a0; --gm-tuile: #efe6c8; --gm-tuile-bord: #b9ad8c; --gm-encre: #1d2333;
}
#app { max-width: 760px; position: relative; z-index: 1; }
.top-bar h1 { font-size: 1.35rem; }
.top-bar .etiquette { min-width: 60px; text-align: right; font-size: 0.8rem; font-weight: 700; color: var(--color-light); }
[hidden] { display: none !important; }



.reglages { max-width: 560px; margin: 0 auto; text-align: left; }
.reglages h2 { font-family: var(--font-display); font-size: 1.15rem; color: #f0f3f6; text-align: center; margin-bottom: 14px; }
.reglage { margin-bottom: 18px; }
.reglage-titre { display: block; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-doux); margin-bottom: 8px; }
.reglage-aide { font-size: 0.86rem; line-height: 1.5; color: var(--texte-doux); margin-top: 8px; min-height: 1.3em; }

.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix button {
  flex: 1 1 96px;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texte);
  background: var(--surface-2);
  border: 1px solid var(--line-forte);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.choix button:hover { border-color: var(--color-light); }
.choix button[aria-pressed="true"] { background: color-mix(in srgb, var(--color-btn1) 46%, var(--surface-2)); border-color: var(--color-light); color: #fff; }
.choix button:focus-visible, .btn:focus-visible, .fin-fermer:focus-visible, .btn-son:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.bilan { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 0.88rem; line-height: 1.6; text-align: center; color: var(--texte-doux); }
.bilan strong { color: var(--texte); }
.bilan a { color: var(--color-light); }
.action { text-align: center; margin: 6px 0 14px; }
.btn { min-height: 44px; }
.btn-grand { min-height: 50px; padding: 14px 38px; font-size: 1.02rem; }
.btn-discret { background: transparent; border-color: transparent; color: var(--texte-doux); }
.btn-discret:hover:not(:disabled) { color: var(--texte); border-color: var(--line-forte); }
.liens-modes { text-align: center; font-size: 0.88rem; line-height: 2; color: var(--texte-faible); }
.liens-modes a { color: var(--texte-doux); text-decoration: none; }
.liens-modes a:hover { color: var(--color-light); text-decoration: underline; }
.regles-rappel, .aide-pose { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 0.88rem; line-height: 1.6; color: var(--texte); text-align: left; }
.regles-rappel summary, .aide-pose summary { cursor: pointer; font-weight: 700; color: var(--texte-doux); min-height: 28px; }
.regles-rappel p, .aide-pose p { margin-top: 8px; }


.btn-son {
  min-width: 44px; min-height: 44px;
  font: inherit; font-size: 1.05rem;
  color: var(--texte-doux);
  background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.btn-son:hover { border-color: var(--line-forte); }



.info-bar { margin-bottom: 10px; min-height: 46px; }
.info-chrono { font-size: 0.85rem; color: var(--texte-doux); }
.outils-partie { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.outils-partie .btn { padding: 8px 14px; font-size: 0.85rem; }

.btn.a-confirmer { background: color-mix(in srgb, #d2973a 24%, var(--surface-2)); border-color: #d2973a; color: #fff; }


.partie-en-cours { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #d2973a; border-radius: 8px; background: color-mix(in srgb, #d2973a 14%, var(--surface-2)); font-size: 0.9rem; line-height: 1.5; color: var(--texte); }
.partie-en-cours-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }


.minuteur { height: 5px; background: var(--surface-2); border-radius: 3px; margin: 0 auto 10px; overflow: hidden; max-width: 460px; }
.minuteur span { display: block; height: 100%; width: 100%; background: var(--color-light); transform-origin: left; }
.minuteur.urgent span { background: #d07070; }



.gm-plateau { width: min(100%, 540px); margin: 0 auto; }


.gm-scores { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; margin-bottom: 8px; }
.gm-puce {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nom score" "detail score";
  column-gap: 8px; padding: 6px 10px; min-width: 0; text-align: left;
  border: 2px solid var(--line); border-left-width: 7px; border-radius: 10px; background: var(--surface-2);
}
.gm-puce.cote-moi { border-left-color: var(--gm-moi); }
.gm-puce.cote-autre { border-left-color: var(--gm-autre); }
.gm-puce.au-trait { border-top-color: #fff; border-right-color: #fff; border-bottom-color: #fff; }
.gm-puce-nom { grid-area: nom; font-size: 0.86rem; font-weight: 700; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-puce-score { grid-area: score; align-self: center; font-size: 1.6rem; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.gm-puce-detail { grid-area: detail; font-size: 0.7rem; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-puce { position: relative; }

.gm-puce-delta { position: absolute; top: -9px; right: 8px; padding: 1px 7px; border-radius: 9px; font-size: 0.74rem; font-weight: 800; line-height: 1.35; color: #06210f; background: #7fd6a0; }
.gm-puce-delta.moins { color: #2a0705; background: #f0a39c; }
.gm-sac { align-self: center; font-size: 0.76rem; line-height: 1.35; color: var(--texte-doux); text-align: center; max-width: 92px; }

.gm-cadre { position: relative; padding: 5px; background: var(--gm-fond); border: 1px solid var(--line-forte); border-radius: 10px; }
.gm-grille { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 2px; user-select: none; touch-action: manipulation; container-type: inline-size; }
.gm-case {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; min-width: 0; padding: 0; margin: 0;
  border: 1px solid var(--gm-case-bord); border-radius: 4px;
  background: var(--gm-case); color: #fff;
  font: 800 clamp(0.78rem, 3.7vw, 1.3rem)/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
@supports (font-size: 1cqw) { .gm-case { font-size: 5.2cqw; } }
.gm-actif .gm-case:not(.mur):not(.lettre) { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .gm-actif .gm-case:not(.mur):not(.lettre):not(.pose):hover { background: color-mix(in srgb, var(--gm-case) 80%, #fff); }
}
.gm-case:focus-visible { outline: 2px solid #fff; outline-offset: 1px; z-index: 2; }


.gm-case.mur { background: repeating-linear-gradient(45deg, #0c1018, #0c1018 4px, #171d2b 4px, #171d2b 8px); border-color: #0c1018; }
.gm-case.etoile:not(.pose)::before { content: '\2605'; color: var(--gm-or); opacity: 0.7; font-size: 0.95em; }
.gm-case.rempart:not(.pose)::before {
  content: ''; width: 46%; height: 52%; background: var(--gm-vert); opacity: 0.6;
  clip-path: polygon(50% 0, 100% 16%, 100% 55%, 50% 100%, 0 55%, 0 16%);
}
.gm-case.centre::before { content: '\25C6'; color: var(--color-light); opacity: 0.8; font-size: 0.8em; }


.gm-case.lettre.a-moi { background: var(--gm-moi); border-color: var(--gm-moi-bord); }
.gm-case.lettre.a-autre { background: var(--gm-autre); border-color: var(--gm-autre-bord); }
.gm-case.lettre.sur-rempart { box-shadow: inset 0 0 0 2px var(--gm-vert); }
.gm-case.lettre.sur-rempart::after {
  content: ''; position: absolute; top: 2px; right: 2px; width: 22%; height: 25%; background: var(--gm-vert);
  clip-path: polygon(50% 0, 100% 16%, 100% 55%, 50% 100%, 0 55%, 0 16%);
}
.gm-case.dernier { box-shadow: inset 0 0 0 2px #fff; }
.gm-case.lettre.sur-rempart.dernier { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--gm-vert); }

.gm-case.lettre.a-autre { clip-path: polygon(0 22%, 22% 0, 100% 0, 100% 100%, 0 100%); }

.gm-case.lettre.sur-etoile::before { content: '\2605'; position: absolute; bottom: 0; right: 2px; font-size: 0.48em; color: var(--gm-or); }

.gm-case.lettre.perdue { box-shadow: inset 0 0 0 3px var(--gm-or); }

.gm-case.pose.derniere-pose::before { content: '\00D7'; position: absolute; top: -1px; left: 2px; font-size: 0.55em; font-weight: 800; color: #8a2a1e; }


.gm-case.pose { background: var(--gm-tuile); border-color: var(--gm-or); color: var(--gm-encre); box-shadow: 0 0 0 2px var(--gm-or); cursor: pointer; touch-action: none; z-index: 1; }
.gm-case.pose.etoile::after { content: '\2605'; position: absolute; top: 0; right: 2px; font-size: 0.5em; color: #b07a10; }
.gm-case.pose.rempart::after {
  content: ''; position: absolute; top: 2px; right: 2px; width: 22%; height: 25%; background: #1f9a68;
  clip-path: polygon(50% 0, 100% 16%, 100% 55%, 50% 100%, 0 55%, 0 16%);
}

.gm-case.curseur { outline: 2px solid #fff; outline-offset: -2px; }
.gm-case.curseur::after {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.2); color: #fff; font-size: 0.9em; border-radius: 3px;
}
.gm-case.curseur.sens-h::after { content: '\2192'; }
.gm-case.curseur.sens-v::after { content: '\2193'; }

.gm-case.lettre.apercu-mot { filter: brightness(1.25); }
.gm-case.apercu-prise { box-shadow: inset 0 0 0 3px var(--gm-or); }


.gm-case.a-venir { opacity: 0.12; }
.gm-case.vient { animation: gm-vient 0.18s ease-out; }
.gm-case.prise { animation: gm-prise 0.5s ease-out; }
.gm-cadre.refus { animation: gm-refus 0.28s ease-in-out; }
@keyframes gm-vient { from { transform: scale(1.3); } to { transform: scale(1); } }
@keyframes gm-prise { 0% { background: var(--gm-or); transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes gm-refus { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .gm-case.vient, .gm-case.prise, .gm-cadre.refus { animation: none; } }

.gm-attente {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; padding: 12px;
  font-size: 0.95rem; font-weight: 700; color: #f0f3f6; text-align: center;
  background: rgba(8, 10, 14, 0.78);
  border-radius: 10px;
}


.gm-annonce {
  position: absolute; left: 50%; top: 12%; transform: translate(-50%, -50%); z-index: 4;
  padding: 10px 20px; border-radius: 12px; white-space: nowrap; pointer-events: none;
  font: 800 clamp(1.1rem, 5vw, 1.9rem)/1.1 var(--font-display, system-ui), system-ui, sans-serif;
  color: #1d2333; background: var(--gm-or); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.gm-annonce.montre { animation: gm-annonce 1.5s ease-out forwards; }
@keyframes gm-annonce { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }



.gm-riviere { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; max-width: 460px; margin: 10px auto 4px; }
.gm-tuile {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; min-width: 0; padding: 0; margin: 0;
  border: 1px solid var(--gm-tuile-bord); border-radius: 8px;
  background: var(--gm-tuile); color: var(--gm-encre);
  font: 800 clamp(1rem, 5.4vw, 1.7rem)/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
  cursor: pointer; touch-action: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.gm-tuile.rare { box-shadow: inset 0 0 0 3px var(--gm-or); }
.gm-tuile.choisie { outline: 3px solid #fff; outline-offset: 1px; transform: translateY(-4px); }
.gm-tuile.utilisee { opacity: 0.22; }
.gm-tuile.vide { background: transparent; border: 1px dashed var(--line-forte); cursor: default; }
.gm-tuile:disabled { cursor: default; filter: saturate(0.5) brightness(0.82); }
.gm-tuile:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.gm-fantome {
  position: fixed; left: 0; top: 0; z-index: 3000; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gm-tuile-bord); border-radius: 8px; background: var(--gm-tuile); color: var(--gm-encre);
  font: 800 1.5rem/1 system-ui, sans-serif; pointer-events: none; opacity: 0.92;
}
body.gm-glisse { user-select: none; cursor: grabbing; }


.message-coup { min-height: 2.7em; margin: 6px 0; font-size: 0.92rem; line-height: 1.35; color: var(--texte); text-align: center; }
.message-coup.erreur { color: #f0a8a0; }
.message-guide { color: var(--texte-doux); }
.mot-def { color: inherit; font-weight: 700; text-decoration: underline dotted; text-underline-offset: 3px; }
.mot-def:hover { color: var(--color-light); }
.lien-revoir { padding: 0 4px; font: inherit; font-size: 0.85em; color: var(--color-light); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.actions-coup { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.actions-coup .btn-primary { flex: 1 1 200px; max-width: 320px; min-height: 48px; }
.aide-pose { font-size: 0.82rem; margin-top: 6px; }


.historique { margin: 0 0 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 0.85rem; line-height: 1.55; text-align: left; }
.historique summary { cursor: pointer; font-weight: 700; color: var(--texte-doux); min-height: 28px; }
.historique ol { margin: 6px 0 2px; padding-left: 2.2em; max-height: 220px; overflow-y: auto; }
.historique .coup-moi .coup-qui { color: var(--gm-moi-bord); }
.historique .coup-autre .coup-qui { color: var(--gm-autre-bord); }
.coup-gain { color: var(--texte-doux); }


.fin-stats { margin: 12px 0; }
.stats-partie { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.stats-partie th, .stats-partie td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.stats-partie tr th:first-child { text-align: left; font-weight: 400; color: var(--texte-doux); }


.defi-ami-direct { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--color-light); border-radius: 10px; background: color-mix(in srgb, var(--color-btn1) 14%, var(--surface-2)); }
.defi-ami-direct-texte { font-size: 0.9rem; line-height: 1.45; margin-bottom: 10px; }
.defi-ami-direct-nom { display: block; font-size: 0.82rem; color: var(--texte-doux); margin-bottom: 10px; }
.defi-ami-direct-nom input { display: block; width: 100%; max-width: 260px; min-height: 44px; margin: 6px auto 0; padding: 8px 12px; font: inherit; font-weight: 700; color: var(--texte); background: var(--surface-0); border: 1px solid var(--line-forte); border-radius: 8px; }
.defi-ami-direct-msg { min-height: 1.2em; margin-top: 8px; font-size: 0.82rem; color: var(--texte-doux); overflow-wrap: anywhere; }
.legende-etoile { color: var(--gm-or); }
.legende-rempart { display: inline-block; width: 0.75em; height: 0.85em; vertical-align: -0.1em; background: var(--gm-vert); clip-path: polygon(50% 0, 100% 16%, 100% 55%, 50% 100%, 0 55%, 0 16%); }



.fin-partie {
  position: relative;
  max-width: 480px;
  margin: 14px auto 4px;
  padding: 20px 18px 16px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line-forte);
  border-radius: 12px;
}
.fin-partie h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 6px; padding: 0 34px; }
.win-text { color: #64ab7c; }
.lose-text { color: #d07070; }
.draw-text { color: #d2973a; }
.fin-fermer {
  position: absolute; top: 6px; right: 6px;
  width: 44px; height: 44px;
  font-size: 1.4rem; line-height: 1;
  color: var(--texte-doux);
  background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer;
}
.fin-fermer:hover { color: var(--texte); border-color: var(--line-forte); }
.fin-message { color: var(--texte); font-size: 0.93rem; line-height: 1.5; margin-bottom: 8px; }
.fin-statut { font-size: 0.86rem; line-height: 1.5; color: var(--texte-doux); margin-bottom: 12px; min-height: 1.3em; }
.fin-statut.ok { color: #8cc7a0; }
.fin-statut.alerte { color: #e0a0a0; }
.fin-statut a, .fin-liens a { color: var(--color-light); }
.fin-boutons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.fin-boutons .btn { min-height: 46px; }
.fin-liens { margin: 10px 0 14px; font-size: 0.86rem; line-height: 1.9; }
.fin-liens:empty { margin: 0 0 12px; }
.cta-score-msg { color: var(--texte); font-size: 0.88rem; margin-bottom: 10px; }
.cta-auth-btns { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.partage-score { margin-bottom: 12px; }

.barre-fin { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.barre-fin .resume { width: 100%; font-weight: 700; color: #f0f3f6; text-align: center; }

.confetti { position: fixed; top: -10px; z-index: 200; pointer-events: none; font-size: 1.2rem; animation: gm-confetti 3s ease-in forwards; }
@keyframes gm-confetti { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }



.lobby-msg { color: var(--texte-doux); margin: 4px 0 14px; font-size: 0.95rem; min-height: 1.4em; text-align: center; }
.salon-bloc { max-width: 480px; margin: 0 auto 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; }
.salon-titre { font-family: var(--font-display); font-size: 1.1rem; color: #f0f3f6; margin-bottom: 12px; }
.salon-code { display: flex; gap: 10px; flex-wrap: wrap; }
.salon-code input, .salon-pseudo input {
  flex: 1 1 130px; min-width: 0; min-height: 48px; padding: 8px 12px;
  font: inherit; font-weight: 700;
  color: var(--texte); background: var(--surface-0); border: 1px solid var(--line-forte); border-radius: 8px;
}
.salon-code input { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.3em; text-align: center; text-transform: uppercase; }
.salon-pseudo input { width: 100%; font-size: 1rem; }
.salon-code input:focus, .salon-pseudo input:focus { outline: 2px solid var(--color-light); outline-offset: 1px; }
.salon-code .btn { flex: 1 1 110px; min-height: 48px; }
.salon-bloc .reglage { margin-bottom: 14px; }
.salon-bloc .choix button { flex-basis: 84px; }
.salon-bloc .btn-creer { width: 100%; min-height: 48px; }
.salon-attente { max-width: 480px; margin: 0 auto 16px; text-align: center; }
.code-affiche { font-size: 2.4rem; font-weight: 800; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--color-light); margin: 8px 0 6px; }
.salon-explication { font-size: 0.9rem; line-height: 1.6; color: var(--texte-doux); margin: 8px auto 14px; }
.salon-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.partie-publique { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.partie-publique:last-child { border-bottom: 0; }
.partie-publique .qui { font-weight: 700; overflow-wrap: anywhere; }
.partie-publique .quoi { display: block; font-size: 0.8rem; font-weight: 400; color: var(--texte-doux); }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-forte); border-top-color: var(--color-light); border-radius: 50%; animation: gm-tourne 0.8s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes gm-tourne { to { transform: rotate(360deg); } }

.score-manches { font-weight: 800; color: #f0f3f6; font-size: 0.95rem; text-align: center; margin-bottom: 8px; }
.bandeau-alerte { background: color-mix(in srgb, #d2973a 16%, var(--surface-2)); border: 1px solid #d2973a; color: #f0d9b0; border-radius: 8px; padding: 9px 12px; font-size: 0.88rem; line-height: 1.45; margin-bottom: 10px; }

.compte-a-rebours { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; background: rgba(6, 8, 11, 0.82); }
.compte-a-rebours span { font-family: var(--font-display); font-size: 6rem; font-weight: 700; color: var(--color-light); }



.page-defi #app { max-width: 800px; }
#entree-defi { text-align: center; }
#entree-defi h1 { font-size: 1.45rem; margin-bottom: 6px; }
.defi-date { color: var(--texte-doux); font-size: 0.92rem; margin-bottom: 12px; }
.btn-lancer { margin: 8px auto 6px; }
.etat-defi { min-height: 1.2em; color: var(--texte-doux); font-size: 0.92rem; margin: 6px 0 10px; }
.defi-avertissement { font-size: 0.8rem; color: var(--texte-faible); margin-bottom: 18px; }
.classement-titre { font-family: var(--font-display); font-size: 1.1rem; color: #f0f3f6; text-align: center; margin-bottom: 10px; }
.lb-echec { color: #d07070; font-weight: 800; }
.lb-ecart { color: var(--texte-faible); font-size: 0.85em; font-weight: 400; }
.titre-jeu-defi { font-family: var(--font-display); font-size: 1.15rem; color: #f0f3f6; }
.defi-compte { margin: 14px auto 18px; padding: 16px; max-width: 520px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 0.92rem; line-height: 1.55; }
.defi-compte-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.defi-btn-inscription, .defi-btn-connexion { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border-radius: 6px; font-weight: 700; text-decoration: none; }
.defi-btn-inscription { background: var(--color-btn1); color: #fff; }
.defi-btn-connexion { border: 1px solid var(--line-forte); color: var(--texte); }
.objectif-du-jour { font-size: 1.02rem; color: var(--texte); margin: 0 0 14px; }
.objectif-du-jour strong { color: #fff; }
.defi-prochain { font-size: 0.88rem; color: var(--texte-doux); margin: 4px 0 12px; }
.defi-semaine { max-width: 480px; margin: 6px auto 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.defi-serie { font-size: 0.9rem; color: var(--texte-doux); margin-bottom: 10px; }
.defi-serie strong { color: var(--texte); }
.semaine-jours { display: flex; gap: 6px; justify-content: center; list-style: none; margin: 0 0 8px; padding: 0; }
.semaine-jours li { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.8rem; font-weight: 800; border: 2px solid var(--line-forte); color: var(--texte-faible); }
.semaine-jours .jour-gagne { background: #39b36a; border-color: #39b36a; color: #fff; }
.semaine-jours .jour-perdu { border-color: #d07070; color: #d07070; }
.semaine-jours .jour-manque { border-style: dashed; }
.semaine-jours .jour-aujourdhui { border-color: var(--color-light); color: var(--texte); }
.defi-semaine-aide { font-size: 0.78rem; line-height: 1.45; color: var(--texte-faible); }

.defi-revue { max-width: 480px; margin: 6px auto 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: center; }
.defi-revue summary { cursor: pointer; font-weight: 700; min-height: 28px; margin-bottom: 10px; }
.defi-revue-aide { font-size: 0.8rem; color: var(--texte-faible); margin-top: 8px; }
.plateau-fige { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 1px; max-width: 330px; margin: 0 auto 10px; padding: 3px; background: var(--gm-fond); border-radius: 6px; }
.pf-case { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 2px; background: var(--gm-case); color: #fff; font: 800 0.72rem/1 system-ui, sans-serif; }
.pf-case.mur { background: #0c1018; }
.pf-case.etoile::before { content: '\2605'; color: var(--gm-or); opacity: 0.7; font-size: 0.8em; }
.pf-case.rempart { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gm-vert) 55%, transparent); }
.pf-case.a-moi { background: var(--gm-moi); }
.pf-case.a-autre { background: var(--gm-autre); clip-path: polygon(0 22%, 22% 0, 100% 0, 100% 100%, 0 100%); }
.pf-case.sur-rempart { box-shadow: inset 0 0 0 2px var(--gm-vert); }
.pf-case.sur-etoile { color: #ffe6a8; }
.revue-tours { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: left; }
.revue-tours th, .revue-tours td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.revue-tours .tour-parfait td:first-of-type { color: #8cc7a0; font-weight: 700; }

.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; }



.tuto-consigne { margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--color-light); border-radius: 10px; background: color-mix(in srgb, var(--color-btn1) 14%, var(--surface-2)); font-size: 0.93rem; line-height: 1.5; text-align: left; }
@media (max-width: 979px) {
  body.page-tutoriel.gm-blocs-caches .tuto-consigne { order: 1; font-size: 0.84rem; padding: 8px 10px; margin-bottom: 6px; }
}



.page-ami h1 { font-size: 1.4rem; text-align: center; margin-bottom: 10px; }

body.ami-en-jeu #ami-intro, body.ami-en-jeu #ami-resultats-bloc, body.ami-en-jeu #ami-suivi, body.ami-en-jeu .page-ami-titre { display: none; }




#lobby-status.mode-invitation > .salon-bloc:not(.salon-pseudo):not(.salon-invitation),
#lobby-status.mode-invitation > .bilan { display: none; }
.salon-invitation-action { text-align: center; margin: 0 auto 18px; }




@media (max-height: 900px) {
  body.gm-en-jeu .jeu-banner { display: none; }
}


body.gm-blocs-caches .bandeau-infos-wrap, body.gm-blocs-caches .bloc-jeux-une-wrap { display: none !important; }
@media (max-width: 1699px) {
  body.gm-en-jeu .bandeau-infos-wrap, body.gm-en-jeu .bloc-jeux-une-wrap { display: none !important; }
}



@media (min-width: 980px) and (min-height: 521px) {
  body.gm-en-jeu #app { max-width: 1180px; }
  body.gm-en-jeu .zone-jeu { display: grid; grid-template-columns: minmax(0, 680px) minmax(280px, 1fr); grid-auto-rows: min-content; gap: 0 28px; align-items: start; }
  body.gm-en-jeu .colonne-plateau { display: contents; }
  body.gm-en-jeu .gm-plateau { grid-column: 1; grid-row: 1 / span 9; width: min(100%, 680px, calc(100svh - 218px)); min-width: 400px; margin: 0 auto; }
  
  body.gm-en-jeu .colonne-infos { grid-column: 2; grid-row: 1; padding-top: 44px; }
  body.gm-en-jeu .message-coup { grid-column: 2; grid-row: 2; text-align: left; min-height: 4.1em; margin: 2px 0 8px; }
  body.gm-en-jeu .actions-coup { grid-column: 2; grid-row: 3; justify-content: flex-start; }
  body.gm-en-jeu .barre-fin { grid-column: 2; grid-row: 4; justify-content: flex-start; }
  body.gm-en-jeu .colonne-fin { grid-column: 2; grid-row: 5; }
  body.gm-en-jeu .historique { grid-column: 2; grid-row: 6; }
  body.gm-en-jeu .aide-pose { grid-column: 2; grid-row: 7; }
  body.gm-en-jeu .outils-partie { justify-content: flex-start; }
  body.gm-en-jeu .fin-partie { margin: 4px 0 12px; max-width: none; }
  body.gm-en-jeu .top-bar h1 { font-size: 1.15rem; }
  body.gm-en-jeu .back-link { white-space: nowrap; }
  body.gm-en-jeu .gm-puce-score { font-size: 1.9rem; }
}


@media (max-width: 979px), (max-height: 520px) {
  body.gm-blocs-caches .auth-nav { display: none !important; }
}


@media (max-width: 560px) {
  .top-bar h1 { font-size: 1.1rem; }
  .compte-a-rebours span { font-size: 4.5rem; }
  .code-affiche { font-size: 2rem; }
  body.gm-en-jeu .jeu-banner { display: none; }
  .gm-plateau { width: calc(100vw - 8px); margin-left: calc((100% - (100vw - 8px)) / 2); }
  .gm-cadre { padding: 3px; border-radius: 8px; }
  .gm-grille { gap: 1px; }
  .gm-case { border-radius: 3px; }
  .gm-riviere { gap: 4px; max-width: none; padding: 0 2px; }
  .gm-puce { padding: 5px 7px; border-left-width: 5px; }
  .gm-puce-score { font-size: 1.35rem; }
  .gm-sac { font-size: 0.7rem; max-width: 70px; }
  .info-bar { min-height: 0; margin-bottom: 6px; }
  .message-coup { min-height: 2.5em; font-size: 0.86rem; padding: 0 4px; margin: 4px 0; }
  .gm-riviere { margin: 6px auto 2px; }
  .gm-scores { margin-bottom: 5px; }
  body.gm-blocs-caches { padding-top: 4px; }
  body.gm-blocs-caches #app { padding-top: 6px; }
  body.gm-blocs-caches .actions-coup { gap: 6px; }
  body.gm-blocs-caches .actions-coup .btn { padding: 8px 10px; font-size: 0.85rem; }
  body.gm-blocs-caches .actions-coup .btn-primary { flex: 1 1 100%; max-width: none; min-height: 46px; font-size: 1rem; }
  .gm-annonce { font-size: 1.05rem; padding: 7px 14px; }
}


@media (max-width: 979px) and (min-height: 521px) {
  body.gm-en-jeu .jeu-banner { display: none; }
  body.gm-blocs-caches .zone-jeu { display: flex; flex-direction: column; }
  body.gm-blocs-caches .colonne-infos, body.gm-blocs-caches .colonne-plateau,
  body.gm-blocs-caches #infos-partie, body.gm-blocs-caches #vue-jeu { display: contents; }
  body.gm-blocs-caches .top-bar, body.gm-blocs-caches .corr-entete, body.gm-blocs-caches .corr-joueurs { display: none; }
  body.gm-blocs-caches .score-manches { order: 0; margin-bottom: 4px; font-size: 0.85rem; }
  body.gm-blocs-caches .info-bar { order: 1; }
  body.gm-blocs-caches .corr-etat, body.gm-blocs-caches .corr-info-nulle { order: 1; }
  body.gm-blocs-caches .minuteur { order: 2; margin-bottom: 6px; }
  body.gm-blocs-caches .bandeau-alerte { order: 2; }
  body.gm-blocs-caches .gm-plateau { order: 3; }
  body.gm-blocs-caches .message-coup { order: 4; }
  body.gm-blocs-caches .actions-coup { order: 5; }
  body.gm-blocs-caches .outils-partie, body.gm-blocs-caches .corr-actions { order: 6; }
  body.gm-blocs-caches .historique { order: 7; }
  body.gm-blocs-caches .aide-pose { order: 8; }
  body.gm-blocs-caches .colonne-fin { order: 9; }
}


@media (max-width: 380px) {
  .salon-code input, .salon-code .btn { flex-basis: 100%; }
  .gm-puce-detail { display: none; }
}



@media (orientation: landscape) and (max-height: 520px) {
  body.gm-en-jeu { padding: 4px; padding-top: 4px; }
  body.gm-en-jeu .jeu-banner, body.gm-en-jeu footer { display: none; }
  body.gm-en-jeu #app { max-width: none; padding: 4px 8px; }
  body.gm-en-jeu .zone-jeu { display: grid; grid-template-columns: calc(100svh - 16px) minmax(0, 1fr); grid-auto-rows: min-content; gap: 0 12px; align-items: start; }
  body.gm-en-jeu .colonne-plateau, body.gm-en-jeu .colonne-infos, body.gm-en-jeu #infos-partie, body.gm-en-jeu #vue-jeu, body.gm-en-jeu .gm-plateau { display: contents; }
  body.gm-en-jeu .gm-cadre { grid-column: 1; grid-row: 1 / span 12; }
  body.gm-en-jeu .zone-jeu > *, body.gm-en-jeu .colonne-infos > *, body.gm-en-jeu .colonne-plateau > *, body.gm-en-jeu #infos-partie > *, body.gm-en-jeu #vue-jeu > *,
  body.gm-en-jeu .gm-scores, body.gm-en-jeu .gm-riviere { grid-column: 2; }
  body.gm-en-jeu .gm-cadre { grid-column: 1; }
  body.gm-blocs-caches .top-bar, body.gm-blocs-caches .corr-entete, body.gm-blocs-caches .corr-joueurs { display: none; }
  body.gm-en-jeu .info-bar { min-height: 0; margin-bottom: 4px; }
  body.gm-en-jeu .gm-scores { margin-bottom: 6px; }
  body.gm-en-jeu .gm-riviere { margin: 0 0 4px; max-width: none; gap: 4px; }
  body.gm-en-jeu .gm-tuile { font-size: clamp(0.9rem, 3.2vw, 1.5rem); }
  body.gm-en-jeu .gm-puce-detail { display: none; }
  body.gm-en-jeu .message-coup { min-height: 2.5em; margin: 2px 0; font-size: 0.84rem; text-align: left; }
  body.gm-en-jeu .actions-coup { gap: 6px; justify-content: flex-start; margin-bottom: 4px; }
  body.gm-en-jeu .actions-coup .btn { padding: 6px 10px; font-size: 0.82rem; min-height: 40px; }
  body.gm-en-jeu .actions-coup .btn-primary { flex: 1 1 100%; max-width: none; min-height: 42px; }
  body.gm-en-jeu .outils-partie { justify-content: flex-start; margin: 0; }
  body.gm-en-jeu .outils-partie .btn { min-height: 36px; padding: 4px 10px; }
  body.gm-en-jeu .fin-partie { margin: 8px 0 0; padding: 14px 12px 12px; }
  body.gm-en-jeu .fin-partie h2 { font-size: 1.2rem; }
}


html:root {
  --entete-reseau: 0px;
}
html .net-entete {
  display: none;
}

html .net-entete + .auth-nav {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--surface-1);
  border-color: var(--line-forte);
}
html .net-entete + .auth-nav::before {
  background: var(--surface-1);
  border-color: var(--line-forte);
}


@media (max-width: 768px) {
  html .net-entete + .auth-nav:not(.no-collapse) .auth-nav-toggle {
    display: inline-flex;
  }
}
