/*
 * Morpion : pages de jeu (ordinateur, à deux, entraînement, duel, défi du jour,
 * morpion infini). Le socle (police, #app, boutons, barre du haut, encart de
 * classement) vient de jeu.css partagé, chargé avant. Ici : l'écran de
 * réglages, le salon, la grille, le panneau de fin.
 *
 * La grille est dimensionnée par la LARGEUR et par la HAUTEUR disponibles :
 * --mo-reserve est la hauteur occupée au-dessus et au-dessous d'elle. Sur un
 * téléphone tenu à l'horizontale, elle passe à gauche sur toute la hauteur.
 */

body { --mo-croix: #818cf8; --mo-rond: #f472b6; --mo-reserve: 330px; }
#app { max-width: 720px; }
.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; }

/* ============================== RÉGLAGES ============================== */

.reglages { max-width: 540px; 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 { 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; }
.regle-courte { font-size: 0.92rem; line-height: 1.6; color: var(--texte); margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }

.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix button {
  flex: 1 1 110px;
  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) 34%, var(--surface-2)); border-color: var(--color-light); color: #fff; }
.choix button:focus-visible, .btn:focus-visible, .mo-case:focus-visible, .fin-fermer:focus-visible, .btn-son:focus-visible { outline: 2px solid var(--color-light); 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; }

/* Réglage du son : hors du tableau de bord de la partie, visible avant de jouer. */
.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); }

/* ============================== EN PARTIE ============================== */

.info-bar { margin-bottom: 10px; min-height: 46px; }
.pastille { flex: none; width: 16px; height: 16px; position: relative; }
.pastille-1::before, .pastille-1::after { content: ''; position: absolute; left: 0; top: 50%; width: 16px; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--mo-croix); transform: rotate(45deg); }
.pastille-1::after { transform: rotate(-45deg); }
.pastille-2::before { content: ''; position: absolute; inset: 1px; border: 3px solid var(--mo-rond); border-radius: 50%; }
.tour-1 { color: var(--mo-croix); }
.tour-2 { color: var(--mo-rond); }
.info-serie { color: var(--texte-doux); font-size: 0.82rem; }
.info-serie strong { color: var(--texte); }
.hint { font-size: 0.84rem; line-height: 1.45; color: var(--texte-doux); margin: 10px 0 4px; min-height: 1.3em; }

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

/* ---------- La grille ---------- */

