/* Styles spécifiques à Artillerie, sans toucher au body ni aux titres du site */
.ar-root,
.ar-root *,
.ar-site .ar-scores * {
  font-family: var(--mg-police, "Outfit", system-ui, sans-serif);
  box-sizing: border-box;
}

.ar-root [hidden],
.ar-site [hidden] {
  display: none !important;
}

/* Barre commune (css/games.css), au-dessus du panneau du jeu */
.ar-site {
  --mg-jeu-largeur: 1204px; /* barre de 1180 px + marges de 12 px */
  --mgb-fond: radial-gradient(120% 160% at 0% 0%, rgba(255, 138, 61, 0.25), transparent 55%),
    linear-gradient(120deg, #0f1222, #2c355c);
  --mgb-accent: #ff8a3d;
  --mgb-titre: linear-gradient(100deg, #ffd166, #ff8a3d);
  --mgb-ombre: 0 4px 14px rgba(0, 0, 0, 0.35);
  --mg-fs-fond: radial-gradient(120% 90% at 50% 0%, #2c355c 0%, #171b33 58%, #0f1222 100%);
  --mg-bulle-fond: #0f1222;
}

.ar-root {
  /* Même largeur que la barre (css/games.css), sauf en plein écran */
  width: min(var(--mg-barre-largeur, 1180px), calc(100vw - 24px));
  align-self: center;
  box-sizing: border-box;
  margin: 0 0 32px 0;
  padding: 14px;
  background: radial-gradient(
    120% 90% at 50% 0%,
    #2c355c 0%,
    #171b33 58%,
    #0f1222 100%
  );
  border-radius: 20px;
  box-shadow: 0 10px 30px #0004;
  color: #eef1ff;
}

.ar-root b {
  color: inherit;
}

/* ---------- Bandeau ---------- */

.ar-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa3cf;
}

.ar-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ar-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ffffff10;
  border: 1px solid #ffffff1c;
  font-weight: 600;
  font-size: 0.9rem;
  transition:
    background 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}

.ar-score i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
}

.ar-site .ar-score b {
  color: #ffd166;
  font-weight: 700;
}

.ar-score.ar-actif {
  background: #ffffff22;
  border-color: var(--c);
}

.ar-score.ar-mort {
  opacity: 0.45;
}

.ar-score.ar-mort i {
  box-shadow: none;
  background: #777;
}

/* ---------- Préparation ---------- */
.ar-config {
  padding: 4px 2px 6px 2px;
}

.ar-root .ar-config-titre {
  margin: 0 0 12px 0;
  font-family: "Madimi One", var(--mg-police, sans-serif);
  font-size: 1.7rem;
  font-weight: 400;
  color: #fff;
}

.ar-joueurs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 10px;
}

.ar-joueur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff0c;
  border: 1px solid #ffffff1a;
  border-left: 5px solid var(--c);
  transition: opacity 0.2s;
}

.ar-joueur.ar-absent {
  opacity: 0.55;
}

.ar-joueur.ar-absent .ar-pastille {
  filter: grayscale(1);
}

.ar-pastille svg {
  display: block;
}

.ar-root .ar-nom {
  flex: 1 1 130px;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid #ffffff2a;
  background: #0d1020;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.ar-root .ar-nom:focus {
  outline: 2px solid #ff8a3d;
  outline-offset: 1px;
}

.ar-root .ar-nom::placeholder {
  color: #6b7299;
}

.ar-choix {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: #0d1020;
  border: 1px solid #ffffff1c;
}

