:root {
  --parchment: #f1e4c3;
  --parchment-dark: #d9c59a;
  --ink: #2b1d0e;
  --wood: #5a3a1c;
  --gold: #c9a227;
  --danger: #a3261f;
  --good: #2f6b2a;
}

* { box-sizing: border-box; }

/* Les barres de défilement (menu, règles, listes) aux couleurs du jeu : une poignée de bois sombre cerclée d'or, dans
   une gouttière de parchemin. Chrome, Edge et Safari lisent ::-webkit-scrollbar ; Firefox, scrollbar-color. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track {
  background: var(--parchment-dark);
  border-radius: 6px;
  box-shadow: inset 0 0 3px rgba(43, 29, 14, 0.45);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #7a5230, var(--wood) 45%, #3e2611);
  border: 2px solid var(--gold);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, #8d6038, #6a4522 45%, #4a2e15); }
::-webkit-scrollbar-thumb:active { border-color: #e3bf4a; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--wood) var(--parchment-dark); }
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #345c82;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hidden { display: none !important; }
.factionInfo { font-size: 13px; text-align: left; margin: 2px 0 6px; opacity: 0.85; }

.panel {
  position: fixed;
  background: var(--parchment);
  border: 3px solid var(--wood);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  padding: 6px 12px;
  font-size: 14px;
}

#topbar {
  top: 8px;
  /* (centrée dans la place laissée à gauche du classement : 280 px de large + ses marges) */
  left: calc((100% - 296px) / 2);
  transform: translateX(-50%);
  width: max-content; /* (sans ça, la barre se replie sur 2 lignes dès qu'elle dépasse la moitié de l'écran) */
  display: flex;
  gap: 16px;
  align-items: center;
  white-space: nowrap;
}

#side {
  top: 8px;
  right: 8px;
  width: 280px;
}
#side h3 {
  margin: 0 0 4px;
  font-family: Cinzel, Georgia, serif;
  text-align: center;
}
/* (la flèche du titre « Royaumes » : un clic cache ou montre le classement ; un petit triangle dessiné, vers le haut quand
   le classement est ouvert, vers le bas quand il est caché) */
#side h3 { position: relative; cursor: pointer; user-select: none; }
#lbFold { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 24px; height: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center; background: transparent; border: none; box-shadow: none; cursor: pointer; }
#lbFold::after { content: ''; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 8px solid var(--wood); transition: transform 0.15s; }
#side.folded #lbFold::after { transform: rotate(180deg); }
#side h3:hover #lbFold::after { border-bottom-color: var(--ink); }
#side.folded { width: auto; min-width: 150px; }
#side.folded h3 { margin: 0; padding-right: 26px; }
#side.folded #lb { display: none; }
#lb {
  margin: 0;
  padding-left: 22px;
}
#lb li { margin: 2px 0; white-space: nowrap; }
#lb li.me { font-weight: bold; }
#lb li.ally .nm { color: var(--good); font-weight: bold; }
/* Royaume qui nous attaque : son nom clignote en rouge (la classe « on » est ajoutée une fois sur deux) */
#lb li.attacker { cursor: pointer; }
#lb li.attacker .nm { color: var(--danger); font-weight: bold; }
#lb li.attacker.on .nm { color: #fff; background: var(--danger); border-radius: 3px; }
#lb .allies { display: inline-block; width: 30px; }
#lb .allies i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border: 1px solid var(--ink);
}

#lb .pct { display: inline-block; width: 42px; text-align: right; }
#lb .faithB { position: relative; display: inline-block; width: 16px; text-align: center; }
/* (l'écart de Croyance, en petit et en haut, juste à gauche de la bible : sur la place des carrés d'alliés, presque
   toujours vide, pour ne pas élargir la ligne) */
#lb .faithB sup { position: absolute; right: 100%; top: -4px; font-size: 10px; font-weight: bold; white-space: nowrap; }
#lb .faithB.good { color: #2f8a2a; }
#lb .faithB.bad { color: #b8322a; }
/* Un pacte : ses membres regroupés dans un cadre, avec la part des terres du pacte entier */
#lb li.pactGroup {
  border: 2px solid var(--wood);
  border-radius: 6px;
  padding: 1px 4px 2px;
  margin: 4px 0 4px -4px;
  background: rgba(120, 90, 40, 0.08);
}
#lb li.pactGroup.mine { border-color: var(--good); }
#lb .pactHead { display: flex; justify-content: space-between; font-size: 12px; font-weight: bold; font-style: italic; }
#lb .pactHead .pct { margin-right: 2px; }
#lb .pactHead span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#lb li.pactGroup ul { list-style: none; margin: 0; padding: 0; }
#lb li.pactGroup .allies { visibility: hidden; } /* (les alliés sont déjà dans le cadre) */
#lb button { padding: 0 4px; margin-left: 4px; font-size: 13px; line-height: 18px; }
#lb li > * { vertical-align: middle; }
.lbb { height: 26px; vertical-align: middle; margin-right: 4px; }
.msg .bn, .attack .bn { height: 26px; vertical-align: middle; margin-right: 4px; }
#kBanner { height: 31px; vertical-align: middle; }
#kName { text-shadow: 0 0 2px #000, 0 0 1px #000; } /* lisible même avec une bannière claire */
.pickTitle { text-align: left; margin: 10px 0 4px; }
#bannerBtn { display: flex; align-items: center; gap: 10px; margin: 4px auto; padding: 4px 12px; background: var(--parchment-dark); }
#bannerBtn img { height: 148px; display: block; }
#bannerPick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 4px;
  max-height: 380px; overflow-y: auto; border: 2px solid var(--wood); border-radius: 6px; padding: 6px; }
