/* Guerre Foxhole en direct (/foxhole/guerre) : carte dessinée et zoomable, barre de temps, chiffres, journal. */
.dz-war-back {
  margin: 0 0 8px;
}

/* La page prend toute la largeur : la carte d'abord, la suite dessous. Sans carte, la colonne habituelle du site. */
/* Le bas de page est celui de la suite (.dz-war-below) : au bout du défilement, elle couvre encore toute la carte. */
.dz-war-page {
  padding: 8px 12px 0;
}

.dz-war-below {
  padding-bottom: 48px;
}

.dz-war-page:not(.has-map) {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 48px 16px;
}

/* Le titre reste pour les lecteurs d'écran et les moteurs de recherche, sans prendre de place. */
.dz-war-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dz-war-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--dz-muted, #9fb1c6);
}

.dz-war-badge {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--dz-line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dz-text);
}

.dz-war-live {
  border-color: #d9534f;
  background: #d9534f;
  color: #fff;
}

.dz-war-stale {
  border-color: #f0a04b;
  color: #ffd0a0;
}

/* Le bouton « EN DIRECT », au début de la barre de temps : voyant rouge et libellé allumés seulement en direct. */
button.dz-war-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 999px;
  background: rgb(10 14 25 / 0.6);
  color: #8a94a6;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

button.dz-war-live:hover:not([disabled]),
button.dz-war-live:focus-visible {
  border-color: #d9534f;
  color: #fff;
}

button.dz-war-live[disabled] {
  cursor: default;
  letter-spacing: normal;
}

.dz-war-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a4f5c;
}

button.dz-war-live.is-on {
  border-color: #d9534f;
  background: rgb(217 83 79 / 0.16);
  color: #fff;
}

button.dz-war-live.is-on .dz-war-live-dot {
  background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
  animation: dz-war-live-pulse 1.6s ease-in-out infinite;
}

@keyframes dz-war-live-pulse {
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  button.dz-war-live.is-on .dz-war-live-dot {
    animation: none;
  }
}

/* La carte prend toute la largeur de la page. Sur un téléphone ou une tablette, elle garde son rapport sans dépasser
   l'écran ; on fait défiler la page à côté d'elle. */
.dz-war-stage {
  width: 100%;
}

/* La carte, sa barre de temps juste dessous, puis les cadres d'informations (posés sur la carte sur un écran large). */
.dz-war-mapbox {
  position: relative;
}

/* Le cadre de la carte et sa fiche : la fiche se pose sur la droite de la carte, sous elle sur un petit écran. */
.dz-war-frame {
  position: relative;
}

.dz-war-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1608 / 1138;
  width: 100%;
  max-height: calc(100svh - var(--dz-bar-height, 56px) - 72px);
  border: 1px solid var(--dz-line);
  border-radius: 8px;
  background: #0f0f1e;
  touch-action: none;
  cursor: grab;
}

/* Sur un écran d'ordinateur, la carte remplit l'écran à l'arrivée en laissant voir la barre de temps dessous (on fait
   défiler la page par là, la molette sur la carte zoome). Elle reste en place : la suite de la page monte par-dessus
   et la couvre en fondu. */
@media (min-width: 1100px) and (min-height: 600px) {
  .dz-war-stage {
    position: sticky;
    top: var(--dz-bar-height, 56px);
    z-index: 0;
  }

  .dz-war-viewport {
    height: calc(100svh - var(--dz-bar-height, 56px) - 104px);
    max-height: none;
    aspect-ratio: auto;
  }

  .dz-war-below {
    margin: 0 -12px;
    padding: 28px 12px 48px;
    background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--dz-night) 92%, transparent) 130px);
  }

  /* Là où le navigateur sait suivre le défilement, la carte s'assombrit aussi pendant que la page la recouvre. */
  @supports (animation-timeline: scroll()) {
    .dz-war-stage {
      animation: dz-war-under linear both;
      animation-timeline: scroll(root);
      animation-range: 0 80vh;
    }
  }
}

