/* Pokémon Shelter : l'écran vert d'un abri. Tout est dessiné ici ou en SVG, sans image d'interface. */
:root {
  --vert: #2bff4a;
  --vert-bouton: #3dff5e;
  --vert-moyen: #0f6b2a;
  --vert-sombre: #052d12;
  --vert-noir: #021a09;
  --texte: #d9ffe0;
  --doux: #8fcf9c;
  --rouge: #ff4d4d;
  --or: #f2c230;
  --lisere: 1px 1px 0 var(--vert-noir), -1px -1px 0 var(--vert-noir), 1px -1px 0 var(--vert-noir), -1px 1px 0 var(--vert-noir), 0 0 5px rgba(0, 40, 10, 0.9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b1612;
  color: var(--texte);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  font-size: 15px;
  user-select: none;
  -webkit-user-select: none;
}

[hidden] { display: none !important; }

#abri {
  position: fixed;
  inset: 0;
  touch-action: none;
  cursor: grab;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.petit { font-size: 12px; color: var(--doux); }
.centre { text-align: center; justify-content: center; }

.icone {
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
  vertical-align: -0.25em;
}

/* La pièce de Pokédollar. */
.piece {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe680, #d99a14);
  border: 1px solid #7a5200;
  color: #5c3d00;
  font-size: 0.85em;
  font-weight: 900;
  text-shadow: none;
  vertical-align: 0.05em;
}

/* ---------- Les compteurs du haut ---------- */

#hud {
  position: fixed;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px 18px;
  pointer-events: none;
  color: var(--vert);
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-stretch: 85%;
  font-weight: 700;
  font-size: 24px;
  text-shadow: var(--lisere);
}
#hud > * { pointer-events: auto; }
#hud .icone { filter: drop-shadow(0 0 1px var(--vert-noir)) drop-shadow(0 0 2px var(--vert-noir)); }

#hud-pop { position: relative; width: 62px; height: 62px; flex: none; }
#hud-pop .icone { width: 62px; height: 62px; }
#hud-pop b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vert-noir);
  text-shadow: none;
  font-size: 23px;
}
#hud-attente {
  position: absolute;
  right: -10px;
  bottom: -2px;
  min-width: 26px;
  padding: 1px 4px;
  border-radius: 13px;
  background: var(--vert);
  border: 2px solid var(--vert-noir);
  color: var(--vert-noir);
  text-shadow: none;
  font-style: normal;
  font-size: 14px;
  text-align: center;
}

#hud-bonheur { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
#hud-bonheur .icone { width: 26px; height: 26px; }

.jauges { display: flex; gap: 6px; margin: 6px auto 0; }
.jauge { display: flex; align-items: center; }
.jauge .rond {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--vert);
  border: 2px solid var(--vert-noir);
  color: var(--vert-noir);
  box-shadow: 0 0 0 2px var(--vert);
}
.jauge .rond .icone { width: 26px; height: 26px; filter: none; }
.jauge .barre {
  width: 112px;
  height: 20px;
  margin-left: -6px;
  border: 3px solid var(--vert);
  border-left: 0;
  border-radius: 0 4px 4px 0;
  background: rgba(2, 26, 9, 0.75);
  box-shadow: 0 0 0 1px var(--vert-noir);
}
.jauge .barre > i { background: var(--vert); border-radius: 0; }
.jauge.alerte .rond { background: var(--rouge); box-shadow: 0 0 0 2px var(--rouge); animation: alerte 0.9s infinite; }
.jauge.alerte .barre { border-color: var(--rouge); }
.jauge.alerte .barre > i { background: var(--rouge); }
@keyframes alerte { 50% { opacity: 0.45; } }

#hud-droite { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px 16px; margin-top: 8px; max-width: 250px; }
#hud-droite > span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
#hud-bonbons { color: #58a6ff; }
#hud-bonbons b { color: var(--vert); }
#hud-droite .mini { font-size: 17px; }

