/* Formica : une page nuit façon Pyment qui encadre des planches naturalistes crème. Aucun style inline (CSP). */
:root {
  --nuit: #14131c; --nuit2: #1c1a27; --trait: #34304a; --or: #e2b65a; --texte: #ece6d6; --doux: #a9a2b8; --sur-or: #1a1724;
  --papier: #f1e6c9; --papier2: #fbf5e4; --encre: #3b2814; --sepia: #7a5a30; --vin: #9b2f2f; --vert: #3b5a2a;
  --titre: Georgia, "Times New Roman", serif; --corps: system-ui, -apple-system, "Segoe UI", sans-serif; --mono: ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nuit); color: var(--texte); font: 16px/1.5 var(--corps); }
a { color: var(--or); }
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, .chambre:focus-visible, .lieu:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

.jeu { max-width: 1320px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }

/* ---------- en-tête ---------- */
.hud { display: grid; gap: 10px; }
.hud-haut { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.marque { margin: 0; font: normal 26px/1.1 var(--titre); color: var(--or); letter-spacing: .01em; }
.alpha { font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sur-or); background: var(--or); padding: 3px 6px; border-radius: 4px; vertical-align: middle; position: relative; top: -3px; }
.hud-reine { font: italic 17px/1.3 var(--titre); }
.hud-reine b { font-weight: normal; }
.doux { color: var(--doux); }
.hud-saison { display: flex; align-items: center; gap: 10px; margin-left: auto; font: 15px var(--titre); }
.hud-saison progress { width: 120px; }
.hud-son { flex: none; background: none; border: 1px solid var(--trait); border-radius: 8px; color: inherit; font-size: 15px; line-height: 1; padding: 5px 7px; cursor: pointer; }
.hud-son[aria-pressed="false"] { opacity: 0.6; }
.hud-res { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hud-res li { display: flex; align-items: baseline; gap: 5px; padding: 5px 10px; border: 1px solid var(--trait); border-radius: 8px; background: var(--nuit2); font-variant-numeric: tabular-nums; font-size: 14px; }
.hud-res li .nom { color: var(--doux); font-size: 13px; }
.hud-res li b { font-weight: 600; }
.hud-res li small { color: var(--doux); font-size: 12px; }
.hud-res li.rare { border-style: dashed; }
.hud-res li.plein b { color: var(--or); }
.hud-res li.vide { border-color: #b3473f; }
.hud-res li.vide b { color: #f08a7e; }
.ico { width: 10px; height: 10px; border-radius: 50%; display: inline-block; align-self: center; flex: none; }
.ico-feuilles { background: #9fb46e; border-radius: 0 60% 0 60%; }
.ico-champi { background: #e8d9b4; border-radius: 50% 50% 2px 2px; }
.ico-miellat { background: #e2b65a; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.ico-pop { background: #8a5a2a; }
.ico-ambre { background: #d8892a; border-radius: 2px; transform: rotate(45deg); }
.ico-rosee { background: #8fb8d8; }
.ico-soie { background: #f6efdc; border: 1px solid #a9a2b8; }

/* ---------- onglets ---------- */
.vues { display: flex; gap: 6px; flex-wrap: wrap; }
.vues button { font: 16px var(--titre); padding: 8px 16px; border-radius: 10px; border: 1px solid var(--trait); background: transparent; color: var(--texte); cursor: pointer; }
.vues button:hover { border-color: var(--or); }
.vues button.on { background: var(--or); border-color: var(--or); color: var(--sur-or); }

/* ---------- corps : planche + fiche ---------- */
.corps { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.scene { position: relative; min-width: 0; }
.vue { border-radius: 6px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: var(--papier); }
.vue svg { display: block; width: 100%; height: auto; max-width: 100%; }
@media (min-width: 981px) { .fiche { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; } }
@media (max-width: 980px) { .corps { grid-template-columns: 1fr; } }
/* grand écran : le carnet de la colonie remplit le bas de la colonne de la planche */
@media (min-width: 981px) {
  .corps { grid-template-rows: auto 1fr; }
  .scene { grid-column: 1; grid-row: 1; }
  .carnet-pc { grid-column: 1; grid-row: 2; }
  .corps > .fenetre > .fiche, .fenetre .fiche { grid-column: 2; grid-row: 1 / span 2; }
}
.carnet-pc { border: 1px solid var(--trait); border-radius: 6px; padding: 12px 16px 14px; }
@media (max-width: 640px) { .carnet-pc { display: none; } }

/* ---------- planches SVG ---------- */
.planche { font-family: var(--titre); user-select: none; -webkit-user-select: none; }
.inerte, .c-contenu, .c-fourmis, .c-etiquettes, .c-meteo, .c-papier, .k-papier, .k-fx, .k-marche, .k-pistes, .k-brume, .lab, .lab-niv { pointer-events: none; }
.pl-titre { font: italic 26px var(--titre); fill: var(--encre); }
.pl-sous { font: 11px var(--titre); letter-spacing: .24em; fill: var(--sepia); }
.pl-fig { font: italic 14px var(--titre); fill: var(--sepia); }
.ciel { fill: #f1e6c9; }
.ciel-printemps { fill: #f0e8cc; }
.ciel-ete { fill: #f3e4bc; }
.ciel-automne { fill: #efdcb8; }
.ciel-hiver { fill: #e9e6dc; }
.herbe { fill: none; stroke-width: 1.1; stroke-linecap: round; transform-box: fill-box; transform-origin: 50% 100%; animation: herbe 3.2s ease-in-out infinite alternate; }
@keyframes herbe { from { transform: skewX(-7deg); } to { transform: skewX(8deg); } }
.herbe:nth-child(3n) { animation-delay: -1.1s; }
.herbe:nth-child(3n+1) { animation-delay: -2.3s; animation-duration: 2.7s; }
.feuille { stroke-width: .8; transform-box: fill-box; transform-origin: 0 50%; animation: vent 4s ease-in-out infinite alternate; }
@keyframes vent { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
.galerie-fond { fill: none; stroke: #b49a6a; stroke-width: 25; stroke-linecap: round; stroke-linejoin: round; }
.galerie { fill: none; stroke: #f3e8cc; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.galerie.a-creuser { stroke: none; }
.chambre { fill: #f6ecd2; stroke: var(--encre); stroke-width: 1.6; cursor: pointer; transition: stroke-width .15s; }
.chambre:hover { stroke-width: 2.6; }
.chambre:focus { outline: none; }
.chambre:focus-visible { stroke: #c08a2c; stroke-width: 3; }
.chambre.vide { fill: rgba(246, 236, 210, .35); stroke-dasharray: 3 5; stroke-width: 1.2; }
.chambre.en-cours { stroke-dasharray: 2 4; }
.trace { fill: none; stroke: var(--sepia); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.lab { font: italic 15px var(--titre); fill: var(--encre); paint-order: stroke; stroke: #f1e6c9; stroke-width: 4px; stroke-linejoin: round; }
.lab-vide { fill: var(--sepia); font-size: 13px; }
.lab-phase { font: italic 13px var(--titre); fill: var(--sepia); paint-order: stroke; stroke: #f1e6c9; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.lab-niv { font: 12px var(--titre); letter-spacing: .1em; fill: var(--sepia); }
.graine { fill: #d9b46a; stroke: var(--encre); stroke-width: .6; }
.oeuf { fill: #fbf5e4; stroke: var(--encre); stroke-width: .6; }
.larve { fill: #f6efdc; stroke: var(--encre); stroke-width: .7; }
.mycelium { fill: #f7f1df; stroke: #a08a62; stroke-width: .6; stroke-dasharray: 1.5 2; }
.chapeau { fill: #e6d2a6; stroke: var(--encre); stroke-width: .8; }
.pied { fill: #f6efdc; stroke: var(--encre); stroke-width: .6; }
.puceron ellipse { fill: #b9c98e; stroke: var(--vert); stroke-width: .7; }
.puceron circle { fill: #9fb46e; stroke: var(--vert); stroke-width: .6; }
.puceron { transform-box: fill-box; transform-origin: 50% 100%; animation: broute 2.6s ease-in-out infinite alternate; }
.puceron:nth-child(2n) { animation-delay: -1.3s; }
@keyframes broute { from { transform: translateY(0); } to { transform: translateY(-1px) rotate(3deg); } }
.goutte { fill: #e2b65a; stroke: #7a4a10; stroke-width: .5; }
.rare-ambre { fill: #d8892a; stroke: #7a4a10; stroke-width: .7; }
.rare-rosee { fill: #a9cbe4; stroke: #4a6a8a; stroke-width: .7; }
.rare-soie { fill: #fbf5e4; stroke: #8a7a5a; stroke-width: .7; }
.flocon { fill: #fff; stroke: #b8b0a0; stroke-width: .3; }
.feuille-morte { fill: #c9803a; stroke: #7a4a10; stroke-width: .5; }

/* carte */
.k-petit { font: italic 12px var(--titre); fill: var(--sepia); }
.brume-fond { fill: #f1e6c9; opacity: .55; }
.piste { fill: none; stroke: var(--sepia); stroke-width: 1.4; stroke-dasharray: 2 6; stroke-linecap: round; animation: piste 1.6s linear infinite; }
@keyframes piste { to { stroke-dashoffset: -16; } }
.lieu { cursor: pointer; }
.lieu:focus { outline: none; }
.halo { fill: transparent; stroke: none; transition: fill .15s; }
.lieu:hover .halo { fill: rgba(226, 182, 90, .25); }
.lieu.choisi .halo { fill: rgba(226, 182, 90, .35); stroke: #c08a2c; stroke-width: 1.4; stroke-dasharray: 3 3; }
.lieu:focus-visible .halo { stroke: #c08a2c; stroke-width: 2.4; }
.lab-lieu { font-size: 13px; fill: var(--sepia); }
.lab-rival { fill: var(--vin); font-size: 13px; }
.lab-nous { fill: #3f6a2c; font-size: 13px; font-weight: 600; }
.lab-inconnu { font: italic 20px var(--titre); fill: var(--sepia); }
.lab-raid { fill: var(--vin); font-size: 13px; letter-spacing: .04em; }
.lab-renfort { fill: var(--vin); font-size: 12px; font-style: italic; }
.p-renfort .phero-nuage { opacity: .1; }

/* lignée */
.arbre-nom { font: italic 18px var(--titre); fill: var(--encre); }
.arbre-info { font: 12px var(--titre); fill: var(--sepia); }
.arbre-genes { font: italic 12px var(--titre); fill: var(--encre); }

/* ---------- toasts ---------- */
.toasts { position: absolute; left: 12px; right: 12px; bottom: 64px; display: grid; gap: 6px; justify-items: center; pointer-events: none; z-index: 5; }
.toast { margin: 0; max-width: 520px; padding: 9px 14px; border-radius: 8px; background: rgba(20, 19, 28, .92); color: var(--texte); border: 1px solid var(--trait); font: 15px/1.35 var(--titre); box-shadow: 0 6px 20px rgba(0, 0, 0, .4); animation: entre .3s ease-out; transition: opacity .7s, transform .7s; }
.toast.part { opacity: 0; transform: translateY(8px); }
.toast.gloire { border-color: var(--or); color: var(--or); }
.toast.mal { border-color: #b3473f; }
.toast.bon { border-color: #6f8f4a; }
.toast.saison { font-style: italic; }
@keyframes entre { from { opacity: 0; transform: translateY(8px); } }

/* ---------- fiche (panneau) ---------- */
.fiche { background: var(--papier); color: var(--encre); border: 1.5px solid var(--encre); outline: 1px solid var(--encre); outline-offset: -7px; padding: 20px; font-family: var(--titre); display: grid; gap: 0; min-width: 0; border-radius: 2px; }
.bloc { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px dotted #b8a27a; }
.bloc:first-child { padding-top: 2px; }
.bloc:last-child { border-bottom: none; padding-bottom: 2px; }
.fiche h3 { margin: 0; font: italic normal 19px/1.2 var(--titre); }
.fiche h3.grand { font-size: 25px; }
.fiche p { margin: 0; }
.fiche .doux { color: var(--sepia); font-size: 14.5px; }
.fiche .petit { font-size: 13px; }
.fiche .ok { color: var(--vert); font-style: italic; }
.fiche .mal, .fiche dd.mal { color: var(--vin); }
.fiche p.mal { font-style: italic; font-size: 14.5px; }
.et { display: block; font: 11.5px/1.2 var(--titre); letter-spacing: .2em; text-transform: uppercase; color: var(--sepia); }
.etapes { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 14.5px; }
.etapes li { padding-left: 22px; position: relative; }
.etapes li::before { content: "○"; position: absolute; left: 2px; color: var(--sepia); }
.etapes li.fait { color: var(--sepia); text-decoration: line-through; text-decoration-color: rgba(122, 90, 48, .5); }
.etapes li.fait::before { content: "✓"; color: var(--vert); }
.etapes li.ici { font-weight: 600; }
.etapes li.ici::before { content: "◉"; color: var(--vin); }
.vues button[hidden], .hud-res li[hidden] { display: none !important; }
/* grands ouvrages */
.fiche .ouvrages { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.fiche .ouvrages li { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dotted #b8a27a; }
.fiche .ouvrages li:first-child { border-top: none; padding-top: 0; }
.fiche .ouvrages li.ferme { opacity: .6; }
.fiche .ouvrages li.ici { background: rgba(122, 90, 48, .07); margin: 0 -10px; padding: 10px; }
.fiche .ouvrages .bonus { font-style: italic; font-size: 14.5px; color: var(--encre); }
.fiche .ouvrages progress { width: 100%; height: 8px; }
.devoir { font-size: 17px; }
.devoir.fait { text-decoration: line-through; text-decoration-color: rgba(59, 40, 20, .4); }
.caste { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.caste label { font-size: 15.5px; }
.caste label b { font-weight: normal; font-variant-numeric: tabular-nums; color: var(--sepia); margin-left: 4px; }
.caste input { grid-column: 1; width: 100%; }
.caste .pc { grid-column: 2; grid-row: 2; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.caste small { grid-column: 1 / -1; color: var(--sepia); font-size: 13px; font-style: italic; }
.glisse { color: #8a5a10; font-style: normal; }
.lignes { margin: 0; display: grid; gap: 4px; font-size: 14.5px; }
.lignes div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted #c8b48a; padding-bottom: 3px; }
.lignes dt { margin: 0; }
.lignes dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.chambres { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chambres li { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #c8b48a; background: rgba(251, 245, 228, .55); scroll-margin: 12px; }
.chambres li.choisie { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); background: var(--papier2); }
.ch-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ch-tete b { font-weight: normal; font-size: 16.5px; }
.niv { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--sepia); white-space: nowrap; }
.chambres .doux { font-size: 13.5px; }

/* boutons de la fiche et des fenêtres */
.fiche button, .mbtn button, .princesse button { font: italic 15.5px/1.25 var(--titre); padding: 10px 14px; border: none; border-radius: 0; background: var(--encre); color: var(--papier); cursor: pointer; text-align: center; }
.fiche button:hover:not(:disabled), .mbtn button:hover, .princesse button:hover { background: #563b1f; }
.fiche button:disabled { opacity: .45; cursor: default; }
button.vin { background: var(--vin); }
.fiche button.vin:hover:not(:disabled), .mbtn button.vin:hover { background: #7f2424; }
button.second, .mbtn button.second { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.mbtn button.second:hover { background: rgba(59, 40, 20, .08); }
.fiche button.lien { background: none; padding: 0; color: var(--vin); text-decoration: underline; font: inherit; }
.fiche button.lien:hover { background: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fiche .chip, .mtxt .chip { font: 15px var(--titre); padding: 6px 11px; border: 1px solid var(--encre); background: transparent; color: var(--encre); cursor: pointer; border-radius: 0; }
.fiche .chip.on, .mtxt .chip.on { background: var(--encre); color: var(--papier); }
.fiche .chip:hover:not(.on), .mtxt .chip:hover:not(.on) { background: rgba(59, 40, 20, .08); }
.gene { display: inline-block; font: 14px var(--titre); padding: 3px 8px; border: 1px solid var(--encre); margin: 0 4px 4px 0; background: var(--papier2); }
.gene.rare { border-color: #b8791e; background: #f6e3b8; }
.genes { display: flex; flex-wrap: wrap; }
.effets { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 3px; }
.effets b { font-weight: normal; font-style: italic; }

/* curseurs et jauges à l'encre */
input[type="range"] { accent-color: var(--encre); height: 24px; cursor: pointer; }
input[type="range"]:disabled { cursor: default; opacity: .45; }
progress { -webkit-appearance: none; appearance: none; height: 8px; width: 100%; border: 1px solid var(--encre); background: var(--papier2); border-radius: 0; }
progress::-webkit-progress-bar { background: var(--papier2); }
progress::-webkit-progress-value { background: var(--sepia); }
progress::-moz-progress-bar { background: var(--sepia); }
.hud progress { border-color: var(--trait); background: var(--nuit2); border-radius: 4px; }
.hud progress::-webkit-progress-bar { background: var(--nuit2); border-radius: 4px; }
.hud progress::-webkit-progress-value { background: var(--or); border-radius: 4px; }
.hud progress::-moz-progress-bar { background: var(--or); }

/* partage */
.pyment-share { display: flex; flex-wrap: wrap; gap: 8px; }
.pyment-share button { font-size: 14.5px; }

/* ---------- carnet ---------- */
.carnet { border-top: 1px solid var(--trait); padding-top: 10px; }
.carnet h2 { margin: 0 0 6px; font: italic normal 18px var(--titre); color: var(--or); }
.carnet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font: 15px/1.4 var(--titre); }
.carnet li { color: var(--texte); }
.carnet li:nth-child(n+4) { color: var(--doux); }
.jr { font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--doux); margin-right: 6px; }
.carnet li.mal { color: #f0a59a; }
.carnet li.gloire { color: var(--or); }

/* ---------- pied de page ---------- */
/* Pied de page commun aux jeux Pyment (« le bouton dé ») : seules --pp-accent et la couleur changent d'un jeu à l'autre */
.pp { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin: 28px auto 16px; padding: 0 12px; }
.pp p { margin: 0; }
.pp a { color: inherit; text-decoration: none; }
.pp a:hover, .pp a:focus-visible { text-decoration: underline; }
.pp .pp-de { display: inline-block; padding: 6px 18px; border: 2px solid var(--pp-accent); border-radius: 999px; color: var(--pp-accent); font-weight: 600; font-size: 16px; line-height: 1.3; margin-bottom: 8px; }
.pp .pp-de:hover, .pp .pp-de:focus-visible { text-decoration: none; background: color-mix(in srgb, var(--pp-accent) 14%, transparent); }
.pp-inspi { font-size: 13px; font-style: italic; opacity: .75; max-width: 46ch; }
.pp-sig { font-size: 13px; opacity: .75; }
.pp .pp-ico { display: inline-block; padding: 0 2px; }
.pp .pp-ico:hover, .pp .pp-ico:focus-visible { text-decoration: none; }
.pied.pp { --pp-accent: var(--or); color: var(--doux); margin: 0; padding-top: 8px; gap: 6px; }
/* barre fixe (ordinateur) : le bouton dé et la signature sur une seule ligne */
.pied.pp { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; white-space: normal; }
.pied .pp-de { padding: 2px 14px; font-size: 14px; margin-bottom: 0; }

/* ---------- fenêtres ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 9, 14, .72); display: grid; place-items: center; padding: 16px; z-index: 20; overflow-y: auto; }
.mbox { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--papier); color: var(--encre); border: 1.5px solid var(--encre); outline: 1px solid var(--encre); outline-offset: -7px; padding: 24px 22px; font-family: var(--titre); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); display: grid; gap: 14px; }
.mbox:has(.princesses) { width: min(820px, 100%); }
.mbox h2 { margin: 0; font: italic normal 28px/1.15 var(--titre); }
.mtxt { display: grid; gap: 10px; font-size: 16.5px; line-height: 1.5; }
.mtxt p { margin: 0; }
.mtxt .doux { color: var(--sepia); font-size: 15px; }
.mbtn { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.champ { display: grid; gap: 6px; font-size: 15px; color: var(--sepia); }
.champ input { font: italic 18px var(--titre); color: var(--encre); background: var(--papier2); border: 1px solid var(--encre); padding: 9px 10px; width: 100%; border-radius: 0; }
.princesses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.princesse { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--encre); background: var(--papier2); }
.princesse h3 { margin: 0; font: italic normal 20px var(--titre); }
.princesse button { margin-top: auto; }
.mut { margin: 0; font-size: 14px; color: #8a5a10; min-height: 1.4em; }
.gains { margin: 0; padding-left: 20px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .princesses { grid-template-columns: 1fr; } }

.noscript { text-align: center; padding: 30px; }
.pyment-banner { font-size: 14px; }

/* ---------- téléphone ---------- */
@media (max-width: 640px) {
  .jeu { padding-top: 10px; gap: 10px; }
  .marque { font-size: 22px; }
  .hud-saison { margin-left: 0; width: 100%; }
  .hud-saison progress { flex: 1; }
  .hud-res li { padding: 4px 8px; font-size: 13px; }
  .hud-res li .nom { display: none; }
  .vues button { flex: 1; padding: 8px 6px; font-size: 15px; }
  .fiche { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .herbe, .feuille, .puceron, .piste, .toast { animation: none; }
  * { transition: none !important; }
}

/* écrans étroits : les nouvelles ne couvrent plus la planche, elles deviennent sa légende, juste dessous,
   sur une ligne réservée (pas de saut de mise en page), et seule la plus récente reste lisible */
@media (max-width: 980px) {
  .toasts { position: static; display: block; justify-items: stretch; text-align: left; min-height: 46px; margin-top: 8px; padding: 0 2px; }
  .toast { display: block; width: auto; margin: 0; max-width: none; padding: 6px 0 6px 12px; border: none; border-left: 2px solid var(--trait); border-radius: 0; background: none; box-shadow: none; font-size: 15px; color: var(--texte); }
  .toast:not(:last-child) { display: none; }
  .toast.gloire { border-left-color: var(--or); }
  .toast.mal { border-left-color: #b3473f; color: #f0a59a; }
  .toast.bon { border-left-color: #6f8f4a; }
  .toast.part { transform: none; }
  .toasts.flottant { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; min-height: 0; padding: 8px max(16px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(20, 19, 28, .95); border-top: 1px solid var(--trait); }
  .toasts.flottant:empty { display: none; }
}

/* onglets de rubriques et fenêtres : seulement sur téléphone */
.onglets, .fen-tete, .v-ico { display: none; }
.cache-vue { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fenetre { display: contents; }
.voile { display: none; }

/* fiche vide (avant la fondation) et étiquettes lisibles sur petit écran */
.fiche:empty { display: none; }
@media (max-width: 640px) {
  .c-etiquettes .lab { font-size: 22px; stroke-width: 5px; }
  .c-etiquettes .lab-vide { font-size: 19px; }
  .carte .lab { font-size: 19px; }
  .carte .lab-lieu, .carte .lab-rival, .carte .lab-nous { font-size: 17px; }
  .carte .lab-renfort { font-size: 15px; }
}

/* ---------- téléphone : un écran de jeu ----------
   en-tête d'une ligne et réserves, planche haute, onglets de rubriques qui ouvrent chacun leur fenêtre,
   barre du bas toujours visible pour passer du nid au jardin et à la lignée */
@media (max-width: 640px) {
  .jeu { gap: 8px; padding-top: 8px; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .hud { gap: 6px; }
  .hud-haut { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .marque { font-size: 19px; }
  .alpha { display: none; }
  .hud-reine { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  #h-age { display: none; }
  .hud-saison { width: auto; margin-left: auto; font-size: 13px; gap: 6px; white-space: nowrap; }
  .hud-saison progress { width: 44px; flex: none; }
  .hud-res { flex-wrap: nowrap; gap: 2px; justify-content: space-between; }
  .hud-res li { padding: 2px 0; font-size: 13px; gap: 4px; border: none; background: none; }
  .hud-res li.rare { border: none; }
  .hud-res li small { display: none; }
  .hud-res li.vide b { color: #f08a7e; }
  .hud-res li.brille { animation: none; }
  .hud-res li.brille b { animation: brilleTexte 1.2s ease-out; }
  @keyframes brilleTexte { 0% { color: var(--or); text-shadow: 0 0 8px rgba(226, 182, 90, .9); } 100% { text-shadow: none; } }

  /* barre du bas */
  .vues { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; flex-wrap: nowrap; gap: 0; background: var(--nuit2); border-top: 1px solid var(--trait); padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .vues button, .vues button.on { flex: 1; display: grid; justify-items: center; gap: 2px; border: none; background: none; color: var(--doux); font-size: 13px; padding: 5px 4px; border-radius: 8px; }
  .vues button.on { color: var(--or); }
  .v-ico { display: block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
  .vues [data-vue="nid"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 8h20'/%3E%3Cpath d='M12 8v4M12 12c-4 0-6 2-6 4M12 12c4 0 6 2 6 4'/%3E%3Cellipse cx='6' cy='18' rx='3.5' ry='2'/%3E%3Cellipse cx='18' cy='18' rx='3.5' ry='2'/%3E%3Cpath d='M9 8c0-2 1.5-3 3-3s3 1 3 3'/%3E%3C/svg%3E"); }
  .vues [data-vue="carte"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E"); }
  .vues [data-vue="lignee"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M4 17l1.5-9 4.5 4 2-6 2 6 4.5-4 1.5 9z'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E"); }

  /* planche : pleine largeur, aussi haute que l'écran le permet */
  .corps { gap: 0; }
  .scene { margin: 0 -16px; }
  .vue { border-radius: 0; box-shadow: none; }
  .vue svg.portrait { max-height: calc(100svh - 196px); width: auto; margin: 0 auto; }
  .toasts { min-height: 32px; margin-top: 2px; padding: 0 16px; }
  .toast { font-size: 14px; padding-top: 4px; padding-bottom: 4px; }

  /* onglets des rubriques */
  .onglets { display: flex; margin: 0 -16px; padding: 0 8px; border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none; }
  .onglets button { flex: 1; position: relative; background: none; border: none; border-bottom: 2px solid transparent; color: var(--doux); font: 15px var(--titre); padding: 11px 6px 9px; white-space: nowrap; cursor: pointer; transition: color .15s, border-color .15s; }
  .onglets button.on { color: var(--or); border-bottom-color: var(--or); }
  .onglets button.signal::after { content: ""; position: absolute; top: 9px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--or); }

  /* fenêtre d'une rubrique : monte du bas, au-dessus de la barre */
  .fenetre { display: block; position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); z-index: 15; max-height: calc(100svh - 140px); overflow-y: auto; overscroll-behavior: contain; background: var(--papier); color: var(--encre); border-top: 1.5px solid var(--encre); box-shadow: 0 -12px 40px rgba(0, 0, 0, .55); transform: translateY(calc(100% + 70px)); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s .28s; }
  .fenetre.ouverte { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .3, 1); }
  .fen-tete { display: flex; align-items: center; justify-content: space-between; gap: 4px; position: sticky; top: 0; z-index: 1; background: var(--papier); padding: 2px max(6px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid #c8b48a; }
  .fen-onglets { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .fen-onglets button { flex: 1; position: relative; background: none; border: none; border-bottom: 2px solid transparent; color: var(--sepia); font: 15px var(--titre); padding: 10px 4px 8px; white-space: nowrap; cursor: pointer; }
  .fen-onglets button.on { color: var(--encre); font-style: italic; border-bottom-color: var(--encre); }
  .fen-onglets button.signal::after { content: ""; position: absolute; top: 8px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #b8791e; }
  .fen-fermer { width: 40px; height: 40px; border: none; background: none; color: var(--encre); font-size: 18px; cursor: pointer; border-radius: 50%; }
  .fen-fermer:active { background: rgba(59, 40, 20, .1); }
  .fenetre .fiche { border: none; outline: none; padding: 6px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); }
  .fenetre .fiche .bloc.hors { display: none; }
  .fenetre .fiche .bloc { border-bottom: none; }
  .fenetre .fiche .bloc:not(.hors) ~ .bloc:not(.hors) { border-top: 1px dotted #b8a27a; }
  .voile { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(10, 9, 14, .45); animation: apparait .25s ease-out; }
  .voile[hidden] { display: none; }
  .carnet { margin-top: 8px; }
  .chambres li { scroll-margin: 64px; }
}
.chambre.fixe { cursor: default; } .chambre.fixe:hover { stroke-width: 1.6; }

/* ---------- petites animations ---------- */
/* changement de vue : la planche apparaît en fondu */
.vue:not([hidden]) { animation: apparait .35s ease-out; }
@keyframes apparait { from { opacity: 0; } }
/* boutons : un léger enfoncement au toucher */
.fiche button, .mbtn button, .princesse button, .vues button, .chip { transition: background-color .15s, transform .08s; }
.fiche button:active:not(:disabled), .mbtn button:active, .princesse button:active, .vues button:active, .chip:active { transform: translateY(1px) scale(.985); }
/* fenêtres : le fond s'assombrit, la planche monte doucement */
.modal:not([hidden]) { animation: apparait .25s ease-out; }
.modal:not([hidden]) .mbox { animation: monte .35s cubic-bezier(.2, .8, .3, 1); }
@keyframes monte { from { opacity: 0; transform: translateY(14px); } }
/* blocs de la fiche qui apparaissent (nouvelle rubrique, nouveau lieu choisi) */
.bloc { animation: apparait .3s ease-out; }
/* chambre agrandie : cercles d'encre */
.eclat { fill: none; stroke: var(--sepia); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: eclat 1.4s ease-out forwards; pointer-events: none; }
.eclat2 { animation-delay: .2s; opacity: 0; }
@keyframes eclat { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
/* réserve pleine ou rareté gagnée */
.hud-res li.brille { animation: brille 1.2s ease-out; }
@keyframes brille { 0% { box-shadow: 0 0 0 0 rgba(226, 182, 90, .7); border-color: var(--or); } 100% { box-shadow: 0 0 0 10px rgba(226, 182, 90, 0); } }
@media (prefers-reduced-motion: reduce) { .vue, .modal, .mbox, .bloc, .eclat, .hud-res li.brille { animation: none !important; } }

/* ---------- jardin vivant : zoom, odeurs, traces de phéromones ---------- */
.carte-cadre { position: relative; }
.carte-cadre svg { display: block; width: 100%; height: auto; aspect-ratio: 900 / 680; touch-action: none; cursor: grab; }
.carte-cadre svg:active { cursor: grabbing; }
.carte-cadre.trace-on svg { cursor: crosshair; }
.carte-herbe { animation: none; opacity: .55; }
.fourmi-c { pointer-events: none; }
.k-marche, .k-phero, .k-trace { pointer-events: none; }
.odeurs { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 70px); }
.odeur { display: inline-flex; align-items: center; gap: 6px; font: 14px var(--titre); padding: 6px 10px; border: 1px solid var(--encre); background: rgba(251, 245, 228, .92); color: var(--encre); cursor: pointer; border-radius: 0; transition: background-color .15s, transform .08s; }
.odeur:active { transform: translateY(1px); }
.odeur .pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--encre)); flex: none; }
.odeur.on { background: var(--encre); color: var(--papier); }
.o-explorer { --c: #2a5a8a; } .o-recolter { --c: #3b6a2a; } .o-attaquer, .o-combattre { --c: #9b2f2f; } .o-defendre { --c: #a0700f; }
.zoom { position: absolute; right: 10px; bottom: 10px; display: grid; gap: 4px; }
.zoom button { width: 36px; height: 36px; font: 20px/1 var(--titre); border: 1px solid var(--encre); background: rgba(251, 245, 228, .92); color: var(--encre); cursor: pointer; border-radius: 0; }
.zoom button:active { background: var(--papier); }
.carte-aide { position: absolute; left: 10px; right: 10px; top: 10px; margin: 0; padding: 7px 12px; font: italic 14.5px/1.35 var(--titre); color: var(--papier); background: rgba(59, 40, 20, .9); border-left: 4px solid var(--c, var(--or)); pointer-events: none; animation: apparait .25s ease-out; }
.a-explorer { --c: #6aa0d8; } .a-recolter { --c: #9fc46e; } .a-attaquer { --c: #e07a6a; } .a-defendre { --c: #e2b65a; }
.phero-nuage { fill: none; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; opacity: .16; }
.phero-fil { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 7; animation: odeur 1.1s linear infinite; }
@keyframes odeur { to { stroke-dashoffset: -16; } }
.phero-but { fill: none; stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .7; transform-box: fill-box; transform-origin: center; animation: but 2.4s ease-in-out infinite; }
@keyframes but { 50% { transform: scale(1.15); opacity: .35; } }
.p-explorer { stroke: #2a5a8a; } .p-recolter { stroke: #3b6a2a; } .p-attaquer { stroke: #9b2f2f; } .p-defendre { stroke: #a0700f; }
.p-explorer path, .p-explorer circle { stroke: #2a5a8a; } .p-recolter path, .p-recolter circle { stroke: #3b6a2a; } .p-attaquer path, .p-attaquer circle { stroke: #9b2f2f; } .p-defendre path, .p-defendre circle { stroke: #a0700f; }
.phero-trace { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 6; opacity: .9; }
.t-explorer { stroke: #2a5a8a; } .t-recolter { stroke: #3b6a2a; } .t-attaquer, .t-combattre { stroke: #9b2f2f; } .t-defendre { stroke: #a0700f; }
.phero-trace.hors { stroke: #9a9488; }
.fiche .pistes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fiche .pistes li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14.5px; padding: 6px 0; border-bottom: 1px dotted #c8b48a; }
.fiche .pistes small { display: block; color: var(--sepia); font-size: 13px; font-style: italic; }
.fiche .pistes b { font-weight: normal; font-style: italic; }
.fiche .pistes .pastille { width: 10px; height: 10px; border-radius: 50%; }
.pi-explorer .pastille { background: #2a5a8a; } .pi-recolter .pastille { background: #3b6a2a; } .pi-attaquer .pastille { background: #9b2f2f; } .pi-defendre .pastille { background: #a0700f; }
@media (prefers-reduced-motion: reduce) { .phero-fil, .phero-but { animation: none; } }
@media (max-width: 640px) {
  #v-carte .carte-cadre svg { aspect-ratio: auto; height: max(260px, calc(100svh - 196px - var(--ci-h, 0px))); }
  .odeurs { left: 6px; right: 50px; bottom: 6px; max-width: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .odeur { padding: 7px 6px; font-size: 13px; white-space: nowrap; gap: 4px; flex: 1 0 auto; justify-content: center; }
  .zoom { right: 6px; bottom: 6px; }
  .zoom button { width: 38px; height: 38px; }
  .carte-aide { left: 6px; right: 6px; top: 6px; font-size: 13.5px; }
}

/* 0.5.0 : rivales colorées, bestioles, mêlées, météo */
.riv { opacity: .7; }
.riv.devine { opacity: .35; }
.fanion { animation: vent 2.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0% 100%; }
.bete { cursor: pointer; }
.bete:focus { outline: none; }
.b-halo { fill: transparent; transition: fill .15s; }
.bete:hover .b-halo, .bete.choisi .b-halo { fill: rgba(226, 182, 90, .3); }
.bete.choisi .b-halo { stroke: #c08a2c; stroke-width: 1.4; stroke-dasharray: 3 3; }
.bete:focus-visible .b-halo { stroke: #c08a2c; stroke-width: 2.4; }
.b-onde { fill: none; stroke-width: 1.4; stroke-dasharray: 2 4; transform-box: fill-box; transform-origin: center; animation: onde 1.8s ease-out infinite; }
.b-proie .b-onde { stroke: #3b6a2a; }
.b-pred .b-onde { stroke: var(--vin); animation-duration: 1.1s; }
.bete.prise .b-onde { animation: none; opacity: 0; }
@keyframes onde { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.lab-bete { font-size: 12px; font-style: italic; fill: var(--sepia); }
.b-pred .lab-bete { fill: var(--vin); }
.averse-voile { fill: #5a6a7a; opacity: .16; }
.pluie { fill: none; stroke: #3a5a7a; stroke-width: 1.1; opacity: .7; stroke-linecap: round; }
.pluie-g { animation: pluie 1.4s linear infinite; }
@keyframes pluie { from { transform: translate(0, 0); } to { transform: translate(-227px, 680px); } }
.canicule-voile { fill: #e8a040; opacity: .08; animation: chaleur 3s ease-in-out infinite alternate; }
@keyframes chaleur { to { opacity: .14; } }
.carnet li.rivale { color: #c4a6dc; }
.dot-maison { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--encre); margin-right: 6px; vertical-align: -1px; }
.dot-rouge { background: #a8382a; } .dot-bleue { background: #2f5d8f; } .dot-violette { background: #6b3f8a; }
.fiche .maisons, .fiche .betes { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.fiche .maisons li, .fiche .betes li { font-size: 14.5px; padding: 4px 0; border-bottom: 1px dotted #c8b48a; }
.fiche .maisons li.dispersee { color: var(--sepia); text-decoration: line-through; }
.fiche .maisons small, .fiche .betes small { color: var(--sepia); font-style: italic; }
.meteo-ligne { font-style: italic; color: #2a5a8a; }
@media (prefers-reduced-motion: reduce) { .b-onde, .pluie-g, .canicule-voile, .fanion { animation: none; } }

/* 0.6.0 : le nid vivant */
.nid-cadre { position: relative; }
.nid-cadre svg { touch-action: pan-y; } /* nid entier : le doigt fait défiler la page jusqu'aux profondeurs (Yan) ; zoomé, il déplace le nid */
.nid-cadre.zoome svg { touch-action: none; }
.nid-cadre.zoome svg { cursor: grab; }
.nid-cadre .zoom { opacity: .85; }
.c-incident .grain-vole, .c-incident .plus-un, .c-incident .eclosion, .c-incident .ponte, .c-bulle { pointer-events: none; }
.grain-vole { fill: #5a3d22; }
.moisi-vole { fill: #9a9a8a; }
.motte { fill: #8a6a3a; stroke: #3b2814; stroke-width: .6; }
.monticule { transition: d .4s; }
.chambre.chantier { fill: #f1e2bd; stroke: var(--encre); stroke-width: 1.8; stroke-dasharray: 5 3; cursor: pointer; animation: chantier 1.2s ease-in-out infinite; }
@keyframes chantier { 50% { stroke-width: 2.8; } }
.trace-but { fill: none; stroke: var(--sepia); stroke-width: 1; stroke-dasharray: 2 5; opacity: .6; pointer-events: none; }
.galerie-neuve { fill: none; stroke: #f1e2bd; stroke-width: 15; stroke-linecap: round; pointer-events: none; }
.plus-un { font: italic 700 18px var(--titre); fill: #a0700f; animation: plusun 1.2s ease-out forwards; }
@keyframes plusun { to { transform: translateY(-18px); opacity: 0; } }
.eclosion { fill: none; stroke: #c08a2c; stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: eclosion 1.2s ease-out forwards; }
@keyframes eclosion { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.ponte { fill: #fbf7ee; stroke: #7a5a30; stroke-width: .8; transform-box: fill-box; transform-origin: center; animation: ponte 1.4s ease-out forwards; }
@keyframes ponte { from { transform: scale(.2); } 30% { transform: scale(1.4); } to { transform: scale(1); opacity: 0; } }
.nouvelle { filter: drop-shadow(0 0 2px rgba(226, 182, 90, .95)); }
.moisi { cursor: pointer; }
.moisi-zone { fill: transparent; }
.moisi-tache { fill: #b8b8a8; stroke: #7a7a6a; stroke-width: .6; opacity: .85; }
.moisi .moisi-tache { animation: moisi 2.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes moisi { to { transform: scale(1.15); opacity: .65; } }
.intrus { cursor: pointer; }
.intrus-zone { fill: rgba(155, 47, 47, .08); stroke: var(--vin); stroke-width: 1; stroke-dasharray: 2 4; }
.intrus-vie { fill: var(--vin); }
.intrus.mord .intrus-zone { animation: mord .25s ease-out; }
@keyframes mord { 50% { fill: rgba(155, 47, 47, .45); } }
.bulle-fond { fill: #2a1d10; opacity: .92; }
.bulle-txt { font: italic 12.5px var(--titre); fill: #f3e8cc; }
@media (prefers-reduced-motion: reduce) { .chambre.chantier, .moisi .moisi-tache, .plus-un, .eclosion, .ponte { animation: none; } }
.front-taille { fill: #4a3220; opacity: .55; }
.front-grain { fill: #3b2814; }
.front { animation: front .5s steps(2) infinite; }
@keyframes front { 50% { transform: translate(.6px, -.4px); } }
.tas { fill: #8a6a3a; stroke: #3b2814; stroke-width: .7; opacity: .9; }

/* ---------- 0.7.1 : ressources lisibles, fiches de chambre, carnet dans la fiche, chasses ---------- */
.res-b { all: unset; display: flex; align-items: baseline; gap: 5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.res-b:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; border-radius: 4px; }
.hud-res li:hover { border-color: var(--or); }
.emo { font-size: 15px; line-height: 1; align-self: center; }
.res-t { margin: 6px 0 0; font: italic 17px var(--titre); }
.res-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.res-l li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dotted #c8b48a; font-size: 15.5px; }
.res-l b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtxt .bon, .res-net .bon { color: var(--vert); }
.mtxt .mal { color: var(--vin); }
.res-net { font-size: 16px; }

.fiche-ch { display: grid; gap: 8px; }
.fiche-ch h3.grand { margin: 0; }
.fiche-ch p { margin: 0; }
.fiche-ch .lien { justify-self: start; margin-top: 4px; }
.carnet-liste { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; font: 15px/1.4 var(--titre); }
.carnet-liste li { color: var(--encre); padding-bottom: 3px; border-bottom: 1px dotted #c8b48a; }
.carnet-liste li:nth-child(n+4) { color: var(--sepia); }
.carnet-liste li.alerte { color: var(--vin); }
.carnet-liste li.gloire { color: #8a5a10; }
.carnet-liste li.bon { color: var(--vert); }
.carnet-liste li.rivale { color: #6a3a5a; }
.carnet-liste li.saison { font-style: italic; }
.carnet-liste .jr { color: var(--sepia); }

/* chasses : combat autour de la bête, jauge, tombées */
.lab-chasse { font: 13px var(--titre); fill: var(--vin); paint-order: stroke; stroke: #f1e6c9; stroke-width: 3px; }
.ban-proie .lab-chasse { fill: var(--vert); }
.jauge-fond { fill: #f1e6c9; stroke: var(--encre); stroke-width: .6; }
.jauge-plein { fill: var(--vin); }
.ban-proie .jauge-plein { fill: var(--vert); }
.choc { stroke: var(--vin); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.miette-c { fill: #9bb35a; }
.bete.en-combat .b-halo { fill: rgba(155, 47, 47, .16); stroke: var(--vin); stroke-width: 1.2; stroke-dasharray: 2 3; animation: combatHalo .6s ease-in-out infinite alternate; }
.b-proie.en-combat .b-halo { fill: rgba(59, 90, 42, .14); stroke: var(--vert); }
@keyframes combatHalo { from { opacity: .5; } to { opacity: 1; } }
.bilan { animation: bilanFin 45s linear forwards; }
@keyframes bilanFin { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.tombee { opacity: .85; }
.lab-bilan { font: italic 14px var(--titre); paint-order: stroke; stroke: #f1e6c9; stroke-width: 3px; animation: bilanMonte 6s ease-out forwards; }
.lab-bilan.b-ok { fill: var(--vert); }
.lab-bilan.b-ko { fill: var(--vin); }
@keyframes bilanMonte { 0% { transform: translateY(6px); opacity: 0; } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* téléphone : le pied de page se range sous la barre Nid / Jardin / Lignée */
@media (max-width: 640px) {
  .pied { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; background: var(--nuit2); padding: 8px 8px calc(4px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--trait); font-size: 11.5px; line-height: 1.2; display: flex; justify-content: center; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
  .pied p { margin: 0; }
  .vues { bottom: calc(28px + env(safe-area-inset-bottom, 0px)); padding-bottom: 6px; }
  .jeu { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .vue svg.portrait { max-height: calc(100svh - 228px); }
  .fenetre { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); max-height: calc(100svh - 172px); }
  #v-carte .carte-cadre svg { height: max(260px, calc(100svh - 228px - var(--ci-h, 0px))); }
  .emo { font-size: 14px; }
}

/* ---------- 0.8.0 : cercle d'influence ---------- */
.o-marquer { --c: #6a4a8a; }
.p-marquer { stroke: #6a4a8a; } .p-marquer path, .p-marquer circle { stroke: #6a4a8a; }
.pi-marquer .pastille { background: #6a4a8a; }
.front-zone { fill: rgba(155, 47, 47, .12); stroke-width: 1.4; stroke-dasharray: 3 3; animation: combatHalo 1.2s ease-in-out infinite alternate; }
.lab-front { font: italic 12px var(--titre); fill: var(--vin); paint-order: stroke; stroke: #f1e6c9; stroke-width: 3px; }
.depot { fill: rgba(106, 74, 138, .35); animation: depot 2.4s ease-out forwards; }
@keyframes depot { from { opacity: 1; } to { opacity: 0; transform: scale(1.6); transform-box: fill-box; transform-origin: center; } }
@media (max-width: 640px) {
  .odeurs { gap: 2px; }
  .odeur { padding: 7px 4px; font-size: 12px; gap: 3px; flex: 1 1 auto; min-width: 0; }
  .odeur .pastille { width: 8px; height: 8px; }
}

/* grands ouvrages sur la planche */
.dome { fill: #d9c08a; stroke: #3b2814; stroke-width: 1.4; }
.dome.dome-chantier { stroke-dasharray: 6 4; fill: #e3cf9f; }
.aiguilles { fill: none; stroke: #6b4a22; stroke-width: 1.1; stroke-linecap: round; opacity: .8; pointer-events: none; }
.lab-ouv { font-size: 13px; fill: #5a3d22; }
.galerie-fond.chicane-fond { stroke-width: 13; }
.galerie.chicane { stroke-width: 10; }
.meule { fill: #f4ecd6; stroke: #8a7550; stroke-width: .9; pointer-events: none; }
.citerne { fill: #e2a64a; stroke: #6b4314; stroke-width: 1; pointer-events: none; }
.citerne-tete { fill: #3b2410; pointer-events: none; }
/* siège (0.9.4) : défenses entamées */
progress.breche { margin: 4px 0 10px; }
progress.breche::-webkit-progress-value { background: var(--vin, #8a2a1a); }
progress.breche::-moz-progress-bar { background: var(--vin, #8a2a1a); }
.fiche button.lien[data-a="rappel"] { margin-left: 8px; }
/* ---------- La mémoire : la chambre des odeurs (0.9.5) ---------- */
body.vue-memoire .fiche .bloc.hors { display: none; }
.filtre { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre .chip { font-size: 14px; padding: 5px 10px; position: relative; }
.filtre .chip.signal::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #b8791e; }
.vues button { position: relative; }
.vues button.signal::after { content: ""; position: absolute; top: 8px; right: 22%; width: 7px; height: 7px; border-radius: 50%; background: var(--or); }
.odeur-saison { font: italic 12.5px var(--titre); fill: var(--sepia); }
.odeur-vide { font: italic 13px var(--titre); fill: #a08a62; }
.odeur-bilan { font: 15px var(--titre); fill: var(--encre); }
.odeur-reine { font: italic 14px var(--titre); fill: var(--sepia); }
.bulle-saison { font: italic 13px var(--titre); fill: var(--sepia); }
#v-lignee .bulle-txt { font: 14.5px var(--titre); fill: var(--encre); }
.goutte-g { cursor: pointer; outline: none; }
.goutte-g:focus-visible .goutte-in, .goutte-g.lue .goutte-in { filter: drop-shadow(0 0 2px #3b2814); }
.goutte-g.fraiche .goutte-in { animation: goutte-pulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes goutte-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
.odeur-fourmi .f-in0, .odeur-fourmi .f-in1 { animation: depose 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.odeur-fourmi .f-in1 { animation-delay: -1.6s; }
@keyframes depose { 0%, 100% { transform: translate(0, 0) rotate(0); } 40% { transform: translate(5px, -3px) rotate(-8deg); } 60% { transform: translate(5px, -3px) rotate(-8deg); } }
.histoire { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 4px; }
.histoire li { display: flex; gap: 8px; align-items: baseline; }
.histoire li.grand { font-weight: bold; }
.goutte { display: inline-block; width: 10px; height: 10px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); flex: none; background: #a0784a; border: 1px solid var(--encre); }
.o-reine { background: #d9a73a; } .o-conquete { background: #9b2f2f; } .o-defaite { background: #5b4a3a; } .o-ouvrage { background: #b98a2a; } .o-mission { background: #7a8a3a; }
.o-chambre { background: #a0784a; } .o-decouverte { background: #2a5a8a; } .o-extension { background: #6a4a8a; } .o-chasse { background: #3b6a2a; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--sepia); margin-top: 6px; }
.legende > span { display: inline-flex; gap: 6px; align-items: center; }
.lignage { margin: 4px 0 12px; padding-left: 20px; }
.lignage li.ici { color: var(--sepia); }
@media (max-width: 640px) {
  body.vue-memoire .fenetre { position: static; transform: none; visibility: visible; max-height: none; box-shadow: none; border-top: none; overflow: visible; }
  body.vue-memoire .fen-tete { display: none; }
  body.vue-memoire .onglets { display: none; }
  body.vue-memoire .fiche .bloc.hors { display: none; }
}
@media (prefers-reduced-motion: reduce) { .goutte-g.fraiche .goutte-in, .odeur-fourmi .f-in0, .odeur-fourmi .f-in1 { animation: none; } }
/* barre des odeurs en pastilles dessinées (0.9.5) : le nom seulement pour l'odeur choisie sur téléphone */
.odeurs { gap: 6px; }
.odeur { --c: var(--encre); }
.odeur.o-explorer { --c: #2a5a8a; } .odeur.o-attaquer, .o-combattre { --c: #9b2f2f; } .odeur.o-defendre { --c: #a0700f; } .odeur.o-marquer { --c: #6a4a8a; }
.odeur .pastille { display: none; }
.odeur .ico { width: 24px; height: 24px; flex: none; color: var(--c); display: grid; place-items: center; }
.odeur .ico svg { width: 24px; height: 24px; display: block; }
.odeur.on .ico { color: var(--papier); }
.odeur.on { background: var(--c); border-color: var(--c); }
@media (max-width: 640px) {
  .odeurs { left: 6px; right: auto; bottom: 6px; flex-direction: column; align-items: flex-start; overflow: visible; max-width: calc(100% - 60px); }
  .odeur { flex: none; width: auto; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 22px; justify-content: flex-start; gap: 8px; box-shadow: 0 1px 3px rgba(59, 40, 20, .25); }
  .odeur .nom { display: none; }
  .odeur.on .nom { display: inline; font-size: 14px; }
}
#v-carte .carte-cadre .odeur .ico svg { width: 24px; height: 24px; aspect-ratio: auto; cursor: pointer; touch-action: manipulation; }
@media (min-width: 641px) { .vues button.signal::after { top: 4px; right: 4px; } }
.onglets:empty { display: none; }
@media (max-width: 640px) { body.sans-onglets .vue svg.portrait { max-height: calc(100svh - 190px); } }
.premiers-pas { background: #efe3c4; color: var(--encre); padding: 14px 22px 4px; border-bottom: 1px dotted #b8a27a; }
.premiers-pas h3 { font: italic 20px var(--titre); margin: 0 0 6px; }
.premiers-pas .etapes { margin: 0 0 8px; }
.lettre-portee { font-size: 15px !important; letter-spacing: 0 !important; }
.c-porteuses { pointer-events: none; }
/* jardin : plus de boutons + − ◎ (pincer ou molette pour zoomer), pastilles plus grandes (demande de Yan) */
#v-carte .zoom { display: none; }
.odeur .ico, #v-carte .carte-cadre .odeur .ico svg { width: 28px; height: 28px; }
@media (max-width: 640px) { .odeur { min-width: 50px; height: 50px; border-radius: 25px; padding: 0 11px; } .odeurs { max-width: calc(100% - 12px); } }
.premiers-pas, .premiers-pas li { font-family: var(--titre); }
.premiers-pas .mission-haut h3 { font: italic 18px var(--titre); margin: 6px 0 4px; }
.premiers-pas .mission-haut { padding-bottom: 8px; }
.premiers-pas .etapes + .mission-haut { border-top: 1px dotted #b8a27a; padding-top: 6px; }

/* ---------- 0.9.8 : l'ordinateur suit la logique du téléphone (demande de Yan) ----------
   en-tête d'une ligne, réserves sobres, planche seule et haute, nouvelles en légende, onglets sous la planche
   qui ouvrent une fenêtre (ici un volet à droite), barre Nid / Jardin / Mémoire en bas, carnet dans la fenêtre des chambres */
@media (min-width: 641px) {
  .jeu { max-width: 1180px; gap: 10px; padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
  .hud { gap: 8px; }
  .hud-haut { flex-wrap: nowrap; align-items: center; gap: 16px; }
  .hud-reine { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .hud-res { gap: 4px 22px; }
  .hud-res li { padding: 2px 0; border: none; background: none; font-size: 15px; gap: 6px; }
  .hud-res li.rare { border: none; }
  .hud-res li .nom, .hud-res li small { display: none; }
  .hud-res li.brille { animation: none; }
  .hud-res li.brille b { animation: brilleTexteG 1.2s ease-out; }
  @keyframes brilleTexteG { 0% { color: var(--or); text-shadow: 0 0 8px rgba(226, 182, 90, .9); } 100% { text-shadow: none; } }

  /* barre du bas, comme sur téléphone, resserrée au centre */
  .vues { position: fixed; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); z-index: 16; flex-wrap: nowrap; justify-content: center; gap: 0; background: var(--nuit2); border-top: 1px solid var(--trait); padding: 4px 8px 6px; }
  .vues button, .vues button.on { flex: 0 1 200px; display: grid; justify-items: center; gap: 2px; border: none; background: none; color: var(--doux); font-size: 14px; padding: 6px 4px; border-radius: 8px; }
  .vues button:hover { color: var(--texte); }
  .vues button.on { color: var(--or); }
  .vues button.signal::after { top: 6px; right: 34%; }
  .v-ico { display: block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
  .vues [data-vue="nid"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 8h20'/%3E%3Cpath d='M12 8v4M12 12c-4 0-6 2-6 4M12 12c4 0 6 2 6 4'/%3E%3Cellipse cx='6' cy='18' rx='3.5' ry='2'/%3E%3Cellipse cx='18' cy='18' rx='3.5' ry='2'/%3E%3Cpath d='M9 8c0-2 1.5-3 3-3s3 1 3 3'/%3E%3C/svg%3E"); }
  .vues [data-vue="carte"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E"); }
  .vues [data-vue="lignee"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M4 17l1.5-9 4.5 4 2-6 2 6 4.5-4 1.5 9z'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E"); }
  .pied { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; background: var(--nuit2); padding: 6px 8px calc(5px + env(safe-area-inset-bottom, 0px)); font-size: 12.5px; line-height: 1.2; display: flex; justify-content: center; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
  .pied p { margin: 0; }
  .pied-copie { display: none; }

  /* planche seule, aussi haute que l'écran le permet */
  .corps { display: block; }
  .carnet-pc { display: none; }
  .vue svg.paysage, #v-nid svg, #v-colonie svg { max-height: calc(100vh - 250px); width: auto; max-width: 100%; margin: 0 auto; }
  #v-carte .carte-cadre svg { aspect-ratio: auto; height: max(300px, calc(100vh - 250px - var(--ci-h, 0px))); }

  /* nouvelles : légende sous la planche, la plus récente seulement */
  .toasts { position: static; display: block; justify-items: stretch; text-align: left; min-height: 34px; margin-top: 4px; padding: 0 2px; }
  .toast { display: block; width: auto; margin: 0; max-width: none; padding: 5px 0 5px 12px; border: none; border-left: 2px solid var(--trait); border-radius: 0; background: none; box-shadow: none; font-size: 15px; color: var(--texte); animation: none; }
  .toast:not(:last-child) { display: none; }
  .toast.gloire { border-left-color: var(--or); }
  .toast.mal { border-left-color: #b3473f; color: #f0a59a; }
  .toast.bon { border-left-color: #6f8f4a; }

  /* onglets des rubriques sous la planche */
  .onglets { display: flex; justify-content: center; border-bottom: 1px solid var(--trait); }
  .onglets button { flex: 0 1 190px; position: relative; background: none; border: none; border-bottom: 2px solid transparent; color: var(--doux); font: 16px var(--titre); padding: 10px 8px 8px; white-space: nowrap; cursor: pointer; }
  .onglets button:hover { color: var(--texte); }
  .onglets button.on { color: var(--or); border-bottom-color: var(--or); }
  .onglets button.signal::after { content: ""; position: absolute; top: 9px; right: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--or); }

  /* fenêtre d'une rubrique : un volet qui glisse depuis la droite */
  .fenetre { display: block; position: fixed; top: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: min(420px, 92vw); z-index: 15; overflow-y: auto; overscroll-behavior: contain; background: var(--papier); color: var(--encre); border-left: 1.5px solid var(--encre); box-shadow: -12px 0 40px rgba(0, 0, 0, .55); transform: translateX(calc(100% + 30px)); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s .28s; }
  .fenetre.ouverte { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .3, 1); }
  .fen-tete { display: flex; align-items: center; justify-content: space-between; gap: 4px; position: sticky; top: 0; z-index: 1; background: var(--papier); padding: 2px 6px 0 8px; border-bottom: 1px solid #c8b48a; }
  .fen-onglets { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .fen-onglets button { flex: 1; position: relative; background: none; border: none; border-bottom: 2px solid transparent; color: var(--sepia); font: 15px var(--titre); padding: 10px 4px 8px; white-space: nowrap; cursor: pointer; }
  .fen-onglets button.on { color: var(--encre); font-style: italic; border-bottom-color: var(--encre); }
  .fen-onglets button.signal::after { content: ""; position: absolute; top: 8px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #b8791e; }
  .fen-fermer { width: 40px; height: 40px; border: none; background: none; color: var(--encre); font-size: 18px; cursor: pointer; border-radius: 50%; }
  .fen-fermer:hover { background: rgba(59, 40, 20, .1); }
  .fenetre .fiche, .corps > .fenetre > .fiche { position: static; max-height: none; overflow: visible; border: none; outline: none; padding: 6px 20px 18px; }
  .fenetre .fiche .bloc.hors { display: none; }
  .fenetre .fiche .bloc { border-bottom: none; }
  .fenetre .fiche .bloc:not(.hors) ~ .bloc:not(.hors) { border-top: 1px dotted #b8a27a; }
  .voile { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(10, 9, 14, .3); animation: apparait .25s ease-out; }
  .voile[hidden] { display: none; }
  .chambres li { scroll-margin: 64px; }

  /* La mémoire : la fenêtre se pose sous la planche, comme sur téléphone */
  body.vue-memoire .fenetre { position: static; width: auto; transform: none; visibility: visible; box-shadow: none; border-left: none; overflow: visible; margin-top: 10px; border-radius: 6px; }
  body.vue-memoire .fen-tete, body.vue-memoire .onglets { display: none; }
}

/* ---------- 0.9.8 : les saisons se voient (demande de Yan) ---------- */
body.vue-memoire .corps { max-width: 920px; margin: 0 auto; }
.saison-voile { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nid-cadre .zoom, .carte-cadre .zoom, .carte-cadre .odeurs, .carte-cadre .carte-aide { z-index: 2; }
.saison-teinte { position: absolute; inset: 0; mix-blend-mode: multiply; transition: background-color 4s ease; }
.saison-printemps .saison-teinte { background: #eaf3d6; }
.saison-ete .saison-teinte { background: #fbe6ac; }
.saison-automne .saison-teinte { background: #f5d0a2; }
.saison-hiver .saison-teinte { background: #dbe5f1; }
.saison-hiver .nid-cadre svg, .saison-hiver .carte-cadre svg { filter: saturate(.55); }
.saison-ciel { position: absolute; inset: 0; }
.ciel-nid .saison-ciel { bottom: auto; height: 23%; }
.saison-ciel .flk { position: absolute; top: 0; height: 100%; width: 12px; animation: tombe linear infinite; }
.saison-ciel .flk i { position: absolute; top: 0; left: 0; display: block; width: 7px; height: 7px; animation: balance ease-in-out infinite alternate; }
@keyframes tombe { from { transform: translateY(-8%); } to { transform: translateY(100%); } }
@keyframes balance { from { margin-left: -9px; rotate: -30deg; } to { margin-left: 9px; rotate: 40deg; } }
.saison-printemps .flk i { background: #f2b8c6; border-radius: 70% 0 70% 0; opacity: .85; }
.saison-ete .flk { animation-direction: reverse; }
.saison-ete .flk i { width: 4px; height: 4px; border-radius: 50%; background: #f6d36b; box-shadow: 0 0 6px 2px rgba(246, 211, 107, .7); opacity: .8; }
.saison-automne .flk i { width: 10px; height: 7px; background: #c8742e; border-radius: 0 80% 0 80%; opacity: .9; }
.saison-automne .flk:nth-child(3n) i { background: #a8452a; }
.saison-automne .flk:nth-child(3n+1) i { background: #d9a23a; }
.saison-hiver .flk i { width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px rgba(80, 90, 110, .6); }
@media (prefers-reduced-motion: reduce) { .saison-ciel { display: none; } .saison-teinte { transition: none; } }
.hud-saison #h-saison { white-space: nowrap; }

/* ---------- 0.10.0 : le monde ---------- */
.lab-recolte { fill: #3b6a2a !important; }
.lab-vierge { fill: var(--sepia) !important; }
.lab-danger { fill: var(--vin) !important; }
.nid-cadre .zoom { display: none; }
/* atelier des grands ouvrages (0.10.1) */
.chambre.atelier { fill: #efe0b8; cursor: pointer; }
.chambre.atelier:hover { stroke-width: 2.6; }
.lab-atelier { fill: #7a4a10; }
.atelier-barre { fill: #e6d6ae; stroke: var(--encre); stroke-width: .8; }
.atelier-plein { fill: #c08a2c; }
.atelier-plein.bati { fill: #3b6a2a; }
/* intrus (0.10.2) : le mille-pattes se reconnaît d'un coup d'œil */
.intrus-dos { fill: none; stroke: #5a2410; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.intrus-seg { fill: #a8481e; stroke: #2a140a; stroke-width: .7; }
.intrus-tete { fill: #4a1a0a; stroke: #2a140a; stroke-width: .9; }
.intrus-anneau { stroke: #2a140a; stroke-width: 1.1; fill: none; }
.intrus-patte { stroke: #d9a050; stroke-width: 1.1; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.intrus-cerque { stroke: #8a3a1a; stroke-width: 1.4; }
.intrus-antenne { stroke: #2a140a; stroke-width: .9; fill: none; stroke-linecap: round; }
.intrus-croc { stroke: #1a0a04; stroke-width: 1.5; fill: none; stroke-linecap: round; }
.intrus-oeil { fill: #f0d8a0; }
.intrus-zone { animation: alerte 1.6s ease-in-out infinite; }
@keyframes alerte { 50% { stroke-opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .intrus-zone { animation: none; } }
/* les profondeurs (0.11.0) : seconde planche sous le nid, l'hiver */
.profondeurs { display: block; width: 100%; max-width: 900px; margin-left: auto; margin-right: auto; height: auto; margin-top: 10px; cursor: pointer; border: 1px solid var(--encre); background: #b99c70; }
.profondeurs.cache { display: none; }
.p-titre { font-size: 20px; fill: #f6efdc; stroke: #3b2814; }
.profondeurs .lab-phase { fill: #f6efdc; stroke: #3b2814; }
.p-grad { font: italic 12px var(--titre); fill: #f1e6c9; }
.p-gal { stroke-width: 18px; } .galerie-fond.p-gal { stroke-width: 21px; }
.p-gal2 { stroke-width: 10px; } .galerie-fond.p-gal2 { stroke-width: 13px; }
.p-inconnu { fill: rgba(246, 236, 210, .18); stroke: #f1e6c9; stroke-width: 1.2; stroke-dasharray: 3 4; }
.p-q { font: italic 18px var(--titre); fill: #f1e6c9; }
.p-z { font: italic 12px var(--titre); fill: #3b2814; }
.poche .chambre { pointer-events: none; }
/* carte sans volet (0.11.1) : une petite carte d'infos posée sur le monde */
.carte-info { position: relative; margin: 8px auto 0; z-index: 3; width: min(560px, 100%); box-sizing: border-box; background: #f6efdc; border: 1px solid var(--encre); border-radius: 6px; box-shadow: 0 4px 14px rgba(20, 12, 4, .35); padding: 10px 34px 10px 12px; display: flex; flex-direction: column; gap: 4px; font-family: var(--titre); color: var(--encre); }
.carte-info[hidden] { display: none; }
.carte-info b { font: italic 17px var(--titre); }
.carte-info span { font-size: 14px; line-height: 1.3; }
.carte-info span.mal { color: var(--vin); } .carte-info span.bon { color: #3b6a2a; } .carte-info span.doux { color: var(--sepia); font-style: italic; }
.carte-info button { margin-top: 4px; padding: 6px 10px; font: italic 15px var(--titre); }
.carte-info .ci-b { display: flex; gap: 8px; align-items: center; }
.carte-info .ci-x { position: absolute; top: 2px; right: 4px; margin: 0; padding: 2px 8px; background: none; border: none; font: 20px var(--titre); color: var(--sepia); cursor: pointer; }
/* 0.11.4 : traces (dessinées, bord en tirets) et actions (au clic, bord plein) séparées ; effacer = simple croix */
.odeur.g-traces { border-style: dashed; }
.odeurs-sep { flex: none; align-self: center; width: 1px; height: 30px; background: var(--sepia); opacity: .55; margin: 0 4px; }
.odeur.o-effacer { --c: var(--sepia); min-width: 0; width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; margin-left: 4px; }
.odeur.o-effacer .ico, #v-carte .carte-cadre .odeur.o-effacer .ico svg { width: 20px; height: 20px; }
.odeur.o-effacer .nom { display: none; }
@media (max-width: 640px) {
  .odeurs-sep { width: 30px; height: 1px; margin: 3px 10px; align-self: flex-start; }
  .odeur.o-effacer { width: 40px; height: 40px; min-width: 0; padding: 0; margin: 2px 0 0 5px; }
}
.carte-info button:not(.ci-x) { border: none; background: var(--encre); color: var(--papier); cursor: pointer; }
.carte-info button.vin { background: var(--vin); }
.carte-info button.lien { background: none; color: var(--vin); text-decoration: underline; }
.carte-info button:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) { .carte-info { margin-top: 6px; padding: 8px 30px 8px 10px; } .carte-info b { font-size: 16px; } .carte-info span { font-size: 13px; } .carte-info button { font-size: 14px; padding: 5px 9px; } }
/* 0.11.5 : terrain pris par une rivale, en pointillés au bord du territoire */
.terrain-perdu { fill: none; stroke: var(--vin); stroke-width: 1.6; stroke-dasharray: 3 4; opacity: .8; }
/* 0.12.0 : La mémoire devient une bibliothèque (demande de Yan) */
.bib-plaque { font: italic 10.5px var(--titre); fill: #3b2814; letter-spacing: .02em; }
.bib-saison { font-size: 10px; }
.livre-g { cursor: pointer; outline: none; }
.livre-in { transition: transform .25s ease; }
.livre-g:hover .livre-in, .livre-g:focus-visible .livre-in, .livre-g.lue .livre-in { transform: translateY(-10px); }
.livre-g.lue .livre-in, .livre-g:focus-visible .livre-in { filter: drop-shadow(0 3px 2px rgba(42, 29, 16, .45)); }
.livre-g.fraiche .livre-in { animation: livre-range 1.6s ease-out 1 both; }
@keyframes livre-range { 0% { transform: translateY(-40px); opacity: 0; } 60% { transform: translateY(3px); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .livre-g.fraiche .livre-in { animation: none; } .livre-in { transition: none; } }
.dos { display: inline-block; width: 7px; height: 14px; border-radius: 1px; flex: none; border: 1px solid var(--encre); vertical-align: -2px; margin-right: 4px; background: #a0784a; }
/* 0.13.0 : L'empire (demande de Yan) */
.vues [data-vue="empire"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Ccircle cx='4.5' cy='5' r='2'/%3E%3Ccircle cx='19.5' cy='5' r='2'/%3E%3Ccircle cx='12' cy='21' r='2'/%3E%3Cpath d='M6 6.4l3.6 3.4M18 6.4l-3.6 3.4M12 15.2V19'/%3E%3C/svg%3E"); }
.planche.empire { display: block; width: 100%; height: auto; }
.empire .emp-nom { font: italic 15px var(--titre); fill: var(--encre); }
.empire .emp-lieu { font: italic 14px var(--titre); fill: var(--encre); }
.empire .emp-reine { font: 12px var(--titre); fill: var(--sepia); }
.empire .emp-apport { font: 12px var(--titre); fill: #3b6a2a; }
.empire .emp-emo { font-size: 26px; }
.empire .emp-emo-p { font-size: 15px; }
.empire .emp-pille { font: italic 11px var(--titre); fill: var(--vin); }
.empire .emp-cart-t { font: italic 15px var(--titre); fill: var(--encre); }
.empire .emp-cart { font: 13px var(--titre); fill: var(--sepia); }
.empire .emp-edit-t { font: italic 14px var(--titre); fill: var(--encre); }
.empire .emp-edit-n { font: 11.5px var(--titre); fill: var(--sepia); }
.empire .emp-aide { font: italic 14px var(--titre); fill: var(--sepia); }
.empire .emp-nid, .empire .emp-decret { cursor: pointer; outline: none; }
.empire .emp-nid:hover circle:nth-child(2), .empire .emp-nid.on circle:nth-child(2), .empire .emp-nid:focus-visible circle:nth-child(2) { stroke-width: 4.5; }
.empire .emp-decret:hover circle, .empire .emp-decret:focus-visible circle { stroke-width: 2.2; }
.empire .emp-decret.cur .emp-emo-p { filter: drop-shadow(0 0 1px #fff); }
@media (max-width: 640px) { .empire .emp-lieu { font-size: 15px; } .empire .emp-reine, .empire .emp-apport { font-size: 13px; } .empire .emp-cart { font-size: 12px; } }
.empire text { paint-order: stroke; stroke: #efe3c4; stroke-width: 3px; stroke-linejoin: round; }
.empire .emp-nid text, .empire .emp-decret text { stroke-width: 2.5px; }
.empire .emp-emo, .empire .emp-emo-p { stroke: none; }
/* 0.14.0 : le puzzle des profondeurs (demande de Yan) */
.profondeurs { margin-top: 0; }
.p-flair { fill: #e2b65a; stroke: #3b2814; stroke-width: 1.2; }
.p-flair-n { font: bold 11px var(--titre); fill: #3b2814; }
.p-roche { fill: #8f8f88; stroke: #3b3b36; stroke-width: 1.2; }
.p-file { fill: rgba(246, 236, 210, .35); stroke: #f6efdc; stroke-width: 1.4; stroke-dasharray: 4 3; }
.p-file.cour { fill: rgba(246, 236, 210, .2); stroke-dasharray: none; }
.p-cand { fill: rgba(246, 236, 210, .08); stroke: #f1e6c9; stroke-width: 1.1; stroke-dasharray: 2 4; }
.p-num { font: italic 13px var(--titre); fill: #3b2814; }
.p-case { pointer-events: none; }
.profondeurs .p-q { font-size: 15px; }

/* ---------- 0.15.0 : missions qui donnent envie (demande de Yan) ---------- */
.premiers-pas { padding: 14px 16px 10px; display: grid; gap: 10px; }
.premiers-pas .mission-haut, .premiers-pas .etapes + .mission-haut { border: 0; padding: 0; }
.m-et { display: block; font: 600 11.5px/1.2 var(--titre); letter-spacing: .14em; text-transform: uppercase; color: var(--sepia); }
.mission { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: start; padding: 12px 14px; background: linear-gradient(180deg, #fbf3dc, #f1e2ba); border: 1.5px solid var(--encre); box-shadow: 3px 3px 0 rgba(59, 40, 20, .18); position: relative; }
.mission::before { content: ""; position: absolute; inset: 3px; border: .6px solid rgba(59, 40, 20, .45); pointer-events: none; }
.m-sceau svg { width: 54px; height: 54px; display: block; }
.m-sceau circle { fill: var(--vin); stroke: #5e1a1a; stroke-width: 2; }
.m-sceau path { fill: #f3d58a; stroke: #5e1a1a; stroke-width: .8; }
.mission.presque .m-sceau svg { animation: sceau 1.6s ease-in-out infinite; transform-origin: center; }
.mission.faite .m-sceau circle { fill: var(--vert); stroke: #22361a; }
@keyframes sceau { 50% { transform: scale(1.08) rotate(-6deg); } }
.m-but { margin: 3px 0 8px; font: italic 19px/1.3 var(--titre); color: var(--encre); }
.m-barre { display: flex; align-items: center; gap: 10px; }
.m-barre progress { flex: 1; height: 12px; border: 1.2px solid var(--encre); background: #fbf5e4; }
.m-barre progress::-webkit-progress-bar { background: #fbf5e4; }
.m-barre progress::-webkit-progress-value { background: repeating-linear-gradient(135deg, #b98a2a 0 6px, #d9a73a 6px 12px); }
.m-barre progress::-moz-progress-bar { background: repeating-linear-gradient(135deg, #b98a2a 0 6px, #d9a73a 6px 12px); }
.m-barre b { font: 600 17px var(--titre); color: var(--encre); min-width: 46px; text-align: right; }
.m-ok { margin: 0 0 6px; font: 600 15px var(--titre); color: var(--vert); }
.m-prix { margin: 8px 0 0; font: 13px/1.35 var(--titre); color: var(--sepia); }
.m-prix span { display: inline-block; margin-right: 6px; padding: 1px 8px; background: var(--encre); color: #f3d58a; font-weight: 600; border-radius: 10px; }
.pas-carte { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 8px 14px; border: 1px dashed var(--sepia); }
.pas-num { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 1.5px solid var(--encre); background: #fbf5e4; display: flex; align-items: center; justify-content: center; font: 600 20px var(--titre); color: var(--encre); line-height: 1; }
.pas-num small { font-size: 11px; color: var(--sepia); }
.pas-but { margin: 2px 0 6px; font: 16px/1.3 var(--titre); color: var(--encre); }
.pas-points { display: flex; gap: 6px; }
.pas-points i { width: 22px; height: 5px; background: #d9c8a2; }
.pas-points i.fait { background: var(--vert); }
.pas-points i.ici { background: var(--vin); }
@media (prefers-reduced-motion: reduce) { .mission.presque .m-sceau svg { animation: none; } }
/* 0.16.0 : profondeurs en chantiers parallèles */
.p-file.attend { stroke-dasharray: 4 3; opacity: .7; }
.p-num { font: italic 600 12px var(--titre); fill: #2a1a0c; paint-order: stroke; stroke: #e8d6ac; stroke-width: 3px; }
.p-trouve { font-size: 15px; fill: #7a4a10; paint-order: stroke; stroke: #f1e6c9; stroke-width: 3px; }
/* 0.16.0 : réserves visibles dans les chambres */
.reserve { stroke: var(--encre); stroke-width: .7; opacity: .95; }
.reserve-etable { fill-opacity: .8; }
.feuille-st { fill: #9fb46e; stroke: #3b5a2a; stroke-width: .6; }
.feuille-st.f2 { fill: #c9b86a; }
.miel-reflet { fill: #fbe7a8; opacity: .8; }
/* 0.16.1 : étable plus belle, pucerons animés (demande de Yan) */
.reserve-etable { fill-opacity: 1; stroke: #7a4a10; stroke-width: .6; }
.miel-goutte { fill: #f2c95e; stroke: #8a5410; stroke-width: .5; }
.miel-reflet { fill: #fff6d6; opacity: .9; }
.radicelle { fill: none; stroke: #8a6a3a; stroke-width: 1.6; stroke-linecap: round; }
.puceron { animation: none; }
.puc-in { transform-box: fill-box; transform-origin: 70% 50%; animation: puc-respire 2.8s ease-in-out infinite; }
.puc-in.p1 { animation-delay: -.7s; } .puc-in.p2 { animation-delay: -1.4s; animation-duration: 3.4s; } .puc-in.p3 { animation-delay: -2.1s; animation-duration: 2.2s; }
@keyframes puc-respire { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(1.06, .95) rotate(-4deg); } 70% { transform: scale(.98, 1.03) rotate(3deg); } }
.puc-corps { stroke: #3b5a2a; stroke-width: .7; }
.puc-seg { fill: none; stroke: #4f6e2c; stroke-width: .45; opacity: .7; }
.puc-tete { fill: #8fae58; stroke: #3b5a2a; stroke-width: .6; }
.puc-oeil { fill: #5a1a10; }
.puc-pattes, .puc-cornicules { fill: none; stroke: #3b5a2a; stroke-width: .8; stroke-linecap: round; }
.puc-antennes { fill: none; stroke: #3b5a2a; stroke-width: .6; stroke-linecap: round; transform-box: fill-box; transform-origin: 0 50%; animation: puc-antenne 1.9s ease-in-out infinite alternate; }
@keyframes puc-antenne { to { transform: rotate(-12deg); } }
.puc-miel { fill: #f2c95e; stroke: #8a5410; stroke-width: .4; transform-box: fill-box; transform-origin: center; animation: puc-perle 4s ease-in infinite; }
@keyframes puc-perle { 0%, 55% { transform: scale(0); opacity: 0; } 75% { transform: scale(1); opacity: 1; } 100% { transform: translate(-3px, 4px) scale(1.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .puc-in, .puc-antennes, .puc-miel { animation: none; } }
/* 0.17.0 : le couvain rangé par âge, des cocons qui éclosent */
.oeuf.o2 { fill: #fffaf0; }
.larve-g .larve { fill: #fbf3df; }
.larve-trait { fill: none; stroke: var(--encre); stroke-width: .45; opacity: .6; }
.larve-g { transform-box: fill-box; transform-origin: center bottom; animation: larve-gigote 2.6s ease-in-out infinite; }
.larve-g.l2 { animation-delay: -1.3s; }
@keyframes larve-gigote { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.cocon { fill: #e6d3a6; stroke: var(--encre); stroke-width: .6; }
.cocon.moitie { transform-box: fill-box; transform-origin: center; animation: cocon-gauche 1.5s ease-out forwards; }
.cocon.md { animation-name: cocon-droite; }
@keyframes cocon-gauche { from { transform: none; opacity: 1; } to { transform: translate(-7px, 4px) rotate(-50deg); opacity: 0; } }
@keyframes cocon-droite { from { transform: none; opacity: 1; } to { transform: translate(7px, 4px) rotate(50deg); opacity: 0; } }
.porteuse-oeuf { fill: #fbf5e4; stroke: var(--encre); stroke-width: .6; }
@media (prefers-reduced-motion: reduce) { .larve-g, .cocon.moitie { animation: none; } }
/* 0.17.0 : le grand compteur de l'empire */
.empire .emp-total { font: 600 40px var(--titre); fill: var(--encre); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.empire .emp-total-l { font: 11px var(--titre); letter-spacing: .26em; fill: var(--sepia); }
/* 0.17.0 : le visualiseur de combat */
.cb-voile { position: fixed; inset: 0; z-index: 60; background: rgba(20, 14, 8, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cb-voile[hidden] { display: none; }
.cb-cadre { position: relative; width: min(980px, 100%); background: #efe3c4; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.cb-svg { display: block; width: 100%; height: auto; }
.cb-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--encre); background: #fbf5e4; color: var(--encre); font-size: 18px; cursor: pointer; }
.cb-titre { font: italic 24px var(--titre); fill: var(--encre); }
.cb-sous { font: 12px var(--titre); letter-spacing: .14em; fill: var(--sepia); }
.cb-pattes, .cb-antenne, .cb-mand { fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.cb-antenne { stroke-width: .9; }
.cb-mand { stroke-width: 1.6; }
.cb-tombee { filter: grayscale(.7); }
.cb-acide { fill: none; stroke: #e8e2a0; stroke-width: 2.4; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .95; animation: cb-gicle .7s linear forwards; }
@keyframes cb-gicle { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
.cb-eclabousse { fill: rgba(232, 226, 160, .55); stroke: #c9c27a; stroke-width: .8; }
.cb-poussiere { fill: #a08a5a; }
.cb-caillou { transition: transform 1.2s ease-in, opacity 1.2s ease-in; transform-box: fill-box; transform-origin: center; }
.cb-caillou.roule { transform: translate(40px, 30px) rotate(140deg); opacity: 0; }
.cb-aile { fill: rgba(255, 255, 255, .55); stroke: #6a6a6a; stroke-width: .6; }
.cb-monstre.vaincu { opacity: .75; filter: grayscale(.6); }
.cb-banniere rect { fill: #fbf5e4; stroke: var(--encre); stroke-width: 1.4; }
.cb-banniere.ok rect { stroke: #8a6a1a; }
.cb-banniere.ko rect { stroke: #8a2a1a; }
.cb-ban-t { font: italic 22px var(--titre); fill: var(--encre); }
.cb-suite { font: italic 12px var(--titre); fill: var(--sepia); letter-spacing: .04em; }
.cb-banniere { animation: cb-ban .6s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes cb-ban { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
body.cb-ouvert { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .cb-acide, .cb-banniere { animation: none; } .cb-caillou { transition: none; } }
/* 0.17.1 : grands ouvrages en cartes illustrées */
.ov-carte { border: 1px solid #b8a27a; border-radius: 6px; background: #fbf5e4; padding: 12px 14px; margin: 10px 0; display: grid; gap: 8px; }
.ov-carte.ici { border: 2px solid var(--or, #c99a2e); background: #fdf3d6; }
.ov-carte.ferme { opacity: .6; }
.ov-tete { display: flex; gap: 12px; align-items: center; }
.ov-ico { width: 54px; height: 45px; flex: none; }
.ov-plein { fill: #e6d3a6; stroke: var(--encre); stroke-width: 1.2; }
.ov-trait { fill: none; stroke: var(--encre); stroke-width: 1; stroke-linecap: round; }
.ov-sol { fill: none; stroke: var(--encre); stroke-width: 1.4; }
.ov-point { fill: #c08a2c; stroke: var(--encre); stroke-width: .6; }
.ov-nom { display: grid; gap: 2px; }
.ov-nom b { font: italic 19px var(--titre); }
.ov-gloire { font: 12px var(--titre); letter-spacing: .12em; color: #8a6a1a; text-transform: uppercase; }
.ov-bonus { margin: 0; padding: 6px 10px; border-left: 3px solid #6f8f4a; background: rgba(111, 143, 74, .1); font-weight: 600; color: #34501f; }
.ov-texte { margin: 0; font-size: 14px; font-style: italic; color: var(--sepia); }
.ov-res { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-pastille { border: 1px solid #b8a27a; border-radius: 999px; padding: 3px 10px; font-size: 14px; background: #f3e8cc; }
.ov-pastille.ok { border-color: #6f8f4a; background: rgba(111, 143, 74, .15); }
.ov-pret { margin: 0; font-size: 14px; }
.ov-pret.oui { color: #34501f; font-weight: 600; }
.ov-pret.bientot { color: #8a6a1a; }
.ov-pret.non { color: var(--sepia); }
.ov-go { justify-self: start; padding: 8px 22px; font: italic 17px var(--titre); }
.ov-avance { display: flex; align-items: center; gap: 10px; }
.ov-avance progress { flex: 1; }
.ov-pc { font: 600 22px var(--titre); }
.ov-et { margin: 14px 0 4px; font: 12px var(--titre); letter-spacing: .2em; text-transform: uppercase; color: var(--sepia); }
.ov-bats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ov-bats li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dotted #b8a27a; }
.ov-bats li .ov-ico { width: 36px; height: 30px; }
.ov-bats li div { display: grid; flex: 1; font-size: 13px; }
.ov-bats li b { font: italic 15px var(--titre); }
.ov-bats li small { color: var(--sepia); }
/* 0.18.0 : L'armée */
.vues [data-vue="armee"] .v-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 5-3 8-7 10-4-2-7-5-7-10V6z'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E"); }
#v-armee { background: #efe3c4; color: var(--encre); }
.ar-planche { padding: 22px 26px 26px; font-family: var(--titre); }
.ar-titre { margin: 0; text-align: center; font: italic 28px var(--titre); }
.ar-total { margin: 8px 0 0; text-align: center; display: grid; gap: 2px; }
.ar-total b { font: 600 46px var(--titre); line-height: 1; font-variant-numeric: tabular-nums; }
.ar-total span { font-size: 11px; letter-spacing: .26em; color: var(--sepia); }
.ar-repart { max-width: 520px; margin: 10px auto 0; }
.ar-barre { display: flex; height: 10px; border: 1px solid var(--sepia); border-radius: 6px; overflow: hidden; background: rgba(0,0,0,.04); }
.ar-barre i { display: block; height: 100%; }
.ar-repart ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; font-size: 14px; }
.ar-repart li { display: flex; align-items: center; gap: 5px; }
.ar-repart li i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ar-repart li b { font-variant-numeric: tabular-nums; }
.ar-barre .ar-mandibule, .ar-repart li.ar-mandibule i { background: #5a2a14; }
.ar-barre .ar-acide, .ar-repart li.ar-acide i { background: #7a5a1a; }
.ar-barre .ar-piege, .ar-repart li.ar-piege i { background: #3a2a3a; }
.ar-barre .ar-kamikaze, .ar-repart li.ar-kamikaze i { background: #e2b62a; }
/* 0.27.0 : renforts des nids en Guerre, rouge hachuré, un trait clair entre deux nids */
.ar-barre .ar-renfort, .ar-repart li.ar-renfort i { background: repeating-linear-gradient(135deg, #a8321e 0 3px, #c8583a 3px 6px); }
.ar-barre .ar-renfort + .ar-renfort { border-left: 1px solid #efe3c4; }
.ar-sans-renfort { margin: 6px 0 0; text-align: center; }
.ar-force { text-align: center; margin: 10px 0 0; font-style: italic; }
.ar-cap { color: var(--sepia); text-align: center; margin: 4px 0 12px; }
.ar-recrue { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 14px; }
.ar-chip { border: 1px solid #b8a27a; border-radius: 999px; background: #fbf5e4; color: var(--encre); padding: 4px 12px; font: italic 14px var(--titre); cursor: pointer; }
.ar-chip.on { background: var(--encre); color: #fbf5e4; border-color: var(--encre); }
.ar-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ar-reg { border: 1px solid #b8a27a; border-radius: 6px; background: #fbf5e4; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.ar-tete { display: flex; gap: 10px; align-items: center; }
.ar-tete > div { display: grid; flex: 1; }
.ar-tete h3 { margin: 0; font: italic 19px var(--titre); }
.ar-court { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--sepia); }
.ar-niv { color: #b8862a; letter-spacing: .1em; } .ar-niv i { font-style: normal; color: #d8c8a0; }
.ar-n { font: 600 30px var(--titre); font-variant-numeric: tabular-nums; }
#v-armee .ar-portrait { width: 104px; height: 56px; flex: none; }
#v-armee .ar-rangs { width: 100%; height: auto; }
.ar-corps { stroke: var(--encre); stroke-width: 1; }
.ar-patte, .ar-antenne, .ar-trait, .ar-mand, .ar-dent, .ar-mini-patte { fill: none; stroke: var(--encre); stroke-linecap: round; stroke-linejoin: round; }
.ar-patte { stroke-width: 1.4; } .ar-antenne { stroke-width: .9; } .ar-trait { stroke-width: .7; opacity: .6; }
.ar-mand { stroke-width: 2; } .ar-mand.gros { stroke-width: 3.2; } .ar-mand.long { stroke-width: 2; } .ar-dent { stroke-width: 1.6; }
.ar-reflet { fill: #fff6c8; opacity: .7; }
.ar-jet { fill: none; stroke: #c9c27a; stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.ar-goutte { fill: #e8e2a0; stroke: #a8a05a; stroke-width: .6; }
.ar-mini-patte { stroke-width: .7; }
.ar-texte { margin: 0; font-size: 14px; font-style: italic; color: var(--sepia); }
.ar-mult { margin: 0; font-size: 13px; }
.ar-rangs { width: 100%; height: auto; display: block; }
.ar-actions { display: grid; gap: 6px; }
.ar-ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ar-actions button:not(.lien) { border: none; border-radius: 4px; background: var(--encre); color: #fbf5e4; padding: 6px 12px; font: italic 15px var(--titre); cursor: pointer; display: grid; text-align: left; }
.ar-actions button small { font: 12px var(--titre); font-style: normal; opacity: .85; }
.ar-actions button.ar-form { background: #6a4a2a; }
.ar-actions button:disabled { opacity: .4; cursor: default; }
.ar-actions .lien { background: none; border: none; color: var(--vin); text-decoration: underline; font: italic 14px var(--titre); cursor: pointer; }
.ar-max { font-style: italic; color: #8a6a1a; }
.ar-pied { margin: 14px 0 0; text-align: center; }
@media (max-width: 640px) { .ar-planche { padding: 16px 12px 20px; } .ar-grille { grid-template-columns: 1fr; } .ar-total b { font-size: 40px; } }
.cb-boum { fill: rgba(240, 200, 60, .55); stroke: #c99a1a; stroke-width: 1.5; }
.cb-venin { fill: #e2b62a; }
/* 0.18.0 : la reine régnante, au-dessus de la bibliothèque */
.reine-regnante { background: #efe3c4; color: var(--encre); padding: 16px 22px 14px; border-bottom: 1px dotted #b8a27a; }
.rn-carte { max-width: 900px; margin: 0 auto; display: grid; gap: 12px; }
.rn-tete { display: flex; align-items: center; gap: 16px; }
#v-lignee .rn-portrait { width: 92px; height: 115px; flex: none; }
.rn-corps { stroke: var(--encre); stroke-width: 1.2; }
.rn-patte { fill: none; stroke: var(--encre); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rn-anneau { fill: none; stroke: #c9a46a; stroke-width: 1; opacity: .7; }
.rn-reflet { fill: #fff; opacity: .16; }
.rn-moignon { stroke: #c9a46a; stroke-width: 2.2; stroke-linecap: round; }
.rn-mand { fill: none; stroke: var(--encre); stroke-width: 2; stroke-linecap: round; }
.rn-couronne { fill: #d9a73a; stroke: #6e4a10; stroke-width: 1; stroke-linejoin: round; }
.rn-perle { fill: #fbf5e4; stroke: #6e4a10; stroke-width: .6; }
.rn-id h3.grand { margin: 2px 0 4px; }
.rn-rang { margin: 0; font-style: italic; color: var(--vin); }
.rn-id .doux { margin: 4px 0 0; }
.rn-bloc .et { display: block; margin-bottom: 6px; }
#v-lignee .rn-frise { width: 100%; max-width: 420px; height: auto; display: block; }
.rn-case { fill: #fbf5e4; stroke: var(--encre); stroke-width: .8; }
.rn-plein { fill: #d9a73a; }
.rn-an { font: italic 9px var(--titre); fill: var(--sepia); }
.rn-lignee { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.rn-lignee li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; position: relative; }
.rn-lignee li + li::before { content: '›'; position: absolute; left: -13px; top: 4px; color: var(--sepia); }
.rn-med { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #d9c296; border: 1.5px solid var(--encre); font: italic 16px var(--titre); }
.rn-lignee li.ici .rn-med { background: #d9a73a; box-shadow: 0 0 0 3px #efe3c4, 0 0 0 4px #6e4a10; }
.rn-lignee b { font: italic 14px var(--titre); }
.rn-lignee small { color: var(--sepia); font-size: 12px; }
.rn-genes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rn-gene { border: 1px solid var(--encre); border-radius: 3px; background: #fbf5e4; padding: 8px 10px; display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; align-items: center; }
.rn-gene.rare { border-color: #b98a2a; box-shadow: inset 0 0 0 2px #f1dca0; }
.rn-gene .rn-ico { grid-row: span 2; width: 28px; height: 28px; fill: #7a5a30; stroke: var(--encre); stroke-width: .8; }
.rn-gene.rare .rn-ico { fill: #d9a73a; }
.rn-ico .rn-trait { fill: none; stroke: var(--encre); stroke-width: 1.6; stroke-linecap: round; }
.rn-ico .rn-clair { fill: none; stroke: #fbf5e4; stroke-width: 1.2; }
.rn-gene b { font: italic 14px var(--titre); }
.rn-pts { color: var(--vin); font-size: 10px; letter-spacing: 2px; }
.rn-pts i { color: #d9c296; font-style: normal; }
.rn-gene small { grid-column: 1 / -1; color: var(--sepia); font-size: 12px; margin-top: 4px; }
.rn-gene.vide { border-style: dashed; background: transparent; display: block; }
.rn-gene.vide small { margin: 0; }
@media (max-width: 640px) { .reine-regnante { padding: 14px 16px 12px; } #v-lignee .rn-portrait { width: 72px; height: 90px; } .rn-genes { grid-template-columns: 1fr 1fr; } }
.reine-regnante, .reine-regnante small { font-family: var(--titre); }
.rn-id h3.grand { font: italic 26px var(--titre); color: var(--encre); }
.reine-regnante .doux { color: var(--sepia); }
.reine-regnante .et { color: var(--sepia); }
#v-armee .doux { color: var(--sepia); }
/* 0.18.0 : jauges de vie et barre d'action du combat */
.cb-j-lab { font: italic 13px var(--titre); fill: var(--encre); }
.cb-j-n { font: 11px var(--titre); fill: var(--sepia); letter-spacing: .04em; }
.cb-j-fond { fill: #fbf5e4; stroke: var(--encre); stroke-width: .8; }
.cb-j-nous .cb-j-vie { fill: #4f7a3a; }
.cb-j-eux .cb-j-vie { fill: var(--vin); }
.cb-j-vie.bas { opacity: .75; }
.cb-barre { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px 10px; }
.cb-barre:empty { display: none; }
/* 0.18.0 : chambre au niveau maximal, une couronne plutôt qu'un texte (Yan) */
.max-couronne { width: 20px; height: 14px; vertical-align: -2px; margin-right: 6px; fill: #d9a73a; stroke: #6e4a10; stroke-width: 1; stroke-linejoin: round; }
.chambres li.ch-max { border-color: #b98a2a; box-shadow: inset 0 0 0 2px #f1dca0; background: linear-gradient(115deg, rgba(241, 220, 160, .35), rgba(251, 245, 228, 0) 45%, rgba(241, 220, 160, .35) 55%, rgba(251, 245, 228, 0)) , #f8efd6; background-size: 300% 100%; animation: ch-lustre 6s ease-in-out infinite; }
.chambres li.ch-max .niv { color: #8a6418; }
.ch-max-sceau { text-align: center; margin: 10px 0 0; }
.ch-max-sceau .max-couronne { width: 44px; height: 30px; margin: 0; filter: drop-shadow(0 1px 0 #6e4a10); }
@keyframes ch-lustre { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .chambres li.ch-max { animation: none; } }
.cb-barre button { font: italic 15px var(--titre); padding: 8px 16px; border: 0; color: #fbf5e4; border-radius: 3px; cursor: pointer; }
/* 0.18.0 : le couvain tapisse la chambre et vit */
.cv-o, .cv-l, .cv-c { transform-box: fill-box; transform-origin: center bottom; }
.cv-l { animation: larve-gigote 2.4s ease-in-out infinite; }
.cv-o { animation: oeuf-luit 3.6s ease-in-out infinite; }
.cv-c { animation: cocon-berce 4.8s ease-in-out infinite; }
.cv-o.d1, .cv-l.d1, .cv-c.d1 { animation-delay: -0.7s; } .cv-o.d2, .cv-l.d2, .cv-c.d2 { animation-delay: -1.5s; }
.cv-o.d3, .cv-l.d3, .cv-c.d3 { animation-delay: -2.2s; } .cv-o.d4, .cv-l.d4, .cv-c.d4 { animation-delay: -3.1s; }
@keyframes oeuf-luit { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .85; } }
@keyframes cocon-berce { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .cv-o, .cv-l, .cv-c { animation: none; } }
/* 0.18.0 : le dôme du nid se touche pour être renforcé */
.monticule { cursor: pointer; pointer-events: auto; }
.monticule:hover, .monticule:focus-visible { stroke-width: 2; filter: brightness(1.05); outline: none; }
.rempart-deco { pointer-events: none; }
.rempart-brin { stroke: #6a4a26; stroke-width: 1; stroke-linecap: round; }
.rempart-brin.b1 { stroke: #a8804c; } .rempart-brin.b2 { stroke: #3f2a14; }
.rempart-caillou { fill: #b5a68c; stroke: #3b2814; stroke-width: .6; }

/* ---------- 0.19.0 : les profondeurs, « Tout droit » (choix de Yan) ---------- */
.profondeurs { touch-action: pan-y; cursor: default; user-select: none; -webkit-user-select: none; }
.td-gal { stroke-width: 30px; stroke-linecap: round; } .galerie-fond.td-gal { stroke-width: 34px; }
.td-niche { fill: #f4ead0; } .td-niche-fond { fill: #3b2814; }
.td-bord { fill: none; stroke: #5a4630; stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .75; }
.td-pt { fill: #3b2814; opacity: .28; }
.td-compte { font-size: 17px; fill: #f6efdc; stroke: #3b2814; }
.td-coup { fill: rgba(59, 40, 20, .25); stroke: #3b2814; stroke-width: 1.2; }
.td-coup.on { fill: #e2b65a; }
.td-halo { fill: #f6d27a; opacity: .5; transform-box: fill-box; transform-origin: center; animation: td-halo 2.6s ease-in-out infinite; }
@keyframes td-halo { 50% { transform: scale(1.14); opacity: .32; } }
.td-trouvaille, .p-vise, .p-etiq, .p-fourmis, .p-cases { pointer-events: none; }
.td-fleche { fill: none; stroke: #fffaf0; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; paint-order: stroke; filter: drop-shadow(0 0 1.5px #3b2814); animation: td-fleche 1.5s ease-in-out infinite; }
@keyframes td-fleche { 50% { opacity: .45; } }
.td-choix { fill: none; stroke: #f6efdc; stroke-width: 1.6; stroke-dasharray: 3 5; opacity: .6; }
.td-choix.on { stroke: #e2b65a; stroke-width: 2.6; stroke-dasharray: none; opacity: 1; }
.td-main { fill: transparent; touch-action: none; cursor: grab; }
.td-vise-fond { fill: none; stroke: #3b2814; stroke-width: 7; stroke-linecap: round; opacity: .35; }
.td-vise { fill: none; stroke: #fffaf0; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 11; animation: td-vise .5s linear infinite; }
@keyframes td-vise { to { stroke-dashoffset: -13; } }
.td-arret { fill: rgba(255, 250, 240, .25); stroke: #fffaf0; stroke-width: 2.5; }
.td-prise { fill: none; stroke: #e2b65a; stroke-width: 3.5; }
.td-non { fill: none; stroke: #8f2a1c; stroke-width: 4; stroke-linecap: round; }
.td-onde { fill: none; stroke: #f0c14a; stroke-width: 5; transform-box: fill-box; transform-origin: center; animation: td-onde .8s ease-out forwards; }
.td-onde2 { animation-delay: .14s; stroke: #fff3c4; stroke-width: 3; }
@keyframes td-onde { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.3); opacity: 0; } }
.grain-vole.td-or { fill: #e9b23c; stroke: #7a4a10; stroke-width: .4; }
.td-choc-h { animation: td-choc-h .26s ease-out; } .td-choc-v { animation: td-choc-v .26s ease-out; }
@keyframes td-choc-h { 20% { transform: translateX(5px); } 50% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes td-choc-v { 20% { transform: translateY(5px); } 50% { transform: translateY(-4px); } 80% { transform: translateY(2px); } }
.td-fete .galerie { animation: td-fete 1.5s ease-in-out 2; }
@keyframes td-fete { 50% { stroke: #f6d27a; } }
.td-bouton { cursor: pointer; }
.td-bouton rect { fill: #3b2814; stroke: #e2b65a; stroke-width: 1.5; }
.td-bouton text { font: italic 600 18px var(--titre); fill: #f6efdc; }
.td-bouton:hover rect, .td-bouton:focus rect { fill: #5a3d22; }
@media (prefers-reduced-motion: reduce) { .td-halo, .td-fleche, .td-vise, .td-choc-h, .td-choc-v, .td-fete .galerie { animation: none; } }
.profondeurs .td-aide { font-size: 16px; }
.profondeurs .p-grad { font-size: 14px; }
/* 0.21.0 : passer l'hiver */
.td-bouton.second rect { fill: #f4ead0; stroke: #3b2814; }
.td-bouton.second text { fill: #3b2814; }
.td-bouton.second:hover rect, .td-bouton.second:focus rect { fill: #fffaf0; }

/* 0.22.0 (choix de Yan) : « La vague d'odeur », étendre la colonie se voit et se récompense */
.ext-apercu { fill: rgba(106, 74, 138, .1); stroke: #6a4a8a; stroke-width: 2.2; stroke-dasharray: 7 6; stroke-linecap: round; animation: odeur 1.2s linear infinite; }
.ext-apercu.en-cours { fill: none; stroke-width: 1.6; opacity: .75; }
.ext-prix { font: italic 600 15px var(--titre); fill: #4a2f6a; }
.ext-prix.cher { fill: var(--vin); opacity: .8; }
.ext-vague { fill: none; stroke: #fff; stroke-width: 5; stroke-linejoin: round; opacity: 0; animation: extVague 1.25s cubic-bezier(.2, .7, .3, 1) both; }
.ext-vague.v1 { stroke: #8a6ab0; stroke-width: 3.5; animation-delay: .22s; }
.ext-vague.v2 { stroke: #6a4a8a; stroke-width: 2.5; animation-delay: .44s; }
@keyframes extVague { 0% { transform: scale(.2); opacity: 0; } 15% { opacity: .95; } 75% { opacity: .7; } 100% { transform: scale(1); opacity: 0; } }
.ext-plus { font: 700 19px var(--titre); fill: var(--vert); stroke-width: 5px; animation: extPlus 3.1s ease-out both; }
.ext-plus.fin { font-size: 22px; fill: #4a2f6a; animation-duration: 4.1s; }
@keyframes extPlus { 0% { transform: translateY(10px); opacity: 0; } 12% { transform: translateY(-4px); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
.ext-eclat { fill: rgba(155, 179, 90, .55); transform-box: fill-box; transform-origin: center; animation: eclosion 1s ease-out both; }
.ext-fini { fill: none; stroke: #fff; stroke-width: 6; stroke-linejoin: round; animation: extFini 2.4s ease-out both; }
@keyframes extFini { 0% { opacity: 0; stroke-width: 12; } 15% { opacity: 1; } 55% { stroke: #8a6ab0; opacity: .9; } 100% { stroke: #6a4a8a; stroke-width: 2; opacity: 0; } }
.ext-compte { position: absolute; right: 10px; bottom: 10px; z-index: 2; margin: 0; padding: 5px 12px; font: italic 15px var(--titre); color: var(--papier); background: rgba(59, 40, 20, .9); border-left: 4px solid #8a6ab0; border-radius: 2px; pointer-events: none; font-variant-numeric: tabular-nums; }
.ext-compte.monte { color: var(--or); }
@media (max-width: 640px) { .ext-compte { right: 6px; bottom: 6px; font-size: 13.5px; padding: 4px 9px; } }
@media (prefers-reduced-motion: reduce) { .ext-apercu, .ext-vague, .ext-plus, .ext-eclat, .ext-fini { animation: none; } .ext-vague { display: none; } }

/* ---------- 0.26.1 : un écran bien tenu, du petit téléphone à l'ordinateur ----------
   La page ne dépasse jamais la largeur de l'écran (sinon le navigateur du téléphone agrandit sa zone d'affichage
   et les barres du bas sortent de l'écran). La planche prend la hauteur réellement libre (--dispo, mesurée par app.js)
   entre l'en-tête et la barre du bas. --pied-h et --barre-h : hauteurs du pied de page et de la barre des vues. */
html { overflow-x: hidden; overflow-x: clip; }
:root { --pied-h: 40px; --barre-h: 62px; --bas: env(safe-area-inset-bottom, 0px); }
.jeu { grid-template-columns: minmax(0, 1fr); padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--pied-h) + var(--barre-h) + 8px + var(--bas)); }
.hud, .hud-haut, .hud-res, .corps { min-width: 0; }
.hud-son { align-self: center; }
.vues { bottom: calc(var(--pied-h) + var(--bas)); }
.vues button { min-width: 0; white-space: nowrap; }
.pied { min-height: calc(var(--pied-h) + var(--bas)); }
@media (min-width: 641px) {
  .vue svg.paysage, #v-nid svg, #v-colonie svg { max-height: var(--dispo, calc(100vh - 250px)); }
  #v-carte .carte-cadre svg { height: max(300px, calc(var(--dispo, calc(100vh - 250px)) - var(--ci-h, 0px))); }
  .fenetre { bottom: calc(var(--pied-h) + var(--barre-h) + var(--bas)); }
}
@media (max-width: 640px) {
  :root { --pied-h: 52px; --barre-h: 60px; }
  .jeu { padding-top: max(8px, env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--pied-h) + var(--barre-h) + 4px + var(--bas)); }
  /* en-tête : le nom de la reine cède la place en premier, la saison et le bouton du son restent entiers */
  .hud-haut { gap: 8px; }
  .marque { flex: none; }
  .hud-reine { flex: 1 1 auto; }
  .hud-saison { flex: none; }
  .hud-son { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }
  /* réserves : elles se serrent au lieu de pousser la page */
  .hud-res { gap: 4px; font-size: clamp(12px, 3.6vw, 13px); }
  .hud-res li { flex: 0 1 auto; min-width: 0; font-size: inherit; }
  .res-b { min-width: 0; gap: 4px; }
  .res-b b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* barre des vues : cinq libellés entiers, même sur un petit écran */
  .vues button, .vues button.on { font-size: clamp(11px, 3.4vw, 13px); padding: 5px 1px; }
  /* pied de page sur deux lignes : le bouton dé, puis Pyment, la version, ☕ et ✉️ */
  .pied.pp { flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 3px; padding: 4px 8px calc(4px + var(--bas)); font-size: 11.5px; overflow: visible; }
  .pied .pp-de { padding: 1px 12px; font-size: 12.5px; border-width: 1.5px; margin-bottom: 4px; }
  .pied .pp-sig { font-size: 11px; }
  .vue svg.portrait, body.sans-onglets .vue svg.portrait { max-height: var(--dispo, calc(100vh - 246px)); }
  #v-carte .carte-cadre svg { height: max(260px, calc(var(--dispo, calc(100vh - 246px)) - var(--ci-h, 0px))); }
  .fenetre { bottom: calc(var(--pied-h) + var(--barre-h) + var(--bas)); max-height: calc(100vh - var(--pied-h) - var(--barre-h) - 82px); max-height: calc(100dvh - var(--pied-h) - var(--barre-h) - 82px - var(--bas)); }
}
/* écran étroit : la jauge de saison passe sous son texte */
@media (max-width: 400px) {
  .hud-saison { flex-direction: column; align-items: stretch; gap: 3px; }
  .hud-saison progress { width: 100%; height: 5px; }
}
/* écran bas (téléphone couché) : barre des vues sur une ligne, pied de page en bas de la page */
@media (max-height: 520px) {
  :root { --pied-h: 0px; --barre-h: 40px; }
  .jeu { padding-top: max(6px, env(safe-area-inset-top, 0px)); gap: 6px; }
  .hud { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; }
  .hud-haut { flex: 1 1 440px; }
  .hud-res { flex: none; max-width: 100%; gap: 4px 16px; }
  .alpha, #h-age { display: none; }
  .vues { padding-top: 2px; padding-bottom: calc(2px + var(--bas)); }
  .vues button, .vues button.on { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; }
  .v-ico { width: 20px; height: 20px; flex: none; }
  .pied { position: static; z-index: auto; min-height: 0; flex-wrap: wrap; background: none; border-top: none; padding: 8px; overflow: visible; }
}

/* 0.28.0 : les grands travaux de l'empire (greniers communs, niveaux des nids, part des récoltes) */
.empire .emp-gren-t { font: italic 16px var(--titre); fill: var(--encre); }
.empire .emp-gren-n { font: 600 15px var(--titre); fill: var(--encre); font-variant-numeric: tabular-nums; }
.empire .emp-gren-d { font: 12px var(--titre); fill: #3b6a2a; }
.empire .emp-part { font: 600 12px var(--titre); fill: var(--encre); stroke: none; }
.empire .emp-chant { font: italic 13.5px var(--titre); fill: var(--encre); }
.empire .emp-nid .emp-niv { font: 700 10px var(--titre); fill: #fbf5e4; stroke: none; }
.empire .emp-nid .emp-marteau { font-size: 11px; stroke: none; }
.empire .emp-decret .emp-prio { fill: #3b2814; }
.empire .emp-decret:hover rect, .empire .emp-decret:focus-visible rect { stroke-width: 2.2; }

/* ---------- 0.29.0 : interrupteur de langue FR · EN, à côté du bouton du son ----------
   Un seul bouton : la langue du moment en clair, l'autre estompée. Le toucher recharge le jeu dans l'autre langue. */
.hud-langue { flex: none; align-self: center; display: inline-flex; gap: 0; background: none; border: 1px solid var(--trait); border-radius: 8px; color: inherit; font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: .04em; padding: 0; cursor: pointer; overflow: hidden; }
.hud-langue span { padding: 6px 5px; opacity: .45; }
html[lang="fr"] .hud-langue .l-fr, html[lang="en"] .hud-langue .l-en { opacity: 1; background: rgba(255, 255, 255, .12); }
@media (max-width: 640px) { .hud-langue { height: 34px; } .hud-langue span { padding: 0 5px; display: grid; place-items: center; } }

/* 0.31.0 : la phrase qui dit la vitesse du chantier et comment l'accélérer */
.empire .emp-chant3 { font: 12.5px var(--titre); fill: #3b6a2a; }
@media (max-width: 640px) { .empire .emp-chant { font-size: 13px; } }

/* ---------- 0.32.0 : le dernier bastion et le couronnement ---------- */
.bastion-mur { animation: bastion-bat 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bastion-bat { 50% { transform: scale(1.06); } }
.carte-info .bastion-l { display: block; }
.carte-info .bastion-v { display: flex; align-items: center; gap: 6px; }
.bastion-v i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--encre); background: var(--papier2); display: inline-block; }
.bastion-v i.ok { background: #4f7a3a; }
.fin-ouverte { overflow: hidden; }
.fin { position: fixed; inset: 0; z-index: 400; background: rgba(12, 11, 18, .96); overflow-y: auto; -webkit-overflow-scrolling: touch; animation: fin-voile 1.2s ease both; padding: 12px; display: grid; place-items: start center; }
@keyframes fin-voile { from { opacity: 0; } }
.fin-cadre { position: relative; width: min(100%, 920px); margin: auto; }
.fin-scene { display: block; width: auto; max-width: 100%; height: auto; max-height: 58vh; margin: 0 auto; aspect-ratio: 900 / 620; border-radius: 4px; box-shadow: 0 10px 50px rgba(0, 0, 0, .6); animation: fin-planche 1.4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fin-planche { from { opacity: 0; transform: scale(.94); } }
.fin-passer[hidden] { display: none; }
.fin-passer { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(20, 19, 28, .78); color: var(--texte); border: 1px solid var(--trait); border-radius: 20px; padding: 6px 14px; font: 14px var(--corps); cursor: pointer; }
.fin-rayons { opacity: 0; animation: fin-tourne 60s linear infinite; transition: opacity 2.5s ease; }
.fin-acte2 .fin-rayons, .fin-finie .fin-rayons { opacity: 1; }
@keyframes fin-tourne { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.fin-gastre { transform-box: fill-box; transform-origin: 50% 0; animation: fin-souffle 3.2s ease-in-out infinite; }
@keyframes fin-souffle { 50% { transform: scale(1.035, 1.02); } }
.fin-tete { transform-box: fill-box; transform-origin: 50% 100%; animation: fin-salue 5s ease-in-out infinite; }
@keyframes fin-salue { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.fin-couronne { animation: fin-pose 2.4s cubic-bezier(.3, 1.3, .5, 1) 2s both; }
@keyframes fin-pose { from { transform: translateY(-330px) rotate(-14deg); opacity: 0; } 20% { opacity: 1; } }
.fin-fanion { transform-box: fill-box; transform-origin: 0 100%; animation: fin-plante .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes fin-plante { from { transform: scaleY(0); opacity: 0; } }
.fin-nom-nid { font: italic 15px var(--titre); fill: var(--encre); paint-order: stroke; stroke: #f1e6c9; stroke-width: 4px; stroke-linejoin: round; }
.fin-envol { animation: fin-monte 9s ease-in both; opacity: 0; }
@keyframes fin-monte { 0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translate(60px, -760px); opacity: 1; } }
.fin-or { opacity: 0; animation: fin-pluie 6s linear infinite; }
@keyframes fin-pluie { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(660px); opacity: 0; } }
.fin-texte { text-align: center; color: var(--texte); padding: 14px 6px 30px; font-family: var(--titre); }
.fin-sur, .fin-titre, .fin-sous { opacity: 0; transform: translateY(10px); transition: opacity 1.2s ease, transform 1.2s ease; }
.fin-acte2 .fin-sur, .fin-acte2 .fin-titre, .fin-acte2 .fin-sous, .fin-finie .fin-sur, .fin-finie .fin-titre, .fin-finie .fin-sous { opacity: 1; transform: none; }
.fin-sur { margin: 0; font: 600 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--doux); }
.fin-titre { margin: 4px 0 0; font: italic 44px/1.1 var(--titre); color: var(--or); transition-delay: .3s; }
.fin-sous { margin: 2px 0 14px; font: italic 20px var(--titre); transition-delay: .6s; }
.fin-bilan { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.fin-bilan li { border: 1px solid var(--trait); background: var(--nuit2); border-radius: 8px; padding: 7px 12px; min-width: 96px; display: grid; opacity: 0; }
.fin-acte2 .fin-bilan li, .fin-finie .fin-bilan li { animation: fin-ligne .6s ease both; }
.fin-finie .fin-bilan li { animation-delay: 0s !important; }
@keyframes fin-ligne { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fin-bilan b { font: 600 22px var(--titre); color: var(--or); font-variant-numeric: tabular-nums; }
.fin-bilan span { font: 13px var(--corps); color: var(--doux); }
.fin-suite { opacity: 0; visibility: hidden; transition: opacity 1s ease; margin-top: 18px; }
.fin-finie .fin-suite { opacity: 1; visibility: visible; }
.fin-et { margin: 0 0 10px; font: italic 19px var(--titre); }
.fin-boutons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fin-b { flex: 1 1 250px; max-width: 340px; display: grid; gap: 2px; padding: 12px 16px; border-radius: 10px; border: 1.5px solid var(--or); background: var(--nuit2); color: var(--texte); cursor: pointer; font-family: var(--titre); }
.fin-b b { font: 600 19px var(--titre); color: var(--or); }
.fin-b small { font: 13px var(--corps); color: var(--doux); }
.fin-jardin { background: var(--or); }
.fin-jardin b, .fin-jardin small { color: var(--sur-or); }
.fin-b:hover { filter: brightness(1.1); }
.fin-conf[hidden], .fin-suite[hidden] { display: none; }
.fin-conf { margin-top: 18px; }
.fin-dit { max-width: 620px; margin: 0 auto 10px; font: 16px/1.45 var(--corps); color: var(--texte); }
.fin-gras { color: var(--or); font-weight: 600; }
.fin-regner { margin-top: 14px; background: none; border: 0; color: var(--doux); text-decoration: underline; font: 15px var(--corps); cursor: pointer; padding: 8px; }
.fin-calme *, .fin-calme { animation: none !important; transition: none !important; }
.fin-calme .fin-rayons, .fin-calme .fin-bilan li { opacity: 1; }
@media (max-width: 640px) { .fin { padding: 6px; } .fin-titre { font-size: 32px; } .fin-sous { font-size: 17px; } .fin-bilan li { min-width: 84px; padding: 6px 8px; } .fin-bilan b { font-size: 19px; } }
/* 0.33.0 : « 🌱 Fondation » en tête ouvre la fenêtre de la fondation (plus de rangée d'onglets sous la planche) */
button.hud-saison { background: none; border: none; color: inherit; padding: 0; text-align: inherit; }
button.hud-saison:not(:disabled) { cursor: pointer; }
button.hud-saison:not(:disabled) #h-saison { text-decoration: underline dotted; text-underline-offset: 4px; }
button.hud-saison:disabled { opacity: 1; cursor: default; }
/* 0.35.0 : les routes de l'empire */
.route-fond { fill: none; stroke: #b89a62; stroke-width: 8; stroke-linecap: round; opacity: .32; }
.route-fond.prio { stroke: #d9a520; stroke-width: 10; opacity: .45; }
.route-fond.ferme { opacity: .12; }
.route-e { stroke-width: 1.6; }
.route-e.prio { stroke: #b07a10; stroke-width: 2.4; }
.route-e.ferme { opacity: .45; animation: none; }
.route-hit { fill: none; stroke: transparent; stroke-width: 22; pointer-events: stroke; cursor: pointer; }
.route-hit:focus-visible { stroke: rgba(176, 122, 16, .35); outline: none; }
.tas-fond { fill: #f6efdc; stroke: #5b4a30; stroke-width: .6; opacity: .9; }
.nid-manque { fill: none; stroke: #b33a2a; stroke-width: 3; animation: nid-manque 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes nid-manque { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nid-manque { animation: none; } }
.garde-nid { display: flex; gap: 4px; flex-wrap: wrap; }
.garde-nid button { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 13px; }
.garde-nid button.on { background: var(--or); color: #1a1410; border-color: var(--or); }