@keyframes dz-war-under {
  to {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dz-war-stage {
    animation: none;
  }
}

/* La suite de la page : au-dessus de la carte, chaque bloc large comme la page jusqu'à 1800 px. */
.dz-war-below {
  position: relative;
  z-index: 1;
}

.dz-war-below > * {
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

.dz-war-block {
  margin-bottom: 32px;
}

.dz-war-block > h2,
.dz-war-chart > h2 {
  margin: 0 0 10px;
}

/* Les points de victoire en haut du cadre : bleu des Wardens depuis la gauche, vert des Colonials depuis la droite ;
   le trait du milieu est le nombre requis. */
.dz-war-vp {
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  z-index: 3;
  display: flex;
  height: 7px;
  overflow: hidden;
  border-radius: 7px 7px 0 0;
  background: rgb(255 255 255 / 0.1);
  pointer-events: none;
}

.dz-war-vp::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgb(0 0 0 / 0.8);
}

.dz-war-vp-half {
  display: flex;
  flex: 1 1 50%;
}

.dz-war-vp-half.is-colonials {
  justify-content: flex-end;
}

.dz-war-vp-line {
  height: 100%;
  transition: width 0.6s ease;
}

.is-wardens > .dz-war-vp-line {
  background: linear-gradient(to right, #1f4f9e, #4ba0ff);
  box-shadow: 0 0 8px #4ba0ff;
}

.is-colonials > .dz-war-vp-line {
  background: linear-gradient(to left, #1f7a2c, #4be85c);
  box-shadow: 0 0 8px #4be85c;
}

/* Le drapeau du camp en tête (le plus de territoire, data-lead posé par site/guerre.js) au fond du cadre, seul ; quand
   la tête change, l'un s'efface pendant que l'autre apparaît ; à égalité, aucun. Les images sont déjà sombres : bien
   visibles, elles restent un fond. Le drapeau en tête flotte (une vidéo en boucle, site/drapeau-*.webm|mp4) ; l'image
   fixe reste dessous (avant la vidéo, et pour qui a réduit les animations). Un vignettage assombrit les bords. */
.dz-war-flags {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.dz-war-flag {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.dz-war-flag-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(0.9);
}

/* Le cadre est plus large que les vidéos (16:9) : elles sont coupées en haut et en bas. L'aigle est à 47 % de la hauteur
   de la sienne, le poing à 49 % : on garde un peu plus du haut pour que chaque emblème tombe au milieu du cadre. */
.dz-war-flag.is-wardens .dz-war-flag-video {
  object-position: 50% 32%;
}

.dz-war-flag.is-colonials .dz-war-flag-video {
  object-position: 50% 44%;
}

.dz-war-flags::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 0.6) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .dz-war-flag-video {
    display: none;
  }
}

.dz-war-flag.is-wardens {
  background-image: url("/site/drapeau-wardens.webp");
}

.dz-war-flag.is-colonials {
  background-image: url("/site/drapeau-colonials.webp");
}

/* Le drapeau en tête se montre selon la part des régions de son camp (--dz-war-flag-strength, posé par site/guerre.js) :
   rien jusqu'à 40 %, 75 % à 80 %. */
.dz-war-flags[data-lead="wardens"] .is-wardens,
.dz-war-flags[data-lead="colonials"] .is-colonials {
  opacity: var(--dz-war-flag-strength, 1);
}

/* Le fond plein sous chaque hexagone : opaque par défaut (la carte à 100 %), le drapeau se voit à travers quand on
   baisse « Opacité de la carte » dans les réglages (--dz-war-solid, de 0 à 1, posé par site/guerre.js). */
.dz-war-hex-base {
  fill: #12131f;
  opacity: var(--dz-war-solid, 1);
}

/* Avec les drapeaux, le sol de la carte disparaît : pas de rectangle sombre autour des hexagones. */
.dz-war-flags ~ .dz-war-map .dz-war-ground {
  fill-opacity: 0;
}

/* Le petit tutoriel de la première visite : une bulle près de ce qu'elle montre, qui s'entoure d'or. */
.dz-war-tour {
  position: absolute;
  z-index: 30;
  width: min(300px, calc(100% - 24px));
  padding: 12px 14px;
  border: 1px solid rgb(255 209 102 / 0.6);
  border-radius: 10px;
  background: rgb(14 17 28 / 0.96);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.55);
  color: #e8ecf2;
  font-size: 0.9rem;
}

.dz-war-tour-count {
  margin: 0 0 4px;
  color: #ffd166;
  font-size: 0.75rem;
  font-weight: 700;
}

.dz-war-tour-text {
  margin: 0 0 10px;
  line-height: 1.4;
}

.dz-war-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dz-war-tour-skip {
  border: 0;
  background: none;
  color: #aab3c2;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

[data-war-tour-lit] {
  outline: 2px solid #ffd166 !important;
  outline-offset: 3px;
  animation: dz-war-tour-glow 1.2s ease-in-out infinite alternate;
}

@keyframes dz-war-tour-glow {
  from { outline-color: rgb(255 209 102 / 0.35); }
  to { outline-color: #ffd166; }
}

@media (prefers-reduced-motion: reduce) {
  [data-war-tour-lit] {
    animation: none;
  }
}

.dz-war-viewport:focus-visible {
  outline: 2px solid #ffd166;
  outline-offset: 2px;
}

.dz-war-viewport.is-dragging {
  cursor: grabbing;
}

/* Placée (relative) pour passer au-dessus des drapeaux du fond, posés en absolu avant elle. */
.dz-war-map {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.dz-war-stage:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 12px;
  background: var(--dz-night);
}

.dz-war-stage:fullscreen .dz-war-mapbox {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.dz-war-stage:fullscreen .dz-war-frame {
  flex: 1 1 auto;
  min-height: 0;
}

.dz-war-stage:fullscreen .dz-war-timeline {
  margin-bottom: 0;
}

.dz-war-stage:fullscreen .dz-war-viewport {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

/* En bas à droite de la carte : en direct et l'heure de la carte, puis la mention de Slipshady et Skilvin, au même
   niveau. */
.dz-war-corner {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: grid;
  justify-items: end;
  gap: 4px;
  pointer-events: none;
}

.dz-war-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgb(10 14 25 / 0.72);
}

.dz-war-when {
  color: #d8dde6;
  font-size: 0.8rem;
}

.dz-war-tools {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dz-war-credit {
  margin: 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgb(10 14 25 / 0.72);
  color: #d8dde6;
  font-size: 0.8rem;
  pointer-events: none;
  text-align: right;
}

.dz-war-credit strong {
  color: #ffd166;
}

/* Les noms mènent aux profils : seuls les liens prennent le pointeur, le reste de la mention le laisse à la carte. */
.dz-war-credit a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.dz-war-credit a:hover strong,
.dz-war-credit a:focus-visible strong {
  text-decoration: underline;
}

.dz-war-tools[hidden] {
  display: none;
}

.dz-war-tools button {
  min-width: 40px;
  min-height: 40px;
  font-size: 1.15rem;
  background: rgb(11 18 28 / 0.85);
}

/* La fiche d'un hexagone : à droite de la carte, sous la carte sur un petit écran. */
.dz-war-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(360px, 40%);
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--dz-line);
  border-radius: 8px;
  background: rgb(11 18 28 / 0.94);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
  font-size: 0.92rem;
  cursor: auto;
}

.dz-war-panel[hidden] {
  display: none;
}

.dz-war-panel h2 {
  margin: 0 32px 6px 0;
  font-size: 1.2rem;
}

.dz-war-panel h3 {
  margin: 12px 0 4px;
  font-size: 0.95rem;
}

.dz-war-panel ul {
  margin: 0;
  padding-left: 1.1em;
}

.dz-war-panel p {
  margin: 4px 0;
}

.dz-war-panel [data-war-panel-close] {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 32px;
  min-height: 32px;
}

@media (max-width: 760px) {
  .dz-war-panel {
    position: relative;
    inset: auto;
    width: auto;
    margin-top: 8px;
  }

  /* Le coin passe en haut : en bas, les boutons occupent la largeur. */
  .dz-war-corner {
    top: 12px;
    right: 6px;
    bottom: auto;
  }

  .dz-war-credit,
  .dz-war-when {
    font-size: 0.72rem;
  }

  .dz-war-status .dz-war-badge {
    padding: 0 7px;
    font-size: 0.7rem;
  }
}

/* Sur un téléphone, la carte est trop petite pour garder la mention des auteurs dessus : elle reste en bas de page. */
@media (max-width: 600px) {
  .dz-war-credit {
    display: none;
  }

  /* Sur un téléphone, les boutons en ligne : en colonne ils mangeraient la carte. */
  .dz-war-tools {
    bottom: 6px;
    left: 6px;
    flex-direction: row;
  }

  .dz-war-tools button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 8px;
    font-size: 1rem;
  }
}

/* ---- Le dessin (site/guerre-carte.js) : seules les zones des hexagones reçoivent le pointeur. */
.dz-war-ground {
  fill: #12131f;
}

[data-war-layer] {
  pointer-events: none;
}

/* L'opacité des couleurs des camps se règle dans la légende (--dz-war-tint, de 0,2 à 1 ; 1 : le rendu d'origine). */
.dz-war-region {
  opacity: calc(0.55 * var(--dz-war-tint, 1));
}

.dz-war-region.is-neutral {
  opacity: calc(0.3 * var(--dz-war-tint, 1));
}

.dz-war-building {
  opacity: 0.8;
}

.dz-war-scorched {
  fill: #8f1a12;
  opacity: 0.52;
}

.dz-war-impact {
  fill: #b3261e;
  opacity: 0.5;
}

.dz-war-border {
  fill: none;
  stroke: #000;
  stroke-width: 2;
  opacity: 0.95;
  vector-effect: non-scaling-stroke;
}

.dz-war-mark {
  stroke: rgb(0 0 0 / 0.6);
  stroke-width: 0.15;
}

.dz-war-victory {
  fill: none;
  stroke: #ffd166;
  stroke-width: 0.12;
}

.dz-war-burnt {
  filter: sepia(1) saturate(6) hue-rotate(-30deg) brightness(0.8);
}

.dz-war-site {
  opacity: 0.55;
}

/* Une structure en ruine (sans camp ni chantier) : grise et estompée, pour ne pas passer pour un bâtiment debout. */
.dz-war-icon.is-ruin image,
.dz-war-icon.is-ruin .dz-war-mark {
  filter: grayscale(1) brightness(0.7);
  opacity: 0.4;
}

.dz-war-label,
.dz-war-title,
.dz-war-stat {
  fill: #fff;
  stroke: rgb(0 0 0 / 0.55);
  stroke-width: 0.25;
  paint-order: stroke;
  font-weight: 700;
  dominant-baseline: middle;
}

/* Les chiffres des pertes s'alignent selon leur camp : leur attribut text-anchor, posé par le script. */
.dz-war-label,
.dz-war-title {
  text-anchor: middle;
}

.dz-war-label-minor {
  font-weight: 400;
  fill: #e6e6e6;
}

/* Les pertes d'un hexagone : le rythme et le total, bien teintés de la couleur du camp, cerclés de sombre pour rester
   lisibles sur tous les fonds. */
.dz-war-loss .dz-war-stat {
  stroke: rgb(0 0 0 / 0.75);
  stroke-width: 0.9;
}

.dz-war-loss[data-side="wardens"] .dz-war-stat {
  fill: #9fc0ff;
}

.dz-war-loss[data-side="colonials"] .dz-war-stat {
  fill: #95eea4;
}

.dz-war-stat.is-total {
  font-weight: 600;
  opacity: 0.95;
}

/* Ce qui n'apparaît qu'au zoom (niveau posé sur le SVG par le script). */
.dz-war-map:not([data-zoom-level="2"]):not([data-zoom-level="3"]) .dz-war-detail,
.dz-war-map:not([data-zoom-level="2"]):not([data-zoom-level="3"]) .dz-war-label-major,
.dz-war-map:not([data-zoom-level="3"]) .dz-war-label-minor,
.dz-war-map[data-zoom-level="2"] [data-war-layer="ensemble"],
.dz-war-map[data-zoom-level="3"] [data-war-layer="ensemble"] {
  display: none;
}

/* Les pastilles des morts par heure : des anneaux qui s'élargissent et s'effacent, cycle de 7 s comme le bot. */
.dz-war-dot {
  stroke: rgb(0 0 0 / 0.55);
  stroke-width: 0.35;
}

.dz-war-ring {
  fill: none;
  stroke: var(--ring, #fff);
  stroke-width: 0.7;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: dz-war-pulse 7s ease-out infinite;
  animation-delay: var(--delay, 0s);
}

.dz-war-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: dz-war-breathe 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes dz-war-pulse {
  0% {
    opacity: var(--strength, 0.3);
    transform: scale(1);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(var(--spread, 2.4));
  }
}

@keyframes dz-war-breathe {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(1);
  }

  50% {
    opacity: var(--strength, 0.3);
    transform: scale(1.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dz-war-ring {
    display: none;
  }

  .dz-war-halo {
    animation: none;
    opacity: var(--strength, 0.3);
  }
}

/* La barre de temps, juste sous la carte. */
.dz-war-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 8px 0 16px;
}

.dz-war-timeline[hidden] {
  display: none;
}

.dz-war-timeline input[type="range"] {
  flex: 1 1 220px;
  min-height: 32px;
  accent-color: #f0a04b;
}

.dz-war-timeline [data-war-play] {
  min-width: 44px;
  min-height: 44px;
}

.dz-war-numbers {
  display: grid;
  gap: 12px;
}

.dz-war-numbers > h2 {
  margin: 0;
}

/* Les chiffres de chaque camp à sa couleur, dans les tableaux des pertes. */
.dz-war-numbers .is-wardens {
  color: #8eb7ff;
}

.dz-war-numbers .is-colonials {
  color: #7bf08d;
}

.dz-war-numbers td,
.dz-war-numbers thead th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dz-war-numbers td:last-child {
  font-weight: 700;
}

/* Des lignes serrées : le tableau des hexagones se lit d'un coup d'œil, et tient sur un téléphone sans défiler de côté. */
.dz-war-numbers .dz-table th,
.dz-war-numbers .dz-table td {
  padding: 7px 12px;
}

@media (max-width: 600px) {
  .dz-war-numbers .dz-table {
    font-size: 0.85rem;
  }

  .dz-war-numbers .dz-table th,
  .dz-war-numbers .dz-table td {
    padding: 6px 7px;
  }

  .dz-war-numbers .dz-table th {
    white-space: normal;
  }
}

/* Les hexagones, du plus meurtrier au moins meurtrier : une boîte qu'on fait défiler, l'en-tête reste visible. */
.dz-war-hexlist {
  max-height: 32rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--dz-line);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--dz-line) transparent;
}

.dz-war-hexlist:focus-visible {
  outline: 2px solid var(--dz-sky);
  outline-offset: 2px;
}

.dz-war-hextable {
  width: 100%;
  margin: 0;
}

.dz-war-hextable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--dz-surface-2, var(--dz-surface));
}

