@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(polices/fredoka-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(polices/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --texte: #fff;
  --doux: rgba(255, 255, 255, 0.68);
  --verre: rgba(14, 20, 40, 0.55);
  --verre-fort: rgba(12, 17, 34, 0.78);
  --bord: rgba(255, 255, 255, 0.14);
  --chaud: linear-gradient(135deg, #ffb340 0%, #ff6a3d 48%, #ff3d77 100%);
  --mer: #2ee6d6;
  --ombre: 0 24px 60px rgba(0, 0, 0, 0.45);
  --rayon: 22px;
  --police: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: #0b1020;
  color: var(--texte);
  font-family: var(--police);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
/* tactile : pas de zoom au double appui ni de flash gris sur les boutons */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }

/* Plage floue en fond de page, pour habiller les bords */
#fond {
  position: fixed;
  inset: -10%;
  background: url(backgrounds/strand2.bmp) center / cover;
  filter: blur(40px) brightness(0.42) saturate(1.3);
  transition: background-image 0.4s;
}
body.stade #fond { background-image: url(backgrounds/strand1.bmp); }

/* ---------- Terrain ---------- */
#scene {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100vh * var(--ratio, 1.3333)));
  height: min(100vh, calc(100vw / var(--ratio, 1.3333)));
  translate: -50% -50%;
  container-type: size;
  /* unité du tableau de score : 1 % de la largeur d'un terrain 4:3 de même hauteur */
  --u: 1.3333cqh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
@media (max-aspect-ratio: 4/3) and (max-width: 820px), (max-height: 620px) {
  #scene { border-radius: 0; }
}

#ecran {
  display: block;
  width: 100%;
  height: 100%;
  transition: filter 0.5s ease, transform 0.6s ease;
}
#scene.floute #ecran {
  filter: blur(7px) brightness(0.55) saturate(1.25);
  transform: scale(1.06);
}
#scene.en-jeu, body.classique #scene { cursor: none; }
body.classique #ui, body.classique #hud { display: none !important; }

/* ---------- Tableau de score ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }

.tableau {
  position: absolute;
  top: 2.2cqh;
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: calc(1.6 * var(--u));
  padding: 0.7cqh calc(0.9 * var(--u));
  border-radius: 999px;
  background: var(--verre);
  border: 1px solid var(--bord);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.tableau .joueur {
  display: flex;
  align-items: center;
  gap: calc(0.8 * var(--u));
  font-size: calc(1.95 * var(--u));
  font-weight: 600;
  width: calc(21 * var(--u));
  padding: 0 calc(0.8 * var(--u));
}
.tableau .joueur.d { justify-content: flex-end; }
.tableau .nom { overflow: hidden; text-overflow: ellipsis; }
.pastille {
  flex: none;
  width: calc(1.5 * var(--u));
  height: calc(1.5 * var(--u));
  border-radius: 50%;
  background: var(--couleur, #fff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 14px var(--couleur, #fff);
}
.pastille.arc-en-ciel, .nuance.arc-en-ciel {
  background: conic-gradient(#ff3d3d, #ffd23d, #3dff6a, #3dd8ff, #6a3dff, #ff3dd2, #ff3d3d);
}
.scores {
  display: flex;
  align-items: center;
  gap: calc(0.9 * var(--u));
  padding: 0.3cqh calc(1.6 * var(--u));
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}
.score {
  font-size: calc(4.4 * var(--u));
  font-weight: 700;
  line-height: 1.1;
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.score.pop { animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.55); color: #ffd23f; text-shadow: 0 0 22px #ffb340; }
  100% { transform: scale(1); }
}
.sep { width: calc(0.5 * var(--u)); height: calc(0.5 * var(--u)); border-radius: 50%; background: var(--doux); box-shadow: 0 calc(1.4 * var(--u)) 0 var(--doux); translate: 0 -calc(0.7 * var(--u)); }
.service {
  width: calc(1.7 * var(--u));
  height: calc(1.7 * var(--u));
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 30%, #d9dee6 60%, #9aa4b0 100%);
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.25s, scale 0.35s cubic-bezier(.2, 1.6, .4, 1);
}
.service.actif { opacity: 1; scale: 1; }

.chrono {
  position: absolute;
  top: 10.2cqh;
  left: 50%;
  translate: -50% 0;
  font-size: calc(1.7 * var(--u));
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--doux);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.bouton-pause {
  position: absolute;
  top: 2.2cqh;
  right: calc(1.6 * var(--u));
  pointer-events: auto;
  width: calc(5.2 * var(--u));
  height: calc(5.2 * var(--u));
  min-width: 36px;
  min-height: 36px;
}

.indice-debut {
  position: absolute;
  bottom: 4cqh;
  display: flex;
  gap: calc(0.6 * var(--u));
  align-items: center;
  font-size: calc(1.6 * var(--u));
  color: var(--doux);
  opacity: 0;
  transition: opacity 0.6s;
}
.indice-debut.g { left: calc(3 * var(--u)); }
.indice-debut.d { right: calc(3 * var(--u)); }
.indice-debut.visible { opacity: 1; }
.indice-debut kbd { font-size: calc(1.8 * var(--u)); }

/* ---------- Écrans de menu ---------- */
#ui {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* centré, mais si l'écran déborde on peut défiler jusqu'en haut (marges auto) */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}
#ui:not(:has(.ecran:not([hidden]))) { pointer-events: none; }

