/*
 * Fiche de compagnie (shared/fiche-compagnie.js) : parchemin ancien peint (tools/skins/parchemin.py) entre deux
 * rouleaux, qui se déroule à l'ouverture. Couleurs : variables du thème ; écu d'une autre compagnie par
 * [data-ecu1] / [data-ecu2] (base.css). Aucun style en ligne (CSP).
 */
.fc-dialog { width: min(440px, calc(100vw - 32px)); max-height: none; padding: 0 16px; border: 0; background: none; overflow: visible; }
.fc-dialog::backdrop { background: color-mix(in srgb, var(--ws-bois) 70%, transparent); }
.fc-rouleau { position: relative; z-index: 2; height: 36px; margin: 0 -16px; image-rendering: pixelated;
  background: url("/skins/base/ui/parchemin-rouleau.png") 0 0 / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 4px color-mix(in srgb, var(--ws-bois) 80%, transparent)); }
.fc-parch { position: relative; z-index: 1; margin: -14px 0; padding: 28px 22px 26px; color: var(--ws-encre); image-rendering: pixelated;
  background: url("/skins/base/ui/parchemin-feuille.png") 0 0 / 100% auto repeat-y;
  animation: fc-deroule .55s ease-out both; font-family: 'Alegreya', var(--title);
  max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; }   /* seule la feuille défile, les rouleaux restent */
@keyframes fc-deroule { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .fc-parch { animation: none; } }
.fc-parch > * { image-rendering: auto; }

.fc-tete { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, var(--ws-encre) 25%, transparent); }
.fc-tete h2 { margin: 0; font: 700 18px 'Cinzel', var(--title); color: var(--ws-encre); }
.fc-ecu { width: 36px; height: 42px; border-radius: 4px 4px 18px 18px;
  background: linear-gradient(90deg, var(--choix, var(--t1)) 50%, var(--choix2, var(--t2)) 50%);
  box-shadow: 0 0 0 2px var(--ws-bois), 0 0 0 3px var(--ws-laiton-lo); }
:root:root .fc-dialog .fc-fermer { font: 700 18px var(--title); background: none; border: 0; box-shadow: none; color: var(--ws-encre); cursor: pointer; padding: 4px 8px; }

.fc-totaux { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.fc-tot { text-align: center; padding: 6px 2px; border-radius: 3px; background: color-mix(in srgb, var(--ws-parch) 72%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ws-encre) 35%, transparent); }
.fc-tot span { display: block; font: 700 11.5px 'Alegreya SC', var(--sc); letter-spacing: .05em; text-transform: uppercase; color: var(--ws-encre); }
.fc-tot b { display: block; font: 900 16px 'Cinzel', var(--title); color: var(--ws-encre); font-variant-numeric: tabular-nums; }
.fc-tot small { display: block; font-size: 12px; font-weight: 700; color: var(--ws-encre); }
.fc-petit { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.fc-petit .fc-tot b { font-size: 14px; }

.fc-liste { list-style: none; margin: 0; padding: 0; }
.fc-liste li { border-bottom: 1px dotted color-mix(in srgb, var(--ws-encre) 30%, transparent); }
:root:root .fc-dialog .fc-ligne { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 7px 2px;
  background: none; border: 0; box-shadow: none; border-radius: 0; cursor: pointer; text-align: left; color: var(--ws-encre); font: inherit; }
.fc-ligne strong { display: block; font-size: 15px; }
.fc-ligne:hover strong { text-decoration: underline dotted 1px; }
.fc-ligne small { color: var(--ws-encre); font-size: 12.5px; }
.fc-fl { transition: transform .15s; }
.fc-ligne[aria-expanded="true"] .fc-fl { transform: rotate(180deg); }
.fc-etat { font: 700 11px 'Alegreya SC', var(--sc); padding: 1px 6px; border-radius: 3px; margin-left: 4px; background: color-mix(in srgb, var(--ws-ko) 22%, var(--ws-parch)); }
.fc-detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 0 0 10px; }
.fc-detail[hidden] { display: none; }
.fc-grand { justify-self: center; image-rendering: pixelated; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ws-parch) 85%, transparent), transparent); }

/* Noms de compagnie qui ouvrent la fiche */
[data-compagnie-id], [data-compagnie-nom] { cursor: pointer; text-decoration: underline dotted 1px; text-underline-offset: 3px; }
button[data-compagnie-id], button[data-compagnie-nom] { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
/* Bat le style des boutons des salles (:root ×4) : le nom reste du texte, souligné en pointillé laiton */
:root:root:root:root:root .ws-scene :is(button[data-compagnie-id], button[data-compagnie-nom]) {
  background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; border-radius: 0; font: inherit; color: inherit;
  text-decoration: underline dotted 1px var(--ws-laiton-hi); text-underline-offset: 3px; cursor: pointer; filter: none;
}
:root:root:root:root:root .ws-scene :is(button[data-compagnie-id], button[data-compagnie-nom]):hover { color: var(--ws-laiton-hi); }