.mo-plateau {
  width: min(100%, 420px, calc(100vh - var(--mo-reserve)));
  width: min(100%, 420px, calc(100svh - var(--mo-reserve)));
  min-width: 228px;
  margin: 0 auto;
  position: relative;
}
.mo-grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--surface-0);
  border: 1px solid var(--line-forte);
  border-radius: 14px;
  aspect-ratio: 1;
  touch-action: manipulation;
}
.mo-case {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.mo-grille.actif .mo-case.libre { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .mo-grille.actif .mo-case.libre:hover { border-color: var(--color-light); background: color-mix(in srgb, var(--color-btn1) 14%, var(--surface-2)); }
}
.mo-case svg { position: absolute; inset: 16%; width: 68%; height: 68%; overflow: visible; }
.mo-case .trait { fill: none; stroke-width: 11; stroke-linecap: round; }
.mo-case.c1 .trait { stroke: var(--mo-croix); }
.mo-case.c2 .trait { stroke: var(--mo-rond); }
.mo-case.pose svg { animation: mo-pose 0.22s ease-out; }
.mo-case.dernier { border-color: var(--line-forte); box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 22%, transparent); }
.mo-case.gagnante { background: color-mix(in srgb, #64ab7c 26%, var(--surface-2)); border-color: #64ab7c; }
.mo-case.gagnante.c2 { background: color-mix(in srgb, #d07070 24%, var(--surface-2)); border-color: #d07070; }
.mo-plateau.victoire-moi .mo-case.gagnante { background: color-mix(in srgb, #64ab7c 26%, var(--surface-2)); border-color: #64ab7c; }
.mo-plateau.victoire-autre .mo-case.gagnante { background: color-mix(in srgb, #d07070 24%, var(--surface-2)); border-color: #d07070; }
/* Morpion infini : le symbole qui disparaîtra au prochain coup de son camp. */
.mo-case.fragile svg { opacity: 0.38; }
.mo-case.fragile::after { content: ''; position: absolute; inset: 5px; border: 2px dashed var(--texte-faible); border-radius: 7px; }
.mo-case.part svg { animation: mo-part 0.25s ease-in forwards; }

/* Entraînement : ce que vaut chaque case libre. */
.mo-case.conseil-gagne { background: color-mix(in srgb, #64ab7c 30%, var(--surface-2)); border-color: #64ab7c; }
.mo-case.conseil-nul { background: color-mix(in srgb, #d2973a 22%, var(--surface-2)); border-color: #d2973a; }
.mo-case.conseil-perd { background: color-mix(in srgb, #d07070 26%, var(--surface-2)); border-color: #d07070; }
.mo-case .conseil-mot { position: absolute; left: 0; right: 0; bottom: 6px; font-size: 0.68rem; font-weight: 700; color: var(--texte); pointer-events: none; }
.legende-conseils { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 0.8rem; color: var(--texte-doux); margin: 8px 0 0; }
.legende-conseils span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legende-conseils .l-gagne::before { background: #64ab7c; }
.legende-conseils .l-nul::before { background: #d2973a; }
.legende-conseils .l-perd::before { background: #d07070; }

/* Le trait qui barre les trois cases alignées. */
.mo-trait-fin { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mo-trait-fin line { stroke: #f0f3f6; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: mo-trace 0.45s ease-out 0.1s forwards; }

.mo-attente {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 700; color: #f0f3f6;
  background: rgba(8, 10, 14, 0.72);
  border-radius: 14px;
  pointer-events: none;
}

@keyframes mo-pose { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mo-part { to { transform: scale(0.3); opacity: 0; } }
@keyframes mo-trace { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .mo-case.pose svg, .mo-case.part svg { animation: none; }
  .mo-trait-fin line { animation: none; stroke-dashoffset: 0; }
}

/* ---------- Fin de partie : SOUS la grille, jamais dessus ---------- */

.fin-partie {
  position: relative;
  max-width: 460px;
  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; }
.fin-liens a { text-underline-offset: 2px; }
.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; }

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

/* ============================== SALON DU DUEL ============================== */

.lobby-msg { color: var(--texte-doux); margin: 4px 0 14px; font-size: 0.95rem; min-height: 1.4em; }
.salon-bloc { max-width: 460px; 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 {
  flex: 1 1 130px; min-width: 0; min-height: 48px; padding: 8px 12px;
  font: inherit; font-size: 1.25rem; font-weight: 800; letter-spacing: 0.3em; text-align: center; text-transform: uppercase;
  color: var(--texte); background: var(--surface-0); border: 1px solid var(--line-forte); border-radius: 8px;
}
.salon-code 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 .btn-creer { width: 100%; min-height: 48px; }
.salon-attente { max-width: 460px; 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; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-forte); border-top-color: var(--color-light); border-radius: 50%; animation: mo-tourne 0.8s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes mo-tourne { to { transform: rotate(360deg); } }

.joueurs { display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.joueur { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 0.86rem; border: 1px solid var(--line); background: var(--surface-2); max-width: 100%; }
/* Le nom n'est jamais coupé : la mention « (visiteur) » qui le termine doit rester lisible. */
.joueur .nom { overflow-wrap: anywhere; text-align: left; }
.salon-bloc .choix button { flex-basis: 84px; }
.joueur.actif { border-color: var(--color-light); background: color-mix(in srgb, var(--color-btn1) 22%, var(--surface-2)); }
.score-manches { font-weight: 800; color: #f0f3f6; font-size: 0.95rem; }
.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); }

/* ============================== DÉFI DU JOUR ============================== */

.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; }
.titre-jeu-defi { font-family: var(--font-display); font-size: 1.15rem; color: #f0f3f6; }
.info-restants { color: var(--texte-doux); }
.info-restants strong { color: #fff; }
.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); }

/* ============================== TEXTE SOUS LE JEU (morpion infini) ============================== */

.texte-page { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; font-size: 0.95rem; line-height: 1.65; color: var(--texte); }
.texte-page h2 { font-family: var(--font-display); font-size: 1.2rem; color: #f0f3f6; margin: 22px 0 10px; }
.texte-page h2:first-child { margin-top: 0; }
.texte-page p { margin-bottom: 12px; }
.texte-page ul { margin: 0 0 14px 22px; }
.texte-page li { margin-bottom: 6px; }
.texte-page a { color: var(--color-light); }
.table-defilante { overflow-x: auto; margin: 10px 0 14px; }
.table-regles { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-regles th, .table-regles td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-regles thead th { color: var(--color-light); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.faq-simple dt { font-weight: 700; color: #f0f3f6; margin-top: 12px; }
.faq-simple dd { margin: 4px 0 0; color: var(--texte); }
/* Pendant la partie, le texte s'efface : place à la grille. */
body.mo-en-jeu .texte-page { display: none; }

/* ============================== ÉCRANS ÉTROITS OU BAS ============================== */

/* Pendant la partie, sur un écran peu haut, la bannière du site (déjà doublée
   par « Accueil ») laisse sa place à la grille. */
@media (max-height: 820px) and (min-aspect-ratio: 3/4) {
  body.mo-en-jeu .jeu-banner { display: none; }
  body.mo-en-jeu { --mo-reserve: 250px; }
}

/* Pendant qu'on joue, rien d'autre que la partie : les blocs latéraux du site
   reviennent dès qu'elle est finie. */
body.mo-blocs-caches .bandeau-infos-wrap, body.mo-blocs-caches .bloc-jeux-une-wrap { display: none !important; }

/* Écran large : la grille à gauche, les informations et le résultat à droite.
   Le résultat s'affiche à côté de la grille, sans la couvrir ni faire défiler. */
@media (min-width: 900px) and (min-height: 521px) {
  body.mo-en-jeu { --mo-reserve: 200px; }
  body.mo-en-jeu #app { max-width: 820px; }
  body.mo-en-jeu .zone-jeu { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 28px; align-items: start; }
  body.mo-en-jeu .colonne-plateau { grid-column: 1; grid-row: 1 / span 2; }
  body.mo-en-jeu .colonne-infos { grid-column: 2; grid-row: 1; }
  body.mo-en-jeu .colonne-fin { grid-column: 2; grid-row: 2; }
  body.mo-en-jeu .fin-partie { margin: 8px 0 0; max-width: none; }
  body.mo-en-jeu .barre-fin { justify-content: flex-start; }
  body.mo-en-jeu .top-bar h1 { font-size: 1.15rem; }
  body.mo-en-jeu .back-link { white-space: nowrap; }
}

@media (max-width: 480px) {
  .top-bar h1 { font-size: 1.1rem; }
  .mo-grille { gap: 6px; padding: 8px; }
  .joueur { padding: 5px 10px; font-size: 0.8rem; }
  .compte-a-rebours span { font-size: 4.5rem; }
  .code-affiche { font-size: 2rem; }
}

/* Très petit écran : champ du code et bouton l'un sous l'autre. */
@media (max-width: 380px) {
  .salon-code input, .salon-code .btn { flex-basis: 100%; }
  .choix button { flex-basis: 96px; }
}

/* Téléphone tenu à l'horizontale : grille à gauche sur toute la hauteur, infos à droite. */
@media (orientation: landscape) and (max-height: 520px) {
  body.mo-en-jeu { padding: 6px; padding-top: 6px; }
  body.mo-en-jeu .jeu-banner, body.mo-en-jeu footer { display: none; }
  body.mo-en-jeu #app { max-width: none; padding: 8px 12px; }
  body.mo-en-jeu .zone-jeu { display: grid; grid-template-columns: auto minmax(180px, 1fr); grid-template-rows: auto 1fr; gap: 0 14px; align-items: start; }
  body.mo-en-jeu .colonne-plateau { grid-column: 1; grid-row: 1 / span 2; }
  /* La barre de connexion du site, fixée en haut à droite, tombe sur la colonne d'infos. */
  body.mo-en-jeu .colonne-infos { grid-column: 2; grid-row: 1; text-align: left; padding-top: 50px; }
  body.mo-en-jeu .colonne-fin { grid-column: 2; grid-row: 2; }
  body.mo-en-jeu .top-bar { border-bottom: 0; margin-bottom: 6px; padding-bottom: 0; }
  body.mo-en-jeu .info-bar { flex-direction: column; align-items: flex-start; }
  body.mo-en-jeu .mo-plateau { width: calc(100vh - 28px); width: calc(100svh - 28px); max-width: 55vw; }
  body.mo-en-jeu .fin-partie { margin: 8px 0 0; padding: 14px 12px 12px; }
  body.mo-en-jeu .fin-partie h2 { font-size: 1.2rem; }
}

/* ============================== MORPION ULTIMATE ============================== */

/* Neuf petites grilles dans une grande : 81 cases, donc une grille plus large
   que celle du morpion classique dès que l'écran le permet. */
.mo-plateau.mo-ultimate {
  width: min(100%, 560px, calc(100vh - var(--mo-reserve)));
  width: min(100%, 560px, calc(100svh - var(--mo-reserve)));
  min-width: 280px;
}
.mo-grille.mo-grande { gap: 7px; padding: 8px; }
.mo-petite {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-0);
  transition: border-color 0.15s, background-color 0.15s;
}
.mo-ultimate .mo-case { border-radius: 5px; }
.mo-ultimate .mo-case svg { inset: 14%; width: 72%; height: 72%; }
.mo-ultimate .mo-case .trait { stroke-width: 14; }
/* Seules les cases permises par la règle répondent, pas toutes les cases vides. */
.mo-ultimate .mo-grille.actif .mo-case.libre { cursor: default; }
.mo-ultimate .mo-grille.actif .mo-case.jouable { cursor: pointer; background: color-mix(in srgb, var(--color-btn1) 16%, var(--surface-2)); }
@media (hover: hover) and (pointer: fine) {
  .mo-ultimate .mo-grille.actif .mo-case.libre:not(.jouable):hover { border-color: var(--line); background: var(--surface-2); }
  .mo-ultimate .mo-grille.actif .mo-case.jouable:hover { border-color: var(--color-light); background: color-mix(in srgb, var(--color-btn1) 34%, var(--surface-2)); }
}
/* La ou les petites grilles où le camp au trait doit jouer. */
.mo-petite.visee { border-color: var(--color-light); background: color-mix(in srgb, var(--color-btn1) 10%, var(--surface-0)); }
/* Petite grille remportée : ses cases s'effacent derrière le symbole du vainqueur. */
.mo-petite.gagnee-1 .mo-case, .mo-petite.gagnee-2 .mo-case { opacity: 0.22; }
.mo-petite.gagnee-1 { border-color: color-mix(in srgb, var(--mo-croix) 60%, var(--line)); background: color-mix(in srgb, var(--mo-croix) 12%, var(--surface-0)); }
.mo-petite.gagnee-2 { border-color: color-mix(in srgb, var(--mo-rond) 60%, var(--line)); background: color-mix(in srgb, var(--mo-rond) 12%, var(--surface-0)); }
.mo-petite.nulle .mo-case { opacity: 0.4; }
.mo-petite.nulle { border-style: dashed; }
.mo-grand-symbole { position: absolute; inset: 12%; width: 76%; height: 76%; overflow: visible; pointer-events: none; }
.mo-grand-symbole .trait { fill: none; stroke-width: 12; stroke-linecap: round; }
.mo-petite.gagnee-1 .mo-grand-symbole .trait { stroke: var(--mo-croix); }
.mo-petite.gagnee-2 .mo-grand-symbole .trait { stroke: var(--mo-rond); }
.mo-petite.prise .mo-grand-symbole { animation: mo-pose 0.3s ease-out; }
.mo-petite.gagnante { border-color: #f0f3f6; }
.mo-plateau.victoire-moi .mo-petite.gagnante { border-color: #64ab7c; background: color-mix(in srgb, #64ab7c 22%, var(--surface-0)); }
.mo-plateau.victoire-autre .mo-petite.gagnante { border-color: #d07070; background: color-mix(in srgb, #d07070 20%, var(--surface-0)); }
.mo-ultimate .mo-trait-fin line { stroke-width: 1.8; }
@media (prefers-reduced-motion: reduce) {
  .mo-petite.prise .mo-grand-symbole { animation: none; }
}

@media (min-width: 900px) and (min-height: 521px) {
  body.mo-page-ultimate.mo-en-jeu #app { max-width: 1000px; }
  body.mo-page-ultimate.mo-en-jeu .zone-jeu { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .mo-grille.mo-grande { gap: 4px; padding: 5px; }
  .mo-petite { gap: 2px; padding: 2px; border-width: 2px; border-radius: 7px; }
  .mo-ultimate .mo-case { border-radius: 4px; }
  /* 81 cases à toucher : la grille prend presque toute la largeur de l'écran, en
     débordant des marges de la page (sans toucher à celles-ci : la bannière du
     site est calée dessus). */
  /* Sur un petit téléphone, c'est la hauteur qui manque : pendant la partie, la
     bannière du site (déjà doublée par « Accueil ») laisse sa place à la grille. */
  body.mo-page-ultimate.mo-en-jeu .jeu-banner { display: none; }
  body.mo-page-ultimate.mo-en-jeu { --mo-reserve: 250px; }
  .mo-plateau.mo-ultimate {
    --mo-larg: min(calc(100vw - 16px), calc(100vh - var(--mo-reserve)));
    --mo-larg: min(calc(100vw - 16px), calc(100svh - var(--mo-reserve)));
    width: var(--mo-larg);
    min-width: 0;
    margin-left: calc((100% - var(--mo-larg)) / 2);
    margin-right: 0;
  }
}
/* La grille du morpion ultimate occupe la place des blocs latéraux du site : ils
   restent masqués après la fin tant que l'écran n'est pas assez large pour tout
   montrer, sinon ils recouvrent la grille et le résultat. */
@media (max-width: 1539px) {
  body.mo-page-ultimate.mo-en-jeu .bandeau-infos-wrap, body.mo-page-ultimate.mo-en-jeu .bloc-jeux-une-wrap { display: none !important; }
}