.ecran {
  margin-block: auto;
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  animation: entree 0.45s cubic-bezier(.2, .9, .3, 1);
}
@keyframes entree {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.entete {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.entete h2 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; }

/* Accueil */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(12px, 3vw, 40px);
  margin-top: 8px;
}
.blob-hero {
  width: clamp(116px, 18vw, 212px);
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45));
  animation: rebond 1.6s ease-in-out infinite;
}
.blob-hero.d { animation-delay: -0.8s; }
@keyframes rebond {
  0%, 100% { transform: translateY(0) scaleY(1); }
  12% { transform: translateY(0) scaleX(1.06) scaleY(0.92); }
  45% { transform: translateY(-26%) scaleY(1.04); }
}
.titre { position: relative; text-align: center; }
h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 0.88;
  font-weight: 700;
  font-size: clamp(3.2rem, 9.5vw, 6.6rem);
  letter-spacing: -0.02em;
}
h1 .l1 {
  color: #fff;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 18px 40px rgba(0, 0, 0, 0.45);
}
h1 .l2 {
  background: var(--chaud);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 24px rgba(255, 80, 90, 0.45));
}
.badge {
  position: absolute;
  top: -6px;
  right: -26px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  color: #062a2a;
  background: var(--mer);
  rotate: 8deg;
  box-shadow: 0 8px 24px rgba(46, 230, 214, 0.45);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(340px, 100%);
}

.astuce { margin: 0; color: var(--doux); font-size: 0.98rem; text-align: center; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.9em;
  height: 1.9em;
  padding: 0 0.45em;
  border-radius: 0.45em;
  font: 600 0.85em var(--police);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 3px;
}

/* Boutons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid var(--bord);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover:not(:disabled), .btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }
.btn.principal {
  border: none;
  background: var(--chaud);
  box-shadow: 0 12px 30px rgba(255, 70, 90, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(120, 0, 30, 0.35);
}
.btn.principal:hover, .btn.principal:focus-visible {
  background: var(--chaud);
  box-shadow: 0 16px 40px rgba(255, 70, 90, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: brightness(1.06);
}
.btn.grand { padding: 18px 34px; font-size: 1.35rem; }
.etiquette {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(46, 230, 214, 0.2);
  color: var(--mer);
}

.btn-icone {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--bord);
  background: var(--verre);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.2s, transform 0.18s;
}
.btn-icone:hover, .btn-icone:focus-visible { background: rgba(255, 255, 255, 0.18); transform: scale(1.06); }
.btn-icone svg { width: 55%; height: 55%; fill: currentColor; }

:focus-visible { outline: 3px solid var(--mer); outline-offset: 3px; }

/* Panneaux en verre */
.panneau, .carte-joueur, .carte-modale {
  background: var(--verre);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--ombre);
}

/* Préparation */
.cartes {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}
.vs {
  font-size: 1.6rem;
  font-weight: 700;
  color: transparent;
  background: var(--chaud);
  -webkit-background-clip: text;
  background-clip: text;
}
.carte-joueur {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px 22px 24px;
  position: relative;
  overflow: hidden;
}
.carte-joueur::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(closest-side, var(--lueur, rgba(255, 255, 255, 0.15)), transparent);
  opacity: 0.55;
  pointer-events: none;
}
.carte-joueur .cote {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--doux);
}
.apercu {
  width: 190px;
  margin: -10px 0 -18px;
  cursor: pointer;
  height: auto;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.45));
  animation: rebond 1.6s ease-in-out infinite;
}
.carte-joueur[data-cote='1'] .apercu { animation-delay: -0.8s; }
.champ-nom {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--bord);
  background: rgba(0, 0, 0, 0.28);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.champ-nom:focus { border-color: var(--mer); background: rgba(0, 0, 0, 0.4); }