/* Les en-têtes trient : tout l'en-tête est le bouton, une flèche dit le sens du tri. */
.dz-war-sort {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  color: inherit;
  white-space: nowrap;
}

.dz-war-sort:focus-visible {
  outline: 2px solid var(--dz-sky);
  outline-offset: 2px;
}

.dz-war-sort::after {
  content: '↕';
  opacity: 0.35;
  font-size: 0.85em;
}

[aria-sort="ascending"] > .dz-war-sort::after {
  content: '▲';
  opacity: 0.9;
}

[aria-sort="descending"] > .dz-war-sort::after {
  content: '▼';
  opacity: 0.9;
}

.dz-war-hextable td,
.dz-war-hextable thead th {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dz-war-hextable tbody th,
.dz-war-hextable thead th[data-war-sort="name"] {
  text-align: left;
}

/* Le rang et son évolution sur six heures : ▲ monté, ▼ descendu. */
.dz-war-hextable .dz-war-rank {
  text-align: left;
  white-space: nowrap;
  color: var(--dz-muted, #9aa4b2);
}

.dz-war-trend {
  font-size: 0.75em;
}

.dz-war-trend.is-up {
  color: #ef4444;
}

.dz-war-trend.is-down {
  color: #34d399;
}

/* Tout le front, au-dessus des hexagones, en gras. */
.dz-war-front th,
.dz-war-front td {
  font-weight: 700;
  border-bottom: 2px solid var(--dz-line);
}

/* Le journal des villes : une ligne par événement, liseré et teinte du camp ; les plus anciens repliés. */
/* Une boîte qu'on fait défiler (comme foxholestats) : environ onze lignes, le reste en dessous. */
.dz-war-journal {
  max-height: 27rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: 32px;
  padding: 6px;
  border: 1px solid var(--dz-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--dz-night) 70%, transparent);
  scrollbar-width: thin;
  scrollbar-color: var(--dz-line) transparent;
  --wardens: #5b8fdc;
  --colonials: #5fa84a;
  --neutral: #8a94a3;
}

.dz-war-feed {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dz-war-event {
  --camp: var(--neutral);
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2px 14px;
  padding: 7px 12px;
  border-left: 3px solid var(--camp);
  border-radius: 6px;
  background: color-mix(in srgb, var(--camp) 9%, var(--dz-surface));
  font-size: 0.92rem;
}

.dz-war-event[data-team="wardens"] {
  --camp: var(--wardens);
}

.dz-war-journal:focus-visible {
  outline: 2px solid var(--dz-sky);
  outline-offset: 2px;
}

/* La dernière arrivée, en haut, reste surlignée. */
.dz-war-feed > .dz-war-event:first-child {
  background: color-mix(in srgb, var(--camp) 22%, var(--dz-surface-2, var(--dz-surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--camp) 45%, transparent);
}

/* Un événement arrivé en direct (guerre.js) s'allume puis se fond dans la liste. */
.dz-war-event-new {
  animation: dz-war-arrival 8s ease-out;
}

@keyframes dz-war-arrival {
  0%,
  15% {
    background: color-mix(in srgb, var(--camp) 55%, var(--dz-surface));
    box-shadow: 0 0 18px color-mix(in srgb, var(--camp) 60%, transparent), inset 0 0 0 1px var(--camp);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dz-war-event-new {
    animation: none;
  }
}

.dz-war-event[data-team="colonials"] {
  --camp: var(--colonials);
}

/* Un chantier : la ligne hachurée en diagonale aux couleurs de son camp, comme les régions en construction sur la carte. */
.dz-war-event[data-kind="building"] {
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--camp) 30%, transparent) 0 4px, transparent 4px 10px),
    color-mix(in srgb, var(--camp) 7%, var(--dz-surface));
}

/* Une prise de moins d'une heure ressort, de moins en moins (--recent, de 1 à 0, posé par la page). */
.dz-war-event-recent {
  background: color-mix(in srgb, var(--camp) calc(9% + 40% * var(--recent, 0)), var(--dz-surface));
  box-shadow: 0 0 calc(14px * var(--recent, 0)) color-mix(in srgb, var(--camp) calc(60% * var(--recent, 0)), transparent), inset 0 0 0 1px color-mix(in srgb, var(--camp) calc(70% * var(--recent, 0)), transparent);
}

/* Sur la carte, le voile d'une prise récente (son opacité baisse avec l'heure) et le disque hachuré d'un chantier. */
.dz-war-fresh {
  pointer-events: none;
  mix-blend-mode: screen;
}

.dz-war-site-hatch {
  stroke: rgba(10, 14, 25, 0.8);
  stroke-width: 0.5;
}

.dz-war-event-tag {
  justify-self: start;
  padding: 1px 8px;
  border: 1px solid color-mix(in srgb, var(--camp) 60%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--camp) 55%, #fff);
  font: 700 0.72rem/1.6 var(--dz-display);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Une construction est moins forte qu'une prise : étiquette pleine pour prise et perte, en creux pour le chantier. */
.dz-war-event[data-kind="taken"] .dz-war-event-tag,
.dz-war-event[data-kind="lost"] .dz-war-event-tag {
  background: color-mix(in srgb, var(--camp) 28%, transparent);
}

.dz-war-event-place {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* L'icône du bâtiment : la vraie icône de la carte, aux couleurs du camp qui la tient ; pâlie en construction. */
.dz-war-event-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.45em;
  vertical-align: -0.38em;
}

.dz-war-event-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgb(0 0 0 / 0.8));
}

.dz-war-event-icon[data-state="building"] img {
  opacity: 0.6;
}

