/* economie.css — Brick ZR : la ville vit de ses commerces (economie.js). Le style « Brick ZR, les briques » (jetons de styles.css). */

/* ── Le compteur en haut de Ma ville : l'or · les habitants · les visiteurs · les postes à pourvoir (une tuile du tableau de bord) ── */
.city-pill.eco-pill { position: relative; padding-right: 11px; gap: 5px; }
.city-pill.eco-pill > svg { width: 20px; height: 20px; stroke: none; flex: none; }
.eco-pill .ep-txt { display: flex; align-items: center; gap: 5px; }
.eco-pill .ep-or { min-width: 1.2em; color: var(--jaune); font-variant-numeric: tabular-nums; }
/* les éclats, à côté de l'or (le même compteur que la barre du haut : leur gemme et leur nombre) */
.eco-pill .ep-haut { display: flex; align-items: center; gap: 7px; }
.eco-pill .ep-eclats { display: inline-flex; align-items: center; gap: 2px; color: var(--texte); font-variant-numeric: tabular-nums; }
.eco-pill .ep-eclats .ico { width: 16px; height: 16px; stroke: none; }
.eco-pill .ep-stats { display: flex; align-items: center; gap: 7px; margin-left: 3px; padding-left: 8px; height: 22px;
  box-shadow: inset 2px 0 0 var(--plaque-bord); font-size: 13px; }
.eco-pill .ep-stats > span { display: inline-flex; align-items: center; gap: 2px; }
.eco-pill .ep-stats b { font-variant-numeric: tabular-nums; }
.eco-pill .ep-stats .ico { width: 15px; height: 15px; vertical-align: 0; }
/* Sur un téléphone : l'or en grand, les habitants, les visiteurs et les postes en petit dessous. La pastille reste étroite :
   les boutons du haut tiennent en 2 rangées, même avec 99 999 pièces et une grande ville (360 px compris). */
@media (max-width: 440px) {
  .city-pill.eco-pill { gap: 6px; padding: 0 10px 0 8px; }
  .city-pill.eco-pill > svg { width: 21px; height: 21px; }
  .eco-pill .ep-txt { flex-direction: column; align-items: flex-start; gap: 3px; }
  .eco-pill .ep-or { font-size: 15px; line-height: 1; }
  .eco-pill .ep-haut { gap: 6px; }
  .eco-pill .ep-eclats { font-size: 13px; line-height: 1; }
  .eco-pill .ep-eclats .ico { width: 14px; height: 14px; }
  .eco-pill .ep-stats { height: auto; gap: 5px; margin: 0; padding: 0; box-shadow: none; font-size: 11px; line-height: 1; letter-spacing: -.1px; }
  .eco-pill .ep-stats > span { gap: 1px; }
  .eco-pill .ep-stats .ico { width: 13px; height: 13px; }
}
/* des postes à pourvoir et des habitants libres : on peut embaucher (un liseré jaune, comme un bateau qui arrive) */
.city-pill.eco-pill.embauche { box-shadow: 0 3px 0 var(--plaque-bord), inset 0 0 0 2px var(--jaune); }
.eco-pill.embauche .ep-emp b { color: var(--jaune); }
/* les pièces arrivent : le chiffre de l'or saute un peu (retour d'information, 220 ms) */
.eco-pill.gagne .ep-or { animation: ep-gagne .22s var(--ease-out); }
@keyframes ep-gagne { 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.eco-pill .ep-or { display: inline-block; }

/* ── Les bulles d'or au-dessus des bâtiments qui rapportent (une pastille ronde : son anneau se remplit) ── */
.eco-couche { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.city-touring .eco-couche, .city-fullscreen:not(.active) .eco-couche { display: none !important; }
.eco-bulle { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 50% 100%; will-change: transform; transition: opacity .2s var(--ease-out); }
/* un bâtiment sélectionné (ses flèches, sa fiche) : les autres bulles s'effacent un peu, on peut toujours les toucher */
.eco-couche.edition .eco-bulle { opacity: .45; }
.eb-corps {
  position: relative; display: block; width: 38px; height: 38px; border-radius: 50%;
  background: var(--plaque); box-shadow: 0 3px 0 var(--plaque-bord), 0 5px 8px rgba(10,16,34,.35);
}
/* la petite pointe sous la bulle : elle montre le bâtiment */
.eb-corps::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; margin-left: -5px;
  background: inherit; transform: rotate(45deg); border-radius: 0 0 3px 0; box-shadow: 2px 2px 0 var(--plaque-bord); z-index: -1;
}
/* (l'anneau seulement, l'enfant direct : « .eb-corps svg » prenait aussi l'icône du vendeur d'un commerce fermé, couchée d'un
   quart de tour et collée dans le coin) */
.eb-corps > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.eb-piste { fill: none; stroke: var(--plaque-bord); stroke-width: 3.5; }
.eb-anneau { fill: none; stroke: var(--jaune); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease-out); }
.eb-n {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--texte); font: 800 12.5px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.2px;
}
.eb-n .eb-max { color: var(--texte-2); font-size: 10px; font-weight: 700; }
/* au moins une pièce : le chiffre en or */
.eco-bulle.pret .eb-n > span:first-child { color: var(--jaune); }
/* pleine : une pièce d'or qui sautille (elle s'arrête de se remplir) */
.eco-bulle.plein .eb-corps { background: linear-gradient(180deg, var(--jaune-face) 0 3px, var(--jaune) 3px); box-shadow: 0 3px 0 var(--jaune-ombre), 0 5px 8px rgba(10,16,34,.35);
  animation: eb-sautille 2.4s var(--ease-out) infinite; }