.nuancier { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.nuance {
  position: relative;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: var(--couleur);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.nuance:hover { transform: scale(1.14); }
.nuance[aria-checked='true'] {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 0 16px var(--couleur, #fff);
  transform: scale(1.12);
}
.nuance.perso { display: grid; place-items: center; overflow: hidden; }
.nuance.perso::after { content: '+'; font-weight: 700; font-size: 1.1rem; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.nuance.perso input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.commandes { display: flex; gap: 10px; }
.touche {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.touche kbd {
  min-width: 52px;
  height: 46px;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.15s;
}
.touche:hover kbd, .touche:focus-visible kbd { background: rgba(255, 255, 255, 0.24); transform: translateY(-2px); }
.touche span { font-size: 0.78rem; color: var(--doux); }

.reglage-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.reglage-match .libelle { font-weight: 600; }
.reglage-match .note { color: var(--doux); font-size: 0.9rem; }

.segments {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bord);
}
.segments button {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: none;
  font-weight: 600;
  cursor: pointer;
  color: var(--doux);
  transition: background 0.2s, color 0.2s;
}
.segments button:hover { color: #fff; }
.segments button[aria-checked='true'] { background: rgba(255, 255, 255, 0.92); color: #10162a; }

/* Options */
.grille-options {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.panneau { padding: 20px 24px; }
.panneau.large { grid-column: 1 / -1; }
.panneau h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mer);
}
.ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 1.05rem;
}
.panneau h3 + .ligne { border-top: none; }
.ligne.colonne { flex-direction: column; align-items: flex-start; }
.ligne small { display: block; color: var(--doux); font-size: 0.82rem; }

.interrupteur {
  flex: none;
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background 0.25s;
}
.interrupteur::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(.3, 1.4, .5, 1);
}
.interrupteur[aria-checked='true'] { background: var(--chaud); }
.interrupteur[aria-checked='true']::after { transform: translateX(22px); }

input[type='range'] {
  flex: 1;
  max-width: 220px;
  accent-color: #ff6a3d;
  cursor: pointer;
}

.choix-plages { display: flex; gap: 14px; }
.plage {
  position: relative;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid transparent;
  background: none;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.18s;
}
.plage:hover { transform: translateY(-2px); }
.plage[aria-checked='true'] { border-color: #fff; }
.plage img { display: block; width: 168px; height: 126px; object-fit: cover; }
.plage span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.55);
}

/* Crédits */
.texte-credits { width: min(640px, 100%); line-height: 1.55; font-size: 1.05rem; }
.texte-credits dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; margin: 20px 0; }
.texte-credits dt { color: var(--mer); font-weight: 600; }
.texte-credits dd { margin: 0; }
.texte-credits .petit { color: var(--doux); font-size: 0.88rem; }
.texte-credits a { color: var(--mer); }

/* ---------- Fenêtres (pause, victoire…) ---------- */
.modale {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(6, 10, 22, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fondu 0.25s ease;
  z-index: 10;
}
.modale[hidden] { display: none; }
@keyframes fondu { from { opacity: 0; } }
.carte-modale {
  position: relative;
  margin-block: auto;
  flex: none;
  width: min(420px, 100%);
  padding: 30px 30px 26px;
  text-align: center;
  background: var(--verre-fort);
  animation: entree 0.4s cubic-bezier(.2, 1.2, .3, 1);
}
.carte-modale.petite { width: min(360px, 100%); }
.carte-modale h2 { margin: 0 0 14px; font-size: 2rem; }
.pile { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 14px; }
.pile.horizontale { flex-direction: row; justify-content: center; }
.score-modale, .score-final {
  font-size: 1.15rem;
  color: var(--doux);
  font-variant-numeric: tabular-nums;
}
.score-final { font-size: 2.6rem; font-weight: 700; color: #fff; }
.sur-titre {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mer);
}
.nom-vainqueur { margin: 4px 0 6px !important; font-size: 2.3rem !important; }
.duree { margin: 4px 0 0; color: var(--doux); }
.blob-vainqueur {
  width: 216px;
  height: auto;
  margin-top: -170px;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.5));
  animation: rebond 1.1s ease-in-out infinite;
}
#victoire { padding-top: 80px; }
.confettis { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Petits écrans ---------- */
@media (max-width: 760px) {
  .cartes { grid-template-columns: 1fr; }
  .vs { text-align: center; }
  .grille-options { grid-template-columns: 1fr; }
  .badge { right: -10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 760px) {
  .ligne:has(.segments) { flex-direction: column; align-items: flex-start; }
}

/* ---------- Jeu en ligne ---------- */
.disposition-enligne {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}
.choix-enligne { display: flex; flex-direction: column; gap: 12px; }
.choix-enligne .btn { width: 100%; }
.aide { margin: 0; color: var(--doux); font-size: 0.92rem; text-align: center; }
.separateur {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 2px;
  color: var(--doux);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.separateur::before, .separateur::after { content: ''; flex: 1; height: 1px; background: var(--bord); }
.rejoindre { display: flex; gap: 10px; }
.rejoindre .btn { width: auto; flex: none; }
.champ-code {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--bord);
  background: rgba(0, 0, 0, 0.3);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}
.champ-code:focus { border-color: var(--mer); }
.champ-code::placeholder { color: rgba(255, 255, 255, 0.3); letter-spacing: 0.2em; }
.champ-code.erreur { animation: secoue 0.4s; border-color: #ff4f6d; }
@keyframes secoue {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.chargeur { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.chargeur span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--chaud);
  animation: saut-point 1s ease-in-out infinite;
}
.chargeur span:nth-child(2) { animation-delay: 0.15s; }
.chargeur span:nth-child(3) { animation-delay: 0.3s; }
@keyframes saut-point {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-12px); opacity: 1; }
}
.titre-attente { font-size: 1.5rem !important; }
.bloc-code { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.code-partie {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  background: var(--chaud);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: all;
}
.etat-revanche { margin: 10px 0 0; min-height: 1.3em; color: var(--mer); font-weight: 600; }

.chrono .ping { margin-left: 0.8em; font-size: 0.85em; opacity: 0.85; }
.chrono .ping:empty { display: none; }
.chrono .ping.lent { color: #ffb340; }
.tag-toi {
  flex: none;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #062a2a;
  background: var(--mer);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 20px;
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--verre-fort);
  border: 1px solid var(--bord);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--ombre);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, translate 0.3s;
  z-index: 20;
}
#toast.visible { opacity: 1; translate: -50% 0; }
#toast.erreur { border-color: rgba(255, 79, 109, 0.6); }

@media (max-width: 760px) {
  .disposition-enligne { grid-template-columns: 1fr; }
}

/* ---------- Contre l'ordinateur ---------- */
.reglages-bot { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.reglages-bot .nom-bot { margin: 0; font-size: 1.5rem; font-weight: 700; }
.reglages-bot .groupe { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.reglages-bot .groupe > span { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--doux); }
.reglages-bot .segments button { padding: 7px 12px; }
.reglages-bot .description { margin: 0; color: var(--doux); font-size: 0.9rem; text-align: center; min-height: 2.6em; }

/* ---------- Salon en ligne ---------- */
.bandeau-salon { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; }
.code-salon { display: flex; align-items: center; gap: 14px; }
.code-partie.petit { font-size: 2.2rem; }
.format-salon {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(46, 230, 214, 0.15);
  color: var(--mer);
  font-weight: 600;
}
.equipes {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
}
.equipes .vs { align-self: center; }
.equipe { display: flex; flex-direction: column; gap: 12px; min-height: 250px; }
.equipe h3 { margin: 0; }
.liste-equipe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.liste-equipe li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.1rem;
  font-weight: 600;
  animation: entree 0.35s cubic-bezier(.2, .9, .3, 1);
}
.liste-equipe li.moi { background: rgba(46, 230, 214, 0.14); box-shadow: inset 0 0 0 1px rgba(46, 230, 214, 0.45); }
.liste-equipe li.vide { background: none; border: 1px dashed var(--bord); color: var(--doux); font-weight: 500; font-size: 0.95rem; animation: none; }
.liste-equipe .pastille { width: 18px; height: 18px; }
.liste-equipe .avatar { width: 40px; height: auto; margin: -12px -4px -6px -8px; flex: none; }
.liste-equipe .nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquette.hote { background: rgba(255, 179, 64, 0.2); color: #ffb340; }
.etiquette.en-jeu { background: rgba(255, 255, 255, 0.12); color: var(--doux); }
.rejoindre-equipe { padding: 10px 16px; font-size: 1rem; }
.etat-salon { margin: 0; color: var(--doux); font-size: 1.05rem; text-align: center; min-height: 1.4em; }
.etat-salon strong { color: #fff; font-size: 1.25em; font-variant-numeric: tabular-nums; }

/* plusieurs joueurs par équipe dans le tableau de score */
.tableau .pastilles { display: flex; gap: calc(0.4 * var(--u)); flex: none; }

@media (max-width: 760px) {
  .equipes { grid-template-columns: 1fr; }
  .equipe { min-height: 0; }
}
.tableau.equipes .joueur { width: 24cqw; }

/* ---------- Réglages de la partie (préparation et salon) ---------- */
.reglages-partie {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px 18px;
  padding: 18px 24px;
}
.reglages-partie .libelle { font-weight: 600; color: var(--doux); white-space: nowrap; }
.reglages-partie .ligne-reglage { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.reglages-partie .note { color: var(--doux); font-size: 0.88rem; }
.reglages-partie .segments button { padding: 7px 13px; }
.reglages-partie .segments button .e { margin-right: 4px; }
.reglages-partie .description { grid-column: 2; margin: -6px 0 0; color: var(--doux); font-size: 0.88rem; }
.reglages-partie.lecture .segments button:not([aria-checked='true']) { display: none; }
.reglages-partie.lecture .segments { pointer-events: none; }
@media (max-width: 760px) {
  .reglages-partie { grid-template-columns: 1fr; }
  .reglages-partie .description { grid-column: 1; }
}

/* annonces pendant le match */
.annonce {
  position: absolute;
  left: 50%;
  top: 28%;
  translate: -50% -50%;
  font-size: calc(5.2 * var(--u));
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
}
.annonce.visible { animation: annonce 1.9s cubic-bezier(.2, 1.3, .3, 1) forwards; }
.annonce.chaude {
  background: var(--chaud);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 80, 90, 0.55));
  text-shadow: none;
}
@keyframes annonce {
  0% { opacity: 0; transform: scale(0.4) rotate(-6deg); }
  15% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  25% { transform: scale(1) rotate(0); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05) translateY(-20px); }
}

/* vent */
.meteo-hud {
  position: absolute;
  top: 13.5cqh;
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.2em 0.8em;
  border-radius: 999px;
  background: var(--verre);
  border: 1px solid var(--bord);
  font-size: calc(1.5 * var(--u));
  font-weight: 600;
}
.meteo-hud .fleche { display: inline-block; transition: transform 0.5s; }

/* émojis en ligne */
.emojis-hud {
  position: absolute;
  bottom: 4cqh;
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 0.6em;
  font-size: calc(1.5 * var(--u));
  color: var(--doux);
  opacity: 0.85;
}
.emojis-hud kbd { font-size: 0.9em; margin-right: 0.15em; }

/* ralenti du point gagnant */
.bandeau-ralenti {
  position: absolute;
  top: 19cqh;
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.4em 1.2em;
  border-radius: 999px;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--bord);
  font-size: calc(2 * var(--u));
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: fondu 0.3s;
}
.bandeau-ralenti .point-rouge { width: 0.6em; height: 0.6em; border-radius: 50%; background: #ff3d5a; animation: clignote 1s infinite; }
.bandeau-ralenti small { font-size: 0.6em; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--doux); }
@keyframes clignote { 50% { opacity: 0.2; } }
#scene.ralenti #ecran { filter: saturate(0.75) contrast(1.05); }
#scene.ralenti::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45));
}