#bannerPick.hidden { display: none; }
#bannerPick button { padding: 2px 2px 4px; background: transparent; border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 3px; }
#bannerPick .bname { max-width: 150px; font-size: 13px; line-height: 1.15; text-align: center; color: var(--ink); }
#bannerPick .bdone { color: #2f8a2a; font-weight: bold; } /* (✔ vert : campagne ou défis déjà réussis en solo) */
#bannerPick .bkind { font-style: normal; font-size: 0.85em; opacity: 0.75; } /* (📜 « (Campagne) » ou « (Défis) », à côté du nom) */
#bannerPick button:hover { background: var(--parchment-dark); }
#bannerPick button.active { border-color: var(--wood); background: var(--gold); }
#bannerPick img { height: 148px; display: block; }
/* la liste des cartes : la vraie liste reste là (cachée), un bouton et un panneau la montrent avec des icônes */
.ghost { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#mapBtn { display: flex; align-items: center; gap: 6px; font-size: 15px; background: #fffaf0; padding: 4px 10px; }
#mapBtn .ico { width: 1.4em; height: 1.4em; }
#mapBtn:disabled { opacity: 0.55; cursor: default; } /* (🌐 salon : seul l'hôte choisit la carte) */
#mapPick { margin: -4px 0 8px; border: 2px solid var(--wood); border-radius: 6px; padding: 6px 8px; text-align: left;
  background: #fffaf0; max-height: 520px; overflow-y: auto; }
#mapPick.hidden { display: none; }
#mapPick .grp { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; font-family: Cinzel, Georgia, serif;
  font-weight: bold; color: var(--wood); }
/* (chaque sorte de carte : une section qui se déplie, avec une petite flèche et le nombre de cartes) */
#mapPick details.grpBox { border-bottom: 1px solid rgba(90, 60, 30, 0.25); }
#mapPick details.grpBox > summary { list-style: none; cursor: pointer; padding: 4px 2px; margin: 0; border-radius: 4px; }
#mapPick details.grpBox > summary::-webkit-details-marker { display: none; }
#mapPick details.grpBox > summary:hover { background: var(--parchment-dark); }
#mapPick details.grpBox > summary::after { content: ''; margin-left: auto; width: 0; height: 0; border-left: 5px solid transparent;
  border-right: 5px solid transparent; border-top: 7px solid var(--wood); transition: transform 0.15s; }
#mapPick details.grpBox[open] > summary::after { transform: rotate(180deg); }
#mapPick .grp .cnt { font-family: Georgia, serif; font-size: 12px; font-weight: normal; color: var(--ink); opacity: 0.7; }
#mapPick details.grpBox .opts { padding-bottom: 8px; }
#mapPick .grp .ico { width: 1.5em; height: 1.5em; }
#mapPick .opts { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding-left: 28px; }
/* (🌿 les cartes arène : deux colonnes côte à côte, les classiques et les cartes de gloire) */
#mapPick .opts.cols2 { flex-direction: row; align-items: flex-start; gap: 10px; }
#mapPick .opts.cols2 .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#mapPick .opts.cols2 .colTitle { font-weight: bold; font-size: 0.85em; opacity: 0.75; padding: 0 2px 2px; }
@media (max-width: 520px) { #mapPick .opts.cols2 { flex-direction: column; align-items: stretch; } } /* (téléphone : les deux colonnes l'une sous l'autre) */
#mapPick .opts button { background: var(--parchment-dark); display: flex; justify-content: space-between; gap: 12px;
  text-align: left; width: 100%; max-width: 340px; }
#mapPick .opts button .meta { opacity: 0.7; font-size: 0.9em; white-space: nowrap; }
#mapPick .opts button.active { background: var(--gold); box-shadow: 0 0 0 2px var(--ink) inset; }
/* 🗺️ l'aperçu de la carte, en haut du choix des cartes (il reste en haut quand on fait défiler la liste) */
#mapPick .mapPreview { position: sticky; top: -6px; z-index: 1; display: flex; gap: 10px; align-items: center;
  background: #fffaf0; padding: 4px 0 6px; border-bottom: 1px solid var(--wood); margin-bottom: 4px; }
#mapPick .mapPreview .pv { flex: none; width: 300px; height: 190px; display: flex; align-items: center; justify-content: center;
  background: #2f4c66; border: 2px solid var(--wood); border-radius: 4px; overflow: hidden; }