.eco-bulle.plein .eb-corps::after { box-shadow: 2px 2px 0 var(--jaune-ombre); }
.eco-bulle.plein .eb-piste, .eco-bulle.plein .eb-anneau { stroke: transparent; }
.eco-bulle.plein .eb-n, .eco-bulle.plein .eb-n .eb-max, .eco-bulle.plein .eb-n > span:first-child { color: var(--jaune-txt); }
@keyframes eb-sautille { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } 90% { transform: translateY(0); } 95% { transform: translateY(-2px); } }
/* fermé (pas de vendeur) : une pastille éteinte, un Briko au travail à trouver */
.eco-bulle.ferme .eb-corps { background: var(--eteint); box-shadow: 0 3px 0 var(--eteint-ombre), 0 5px 8px rgba(10,16,34,.3); }
.eco-bulle.ferme .eb-corps::after { box-shadow: 2px 2px 0 var(--eteint-ombre); }
.eco-bulle.ferme .eb-anneau { stroke: transparent; }
.eco-bulle.ferme .eb-piste { stroke: var(--eteint-ombre); }
/* fermé : le petit vendeur et, dessous, ses vendeurs sur ses postes (« 0/1 », « 0/3 ») */
.eco-bulle.ferme .eb-n { flex-direction: column; gap: 1px; }
.eb-gars { display: flex; line-height: 1; }
.eb-gars .ico { width: 16px; height: 16px; }
.eb-postes { font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: 0; color: var(--texte); }
/* ouvert, mais pas tous ses vendeurs (« 1/3 ») : une pastille au bord, en bas à droite, hors de l'anneau (l'or reste au milieu ;
   son coin arrondi s'arrête au bord de l'anneau, à 18 px du centre) */
.eb-vendeurs {
  position: absolute; left: 30px; top: 28px; z-index: 1; display: flex; align-items: center; gap: 1px;
  height: 16px; padding: 0 4px 0 2px; border-radius: 8px;
  background: var(--plaque-bord); color: var(--texte); font: 800 10px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 2px 0 #060a18, inset 0 0 0 1.5px var(--rouge);
}
.eb-vendeurs .ico { width: 12px; height: 12px; }

/* ── La récolte : les pièces volent vers le compteur, le gain monte de la bulle ── */
.eco-piece {
  position: absolute; z-index: 6; width: 16px; height: 16px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 35%, #ffe27a, #e8b923 60%, #a87b08); box-shadow: 0 1px 0 #7a5900;
}
.eco-gain {
  position: absolute; z-index: 6; pointer-events: none; transform: translate(-50%, -100%);
  color: var(--jaune); font: 800 17px/1 var(--font); text-shadow: 0 2px 0 var(--plaque-bord), 0 0 6px rgba(10,16,34,.5);
  animation: eco-gain .9s var(--ease-out) forwards;
}
@keyframes eco-gain { 0% { opacity: 0; transform: translate(-50%, -80%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -190%); } }

