/*
 * Pluie de Sable : pages où l'on joue (classique, défi du jour, défi entre
 * amis, apprentissage, duel) et zone de jeu.
 *
 * Contraintes du réseau :
 *   - #app reste à 800 px : au-delà, les blocs latéraux fixes recouvriraient
 *     le contenu dès 1280 px.
 *   - padding horizontal de #app jamais sous 24 px : le banner partagé sort
 *     du conteneur avec des marges négatives calées sur cette valeur.
 *
 * Pendant une partie (.ps-jeu.visible), la zone de jeu occupe toute la
 * fenêtre, au-dessus de la barre de compte : le plateau se cale sur la
 * hauteur disponible et rien ne le recouvre, sur tous les écrans.
 * Charte sobre du réseau : aplats, aucune animation d'interface.
 */

* { box-sizing: border-box; }

body.page-pluie-de-sable {
  margin: 0;
  background: #17130e;
  color: #f1e9dc;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.page-pluie-de-sable #app {
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.page-pluie-de-sable h1 { font-size: 1.6rem; color: #f4c27a; margin: 8px 0 12px; text-align: center; }
.page-pluie-de-sable h2 { font-size: 1.1rem; color: #ffd99a; margin: 20px 0 8px; }
.page-pluie-de-sable #app a { color: #f6c98a; }
.page-pluie-de-sable footer { text-align: center; font-size: 0.82rem; color: #a89a86; margin-top: 30px; line-height: 1.7; }
.page-pluie-de-sable #app footer a { color: #d9cbb6; }

.setup-intro {
  color: #d9cbb6;
  line-height: 1.6;
  font-size: 0.95rem;
  text-align: center;
  margin: 0 auto 18px;
  max-width: 62ch;
}
.message-partie { min-height: 1.2em; text-align: center; color: #ffd99a; font-size: 0.92rem; margin: 10px 0; }
.date-titre { text-align: center; color: #f4c27a; margin: 0 0 16px; font-weight: 600; }
.liens-modes { text-align: center; margin: 22px 0 6px; line-height: 1.9; font-size: 0.93rem; }
.ps-etat { text-align: center; font-size: 1rem; margin: 6px 0; line-height: 1.5; }
.ps-etat strong { color: #ffd99a; }
.ps-pseudo-visiteur { text-align: center; color: #a89a86; font-size: 0.85rem; margin: 0 0 12px; }

.ps-regles { margin: 16px auto; padding: 0 0 0 20px; max-width: 60ch; line-height: 1.6; color: #d9cbb6; font-size: 0.95rem; }
.ps-regles li { margin: 5px 0; }
.ps-texte { line-height: 1.65; color: #d9cbb6; font-size: 0.96rem; }
.ps-texte strong { color: #f1e9dc; }

/* ---- Tableaux -------------------------------------------------------------- */
.ps-tableau-cadre { overflow-x: auto; margin: 12px 0; }
.ps-tableau { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ps-tableau th, .ps-tableau td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 240, 210, 0.1); text-align: left; vertical-align: top; }
.ps-tableau th { color: #ffd99a; font-weight: 700; white-space: nowrap; }
.ps-tableau td { color: #d9cbb6; }

/* ---- Boutons ------------------------------------------------------------- */
.ps-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0 0; }
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  background: #b46a24;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.page-pluie-de-sable #app a.ps-btn, .ps-jeu a.ps-btn { color: #fff; }
.ps-btn.secondaire { background: rgba(255, 240, 210, 0.12); }
.ps-btn-grand { min-height: 56px; padding: 12px 34px; font-size: 1.15rem; }
.ps-btn:focus-visible { outline: 3px solid #ffd99a; outline-offset: 2px; }
.ps-btn[hidden] { display: none; }
.ps-btn:disabled { opacity: 0.55; cursor: default; }

/* ---- Statistiques personnelles --------------------------------------------- */
#mes-stats[hidden] { display: none; }
.ps-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 0; }
.ps-stats div { padding: 10px 12px; border-radius: 12px; background: rgba(255, 240, 210, 0.05); border: 1px solid rgba(255, 240, 210, 0.08); }
.ps-stats dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: #a89a86; }
.ps-stats dd { margin: 3px 0 0; font-weight: 800; color: #ffd99a; font-variant-numeric: tabular-nums; }

/* ---- Salon du duel ------------------------------------------------------------ */
.ps-salon { max-width: 460px; margin: 0 auto; padding: 18px; border-radius: 16px; background: rgba(255, 240, 210, 0.05); border: 1px solid rgba(255, 240, 210, 0.1); text-align: center; }
.ps-salon-statut { min-height: 1.5em; margin: 0 0 12px; line-height: 1.5; font-weight: 600; }
/* minmax(0, 1fr) : sans lui la colonne prend la largeur naturelle du champ et déborde sur téléphone. */
.ps-salon-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ps-salon-actions[hidden], .ps-salon-prive[hidden] { display: none; }
.ps-salon-code { display: flex; gap: 8px; }
.ps-salon-code input {
  flex: 1 1 0; min-width: 0; width: 100%; text-align: center; text-transform: uppercase; letter-spacing: 0.2em;
  font: inherit; font-weight: 800; font-size: 1.05rem; padding: 10px; border-radius: 12px;
  border: 1px solid rgba(255, 240, 210, 0.25); background: rgba(0, 0, 0, 0.3); color: #ffd99a;
}
.ps-salon-code .ps-btn { flex: 1 1 0; min-width: 0; background: #8a5a1f; }
.ps-salon-prive { margin: 6px 0 12px; }
.ps-code { display: inline-block; font-size: 2rem; font-weight: 900; letter-spacing: 0.25em; color: #ffd99a; background: rgba(244, 194, 122, 0.12); padding: 8px 18px 8px 24px; border-radius: 12px; }

/* Encadré explicatif du défi et cadre du classement du jour (convention des pages de défi) */
.defi-intro {
  margin: 18px 0; padding: 14px 18px; border-radius: 14px;
  background: rgba(244, 194, 122, 0.07); border: 1px solid rgba(255, 240, 210, 0.08);
  line-height: 1.55; font-size: 0.95rem;
}
.defi-intro h2 { margin-top: 0; }
.defi-intro ul { padding-left: 20px; margin: 8px 0 0; }
.defi-intro li { margin: 4px 0; }
.defi-compte { text-align: center; margin: 14px 0 20px; line-height: 1.5; }
.classement-section {
  max-width: 800px; margin: 24px auto 10px; padding: 16px 18px;
  background: rgba(255, 240, 210, 0.06); border: 1px solid rgba(255, 240, 210, 0.1);
  border-radius: 18px;
}
.classement-section[hidden] { display: none; }
.classement-section h3 { margin: 0 0 10px; text-align: center; color: #f4c27a; }
.classement-invite, .classement-lien { text-align: center; font-size: 0.9rem; margin: 10px 0 0; }

/* ---- Apprentissage --------------------------------------------------------------- */
.ps-lecons { list-style: none; margin: 16px auto; padding: 0; max-width: 520px; display: grid; gap: 8px; }
.ps-lecons li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(255, 240, 210, 0.05); border: 1px solid rgba(255, 240, 210, 0.08); }
.ps-lecons .ps-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: rgba(244, 194, 122, 0.18); color: #ffd99a; }
.ps-lecons li.faite .ps-num { background: #4c9a50; color: #fff; }
.ps-consigne {
  flex: none; margin: 0 auto 8px; padding: 10px 16px; max-width: min(560px, 94vw);
  border-radius: 12px; background: rgba(244, 194, 122, 0.14); border: 1px solid rgba(244, 194, 122, 0.5);
  color: #fff3df; font-size: 0.95rem; line-height: 1.45; text-align: center;
}
.ps-consigne strong { color: #ffd99a; }
.ps-consigne[hidden] { display: none; }

/* ========================================================================== */
/* Zone de jeu                                                                */

.ps-jeu { display: none; }
body.ps-en-partie { overflow: hidden; }
.ps-jeu.visible {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 2000;               /* au-dessus de la barre de compte (1000), sous les annonces du site */
  background: #120f0b;
  color: #f1e9dc;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* Bandeaux latéraux du réseau (PC) : masqués pendant la partie, de retour sur l'écran de fin */
body.ps-bandeaux-visibles .bandeau-infos-wrap,
body.ps-bandeaux-visibles .bloc-jeux-une-wrap { z-index: 2001; }

.ps-hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: max(4px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
  background: rgba(255, 240, 210, 0.04);
  border-bottom: 1px solid rgba(255, 240, 210, 0.08);
}
.ps-stat { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ps-stat[hidden] { display: none; }
.ps-lib { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #a89a86; white-space: nowrap; }
.ps-stat strong { font-size: 1.08rem; color: #ffd99a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-outils { display: flex; gap: 6px; flex: none; margin-left: auto; }
.ps-outils button {
  width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(255, 240, 210, 0.3); border-radius: 12px;
  background: rgba(255, 240, 210, 0.06); color: #fff; font-size: 19px; line-height: 1; cursor: pointer;
}
.ps-outils button[hidden] { display: none; }
.ps-outils button[aria-pressed="true"]#btn-motifs { background: rgba(244, 194, 122, 0.25); border-color: #f4c27a; }
.ps-outils button:focus-visible { outline: 3px solid #ffd99a; outline-offset: 2px; }

/* Le plateau : centré, calé en hauteur par le script. */
.ps-zone {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.ps-jeu canvas {
  display: block;
  border-radius: 8px;
  background: #1b1712;
  touch-action: none;
  cursor: grab;
  outline: none;
  box-shadow: 0 0 0 1px rgba(255, 240, 210, 0.1);
}

/* Annonce au milieu du plateau (traversée, chaîne, sable gris) : elle ne prend jamais le clic. */
.ps-annonce {
  position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%);
  max-width: 88%; margin: 0; padding: 10px 18px; border-radius: 12px;
  background: rgba(23, 19, 14, 0.92); border: 1px solid rgba(244, 194, 122, 0.6); color: #fff3df;
  font-weight: 800; text-align: center; pointer-events: none; z-index: 2;
}
.ps-annonce.chaine { border-color: #ffd99a; color: #ffd99a; font-size: 1.15rem; }
.ps-annonce.palier { border-color: #a5d6a7; color: #d6f5d8; }
.ps-annonce.malus { border-color: #f87171; color: #fecaca; }
.ps-annonce.envoi { border-color: #4ade80; color: #bbf7d0; }
.ps-annonce[hidden] { display: none; }
.ps-annonce-adv { font-size: 0.75rem; padding: 4px 8px; top: 40%; }

/* Conseil de la première partie : sous le plateau, sans rien cacher. */
.ps-tuto {
  flex: none; margin: 0 auto 8px; padding: 8px 14px; max-width: min(520px, 94vw);
  border-radius: 12px; background: rgba(244, 194, 122, 0.12); border: 1px solid rgba(244, 194, 122, 0.4);
  color: #fff3df; font-size: 0.9rem; line-height: 1.45; text-align: center;
}
.ps-tuto[hidden] { display: none; }

.ps-revoir {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 4;
  min-height: 44px; padding: 8px 18px; border: 0; border-radius: 12px;
  background: #b46a24; color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.ps-revoir[hidden] { display: none; }

/* ---- Écrans par-dessus le plateau (menu, fin, décompte) ----------------------- */
.ps-voile {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 14px; background: rgba(10, 8, 5, 0.74); overflow: auto;
}
.ps-voile[hidden] { display: none; }
.ps-carte {
  position: relative; width: min(440px, 100%); max-height: 100%; overflow: auto;
  padding: 26px 20px 20px; border-radius: 16px; text-align: center;
  background: #221c14; border: 1px solid rgba(255, 240, 210, 0.14);
  -webkit-user-select: text; user-select: text;
}
.ps-carte h2 { margin: 0 0 8px; font-size: 1.5rem; color: #f1e9dc; }
.ps-fin-titre.gagne { color: #a5d6a7; }
.ps-fin-titre.perdu { color: #fca5a5; }
.ps-fermer {
  position: absolute; top: 4px; right: 6px; width: 44px; height: 44px;
  border: 0; background: none; color: #d9cbb6; font-size: 1.7rem; line-height: 1; cursor: pointer; border-radius: 10px;
}
.ps-fermer:hover, .ps-fermer:focus-visible { background: rgba(255, 240, 210, 0.1); outline: none; }
.ps-note { color: #a89a86; font-size: 0.9rem; line-height: 1.5; margin: 6px 0; }
.ps-commandes { color: #d9cbb6; font-size: 0.9rem; line-height: 1.6; margin: 10px 0; }
.ps-commandes kbd {
  display: inline-block; min-width: 1.5em; padding: 1px 5px; border-radius: 5px; border: 1px solid rgba(255, 240, 210, 0.35);
  background: rgba(255, 240, 210, 0.08); font: inherit; font-size: 0.8em; text-align: center;
}
.ps-tactile-seul { display: none; }
.ps-jeu.mode-tactile .ps-tactile-seul { display: block; }
.ps-jeu.mode-tactile .ps-clavier-seul { display: none; }
.ps-fin-score { margin: 4px 0; font-size: 2.2rem; font-weight: 900; color: #ffd99a; font-variant-numeric: tabular-nums; }
.ps-fin-score small { font-size: 0.95rem; font-weight: 600; color: #d9cbb6; }
.ps-fin-detail { margin: 4px 0 10px; color: #a89a86; font-size: 0.88rem; line-height: 1.5; }
.ps-fin-statut { min-height: 1.4em; margin: 10px 0; font-size: 0.93rem; line-height: 1.55; color: #d9cbb6; }
.ps-fin-statut.attente { color: #ffd99a; }
.ps-fin-statut.erreur { color: #fca5a5; }
.ps-fin-statut a { color: #f6c98a; }
.ps-record { color: #a5d6a7; font-weight: 800; }
.ps-fin-duel { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0; }
.ps-fin-duel span { display: flex; flex-direction: column; min-width: 0; }
.ps-fin-duel small { color: #a89a86; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.ps-fin-duel strong { font-size: 1.6rem; color: #ffd99a; font-variant-numeric: tabular-nums; }
.ps-fin-contre { color: #7d705e; font-size: 0.85rem; }
.ps-decompte .ps-carte { background: none; border: 0; }
.ps-affiche { font-size: 1.15rem; font-weight: 800; color: #f1e9dc; margin: 0 0 6px; }
.ps-chiffre { font-size: 6rem; font-weight: 900; line-height: 1; margin: 0 0 10px; color: #f4c27a; }

/* ---- Duel : deux plateaux ----------------------------------------------------- */
.ps-hud-duel { gap: 10px; }
.ps-camp { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 0; }
.ps-camp.adv { justify-content: flex-end; }
.ps-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 0.9rem; }
.ps-camp.moi .ps-nom { color: #a5d6a7; }
.ps-camp.adv .ps-nom { color: #fca5a5; }
.ps-points { font-size: 1.15rem; color: #ffd99a; font-variant-numeric: tabular-nums; }
.ps-centre { display: flex; flex-direction: column; align-items: center; flex: none; line-height: 1.2; }
.ps-chrono { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ps-plateaux { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; justify-content: center; padding: 0 6px; }
.ps-plateaux .ps-zone { flex: 3 1 0; }
.ps-zone-adv { position: relative; flex: 2 1 0; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px; }
.ps-zone-adv canvas { cursor: default; }
.ps-barre {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  padding: 4px 10px max(8px, env(safe-area-inset-bottom)); font-size: 0.86rem; font-weight: 600; color: #a89a86;
}
.ps-attente.menace { color: #fca5a5; }

@media (max-width: 760px) {
  /* Écran étroit : le plateau adverse devient une vignette au-dessus du sien. */
  .ps-plateaux { flex-direction: column-reverse; gap: 0; }
  .ps-zone-adv { flex: none; height: 110px; padding: 4px; }
  .ps-hud { gap: 8px; }
  .ps-stat strong { font-size: 0.98rem; }
  .ps-outils button { width: 40px; height: 40px; font-size: 17px; }
  .ps-hud-duel .ps-camp { flex-direction: column-reverse; align-items: flex-start; gap: 0; line-height: 1.15; }
  .ps-hud-duel .ps-camp.adv { flex-direction: column; align-items: flex-end; }
  .ps-nom { font-size: 0.72rem; max-width: 100%; }
  .ps-points { font-size: 1.05rem; }
}

@media (max-width: 760px) {
  /* Duel sur écran étroit : un peu d'air entre la vignette adverse, ton plateau et la barre du bas. */
  .ps-plateaux { gap: 4px; }
  .ps-barre { padding-top: 6px; }
}

/* Téléphone : les quatre boutons restent, motifs ◐ compris (accessibilité promise par la FAQ),
   en plus petit. Sous 380 px, le plein écran (rare sur téléphone, absent sur iPhone) cède sa place. */
@media (max-width: 420px) {
  .ps-lib { font-size: 0.6rem; }
  .ps-hud { gap: 6px; padding-left: 8px; padding-right: 6px; }
  .ps-outils { gap: 4px; }
  .ps-outils button { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
}
@media (max-width: 380px) {
  #btn-plein-ecran { display: none; }
}

/* Serveur de jeu injoignable pendant la partie : bandeau discret, la partie continue. */
.ps-reseau {
  flex: none; margin: 0 auto 6px; padding: 6px 12px; max-width: min(560px, 94vw);
  border-radius: 10px; background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca; font-size: 0.82rem; line-height: 1.4; text-align: center;
}
.ps-reseau[hidden] { display: none; }

/* Encart « défi du jour » de l'écran de fin (module partagé) : aux couleurs des boutons du jeu. */
#ecran-fin div#cta-defi-du-jour { background: rgba(244, 194, 122, 0.08); border-color: rgba(244, 194, 122, 0.3); border-radius: 12px; }
#ecran-fin div#cta-defi-du-jour p.cta-ddj-titre { color: #ffd99a; }
#ecran-fin div#cta-defi-du-jour a.cta-ddj-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px;
  border-radius: 12px; background: #b46a24; color: #fff; font-weight: 800; font-size: 0.95rem;
}

/* Guide de stratégie (guide.php) */
.ps-guide h1 { margin-bottom: 14px; }
.ps-guide p, .ps-guide li { line-height: 1.65; }
.ps-guide-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.ps-guide figure { margin: 0; }
.ps-guide-seule { max-width: 320px; margin: 14px auto !important; }
.ps-guide img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 240, 210, 0.12); }
.ps-guide figcaption { margin-top: 6px; font-size: 0.84rem; color: #a89a86; text-align: center; line-height: 1.4; }

/* Revoir la partie du 1er (revoir.php) */
.ps-revoir-cadre { max-width: 380px; margin: 0 auto; }
.ps-revoir-cadre canvas { display: block; margin: 8px auto; border-radius: 8px; background: #1b1712; box-shadow: 0 0 0 1px rgba(255, 240, 210, 0.1); }
.ps-revoir-infos { display: flex; justify-content: space-between; font-size: 0.9rem; color: #a89a86; }
.ps-revoir-infos strong { color: #ffd99a; font-variant-numeric: tabular-nums; }

/* Duel contre l'ordinateur */
.ps-salon-ordi { margin-top: 14px; }
.ps-niveaux { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ps-niveaux .ps-btn { flex: 1 1 0; min-width: 0; }

/* Mes dernières parties, mes exploits (statistiques du compte) */
.ps-histo-titre, .ps-exploits-titre { font-size: 0.95rem; color: #ffd99a; margin: 18px 0 8px; }
.ps-histo { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ps-histo li { display: grid; grid-template-columns: 7.5em 1fr 5.5em; gap: 10px; align-items: center; font-size: 0.85rem; }
.ps-histo-date { color: #a89a86; white-space: nowrap; }
.ps-histo-barre { height: 8px; border-radius: 4px; background: rgba(255, 240, 210, 0.08); overflow: hidden; }
.ps-histo-barre span { display: block; height: 100%; background: #b46a24; }
.ps-histo strong { text-align: right; color: #ffd99a; font-variant-numeric: tabular-nums; }
.ps-exploits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ps-exploits li { padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(255, 240, 210, 0.08); background: rgba(255, 240, 210, 0.03); color: #7d705e; font-size: 0.82rem; line-height: 1.35; }
.ps-exploits li.obtenu { color: #f1e9dc; border-color: rgba(244, 194, 122, 0.45); background: rgba(244, 194, 122, 0.1); }
.ps-exploits li span { display: block; font-size: 1.2rem; filter: grayscale(1); opacity: 0.5; }
.ps-exploits li.obtenu span { filter: none; opacity: 1; }
.ps-exploit-nouveau { display: block; margin-top: 6px; color: #a5d6a7; font-weight: 800; }

/* Barre de compte en surimpression (voir la fin de cette feuille) : sur téléphone et tablette,
   le haut des pages (logo du jeu, maison) passe dessous. On lui laisse sa place. */
@media (max-width: 768px) {
  .page-pluie-de-sable #app { padding-top: 72px; }
}

/* Téléphone couché : la barre d'état passe à gauche, le plateau prend toute la hauteur. */
@media (orientation: landscape) and (max-height: 520px) {
  .ps-jeu.visible { flex-direction: row; flex-wrap: nowrap; }
  .ps-hud { flex-direction: column; align-items: stretch; justify-content: flex-start; width: 132px; min-height: 0; gap: 8px; padding: 8px; border-bottom: 0; border-right: 1px solid rgba(255, 240, 210, 0.08); }
  .ps-outils { margin: auto 0 0; flex-wrap: wrap; }
  .ps-barre { flex-direction: column; justify-content: center; width: 128px; padding: 8px; }
  .ps-tuto, .ps-consigne { display: none; }
  .ps-reseau { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 3; }
  .ps-hud-duel .ps-camp { flex: none; flex-direction: column; align-items: flex-start; gap: 0; }
  .ps-hud-duel .ps-camp.adv { align-items: flex-start; }
  .ps-plateaux { flex-direction: row; }
  .ps-zone-adv { flex: 0 0 30%; height: auto; }
}

/* Écran tactile sans souris : les consignes du doigt d'emblée. */
@media (hover: none) and (pointer: coarse) {
  .ps-tactile-seul { display: block; }
  .ps-clavier-seul { display: none; }
}

@media (max-width: 480px) {
  .page-pluie-de-sable #app { padding: 72px 24px 28px; }
  .page-pluie-de-sable h1 { font-size: 1.35rem; }
}

/* En-tête réseau (01/11/2026) : page de partie plein écran, le jeu garde tout l'écran.
   Pas de bande en haut ; la barre de compte reste en surimpression, comme avant.
   Sélecteurs préfixés par html : ils l'emportent sur head-common.css quel que soit
   l'ordre de chargement. */
html:root {
  --entete-reseau: 0px;
}
html .net-entete {
  display: none;
}
html .net-entete + .auth-nav {
  position: fixed;
  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);
}

/* Le bouton de repli de la barre reste utile ici (téléphone et tablette) */
@media (max-width: 768px) {
  html .net-entete + .auth-nav:not(.no-collapse) .auth-nav-toggle {
    display: inline-flex;
  }
}
