.hidden {
  display: none !important;
}

/* Modal fin de partie — centré plein écran, indépendant du HUD #scorePanel.
   Le classement (liste) ne s'affiche JAMAIS ici : uniquement dans la prez
   (index.php, rubrique Classement mondial). Seul le prompt pseudo/enregistrement
   vit dans le jeu (2026-07-11). */
.highscore-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  font-family: monospace;
}

.highscore-modal.hidden {
  display: none;
}

.highscore-modal-panel {
  width: min(480px, calc(100vw - 48px));
  box-sizing: border-box;
  padding: 34px 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(22, 31, 45, 0.97), rgba(7, 11, 18, 0.97)),
    radial-gradient(circle at top left, rgba(58, 125, 255, 0.20), transparent 45%);
  border: 1px solid rgba(120, 180, 255, 0.42);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.highscore-modal-kicker {
  color: rgba(220, 240, 255, 0.62);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.highscore-modal-score {
  font-family: 'BebasNeue', system-ui, sans-serif;
  font-size: clamp(52px, 9vw, 88px);
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 26px rgba(120, 180, 255, 0.45);
}

.highscore-modal-sub {
  margin-top: -4px;
  font-size: 13px;
  color: rgba(220, 240, 255, 0.72);
}

/* Bouton "Enregistrer" — ciblé par id pour ne pas déteindre sur les boutons
   .abandon-button/.new-game-button réutilisés dans le modal de confirmation
   d'abandon (même conteneur .highscore-modal-panel, styles différents voulus). */
#btnSaveScore {
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border: 1px solid rgba(120, 180, 255, 0.42);
  border-radius: 11px;
  background: #1b1f2a;
  color: rgba(240, 250, 255, 0.96);
  font-family: monospace;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#btnSaveScore:hover {
  background: #2a3142;
  color: #ffffff;
}

#btnSaveScore:disabled {
  cursor: default;
  opacity: 0.55;
}

.highscore-status {
  min-height: 16px;
  font-size: 12px;
  color: rgba(225, 242, 255, 0.72);
}

.game-action-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.abandon-button,
.new-game-button {
  flex: 1;
  margin-top: 0;
  padding: 8px 9px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.abandon-button:disabled {
  cursor: default;
  opacity: 0.48;
}

/* ─── [data-theme="bleu"] — apparence actuelle par défaut ─────────────────── */
[data-theme="bleu"] .abandon-button,
[data-theme="bleu"] .new-game-button {
  border: 1px solid rgba(255, 120, 120, 0.46);
  background: rgba(80, 16, 20, 0.78);
  color: rgba(255, 235, 235, 0.96);
}
[data-theme="bleu"] .abandon-button:hover {
  background: rgba(120, 24, 30, 0.9);
  color: #ffffff;
}
[data-theme="bleu"] .new-game-button {
  border-color: rgba(145, 205, 255, 0.42);
  background: rgba(25, 56, 82, 0.78);
  color: rgba(230, 246, 255, 0.96);
}
[data-theme="bleu"] .new-game-button:hover {
  background: rgba(38, 86, 124, 0.9);
  color: #ffffff;
}

/* ─── [data-theme="ancien"] — 2026-07-19 (corrigé le 2026-07-19, image
   remplacée le 2026-07-19) : border-image 3-slice sur images/button2.png
   (160x42, cf. css/themes/medieval.css §32 et css/multiplayerUi.css). Une
   seule image bouton rouge pour abandonner/nouvelle partie, pas de
   distinction de couleur par rôle (cohérent avec .mode-panel button/
   .btn-secondary). Cap 8px (mesure réelle du rayon de coin sur button2.png).
   height: 42px FORCÉ (hauteur native de l'image, cf. css/themes/medieval.css
   §32 pour l'explication complète) : écrase le padding 8px 9px d'origine
   (pensé pour la version texte plate), assumé. ─── */
[data-theme="ancien"] .abandon-button,
[data-theme="ancien"] .new-game-button {
  background: none;
  border-style: solid;
  border-width: 0 6px;
  border-image-source: url("../images/button3.png");
  border-image-slice: 0 6 fill;
  border-image-width: 0 6px;
  border-image-repeat: stretch;
  border-radius: 0;
  height: 38px;
  box-sizing: border-box;
  color: #f5e2b8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: filter 0.2s;
}
[data-theme="ancien"] .abandon-button:hover,
[data-theme="ancien"] .new-game-button:hover { filter: brightness(1.12); }
