/* Chessland — l'appli (couleurs reprises du plateau du bot) */
:root {
  --fond: #1d1a24;
  --fond-2: #28242f;
  --carte: #2f2a38;
  --carte-2: #3a3445;
  --bord: #4a4356;
  --texte: #f1ece4;
  --texte-2: #b9b0c2;
  --or: #f6d65c;
  --or-fonce: #c99a2e;
  --clair: #eed9b5;
  --fonce: #b07e56;
  --bleu: #2d6edc;
  --vert: #28965a;
  --rouge: #d23737;
  --gris: #4b4558;
  --rayon: 14px;
  --ombre: 0 6px 20px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #2e2838 0%, var(--fond) 60%) fixed, var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
b, strong { color: #fff; }

.ecran { display: none; min-height: 100vh; min-height: 100dvh; }
.ecran.actif { display: block; }
.ecran.centre.actif { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px 16px; text-align: center; }
.cache { display: none !important; }
.discret { color: var(--texte-2); }
.petit { font-size: 14px; }
.texte-centre { text-align: center; }
.erreur { color: #ff8a8a; min-height: 1.4em; text-align: center; margin: 10px 0 0; }

/* logo / titres */
.logo-chessy { width: 120px; height: 120px; image-rendering: auto; filter: drop-shadow(0 8px 16px rgba(0,0,0,.45)); }
.flotte { animation: flotte 3s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-8px); } }
.titre-jeu { font-size: 34px; margin: 4px 0 0; letter-spacing: .5px;
  background: linear-gradient(180deg, #fff3b8, var(--or) 45%, var(--or-fonce));
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.sous-titre { margin: 0 0 18px; color: var(--texte-2); text-align: center; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px;
  padding: 11px 16px; font-weight: 700; cursor: pointer; text-decoration: none; color: #fff; min-height: 44px;
  transition: transform .08s ease, filter .15s ease; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn-grand { width: 100%; font-size: 17px; padding: 14px; }
.btn-or { background: linear-gradient(180deg, #ffe17a, var(--or-fonce)); color: #2a1f05; box-shadow: 0 4px 0 #8c6a1c; }
.btn-gris { background: var(--gris); }
.btn-bleu { background: var(--bleu); box-shadow: 0 3px 0 #1b4a99; }
.btn-vert { background: var(--vert); box-shadow: 0 3px 0 #18623a; }
.btn-rouge { background: var(--rouge); box-shadow: 0 3px 0 #8f2121; }
.btn-orange { background: linear-gradient(180deg, #f5b51e, #d98400); color: #2a1a00; box-shadow: 0 3px 0 #8a5300; }
.lien-discret { display: block; margin: 26px auto 10px; background: none; border: 0; color: var(--texte-2);
  text-decoration: underline; cursor: pointer; padding: 10px; }

/* cartes et formulaires */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px;
  box-shadow: var(--ombre); }
.connexion { max-width: 420px; margin: 0 auto; padding: 28px 16px 40px; display: flex; flex-direction: column;
  align-items: center; }
.formulaire { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--texte-2); }
.formulaire input { background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 12px;
  font-size: 16px; color: var(--texte); outline: none; }
.formulaire input:focus { border-color: var(--or); }
.champ-code { font-size: 26px !important; letter-spacing: 8px; text-align: center; }
.etapes { margin: 0; padding-left: 20px; color: var(--texte-2); }
.onglets { display: flex; width: 100%; gap: 4px; background: var(--fond); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.onglet { flex: 1; border: 0; background: none; padding: 10px 4px; border-radius: 9px; font-weight: 700; font-size: 14px;
  color: var(--texte-2); cursor: pointer; }
.onglet.actif { background: var(--carte-2); color: var(--texte); }
.onglets.petits { margin: 0 0 8px; }
.onglets.petits .onglet { font-size: 13px; padding: 8px 2px; }

/* accueil */
.barre-haut { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(29, 26, 36, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord); }
.moi { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--carte-2); border: 2px solid var(--or); }
.pseudo { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.monnaies { display: flex; gap: 8px; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }
.monnaies span { background: var(--carte); border: 1px solid var(--bord); border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.contenu { max-width: 560px; margin: 0 auto; padding: 16px; padding-bottom: 40px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stats div b { display: block; font-size: 20px; color: var(--or); }
.stats div span { font-size: 12px; color: var(--texte-2); }
.titre-section { font-size: 17px; margin: 22px 0 10px; }
.liste-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode { text-align: left; background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; padding: 10px 11px;
  cursor: pointer; width: 100%; min-height: 54px; overflow-wrap: anywhere; }
.mode .fin-mode { font-size: 11px; color: var(--texte-2); margin-top: 3px; }
.texte-mode-choisi { margin-top: 8px; font-size: 13px; color: var(--texte-2); }
.texte-mode-choisi b { color: var(--texte); }
.texte-mode-choisi > b:first-child { display: block; font-size: 14px; margin-bottom: 3px; }   /* 6.06 : seul le titre est à part */
@media (min-width: 600px) { .liste-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .liste-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mode.choisi { border-color: var(--or); background: #3b3426; }
.mode .nom-mode { font-weight: 800; }
.mode .texte-mode { font-size: 13px; color: var(--texte-2); margin-top: 3px; }
.petite-carte { margin-top: 10px; padding: 10px 14px; }
.ligne-select { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.ligne-select select { background: var(--fond); border: 1px solid var(--bord); border-radius: 9px; padding: 8px; max-width: 60%; }
.grille-jouer { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-jouer { border: 0; border-radius: 16px; padding: 16px 6px; color: #fff; font-weight: 800; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; min-height: 104px;
  transition: transform .08s ease; }
.btn-jouer:active { transform: scale(.96); }
.btn-jouer.bot { background: linear-gradient(160deg, #4b7bd6, #2b4b9a); box-shadow: 0 5px 0 #1d3570; }
.btn-jouer.rapide { background: linear-gradient(160deg, #e3a43a, #b26a12); box-shadow: 0 5px 0 #7a480c; }
.btn-jouer.ami { background: linear-gradient(160deg, #3db178, #1f7a4c); box-shadow: 0 5px 0 #145536; }
.emoji-grand { font-size: 32px; line-height: 1; }
.grille-bientot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tuile-bientot { background: var(--carte); border: 1px dashed var(--bord); border-radius: 12px; padding: 12px 4px;
  text-align: center; font-size: 24px; opacity: .6; }
.tuile-bientot span { display: block; font-size: 12px; margin-top: 4px; color: var(--texte-2); }

/* attente */
.gros-code { font-size: 44px; font-weight: 900; letter-spacing: 8px; color: var(--or); background: var(--carte);
  border: 2px dashed var(--or-fonce); border-radius: 14px; padding: 8px 18px; user-select: all; }
.points { display: flex; gap: 8px; margin: 10px 0; }
.points span { width: 10px; height: 10px; border-radius: 50%; background: var(--or); animation: point 1.2s infinite ease-in-out; }
.points span:nth-child(2) { animation-delay: .15s; }
.points span:nth-child(3) { animation-delay: .3s; }
@keyframes point { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }

/* partie */
.partie { max-width: 560px; margin: 0 auto; padding: 8px 10px 96px; padding-top: max(8px, env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px; }
.joueur-barre { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; min-height: 44px; }
.joueur-barre.au-trait { border-color: var(--or); box-shadow: 0 0 0 2px rgba(246, 214, 92, .25); }
.joueur-nom { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.joueur-nom span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pion-couleur { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 2px solid #888; }
.pion-couleur.w { background: #f4f1ea; }
.pion-couleur.b { background: #222; }
.chrono { font-variant-numeric: tabular-nums; font-weight: 800; background: var(--fond); border-radius: 8px; padding: 2px 8px; }
.chrono.urgent { color: #ff7b7b; }
.plateau-zone { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: #28242f; box-shadow: var(--ombre); }
#img-plateau { width: 100%; height: 100%; display: block; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.toucher { position: absolute; pointer-events: none; box-sizing: border-box; border: 4px solid #ffd34d;
  background: rgba(255, 211, 77, .28); border-radius: 6px; box-shadow: 0 0 14px rgba(255, 211, 77, .8); }
.toucher.cache { display: none; }
.badge-anim { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); border-radius: 20px; padding: 3px 10px;
  font-size: 12px; pointer-events: none; }
.tour { font-size: 15px; padding: 2px 4px; }
.consigne { font-size: 14.5px; padding: 11px 13px; }
.consigne:empty { display: none; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puces:empty, .boutons-action:empty { display: none; }
.puce { border: 0; border-radius: 9px; padding: 8px 11px; font-weight: 700; font-size: 14px; color: #fff; cursor: pointer;
  min-height: 38px; }
.puce.bleu { background: var(--bleu); } .puce.vert { background: var(--vert); } .puce.rouge { background: var(--rouge); }
.puce.gris { background: var(--gris); }
.boutons-action { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.boutons-action .btn { width: 100%; font-size: 14px; padding: 10px 8px; }
.journal summary { cursor: pointer; font-weight: 700; }
.journal[open] summary { margin-bottom: 8px; }
.journal { font-size: 14px; padding: 10px 13px; }
.cite { border-left: 3px solid var(--bord); padding-left: 8px; color: var(--texte-2); margin: 2px 0; }
.mode-pied { text-align: center; font-size: 12px; color: var(--texte-2); }
.fin-titre { font-size: 26px; font-weight: 900; text-align: center; margin-bottom: 8px; }
.fin { font-size: 14.5px; }
.fin-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
#btn-analyse { grid-column: 1 / -1; }
#fin-boites img { width: 100%; border-radius: 10px; margin-top: 10px; }
.barre-bas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; gap: 4px;
  background: rgba(29, 26, 36, .95); backdrop-filter: blur(8px); border-top: 1px solid var(--bord);
  padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.barre-bas button { flex: 1; max-width: 180px; background: none; border: 0; display: flex; flex-direction: column;
  align-items: center; font-size: 20px; padding: 4px; border-radius: 10px; cursor: pointer; }
.barre-bas button span { font-size: 12px; color: var(--texte-2); }
.barre-bas button:active { background: var(--carte); }

/* fenêtre */
.fenetre { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: flex; align-items: flex-end;
  justify-content: center; }
.fenetre-boite { background: var(--fond-2); width: 100%; max-width: 560px; max-height: 86vh; max-height: 86dvh; border-radius: 18px 18px 0 0;
  border: 1px solid var(--bord); display: flex; flex-direction: column; padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom)); animation: monte .2s ease-out; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
.fenetre-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fenetre-haut h3 { margin: 0; font-size: 18px; }
.fermer { background: var(--carte); border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.fenetre-corps { overflow-y: auto; font-size: 14.5px; margin-top: 8px; white-space: normal; }
.fenetre-corps pre { white-space: pre-wrap; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; margin: 0; }
.fenetre-boutons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fenetre-boutons:empty { display: none; }
.fenetre-corps .formulaire { margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 30;
  background: #111; border: 1px solid var(--bord); color: #fff; padding: 10px 16px; border-radius: 12px; max-width: 90vw;
  transition: all .25s ease; pointer-events: none; text-align: center; font-size: 14px; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 700px) {
  .fenetre { align-items: center; }
  .fenetre-boite { border-radius: 18px; }
}
@media (max-width: 360px) {
  .monnaies { font-size: 12px; gap: 4px; }
  .btn-jouer { font-size: 12px; min-height: 92px; }
  .stats div b { font-size: 17px; }
}

/* ----- 5.73 : connexion Discord, amis, invitations ----- */
.btn-discord { background: #5865f2; box-shadow: 0 4px 0 #3c45a5; color: #fff; gap: 10px; }
.separateur { display: flex; align-items: center; gap: 10px; width: 100%; margin: 14px 0 10px; color: var(--texte-2);
  font-size: 13px; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--bord); }
.btn-jouer { position: relative; }
.pastille { position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px;
  background: var(--rouge); color: #fff; font-size: 13px; line-height: 22px; font-weight: 800; border: 2px solid #fff; }
.liste-amis { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ami { display: flex; align-items: center; gap: 10px; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 12px; padding: 9px 11px; }
.ami-infos { flex: 1; min-width: 0; }
.ami-nom { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ami-nom small { color: var(--texte-2); font-weight: 600; }
.ami-sous { font-size: 13px; color: var(--texte-2); }
.ami-actions { display: flex; gap: 6px; flex: none; }
.ami-actions .btn { min-height: 38px; padding: 7px 11px; font-size: 14px; }
.point-statut { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #777; }
.point-statut.en_ligne { background: #3ddc84; box-shadow: 0 0 6px #3ddc84; }
.point-statut.en_partie { background: #f0a020; }
.vide { color: var(--texte-2); font-size: 14px; padding: 6px 2px; }
.invitation { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #2f6b4a, #24563c);
  border: 2px solid #3ddc84; border-radius: 14px; padding: 12px; margin-bottom: 12px; animation: monte .25s ease-out; }
.invitation .texte { flex: 1; font-size: 14.5px; }
.invitation .btn { min-height: 40px; padding: 8px 12px; }
#ecran-amis .barre-haut .pseudo { flex: 1; text-align: center; }

/* ----- 5.73 : vrai mode HORIZONTAL (téléphone couché) : plateau à gauche, le reste à droite ----- */
@media (orientation: landscape) and (min-width: 560px) {
  #ecran-partie .partie { max-width: none; margin: 0; padding: 8px 12px 0 calc(100vh - 16px + 26px);
    padding-left: calc(100dvh - 16px + 26px); min-height: 100dvh; }
  #ecran-partie .plateau-zone { position: fixed; left: 12px; top: 8px; width: calc(100vh - 16px); width: calc(100dvh - 16px);
    height: calc(100dvh - 16px); aspect-ratio: auto; }
  #ecran-partie .barre-bas { position: sticky; bottom: 0; left: auto; right: auto; margin: auto -12px 0 -12px; }
  #ecran-partie .barre-bas button { font-size: 18px; padding: 2px; }
  #ecran-partie .joueur-barre { min-height: 38px; padding: 5px 10px; }
  #ecran-partie .boutons-action .btn { min-height: 40px; padding: 8px; }
  .fenetre { align-items: center; }
  .fenetre-boite { border-radius: 18px; max-height: 94dvh; }
  .connexion { max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: start; }
  .connexion > .logo-chessy, .connexion > .titre-jeu, .connexion > .sous-titre { grid-column: 1; justify-self: center; text-align: center; }
  .connexion > :not(.logo-chessy):not(.titre-jeu):not(.sous-titre) { grid-column: 2; }
  .connexion > .logo-chessy { grid-row: 1 / span 2; justify-self: center; }
  .contenu { max-width: 820px; }
}

/* ----- 5.75 : menus (profil, pièces, boutique, Pass…), emotes, fond de saison ----- */
body.avec-fond { background: #1d1a24 var(--fond-saison) center top / cover fixed; }
.grille-menus { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tuile-menu { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 12px 4px;
  font-size: 26px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .08s ease; }
.tuile-menu:active { transform: scale(.96); }
.tuile-menu span { font-size: 13px; color: var(--texte); font-weight: 700; }
.carte-menu { background: var(--carte); border: 1px solid var(--bord); border-left: 5px solid var(--bord);
  border-radius: var(--rayon); padding: 13px 14px; margin-bottom: 12px; font-size: 14.5px; overflow: hidden; }
.carte-menu h3 { margin: 0 0 6px; font-size: 18px; }
.carte-menu .vignette { float: right; width: 72px; height: 72px; margin: 0 0 6px 10px; border-radius: 10px; }
.carte-menu .grande-image { display: block; width: 100%; border-radius: 10px; margin-top: 10px; background: #00000030; }
.carte-menu .champ { margin-top: 10px; clear: both; }
.carte-menu .champ-nom { font-weight: 800; margin-bottom: 2px; }
.carte-menu .pied { color: var(--texte-2); font-size: 12px; margin-top: 8px; }
.message-menu { background: #2c3b2f; border: 1px solid #3ddc84; border-radius: 12px; padding: 10px 12px;
  margin-bottom: 12px; font-size: 14.5px; }
.message-menu.erreur-menu { background: #3b2c2c; border-color: #ff8a8a; }
.zone-choix { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.zone-choix label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 14px; }
.zone-choix select { background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 11px;
  font-size: 15px; color: var(--texte); width: 100%; }
.saisie-menu { display: flex; gap: 6px; margin-top: 4px; }
.saisie-menu input, .saisie-menu textarea { flex: 1; min-width: 0; padding: 9px; border-radius: 10px; border: 1px solid var(--bord);
  background: var(--fond); color: inherit; font: inherit; }
.saisie-menu textarea { min-height: 70px; resize: vertical; }
.multi { background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 6px 10px;
  max-height: 260px; overflow-y: auto; }
.multi label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; padding: 6px 0; }
.multi input { width: 20px; height: 20px; }
.boutons-menu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.boutons-menu .btn { width: 100%; }
.boite { background: var(--carte); border: 2px solid var(--or-fonce); border-radius: var(--rayon); padding: 12px;
  margin-bottom: 14px; }
.boite img { width: 100%; border-radius: 10px; display: block; }
.boite .derniere { font-weight: 800; text-align: center; margin: 8px 0; min-height: 1.4em; }
.boite .boutons-boite { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.chargement { text-align: center; color: var(--texte-2); padding: 40px 0; }
#bulles-emotes { position: absolute; inset: 0; pointer-events: none; }
.bulle-emote { position: absolute; left: 50%; transform: translateX(-50%); width: 42%; max-width: 220px;
  background: rgba(20, 18, 28, .82); border: 2px solid var(--or); border-radius: 16px; padding: 6px; text-align: center;
  animation: monte .25s ease-out; }
.bulle-emote img { width: 100%; display: block; border-radius: 10px; }
.bulle-emote span { font-size: 12px; font-weight: 700; }
.bulle-emote.haut { top: 6%; } .bulle-emote.bas { bottom: 6%; }
/* 6.16 : croix + petite taille */
.bulle-emote { transition: width .2s, max-width .2s; }
.bulle-emote .emote-x, .bulle-emote .emote-taille { pointer-events: auto; }
.bulle-emote .emote-x, .bulle-emote .emote-taille { position: absolute; top: -12px; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--or); background: #1d1a24; color: #fff; font-size: 14px; font-weight: 900; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.bulle-emote .emote-x { right: -12px; } .bulle-emote .emote-taille { left: -12px; }
.bulle-emote.petite { width: 20%; max-width: 100px; left: auto; right: 4%; transform: none; padding: 3px; }
.bulle-emote.petite span { display: none; }
.liste-emotes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.liste-emotes .btn { font-size: 13px; padding: 8px; min-height: 40px; }
.groupe-emotes { grid-column: 1 / -1; font-weight: 800; margin-top: 8px; font-size: 14px; }
@media (orientation: landscape) and (min-width: 560px) {
  .grille-menus { grid-template-columns: repeat(5, 1fr); }
}

/* ----- 5.76 : 1V1V1V1 (4 joueurs) ----- */
.chips4 { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip4 { background: var(--fond); border: 2px solid transparent; border-radius: 20px; padding: 3px 9px; font-size: 13px;
  font-weight: 700; white-space: nowrap; }
.chip4.trait { border-color: var(--or); }
.chip4.elimine { opacity: .45; text-decoration: line-through; }

/* 5.77 : joueur banni */
.bandeau-banni { border: 1px solid #ff6b6b; background: rgba(255, 80, 80, .12); color: #ffd0d0; }
#texte-banni { max-width: 420px; margin: 0 auto 18px; }

/* 5.77 : acheter des gemmes */
.grille-packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.pack-gemmes { position: relative; background: var(--carte); border: 1px solid var(--bord); border-radius: 16px;
  padding: 14px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pack-gemmes .pack-emoji { font-size: 34px; filter: drop-shadow(0 4px 8px rgba(80, 160, 255, .45)); }
.pack-gemmes .pack-nombre { font-size: 22px; font-weight: 800; }
.pack-gemmes .btn { width: 100%; }
.pack-gemmes .bonus { position: absolute; top: 8px; right: 8px; background: #3fb96b; color: #fff; font-size: 11px;
  font-weight: 800; border-radius: 999px; padding: 2px 7px; }
body.achats-actifs .monnaies [title=Gemmes] { cursor: pointer; }
@media (min-width: 700px) { .grille-packs { grid-template-columns: repeat(5, 1fr); } }
#btn-supprimer, a.lien-discret { margin-top: 4px; text-align: center; text-decoration: none; }
.tuile-actu { position: relative; }

/* 5.90 : maintenance, Panel admin, signaler un bug */
.image-maintenance { width: min(100%, 420px); height: auto; margin: 4px auto 6px; display: block; }
.maint-message { background: var(--carte, #2c2738); border-radius: 12px; padding: 10px 14px; }
.maint-fin { font-weight: 800; color: #ffd36b; }
.maint-boutons { display: grid; gap: 8px; width: min(100%, 420px); margin: 10px auto; }
.bandeau-maintenance { background: #6b3a00; color: #ffe2a8; border-radius: 10px; padding: 8px 12px; text-align: center;
  font-weight: 700; margin: 8px 0; }
.tuile-admin { outline: 2px dashed #e0a020; }
.form-bug label { display: block; font-weight: 700; margin: 10px 0 4px; }
.form-bug select, .form-bug textarea { width: 100%; box-sizing: border-box; border-radius: 10px; border: 1px solid #555;
  background: #1d1a24; color: #fff; padding: 10px; font: inherit; }
.form-bug textarea { min-height: 120px; resize: vertical; }

/* 5.91 : paramètres */
.parametres { display: grid; gap: 12px; }
.carte-param { background: var(--carte, #2c2738); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.carte-param h3 { margin: 0 0 2px; font-size: 16px; }
.carte-param .lien-discret { margin: 4px auto; }
.ligne-param { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ligne-param input[type=range] { flex: 1; accent-color: #ffd34d; }

/* 5.93 : tutoriel */
.tuto { display: grid; gap: 10px; }
.tuto-image { width: 100%; max-width: 520px; margin: 0 auto; border-radius: 12px; display: block; box-shadow: var(--ombre); }
.tuto-titre { margin: 6px 0 0; font-size: 21px; text-align: center; }
.tuto-texte { background: var(--carte, #2c2738); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.5; }
.tuto-points { display: flex; justify-content: center; gap: 6px; }
.tuto-points span { width: 9px; height: 9px; border-radius: 50%; background: #555; }
.tuto-points span.actif { background: #ffd34d; }
.tuto-boutons { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }

/* 5.94 : comptes à rebours des modes + teasers */
.chrono-mode { font-size: 11px; font-weight: 800; color: #ffd36b; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.chrono-mode.modif { color: #9fd7ff; }
.chrono-mode.bientot { color: #c9b6ff; }
.mode.teaser { opacity: .8; border-style: dashed; background: repeating-linear-gradient(135deg, var(--carte), var(--carte) 10px, #2f2a3c 10px, #2f2a3c 20px); }
.bientot-texte { background: #3a2f5c; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.btn-jouer:disabled { opacity: .45; filter: grayscale(.7); cursor: default; }

/* ----- 5.95 : TABLETTES (debout) : tout est agrandi pour remplir l'écran, au lieu d'un petit écran de téléphone au milieu ----- */
@media (orientation: portrait) and (min-width: 700px) { html { zoom: 1.3; } }
@media (orientation: portrait) and (min-width: 880px) { html { zoom: 1.55; } }
@media (orientation: portrait) and (min-width: 1100px) { html { zoom: 1.85; } }

/* ----- 5.95 : ancienne appli Android (version 1) : le jeu passait sous la barre du haut (heure) et sous la barre du bas
   (boutons Samsung). On garde une marge en haut et en bas ; la version 1.1 de l'appli règle ça toute seule. ----- */
html.vieille-appli body { position: fixed; top: 30px; bottom: 48px; left: 0; right: 0; height: auto;
  overflow-y: auto; -webkit-overflow-scrolling: touch; transform: translateZ(0); }
html.vieille-appli { overflow: hidden; background: var(--fond); }
html.vieille-appli .ecran { min-height: 100%; }

/* ----- 5.95 : boutique en cartes (onglets + offres à toucher) ----- */
.onglets-menu { margin: 0 0 10px; }
.onglets-menu .onglet { font-weight: 800; }
.section-tuiles { margin: 14px 0 6px; }
.section-tuiles h3 { margin: 0 0 4px; font-size: 17px; }
.sous-tuiles { font-size: 13px; color: var(--texte-2); margin-bottom: 8px; }
.grille-tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .grille-tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grille-tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tuile-offre { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 16px; transition: transform .1s; }
.tuile-offre img { width: 100%; display: block; aspect-ratio: 250 / 330; border-radius: 16px; }
.tuile-offre:active { transform: scale(.96); }
.tuile-offre:disabled { opacity: .6; }

/* ----- 5.95 : maintenance annoncée ----- */
.bandeau-preavis { position: fixed; left: 8px; right: 8px; top: max(8px, env(safe-area-inset-top)); z-index: 40;
  background: linear-gradient(135deg, #f0a020, #d26a10); color: #1d1a24; font-weight: 700; font-size: 15px;
  text-align: center; padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.45); border: 2px solid #1d1a24; }
.bandeau-preavis b { color: #1d1a24; }
.bandeau-preavis span[data-fin] { font-variant-numeric: tabular-nums; background: #1d1a24; color: #ffd34d; border-radius: 8px;
  padding: 1px 8px; margin-left: 4px; }

/* ----- 5.96 : vidéo de présentation ----- */
#ecran-video.actif { display: flex; align-items: center; justify-content: center; background: #07060f; }
.video-boite { position: relative; width: 100%; max-width: 560px; height: 100vh; height: 100dvh; display: flex;
  align-items: center; justify-content: center; }
#video-pres { width: 100%; max-height: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: #07060f; }
.video-boutons { position: absolute; right: 14px; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }

/* ----- 5.96 : vraies jauges de Super / Éveil ----- */
.btn-jauge { grid-column: 1 / -1; position: relative; display: block; width: 100%; min-height: 56px; padding: 0; border: 3px solid #4a4356;
  border-radius: 14px; background: #1d1a24; color: #fff; overflow: hidden; cursor: default; text-align: left; font: inherit; }
.btn-jauge .jauge-fond { position: absolute; inset: 0; }
.btn-jauge .jauge-rempli { position: absolute; left: 0; top: 0; bottom: 0; transition: width .5s ease;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 10px, rgba(255,255,255,0) 10px 20px), linear-gradient(90deg, #c85a00, #ff9a1f); }
.btn-jauge.hyper .jauge-rempli { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 10px, rgba(255,255,255,0) 10px 20px), linear-gradient(90deg, #5a2fc0, #b07bff); }
.btn-jauge .jauge-titre { position: relative; display: block; padding: 8px 70px 0 14px; font-weight: 900; font-size: 15px;
  text-shadow: 0 2px 0 #000, 0 0 6px #000; }
.btn-jauge .jauge-nom { position: relative; display: block; padding: 1px 70px 8px 14px; font-size: 12px; font-weight: 700;
  color: #f1ece4; text-shadow: 0 1px 0 #000, 0 0 5px #000; }
.btn-jauge .jauge-nombre { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 17px;
  font-variant-numeric: tabular-nums; background: rgba(0,0,0,.55); border-radius: 9px; padding: 3px 9px; }
.btn-jauge.super { border-color: #ff9a1f; }
.btn-jauge.hyper { border-color: #9b6bff; }
.btn-jauge.verrou { opacity: .55; border-color: #4a4356; }
.btn-jauge.pret { cursor: pointer; animation: jaugePrete 1s ease-in-out infinite; }
.btn-jauge.super.pret { box-shadow: 0 0 0 3px rgba(255,154,31,.35), 0 0 22px rgba(255,154,31,.75); }
.btn-jauge.hyper.pret { box-shadow: 0 0 0 3px rgba(155,107,255,.35), 0 0 22px rgba(155,107,255,.8); }
.btn-jauge.pret .jauge-rempli { animation: jaugeBrille 1.2s linear infinite; background-size: 28px 28px, 100% 100%; }
.btn-jauge:disabled { cursor: default; }
@keyframes jaugePrete { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes jaugeBrille { from { background-position: 0 0, 0 0; } to { background-position: 28px 0, 0 0; } }
.form-bug textarea { min-height: 54px; }
.ligne-case { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; }
.boutons-menu.compacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.boutons-menu.compacts .btn { min-height: 44px; padding: 8px 4px; font-size: 14px; }
.boutons-menu.compacts .btn:last-child { grid-column: 1 / -1; }
#regarder-img { width: 100%; height: 100%; display: block; }

/* 6.01 : annonce vidéo */
.annonce-video-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px;
  margin-bottom: 12px; cursor: pointer; background: #000; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.annonce-video-texte { font-size: 1.08em; line-height: 1.45; }

/* 6.04 : Chess Pass bien visible sur l'accueil */
.acc-pass { position: relative; display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: inherit; border: 2px solid var(--or-fonce);
  background: linear-gradient(135deg, rgba(246,214,92,.16), rgba(201,154,46,.06)), var(--carte); }
.acc-pass:active { transform: scale(.99); }
.acc-pass-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.acc-pass-haut b { color: var(--or); font-size: 1.05em; }
.acc-pass-barre { display: block; height: 12px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.acc-pass-barre > span { display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--or-fonce), var(--or)); transition: width .4s; }
.acc-pass-bas { font-size: .9em; opacity: .85; }
.acc-pass.a-reclamer { animation: pass-brille 1.6s ease-in-out infinite; }
.acc-pass.a-reclamer .acc-pass-bas { opacity: 1; color: var(--or); font-weight: 700; }
@keyframes pass-brille { 0%, 100% { box-shadow: 0 0 0 0 rgba(246,214,92,.0); } 50% { box-shadow: 0 0 18px 2px rgba(246,214,92,.55); } }
.tuile-pass { position: relative; border-color: var(--or-fonce) !important; }
.acc-pass .pastille { top: -10px; right: -8px; }

/* 6.08 : revoir l'animation du dernier coup */
.btn-revoir-coup { display: block; margin: 6px auto 2px; border: 1px solid var(--bord, rgba(255,255,255,.25));
  background: rgba(0,0,0,.35); color: inherit; border-radius: 20px; padding: 6px 14px; font: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; }
.btn-revoir-coup.cache { display: none; }
.btn-revoir-coup:active { transform: scale(.96); }

/* =====================================================================
   6.09 : NOUVELLE INTERFACE — barre d'onglets en bas, accueil épuré
   ===================================================================== */
.barre-onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px max(6px, calc((100% - 640px) / 2)) max(8px, env(safe-area-inset-bottom));
  background: rgba(20, 17, 26, .97); border-top: 1px solid var(--bord); backdrop-filter: blur(8px); }
.barre-onglets button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: 5px 0 3px; border: 0; background: none; color: var(--texte-2); font-size: 11px; font-weight: 700;
  cursor: pointer; border-radius: 12px; }
.barre-onglets button span:first-of-type { font-size: 9.5px; letter-spacing: -.45px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; }
.barre-onglets svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; }
.barre-onglets button.actif { color: var(--or); font-weight: 800; }
.barre-onglets button.actif::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--or); }
.barre-onglets button:active { transform: scale(.94); }
.pastille-onglet { position: absolute; top: 1px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--rouge); color: #fff; font-size: 10px; line-height: 17px; font-weight: 800;
  border: 2px solid #14111a; }
body.avec-onglets .contenu { padding-bottom: 104px; }
html.vieille-appli .barre-onglets { bottom: 48px; padding-bottom: 8px; }

/* sous-onglets (Collection, Pass, Amis) */
.sous-onglets { position: sticky; top: 61px; z-index: 4; display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px;
  background: rgba(29, 26, 36, .9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--bord); scrollbar-width: none; }
.sous-onglets::-webkit-scrollbar { display: none; }
.sous-onglet { flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--bord); background: var(--carte);
  color: var(--texte-2); font-size: 13px; font-weight: 700; cursor: pointer; }
.sous-onglet.actif { background: var(--or); border-color: var(--or); color: #2a1f05; font-weight: 800; }
.sous-onglets { max-width: none; }

/* haut de l'accueil : on touche son nom → profil ; « + » pour les gemmes */
.barre-accueil .moi { border: 1px solid var(--bord); background: rgba(23, 20, 29, .75); color: inherit; border-radius: 999px;
  padding: 3px 12px 3px 3px; cursor: pointer; text-align: left; font: inherit; }
.barre-accueil .moi:active { transform: scale(.97); }
.moi-texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.barre-accueil .avatar { object-fit: cover; }
.plus-gemmes { margin-left: 5px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--vert); color: #fff;
  font-weight: 900; font-size: 15px; line-height: 20px; padding: 0; cursor: pointer; vertical-align: middle; }

/* actualités : une ligne discrète (point rouge si nouveau) */
.acc-actu { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 14px; padding: 14px 14px; border-radius: 16px;
  border: 2px solid #5a7fd6; background: linear-gradient(135deg, rgba(58, 85, 160, .55), rgba(47, 42, 56, .9));
  color: var(--texte-2); font-size: 15px; text-align: left; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.acc-actu-icone { font-size: 34px; line-height: 1; flex-shrink: 0; }
.acc-actu-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acc-actu-mot { font-weight: 800; color: #9fc0ff; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.acc-actu-texte { color: #fff; font-weight: 700; font-size: 17px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.acc-actu-date { font-size: 12px; color: var(--texte-2); }
.acc-actu.non-lue { border-color: #ff5a5a; box-shadow: 0 0 18px rgba(255, 90, 90, .45); }
.badge-nouveau { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #ff5a5a; color: #fff;
  font-size: 11px; letter-spacing: .04em; vertical-align: 1px; animation: badge-pulse 1.6s ease-in-out infinite; }
.badge-nouveau.cache { display: none; }
@keyframes badge-pulse { 50% { transform: scale(1.1); } }
.point-actu { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255,90,90,.25); }
.fleche { color: var(--texte-2); font-size: 18px; line-height: 1; flex-shrink: 0; }

.acc-evenements { display: flex; flex-direction: column; gap: 8px; }
.acc-evenements .tuile-menu:not(.cache) { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 12px 14px;
  font-size: 22px; margin-top: 10px; border-color: var(--or); }

/* modes : des pastilles qu'on fait glisser + « Comment jouer » */
.titre-modes { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.titre-modes .titre-section { margin: 0; }
.btn-comment-jouer { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--bord);
  background: rgba(23, 20, 29, .75); color: var(--or); font-size: 13px; font-weight: 700; cursor: pointer; }
.rond-aide { width: 18px; height: 18px; border-radius: 50%; background: var(--or); color: #2a1f05; font-size: 12px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center; }
/* 6.10 : modes LISIBLES : des tuiles 2 par ligne (3-4 sur grand écran), tout se voit d'un coup */
#acc-modes.liste-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
@media (min-width: 600px) { #acc-modes.liste-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { #acc-modes.liste-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#acc-modes .mode { display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 64px; padding: 10px 11px;
  background: rgba(47, 42, 56, .95); border: 2px solid var(--bord); border-radius: 14px; overflow-wrap: normal; }
#acc-modes .mode.choisi { border-color: var(--or); background: #3d3527; box-shadow: 0 0 0 3px rgba(246, 214, 92, .18); }
.mode-tete { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mode-emoji { font-size: 24px; line-height: 1; flex-shrink: 0; }
.mode-nom { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; color: #fff; line-height: 1.15; }
.mode-nom small { display: block; font-size: 11px; font-weight: 700; color: var(--texte-2); margin-top: 2px; }
.mode-coche { width: 20px; height: 20px; border-radius: 50%; background: var(--or); color: #2a1f05; font-size: 12px;
  font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mode-modifs { display: flex; flex-wrap: wrap; gap: 4px; }
.etiquette-modif { padding: 2px 7px; border-radius: 999px; background: rgba(124, 77, 214, .35); border: 1px solid #7c4dd6;
  color: #efe6ff; font-size: 11px; font-weight: 700; line-height: 1.5; }
#acc-modes .chrono-mode { font-size: 11px; color: var(--or); font-weight: 700; margin: 0; }
#acc-modes .chrono-mode.modif { color: #c9b3ff; }
.regles-corps { overflow-wrap: anywhere; }
.texte-mode-choisi.replie .regles-corps { max-height: 4.3em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.btn-regles { display: block; margin-top: 4px; padding: 4px 0; border: 0; background: none; color: var(--or); font-size: 13px;
  font-weight: 700; cursor: pointer; }
.btn-regles.cache { display: none; }

/* jouer : un gros bouton principal, les autres en dessous */
.grille-jouer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille-jouer .btn-jouer.principal { grid-column: 1 / -1; order: -1; min-height: 78px; flex-direction: row; gap: 10px;
  font-size: 22px; letter-spacing: .03em; }
.grille-jouer .btn-jouer.rapide.principal { background: linear-gradient(180deg, #ffe17a, #e9b83a); color: #2a1f05;
  box-shadow: 0 5px 0 #a8791f, 0 10px 24px rgba(0, 0, 0, .35); }
.grille-jouer .btn-jouer.principal .emoji-grand { font-size: 26px; }
.grille-jouer .btn-jouer:not(.principal) { min-height: 60px; flex-direction: row; gap: 8px; font-size: 15px; padding: 10px 8px; }
.grille-jouer .btn-jouer:not(.principal) .emoji-grand { font-size: 20px; }
.grille-jouer .btn-jouer.pleine { grid-column: 1 / -1; }
.aide-jouer { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--texte-2); }
.aide-jouer:empty { display: none; }

/* raccourcis : Académie, Débloquer une fusion */
.acc-raccourcis { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.raccourci { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--bord); background: rgba(47, 42, 56, .92); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.raccourci:active { transform: scale(.98); }
.raccourci-emoji { font-size: 26px; flex-shrink: 0; }
.raccourci-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.raccourci-texte b { font-size: 15px; }
.raccourci-texte span { font-size: 12px; color: var(--texte-2); }
.raccourci-fusion { border-color: #7c4dd6; background: linear-gradient(135deg, rgba(124, 77, 214, .28), rgba(47, 42, 56, .92)); }

/* profil : les liens (Mes parties, Comment jouer, Paramètres…) */
.liens-profil { display: flex; flex-direction: column; margin-top: 14px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--bord); background: var(--carte); }
.lien-profil { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--carte-2);
  background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.lien-profil:last-child { border-bottom: 0; }
.lien-profil-emoji { font-size: 20px; width: 26px; text-align: center; }
.lien-profil-texte { flex: 1; display: flex; flex-direction: column; }
.lien-profil-texte span { font-size: 12px; color: var(--texte-2); }

/* fond de saison sur tous les écrans à onglets */
body.avec-fond .barre-haut { background: rgba(29, 26, 36, .78); }

.invisible { visibility: hidden; }

/* 6.12 : en partie, la place de la barre du bas = sa vraie hauteur + une marge (rien n'est caché dessous) */
#ecran-partie .partie { padding-bottom: calc(var(--hauteur-barre-bas, 70px) + 34px); }
#ecran-partie .mode-pied { padding-bottom: 6px; }
html.vieille-appli #ecran-partie .barre-bas { bottom: 48px; }
@media (orientation: landscape) and (min-width: 560px) { #ecran-partie .partie { padding-bottom: 0; } }

/* 6.14 : victoires du jour + Jour de Chance sur l'accueil */
.acc-chance { margin: 0 0 12px; padding: 14px 16px; border-radius: 16px; text-align: center; color: #1d2a12;
  background: linear-gradient(135deg, #b8f070, #f6d65c 55%, #7fe0a0); box-shadow: 0 6px 22px rgba(160, 230, 90, .35);
  animation: chance-pulse 1.8s ease-in-out infinite; }
.chance-titre { font-size: 24px; font-weight: 900; letter-spacing: .04em; }
.chance-texte { font-size: 13px; font-weight: 700; margin-top: 4px; }
@keyframes chance-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.acc-quotidien { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--bord);
  background: rgba(47, 42, 56, .92); }
.acc-quotidien.chance { border: 2px solid #9be36a; }
.quotidien-haut { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.quotidien-haut span { color: var(--texte-2); font-weight: 700; }
.quotidien-pas { display: flex; gap: 6px; margin: 9px 0 7px; flex-wrap: wrap; }
.pas-quotidien { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: var(--carte-2); color: var(--texte-2); border: 2px solid var(--bord); }
.pas-quotidien.fait { background: var(--vert); color: #fff; border-color: var(--vert); }
.pas-quotidien.prochain { border-color: var(--or); color: var(--or); box-shadow: 0 0 0 3px rgba(246, 214, 92, .2); }
.quotidien-bas { font-size: 13px; color: var(--texte-2); }
.quotidien-bas b { color: #fff; }
/* 6.14 : haut de l'accueil compact (les monnaies ne passent plus sur 2 lignes) ; cartes du jour plus compactes */
.barre-accueil { gap: 8px; }
.barre-accueil .moi { flex-shrink: 1; min-width: 0; }
.barre-accueil .monnaies { flex-wrap: nowrap; gap: 5px; font-size: 13px; flex-shrink: 0; }
.barre-accueil .monnaies span { padding: 3px 7px; }
.acc-chance { padding: 10px 14px; }
.chance-titre { font-size: 20px; }
.chance-texte { font-size: 12px; }
.acc-quotidien { padding: 10px 12px; }
.quotidien-pas { margin: 7px 0 5px; }
.pas-quotidien { width: 26px; height: 26px; font-size: 12px; }

/* 6.15 : la box fermée attend qu'on la touche */
.boite img.box-fermee { cursor: pointer; animation: box-attend 1.6s ease-in-out infinite; }
@keyframes box-attend { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }

/* 6.15 : Panel admin bien visible sur l'accueil (admins seulement) */
.acc-admin { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px;
  border: 2px dashed var(--or); background: rgba(246, 214, 92, .1); color: var(--or); font-size: 15px; text-align: left; cursor: pointer; }
.acc-admin b { color: var(--or); }
.acc-admin span:not(.fleche) { flex: 1; font-size: 12px; color: var(--texte-2); }
.onglets-menu:empty { display: none; }


/* ----- 6.19 : MODE HISTOIRE ----- */
.acc-histoire { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin: 10px 0 4px;
  padding: 16px 16px 14px; border-radius: 16px; border: 2px solid var(--or); color: #fff; text-align: left; cursor: pointer; overflow: hidden;
  background: linear-gradient(90deg, rgba(20,10,40,.92) 30%, rgba(20,10,40,.35)), url("/web/histoire/palais_cour.webp") center / cover; }
.acc-histoire-titre { font-size: 21px; font-weight: 900; text-shadow: 0 2px 6px #000; }
.acc-histoire-sous { font-size: 13px; color: #e9dcff; }
.acc-histoire-etoiles { font-size: 13px; color: var(--or); font-weight: 800; margin-top: 4px; }
.acc-histoire-badge { position: absolute; top: 10px; right: 10px; background: #d23737; color: #fff; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 999px; }
#ecran-histoire { background: #160f24; }
.histoire-entete { display: flex; justify-content: space-between; padding: 6px 16px; color: #e9dcff; font-size: 13px; }
.histoire-entete b { color: var(--or); }
.histoire-carte-zone { overflow-y: auto; height: calc(100vh - 110px); height: calc(100dvh - 110px); }
.histoire-carte { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 720 / 1560;
  background: url("/web/histoire/carte.webp") center / 100% 100% no-repeat; }
.noeud-histoire { position: absolute; transform: translate(-50%, -50%); width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: #fff; cursor: pointer; padding: 0; }
.noeud-rond { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900;
  background: radial-gradient(circle at 35% 30%, #ffe58a, #c99a2e); color: #2a1f05; border: 4px solid #fff3c4; box-shadow: 0 4px 10px rgba(0,0,0,.6); }
.noeud-histoire.ferme .noeud-rond { background: #4b4558; color: #aaa3b8; border-color: #6d6577; }
.noeud-histoire.fini .noeud-rond { background: radial-gradient(circle at 35% 30%, #b98cff, #6b46c8); color: #fff; border-color: #e3d4ff; }
.noeud-histoire.actuel .noeud-rond { animation: pulse-noeud 1.4s ease-in-out infinite; }
@keyframes pulse-noeud { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,90,.8); } 50% { box-shadow: 0 0 0 14px rgba(255,215,90,0); } }
.noeud-etoiles { font-size: 13px; letter-spacing: -1px; text-shadow: 0 1px 3px #000; }
.noeud-titre { font-size: 10.5px; font-weight: 800; text-align: center; text-shadow: 0 1px 3px #000, 0 0 6px #000; line-height: 1.1; width: 110px; }
.defis-histoire { list-style: none; padding: 0; margin: 8px 0; }
.defis-histoire li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.choix-genre { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.choix-genre button.actif { outline: 3px solid var(--or); }
.scene-histoire, .video-histoire { position: fixed; inset: 0; z-index: 40; background: #000; overflow: hidden; user-select: none; -webkit-user-select: none; }
.scene-fond { position: absolute; inset: 0; background: #000 center / cover no-repeat; transition: filter .4s; }
.scene-histoire.souvenir .scene-fond { filter: sepia(.4) contrast(.95); }
.scene-souvenir { position: absolute; top: 14px; left: 14px; padding: 4px 10px; border: 1px solid #f0d8a8; color: #f0d8a8; font-size: 12px; letter-spacing: 3px; border-radius: 4px; background: rgba(0,0,0,.4); }
.scene-perso { position: absolute; bottom: 150px; width: min(52vw, 300px); max-height: 55vh; object-fit: contain; transition: transform .25s, filter .25s, opacity .25s;
  filter: brightness(.5) saturate(.6); opacity: 0; }
.scene-perso.gauche { left: -4%; } .scene-perso.droite { right: -4%; }
.scene-perso.visible { opacity: 1; }
.scene-perso.parle { filter: none; transform: scale(1.06); z-index: 2; }
.scene-bulle { position: absolute; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); min-height: 120px; padding: 14px 16px 22px; border-radius: 16px;
  background: rgba(16,10,28,.92); border: 2px solid var(--or); color: #fff; font-size: 16.5px; line-height: 1.4; z-index: 3; }
.scene-bulle.narration { border-color: #8a7cb0; font-style: italic; color: #e9dcff; }
.scene-nom { position: absolute; top: -14px; left: 14px; background: var(--or); color: #2a1f05; font-weight: 900; font-size: 13px; padding: 3px 12px; border-radius: 999px; }
.scene-nom:empty { display: none; }
.scene-suite { position: absolute; right: 14px; bottom: 6px; color: var(--or); font-size: 12px; animation: monte .8s ease-in-out infinite alternate; }
.scene-passer { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 5; background: rgba(0,0,0,.55); color: #fff; border: 1px solid #fff6;
  border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 13px; }
.scene-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 4; }
.scene-flash.flash { animation: flash-scene .7s ease-out; background: #fff; }
.scene-flash.violet { animation: flash-scene 1s ease-out; background: radial-gradient(circle, #fff 0%, #b47cff 40%, rgba(80,30,160,0) 80%); }
@keyframes flash-scene { 0% { opacity: 1; } 100% { opacity: 0; } }
.scene-histoire.secousse { animation: secousse .5s linear; }
@keyframes secousse { 0%, 100% { transform: none; } 20% { transform: translate(-8px, 4px); } 40% { transform: translate(8px, -4px); } 60% { transform: translate(-6px, -2px); } 80% { transform: translate(6px, 2px); } }
.video-histoire video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.livre-page { border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); padding: 10px; margin-bottom: 10px; }
.livre-page h4 { margin: 0 0 6px; color: var(--or); }
.livre-page img { width: 100%; border-radius: 10px; display: block; }
.livre-page img.portrait { width: 120px; float: left; margin-right: 10px; }
.livre-page::after { content: ""; display: block; clear: both; }
.livre-page.fermee { opacity: .55; }
#histoire-titre { font-size: 18px; white-space: nowrap; margin: 0; }

/* 6.21 : bouton Classement à côté du Livre (Mode Histoire) */
.histoire-boutons-haut { display: flex; gap: 6px; align-items: center; }

/* 6.25 : chapitres à venir (/admin_chapitre) et chapitre fermé sur l'accueil */
.histoire-autres { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 8px; }
.chapitre-a-venir { background: rgba(20, 14, 34, .82); border: 1px dashed rgba(246, 214, 92, .55); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; color: #e9dcff; }
.acc-histoire.ferme { filter: grayscale(.6) brightness(.85); }

/* 6.29 : onglets des chapitres du Mode Histoire (Chapitre 1 / Chapitre 2) */
.histoire-onglets { display: flex; gap: 6px; padding: 0 12px 8px; }
.histoire-onglets button { flex: 1; padding: 7px 6px; border-radius: 10px; border: 1px solid rgba(246, 214, 92, .45);
  background: rgba(20, 14, 34, .82); color: #e9dcff; font-weight: 700; font-size: 14px; cursor: pointer; }
.histoire-onglets button.actif { background: linear-gradient(#f6d65c, #d9a82a); color: #2a1a05; border-color: #f6d65c; }
.histoire-carte.chapitre-2 { background-image: url(/web/histoire/carte2.webp), url(/web/histoire/carte.webp); }
.histoire-carte.chapitre-3 { background-image: url(/web/histoire/carte3.webp), url(/web/histoire/carte.webp); }
.histoire-carte.chapitre-4 { background-image: url(/web/histoire/carte4.webp), url(/web/histoire/carte.webp); }
.histoire-carte.chapitre-5 { background-image: url(/web/histoire/carte5.webp), url(/web/histoire/carte.webp); }
.histoire-carte.chapitre-6 { background-image: url(/web/histoire/carte6.webp), url(/web/histoire/carte.webp); }
#ecran-histoire:has(.histoire-onglets:not(.cache)) .histoire-carte-zone { height: calc(100vh - 156px); height: calc(100dvh - 156px); }

/* 6.32 : histoire secrète : le téléphone de Gamusique (caché dans la scène) et l'écharpe sur la carte */
.scene-secret { position: absolute; right: 27%; bottom: 21%; z-index: 4; font-size: 30px; background: none; border: none;
  padding: 6px; cursor: pointer; opacity: .55; animation: secret-pulse 1.6s ease-in-out infinite; }
@keyframes secret-pulse { 0%, 100% { transform: scale(1) rotate(-8deg); opacity: .4; } 50% { transform: scale(1.12) rotate(6deg); opacity: .8; } }
.noeud-secret { position: absolute; transform: translate(-50%, -50%); background: rgba(20, 8, 12, .7); border: 2px solid #c8303c;
  border-radius: 50%; width: 46px; height: 46px; font-size: 24px; cursor: pointer; box-shadow: 0 0 14px #c8303c;
  animation: secret-pulse 2s ease-in-out infinite; }
.noeud-secret.fait { border-color: #f6d65c; box-shadow: 0 0 10px #f6d65c; animation: none; }

/* 6.33 : outils du compte TEST (maintenance) dans le Mode Histoire */
.histoire-test { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 0 12px 8px; font-size: 13px; color: #ffd6a0; }
.histoire-test.cache { display: none; }
#ecran-histoire:has(.histoire-test:not(.cache)) .histoire-carte-zone { height: calc(100dvh - 200px); }

/* 6.37 : Atelier de la communauté (Map Maker + vote) */
.atelier { padding: 0 12px 90px; max-width: 560px; margin: 0 auto; }
.atelier-onglets { display: flex; gap: 6px; padding: 8px 12px; max-width: 560px; margin: 0 auto; }
.atelier-onglets button { flex: 1; padding: 8px; border-radius: 10px; border: 1px solid rgba(246, 214, 92, .45);
  background: rgba(20, 14, 34, .82); color: #e9dcff; font-weight: 700; cursor: pointer; }
.atelier-onglets button.actif { background: linear-gradient(#f6d65c, #d9a82a); color: #2a1a05; }
.carte-map { background: rgba(20, 14, 34, .85); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  padding: 10px; margin: 8px 0; display: flex; gap: 12px; align-items: center; }
.carte-map.choisie { border-color: #f6d65c; box-shadow: 0 0 10px rgba(246, 214, 92, .5); }
.carte-map .infos { flex: 1; min-width: 0; }
.carte-map .infos b { display: block; }
.carte-map .boutons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mini-map { display: grid; grid-template-columns: repeat(8, 1fr); width: 88px; height: 88px; flex: none;
  border: 2px solid #3a2c48; border-radius: 4px; overflow: hidden; }
.mini-map i { display: block; }
.case-c { background: #eed8b4; } .case-f { background: #b07c55; } .case-t { background: #16141e; } .case-r { background: #f6d65c; }
.editeur-map { display: grid; grid-template-columns: repeat(8, 1fr); width: min(92vw, 420px); aspect-ratio: 1;
  margin: 10px auto; border: 3px solid #3a2c48; border-radius: 6px; overflow: hidden; touch-action: manipulation; }
.editeur-map button { border: none; padding: 0; cursor: pointer; font-size: 18px; }
.editeur-map button.case-r { cursor: not-allowed; }
.atelier .aide { font-size: 13px; color: #cfc3e6; }
.atelier input.nom-map { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #555; background: #1a1424; color: #fff; }

/* 6.38 : Skin Maker (onglet « Skins » de l'Atelier) */
.skm-ev { background: linear-gradient(135deg, rgba(120, 60, 200, .55), rgba(30, 20, 60, .9)); border: 1px solid rgba(246, 214, 92, .5);
  border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.skm-ev b { color: #f6d65c; font-size: 16px; }
.skm-ev .petit { display: block; margin-top: 3px; }
.skm-regles { background: rgba(80, 20, 30, .45); border: 1px solid rgba(255, 120, 120, .35); border-radius: 10px;
  padding: 6px 10px; margin: 8px 0; font-size: 13px; }
.skm-regles summary { cursor: pointer; font-weight: 700; color: #ffd0d0; }
.skm-regles li { margin: 3px 0; }
.skm-apercu { width: 124px; height: 62px; flex: none; border-radius: 6px; image-rendering: auto; background: #2a2236; }
.skm-grand { width: min(92vw, 360px); height: auto; aspect-ratio: 2 / 1; display: block; margin: 8px auto; border-radius: 8px; }
.skm-titre { margin: 14px 0 4px; font-size: 15px; color: #f6d65c; }
.skm-ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.atelier select, .atelier input[type=file] { padding: 7px; border-radius: 8px; border: 1px solid #555; background: #1a1424; color: #fff; max-width: 100%; }
.skm-choix-img { width: 140px; height: 140px; object-fit: contain; display: block; margin: 8px auto;
  background: repeating-conic-gradient(#3a3348 0 25%, #2a2436 0 50%) 0 0 / 20px 20px; border-radius: 8px; }
.skm-certif { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 8px 0; }
.atelier .vide { text-align: center; padding: 14px; color: #bdb1d6; }

/* 6.44 : bulle des répliques des personnages pendant un combat */
.voix { position: relative; margin: 8px 0 4px; padding: 9px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.35;
  background: #fffaf0; color: #2a2033; border: 2px solid #2a2033; box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  animation: voix-arrive .25s ease-out; }
.voix::before { content: ""; position: absolute; top: -10px; left: 26px; border: 8px solid transparent;
  border-bottom-color: #2a2033; border-top: 0; }
.voix p { margin: 2px 0; }
.voix strong { color: #6a2a8a; }
@keyframes voix-arrive { from { transform: translateY(-4px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* 6.45 : l'icône principale d'un ami, à côté de son statut */
.ami-icone { width: 38px; height: 38px; border-radius: 50%; flex: none; margin-right: 8px; object-fit: cover; }

/* 6.45 : fenêtre des emotes (onglets, recherche, favoris, phrases, automatiques) */
.em-recherche { width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid #555; background: #1a1424; color: #fff; margin-bottom: 8px; box-sizing: border-box; }
.em-onglets { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; scrollbar-width: thin; }
.em-onglets button { flex: none; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(246, 214, 92, .45);
  background: rgba(20, 14, 34, .82); color: #e9dcff; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.em-onglets button.actif { background: linear-gradient(#f6d65c, #d9a82a); color: #2a1a05; }
.em-corps { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.emote-ligne { display: flex; gap: 6px; align-items: center; }
.emote-ligne .btn { flex: 1; text-align: left; }
.emote-etoile { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #555; background: #1a1424; color: #bbb; font-size: 20px; cursor: pointer; flex: none; }
.emote-etoile.on { color: #f6d65c; border-color: #f6d65c; }
.em-corps .phrase { text-align: left; }
.emote-auto { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: #e9dcff; }
.em-par-piece { align-self: flex-start; margin: -2px 0 6px; padding: 5px 10px; font-size: 12px; }
.em-pieces { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px 12px; padding-left: 10px; border-left: 3px solid #6c4bb8; }
.emote-auto.petit { font-size: 12px; color: #cdbdf2; }
.emote-auto select { padding: 7px; border-radius: 8px; border: 1px solid #555; background: #1a1424; color: #fff; }
.em-muet { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 10px; color: #cfc3e6; }
.bulle-phrase { display: block; padding: 8px 12px; font-weight: 800; font-size: 15px; }

/* 6.54 : écran de l'âge (PEGI), par-dessus tout, impossible à fermer */
.ecran-age { position: fixed; inset: 0; z-index: 9999; background: rgba(12, 8, 24, 0.96); display: flex;
  align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.age-boite { background: #241f33; border: 3px solid #ffd36b; border-radius: 18px; padding: 18px; max-width: 420px;
  width: 100%; color: #ece8f3; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.age-titre { font-size: 22px; font-weight: 800; color: #ffd36b; text-align: center; margin-bottom: 8px; }
.age-texte { font-size: 14px; line-height: 1.45; margin: 0 0 12px; }
.age-ligne { display: flex; gap: 10px; margin-bottom: 12px; }
.age-ligne select { flex: 1; font-size: 17px; padding: 10px; border-radius: 10px; border: 2px solid #5a5070;
  background: #1a1626; color: #fff; }
.age-case { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; margin-bottom: 10px;
  background: #1a1626; border-radius: 10px; padding: 10px; }
.age-case input { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.age-erreur { color: #ff7a7a; font-size: 14px; min-height: 18px; margin-bottom: 8px; text-align: center; }
.age-boite .btn { width: 100%; }

/* 6.57 : Emote & Icône Maker + signalements */
.atelier-onglets { flex-wrap: wrap; }
.atelier-onglets button { min-width: calc(50% - 3px); }
img.mini-emi { width: 72px; height: 72px; flex: none; image-rendering: pixelated; background: repeating-conic-gradient(#2a2238 0 25%, #221b2e 0 50%) 0 0 / 18px 18px;
  border: 2px solid #3a2c48; border-radius: 8px; }
.emi-sortes { display: flex; gap: 6px; margin: 8px 0; }
.emi-grille { display: grid; width: min(92vw, 400px); aspect-ratio: 1; margin: 8px auto; touch-action: none; user-select: none;
  border: 3px solid #3a2c48; border-radius: 6px; overflow: hidden;
  background: repeating-conic-gradient(#3a3248 0 25%, #2e2740 0 50%) 0 0 / 12.5% 12.5%; }
.emi-grille i { display: block; border: 1px solid rgba(255, 255, 255, .05); }
.emi-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; max-width: 400px; margin: 6px auto; }
.emi-palette button { aspect-ratio: 1; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .25); background: #2a2238; cursor: pointer; font-size: 18px; }
.emi-palette button.actif { border-color: #f6d65c; box-shadow: 0 0 8px rgba(246, 214, 92, .8); transform: scale(1.08); }
.sig-champ { display: block; width: 100%; margin-top: 4px; padding: 8px; border-radius: 8px; border: 1px solid #555; background: #1a1424; color: #fff; font: inherit; }

/* 6.58 : sortie du Chapitre 2 (affiche en fond de l'accueil, annonce) + écran de chargement */
#ecran-accueil.fond-chapitre2 { background: linear-gradient(rgba(14, 8, 20, .05), rgba(10, 6, 16, .35) 45%, rgba(10, 6, 16, .7)),
  url("/web/histoire/affiche_chapitre2_fond.webp") center top / 100% auto no-repeat, #0d0a12; }
#ecran-accueil.fond-chapitre2 #acc-histoire { background: linear-gradient(90deg, rgba(24, 6, 14, .7), rgba(24, 6, 14, 0) 70%),
  url("/web/histoire/affiche_chapitre2_bandeau.webp") right center / cover no-repeat; border-color: #ff5a5a;
  box-shadow: 0 0 18px rgba(255, 60, 60, .45); }
#ecran-accueil.fond-chapitre3 { background: linear-gradient(rgba(14, 8, 20, .05), rgba(10, 6, 16, .35) 45%, rgba(10, 6, 16, .7)),
  url("/web/histoire/affiche_chapitre3_fond.webp") center top / 100% auto no-repeat, #0d0a12; }
#ecran-accueil.fond-chapitre3 #acc-histoire { background: linear-gradient(90deg, rgba(20, 6, 34, .7), rgba(20, 6, 34, 0) 70%),
  url("/web/histoire/affiche_chapitre3_bandeau.webp") right center / cover no-repeat; border-color: #b47cff;
  box-shadow: 0 0 18px rgba(180, 100, 255, .5); }
.acc-affiche.chapitre3 { background-image: url("/web/histoire/affiche_chapitre3_banniere.webp"); }
/* 6.63 : sortie du chapitre 4 (affiche noire et violette) */
#ecran-accueil.fond-chapitre4 { background: linear-gradient(rgba(8, 6, 14, .05), rgba(6, 4, 12, .35) 45%, rgba(6, 4, 12, .7)),
  url("/web/histoire/affiche_chapitre4_fond.webp") center top / 100% auto no-repeat, #08060c; }
#ecran-accueil.fond-chapitre4 #acc-histoire { background: linear-gradient(90deg, rgba(10, 4, 20, .75), rgba(10, 4, 20, 0) 70%),
  url("/web/histoire/affiche_chapitre4_bandeau.webp") right center / cover no-repeat; border-color: #b45cff;
  box-shadow: 0 0 18px rgba(180, 92, 255, .45); }
.acc-affiche.chapitre4 { background-image: url("/web/histoire/affiche_chapitre4_banniere.webp"); border-color: #b45cff;
  box-shadow: 0 0 22px rgba(180, 92, 255, .5); }
/* 6.64 : sortie du chapitre 5 (affiche grise, rouge et or) */
#ecran-accueil.fond-chapitre5 { background: linear-gradient(rgba(12, 8, 12, .05), rgba(10, 6, 10, .35) 45%, rgba(10, 6, 10, .7)),
  url("/web/histoire/affiche_chapitre5_fond.webp") center top / 100% auto no-repeat, #0c080c; }
#ecran-accueil.fond-chapitre5 #acc-histoire { background: linear-gradient(90deg, rgba(24, 4, 10, .75), rgba(24, 4, 10, 0) 70%),
  url("/web/histoire/affiche_chapitre5_bandeau.webp") right center / cover no-repeat; border-color: #ff3a4a;
  box-shadow: 0 0 18px rgba(255, 58, 74, .45); }
.acc-affiche.chapitre5 { background-image: url("/web/histoire/affiche_chapitre5_banniere.webp"); border-color: #ff3a4a;
  box-shadow: 0 0 22px rgba(255, 58, 74, .5); }
/* 6.65 : sortie du chapitre 6 (affiche violette et or : le visage de Myzel) */
#ecran-accueil.fond-chapitre6 { background: linear-gradient(rgba(10, 4, 18, .05), rgba(8, 4, 14, .35) 45%, rgba(8, 4, 14, .7)),
  url("/web/histoire/affiche_chapitre6_fond.webp") center top / 100% auto no-repeat, #08040e; }
#ecran-accueil.fond-chapitre6 #acc-histoire { background: linear-gradient(90deg, rgba(18, 4, 30, .75), rgba(18, 4, 30, 0) 70%),
  url("/web/histoire/affiche_chapitre6_bandeau.webp") right center / cover no-repeat; border-color: #b45cff;
  box-shadow: 0 0 18px rgba(180, 92, 255, .5); }
.acc-affiche.chapitre6 { background-image: url("/web/histoire/affiche_chapitre6_banniere.webp"); border-color: #f6c945;
  box-shadow: 0 0 22px rgba(180, 92, 255, .55); }
img.affiche-annonce { display: block; width: 100%; max-width: 360px; margin: 0 auto 10px; border-radius: 14px;
  box-shadow: 0 0 24px rgba(255, 50, 50, .45); }
.chargement { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 40%, #3a2350, #1d1a24 70%); transition: opacity .45s; }
.chargement.parti { opacity: 0; pointer-events: none; }
.chargement-logo { width: 120px; height: 120px; border-radius: 28px; animation: chargement-pulse 1.4s ease-in-out infinite; }
.chargement-titre { font-size: 40px; font-weight: 800; color: #f6d65c; text-shadow: 0 3px 0 #6b3fa0; }
.chargement-sous { color: #d8cfe6; font-size: 16px; margin-top: -6px; }
.chargement-barre { width: min(70vw, 280px); height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .12);
  overflow: hidden; margin-top: 14px; }
.chargement-barre i { display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, #9b59d6, #f6d65c); animation: chargement-barre 2.4s ease-out forwards; }
.chargement-astuce { color: #b9aecb; font-size: 14px; max-width: 300px; margin-top: 8px; min-height: 40px; }
@keyframes chargement-pulse { 50% { transform: scale(1.07) rotate(-3deg); } }
@keyframes chargement-barre { to { width: 100%; } }
.acc-affiche { position: relative; display: block; width: 100%; aspect-ratio: 1080 / 740; margin: 0 0 12px; padding: 0;
  border: 2px solid #ff5a5a; border-radius: 16px; cursor: pointer; overflow: hidden;
  background: url("/web/histoire/affiche_chapitre2_banniere.webp") center / cover no-repeat, #120a14;
  box-shadow: 0 0 22px rgba(255, 60, 60, .5); animation: affiche-lueur 2.6s ease-in-out infinite; }
.acc-affiche-bouton { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 7px 16px;
  border-radius: 999px; background: #e8413b; color: #fff; font-weight: 800; font-size: 15px; white-space: nowrap;
  box-shadow: 0 3px 0 #8a1d1d; }
@keyframes affiche-lueur { 50% { box-shadow: 0 0 34px rgba(255, 60, 60, .8); } }
.noeud-secret.ferme { opacity: .45; animation: none; filter: grayscale(1); }

/* 6.69 : choix de la langue (1er lancement + Paramètres) */
.choix-langue { display: flex; gap: 8px; }
.choix-langue .btn { flex: 1; }
.choix-langue .btn.actif { background: #6b3fa0; color: #fff; box-shadow: 0 0 0 3px #f6d65c inset; }
.ecran-langue { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 40%, #3a2350, #1d1a24 70%); color: #fff; }
.ecran-langue h2 { margin: 0; font-size: 26px; color: #f6d65c; }
.ecran-langue p { margin: 0; color: #d8cfe6; }
.ecran-langue button { width: min(80vw, 300px); padding: 18px; font-size: 22px; font-weight: 800; border: 0; border-radius: 16px;
  background: #fff; color: #2a1d44; cursor: pointer; box-shadow: 0 6px 0 #6b3fa0; }

/* 6.73 : vue 1re personne : les flèches pour bouger sont petites (4 par ligne), pour que tout tienne sur un téléphone */
#zone-boutons .btn-aller { flex: 0 0 calc(25% - 8px); min-height: 44px; padding: 4px; font-size: 22px; }
#zone-boutons:has(.btn-aller) { display: flex; flex-wrap: wrap; gap: 8px; }
/* 6.73 : vue 1re personne sur téléphone (debout) : le plateau rétrécit un peu pour que TOUT tienne sur l'écran, sans défiler */
@media (orientation: portrait) {
  body.vue-pov #ecran-partie .plateau-zone { width: min(100%, calc(100dvh - 360px)); margin-left: auto; margin-right: auto; }
}
/* 6.74 : Mode Histoire sur téléphone : les 6 onglets de chapitres ne doivent jamais rendre la page plus large que l'écran */
.histoire-onglets { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; box-sizing: border-box; }
.histoire-onglets button { min-width: 0; flex: 1 1 0; white-space: nowrap; font-size: 13px; padding: 7px 4px; }
#ecran-histoire { max-width: 100vw; overflow-x: hidden; }

/* 6.87 : bandeau Black Friday */
.bandeau-promo { position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 39;
  background: linear-gradient(90deg, #111116, #2a1020); color: #fff; border: 2px solid #ffcd3c; border-radius: 12px;
  padding: 8px 34px 8px 12px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.5); cursor: pointer; }
.bandeau-promo b { color: #ffcd3c; }
.bandeau-promo span[data-fin] { font-variant-numeric: tabular-nums; background: #ff3c5a; color: #fff; border-radius: 8px; padding: 0 6px; }
.bandeau-promo .promo-x { position: absolute; right: 6px; top: 6px; background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; }

/* 6.94 : Boîte de réception (raccourci de l'accueil, visible seulement s'il y a un cadeau) */
.raccourci-boite { position: relative; border-color: #3ddc84 !important; animation: chance-pulse 1.8s ease-in-out infinite; }
.raccourci-boite .pastille { top: -8px; right: -6px; }
