/* « Ma Cité » (/mon-ile) : le HUD de gestion par-dessus l'île flottante de la vue 3D (island_view.css : ciel,
   socle, nuages) — refonte UX du 29/10 : bandeau du haut, accès rapides à icônes, barre de construction en bas
   (cite_chantier.css). Boîtes en #101624 à 86 % SANS backdrop-filter : un flou recalculé sur le canvas coûte des
   images par seconde. Titres dorés en majuscules au dégradé commun. Animations courtes, coupées sous
   prefers-reduced-motion. */
.cite-ile,
.cite-page,
dialog.cite-confirmation {
  --cite-nuit: rgba(16, 22, 36, .86);
  --cite-bord: rgba(201, 164, 76, .55);
  --cite-or: #EBCC5B;
  --cite-or-2: #D98940;
  --cite-texte: #f3ecdc;
  --cite-gris: #a9aebb;
  --cite-vert: #6fd36a;
  --cite-rouge: #e85a48;
}

.cite-titre-or {
  margin: 0;
  font-family: "Arturo", serif;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--cite-or), var(--cite-or-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cite-boite {
  color: var(--cite-texte);
  background: var(--cite-nuit);
  border: 1px solid var(--cite-bord);
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.cite-boite__titre { font-size: .82rem; margin-bottom: .3rem; }

/* ── Mise en page de « Ma Cité » (refonte UX du 29/10) ──────────────────────────────────────
   Le bandeau du haut (--cite-haut), la barre de construction en bas (--cite-bas, cite_chantier.css), l'île entre
   les deux ; panneaux, barres d'un bâtiment et de la pose, outils et annonces se placent entre ces deux bords. Les
   variables sont posées sur body (le bouton de confidentialité du site, hors de la section, les lit aussi). */
body:has(.cite-ile) { --cite-haut: 4.25rem; --cite-bas: 16.25rem; --cite-marge: .9rem; }
body:has(.cite-chantier[data-replie]) { --cite-bas: 3.25rem; }
@media (max-height: 820px) {
  body:has(.cite-ile) { --cite-bas: 10.5rem; }
  body:has(.cite-chantier[data-replie]) { --cite-bas: 3.25rem; }
}

/* ── Le HUD au-dessus du canvas ─────────────────────────────────────────────────────────── */
.cite-hud { position: absolute; inset: 0; display: block; pointer-events: none; }
.cite-hud > * { pointer-events: auto; }

.cite-svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }

/* Le bandeau du haut : la cité à gauche, ses ressources, le direct, puis les accès rapides. */
.cite-tete {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--cite-haut);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 var(--cite-marge);
  color: var(--cite-texte);
  background: linear-gradient(180deg, rgba(16, 22, 36, .95), rgba(16, 22, 36, .84));
  border-bottom: 1px solid var(--cite-bord);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.cite-identite { display: flex; align-items: center; gap: .7rem; min-width: 0; padding-right: 1rem; border-right: 1px solid rgba(255, 255, 255, .1); }
.cite-blason { width: 2.6rem; height: 2.6rem; flex: 0 0 auto; image-rendering: pixelated; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.cite-identite__texte { min-width: 0; }
h1.cite-identite__nom { font-size: 1.15rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cite-identite p { margin: 0; font-size: .8rem; color: var(--cite-gris); }
.cite-identite__ligne { display: flex; align-items: center; gap: .55rem; white-space: nowrap; }
.cite-identite .cite-identite__rang { color: var(--cite-texte); font-weight: 700; }
.cite-jauge { display: inline-block; width: 5.5rem; height: .4rem; border-radius: .25rem; overflow: hidden; background: rgba(255, 255, 255, .12); }
.cite-jauge b { display: block; height: 100%; background: linear-gradient(90deg, var(--cite-or-2), var(--cite-or)); transition: width .6s ease; }
.cite-identite__progression { font-weight: 700; }

.cite-ressources { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.cite-pastille {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 2.3rem;
  padding: 0 .75rem;
  border-radius: .65rem;
  font-weight: 800;
  font-size: .9rem;
  white-space: nowrap;
  color: var(--cite-texte);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
}
.cite-pastille .cite-svg { width: 1.1rem; height: 1.1rem; color: var(--cite-or); }
.cite-pastille__image { width: 1.25rem; height: 1.25rem; image-rendering: pixelated; }
.cite-pastille__nom { color: var(--cite-gris); font-size: .78rem; font-weight: 700; }
.cite-pastille .currency-amount { font-weight: 800; }
.cite-pastille--actif { border-color: rgba(95, 176, 230, .45); }
.cite-pastille--actif .cite-svg { color: #5FB0E6; animation: cite-chantier-marteau 1.6s ease-in-out infinite; transform-origin: 70% 30%; }
/* Le chantier en cours dans sa pastille : « Four à pain · reste 18 min » sur une ligne, la barre dessous. */
.cite-pastille__chantier { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: .4rem; row-gap: .25rem; min-width: 8rem; font-size: .74rem; font-weight: 700; color: #cfe6f7; }
.cite-pastille__chantier .cite-avancement { display: contents; }
.cite-pastille__chantier .cite-avancement__barre { grid-column: 1 / -1; grid-row: 2; }
.cite-pastille__chantier .cite-avancement__reste { grid-column: 2; grid-row: 1; }
.cite-pastille__batiment { grid-column: 1; grid-row: 1; overflow: hidden; text-overflow: ellipsis; max-width: 9rem; }
@keyframes cite-chantier-marteau { 0%, 60%, 100% { transform: rotate(0); } 30% { transform: rotate(-18deg); } }

/* L'avancement d'un chantier (cite-compte : la barre et le temps restant, refaits toutes les 30 s). */
.cite-avancement { display: grid; gap: .15rem; width: 100%; }
.cite-avancement__barre { display: block; height: .3rem; border-radius: .2rem; overflow: hidden; background: rgba(95, 176, 230, .22); }
.cite-avancement__plein { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #3d8fd0, #7cc4f2); transition: width .8s ease; }
.cite-avancement__reste { font-size: .7rem; font-weight: 700; color: #9fcdee; }
.cite-avancement__reste:empty { display: none; }

.cite-pont {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 700;
  color: #d7ecd6;
}
.cite-pont > span { overflow: hidden; text-overflow: ellipsis; }
.cite-pont i { width: .5rem; height: .5rem; flex: 0 0 auto; border-radius: 50%; background: var(--cite-vert); box-shadow: 0 0 8px var(--cite-vert); }
.cite-pont--en-ligne i { animation: cite-pouls 2.4s ease-in-out infinite; }
/* Page sans attention (onglet caché, fenêtre au second plan : cite-hud, data-attention) : le voyant se fige,
   comme la vue 3D ; flux fermé (veille), il s'éteint jusqu'au retour. */
.cite-ile[data-attention="non"] .cite-pont--en-ligne i { animation-play-state: paused; }
.cite-ile[data-direct="veille"] .cite-pont--en-ligne i { animation: none; opacity: .45; box-shadow: none; }
.cite-pont--hors-ligne { color: #f6d2cc; }
.cite-pont--hors-ligne i { background: var(--cite-rouge); box-shadow: none; }
@keyframes cite-pouls { 50% { opacity: .35; } }

.cite-bandeau {
  position: absolute;
  top: calc(var(--cite-haut) + .6rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: .55rem 1rem;
  border-radius: .6rem;
  font-weight: 700;
  text-align: center;
  color: #fff4f1;
  background: rgba(120, 30, 20, .88);
  border: 1px solid rgba(232, 90, 72, .7);
}
.cite-bandeau--page { position: static; transform: none; width: auto; max-width: none; margin-top: 1rem; }

/* ── Accès rapides (bandeau) ────────────────────────────────────────────────────────────── */
.cite-acces { display: flex; gap: .4rem; flex: 0 0 auto; }
.cite-acces__bouton {
  position: relative;
  width: 3.6rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .15rem;
  padding: 0;
  border: 1px solid rgba(201, 164, 76, .6);
  border-radius: .75rem;
  color: #f3e7c4;
  background: radial-gradient(circle at 35% 25%, #2b3550, #121826);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.cite-acces__icone { width: 1.35rem; height: 1.35rem; color: var(--cite-or); }
.cite-acces__libelle { font-size: .6rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.cite-acces__bouton:hover { transform: translateY(-2px); border-color: #fff1c0; box-shadow: 0 8px 18px rgba(0, 0, 0, .45); }
.cite-acces__bouton:active { transform: translateY(0) scale(.96); }
.cite-acces__bouton:focus-visible { outline: 3px solid #5FB0E6; outline-offset: 2px; }
.cite-acces__bouton[aria-disabled="true"] { opacity: .45; filter: grayscale(.6); cursor: not-allowed; transform: none; }
/* Le panneau ouvert : son bouton reste allumé. */
.cite-ile:has(.cite-panneau[data-panneau="habitants"]:not([hidden])) .cite-acces__bouton[data-cite-hud-panneau-param="habitants"],
.cite-ile:has(.cite-panneau[data-panneau="droits"]:not([hidden])) .cite-acces__bouton[data-cite-hud-panneau-param="droits"],
.cite-ile:has(.cite-panneau[data-panneau="courrier"]:not([hidden])) .cite-acces__bouton[data-cite-hud-panneau-param="courrier"],
.cite-ile:has(.cite-panneau[data-panneau="domaine"]:not([hidden])) .cite-acces__bouton[data-cite-hud-panneau-param="domaine"],
.cite-ile:has(.cite-panneau[data-panneau="tresor"]:not([hidden])) .cite-acces__bouton[data-cite-hud-panneau-param="tresor"],
.cite-ile:has(.cite-panneau[data-panneau="reglages"]:not([hidden])) .cite-acces__bouton[data-cite-hud-panneau-param="reglages"] {
  border-color: #fff1c0;
  box-shadow: 0 0 0 2px rgba(235, 204, 91, .35), 0 6px 14px rgba(0, 0, 0, .45);
}
.cite-acces__badge {
  position: absolute;
  top: -.35rem;
  right: -.35rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  display: grid;
  place-items: center;
  border-radius: .6rem;
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  background: var(--cite-rouge);
  border: 2px solid #121826;
  animation: cite-badge-entree .3s ease-out;
}
.cite-acces__badge[hidden] { display: none; }
@keyframes cite-badge-entree { from { transform: scale(.4); opacity: 0; } }

/* Infobulles des boutons à icônes (police du site, identiques partout) : sous le bouton dans le bandeau, à gauche
   dans la colonne des outils (island_view.css). */
[data-infobulle] { position: relative; }
.cite-acces__bouton[data-infobulle]::after {
  content: attr(data-infobulle);
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  z-index: 8;
  padding: .3rem .6rem;
  border-radius: .45rem;
  white-space: nowrap;
  font: 700 .78rem/1.3 "Nunito", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cite-texte);
  background: #101624;
  border: 1px solid var(--cite-bord);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-.2rem);
  transition: opacity .12s ease, transform .12s ease;
}
.cite-acces__bouton[data-infobulle]:hover::after,
.cite-acces__bouton[data-infobulle]:focus-visible::after { opacity: 1; transform: none; transition-delay: .25s; }

/* Les bonus actifs, en pastilles sous le bandeau. */
.cite-bonus { position: absolute; top: calc(var(--cite-haut) + 3.3rem); left: var(--cite-marge); max-width: calc(100% - 10rem); }
.cite-bonus ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.cite-bonus li, .cite-bonus__vide {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .25rem .7rem .25rem .35rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  color: #d8f5d2;
  background: var(--cite-nuit);
  border: 1px solid rgba(111, 211, 106, .45);
}
.cite-bonus__vide { padding-left: .7rem; color: var(--cite-gris); border-color: rgba(255, 255, 255, .12); }
.cite-bonus__metier { width: 1.25rem; height: 1.25rem; image-rendering: pixelated; }
.cite-bonus__metier--emoji { width: auto; height: auto; }
.cite-metier { image-rendering: pixelated; }

/* Outils de la vue 3D : une colonne à droite, au milieu de l'île visible (entre le bandeau et la barre du bas). */
.cite-ile .island-view__tools {
  top: calc(var(--cite-haut) + (100% - var(--cite-haut) - var(--cite-bas)) / 2);
  bottom: auto;
  right: var(--cite-marge);
  transform: translateY(-50%);
  transition: top .25s ease;
}

/* « Dessiner l'île » : sous le message de la vue 3D, seulement quand l'export manque (§ 11.4). */
.cite-dessiner { display: none; }
.cite-ile[data-export="absent"] .cite-dessiner {
  display: inline-flex;
  position: absolute;
  top: calc(45% + 3.5rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ── Sélecteur de cité : sous le bandeau, à gauche (un panneau ouvert, à droite, ne le couvre pas) ───── */
.cite-selecteur { position: absolute; z-index: 3; left: var(--cite-marge); top: calc(var(--cite-haut) + .6rem); max-width: min(16rem, calc(100% - 2rem)); padding: .35rem .75rem; font-size: .85rem; }
.cite-selecteur summary { cursor: pointer; font-weight: 800; }
.cite-selecteur ul { margin: .4rem 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
.cite-selecteur a { color: var(--cite-texte); text-decoration: none; }
.cite-selecteur a:hover, .cite-selecteur a:focus-visible { color: var(--cite-or); text-decoration: underline; }
.cite-selecteur a[aria-current="page"] { color: var(--cite-or); font-weight: 800; }
.cite-selecteur small { color: var(--cite-gris); }
/* Le bouton « Confidentialité et cookies » du site (audience_consent.css : fixe, en bas à gauche, affiché quand la
   mesure d'audience est active) couvrirait la barre de construction : sur Ma Cité, il monte au-dessus d'elle. */
body:has(.cite-ile) .audience-settings { bottom: calc(var(--cite-bas) + .6rem); left: var(--cite-marge); }

/* ── Panneau d'un accès rapide : à droite, entre le bandeau et la barre du bas ─────────── */
.cite-panneau {
  position: absolute;
  top: calc(var(--cite-haut) + .6rem);
  right: var(--cite-marge);
  bottom: calc(var(--cite-bas) + .6rem);
  z-index: 6;
  width: min(26rem, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  color: var(--cite-texte);
  background: var(--cite-nuit);
  border: 1px solid var(--cite-bord);
  border-radius: .9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  animation: cite-panneau-entree .18s ease-out;
}
.cite-panneau[hidden] { display: none; }
@keyframes cite-panneau-entree { from { opacity: 0; transform: translateX(.8rem); } }
.cite-panneau__tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.cite-panneau__tete h2 { font-size: 1.05rem; }
.cite-panneau__fermer, .cite-barre__fermer {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 50%;
  color: var(--cite-texte);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}
.cite-panneau__fermer .cite-svg, .cite-barre__fermer .cite-svg { width: 1rem; height: 1rem; }
.cite-panneau__fermer:hover, .cite-barre__fermer:hover { background: rgba(255, 255, 255, .14); }
.cite-panneau__fermer:focus-visible, .cite-barre__fermer:focus-visible { outline: 3px solid #5FB0E6; outline-offset: 2px; }
.cite-panneau__cadre { display: block; flex: 1 1 auto; overflow: auto; padding: 1rem; }

.cite-annonce {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: calc(var(--cite-bas) + 1rem);
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: .5rem .9rem;
  border-radius: .6rem;
  font-weight: 700;
  color: var(--cite-texte);
  background: var(--cite-nuit);
  border: 1px solid var(--cite-bord);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
  animation: cite-annonce-entree .22s ease-out;
}
.cite-annonce[hidden] { display: none; }
@keyframes cite-annonce-entree { from { opacity: 0; transform: translate(-50%, .5rem); } }

/* ── Barre d'actions d'un bâtiment (tâche 17) : au-dessus de la barre de construction, au centre ── */
.cite-barre {
  position: absolute;
  left: 50%;
  bottom: calc(var(--cite-bas) + .75rem);
  z-index: 5;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: .6rem 2.9rem .6rem .9rem;
  color: var(--cite-texte);
  background: var(--cite-nuit);
  border: 1px solid var(--cite-bord);
  border-radius: .9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  animation: cite-barre-entree .18s ease-out;
}
.cite-barre[hidden] { display: none; }
@keyframes cite-barre-entree { from { opacity: 0; transform: translate(-50%, .5rem); } }
.cite-barre__fermer { position: absolute; top: .45rem; right: .45rem; width: 1.9rem; height: 1.9rem; }
.cite-barre__cadre { display: block; }
.cite-barre .cite-panneau__message { position: static; margin: 0 0 .45rem; padding: .3rem .5rem; border-radius: .4rem; }
.cite-barre__etat { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.cite-barre__nom { display: flex; flex-direction: column; padding-right: .7rem; border-right: 1px solid rgba(255, 255, 255, .12); }
.cite-barre__nom b { white-space: nowrap; font-size: 1rem; }
.cite-barre__nom small { display: inline-flex; align-items: center; gap: .3rem; color: var(--cite-gris); font-size: .78rem; }
.cite-barre__metier { width: 1.1rem; height: 1.1rem; image-rendering: pixelated; }
.cite-barre__gestes { display: flex; flex-wrap: wrap; gap: .45rem; }
.cite-barre__gestes .cite-bouton { white-space: nowrap; }
/* Le trésor ne suffit pas au coût du niveau suivant (condition connue fausse) : le jeu refusera au geste. */
.cite-barre__cout--manque { color: #f6d2cc; text-decoration: underline wavy var(--cite-rouge); text-underline-offset: 3px; }
.cite-barre__absent { margin: 0; color: var(--cite-gris); }
/* Infos : la fiche, au-dessus de la barre. */
.cite-barre__fiche { display: none; }
.cite-barre[data-infos] .cite-barre__fiche {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + .5rem);
  max-height: 45vh;
  overflow: auto;
  padding: .8rem 1rem;
  background: #101624;
  border: 1px solid var(--cite-bord);
  border-radius: .9rem;
}
.cite-ile:has(.cite-barre:not([hidden])) .cite-annonce,
.cite-ile:has(.cite-pose:not([hidden])) .cite-annonce { bottom: calc(var(--cite-bas) + 7.5rem); }

/* ── Pose d'un bâtiment (tâche 18) : la barre de la pose, au-dessus de la barre de construction ── */
.cite-pose {
  position: absolute;
  left: 50%;
  bottom: calc(var(--cite-bas) + .75rem);
  z-index: 5;
  transform: translateX(-50%);
  width: min(34rem, calc(100% - 2rem));
  display: grid;
  gap: .45rem;
  padding: .6rem .9rem;
  color: var(--cite-texte);
  background: var(--cite-nuit);
  border: 1px solid var(--cite-bord);
  border-radius: .9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  animation: cite-barre-entree .18s ease-out;
}
.cite-pose[hidden] { display: none; }
.cite-pose__nom { font-size: 1rem; }
.cite-pose__bulle { min-height: 1.3rem; font-size: .9rem; }
.cite-pose__bulle[data-genre="ok"] { color: #d8f5d2; }
.cite-pose__bulle[data-genre="refus"] { color: #f6d2cc; }
.cite-pose__bulle .cite-rendu { margin: 0; }
.cite-pose__bulle .cite-rendu__message { margin: 0; }
.cite-pose__gestes { display: flex; flex-wrap: wrap; gap: .45rem; }
.cite-pose__gestes .cite-bouton { display: inline-flex; align-items: center; gap: .35rem; }
.cite-pose__gestes .cite-svg { width: 1.05rem; height: 1.05rem; }
/* Pendant un glisser, la barre de la pose ne prend pas le pointeur : la carte se lâche sur l'île, même dessous. */
.cite-ile[data-pose-glisse] .cite-pose { pointer-events: none; opacity: .92; }

/* Bandeau trop étroit pour tout dire : les noms des ressources, les présents et le texte de la progression
   s'effacent (lus quand même), les icônes et les nombres restent. */
@media (max-width: 1500px) {
  .cite-pastille__nom, .cite-pont__presents, .cite-pont__suite { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .cite-pastille { padding: 0 .6rem; }
}
@media (max-width: 1180px) {
  .cite-identite__progression, .cite-pastille__batiment { display: none; }
  .cite-pastille__chantier { min-width: 4.5rem; }
  .cite-acces__bouton { width: 3rem; }
  .cite-acces__libelle { font-size: .52rem; }
  .cite-tete { gap: .6rem; }
}

/* ── Pages simples : « Fonder ma cité », îles publiques, cité indisponible ─────────────── */
.cite-page { max-width: 56rem; margin: 0 auto; padding: 2rem 1rem 3rem; color: var(--cite-texte); }
.cite-page h1.cite-titre-or { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .75rem; }
.cite-page p { color: #ddd6c6; }
.cite-page__sous-titre { font-size: 1.1rem; margin: 2rem 0 .75rem; }
.cite-lien, .cite-page a { color: var(--cite-or); }
.cite-invitations { margin: 0; padding: 0; list-style: none; display: grid; gap: .75rem; }
.cite-invitation { display: grid; grid-template-columns: 3.25rem 1fr auto; gap: .9rem; align-items: center; padding: .8rem 1rem; }
.cite-invitation p { margin: 0; }
.cite-invitation__nom { font-weight: 800; font-size: 1.05rem; }
.cite-invitation__detail { font-size: .85rem; color: var(--cite-gris) !important; }
.cite-invitation__choix { display: flex; gap: .5rem; }
.cite-bouton { padding: .45rem .9rem; border-radius: .5rem; font-weight: 800; color: var(--cite-texte); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); cursor: pointer; }
.cite-bouton--or { color: #2b1a05; background: linear-gradient(180deg, #f0d06a, #c98a3c); border-color: #8a5a1e; }
.cite-bouton[aria-disabled="true"], .cite-bouton:disabled { opacity: .45; cursor: not-allowed; }
.cite-bouton:focus-visible { outline: 3px solid #5FB0E6; outline-offset: 2px; }
.cite-annonce--page { position: static; transform: none; margin-top: 1rem; display: inline-block; }

/* ── Téléphone : bandeau sur trois lignes (la cité, les ressources, les accès rapides défilants), barre de
   construction resserrée, outils au-dessus d'elle, panneaux plein écran ─────────────────────────────── */
@media (max-width: 640px) {
  body:has(.cite-ile) { --cite-bas: 10.25rem; --cite-marge: .5rem; }
  body:has(.cite-chantier[data-replie]) { --cite-bas: 3rem; }
  .cite-hud { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; }
  .cite-tete { position: static; height: auto; flex-wrap: wrap; gap: .4rem .6rem; padding: .45rem .5rem .5rem; }
  .cite-identite { flex: 1 1 0; order: 0; padding-right: 0; border-right: 0; }
  .cite-pont { order: 1; }
  .cite-ressources { order: 2; }
  .cite-acces { order: 3; }
  .cite-blason { width: 2.1rem; height: 2.1rem; }
  h1.cite-identite__nom { font-size: 1rem; }
  .cite-identite__progression { display: none; }
  .cite-pont { margin: 0; }
  .cite-pont > span { display: none; }
  .cite-ressources, .cite-acces { flex: 1 0 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: .1rem; }
  .cite-ressources::-webkit-scrollbar, .cite-acces::-webkit-scrollbar { display: none; }
  .cite-pastille { height: 2rem; font-size: .82rem; }
  .cite-pastille__batiment { display: none; }
  .cite-acces { gap: .35rem; }
  .cite-acces__bouton { flex: 0 0 auto; width: 3.4rem; height: 2.6rem; }
  .cite-acces__icone { width: 1.15rem; height: 1.15rem; }
  .cite-acces__libelle { font-size: .5rem; }
  .cite-acces__bouton[data-infobulle]::after { display: none; }
  .cite-bandeau { position: static; transform: none; width: auto; max-width: none; margin: 0 .5rem; }
  .cite-bonus { position: static; max-width: none; padding: 0 .5rem; }
  .cite-bonus ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cite-bonus li { flex: 0 0 auto; }
  .cite-ile .island-view__tools { top: auto; bottom: calc(var(--cite-bas) + .6rem); right: .5rem; transform: none; }
  .cite-selecteur { top: auto; left: .5rem; bottom: calc(var(--cite-bas) + .6rem); max-width: calc(100% - 9rem); }
  /* Le bouton de confidentialité va à droite de « Mes cités », resserré, à gauche des outils ; un panneau ouvert
     (plein écran) le masque. */
  body:has(.cite-ile) .audience-settings { left: auto; right: 3.9rem; max-width: 8.5rem; padding: 6px 9px; font-size: 11px; line-height: 1.25; text-align: left; }
  body:has(.audience-settings:not([hidden])) .cite-selecteur { max-width: calc(100% - 13.5rem); }
  body:has(.cite-panneau:not([hidden])) .audience-settings { display: none; }
  .cite-barre { width: calc(100% - 1rem); max-width: none; padding-right: 2.6rem; }
  .cite-barre__nom { border-right: 0; padding-right: 0; }
  .cite-barre__gestes { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .cite-pose { width: calc(100% - 1rem); }
  .cite-panneau { position: fixed; inset: 0; z-index: 60; width: auto; border-radius: 0; }
  .cite-invitation { grid-template-columns: 2.6rem 1fr; }
  .cite-invitation__choix { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .cite-pont--en-ligne i, .cite-pastille--actif .cite-svg, .cite-acces__badge { animation: none; }
  .cite-panneau, .cite-annonce, .cite-barre, .cite-pose { animation: none; }
  .cite-acces__bouton, .cite-jauge b, .cite-avancement__plein, .cite-ile .island-view__tools { transition: none; }
  .cite-acces__bouton:hover { transform: none; }
}

/* ── Banque de la cité dans l'en-tête de la carte du spawn (maps/_banque_cite) ──────────── */
.banque-cite {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .65rem;
  border-radius: .75rem;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
  white-space: nowrap;
  color: #f3ecdc;
  text-decoration: none;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(217, 137, 64, .35);
}
a.banque-cite:hover, a.banque-cite:focus-visible { border-color: #EBCC5B; }
a.banque-cite:focus-visible { outline: 3px solid #5FB0E6; outline-offset: 2px; }
.banque-cite__coffre { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.banque-cite .currency-amount { font-weight: 800; }
.banque-cite__etat { font-size: .78rem; font-weight: 600; color: #c4b5fd; }
.banque-cite--hors-ligne .currency-amount { opacity: .6; }
.banque-cite--hors-ligne .banque-cite__etat { color: #f6b8ae; }
@media (max-width: 640px) {
  /* Masqué à l'écran seulement : « Banque » reste dans le nom lu du lien. */
  .banque-cite__libelle { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .banque-cite { padding: .25rem .45rem; font-size: .8rem; }
}

/* ── Fenêtre de confirmation des gestes lourds (cite/confirmation.js, à la place de window.confirm) ── */
dialog.cite-confirmation {
  width: min(26rem, calc(100% - 2rem));
  margin: auto;
  padding: 1.1rem 1.2rem 1rem;
  color: #f3ecdc;
  background: rgba(16, 22, 36, .96);
  border: 1px solid rgba(201, 164, 76, .7);
  border-radius: .9rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}
dialog.cite-confirmation[open] { animation: cite-confirmation-entree .16s ease-out; }
dialog.cite-confirmation::backdrop { background: rgba(8, 10, 18, .6); }
.cite-confirmation__titre { font-size: 1.05rem; margin: 0 0 .5rem; }
.cite-confirmation__message { margin: 0 0 1rem; line-height: 1.4; }
.cite-confirmation__gestes { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.cite-confirmation__gestes .cite-bouton { min-height: 2.75rem; }
@keyframes cite-confirmation-entree { from { opacity: 0; transform: translateY(.4rem) scale(.98); } }
@media (max-width: 640px) {
  .cite-confirmation__gestes { flex-direction: column-reverse; }
  .cite-confirmation__gestes .cite-bouton { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.cite-confirmation[open] { animation: none; }
}