.ar-root .ar-choix button {
  padding: 6px 10px;
  border-radius: 8px;
  color: #c4cae8;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
/* Type de joueur : boutons plus serrés, le nom reste lisible en entier */
.ar-root .ar-joueur .ar-choix button {
  padding: 6px 7px;
}

.ar-root .ar-choix button:hover {
  background: #ffffff14;
  color: #fff;
}

.ar-root .ar-choix button[aria-pressed="true"] {
  background: linear-gradient(#ff9a4d, #f06a28);
  color: #fff;
  box-shadow: 0 2px 8px #f06a2855;
}

/* Grille 2×2 : relief et décor à gauche, vent et manches à droite
   (manches au niveau du décor) ; une seule colonne si la place manque */
.ar-options {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 12px 32px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .ar-options {
    grid-template-columns: auto;
  }
}

.ar-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

/* Relief et décor : boutons en vignettes avec aperçu */

.ar-root .ar-choix-apercus button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 5px 4px;
}

.ar-apercu {
  display: block;
  width: 96px;
  height: 54px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #ffffff1c;
}

.ar-root .ar-choix-apercus button[aria-pressed="true"] .ar-apercu {
  box-shadow: 0 0 0 2px #fff;
}

@media (max-width: 520px) {
  .ar-apercu {
    width: 72px;
    height: 40px;
  }
}

.ar-avis {
  margin: 14px auto 0 auto;
  max-width: 520px;
  padding: 6px 14px;
  border-radius: 10px;
  background: #fff3c4;
  color: #5b4300;
  text-align: center;
  font-weight: 600;
}

.ar-lancer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.ar-root .ar-go {
  padding: 12px 40px;
  font-size: 1.15rem;
  background: linear-gradient(#ff9a4d, #f06a28);
  box-shadow: 0 10px 24px -10px #f06a28;
}

.ar-root .ar-go:hover {
  background: linear-gradient(#ffab66, #f57a3a);
  box-shadow: 0 14px 26px -10px #f06a28;
}

/* ---------- Champ de bataille ---------- */
.ar-scene {
  position: relative;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px #0007;
  line-height: 0;
}

#ar-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #0b0e1c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

/* Messages : pause, fin de manche, classement */
.ar-panneau {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #0a0c18a0;
  backdrop-filter: blur(2px);
  line-height: 1.4;
  animation: ar-apparait 0.25s ease-out;
}

@keyframes ar-apparait {
  from {
    opacity: 0;
  }
}

.ar-panneau-boite {
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  overflow: auto;
  padding: 16px 20px;
  background: #1b2040f2;
  border: 1px solid #ffffff26;
  border-radius: 16px;
  box-shadow: 0 20px 40px #0008;
  text-align: center;
}

.ar-root .ar-pan-titre {
  margin: 0 0 6px 0;
  font-family: "Madimi One", var(--mg-police, sans-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: #ffd166;
}

.ar-pan-corps p {
  margin: 0 0 8px 0;
  color: #d6dbf5;
}

.ar-root .ar-pan-corps table {
  width: 100%;
  margin: 4px 0 10px 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ar-pan-corps th {
  padding: 4px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa3cf;
}

.ar-pan-corps td {
  padding: 5px 6px;
  border-top: 1px solid #ffffff14;
  font-variant-numeric: tabular-nums;
}

.ar-pan-corps td:first-child {
  text-align: left;
  font-weight: 600;
}

.ar-pan-corps td:first-child i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--c);
}

.ar-pan-corps tr.ar-premier td {
  color: #ffd166;
}

.ar-pan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.ar-root .ar-pan-actions .btn-rouge {
  background: transparent;
  color: #ff8fbf;
}

.ar-root .ar-pan-actions .btn-rouge:hover {
  background: #ff4f9a22;
  color: #ffc2dc;
}

/* ---------- Commandes ---------- */
.ar-commandes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 10px;
  line-height: 1.2;
}

.ar-commandes.ar-inactif .ar-groupe,
.ar-commandes.ar-inactif .ar-feu {
  opacity: 0.4;
  pointer-events: none;
}

.ar-groupe {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 12px;
  background: #ffffff0f;
  border: 1px solid #ffffff1c;
  transition: opacity 0.2s;
}

.ar-groupe > .ar-label {
  margin: 0 3px;
}

.ar-root .ar-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff14;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.ar-root .ar-btn:hover {
  background: #ffffff26;
}

.ar-root .ar-btn:active {
  background: #ff8a3d;
}

.ar-valeur {
  min-width: 62px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.ar-root .ar-arme {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 172px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: #0d1020;
  border: 1px solid #ffffff1c;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.ar-root .ar-arme:hover {
  border-color: #ff8a3d;
}

.ar-arme-icone svg {
  display: block;
  width: 22px;
  height: 22px;
  color: #ffb070;
}

.ar-arme-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.ar-arme-nom {
  font-weight: 700;
  font-size: 0.95rem;
}

.ar-arme-stock {
  font-size: 0.72rem;
  color: #9aa3cf;
}

.ar-carbu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.ar-jauge {
  display: block;
  width: 70px;
  height: 7px;
  border-radius: 5px;
  background: #0d1020;
  overflow: hidden;
}

.ar-jauge span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffd166, #ff8a3d);
  transition: width 0.1s linear;
}

.ar-root .ar-feu {
  height: 46px;
  padding: 0 28px;
  border-radius: 13px;
  background: linear-gradient(#ff6a4d, #d8322a);
  color: #fff;
  font-family: "Madimi One", var(--mg-police, sans-serif);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  box-shadow:
    0 0 0 2px var(--c, transparent),
    0 8px 18px -8px #d8322a;
  cursor: pointer;
  transition:
    transform 0.15s,
    filter 0.15s,
    opacity 0.2s;
}

.ar-root .ar-feu:hover {
  filter: brightness(1.1);
}

.ar-root .ar-feu:active {
  transform: scale(0.96);
}

/* Arsenal : toutes les armes et leurs munitions */
.ar-arsenal {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(640px, calc(100% - 20px));
  padding: 10px;
  transform: translateX(-50%);
  border-radius: 14px;
  background: #141833f2;
  border: 1px solid #ffffff2a;
  box-shadow: 0 16px 40px #000a;
  line-height: 1.2;
  animation: ar-apparait 0.15s ease-out;
}

.ar-root .ar-case {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 10px;
  background: #ffffff0d;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.ar-root .ar-case:hover {
  background: #ffffff1c;
}

.ar-case svg {
  width: 26px;
  height: 26px;
  color: #ffb070;
}

.ar-case small {
  color: #9aa3cf;
  font-weight: 500;
}

.ar-root .ar-case[aria-pressed="true"] {
  background: #ff8a3d33;
  outline: 2px solid #ff8a3d;
}

.ar-root .ar-case:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---------- Plein écran ---------- */
.ar-site.mg-fs .ar-root {
  align-self: stretch;
  width: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.ar-site.mg-fs .ar-config {
  width: 100%;
  max-width: 1000px;
  margin: auto;
}

.ar-site.mg-fs .ar-jeu {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- Règles : plus larges, sur trois colonnes (évite l'ascenseur) ---------- */
.mg-regles.ar-regles {
  width: min(97vw, 1240px);
  max-height: 96vh;
  line-height: 1.4;
}
.ar-regles .mg-regles-tete {
  padding: 12px 20px 10px 24px;
}
.ar-regles .mg-regles-corps {
  columns: 3 280px;
  column-gap: 30px;
}
.ar-regles .mg-regles-corps h3 {
  margin: 10px 0 4px 0;
}
.ar-regles .mg-regles-corps > h3:first-child {
  margin-top: 0;
}
.ar-regles .mg-regles-corps p,
.ar-regles .mg-regles-corps ul {
  margin-bottom: 6px;
  font-size: 0.92em;
}
.ar-regles .mg-regles-corps li {
  margin: 2px 0;
}
.ar-regles .mg-regles-actions {
  padding: 4px 24px 14px 24px;
}

/* ---------- Petits écrans ---------- */
@media (max-width: 600px) {
  .ar-root {
    padding: 8px;
    border-radius: 14px;
  }

  .ar-root .ar-config-titre {
    font-size: 1.35rem;
  }

  .ar-scene {
    border-radius: 10px;
  }

  .ar-commandes {
    gap: 6px;
  }

  .ar-groupe {
    padding: 4px 5px;
  }

  .ar-root .ar-arme {
    min-width: 140px;
  }

  .ar-valeur {
    min-width: 52px;
    font-size: 0.95rem;
  }

  .ar-arsenal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    bottom: 6px;
    top: 6px;
    overflow: auto;
  }

  .ar-root .ar-pan-titre {
    font-size: 1.25rem;
  }

  .ar-panneau-boite {
    padding: 10px 12px;
  }
}
