/* /var/www/alessio-site/public/assets/css/excedent2-map.css
 *
 * Excedent II : onglet « Carte » (globe et planisphere). Complete assets/css/excedent2.css,
 * dont il reprend les variables (papier, encre, rayons) et les composants (x2-segs, x2-chip, x2-meter...).
 * Charte : docs/EXCEDENT2_VISUEL.md. Le dessin de la carte lui-meme est dans assets/js/excedent2-map.js (canvas).
 */

/* La quatrieme encre : celle de la carte (violet), distincte du rouge, du vert et du bleu des trois autres onglets. */
.x2-game[data-tab="carte"]{ --x2-hue: #6f42a6; --x2-hue-soft: #ebe3f6; --x2-hue-deep: #4a2878; }
.x2-tab[data-tab="carte"]{ --tab-hue: #6f42a6; --tab-soft: #ebe3f6; --tab-light: #c9aef0; }

/* Quatre onglets au lieu de trois : sur tablette, le rappel du premier jour (« En pause · choisis ×1, ×2 ou ×4 pour lancer
   le temps ») ne tenait plus a cote d'eux et perdait son debut. Il garde l'essentiel ; la phrase entiere revient a partir de 1 280 px. */
.x2-paused-more{ margin-left: -.24em; }
@media (max-width: 1279px){ .x2-paused-more{ display: none; } }

/* Mise en page : la carte prend toute la feuille, la fiche du pays est a droite. */
.x2-map{ flex: 1; min-height: 0; display: flex; flex-direction: column; }
.x2-map-head{ align-items: center; }
.x2-map-head > div:first-child{ min-width: 0; }
.x2-map-modes{ margin-left: auto; flex: none; }
.x2-map-body{ flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; padding: 0 18px 18px; }

.x2-map-stage{ position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 18px; background: var(--x2-paper-2); box-shadow: inset 0 0 0 1px var(--x2-rule); }
#x2-map-canvas{ position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#x2-map-canvas:active{ cursor: grabbing; }

/* Calques : ce que racontent les couleurs */
.x2-map-layers{ position: absolute; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.x2-map-layers .x2-chip{ pointer-events: auto; display: inline-flex; align-items: center; gap: .42em; height: 40px; padding: 0 .85em 0 .7em; font-weight: 600; color: var(--x2-ink-2); background: var(--x2-card); box-shadow: inset 0 0 0 1px var(--x2-rule-2), var(--x2-shadow-card); }
.x2-map-layers .x2-chip[aria-pressed="true"]{ background: var(--x2-ink); color: var(--x2-paper); box-shadow: var(--x2-shadow-card); }
.x2-map-layers .x2-chip .x2-ico{ width: 1.1em; height: 1.1em; }

.x2-map-legend{ position: absolute; left: 10px; bottom: 10px; display: grid; gap: 4px; max-width: 236px; padding: 10px 12px 9px; border-radius: 13px; background: rgba(255,253,248,.93); box-shadow: inset 0 0 0 1px var(--x2-rule), var(--x2-shadow-card); font-size: .78rem; line-height: 1.25; color: var(--x2-ink-2); pointer-events: none; }
.x2-map-legend:empty{ display: none; }
.x2-map-legend b{ margin-bottom: 2px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--x2-ink-3); }
.x2-map-key{ display: flex; align-items: center; gap: 8px; }
.x2-map-key i{ flex: none; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(23,32,48,.28); }
.x2-map-ramp{ display: block; min-width: 180px; height: 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(23,32,48,.22); }
.x2-map-ramp-scale{ display: flex; justify-content: space-between; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.x2-map-ramp-scale i{ font-style: normal; }

.x2-map-tools{ position: absolute; right: 10px; bottom: 10px; display: grid; gap: 6px; }
.x2-map-tool{ display: grid; place-items: center; width: var(--x2-tap); height: var(--x2-tap); border-radius: 13px; font-size: 1.15rem; color: var(--x2-ink); background: var(--x2-card); box-shadow: inset 0 0 0 1px var(--x2-rule-2), var(--x2-shadow-card); }
.x2-map-tool:active{ background: var(--x2-paper-2); transform: translateY(1px); }
.x2-map-tool[aria-pressed="true"]{ background: var(--x2-ink); color: var(--x2-paper); }

.x2-map-wait{ position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: var(--x2-ink-2); background: var(--x2-paper-2); }
.x2-map-wait p{ max-width: 42ch; }

/* Fiche du pays, ou liste des pays quand aucun n'est choisi */
.x2-map-panel{ min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: 18px; background: var(--x2-card); box-shadow: inset 0 0 0 1px var(--x2-rule), var(--x2-shadow-card); }
.x2-map-panel[data-kind="list"]{ overflow: hidden; }
.x2-map-panel > *{ flex: none; min-width: 0; }

.x2-map-sum{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.x2-map-sum > div{ display: grid; justify-items: center; gap: 1px; padding: 8px 2px 7px; border-radius: 11px; background: var(--x2-paper); }
.x2-map-sum b{ font-size: 1.2rem; font-weight: 600; line-height: 1.1; color: var(--x2-hue-deep); }
.x2-map-sum small{ font-size: .75rem; color: var(--x2-ink-3); }
.x2-map-search{ margin: 0; }
.x2-map-list-title{ margin-top: 2px; }
.x2-map-panel .x2-map-list{ flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; margin: 0 -6px -6px; padding: 0 0 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.x2-map-list .x2-flag{ width: 28px; height: 20px; border-radius: 4px; font-size: 8px; }
.x2-map-who{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.x2-map-list .x2-rel-val{ min-width: 0; font-size: .84rem; white-space: nowrap; }

.x2-map-card-head{ display: flex; align-items: center; gap: 12px; }
.x2-map-card-head > div{ min-width: 0; }
.x2-map-flag{ width: 54px; height: 40px; border-radius: 7px; font-size: 13px; box-shadow: 0 0 0 1px rgba(23,32,48,.16), 0 8px 16px -10px rgba(23,32,48,.6); }
.x2-map-card-head h2{ font-family: var(--x2-font-display); font-weight: 600; font-size: 1.36rem; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: break-word; }
.x2-map-card-head p{ margin-top: 2px; font-size: .84rem; color: var(--x2-ink-2); }
.x2-map-card-head .x2-close{ flex: none; align-self: flex-start; margin: -6px -6px 0 auto; }
.x2-map-tags{ display: flex; flex-wrap: wrap; gap: 5px; }
.x2-map-tags span{ padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; color: var(--x2-ink-2); background: var(--x2-paper-2); }
.x2-map-tags .is-me{ color: #fff; background: var(--x2-hue); }

.x2-map-rel{ display: grid; gap: 6px; padding: 10px 12px 9px; border-radius: 12px; background: var(--x2-paper); }
.x2-map-rel p{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.x2-map-rel p span{ font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--x2-ink-3); }
.x2-map-rel p b{ font-size: 1.45rem; font-weight: 600; line-height: 1; color: var(--x2-hue-deep); }
.x2-map-rel p b small{ font-size: .8rem; font-weight: 500; color: var(--x2-ink-3); }
.x2-map-rel > small{ font-size: .76rem; line-height: 1.3; color: var(--x2-ink-3); }

.x2-map-facts{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.x2-map-facts > div{ min-width: 0; padding: 8px 11px; border-radius: 11px; background: var(--x2-paper); }
.x2-map-facts dt{ font-size: .75rem; color: var(--x2-ink-3); }
.x2-map-facts dd{ font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x2-map-facts dd small{ display: block; font-size: .75rem; font-weight: 400; color: var(--x2-ink-3); overflow: hidden; text-overflow: ellipsis; }

.x2-map-acts{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.x2-map-act{ display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 58px; padding: 7px 9px; border-radius: 13px; text-align: left; background: var(--x2-card); box-shadow: inset 0 0 0 1.5px var(--x2-rule-2); }
.x2-map-act:last-child:nth-child(odd){ grid-column: 1 / -1; }
.x2-map-act:active:not(:disabled){ background: var(--x2-paper-2); transform: translateY(1px); }
.x2-map-act-ico{ flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 1.05rem; background: var(--x2-hue-soft); color: var(--x2-hue-deep); }
.x2-map-act-txt{ display: grid; min-width: 0; line-height: 1.2; }
.x2-map-act-txt b{ font-size: .93rem; font-weight: 600; }
.x2-map-act-txt small{ font-size: .75rem; color: var(--x2-ink-3); }
.x2-map-act.is-danger .x2-map-act-ico{ background: var(--x2-dep-soft); color: var(--x2-dep-deep); }
.x2-map-act:disabled{ background: var(--x2-paper); box-shadow: inset 0 0 0 1.5px var(--x2-rule); }
.x2-map-act:disabled .x2-map-act-ico{ background: var(--x2-paper-2); color: var(--x2-ink-3); }
.x2-map-act:disabled b{ color: var(--x2-ink-3); }
/* deja fait (ambassade ouverte, pacte en cours) : inactif, mais pas « impossible » */
.x2-map-act.is-done{ background: var(--x2-card); }
.x2-map-act.is-done .x2-map-act-ico{ background: var(--x2-rev-soft); color: var(--x2-rev-deep); }
.x2-map-act.is-done b{ color: var(--x2-ink); }

/* Fenetre « Vendre a un pays » : la liste des produits reprend les lignes du choix d'un pays */
.x2-map-goods .x2-row-ico{ display: grid; background: var(--x2-paper-2); color: var(--x2-ink-2); }
.x2-map-goods .x2-trade-who small{ margin-left: 0; }

/* Tablettes etroites (1024 px) */
@media (max-width: 1100px){
  .x2-map-body{ grid-template-columns: minmax(0, 1fr) 304px; gap: 12px; padding: 0 14px 14px; }
  .x2-map-panel{ padding: 12px; }
  .x2-map-head .x2-lead{ display: none; }
}
/* Faible hauteur : la consigne passe sur la ligne du titre (regle commune de la feuille) */
@media (max-height: 780px) and (min-width: 900px){
  .x2-map-legend{ padding: 8px 10px 7px; }
  .x2-map-panel{ gap: 8px; padding: 12px; }
  .x2-map-flag{ width: 46px; height: 34px; }
  .x2-map-rel{ gap: 4px; padding: 8px 12px 7px; }
  .x2-map-facts > div{ padding: 6px 10px; }
  .x2-map-act{ min-height: 50px; padding: 5px 8px; }
}
/* Portrait : la carte en haut, la fiche dessous */
@media (max-width: 899px){
  .x2-map-head{ flex-wrap: wrap; gap: 10px; }
  .x2-map-body{ grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.15fr) minmax(0, .85fr); padding: 0 12px 12px; }
  .x2-map-acts{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x2-map-act:last-child:nth-child(odd){ grid-column: auto; }
  .x2-map-facts{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 699px){
  .x2-map-head .x2-lead{ display: none; }
  .x2-map-acts{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x2-map-facts{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x2-map-legend{ display: none; }
  .x2-map-modes .x2-seg{ padding: 0 12px 0 10px; }
}
@media (prefers-reduced-motion: reduce){ .x2-map-tool:active, .x2-map-act:active:not(:disabled){ transform: none; } }