/* Les barres : fond sombre, remplissage vert. */
.barre {
  width: 74px;
  height: 11px;
  background: var(--vert-noir);
  border: 1px solid var(--vert-moyen);
  overflow: hidden;
}
.barre > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--vert);
  transition: width 0.3s;
}

/* ---------- Les cadres verts : guide, fiche, salle choisie, menu ---------- */

#guide, #fiche, #salle-info, #menu, .toast {
  background: rgba(3, 38, 14, 0.93);
  border: 2px solid var(--vert-bouton);
  box-shadow: 0 0 0 2px var(--vert-noir), 0 0 14px rgba(43, 255, 74, 0.25);
}

#guide {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 20px));
  padding: 8px 14px 10px;
  line-height: 1.4;
}
#guide.replie { width: auto; padding: 5px 10px; }
#guide .tete { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
#guide .tete b { color: var(--vert); }
#guide button, .fermer {
  padding: 2px 14px;
  border: 0;
  background: var(--vert-bouton);
  color: #000;
  font-weight: bold;
}

#fiche {
  position: fixed;
  top: 96px;
  left: 12px;
  width: 258px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 16px 12px 10px;
  border-radius: 10px;
  color: var(--vert);
}
.titre-fiche {
  margin: -8px 26px 8px 0;
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-stretch: 85%;
  font-weight: 700;
  font-size: 21px;
  text-shadow: var(--lisere);
}
.fermer-fiche {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  background: var(--vert-moyen);
  color: var(--vert);
  font-weight: bold;
}
#fiche .haut { display: flex; gap: 12px; align-items: center; }
#fiche .droite { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#fiche .pilule { display: flex; align-items: center; gap: 5px; padding: 1px 10px; border: 2px solid var(--vert); border-radius: 14px; font-weight: bold; }
#fiche .niveau { font-family: "Bahnschrift", "Arial Narrow", sans-serif; font-weight: 700; font-size: 19px; }
#fiche .droite .barre { width: 100%; }
#fiche .barre.vie { width: 92px; margin-top: 6px; }
#fiche .barre.vie.ko > i { background: var(--rouge); }
#fiche .ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; }
#fiche .types { margin: 0; }

.special { display: flex; justify-content: center; gap: 7px; margin-top: 8px; }
.special > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.special span { display: flex; align-items: flex-end; width: 12px; height: 44px; background: var(--vert-noir); border: 1px solid var(--vert-moyen); }
.special span i { display: block; width: 100%; background: var(--vert); transition: height 0.3s; }
.special b { font-family: "Bahnschrift", "Arial Narrow", sans-serif; font-size: 16px; }
.special em { font-style: normal; font-size: 11px; color: var(--doux); }

.tuiles { display: flex; gap: 8px; margin-top: 8px; }
#fiche .actions { margin-top: 8px; gap: 8px; flex-wrap: nowrap; }
#fiche .actions button { flex: 1; padding: 5px 4px; font-size: 13px; white-space: nowrap; }
.tuiles button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 4px;
  border: 0;
  border-radius: 8px;
  background: var(--vert-bouton);
  color: var(--vert-noir);
  font-weight: bold;
}
.tuiles .icone { width: 26px; height: 26px; }

#salle-info {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 200px);
  padding: 6px 18px 8px;
  border-radius: 12px;
  color: var(--vert);
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-stretch: 85%;
  font-weight: 700;
  font-size: 22px;
}
#salle-info .nom { text-align: center; font-size: 23px; text-shadow: var(--lisere); }
#salle-info .ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 20px; }
#salle-info .ligne > span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#salle-info .ligne button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 8px;
  border: 0;
  background: none;
  color: var(--vert);
  line-height: 1;
}
#salle-info .ligne button .icone { width: 30px; height: 30px; }
#salle-info .ligne button b { font-size: 15px; }
#salle-info .ligne button small { font-size: 12px; font-family: "Segoe UI", sans-serif; color: var(--texte); }
#salle-info .ligne button:hover { filter: brightness(1.3); }
#salle-info .ligne button.danger { color: var(--rouge); border: 0 !important; }
.occupants { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; }
.occupants:empty { display: none; }
.occupants button { background: none; border: 0; padding: 0; }
.occupants .portrait { width: 34px; height: 34px; }