#mapPick .mapPreview .pv img, #mapPick .mapPreview .pv canvas { max-width: 100%; max-height: 100%; display: block; }
#mapPick .mapPreview .pvText { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.3; }
#mapPick .mapPreview .pvName { font-family: Cinzel, Georgia, serif; color: var(--wood); }
@media (max-width: 560px) {
  #mapPick .mapPreview { flex-direction: column; align-items: stretch; }
  #mapPick .mapPreview .pv { width: 100%; }
}
.nm {
  display: inline-block;
  width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bottomwrap {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#bottomwrap .panel { position: static; }
/* (le cadre du bas et la rangée des assauts sont invisibles : leurs coins vides laissent passer les clics jusqu'à la carte ;
   seules leurs barres les arrêtent) */
#bottomwrap { pointer-events: none; }
#bottomwrap > * { pointer-events: auto; }
#bottomwrap > #attacks { pointer-events: none; }
#attacks > * { pointer-events: auto; }

/* 🎵 La musique d'ambiance, en bas à droite : le bouton (couper / remettre) et la petite barre de volume */
#musicBox { bottom: 8px; right: 8px; z-index: 50; display: flex; align-items: center; gap: 6px; padding: 4px 8px; }
#musicBox button { padding: 2px 6px; }
#musicVol { width: 80px; accent-color: #7a4a1a; cursor: pointer; }

/* Jauge des soldats */
#troopGauge {
  width: min(420px, calc(100vw - 32px));
  padding: 4px 10px 6px;
  text-align: center;
  font-size: 13px;
}
#troopRate { margin-bottom: 3px; }
#troopGauge .gauge {
  position: relative;
  height: 20px;
  background: #d8c8a2;
  border: 2px solid var(--wood);
  border-radius: 10px;
  overflow: hidden;
}
#troopFill {
  height: 100%;
  width: 0;
  transition: width 0.2s linear, background 0.3s;
}
#troopText {
  position: absolute;
  inset: 0;
  line-height: 16px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 0 2px #000;
}