/* Une perte ou une destruction : le panneau en gris, l'étiquette « Perdue » reste de la couleur du camp. */
.dz-war-event[data-kind="lost"],
.dz-war-event[data-kind="destroyed"] {
  background: color-mix(in srgb, #8b93a1 16%, var(--dz-surface));
  color: #b9c0cc;
}

.dz-war-event[data-kind="lost"] .dz-war-event-icon img,
.dz-war-event[data-kind="destroyed"] .dz-war-event-icon img {
  filter: grayscale(0.35) drop-shadow(0 0 1px rgb(0 0 0 / 0.8));
}

/* Le journal dans la fiche d'un hexagone : les mêmes panneaux, sur deux rangs (l'étiquette et l'heure, puis le lieu et
   le camp) pour tenir dans la largeur de la fiche. */
.dz-war-panel-journal {
  max-height: 22rem;
  margin-bottom: 4px;
  padding: 4px;
}

.dz-war-panel-journal .dz-war-event {
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 6px 8px;
  font-size: 0.86rem;
}

/* Le nom du bâtiment sur une ligne, son lieu dessous. */
.dz-war-panel-journal .dz-war-event-place {
  white-space: normal;
}

.dz-war-panel-journal .dz-war-event-place b {
  white-space: nowrap;
}

.dz-war-panel-journal .dz-war-event-hex {
  display: block;
  margin-left: 1.8em;
}

.dz-war-panel-journal .dz-war-event-when {
  justify-self: end;
  grid-column: 2;
  grid-row: 1;
}

.dz-war-panel-journal .dz-war-event-team {
  justify-self: end;
}

.dz-war-event-hex {
  margin-left: 0.5em;
  color: var(--dz-muted);
  font-size: 0.85rem;
}

.dz-war-event-team {
  color: color-mix(in srgb, var(--camp) 55%, #fff);
  font-size: 0.85rem;
}

.dz-war-event-when {
  color: var(--dz-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sur téléphone, deux rangs : l'étiquette et l'heure, puis le lieu et le camp. */
@media (max-width: 600px) {
  .dz-war-event {
    grid-template-columns: auto 1fr;
  }

  .dz-war-event-when {
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .dz-war-event-team {
    justify-self: end;
  }
}

.dz-war-list {
  padding-left: 1.2em;
}

/* Sans script, les zones montrent les bordures ; avec, elles ne s'allument qu'au survol et au focus. */
/* Pas de cadre rectangulaire du navigateur autour d'un hexagone cliqué : le surlignage suit la forme de l'hexagone. */
.dz-war-hexes polygon {
  fill: transparent;
  stroke: rgb(255 255 255 / 0.2);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
}

.dz-war-hexes polygon[data-war-selected],
.dz-war-drawn .dz-war-hexes polygon[data-war-selected] {
  fill: rgb(255 209 102 / 0.08);
  stroke: #ffd166;
  stroke-width: 3;
}

.dz-war-drawn .dz-war-hexes polygon {
  stroke: transparent;
}

/* Pas de surbrillance au survol de la souris : seulement au clavier, pour savoir où l'on est. */
.dz-war-hexes polygon:focus-visible,
.dz-war-drawn .dz-war-hexes polygon:focus-visible {
  fill: rgb(255 209 102 / 0.1);
  stroke: #ffd166;
  stroke-width: 2;
  outline: none;
}

/* Les graphiques de la fiche d'un hexagone, l'un sous l'autre dans sa largeur. */
.dz-war-panel-chart {
  margin: 8px 0 0;
}

.dz-war-panel-chart .dz-war-chart-svg {
  width: 100%;
  height: auto;
}

.dz-war-chart {
  margin-bottom: 32px;
}

.dz-war-chart[hidden] {
  display: none;
}

.dz-war-chart-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.dz-war-chart-tools [aria-pressed="true"] {
  outline: 2px solid #f0a04b;
}

.dz-war-chart-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto;
  color: var(--dz-muted);
  font-size: 0.9rem;
}

.dz-war-chart-keys .dz-war-key-colonials {
  margin-left: 10px;
}

/* Les deux graphiques côte à côte sur un écran large, l'un sous l'autre sur un téléphone. */
/* Un graphique par ligne, sur toute la largeur. */
.dz-war-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.dz-war-chart-box {
  margin: 0;
  padding: 10px 12px 6px;
  border: 1px solid var(--dz-line);
  border-radius: 10px;
  background: var(--dz-surface);
}

.dz-war-chart-box figcaption {
  margin-bottom: 4px;
  font-weight: 700;
}

/* Dessiné à la taille réelle du cadre (site/guerre.js) : le texte garde sa taille sur tous les écrans. */
.dz-war-chart-svg {
  display: block;
  width: 100%;
  height: 260px;
  overflow: visible;
  touch-action: pan-y;
}

.dz-war-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.dz-war-line-wardens {
  stroke: #6fa0e8;
}

.dz-war-line-colonials {
  stroke: #8cc46f;
}

.dz-war-area-wardens {
  fill: rgb(111 160 232 / 0.1);
}

.dz-war-area-colonials {
  fill: rgb(140 196 111 / 0.1);
}

.dz-war-line-players {
  stroke: #f0a04b;
}

.dz-war-area-players {
  fill: rgb(240 160 75 / 0.12);
}

.dz-war-axis {
  stroke: var(--dz-line);
}

.dz-war-grid {
  stroke: rgb(255 255 255 / 0.07);
}

.dz-war-tick {
  fill: var(--dz-muted, #9fb1c6);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Au survol : un trait à l'instant visé, un point par courbe et une étiquette avec les valeurs. */
.dz-war-cursor line {
  stroke: rgb(255 255 255 / 0.45);
  stroke-dasharray: 3 3;
}

.dz-war-cursor circle {
  stroke: #0b121c;
  stroke-width: 2;
}

.dz-war-cursor rect {
  fill: rgb(10 14 25 / 0.92);
  stroke: rgb(255 255 255 / 0.2);
}

.dz-war-cursor text {
  fill: #e6ebf2;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dz-war-key {
  display: inline-block;
  width: 12px;
  height: 4px;
  vertical-align: middle;
}

.dz-war-key-wardens {
  background: #6fa0e8;
}

.dz-war-key-colonials {
  background: #8cc46f;
}

/* ---- Bonus d'invasion et trajectoires de roquettes (calques de la carte). */
.dz-war-invasion {
  stroke: #ff2222;
  stroke-width: 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px #ff0000);
}

.dz-war-rocket {
  fill: none;
  stroke-width: 1.5;
  stroke-dasharray: 7 4;
  vector-effect: non-scaling-stroke;
}

/* ---- Les cadres posés sur la carte (comme sur la carte du bot), sous la carte sur un écran étroit. */
.dz-war-hud {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.85rem;
}

.dz-war-hud[hidden] {
  display: none;
}

.dz-war-hud-box,
.dz-war-hud-side {
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 10px;
  background: rgb(10 14 25 / 0.82);
}

.dz-war-hud-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}

.dz-war-hud-right {
  display: grid;
  gap: 8px;
  align-content: start;
}

/* Le cadre des pertes : une ligne par chiffre, le rythme sur la même ligne que le total (nom, total, pastille et /h). */
.dz-war-hud-stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 3px;
}

.dz-war-hud-row {
  display: contents;
}

.dz-war-hud-row > span:first-child {
  min-width: 0;
  white-space: nowrap;
}

.dz-war-hud-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Le territoire n'a pas de rythme : sa part prend aussi la place de la pastille. */
.dz-war-hud-land strong {
  grid-column: 2 / 4;
}

.dz-war-hud-rate {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  min-width: 4rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #d8dde6;
}

/* Assez grande pour voir pulser les anneaux (le cœur fait ~8 px), sans écarter les lignes. */
.dz-war-hud-dot {
  width: 18px;
  height: 18px;
  margin: -3px 0;
  overflow: visible;
}

.dz-war-hud-row.is-wardens,
.dz-war-hud-side.is-wardens .dz-war-hud-vp {
  color: #8eb7ff;
}

.dz-war-hud-row.is-colonials,
.dz-war-hud-side.is-colonials .dz-war-hud-vp {
  color: #7bf08d;
}

/* Les villes tenues en attente de garnison, à côté du compte. */
.dz-war-hud-wait {
  margin-left: 4px;
  font-size: 0.75em;
  opacity: 0.7;
}

/* Le territoire se teinte du camp en tête, de plus en plus entre 50 et 65 %. */
.dz-war-hud-land.is-wardens strong {
  color: color-mix(in srgb, #8eb7ff calc(var(--strength, 0) * 100%), #fff);
}

.dz-war-hud-land.is-colonials strong {
  color: color-mix(in srgb, #7bf08d calc(var(--strength, 0) * 100%), #fff);
}

.dz-war-hud-title {
  text-align: center;
}

.dz-war-hud-title h2 {
  margin: 0;
  font-size: 1.15rem;
}

.dz-war-hud-title p {
  margin: 2px 0 0;
  color: #c9d1dc;
}

/* Les cadres des camps (hauts faits et villes de victoire), un peu plus petits que les autres cadres : ils couvrent la
   carte. */
.dz-war-hud-side {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 7px 9px;
}

.dz-war-feats {
  display: flex;
  gap: 5px;
}

/* Un haut fait : une case grise qui se remplit de bas en haut à la couleur du camp, l'insigne (blanc) aussi. */
.dz-war-feat {
  position: relative;
  width: 23px;
  height: 23px;
  border: 1px solid rgb(255 255 255 / 0.9);
  border-radius: 4px;
  background: linear-gradient(to top, var(--tint) var(--fill, 0%), rgb(205 205 205 / 0.54) var(--fill, 0%));
}

.dz-war-feat::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: linear-gradient(to top, var(--tint-deep) var(--fill, 0%), #fff var(--fill, 0%));
  -webkit-mask: var(--mask, none) center / contain no-repeat;
  mask: var(--mask, none) center / contain no-repeat;
}

.dz-war-feat:not([style*="--mask"])::after {
  display: none;
}

/* Un haut fait accompli garde son contour blanc ; un second contour, à l'intérieur, un peu plus sombre que le
   remplissage, le distingue. Pas de lueur autour. */
.dz-war-feat.is-done {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tint) 55%, #000);
}

.dz-war-hud-vp {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.2rem;
}

.dz-war-hud-flag {
  width: 27px;
  height: 27px;
}

.dz-war-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}

.dz-war-legend-row + .dz-war-legend-row {
  margin-top: 6px;
}

/* Chaque ligne de la légende se survole : ce qu'elle désigne clignote sur la carte ; un clic la montre ou la masque
   (aria-pressed). Masquée, elle pâlit et sa marque passe en gris. */
.dz-war-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: -2px -4px;
  padding: 2px 4px;
  border-radius: 5px;
  cursor: help;
  outline: none;
}

.dz-war-legend-item[role="button"] {
  cursor: pointer;
  user-select: none;
}

.dz-war-legend-item[aria-pressed="false"]:not(.dz-war-legend-cat) {
  opacity: 0.45;
}

.dz-war-legend-item[aria-pressed="false"]:not(.dz-war-legend-cat) > :first-child {
  filter: grayscale(1);
}

/* L'en-tête : le nom et le bouton des cadres, à droite. Cadres masqués (data-bare sur les cadres) : il reste seul. */
.dz-war-legend-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dz-war-legend-name {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c9d1dc;
}

.dz-war-legend-body {
  margin-top: 6px;
}

.dz-war-legend-frames,
.dz-war-legend-all,
.dz-war-legend-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  color: #e8ecf2;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.dz-war-legend-frames:hover,
.dz-war-legend-all:hover,
.dz-war-legend-more:hover,
.dz-war-legend-frames:focus-visible,
.dz-war-legend-all:focus-visible,
.dz-war-legend-more:focus-visible {
  border-color: #ffd166;
  outline: none;
}

.dz-war-legend-frames[aria-pressed="true"],
.dz-war-legend-all[aria-pressed="true"] {
  border-color: rgb(255 209 102 / 0.7);
  color: #ffd166;
}

.dz-war-legend-all[aria-pressed="mixed"] {
  border-color: rgb(255 209 102 / 0.45);
  color: #f5d38a;
}

.dz-war-legend-row.is-heading {
  justify-content: space-between;
}

.dz-war-legend-row.is-heading .dz-war-legend-title {
  margin: 0;
}

.dz-war-legend-more {
  margin-top: 8px;
  width: 100%;
  justify-content: space-between;
}

.dz-war-legend-more[aria-expanded="true"] .dz-war-legend-chevron {
  transform: rotate(90deg);
}

.dz-war-legend-chevron {
  transition: transform 0.2s ease;
}

/* L'opacité des couleurs des camps, sous leurs lignes. */
.dz-war-legend-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #c9d1dc;
}

.dz-war-legend-range input {
  flex: 1 1 auto;
  min-width: 70px;
  accent-color: #f0a04b;
}

.dz-war-legend-range output {
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Les marques des lignes : signes des noms, bandes des zones, contour des frontières, pastille des pertes. */
.dz-war-legend-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 13px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.dz-war-legend-glyph.is-minor {
  font-weight: 400;
  color: #d6d6d6;
}

.dz-war-legend-glyph.is-zones {
  width: 18px;
  border-radius: 2px;
  background: linear-gradient(to right, rgb(239 68 68 / 0.75) 0 40%, transparent 40%), repeating-linear-gradient(135deg, rgb(245 158 11 / 0.9) 0 2px, transparent 2px 4px);
}

.dz-war-legend-glyph.is-borders {
  width: 15px;
  border: 2px solid #000;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25);
}

.dz-war-legend-glyph.is-losses {
  min-width: 10px;
  width: 10px;
  height: 10px;
  margin: 0 2px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.3);
}

.dz-war-legend-glyph.is-frames {
  min-width: 0;
}

/* « Légende » éteint : les autres cadres disparaissent sans libérer leur place (la légende ne bouge pas), le corps de la
   légende se replie sur son bouton. */
.dz-war-hud[data-bare] .dz-war-hud-left,
.dz-war-hud[data-bare] .dz-war-hud-center {
  visibility: hidden;
}

.dz-war-hud[data-bare] .dz-war-hud-right > :not(.dz-war-hud-legend),
.dz-war-hud[data-bare] .dz-war-legend-body {
  display: none;
}

.dz-war-hud[data-bare] .dz-war-hud-legend {
  justify-self: end;
}

.dz-war-legend-item:hover,
.dz-war-legend-item:focus-visible {
  background: rgb(255 255 255 / 0.1);
}

.dz-war-legend-item:focus-visible {
  box-shadow: 0 0 0 1px #ffd166;
}

/* Bonus d'invasion et trajectoire de roquette sur la même ligne. */
.dz-war-legend-row.is-single {
  flex-wrap: nowrap;
  gap: 4px 10px;
  white-space: nowrap;
}

.dz-war-legend-heading {
  color: #c9d1dc;
}

.dz-war-legend-row + .dz-war-legend-medals {
  margin-top: 2px;
}

.dz-war-legend-medal {
  width: 18px;
  height: 24px;
  margin: -6px 0 -2px;
  overflow: visible;
}

/* Les camps en hexagones, comme sur la carte. */
.dz-war-legend-hex {
  width: 15px;
  height: 13px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.dz-war-legend-hex.is-colonials {
  background: #2ea93a;
}

.dz-war-legend-hex.is-wardens {
  background: #2e67cc;
}

.dz-war-legend-hex.is-neutral {
  background: #6b6b6b;
}

/* ---- Ce que la légende fait clignoter (site/guerre-carte.js pose data-war-flash sur la carte). */
@keyframes dz-war-flash {
  from {
    opacity: 1;
  }

  to {
    opacity: 0.15;
  }
}

@keyframes dz-war-glow {
  from {
    opacity: 0.2;
  }

  to {
    opacity: 1;
  }
}

.dz-war-map[data-war-flash="wardens"] .dz-war-region[data-team="wardens"],
.dz-war-map[data-war-flash="colonials"] .dz-war-region[data-team="colonials"],
.dz-war-map[data-war-flash="neutral"] .dz-war-region[data-team="neutral"],
.dz-war-map[data-war-flash="invasion"] .dz-war-invasion,
.dz-war-map[data-war-flash="roquettes"] .dz-war-rocket,
.dz-war-map[data-war-flash="roquettes"] .dz-war-target,
.dz-war-map[data-war-flash="roquettes"] .dz-war-icon.is-rocket,
.dz-war-map[data-war-flash="top"] .dz-war-medal-mark,
.dz-war-map[data-war-flash="top-1"] .dz-war-medal-mark[data-rank="1"],
.dz-war-map[data-war-flash="top-2"] .dz-war-medal-mark[data-rank="2"],
.dz-war-map[data-war-flash="top-3"] .dz-war-medal-mark[data-rank="3"],
.dz-war-map[data-war-flash="type"] .dz-war-icon[data-flash],
.dz-war-map[data-war-flash="hexnames"] .dz-war-title,
.dz-war-map[data-war-flash="major"] .dz-war-label-major,
.dz-war-map[data-war-flash="minor"] .dz-war-label-minor,
.dz-war-map[data-war-flash="zones"] .dz-war-decay-band,
.dz-war-map[data-war-flash="zones"] .dz-war-nobuild-band,
.dz-war-map[data-war-flash="borders"] .dz-war-border,
.dz-war-map[data-war-flash="losses"] .dz-war-loss,
.dz-war-map[data-war-flash="family-important"] .dz-war-icon.is-important,
.dz-war-map[data-war-flash="family-secondary"] .dz-war-icon.is-secondary,
.dz-war-map[data-war-flash="family-resources"] .dz-war-icon.is-resource {
  animation: dz-war-flash 0.45s ease-in-out infinite alternate;
}

/* Survolés dans la légende, les noms, les pertes et les structures d'une catégorie se voient à tout zoom. */
.dz-war-map[data-war-flash="major"] .dz-war-label-major,
.dz-war-map[data-war-flash="minor"] .dz-war-label-minor,
.dz-war-map[data-war-flash="family-important"] .dz-war-icon.is-important,
.dz-war-map[data-war-flash="family-secondary"] .dz-war-icon.is-secondary,
.dz-war-map[data-war-flash="family-resources"] .dz-war-icon.is-resource {
  display: inline !important;
}

.dz-war-map[data-war-flash="hexnames"] [data-war-layer="ensemble"],
.dz-war-map[data-war-flash="losses"] [data-war-layer="ensemble"] {
  display: inline !important;
}

.dz-war-map[data-war-flash="borders"] .dz-war-border {
  stroke-width: 3;
}

/* Les structures d'un type survolé dans la légende des icônes : visibles à tout zoom, même masquées par les réglages. */
.dz-war-map[data-war-flash="type"] .dz-war-icon[data-flash] {
  display: inline !important;
}

/* Les plus meurtriers : leur contour s'allume en plus de la médaille. */
.dz-war-top-hex {
  fill: rgb(255 209 102 / 0.12);
  stroke: #ffd166;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.dz-war-map[data-war-flash="top"] .dz-war-top-hex,
.dz-war-map[data-war-flash="top-1"] .dz-war-top-hex[data-rank="1"],
.dz-war-map[data-war-flash="top-2"] .dz-war-top-hex[data-rank="2"],
.dz-war-map[data-war-flash="top-3"] .dz-war-top-hex[data-rank="3"] {
  animation: dz-war-glow 0.45s ease-in-out infinite alternate;
}

/* Le bonus d'invasion et les roquettes s'épaississent aussi, pour se voir même petits. */
.dz-war-map[data-war-flash="invasion"] .dz-war-invasion {
  stroke-width: 8;
}

.dz-war-map[data-war-flash="roquettes"] .dz-war-rocket {
  stroke-width: 4;
}

@media (prefers-reduced-motion: reduce) {
  .dz-war-map[data-war-flash] * {
    animation-duration: 1.2s !important;
  }
}

/* ---- Bulles : le début exact de la guerre sur le jour réel, et la structure sous le pointeur. */
.dz-war-tipped {
  position: relative;
  border-bottom: 1px dotted rgb(255 255 255 / 0.5);
  cursor: help;
  outline: none;
}

.dz-war-tipped:focus-visible {
  box-shadow: 0 0 0 1px #ffd166;
}

.dz-war-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  width: max-content;
  max-width: 260px;
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 8px;
  background: rgb(10 14 25 / 0.96);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
  color: #e6ebf2;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  transform: translateX(-50%);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.dz-war-tipped:hover .dz-war-tip,
.dz-war-tipped:focus-visible .dz-war-tip {
  visibility: visible;
  opacity: 1;
}

.dz-war-itemtip {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 1px;
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-left: 3px solid var(--camp, #8a94a3);
  border-radius: 8px;
  background: rgb(10 14 25 / 0.94);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
  font-size: 0.82rem;
  pointer-events: none;
}

.dz-war-itemtip[hidden] {
  display: none;
}

.dz-war-itemtip[data-team="wardens"] {
  --camp: #4ba0ff;
}

.dz-war-itemtip[data-team="colonials"] {
  --camp: #4be85c;
}

.dz-war-itemtip span:nth-child(2) {
  color: color-mix(in srgb, var(--camp, #8a94a3) 55%, #fff);
}

.dz-war-legend-bar {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: #ff2222;
  box-shadow: 0 0 6px #ff0000;
}

.is-invasion {
  color: #ff8a8a;
}

.dz-war-legend-arc {
  width: 30px;
  height: 10px;
  border-top: 2px dashed #ff8800;
  border-radius: 50% 50% 0 0;
}

.is-rocket {
  color: #ffcc66;
}

.dz-war-hud-rockets h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: #ffcc66;
}

.dz-war-hud-rockets ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dz-war-hud-rockets li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dz-war-hud-rockets p {
  margin: 4px 0 0;
}

.dz-war-hud-target img {
  width: 16px;
  height: 16px;
  margin-right: 5px;
  vertical-align: -3px;
}

/* Sur un grand écran, les cadres se posent sur la carte : pertes à gauche, camps et titre au centre, légende et
   roquettes à droite. Les deux colonnes des côtés ont la même part : le centre tombe au milieu de la carte, quelle que
   soit la largeur des cadres. Ils laissent passer le pointeur (on glisse la carte à travers). */
@media (min-width: 1100px) {
  .dz-war-hud {
    position: absolute;
    inset: 16px 10px auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 0;
    pointer-events: none;
  }

  .dz-war-hud-left {
    justify-self: start;
    width: 272px;
  }

  /* Le titre au milieu exact : les deux camps de part et d'autre, dans deux colonnes de même largeur. */
  .dz-war-hud-center {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    width: max-content;
  }

  .dz-war-hud-center > .is-wardens {
    justify-self: end;
  }

  .dz-war-hud-center > .is-colonials {
    justify-self: start;
  }

  /* À la largeur de la légende (la ligne invasion et roquette ne se coupe pas), 290 px au moins. */
  .dz-war-hud-right {
    justify-self: end;
    width: max-content;
    min-width: 290px;
    max-width: 380px;
  }

  /* Un écran peu haut : des boutons plus petits, pour que leur colonne passe sous le cadre des pertes. */
  @media (max-height: 860px) {
    .dz-war-tools {
      gap: 4px;
    }

    .dz-war-tools button {
      min-width: 34px;
      min-height: 34px;
      font-size: 1rem;
    }
  }

  .dz-war-hud.has-panel .dz-war-hud-right {
    visibility: hidden;
  }

  .dz-war-hud-box,
  .dz-war-hud-side {
    pointer-events: auto;
  }
}

/* Dézoomé à fond : la carte ne garde que les villes de victoire (en haut des hexagones), les pastilles et les roquettes ;
   les icônes reviennent au premier palier de zoom. */
.dz-war-map:not([data-zoom-level="2"]):not([data-zoom-level="3"]) .dz-war-icon:not(.is-rocket) {
  display: none;
}

.dz-war-vp.is-burnt image {
  filter: sepia(1) saturate(6) hue-rotate(-30deg) brightness(0.8);
}

/* Une ville de victoire tenue qui ne compte pas encore (garnison provisoire en cours, ou chantier) : estompée, et son
   anneau en pointillés. */
.dz-war-vp.is-pending image {
  opacity: 0.45;
}

.dz-war-victory.is-pending {
  stroke-dasharray: 0.5 0.4;
  opacity: 0.7;
}

.dz-war-target circle,
.dz-war-target line {
  stroke-width: 1.4;
}

.dz-war-target text {
  font-weight: 700;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgb(0 0 0 / 0.6);
  stroke-width: 0.6;
}

/* ---- Outils de mesure */
.dz-war-viewport.is-measuring {
  cursor: crosshair;
}

/* Au-dessus d'une mesure : la déplacer (point, centre) ou l'étirer (bord du cercle). */
.dz-war-viewport[data-war-cursor="move"] {
  cursor: move;
}

.dz-war-viewport[data-war-cursor="resize"] {
  cursor: ew-resize;
}

.dz-war-measure {
  stroke: #ffd166;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.dz-war-measure-point {
  fill: #ffd166;
  stroke: #000;
  stroke-width: 0.4;
}

.dz-war-range {
  fill: rgb(255 138 61 / 0.12);
  stroke: #ff8a3d;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.dz-war-measure-label text {
  fill: #fff;
  stroke: rgb(0 0 0 / 0.75);
  stroke-width: 0.6;
  paint-order: stroke;
  font-weight: 700;
  text-anchor: middle;
}

.dz-war-tools {
  flex-wrap: wrap;
  max-height: calc(100% - 20px);
}

.dz-war-tools-gap {
  height: 6px;
}

/* Couleurs des camps : pointillés quand seules les icônes restent en couleur, bouton pâli quand tout est neutre. */
.dz-war-tools [data-war-zoom="couleurs"][aria-pressed="mixed"] {
  outline: 2px dashed #ffd166;
}

.dz-war-tools [data-war-zoom="couleurs"][aria-pressed="false"] {
  opacity: 0.6;
}

/* Le bouton des outils tactiques : souligné quand son sous-menu est ouvert ou qu'un de ses outils est en cours. */
.dz-war-tools [data-war-measure="outils"][aria-expanded="true"],
.dz-war-tools [data-war-measure="outils"][data-war-active-tool] {
  outline: 2px solid #ffd166;
}

/* Le sous-menu des outils tactiques, à côté de la barre : les trois outils, puis les calques tout en bas. */
.dz-war-toolmenu {
  position: absolute;
  left: 74px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(340px, calc(100% - 90px));
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 8px;
  background: rgb(10 14 25 / 0.92);
  font-size: 0.85rem;
}

.dz-war-toolmenu[hidden] {
  display: none;
}

.dz-war-toolmenu-title {
  margin: 0;
  color: #ffd166;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dz-war-toolmenu .dz-war-toolmenu-item {
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  background: rgb(11 18 28 / 0.85);
  text-align: left;
}

.dz-war-toolmenu-item[aria-pressed="true"] {
  outline: 2px solid #ffd166;
}

/* La recherche d'un lieu : le champ, puis les lieux trouvés (nom, hexagone). */
.dz-war-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dz-war-search-result {
  all: unset;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgb(11 18 28 / 0.85);
  cursor: pointer;
}

.dz-war-search-result span {
  color: #9aa4b2;
}

.dz-war-search-result:hover,
.dz-war-search-result:focus-visible {
  outline: 2px solid #ffd166;
}

/* Le lieu trouvé, entouré sur la carte. */
.dz-war-found circle {
  fill: none;
  stroke: #ffd166;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  animation: dz-war-found 1.4s ease-out 3;
}

@keyframes dz-war-found {
  0% {
    stroke-opacity: 1;
    stroke-width: 6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dz-war-found circle {
    animation: none;
  }
}

/* Ce que la légende masque (site/guerre.js pose data-hide-* sur la carte). */
.dz-war-map[data-hide-important] .dz-war-icon.is-important,
.dz-war-map[data-hide-secondary] .dz-war-icon.is-secondary,
.dz-war-map[data-hide-resources] .dz-war-icon.is-resource,
.dz-war-map[data-hide-hexnames] .dz-war-title,
.dz-war-map[data-hide-hexnames] .dz-war-medal-mark,
.dz-war-map[data-hide-major] .dz-war-label-major,
.dz-war-map[data-hide-minor] .dz-war-label-minor,
.dz-war-map[data-hide-borders] .dz-war-border,
.dz-war-map[data-hide-invasion] .dz-war-invasion,
.dz-war-map[data-hide-rockets] .dz-war-rocket,
.dz-war-map[data-hide-rockets] .dz-war-target,
.dz-war-map[data-hide-rockets] .dz-war-icon.is-rocket,
.dz-war-map[data-hide-losses] .dz-war-loss {
  display: none;
}

/* Les calques : ajouter, ceux qui sont sur la carte, puis le calque en édition. */
.dz-war-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

.dz-war-layers select,
.dz-war-layers input {
  width: 100%;
  padding: 2px 6px;
}

.dz-war-layers select:disabled {
  opacity: 0.55;
}

.dz-war-active {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dz-war-active li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dz-war-active li span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dz-war-active li.is-editing span {
  color: #ffd166;
  font-weight: 600;
}

.dz-war-active button {
  min-width: 30px;
  min-height: 30px;
  padding: 0 6px;
}

.dz-war-active button[aria-pressed="true"] {
  outline: 2px solid #ffd166;
}

.dz-war-active-empty,
.dz-war-layers-help {
  color: #9aa3b2;
}

.dz-war-layers-help {
  margin: 0;
  font-size: 0.78rem;
}

.dz-war-layer-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dz-war-layer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dz-war-layer-actions button {
  min-height: 32px;
  padding: 0 8px;
}

.dz-war-measure-preview {
  stroke: #ffd166;
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  opacity: 0.75;
  vector-effect: non-scaling-stroke;
}

.dz-war-range-min {
  fill: rgb(10 14 25 / 0.35);
  stroke: #ff8a3d;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

/* Les portées du télémètre, à côté de la barre d'outils. */
.dz-war-range-bar {
  position: absolute;
  left: 74px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 8px;
  background: rgb(10 14 25 / 0.88);
  font-size: 0.85rem;
}

.dz-war-range-bar[hidden] {
  display: none;
}

.dz-war-range-bar input {
  width: 76px;
  padding: 2px 6px;
}

/* La taille et l'opacité de la règle ou du télémètre, dans sa barre. */
.dz-war-range-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dz-war-range-bar input[type="range"] {
  width: 96px;
  padding: 0;
  accent-color: #f0a04b;
}

/* ---- Calque tactique : la barre, en bas de la carte entre les boutons et la mention du bot (en haut, les cadres la
   couvriraient sur grand écran), avec son aide ; et les dessins, épais et cerclés de noir pour rester lisibles dans un
   stream. */
.dz-war-tactic-bar {
  position: absolute;
  bottom: 10px;
  left: 74px;
  right: 290px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 8px;
  background: rgb(10 14 25 / 0.88);
  font-size: 0.85rem;
}

.dz-war-tactic-bar[hidden] {
  display: none;
}

.dz-war-tactic-group {
  display: flex;
  gap: 4px;
}

.dz-war-tactic-bar button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 6px;
  background: rgb(11 18 28 / 0.85);
}

.dz-war-tactic-bar [aria-pressed="true"] {
  outline: 2px solid #ffd166;
}

.dz-war-tactic-login {
  margin: 0;
}

.dz-war-tactic-login a {
  color: #ffd166;
}

/* Le calque ouvert par un lien : de qui il est, en haut de la carte. */
.dz-war-layer-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 5px 6px 5px 12px;
  border: 1px solid rgb(240 160 75 / 0.6);
  border-radius: 8px;
  background: rgb(10 14 25 / 0.92);
  color: #ffd9a8;
  font-size: 0.9rem;
  transform: translateX(-50%);
}

.dz-war-layer-banner[hidden] {
  display: none;
}

/* Sur un écran large, sous les cadres du haut de la carte. */
@media (min-width: 1100px) {
  .dz-war-layer-banner {
    top: 96px;
  }
}

.dz-war-tactic-bar [data-war-tactic-slot][hidden] {
  display: none;
}

.dz-war-tactic-bar [data-war-tactic-slot] .dz-war-swatch {
  background: var(--swatch, transparent);
}

/* Le sélecteur de couleur du navigateur, caché sous le bouton 🎨 : un clic sur le bouton l'ouvre. */
.dz-war-tactic-custom {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  cursor: pointer;
}

.dz-war-tactic-bar .dz-war-tactic-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.dz-war-tactic-custom:focus-within {
  outline: 2px solid #ffd166;
}

.dz-war-tactic-bar input {
  width: 120px;
  padding: 2px 6px;
}

.dz-war-tactic-help {
  flex: 1 0 100%;
  margin: 0;
  color: #ffd166;
  font-size: 0.8rem;
}

.dz-war-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  border-radius: 50%;
  vertical-align: middle;
}

.dz-war-tactic-edge,
.dz-war-tactic-line {
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* La taille de chaque dessin (--size, posé sur son groupe) épaissit ses traits. */
.dz-war-tactic-edge {
  fill: none;
  stroke: rgb(0 0 0 / 0.85);
  stroke-width: calc(8px * var(--size, 1));
}

.dz-war-tactic-line {
  stroke-width: calc(4px * var(--size, 1));
}

.dz-war-tactic-line:not(.dz-war-tactic-zone) {
  fill: none;
}

/* Les zones : le contour dans le groupe de la zone, le remplissage partagé par les zones d'une même couleur (un seul
   chemin, la teinte ne fonce pas où elles se chevauchent). */
.dz-war-tactic-zone {
  fill: none;
}

.dz-war-tactic-fill {
  fill-opacity: 0.25;
  pointer-events: none;
}

.dz-war-tactic-fill.is-air {
  fill-opacity: 0.12;
}

/* Le premier point d'une zone en cours : y revenir la ferme. */
.dz-war-zone-start {
  fill: rgb(255 255 255 / 0.25);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Air : des points (tirets nuls aux bouts ronds) et, dessous, l'ombre décalée du trait, comme s'il volait au-dessus de
   la carte. Mer : un trait plus large creusé d'un filet sombre, deux traits de la couleur. Terre : le trait plein. */
.dz-war-tactic-edge.is-air,
.dz-war-tactic-line.is-air {
  stroke-dasharray: 0.1 11;
}

.dz-war-tactic-shadow {
  fill: none;
  stroke: rgb(0 0 0 / 0.5);
  stroke-width: 6;
  stroke-dasharray: 0.1 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.dz-war-tactic-edge.is-mer {
  stroke-width: calc(11px * var(--size, 1));
}

.dz-war-tactic-line.is-mer {
  stroke-width: calc(7px * var(--size, 1));
}

.dz-war-tactic-core {
  fill: none;
  stroke: rgb(10 14 25 / 0.92);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Le badge ✈ ou ⚓ au départ d'un trait en Air ou en Mer. */
.dz-war-tactic-badge circle {
  fill: rgb(10 14 25 / 0.9);
  stroke-width: 2;
}

.dz-war-tactic-badge text {
  font-weight: 700;
  text-anchor: middle;
}

/* Les pictos des structures sur les boutons de la barre. */
.dz-war-picto {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.dz-war-tactic-head polygon {
  stroke: #000;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.dz-war-tactic-marker circle {
  fill: rgb(10 14 25 / 0.85);
  stroke-width: 2.5;
}

.dz-war-tactic-marker text {
  font-weight: 700;
  text-anchor: middle;
}

.dz-war-tactic-label {
  fill: #fff;
  stroke: rgb(0 0 0 / 0.85);
  stroke-width: 3;
  paint-order: stroke;
}

/* Un texte de l'outil Texte : à sa couleur, gras, cerclé de noir, centré sur son point. */
.dz-war-tactic-words {
  font-weight: 700;
  text-anchor: middle;
  stroke: rgb(0 0 0 / 0.85);
  stroke-width: 3.5;
  stroke-linejoin: round;
  paint-order: stroke;
}

.dz-war-measure-note {
  position: absolute;
  left: 50%;
  bottom: 8px;
  max-width: 60%;
  margin: 0;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 6px;
  background: rgb(10 14 25 / 0.82);
  color: #ffd166;
  font-size: 0.85rem;
  pointer-events: none;
}

.dz-war-measure-note:empty {
  display: none;
}

/* La barre de la règle ou du télémètre ouverte en bas à gauche : l'aide monte au-dessus pour ne pas la couvrir (sur un
   téléphone, c'est la barre qui monte, plus bas). */
@media (min-width: 761px) {
  .dz-war-range-bar:not([hidden]) ~ .dz-war-measure-note {
    bottom: 54px;
  }
}

/* Sur un téléphone (à la fin du fichier, pour l'emporter sur les règles de base) : les portées au-dessus de la rangée
   de boutons ; le calque en une ligne qui défile en haut de la carte, sans l'aide ni la mention qu'il couvrirait ; des
   boutons plus petits pour que la rangée tienne sur une ligne. */
@media (max-width: 760px) {
  .dz-war-range-bar {
    left: 6px;
    bottom: 50px;
  }

  .dz-war-toolmenu {
    left: 6px;
    right: 6px;
    bottom: 50px;
    width: auto;
    max-height: calc(100% - 60px);
  }

  .dz-war-tactic-bar {
    top: 6px;
    bottom: auto;
    left: 6px;
    right: 6px;
    width: auto;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 4px 6px;
    overflow-x: auto;
  }

  .dz-war-tactic-bar button {
    flex: none;
    min-width: 30px;
    min-height: 30px;
    padding: 0 4px;
  }

  .dz-war-tactic-bar label {
    flex: none;
  }

  .dz-war-tactic-bar input {
    width: 90px;
  }

  .dz-war-tactic-help {
    display: none;
  }

  .dz-war-tactic-bar:not([hidden]) ~ .dz-war-measure-note,
  .dz-war-tactic-bar:not([hidden]) ~ .dz-war-corner {
    display: none;
  }

  .dz-war-tools {
    gap: 3px;
  }

  .dz-war-tools-gap {
    display: none;
  }

  .dz-war-tools button {
    min-width: 26px;
    min-height: 30px;
    padding: 0 3px;
  }
}

/* La portée d'une structure importante (clic sur son icône) : cercle plein à la couleur de son camp, second cercle en
   pointillés (tir), distance en mètres au-dessus. */
.dz-war-range {
  --range: #b0b0b0;
  pointer-events: none;
}

.dz-war-range.is-wardens {
  --range: #4ba0ff;
}

.dz-war-range.is-colonials {
  --range: #4be85c;
}

.dz-war-range-main {
  fill: color-mix(in srgb, var(--range) 14%, transparent);
  stroke: var(--range);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.dz-war-range-inner {
  fill: none;
  stroke: var(--range);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

.dz-war-range-label {
  fill: #fff;
  stroke: rgb(10 14 25 / 0.85);
  stroke-width: 2.5;
  paint-order: stroke;
  text-anchor: middle;
  font-weight: 700;
}

/* Les bandes le long des frontières (un seul réglage pour les deux) : decay hachurée en orange (motif de
   site/guerre-carte.js), sans construction en rouge plein. Un seul chemin chacune : la teinte ne fonce pas où deux
   anneaux se touchent. */
.dz-war-decay-band,
.dz-war-nobuild-band {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.dz-war-decay-band {
  fill: url(#dz-war-hatch-decay);
  stroke: rgb(245 158 11 / 0.55);
}

.dz-war-nobuild-band {
  fill: rgb(239 68 68 / 0.38);
  stroke: rgb(239 68 68 / 0.6);
}

/* Le dessin choisi (clic dessus) : un halo doré, le temps de régler son opacité et sa taille. */
.dz-war-tactic.is-selected {
  filter: drop-shadow(0 0 3px #ffd166) drop-shadow(0 0 1px #ffd166);
}

/* Les symboles de la barre, en trois catégories : Terre, Air, Mer. */
.dz-war-tactic-symbols {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dz-war-tactic-symbols[hidden],
.dz-war-tactic-bar [data-war-tactic-for][hidden] {
  display: none;
}

.dz-war-tactic-category {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.dz-war-tactic-category-name {
  min-width: 4.2rem;
  color: #ffd166;
  font-size: 0.75rem;
  font-weight: 700;
}

/* L'opacité et la taille du prochain dessin, ou du dessin choisi. */
.dz-war-tactic-style label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dz-war-tactic-style input {
  width: 110px;
  accent-color: #f0a04b;
}

.dz-war-tactic-style output {
  min-width: 2.8rem;
  color: #d8dde6;
}

/* ---- Résistance : les hexagones indisponibles restent sur la carte, sans couleur (le gris en mode « saturation » ôte la
   teinte de ce qui est dessous), assombris, sans frontières de régions ; ils ne prennent pas le pointeur. */
.dz-war-off {
  pointer-events: none;
}

.dz-war-off-grey {
  fill: #808080;
  mix-blend-mode: saturation;
}

.dz-war-off-dark {
  fill: rgb(6 9 16 / 0.3);
}

.is-off .dz-war-region {
  stroke: none;
}

/* ---- La légende des structures (bouton « Structures › ») : structures importantes, secondaires et ressources
   présentes sur la carte ; le nom d'une catégorie la montre ou la masque (orange affichée, blanc masquée), survoler une
   icône fait clignoter ces structures. */
.dz-war-hud-icons {
  max-height: 46vh;
  overflow-y: auto;
  pointer-events: auto;
}

.dz-war-legend-title {
  margin: 6px 0 2px;
  color: #ffd166;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dz-war-legend-title:first-child {
  margin-top: 0;
}

.dz-war-legend-item.dz-war-legend-cat {
  display: flex;
  margin: 8px -4px 2px;
  color: #f5a524;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dz-war-legend-item.dz-war-legend-cat:first-child {
  margin-top: 0;
}

.dz-war-legend-item.dz-war-legend-cat[aria-pressed="false"] {
  opacity: 1;
  color: #fff;
}

.dz-war-legend-icons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 10px;
}

.dz-war-legend-item.is-icon {
  font-size: 0.78rem;
}

.dz-war-legend-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.dz-war-legend-dot {
  width: 8px;
  height: 8px;
  margin: 0 5px;
  border-radius: 50%;
  background: #b0b0b0;
}

/* Les changements de structures du journal : une perte en plein, une construction ou une amélioration en creux, les
   étapes des roquettes en orange. */
.dz-war-event[data-kind="destroyed"] .dz-war-event-tag {
  background: color-mix(in srgb, var(--camp) 28%, transparent);
}

.dz-war-event[data-kind^="rocket-"] .dz-war-event-tag {
  border-color: #f59e0b;
  color: #ffd08a;
}

/* ---- Lecture depuis le journal : chaque événement se clique ; celui qu'on rejoue reste souligné. */
.dz-war-event[data-war-event] {
  cursor: pointer;
}

.dz-war-event[data-war-event]:hover,
.dz-war-event[data-war-event]:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--camp, #ffd166) 70%, transparent);
  outline-offset: -1px;
}

/* Les deux compteurs sous la barre de temps. */
.dz-war-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: -8px 0 16px;
  color: var(--dz-muted, #9fb1c6);
  font-size: 0.88rem;
}

.dz-war-counters strong {
  color: var(--dz-text, #fff);
  font-variant-numeric: tabular-nums;
}

/* Le compte à rebours d'un calque du site avant son effacement, à côté de son nom ; orange sous 6 heures. */
.dz-war-countdown {
  color: var(--dz-muted, #9fb1c6);
  font-size: 0.78rem;
  white-space: nowrap;
}

.dz-war-countdown.is-soon {
  color: #f59e0b;
  font-weight: 700;
}

/* ---- La forme d'un dessin choisi : trait en tirets ou en pointillés (en Air, le trait est déjà pointillé). */
.dz-war-tactic-line.is-dash-tirets,
.dz-war-tactic-edge.is-dash-tirets {
  stroke-dasharray: 14 8;
}

.dz-war-tactic-line.is-dash-points,
.dz-war-tactic-edge.is-dash-points {
  stroke-dasharray: 0.1 10;
  stroke-linecap: round;
}

.dz-war-tactic-fill.is-hatched {
  fill-opacity: 0.6;
}

/* La flèche du dernier déplacement du dessin choisi, à 20 % d'opacité. */
.dz-war-moved line {
  stroke-width: 3px;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
}

.dz-war-moved {
  pointer-events: none;
}

.dz-war-tactic-shape {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.dz-war-tactic-shape[hidden],
.dz-war-tactic-shape [hidden] {
  display: none;
}