/* ---------- Marteau, Pip-Boy et son menu ---------- */

#boutons {
  position: fixed;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}
#boutons button {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--vert);
  filter: drop-shadow(0 0 2px var(--vert-noir)) drop-shadow(0 0 3px var(--vert-noir));
}
#boutons button:hover { filter: drop-shadow(0 0 2px var(--vert-noir)) drop-shadow(0 0 6px rgba(43, 255, 74, 0.7)); }
#boutons button:active { transform: translateY(2px); }
#btn-construire .icone { width: 66px; height: 66px; }
#btn-pipboy .icone { width: 92px; height: 82px; }

#menu {
  position: fixed;
  right: 14px;
  bottom: 104px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
#menu button, .actions button, .onglets button, .regions button, .filtres button, .objectif button, .rangee button, .lieu button, .expedition > button, .choix-compte button {
  position: relative;
  padding: 8px 18px;
  border: 3px solid var(--vert-bouton);
  background: var(--vert-bouton);
  color: #000;
  font-weight: bold;
}
#menu button { min-width: 190px; text-align: left; font-size: 16px; }
#menu button:hover, .choix-compte button:hover, .actions button:hover, .onglets button:hover, .regions button:hover, .filtres button:hover, .fermer:hover { filter: brightness(1.15); }
.onglets button.actif, .regions button.actif, .filtres button.actif { border-color: #fff; }
button.danger { background: none !important; border: 3px solid var(--rouge) !important; color: var(--rouge) !important; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Pastille rouge : quelque chose attend derrière ce bouton. */
.point {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--rouge);
  border: 2px solid #fff;
}

/* ---------- Panneau central ---------- */

#panneau {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: rgba(0, 18, 6, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
#panneau .contenu {
  position: relative;
  width: min(900px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--vert-sombre);
  border: 3px solid var(--vert-bouton);
  padding: 22px 26px;
  scrollbar-color: var(--vert-moyen) var(--vert-noir);
}
.fermer { position: absolute; top: 20px; right: 24px; padding: 8px 22px; font-size: 16px; }

h1, h2 { margin: 0 0 10px; }
h1 { text-align: center; font-size: 36px; color: var(--vert); }
h2 { color: var(--vert); font-size: 22px; margin-right: 120px; }
h2.centre { margin-right: 0; color: var(--texte); font-weight: 600; }
h3 { margin: 16px 0 8px; font-size: 16px; color: var(--vert); }
a { color: var(--vert); }
.accroche { text-align: center; font-size: 19px; margin: 0 0 14px; }
.accroche b { color: var(--vert); }