#attacks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.attack {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 10px;
}
.attack button { padding: 2px 8px; font-size: 13px; }
.attack button:hover { background: #e9b5a8; }
.attack button.armed { background: var(--gold); font-weight: bold; } /* (⚔️ « Défendre » visé d'un 1er clic : un 2e clic envoie) */
.attack.incoming { border-color: var(--danger); color: var(--danger); padding-right: 10px; }
/* petite croix dans le coin d'une barre : retraite */
#bottomwrap .attack.panel, .attack { position: relative; padding-right: 22px; }
.attack button.x {
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  font-size: 15px; line-height: 16px; font-weight: bold;
  color: #fff; background: var(--danger); border: 2px solid var(--wood);
}
.attack button.x:hover { background: #a3261f; }
.attack .goto { cursor: pointer; }

#bottombar {
  display: flex;
  gap: 16px;
  align-items: center;
}
.slider { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.slider input { width: 130px; accent-color: var(--wood); }
#ratioVal { min-width: 90px; }

#builds { display: flex; gap: 6px; }
button {
  font-family: inherit;
  cursor: pointer;
  background: var(--parchment-dark);
  border: 2px solid var(--wood);
  border-radius: 6px;
  color: var(--ink);
  padding: 4px 8px;
}
button:hover { background: #e8d6a8; }
.build {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  font-size: 12px;
}
.build .key {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  font-weight: bold;
  color: var(--wood);
}
.build .icon { font-size: 20px; }
/* petit compteur en haut à droite (châteaux construits / maximum) */
.build .count {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: bold;
  color: var(--wood);
}
.build .count.full { color: var(--danger); }
.build.active { background: var(--gold); box-shadow: 0 0 0 2px var(--ink) inset; }
.build.poor .cost { color: var(--danger); }
/* bouton « Croisade » (avec une cathédrale) : un peu doré pour le distinguer des constructions */
.build.crusade { border-color: var(--gold); }
.build.crusade:disabled { opacity: 0.7; cursor: default; }

#hint {
  bottom: 8px;
  left: 8px;
  max-width: 340px;
  font-size: 13px;
  pointer-events: none;
}
#hint:empty { display: none; }

/* 👑 Les objectifs d'un scénario, en haut à gauche (voir UI.refreshObjectives) : un objectif rempli est barré, grisé,
   avec un ✔ ; un clic sur le cadre le replie (il ne garde que son titre) */
#objectives { top: 60px; left: 8px; width: 330px; font-size: 12px; padding: 6px 10px; cursor: pointer; }
#objectives .t { display: flex; justify-content: space-between; gap: 8px; font-family: Cinzel, Georgia, serif; font-weight: bold; }
#objectives ul { list-style: none; margin: 4px 0 0; padding: 0; }
#objectives li { position: relative; margin: 3px 0; padding-left: 16px; }
#objectives li.go:hover { text-decoration: underline dotted; color: #ffe08a; } /* (🎯 un objectif qui a un lieu : clic → la carte y va) */
#objectives li::before { content: '•'; position: absolute; left: 4px; }
#objectives li.done { text-decoration: line-through; opacity: 0.55; }
/* (la coche, la croix et l'étoile : de petits dessins, jamais d'emoji) */
#objectives li.done::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.8l5 5L20.5 6' fill='none' stroke='%232f6b2a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); left: 0; top: 1px; }
/* (🛡️ un objectif de la victoire tenu : un petit bouclier vert, pas barré : il peut encore se perdre) */
#objectives li.held { color: #1f5a1a; }
#objectives li.held::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l8 3v6c0 5-3.4 8.6-8 10c-4.6-1.4-8-5-8-10v-6z' fill='%233f8a33' stroke='%231c3a14' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M8 12.2l2.8 2.8L16.4 9' fill='none' stroke='%23eaf6d8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); left: 0; top: 1px; }
#objectives li .heldT { font-style: italic; opacity: 0.75; }
#objectives li.gone { text-decoration: line-through; color: var(--danger); opacity: 0.75; } /* (perdu pour de bon) */
#objectives li.gone::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 5.5l13 13M18.5 5.5l-13 13' fill='none' stroke='%23a3261f' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E"); left: 0; top: 1px; }
#objectives .defisT { margin-top: 6px; padding-top: 4px; border-top: 1px solid rgba(255, 215, 120, 0.3); font-size: 11px; } /* (⭐ les défis, sous les objectifs) */
#objectives ul.defis li::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6L14.4 9.3 21.5 9.5 15.9 13.9 17.9 20.7 12 16.7 6.1 20.7 8.1 13.9 2.5 9.5 9.6 9.3z' fill='%23efc23e' stroke='%236b4a12' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E"); left: 0; top: 1px; }
#objectives ul.defis li.done::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.8l5 5L20.5 6' fill='none' stroke='%232f6b2a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
#objectives ul.defis li.gone::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 5.5l13 13M18.5 5.5l-13 13' fill='none' stroke='%23a3261f' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* fenêtre étroite : sous la barre du bas, au centre (voir UI.placeHint) */
#hint.under { max-width: min(760px, calc(100vw - 16px)); text-align: center; padding: 3px 10px; }

#log {
  position: fixed;
  top: 60px;
  left: 8px;
  width: 340px;
  max-height: calc(100vh - 140px);
  overflow: hidden;
  pointer-events: none;
}
.msg {
  background: rgba(241, 228, 195, 0.95);
  border-left: 5px solid var(--wood);
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: opacity 1s;
}
.msg.warn { border-left-color: var(--danger); }
.msg.good { border-left-color: var(--good); }
.msg.fade { opacity: 0; }
.msg.request {
  pointer-events: auto;
  border-left-color: var(--gold);
  font-size: 14px;
}
.msg.request .choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg.request button:first-child { background: #b9d7a4; }
.msg.request button:last-child { background: #e9b5a8; }
.msg.betray { border-left-color: var(--danger); }
.msg.betray button:first-child { background: #e9b5a8; }
.msg.betray button:last-child { background: var(--parchment-dark); }
/* 🌿 La jauge de gloire, en haut au milieu (sous la barre du haut : voir UI.refreshGlory) */
#gloryBar { left: 50%; transform: translateX(-50%); width: min(360px, 46vw); padding: 3px 8px 5px; text-align: center; font-size: 12px; z-index: 6; }
#gloryTitle { font-weight: bold; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gloryGauge { display: flex; height: 14px; background: #d8c8a2; border: 2px solid var(--wood); border-radius: 8px; overflow: hidden; }
#gloryGauge i { display: block; height: 100%; border-right: 1px solid rgba(40, 25, 10, 0.55); transition: width 0.4s linear; }
#gloryGauge i.me { box-shadow: inset 0 0 0 2px #ffe08a; }
#gloryTip { position: fixed; z-index: 30; padding: 4px 9px; font-size: 12px; white-space: nowrap; pointer-events: none; }
#gloryTip img.bn { height: 16px; vertical-align: -3px; }
#gloryTip .sub { opacity: 0.85; }
/* (🤝 un pacte : ses royaumes côte à côte, dans un cadre doré) */
#gloryGauge b.pact { display: flex; height: 100%; box-sizing: border-box; border: 2px solid #f0c040; border-radius: 4px; overflow: hidden; flex: none; transition: width 0.4s linear; }
#gloryGauge b.pact i { box-shadow: none; }
#gloryGauge b.pact i.me { box-shadow: inset 0 -3px 0 #ffe08a; }
.msg.upgrade img { display: block; width: 120px; margin: 4px auto; }
/* avantages d'un bâtiment : un par ligne, avec un tiret */
.perks { list-style: none; margin: 4px 0 0; padding: 0; font-weight: bold; }
.perks li::before { content: '– '; }
.msg.upgrade .need { margin-top: 4px; color: var(--danger); font-size: 13px; }
.msg.request.upgrade button[data-del] { background: #e9b5a8; }
.msg.request.upgrade button[data-no] { background: var(--parchment-dark); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.card {
  background: var(--parchment);
  border: 4px double var(--wood);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.card h1 {
  font-family: Cinzel, Georgia, serif;
  margin: 0 0 6px;
  font-size: 28px;
}
.card .sub { margin-top: 0; font-style: italic; }
.card label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  gap: 12px;
  text-align: left;
}
.card input, .card select {
  font-family: inherit;
  font-size: 15px;
  padding: 4px 6px;
  border: 2px solid var(--wood);
  border-radius: 4px;
  background: #fffaf0;
}
.card select { max-width: 62%; }
/* (tous les choix du menu ont la même largeur, celle du nom du royaume ; un nom de carte trop long finit par « … ») */
/* (le menu de départ : un tiers plus large que les autres cartes, pour l'aérer ; sur un petit écran, il se resserre
   tout seul : width 100 % et des marges plus fines, voir la fin du fichier) */
#menu > .card { max-width: 860px; padding: 26px 44px; }
#menu > .card > label { margin: 12px 0; }
.card > label > input, .card > label > select:not(.ghost), .card > label > #mapBtn { width: 220px; max-width: 58%; flex: none; }
#menu > .card > label > input, #menu > .card > label > select:not(.ghost), #menu > .card > label > #mapBtn { width: 280px; }
.card > label > #mapBtn { justify-content: space-between; }
#mapBtn > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
/* 🌐 Jouer en ligne (sous « Commencer la conquête ») : la partie publique, les salons privés */
.netBox { margin: 14px 0 4px; padding: 8px 10px; border: 2px dashed var(--parchment-dark); border-radius: 8px; }
.netTitle { font-family: Cinzel, Georgia, serif; font-weight: bold; margin-bottom: 6px; }
.netBtns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.netBtns button, #netRoom button { font-family: inherit; font-size: 14px; padding: 5px 10px; cursor: pointer;
  border: 2px solid var(--wood); border-radius: 5px; background: #fffaf0; color: var(--ink); }
.netBtns button:hover, #netRoom button:hover { background: var(--parchment-dark); }
.netJoin { display: inline-flex; gap: 4px; }
.card .netJoin input { width: 82px; text-transform: uppercase; text-align: center; letter-spacing: 2px; }
#netRoom { text-align: left; }
#netRoom small { display: block; opacity: 0.8; margin: 4px 0; }
#netRoom .choices { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
#netRoom #netGo { background: var(--good); color: #fff; font-weight: bold; }
.netCode { font-size: 18px; letter-spacing: 3px; }
.netPlayers { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.netPlayers li { display: flex; align-items: center; gap: 4px; }
.netPlayers img { width: 20px; height: 20px; object-fit: contain; }
#netStatus { font-size: 13px; margin-top: 4px; min-height: 0; }
#netStatus.warn { color: var(--danger); }
/* lien vers l'éditeur de cartes, sous le choix de la carte */
/* le bouton de l'éditeur de cartes : en bas à droite du menu, à la hauteur du titre des règles (en face) */
/* (sur la ligne du titre des règles, même quand elles sont dépliées) */
.menuFoot { position: relative; }
#editorBtn { position: absolute; right: 0; top: 7px; padding: 4px 12px; font-size: 14px; z-index: 1; }
.big {
  font-family: Cinzel, Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  padding: 10px 20px;
  margin-top: 10px;
  background: var(--gold);
}
.rules {
  text-align: left;
  font-size: 13px;
  margin: 6px 0 0;
}
/* Règles repliées : on clique sur le titre pour les dérouler */
.rulesBox { margin-top: 14px; text-align: left; border-top: 1px solid var(--parchment-dark); padding-top: 8px; }
.rulesBox > summary { padding-right: 190px; }
.rulesBox > summary { cursor: pointer; font-weight: bold; font-family: Cinzel, Georgia, serif; }
.rulesBox summary small { font-weight: normal; font-family: Georgia, serif; opacity: 0.7; }
.rules li { margin: 4px 0; }
/* Une catégorie de règles : un titre qu'on clique pour la déplier (une liste à la fois, plus facile à lire) */
.ruleCat { border: 1px solid var(--parchment-dark); border-radius: 6px; margin: 5px 0; background: rgba(255, 248, 225, 0.35); }
.ruleCat > summary { cursor: pointer; padding: 5px 10px; font-weight: bold; font-family: Cinzel, Georgia, serif; font-size: 14px; }
.ruleCat > summary:hover { background: rgba(212, 175, 55, 0.18); }
.ruleCat[open] > summary { border-bottom: 1px solid var(--parchment-dark); }
.ruleCat > ul { padding: 2px 12px 6px 28px; margin: 0; }

/* (écran moyen : la barre du haut, entre le bord gauche et le classement, passe sur 2 lignes s'il le faut) */
@media (min-width: 761px) and (max-width: 1180px) {
  #topbar { left: 8px; right: 304px; width: auto; transform: none; flex-wrap: wrap; justify-content: center; white-space: normal; row-gap: 4px; gap: 10px; }
}

@media (max-width: 760px) {
  #bannerPick img, #bannerBtn img { height: 110px; }
  #bannerPick .bname { max-width: 115px; font-size: 12px; }
  .panel { font-size: 12px; padding: 4px 8px; }
  /* (width: auto : sur 2 lignes s'il le faut, pour que les boutons Pause, vitesse, Menu et Règles restent à l'écran) */
  #topbar { gap: 8px; left: 8px; right: 8px; width: auto; transform: none; flex-wrap: wrap; justify-content: center; white-space: normal; row-gap: 4px; }
  #side { top: auto; bottom: 120px; width: 170px; font-size: 11px; }
  .nm { width: 80px; }
  #bottomwrap { left: 8px; right: 8px; transform: none; }
  #bottombar { flex-wrap: wrap; justify-content: center; }
  /* (boutons plus étroits : les 5 constructions et la croisade tiennent sur un téléphone) */
  #builds { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .build { min-width: 56px; padding: 4px; }
  #hint { display: none; }
  /* (sous la barre du haut, qui tient sur 2 lignes : les objectifs, la musique, puis les messages ; leur hauteur
     exacte est calculée par UI.placeTopPanels) */
  #log { width: calc(100% - 16px); }
  /* (🎵 sur un téléphone, la barre du bas prend toute la largeur : la musique passe en haut à droite, sous la barre du haut) */
  /* (en jeu : en haut à droite, sous la barre du haut ; dans le menu : en haut à gauche, à côté du titre) */
  #musicBox { bottom: auto; top: 6px; right: auto; left: 6px; }
  #hud:not(.hidden) ~ #musicBox { right: 8px; left: auto; }
  #musicBox { padding: 2px 6px; }
  #musicVol { width: 60px; }
}

/* Menu d'actions (clic droit sur la carte) */
.actionMenu {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  min-width: 200px;
  max-width: 250px;
}
.actionMenu button { text-align: left; }
.actionMenu.quickMenu { flex-direction: row; min-width: 0; padding: 4px; }
.quickMenu button { width: 34px; height: 34px; padding: 0; font-size: 17px; text-align: center; font-weight: bold; }
.quickMenu button.danger { color: #c0392b; }
.quickMenu button.up { color: var(--wood); }
.quickMenu button svg { display: block; margin: auto; width: 20px; height: 20px; }
/* icônes dessinées dans les menus et les boutons (voir ICONS dans main.js) */
.ico { width: 1.2em; height: 1.2em; vertical-align: -0.25em; }
.icotext { white-space: normal; }
button:disabled .ico { opacity: 0.6; }
.actionMenu button:disabled { opacity: 0.5; cursor: not-allowed; }
.actionMenu small { color: var(--danger); font-size: 11px; margin: -2px 4px 2px; }

/* Barre de résumé d'un royaume survolé (fixe, juste sous la barre du haut) */
.kTip {
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 13px;
  padding: 3px 10px;
  z-index: 30;
}
.kTip .bn { height: 24px; vertical-align: middle; margin-right: 4px; }
.kTip span { white-space: nowrap; }

/* Les règles, en jeu (bouton « Règles ») : une grande fiche qui défile */
.rulesCard { max-width: 860px; max-height: 88vh; overflow-y: auto; text-align: left; }
.rulesCard h1 { text-align: center; }
.rulesCard #rulesClose { display: block; margin: 14px auto 0; }
/* (📜 les deux onglets des règles dans un scénario : celles du scénario, et les règles classiques) */
#rulesTabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 12px; }
#rulesTabs.hidden { display: none; }
#rulesTabs button { background: var(--parchment-dark); }
#rulesTabs button.active { background: var(--gold); box-shadow: 0 0 0 2px var(--ink) inset; font-weight: bold; }
#rulesScen.hidden, #rulesBody.hidden { display: none; }
#rulesScen h2 { font-family: Cinzel, Georgia, serif; font-size: 1.1em; margin: 4px 0 6px; text-align: center; }
#rulesScen p { margin: 0 0 10px; }
#rulesScen ul { list-style: none; margin: 0 0 12px; padding: 0; line-height: 1.45; }
#rulesScen li { margin: 0 0 8px; padding-left: 10px; border-left: 2px solid rgba(110, 70, 20, 0.35); }
#rulesScen li.sep { border: 0; padding: 6px 0 0; margin-top: 12px; border-top: 1px solid rgba(110, 70, 20, 0.35); font-family: Cinzel, Georgia, serif;
  font-weight: bold; text-align: center; }
.rules ul { padding-left: 18px; margin: 4px 0; }
.rules ul li { margin: 6px 0; }

/* 🌍 LANGUE : seul le passage de la langue choisie s'affiche (voir js/lang.js) */
.lang-en .fr, .lang-fr .en { display: none !important; }
/* le choix de la langue, en haut à droite du menu de départ */
.langRow { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin: -14px -16px -6px 0; }
.card .langRow select { font-size: 13px; padding: 2px 4px; max-width: none; }

/* 📽️ Résumé de la partie : la carte rejouée en accéléré, et les plus grands royaumes du moment */
.replayCard { max-width: 980px; }
.replayView { display: flex; gap: 12px; align-items: flex-start; }
#replayCanvas {
  flex: 1; min-width: 0; width: 100%; height: auto;
  image-rendering: pixelated;
  border: 2px solid var(--wood); border-radius: 6px;
}
#replayTop { list-style: none; margin: 0; padding: 0; width: 190px; text-align: left; font-size: 14px; }
#replayTop li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
#replayTop li.me { font-weight: bold; }
#replayTop i { width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0, 0, 0, 0.4); }
#replayTop span { margin-left: auto; }
.replayBar { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.replayBar input { flex: 1; }
.replayBar button { font-size: 18px; cursor: pointer; background: none; border: none; }
#replayTime { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .replayView { flex-direction: column; }
  #replayTop { width: 100%; }
}

/* 📜 Parchemin d'un grand événement : deux rouleaux de bois, une feuille qui se déroule, une écriture médiévale */
#parchment {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(20, 12, 4, 0.5);
}
#parchment.hidden { display: none; }
#parchment .scroll { width: min(600px, 100%); filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)); }
/* Les deux rouleaux : le parchemin enroulé (couleur du papier, en volume) autour d'une baguette de bois tourné, qui
   dépasse de chaque côté : un collier, un col, puis un pommeau bombé (dessiné en SVG, retourné pour le côté gauche).
   Le bois sort du rouleau par un bord arrondi, dans l'ombre que le rouleau projette dessus. */
#parchment .rod {
  position: relative; z-index: 2; height: 30px; margin: 0 -8px; border-radius: 10px / 15px;
  background:
    linear-gradient(90deg, rgba(90, 55, 20, 0.5), transparent 4%, transparent 96%, rgba(90, 55, 20, 0.5)),
    linear-gradient(#7d5a2c 0%, #c9a66b 14%, #efdcae 36%, #f9edcb 47%, #e6cd97 64%, #b48c55 85%, #634421 100%);
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 244, 210, 0.35),
    inset 2px 0 1px -1px rgba(70, 40, 12, 0.6), inset -2px 0 1px -1px rgba(70, 40, 12, 0.6); /* (la tranche du rouleau) */
}
#parchment .rod::before, #parchment .rod::after {
  content: ''; position: absolute; top: 50%; width: 48px; height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='34' viewBox='0 0 48 34'%3E%3Cdefs%3E%3ClinearGradient id='w' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%233a1e08'/%3E%3Cstop offset='.28' stop-color='%23b97a3e'/%3E%3Cstop offset='.42' stop-color='%23e9b87c'/%3E%3Cstop offset='.68' stop-color='%238a5222'/%3E%3Cstop offset='1' stop-color='%232e1606'/%3E%3C/linearGradient%3E%3CradialGradient id='k' cx='.4' cy='.33' r='.7'%3E%3Cstop offset='0' stop-color='%23f3c690'/%3E%3Cstop offset='.4' stop-color='%23b0702f'/%3E%3Cstop offset='.8' stop-color='%235a3010'/%3E%3Cstop offset='1' stop-color='%232e1606'/%3E%3C/radialGradient%3E%3ClinearGradient id='s'%3E%3Cstop offset='0' stop-color='%23140800' stop-opacity='.7'/%3E%3Cstop offset='1' stop-color='%23140800' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='%232a1404' stroke-width='.7'%3E%3Crect x='-1' y='11' width='10' height='12' rx='2.5' fill='url%28%23w%29'/%3E%3Crect x='8' y='5.5' width='6.5' height='23' rx='3' fill='url%28%23w%29'/%3E%3Crect x='14' y='12' width='5' height='10' rx='2' fill='url%28%23w%29'/%3E%3Cellipse cx='30.5' cy='17' rx='12' ry='13' fill='url%28%23k%29'/%3E%3Ccircle cx='44' cy='17' r='3' fill='url%28%23w%29'/%3E%3C/g%3E%3Crect x='-1' y='11.4' width='7' height='11.2' rx='2.5' fill='url%28%23s%29'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
#parchment .rod::after { right: -46px; transform: translateY(-50%); }
#parchment .rod::before { left: -46px; transform: translateY(-50%) scaleX(-1); }
#parchment .sheet {
  margin: -6px 0; padding: 22px 34px 18px; overflow-y: auto;
  max-height: calc(100vh - 110px);
  color: #3b2410; font-family: 'IM Fell English', Georgia, serif; font-size: 17px; line-height: 1.45; text-align: left;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 248, 225, 0.9), rgba(255, 248, 225, 0) 70%),
    linear-gradient(90deg, #c9a66b, #ecd9a8 8%, #f4e6bf 50%, #ecd9a8 92%, #c9a66b);
  box-shadow: inset 0 10px 14px -10px rgba(60, 30, 5, 0.6), inset 0 -10px 14px -10px rgba(60, 30, 5, 0.6);
  animation: unroll 0.9s ease-out;
}
/* (la feuille se déroule : elle part de rien, entre les deux rouleaux) */
@keyframes unroll { from { max-height: 0; padding-top: 0; padding-bottom: 0; } to { max-height: calc(100vh - 110px); } }
#parchment .pDate { text-align: center; font-style: italic; color: #6b4a22; font-size: 15px; letter-spacing: 1px; }
#parchment .pTitle {
  margin: 2px 0 10px; text-align: center; color: #7a1a10;
  font-family: 'Uncial Antiqua', Cinzel, Georgia, serif; font-size: 26px; font-weight: normal;
}
#parchment .pText { margin: 0 0 12px; }
/* (une lettrine gothique, comme dans les manuscrits) */
#parchment .pText::first-letter {
  float: left; margin: 4px 8px 0 0; color: #8b1a10;
  font-family: 'UnifrakturMaguntia', 'Uncial Antiqua', Georgia, serif; font-size: 3.1em; line-height: 0.8;
}
#parchment .pTodo { border-top: 1px solid rgba(110, 70, 30, 0.45); padding-top: 10px; margin-bottom: 14px; }
#parchment .pTodo b { font-family: 'Uncial Antiqua', Cinzel, Georgia, serif; font-weight: normal; color: #7a1a10; }
#parchment .pTodo:empty { display: none; }
/* (🎁 ce que l'événement rapporte ou coûte, et 📜 sous les choix, ce qui s'est vraiment passé) */
#parchment .pGain { background: rgba(70, 120, 40, 0.12); border-left: 3px solid #4a7a2a; padding: 6px 10px; margin-bottom: 12px; }
#parchment .pGain b, #parchment .pHist b { font-family: 'Uncial Antiqua', Cinzel, Georgia, serif; font-weight: normal; color: #2f5a1a; }
#parchment .pHist { border-top: 1px solid rgba(110, 70, 30, 0.45); padding-top: 10px; margin-top: 14px; font-style: italic; font-size: 0.93em; }
#parchment .pHist b { color: #7a1a10; font-style: normal; }
#parchment .pGain:empty, #parchment .pHist:empty { display: none; }
/* (📖 les mécaniques d'une campagne, au début : une liste « titre : explication ») */
#parchment .pRules ul { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14px; line-height: 1.4; text-align: left; }
#parchment .pRules li { margin: 0 0 7px; padding-left: 10px; border-left: 2px solid rgba(110, 70, 20, 0.35); }
#parchment .pRules b { font-family: 'Uncial Antiqua', Cinzel, Georgia, serif; font-weight: normal; color: #5a2a0a; }
#parchment .pRules:empty { display: none; }
#parchment .pRules li.sep { border: 0; padding: 6px 0 0; margin-top: 10px; border-top: 1px solid rgba(110, 70, 20, 0.35); font-family: Cinzel, Georgia, serif; font-weight: bold; color: #7a1f0a; text-align: center; }
#parchment .pChoices .sealBtn small { display: block; font-size: 11px; opacity: 0.85; margin-top: 2px; font-family: Georgia, serif; }
#parchment .pChoices .sealBtn.hist { box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), 0 0 0 2px #d9a520; }
/* (le bouton : un sceau de cire rouge) */
#parchment .sealBtn {
  display: block; margin: 0 auto; padding: 10px 26px; border: none; border-radius: 22px; cursor: pointer;
  font-family: 'Uncial Antiqua', Cinzel, Georgia, serif; font-size: 17px; color: #fbe9c8;
  background: radial-gradient(circle at 35% 35%, #c8402e, #8a1a10 70%, #5e0d07);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 200, 160, 0.15);
}
#parchment .sealBtn:hover { filter: brightness(1.12); }
/* (un parchemin à choix : un sceau par choix, l'un sous l'autre) */
#parchment .pChoices { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#parchment .pChoices:empty { display: none; }
#parchment .pChoices .sealBtn { font-size: 15px; max-width: 100%; }
@media (max-width: 640px) {
  #parchment { padding: 16px 46px; } /* (de la place sur les côtés pour les pommeaux des rouleaux) */
  #parchment .sheet { padding: 16px 18px 14px; font-size: 16px; }
  #parchment .pTitle { font-size: 22px; }
}

/* (le menu de départ sur un écran moyen ou petit : moins de marges, pour garder un maximum de place aux réglages) */
@media (max-width: 900px) { #menu > .card { padding: 22px 26px; } }
@media (max-width: 520px) { #menu > .card { padding: 16px 14px; } #menu > .card .langRow { margin-right: -8px; } }

/* 📜 Les actions de campagne : un bouton toujours visible à droite, et son panneau */
#campBtn { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 6; padding: 8px 10px; cursor: pointer;
  font-family: Cinzel, Georgia, serif; font-weight: bold; font-size: 13px; color: var(--ink, #2b1d0e); writing-mode: vertical-rl; text-orientation: mixed;
  border: 2px solid #b8862b; box-shadow: 0 0 0 2px rgba(255, 215, 120, 0.35), 0 3px 10px rgba(0, 0, 0, 0.35); }
#campBtn:hover, #campBtn.on { background: #fff3cf; }
#campBtn.ready::after { content: ''; position: absolute; top: -5px; left: -5px; width: 12px; height: 12px; border-radius: 50%; background: #3f8a33; border: 2px solid #eaf6d8; }
#campPanel { position: fixed; right: 52px; top: 50%; transform: translateY(-50%); z-index: 6; width: 360px; max-width: calc(100vw - 70px);
  max-height: 80vh; overflow-y: auto; padding: 10px 12px; font-size: 13px; }
#campPanel h3 { margin: 0 0 6px; font-family: Cinzel, Georgia, serif; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
#campPanel h3 button { border: 0; background: none; cursor: pointer; font-size: 16px; }
#campPanel .sec { border-top: 1px solid rgba(110, 70, 20, 0.3); padding: 7px 0 5px; }
#campPanel .sec b { font-family: Cinzel, Georgia, serif; }
#campPanel .sec p { margin: 3px 0 5px; line-height: 1.35; }
#campPanel .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#campPanel button.act { padding: 4px 8px; cursor: pointer; font-size: 12px; }
#campPanel button.act:disabled { opacity: 0.5; cursor: not-allowed; }
#campPanel .why { font-size: 11px; font-style: italic; opacity: 0.8; }
#campPanel select { max-width: 170px; font-size: 12px; }
@media (max-width: 760px) { #campBtn { top: auto; bottom: 150px; transform: none; } #campPanel { top: auto; bottom: 60px; transform: none; } }

/* 📋 La barre des effets en cours (sous la barre du haut, centrée comme elle) : une pastille par effet */
#effectsBar { top: 52px; left: calc((100% - 296px) / 2); transform: translateX(-50%); width: max-content; max-width: calc(100% - 330px); padding: 4px 8px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; font-size: 12px; }
#effectsBar .fx { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; cursor: help;
  border: 1px solid rgba(110, 70, 20, 0.35); background: rgba(255, 248, 225, 0.6); }
#effectsBar .fx b { font-family: Cinzel, Georgia, serif; }
#effectsBar .fx.good { border-color: #4a7a2a; background: rgba(120, 180, 80, 0.2); }
#effectsBar .fx.good .v { color: #1f5a1a; font-weight: bold; }
#effectsBar .fx.bad { border-color: #a3261f; background: rgba(200, 60, 40, 0.15); }
#effectsBar .fx.bad .v { color: #a3261f; font-weight: bold; }
#effectsBar .fx .t { opacity: 0.75; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { #effectsBar { left: 8px; right: 296px; transform: none; width: auto; max-width: none; } }
@media (max-width: 760px) { #effectsBar { right: 8px; } }

/* 📈 Les tableaux des niveaux des bâtiments, dans les règles */
.rules table.lvl { border-collapse: collapse; margin: 4px 0 6px; font-size: 12px; max-width: 100%; display: block; overflow-x: auto; }
.rules table.lvl th, .rules table.lvl td { border: 1px solid rgba(110, 70, 20, 0.3); padding: 2px 6px; text-align: center; white-space: nowrap; }
.rules table.lvl th { background: rgba(110, 70, 20, 0.12); font-family: Cinzel, Georgia, serif; }
.rules table.lvl td:first-child { text-align: left; font-weight: bold; }