/* ---------- Salon : bots, tournoi, spectateur ---------- */
.ajouter-bot { padding: 8px 14px; font-size: 0.95rem; background: rgba(255, 255, 255, 0.04); border-style: dashed; }
.liste-equipe .retirer {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 700;
}
.liste-equipe .retirer:hover { background: rgba(255, 79, 109, 0.6); }
.etiquette.bot { background: rgba(140, 160, 255, 0.2); color: #b8c4ff; }
.zone-tournoi { width: min(900px, 100%); display: flex; flex-direction: column; gap: 16px; align-items: center; }
.participants { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.participants .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-weight: 600;
}
.participants .chip.moi { box-shadow: inset 0 0 0 1px rgba(46, 230, 214, 0.6); }
.arbre { display: flex; gap: 22px; justify-content: center; align-items: center; width: 100%; overflow-x: auto; }
.arbre .tour { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; min-width: 170px; }
.arbre .tour h4 { margin: 0 0 4px; text-align: center; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mer); }
.arbre .duel {
  border-radius: 14px; background: var(--verre); border: 1px solid var(--bord);
  overflow: hidden; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.arbre .duel.en-cours { border-color: var(--mer); box-shadow: 0 0 0 2px rgba(46, 230, 214, 0.35), 0 0 24px rgba(46, 230, 214, 0.25); }
.arbre .duel > div { padding: 7px 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arbre .duel > div + div { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.arbre .duel .gagnant { color: #ffd23f; }
.arbre .duel .gagnant::after { content: ' ✓'; }
.arbre .duel .vide { color: var(--doux); font-weight: 500; font-style: italic; }
.champion-tournoi { font-size: 1.4rem; font-weight: 700; color: #ffd23f; text-align: center; }
.badge-spectateur {
  position: absolute; bottom: 4cqh; left: 50%; translate: -50% 0;
  padding: 0.35em 1em; border-radius: 999px; background: var(--verre); border: 1px solid var(--bord);
  font-size: calc(1.6 * var(--u)); font-weight: 600;
}

/* ---------- Résumé du match, succès ---------- */
.resume-match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 4px;
  text-align: left;
}
.resume-match:empty { display: none; }
.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.stat .e { grid-row: span 2; font-size: 1.3rem; align-self: center; }
.stat .t { font-size: 0.75rem; color: var(--doux); }
.stat strong { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#victoire .carte-modale { width: min(470px, 100%); }

.profil-stats { width: min(900px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grille-succes { width: min(900px, 100%); display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.succes {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--verre);
  border: 1px solid var(--bord);
  opacity: 0.55;
}
.succes.obtenu { opacity: 1; border-color: rgba(255, 210, 63, 0.5); box-shadow: 0 0 18px rgba(255, 179, 64, 0.15); }
.succes .medaille { font-size: 1.8rem; width: 44px; text-align: center; flex: none; }
.succes p { margin: 2px 0 0; font-size: 0.85rem; color: var(--doux); }
.succes small { color: #ffd23f; font-size: 0.75rem; }
@media (max-width: 760px) {
  .profil-stats { grid-template-columns: 1fr 1fr; }
  .resume-match { grid-template-columns: 1fr; }
}

/* ---------- Commandes tactiles ----------
   En jeu sur écran tactile, le terrain se resserre au centre et laisse une colonne de chaque côté :
   à gauche le pavé (moitié gauche / moitié droite), à droite le saut. Toute la colonne réagit au doigt. */
body.jeu-tactile {
  --cote-min: clamp(112px, 17vw, 230px);
  --l-scene: min(calc(100vw - 2 * var(--cote-min)), calc(100vh * var(--ratio, 1.3333)));
  --l-colonne: calc((100vw - var(--l-scene)) / 2);
}
@supports (height: 100dvh) {
  body.jeu-tactile { --l-scene: min(calc(100vw - 2 * var(--cote-min)), calc(100dvh * var(--ratio, 1.3333))); }
}
body.jeu-tactile #scene {
  width: var(--l-scene);
  height: calc(var(--l-scene) / var(--ratio, 1.3333));
  border-radius: 0;
}
body.jeu-tactile .emojis-hud, body.classique #tactile { display: none !important; }

#tactile {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.zone-tactile {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--l-colonne);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: max(14px, 9vh);
  pointer-events: auto;
  touch-action: none;
}
.zone-tactile.pave { left: 0; }
.zone-tactile.bouton-saut { right: 0; }
.zone-tactile .disque {
  position: relative;
  width: min(calc(var(--l-colonne) - 20px), 62vh, 200px);
  aspect-ratio: 1;
  border-radius: 50%;
  transition: transform 0.12s cubic-bezier(.3, 1.6, .5, 1), box-shadow 0.15s, background 0.15s;
}
.zone-tactile svg { fill: currentColor; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); }

/* pavé : un gros disque coupé en deux, la moitié appuyée prend la couleur du blob */
.pave .disque {
  display: flex;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.28), 0 14px 30px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pave .moitie {
  flex: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.12s, color 0.12s;
}
.pave .moitie + .moitie { border-left: 2px solid rgba(255, 255, 255, 0.22); }
.pave .moitie svg { width: 58%; transition: transform 0.15s cubic-bezier(.3, 1.6, .5, 1); }
.pave .gauche svg { translate: 8% 0; }
.pave .droite svg { translate: -8% 0; }
.pave[data-sens='gauche'] .gauche, .pave[data-sens='droite'] .droite {
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.45), var(--couleur, #ffd23f) 75%);
  color: #fff;
}
.pave[data-sens='gauche'] .gauche svg, .pave[data-sens='droite'] .droite svg { transform: scale(1.18); }
.pave[data-sens='gauche'] .disque { transform: translateY(5px) rotate(-6deg); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28), 0 0 34px var(--couleur, #ffd23f); }
.pave[data-sens='droite'] .disque { transform: translateY(5px) rotate(6deg); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28), 0 0 34px var(--couleur, #ffd23f); }

/* saut : un gros bouton orange façon borne d'arcade */
.bouton-saut .disque {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2%;
  color: #fff;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.55), transparent 42%), var(--chaud);
  box-shadow: 0 10px 0 #b8264d, 0 18px 34px rgba(255, 70, 90, 0.45), inset 0 -6px 0 rgba(120, 0, 30, 0.25);
}
.bouton-saut svg { width: 42%; }
.bouton-saut b {
  font-size: clamp(0.85rem, 5vh, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(120, 0, 30, 0.35);
}
.bouton-saut.appui .disque {
  transform: translateY(8px) scale(0.95);
  box-shadow: 0 2px 0 #b8264d, 0 0 44px rgba(255, 200, 80, 0.75), inset 0 -3px 0 rgba(120, 0, 30, 0.25);
  filter: brightness(1.12);
}
.bouton-saut.appui svg { animation: hop 0.3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 50% { transform: translateY(-14%); } }

#tourner {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: rgba(6, 10, 22, 0.92);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}
#tourner span { font-size: 3rem; }
@media (orientation: portrait) and (pointer: coarse) {
  body:has(#scene.en-jeu) #tourner { display: grid; }
}

/* bouton de la musique, toujours accessible */
#bouton-musique {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 15;
  width: 42px;
  height: 42px;
}
#bouton-musique.coupee { opacity: 0.6; }
#bouton-musique.coupee::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 3px;
  border-radius: 2px;
  background: #ff4f6d;
  transform: rotate(-45deg);
}
body.classique #bouton-musique { display: none; }

/* ---------- Atelier du blob (atelier.js) ---------- */
.btn.petit { padding: 8px 16px; font-size: 0.95rem; }
.btn[aria-pressed='true'] { background: rgba(255, 255, 255, 0.9); color: #10162a; }
.personnaliser { margin-top: -6px; }
.mon-blob { flex: none; }
.pour-qui { color: var(--doux); font-size: 1.1rem; font-weight: 600; }
.disposition-atelier {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
}
.scene-atelier {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}
.scene-atelier::before {
  content: '';
  position: absolute;
  inset: -30% -30% auto;
  height: 80%;
  background: radial-gradient(closest-side, var(--lueur, rgba(255, 255, 255, 0.2)), transparent);
  opacity: 0.45;
  pointer-events: none;
}
.apercu-atelier {
  position: relative;
  width: min(100%, 300px);
  height: auto;
  cursor: pointer;
  touch-action: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
}
#atelier.en-peinture .apercu-atelier { cursor: crosshair; border-radius: 18px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--bord); }
.actions-atelier { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.outils-atelier { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.outils-atelier h4 { margin: 10px 0 2px; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--doux); }
.outils-atelier h4 small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.outils-atelier .nuancier { justify-content: flex-start; }
.outils-atelier .aide { text-align: left; }
.outils-atelier .aide.petite { font-size: 0.82rem; margin-top: 8px; }
.onglets { align-self: flex-start; }
.onglets button[aria-selected='true'] { background: rgba(255, 255, 255, 0.92); color: #10162a; }
.grille-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
  border-radius: 14px;
  border: 1px solid var(--bord);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.choix:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }
.choix[aria-checked='true'] { border-color: #fff; background: rgba(46, 230, 214, 0.18); box-shadow: 0 0 0 2px rgba(46, 230, 214, 0.4); }
.choix canvas { width: 64px; height: auto; }
.choix span { font-size: 0.75rem; font-weight: 600; line-height: 1.15; text-align: center; color: var(--doux); }
.choix[aria-checked='true'] span { color: #fff; }
.outils-peinture { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.zone-photo { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.recadrage { width: 220px; height: 220px; border-radius: 18px; cursor: grab; touch-action: none; background: rgba(0, 0, 0, 0.3); }
.recadrage:active { cursor: grabbing; }
.reglages-photo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; min-width: 200px; }
.reglages-photo h4 { margin-bottom: 0; }
.ligne-zoom { display: flex; align-items: center; gap: 10px; width: 100%; }
.ligne-zoom input { flex: 1; }
@media (max-width: 760px) {
  .disposition-atelier { grid-template-columns: 1fr; }
  .scene-atelier { position: relative; }
  .apercu-atelier { width: min(70%, 240px); }
}

/* ---------- Téléphones et petits écrans ---------- */
/* au doigt, les aides au clavier n'ont pas de sens */
body.tactile .commandes, body.tactile #accueil .astuce, body.tactile #pause .astuce, body.tactile .touches-enligne, body.tactile .indice-debut { display: none !important; }

/* le bouton de la musique (en haut à gauche) ne doit pas cacher le bouton Retour */
@media (max-width: 1060px) {
  .entete { padding-left: 46px; }
}

@media (max-width: 560px) {
  #ui { padding: 16px 14px 24px; }
  .ecran { gap: 18px; }
  .entete { gap: 10px; }
  .entete h2 { font-size: 1.45rem; line-height: 1.15; }
  .hero { gap: 10px; margin-top: 46px; }
  .blob-hero { width: 21vw; }
  h1 { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .badge { right: -6px; top: -14px; }
  .menu { gap: 10px; }
  .btn { padding: 12px 20px; font-size: 1.05rem; }
  .btn.grand { padding: 16px 26px; font-size: 1.2rem; }
  .panneau { padding: 16px 16px; }
  .reglages-partie { padding: 14px 16px; gap: 8px 12px; }
  .reglages-partie .segments button, .reglages-bot .segments button { padding: 7px 10px; font-size: 0.92rem; }
  .carte-joueur { padding: 16px 16px 18px; gap: 12px; }
  .apercu { width: 140px; }
  .ligne { font-size: 1rem; gap: 12px; }
  .carte-modale { padding: 24px 18px 20px; }
  .carte-modale h2 { font-size: 1.7rem; }
  .code-partie { font-size: 2.6rem; }
  .code-salon { flex-wrap: wrap; justify-content: center; }
  .texte-credits dl { grid-template-columns: 1fr; gap: 2px; }
  .texte-credits dd { margin-bottom: 10px; }
  .grille-succes { grid-template-columns: 1fr; }
  .pile.horizontale { flex-wrap: wrap; }
  .pile.horizontale .btn { flex: 1 1 140px; }
  .rejoindre .btn { padding: 12px 16px; }
}

/* téléphone tenu à l'horizontale : peu de hauteur, on serre tout et l'accueil passe sur deux colonnes */
@media (max-height: 540px) and (orientation: landscape) {
  #ui { padding: 12px max(16px, 4vw) 16px; }
  .ecran { gap: 14px; }
  .entete h2 { font-size: 1.5rem; }
  .btn-icone { width: 40px; height: 40px; }
  #bouton-musique { top: 10px; left: 10px; width: 38px; height: 38px; }
  .btn { padding: 9px 20px; font-size: 1rem; }
  .btn.grand { padding: 12px 26px; font-size: 1.15rem; }

  #accueil {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    align-items: center;
    gap: 4vw;
  }
  .hero { margin: 0; gap: 2vw; }
  .blob-hero { width: min(15vw, 26vh); }
  h1 { font-size: min(9vw, 17vh); }
  .badge { right: -14px; font-size: 0.85rem; }
  .menu { width: 100%; gap: 8px; }
  #accueil .astuce { grid-column: 1 / -1; font-size: 0.85rem; }

  .cartes { grid-template-columns: 1fr auto 1fr; gap: 12px; }
  .disposition-enligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .equipes { grid-template-columns: 1fr auto 1fr; }
  .grille-options { grid-template-columns: 1fr; }
  .carte-joueur { padding: 12px 14px 14px; gap: 10px; }
  .apercu { width: 104px; margin: -6px 0 -10px; }
  .champ-nom { padding: 8px 12px; font-size: 1rem; }
  .nuance { width: 24px; height: 24px; }
  .reglages-partie { padding: 12px 16px; gap: 8px 14px; }
  .reglages-partie .segments button { padding: 6px 11px; font-size: 0.92rem; }
  .reglages-bot { gap: 8px; }
  .reglages-bot .nom-bot { font-size: 1.2rem; }
  .reglages-bot .description { min-height: 0; }
  .panneau { padding: 14px 18px; }
  .ligne { padding: 8px 0; }
  .equipe { min-height: 0; }
  .disposition-atelier { grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr); }
  .apercu-atelier { width: min(100%, 190px); }

  .modale { padding: 12px; }
  .carte-modale { padding: 18px 22px 16px; }
  .carte-modale h2 { margin-bottom: 8px; font-size: 1.6rem; }
  .pile { margin: 12px 0 8px; gap: 8px; }
  #victoire { padding-top: 64px; }
  #victoire .carte-modale { width: min(620px, 100%); }
  .blob-vainqueur { width: 120px; margin-top: -96px; }
  .nom-vainqueur { font-size: 1.8rem !important; }
  .score-final { font-size: 2rem; }
  .resume-match { grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 2px; }
  .stat { padding: 6px 8px; }
  .code-partie { font-size: 2.6rem; }
}