.portrait {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  background: var(--vert-noir);
  vertical-align: middle;
}
.portrait.grand { width: 92px; height: 92px; }
.portrait.geant { width: 160px; height: 160px; }
.portrait.ombre { filter: brightness(0); opacity: 0.6; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.onglets, .regions, .filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.onglets { margin-right: 120px; }
.onglets button { min-width: 130px; font-size: 16px; }
.regions button { padding: 4px 10px; font-size: 13px; }

/* Questionnaire de départ */

.reponses { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.reponses button, .actions.centre button { padding: 13px 26px; border: 0; background: var(--vert-bouton); color: #000; font-weight: bold; font-size: 17px; }
.reponses button:hover { filter: brightness(1.15); }
.elu, .starter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 7px 5px;
  background: var(--vert-bouton);
  border: 0;
  color: #000;
}
.elu { width: max-content; margin: 0 auto 14px; font-size: 17px; }
.duo { display: flex; justify-content: center; gap: 22px; }
.duo .elu { margin: 0 0 12px; }
.starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.starter:hover { filter: brightness(1.15); }
.starter .types, .elu .types { margin: 0; }
.starter .type, .elu .type { font-size: 11px; padding: 1px 7px; }

/* Cartes de construction */

.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.carte {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px;
  text-align: left;
  background: var(--vert-moyen);
  border: 2px solid transparent;
  color: var(--texte);
}
.carte:hover:not(:disabled) { border-color: var(--vert-bouton); }
.carte b { color: var(--vert); font-family: "Bahnschrift", "Arial Narrow", sans-serif; font-size: 16px; }
.carte .cout { color: var(--texte); font-weight: bold; }
.carte small { color: var(--doux); }
.vignette { width: 100%; aspect-ratio: 7 / 4; object-fit: cover; background: var(--vert-noir); }
.vignette.magneti { display: flex; align-items: center; justify-content: center; background: #123a22; }
.vignette.magneti img { width: 64px; height: 64px; image-rendering: pixelated; }
.vignette.ascenseur { background: linear-gradient(90deg, #6e3411, #c0702a 46%, #ff5a1c 48%, #ff5a1c 52%, #c0702a 54%, #6e3411); }

/* Listes */

.etoiles { color: var(--or); letter-spacing: 1px; }
.etoiles i { color: #1c4a2a; font-style: normal; }
.types { display: flex; gap: 6px; margin-top: 5px; }
.type { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: bold; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }

.lieu { margin-top: 12px; padding: 9px 12px; background: var(--vert-moyen); line-height: 1.6; }
.lieu .types { margin: 6px 0; }
.lieu .petit { display: block; color: var(--texte); }
.liste { display: flex; flex-direction: column; gap: 5px; }
.liste + h2 { margin-top: 18px; }
.rangee {
  display: grid;
  grid-template-columns: 40px 1fr auto auto 130px;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  text-align: left;
  background: var(--vert-moyen);
  border: 2px solid transparent;
  color: var(--texte);
}
button.rangee:hover { border-color: var(--vert-bouton); }
.rangee .petit { text-align: right; color: var(--texte); }
.rangee.legendaire { grid-template-columns: 40px 1fr 1fr auto; }

/* ---------- Pokédex, PC, équipes ---------- */

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin-top: 12px; }
.case, .choix {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 2px 2px;
  background: var(--vert-moyen);
  border: 3px solid transparent;
  font-size: 13px;
  color: var(--texte);
}
.case:hover, .choix:hover { border-color: var(--vert-bouton); }
.case i { position: absolute; top: 0; right: 2px; font-style: normal; font-size: 11px; }
.case.vu .portrait { filter: brightness(0); opacity: 0.6; }
.case.inconnu .portrait { filter: brightness(0); opacity: 0.25; }
.choix-equipe { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; max-height: 250px; overflow-y: auto; }
.choix.pris { border-color: #fff; background: #17a03e; }
.adversaires { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.adversaires .portrait { border: 4px solid var(--vert-bouton); width: 52px; height: 52px; }
.adversaires .sep { width: 12px; }

/* ---------- Combat ---------- */

.combat { display: flex; align-items: center; justify-content: space-around; gap: 8px; }
.cote { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 42%; min-height: 150px; text-align: center; }
.cote .portrait { border: 5px solid var(--vert-bouton); }
.cote .barre { width: 100%; height: 13px; }
.cote.ko .portrait { filter: grayscale(1); opacity: 0.4; }
.cote.touche .portrait { animation: touche 0.3s; }
@keyframes touche { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.vs { font-size: 24px; font-weight: bold; color: var(--vert); }
.journal {
  height: 180px;
  margin-top: 10px;
  padding: 8px 10px;
  overflow-y: auto;
  background: var(--vert-noir);
  border: 1px solid var(--vert-moyen);
  font-size: 13px;
  line-height: 1.5;
}
.journal .titre { color: var(--vert); font-weight: bold; }
.journal .lui { color: #ffb0b6; }

/* ---------- Expéditions ---------- */

.expedition { margin-bottom: 10px; padding: 10px 12px; background: var(--vert-moyen); }
.expedition .entete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.expedition .entete b { color: var(--vert); }
.expedition .petit { color: var(--texte); }
.expedition .equipe { display: flex; gap: 10px; margin: 8px 0; }
.expedition .equipe > div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.expedition .equipe .barre { width: 44px; height: 7px; }
.prises { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0; }
.prises .portrait { width: 32px; height: 32px; }
.expedition > button { margin-top: 8px; padding: 5px 14px; }

.especes-zone { margin-top: 8px; padding: 8px 10px; background: var(--vert-noir); border: 1px solid var(--vert-moyen); }
.especes-zone .petit { margin: 0 0 6px; color: var(--texte); }
.grille.zone { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; margin-top: 0; max-height: 170px; overflow-y: auto; }
.grille.zone .case { padding: 3px 1px 1px; cursor: help; }
.grille.zone .portrait { width: 36px; height: 36px; }
/* Dans la liste d'une zone, on montre tous les Pokémon : en gris ceux qui ne sont pas encore capturés. */
.grille.zone .case.vu .portrait, .grille.zone .case.inconnu .portrait { filter: grayscale(1); opacity: 0.5; }
.case .rarete { font-size: 9px; color: var(--or); letter-spacing: -1px; }
.case.legende { border-color: #c77dff; }
.case .mystere { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: #c77dff; font-size: 22px; }

select {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--vert-bouton);
  background: var(--vert-noir);
  color: var(--texte);
  font: inherit;
}
.filtres { margin-top: 10px; }
.reglage { display: flex; align-items: center; gap: 10px; margin: 6px 0; color: var(--vert); }
.reglage input { flex: 1; accent-color: var(--vert-bouton); }
.reglage b { min-width: 28px; text-align: right; }

details { margin-top: 14px; }
summary { cursor: pointer; color: var(--vert); font-weight: bold; }
.credits { max-height: 300px; overflow-y: auto; margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--doux); }
.credits b { color: var(--texte); }

/* ---------- Quêtes ---------- */

.quete {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  text-align: left;
  background: var(--vert-moyen);
  border: 3px solid transparent;
  color: var(--texte);
}
.quete b { color: var(--vert); font-size: 16px; }
.quete .petit { color: var(--texte); }
.quete:hover { border-color: var(--vert-bouton); }
.quete.choisie { border-color: #fff; background: #17a03e; }
#titre .astuce { max-width: 78%; margin-top: 6px; font-size: 14px; text-align: center; color: #3b443b; }

/* ---------- Amis ---------- */

input[type="text"], textarea {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 2px solid var(--vert-bouton);
  background: var(--vert-noir);
  color: var(--texte);
  font: inherit;
  user-select: text;
  -webkit-user-select: text;
}
textarea { display: block; width: 100%; margin-top: 8px; font-size: 12px; word-break: break-all; }
.reglage button { padding: 6px 14px; border: 0; background: var(--vert-bouton); color: #000; font-weight: bold; }
.code { width: auto !important; font-family: Consolas, monospace; font-size: 20px; letter-spacing: 2px; user-select: text; -webkit-user-select: text; }
.lieu .actions { margin-top: 8px; }
.choix-compte { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 6px; }
.choix-compte button { padding: 11px; font-size: 16px; }
.choix-compte .petit { margin-bottom: 10px; }
#rt-texte { min-height: 130px; padding: 8px 10px; font-size: 15px; word-break: normal; resize: vertical; }
.retour-recu { margin-top: 10px; padding: 9px 12px; background: var(--vert-moyen); border-left: 4px solid var(--vert-bouton); }
.retour-recu.lu { opacity: 0.6; border-left-color: transparent; }
.retour-recu p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.retour-recu .actions { margin-top: 6px; }
.retour-recu .actions button { padding: 4px 12px; }
.ami { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; padding: 9px 12px; background: var(--vert-moyen); }
.ami.demande { border: 2px solid var(--or); }
.ami .actions { margin-top: 0; gap: 6px; }
.ami .actions button { padding: 5px 12px; }
.ami .petit { color: var(--texte); }
.voyant { display: inline-block; width: 11px; height: 11px; margin-right: 7px; border-radius: 50%; background: #35503c; border: 1px solid var(--vert-noir); }
.voyant.allume { background: var(--vert); box-shadow: 0 0 6px var(--vert); }
.jaune { color: var(--or); }
.case.envie { border-color: var(--or); background: #4f5c12; }
#plan-ami { display: block; margin: 8px auto; border: 2px solid var(--vert-bouton); }
.membre { display: inline-flex; flex-direction: column; align-items: center; font-size: 11px; }
.membre .portrait { width: 48px; height: 48px; }

/* ---------- Objectifs et sac ---------- */

.objectif { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--vert-moyen); }
.objectif > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.objectif .barre { width: 100%; }
.objectif .petit { color: var(--texte); }
.sac { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--vert); }
.sac .icone { width: 22px; height: 22px; }

/* ---------- Question avant une action sans retour ---------- */

#question {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 18, 6, 0.78);
}
#question .boite {
  width: min(460px, 100%);
  padding: 20px 22px;
  background: var(--vert-sombre);
  border: 3px solid var(--vert-bouton);
  text-align: center;
  font-size: 17px;
}
#question p { margin: 0 0 6px; }

/* ---------- Messages ---------- */

#toasts {
  position: fixed;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 20px);
  z-index: 6;
  pointer-events: none;
}
.toast {
  padding: 6px 16px;
  font-weight: bold;
  text-align: center;
  animation: arrive 0.25s;
  transition: opacity 0.5s;
}
.toast.part { opacity: 0; }
@keyframes arrive { from { transform: translateY(-10px); opacity: 0; } }

/* ---------- Écran-titre : le plan d'un abri, tracé à la règle ---------- */

#titre {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 46%, #eef2ea 0%, #d5dcd1 38%, #7d877b 72%, #1a211a 100%);
  color: #2f362f;
  overflow: hidden;
}
#titre::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.035) 3px 4px),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(47, 54, 47, 0.55) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, transparent 0 139px, rgba(47, 54, 47, 0.35) 139px 141px),
    repeating-linear-gradient(0deg, transparent 0 139px, rgba(47, 54, 47, 0.35) 139px 141px);
}
#titre .plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(92vw, 660px);
  height: min(92vh, 660px);
  border: 3px solid #2f362f;
}
#titre .cercle {
  position: absolute;
  width: min(84vw, 84vh, 600px);
  height: min(84vw, 84vh, 600px);
  border: 4px solid #2f362f;
  border-radius: 50%;
  background: rgba(238, 242, 234, 0.55);
}
#titre .plan > :not(.cercle) { position: relative; }
#titre .mascotte { image-rendering: pixelated; transform: scale(4.2); transform-origin: 50% 100%; margin-top: 60px; margin-bottom: 4px; }
#titre .bienvenue { font-family: "Bahnschrift", "Arial Narrow", Impact, sans-serif; font-stretch: 80%; font-weight: 700; font-size: clamp(22px, 5vw, 34px); letter-spacing: 1px; }
#titre .logo {
  display: flex;
  border: 4px solid #2f362f;
  border-radius: 12px;
  overflow: hidden;
  transform: skewX(-9deg);
  font-family: "Bahnschrift", "Arial Narrow", Impact, sans-serif;
  font-stretch: 80%;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(34px, 9vw, 62px);
  line-height: 1.25;
}
#titre .logo span { padding: 0 14px; background: #f3f5ef; }
#titre .logo span + span { background: #2f362f; color: #f3f5ef; }
#titre .embleme { display: flex; align-items: center; gap: 10px; }
#titre .embleme i { width: 74px; height: 22px; background: repeating-linear-gradient(0deg, #2f362f 0 4px, transparent 4px 9px); }
#titre .embleme b {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #2f362f;
  background: radial-gradient(circle, #f3f5ef 0 5px, #2f362f 5px 9px, transparent 9px), linear-gradient(0deg, #f3f5ef 0 calc(50% - 3px), #2f362f calc(50% - 3px) calc(50% + 3px), #f3f5ef calc(50% + 3px));
}
#btn-entrer {
  margin-top: 16px;
  padding: 10px 22px;
  border: 3px solid #2f362f;
  border-radius: 8px;
  background: #4d564d;
  color: #eef2ea;
  font-family: "Bahnschrift", "Arial Narrow", Impact, sans-serif;
  font-stretch: 80%;
  font-weight: 700;
  font-size: clamp(20px, 5vw, 30px);
  letter-spacing: 1px;
  box-shadow: 0 4px 0 #1f251f;
}
#btn-entrer:hover { background: #5d675d; }
#btn-entrer:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f251f; }
#titre:not([hidden]) ~ #panneau { z-index: 9; }

#titre .liens-titre { display: flex; gap: 10px; }
#titre .liens-titre button {
  position: relative;
  padding: 5px 14px;
  border: 2px solid #2f362f;
  border-radius: 6px;
  background: #eef2ea;
  color: #2f362f;
  font-weight: bold;
}
.annonce { margin-bottom: 12px; padding: 10px 14px; background: var(--vert-moyen); }
.annonce b { display: block; color: var(--vert); font-size: 17px; margin: 2px 0 4px; }
.annonce ul { margin: 0; padding-left: 20px; line-height: 1.5; }

