/* La scène d'un assaut de la Nuit (jeu/assaut/) : plein écran, la 3D dessous, le HUD de jeu par-dessus.
   Une icône et un chiffre par élément ; le libellé dans l'infobulle. Fer, cuir et or, comme la vue de front. */

.assaut-scene {
  --as-fer: #4d5d68;
  --as-fer-vif: #8a9aa5;
  --as-or: #c9a76a;
  --as-or-vif: #f0d38a;
  --as-cuir: linear-gradient(180deg, rgb(34 42 50 / .92), rgb(14 19 25 / .94));
  --as-texte: #ece6d8;
  --as-sang: #ff9a86;
  --as-vert: #9df08a;
  --as-froid: #a9d4ff;
  position: fixed;
  inset: 0;
  z-index: 1400;
  overflow: hidden;
  background: #1b232c;
  color: var(--as-texte);
  font: 400 15px / 1.3 var(--police-corps, Georgia, serif);
}
.assaut-scene__toile { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.assaut-hud { position: absolute; inset: 0; pointer-events: none; }
.assaut-hud > * { pointer-events: auto; }

/* ── La plaque de la phase ── */
.assaut-plaque {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 6px 16px 7px 8px;
  border: 1px solid var(--as-or);
  border-radius: 4px;
  background: var(--as-cuir);
  box-shadow: inset 0 1px 0 rgb(240 211 138 / .35), inset 0 0 0 3px rgb(0 0 0 / .35), 0 6px 18px rgb(0 0 0 / .55);
}
.assaut-plaque__icone { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--as-or); background: #10161c; object-fit: cover; }
.assaut-plaque__texte { display: flex; flex-direction: column; min-width: 0; }
.assaut-plaque__nuit { font-size: 12px; color: #b9c3c8; letter-spacing: .04em; }
.assaut-plaque__phase { font: 400 24px / 1.05 var(--police-titre, 'Palatino Linotype', Georgia, serif); color: var(--as-or-vif); text-shadow: 0 2px 3px #000; white-space: nowrap; }
.assaut-crans { grid-column: 2; display: flex; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
.assaut-cran { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #3c4852; background: #0e1419; opacity: .5; }
.assaut-cran img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; filter: grayscale(1); }
.assaut-cran.est-faite { opacity: .85; border-color: var(--as-fer-vif); }
.assaut-cran.est-faite img { filter: grayscale(.4); }
.assaut-cran.est-en-cours { opacity: 1; border-color: var(--as-or-vif); box-shadow: 0 0 8px rgb(240 211 138 / .6); }
.assaut-cran.est-en-cours img { filter: none; }

/* ── Les deux camps ── */
.assaut-camp {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(50% - 90px);
}
.assaut-camp[hidden] { display: none; }
.assaut-camp--nous { left: 12px; }
.assaut-camp--eux { right: 12px; flex-direction: row-reverse; }
.assaut-camp__blason {
  width: 58px; height: 70px; object-fit: contain;
  filter: drop-shadow(0 3px 4px rgb(0 0 0 / .8));
}
.assaut-camp__blason--morts { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 2px solid #6f8fa8; box-shadow: 0 0 12px rgb(143 210 255 / .45); }
/* La carte du général, entière (2 sur 3), à la hauteur du blason. */
.assaut-camp__general { width: 47px; height: 70px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 4px rgb(0 0 0 / .8)); }
.assaut-pastilles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.assaut-camp--eux .assaut-pastilles { justify-content: flex-end; }
.assaut-pastille {
  position: relative;
  display: grid;
  justify-items: center;
  width: 58px;
  padding: 4px 2px 3px;
  border: 1px solid var(--as-fer);
  border-radius: 4px;
  background: var(--as-cuir);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 3px 8px rgb(0 0 0 / .5);
}
.assaut-pastille__icone { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid #2a333b; background: #0b1015; }
.assaut-pastille__chiffre { font: 700 15px / 1.15 var(--police-titre, Georgia, serif); color: var(--as-texte); font-variant-numeric: tabular-nums; }
.assaut-pastille__perte { font: 700 13px / 1 var(--police-titre, Georgia, serif); color: var(--as-sang); text-shadow: 0 1px 2px #000; }
.assaut-pastille--perte .assaut-pastille__chiffre { color: var(--as-sang); }
.assaut-pastille--coup { border-color: #5f8a6a; }
.assaut-pastille--coup .assaut-pastille__chiffre { color: var(--as-vert); }
.assaut-pastille--gain .assaut-pastille__chiffre { color: var(--as-or-vif); }
.assaut-camp--eux .assaut-pastille { border-color: #3d5568; }

/* ── L'issue ── */
.assaut-issue {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px 22px 18px;
  border: 1px solid var(--as-or);
  border-radius: 5px;
  background: var(--as-cuir);
  box-shadow: inset 0 0 0 3px rgb(0 0 0 / .35), 0 12px 40px rgb(0 0 0 / .7);
}
.assaut-issue[hidden] { display: none; }
.assaut-issue__titre { font: 400 34px / 1 var(--police-titre, Georgia, serif); color: var(--as-or-vif); text-shadow: 0 2px 4px #000; }

/* ── Les commandes ── */
.assaut-commandes {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  display: flex;
  gap: 6px;
}
.assaut-commande {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid #a8864c;
  border-radius: 4px;
  background: linear-gradient(#4a3a22, #2a2014);
  box-shadow: inset 0 1px 0 rgb(201 167 106 / .55), 0 2px 4px rgb(0 0 0 / .6);
  color: #f3e9d2;
  cursor: pointer;
}
.assaut-commande:is(:hover, :focus-visible) { border-color: var(--as-or-vif); box-shadow: inset 0 1px 0 rgb(240 211 138 / .7), 0 0 10px rgb(240 200 120 / .35), 0 2px 4px rgb(0 0 0 / .6); outline: none; }
.assaut-commande:focus-visible { outline: 2px solid var(--as-or-vif); outline-offset: 2px; }
.assaut-commande:active { transform: translateY(1px); }
.assaut-commande[aria-pressed="true"] { background: linear-gradient(#2a2014, #4a3a22); }
.assaut-commande__trait { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── L'infobulle de jeu ── */
.assaut-scene [data-infobulle] { position: relative; }
.assaut-scene [data-infobulle]:is(:hover, :focus-visible)::after {
  content: attr(data-infobulle);
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 14rem;
  padding: 5px 8px;
  border: 2px solid #3a2a17;
  border-radius: 4px;
  background: #e9dcc0;
  color: #2b1b0c;
  font: 400 13px / 1.3 var(--police-corps, Georgia, serif);
  white-space: normal;
  pointer-events: none;
}
/* Sous les commandes, au même poids que la règle d'au-dessus : sinon `top` et `bottom` jouent ensemble et l'infobulle
   tombe à 0 de haut. */
.assaut-scene .assaut-commandes [data-infobulle]:is(:hover, :focus-visible)::after { bottom: auto; top: calc(100% + 6px); }

.assaut-scene .visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* L'attente pendant que la scène se charge, et son refus si la 3D ne s'ouvre pas. */
.assaut-attente {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 10px 18px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--as-or);
  border-radius: 3px;
  background: var(--as-cuir);
  box-shadow: inset 0 1px 0 rgb(201 167 106 / .4), 0 6px 18px rgb(0 0 0 / .6);
  font-size: 17px;
  letter-spacing: .02em;
}
/* La page dessous ne défile plus tant que la scène est ouverte. */
html.assaut-ouvert, html.assaut-ouvert body { overflow: hidden; }
/* Mouvement réduit : aucun déplacement d'interface, seule l'image de la scène change. */
@media (prefers-reduced-motion: reduce) { .assaut-scene * { transition: none !important; animation: none !important; } }
html.mouvement-reduit .assaut-scene * { transition: none !important; animation: none !important; }

/* ── Le téléphone : la plaque en haut à gauche, les camps empilés en bas, des pastilles plus petites ── */
@media (max-width: 700px) {
  .assaut-plaque { left: 8px; transform: none; padding: 4px 10px 5px 5px; column-gap: 7px; }
  .assaut-plaque__icone { width: 34px; height: 34px; }
  .assaut-plaque__phase { font-size: 18px; }
  .assaut-cran { width: 14px; height: 14px; }
  .assaut-commandes { top: auto; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 150px); right: 8px; flex-direction: column; }
  .assaut-commande { width: 44px; height: 44px; }
  /* En colonne, l'infobulle passe à gauche du bouton : dessous, elle cachait le suivant. */
  .assaut-scene .assaut-commandes [data-infobulle]:is(:hover, :focus-visible)::after { top: 50%; bottom: auto; left: auto; right: calc(100% + 6px); transform: translateY(-50%); }
  .assaut-camp { max-width: calc(100% - 16px); left: 8px; right: 8px; gap: 6px; }
  .assaut-camp--nous { bottom: max(8px, env(safe-area-inset-bottom)); }
  .assaut-camp--eux { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 72px); }
  .assaut-camp__blason { width: 40px; height: 48px; }
  .assaut-camp__general { width: 32px; height: 48px; }
  .assaut-camp__blason--morts { width: 40px; height: 40px; }
  .assaut-pastille { width: 48px; }
  .assaut-pastille__icone { width: 30px; height: 30px; }
  .assaut-pastille__chiffre { font-size: 13px; }
  .assaut-issue { width: calc(100% - 40px); }
  .assaut-issue__titre { font-size: 26px; }
}