/* ── « Tout ramasser » (Mairie 3) : une brique jaune, à droite, au-dessus de la barre et du bac ── */
.eco-rang { display: flex; justify-content: flex-end; margin: 0 2px 14px; pointer-events: none; }
.eco-rang.hidden { display: none; }
.eco-rang .btn { pointer-events: auto; }
.eco-tout .et-or, .ef-embaucher .et-or { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.eco-tout .pg-or, .ef-embaucher .pg-or { width: 13px; height: 13px; vertical-align: 0; }

/* ── La fiche d'un bâtiment, dans la barre de Ma ville (city.js) ── */
.eco-fiche {
  flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: 7px;
  padding: 9px 10px; border-radius: 8px; background: var(--plaque-haut); box-shadow: inset 0 -2px 0 var(--plaque-bord);
  font-size: 13.5px; line-height: 1.3; color: var(--texte-2);
}
.eco-fiche b { color: var(--texte); font-variant-numeric: tabular-nums; }
.eco-fiche.ef-simple { flex-direction: row; align-items: center; gap: 8px; }
.ef-l { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.ef-morceau { display: contents; } /* (un morceau que economie.js refait seul : ses enfants restent dans la ligne) */
.ef-ico { flex: none; width: 20px; display: flex; justify-content: center; line-height: 1; }
.ef-ico .ico { width: 18px; height: 18px; }
.ef-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ef-type { color: var(--texte); font-weight: 700; flex-wrap: wrap; row-gap: 2px; }
.ef-concur { flex: 1 1 auto; text-align: right; color: var(--texte-2); font-size: 12.5px; font-weight: 600; }
.ef-pleine { color: var(--jaune) !important; }
.ef-ferme { color: var(--rouge-clair); font-weight: 600; }
.eco-fiche .ef-jauge { height: 6px; }
.eco-fiche .ef-jauge > i { background: linear-gradient(180deg, var(--jaune-clair) 0 2px, var(--jaune) 2px); }
.ef-parjour { color: var(--texte-2); font-size: 12.5px; font-weight: 600; }
.ef-parjour b { color: var(--jaune); }
.eco-fiche .cb-btn { height: 36px; padding: 3px 11px 0; font-size: 14px; }
/* Récolter : une brique verte ; Embaucher : une brique bleue (le jaune reste à « OK ») ; impossible : terne, et touchable */
.eco-fiche .ef-recolter { --c: var(--vert); --c-face: var(--vert-face); --c-clair: var(--vert-clair); --c-ombre: var(--vert-ombre); }
.eco-fiche .ef-embaucher.ef-dim { --c: var(--eteint); --c-face: var(--eteint-face); --c-clair: var(--eteint-clair); --c-ombre: var(--eteint-ombre); color: var(--eteint-txt); }

/* ── La fenêtre « Ta ville vit de ses commerces » : serrée, elle tient sans défiler (375 × 667 compris) ── */
.fen-eco .fen-titre { padding: 12px 58px 11px 14px; font-size: 18px; }
.fen-eco .fen-corps { padding: 10px 14px 0; }
.fen-eco .fen-boutons { padding: 12px 14px 14px; }
.fen-eco .fe-gros { margin: 0 0 8px; font-size: 16px; line-height: 1.3; text-align: center; }
.fen-eco .fe-gros b { color: var(--jaune); font-size: 22px; font-variant-numeric: tabular-nums; }
.fe-liste { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fe-liste li { display: flex; align-items: center; gap: 10px; padding: 6px 11px 7px; border-radius: var(--r-tuile); background: var(--plaque-haut); box-shadow: var(--ombre-ligne); }
.fe-ico { flex: none; width: 24px; display: flex; justify-content: center; }
.fe-ico .ico { width: 22px; height: 22px; }
.fe-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.25; font-weight: 700; color: var(--texte); }
.fe-txt small { font-size: 12.5px; line-height: 1.3; font-weight: 500; color: var(--texte-2); }
.fe-liste li > b { flex: none; color: var(--jaune); font-size: 16px; font-variant-numeric: tabular-nums; }
.fen-eco .fen-petit { margin: 0 0 4px; font-size: 13px; line-height: 1.4; }
.fen-eco-nouveau .fe-etapes li { padding: 7px 11px; }
/* un écran bas (375 × 667…) : encore un peu plus serré */
@media (max-height: 700px) {
  .fen-eco .fen-titre { padding: 10px 56px 9px 14px; font-size: 17px; }
  .fen-eco .fe-gros { margin-bottom: 6px; }
  .fe-liste { gap: 5px; margin-bottom: 8px; }
  .fe-liste li { padding: 5px 11px 6px; }
  .fen-eco .fen-petit { font-size: 12.5px; line-height: 1.35; }
}

/* ── La boutique : les packs d'éclats (l'icône à la taille de la pièce des packs d'or) ── */

/* Moins d'animations : rien ne saute ni ne vole (les pièces n'apparaissent pas, le gain s'efface sur place) */
@media (prefers-reduced-motion: reduce) {
  .eco-bulle.plein .eb-corps, .eco-pill.gagne .ep-or { animation: none; }
  .eb-anneau { transition: none; }
  .eco-gain { animation: eco-gain-doux .9s ease forwards; }
  @keyframes eco-gain-doux { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
}