#titre .mention { font-weight: bold; letter-spacing: 2px; }

/* ---------- Petits écrans ---------- */

@media (max-width: 720px) {
  #hud { flex-wrap: wrap; font-size: 19px; gap: 4px 10px; }
  #hud-pop, #hud-pop .icone { width: 50px; height: 50px; }
  #hud-pop b { font-size: 19px; }
  #hud-bonheur { margin-top: 12px; }
  #hud-droite { margin-left: auto; max-width: 200px; }
  .jauges { order: 9; width: 100%; justify-content: center; margin-top: 0; }
  .jauge .rond { width: 34px; height: 34px; }
  .jauge .rond .icone { width: 21px; height: 21px; }
  .jauge .barre { width: 70px; height: 16px; }
  #guide { top: 112px; font-size: 14px; }
  #toasts { top: 200px; }
  #fiche { top: 104px; left: 6px; width: 236px; max-height: calc(100vh - 120px); }
  #salle-info { bottom: 96px; max-width: calc(100vw - 16px); font-size: 19px; }
  #btn-construire .icone { width: 54px; height: 54px; }
  #btn-pipboy .icone { width: 74px; height: 66px; }
  #menu { bottom: 88px; }
  #panneau .contenu { padding: 16px 14px; }
  .fermer { top: 14px; right: 12px; padding: 6px 14px; }
  .onglets { margin-right: 0; margin-top: 44px; }
  .onglets button { min-width: 0; padding: 7px 10px; font-size: 14px; }
  .rangee { grid-template-columns: 40px 1fr auto auto; }
  .rangee .etoiles { display: none; }
  .rangee.legendaire { grid-template-columns: 40px 1fr auto; }
  .rangee.legendaire .petit { display: none; }
  .portrait.geant { width: 120px; height: 120px; }
}
