/* =============================================================
   CHRONOLEGENDS — Style
   Direction : musée nocturne. Fond encre, or patiné, parchemin.
   ============================================================= */

:root {
  --encre: #101320;
  --encre-2: #181c2e;
  --encre-3: #232842;
  --or: #d4b26a;
  --or-clair: #f1dc9f;
  --or-sombre: #8a6a2c;
  --parchemin: #f4ecdb;
  --parchemin-2: #e7dcc2;
  --texte-carte: #2a2418;
  --texte: #e9e3d3;
  --texte-doux: #a9a391;
  --serif-titre: "Cinzel", "Times New Roman", serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, #2a3050 0%, transparent 60%),
    radial-gradient(ellipse at 50% 120%, #1d1a2a 0%, transparent 55%),
    var(--encre);
  background-attachment: fixed;
  color: var(--texte);
  font-family: var(--serif);
  font-size: 18px;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- En-tête ---------- */

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(212, 178, 106, .18);
}

.marque { display: flex; flex-direction: column; line-height: 1.1; }
.marque-titre {
  font-family: var(--serif-titre);
  font-weight: 700;
  font-size: clamp(20px, 5.2vw, 26px);
  letter-spacing: .12em;
  white-space: nowrap;
  background: linear-gradient(180deg, var(--or-clair), var(--or) 55%, var(--or-sombre));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.marque-sous { font-style: italic; color: var(--texte-doux); font-size: 15px; }

.onglets { display: flex; gap: 4px; background: var(--encre-2); padding: 4px; border-radius: 999px; border: 1px solid rgba(212, 178, 106, .2); }
.onglet {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--serif-titre);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--texte-doux);
  transition: background .2s, color .2s;
}
.onglet.actif { background: linear-gradient(180deg, #e3c682, #b18d45); color: var(--encre); }
.onglet span { opacity: .75; font-size: 12px; }

.region-joueur { margin: -12px 0 0; font-family: var(--serif-titre); font-size: 12px; letter-spacing: .08em; color: var(--or); text-align: center; }
.region-joueur:empty { display: none; }
.anti-robot { min-height: 65px; display: flex; justify-content: center; }
.verrou-region { margin: -14px 0 0; max-width: 34ch; text-align: center; font-size: 15px; font-style: italic; color: var(--texte-doux); }

@media (max-width: 640px) {
  .entete { justify-content: center; text-align: center; }
  .marque { align-items: center; width: 100%; }
}

main { flex: 1; padding: clamp(20px, 4vw, 48px) 16px; }

/* ---------- Booster scellé ---------- */

.langues { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--encre-2); border: 1px solid rgba(212, 178, 106, .2); }
.langues button {
  border: 0; background: transparent; padding: 5px 10px; border-radius: 999px;
  font-family: var(--serif-titre); font-size: 12px; letter-spacing: .08em; color: var(--texte-doux);
}
.langues button.actif { background: var(--encre-3); color: var(--or-clair); }

.epoques { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 22px; }
.epoque {
  border: 1px solid rgba(212, 178, 106, .35);
  background: var(--encre-2);
  padding: 7px 16px;
  border-radius: 999px;
  font-family: var(--serif-titre);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--texte-doux);
  transition: background .2s, color .2s;
}
.epoque:hover { color: var(--texte); }
.epoque.actif { background: linear-gradient(180deg, #e3c682, #b18d45); color: var(--encre); border-color: transparent; }
.epoque span { font-family: var(--serif); font-style: italic; font-size: 13px; letter-spacing: 0; opacity: .7; }

.zone-booster { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 2vh; }

.booster {
  position: relative;
  width: min(62vw, 250px);
  aspect-ratio: 63 / 98;
  border: 0;
  border-radius: 14px;
  padding: 0;
  background:
    repeating-linear-gradient(45deg, rgba(212, 178, 106, .05) 0 2px, transparent 2px 12px),
    linear-gradient(160deg, #283055 0%, #151a33 55%, #0d1022 100%);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(212, 178, 106, .4) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .3s ease, box-shadow .3s ease;
  animation: flotter 4s ease-in-out infinite;
}
.booster:hover:not(:disabled) { transform: translateY(-6px) scale(1.02); box-shadow: 0 40px 70px -20px rgba(0, 0, 0, .9), 0 0 40px rgba(212, 178, 106, .25), 0 0 0 1px rgba(212, 178, 106, .6) inset; }
.booster:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; animation: none; }

.booster-bord { position: absolute; inset: 10px; border: 1px solid rgba(212, 178, 106, .55); border-radius: 8px; pointer-events: none; }
.booster-bord::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(212, 178, 106, .25); border-radius: 5px; }
.booster-titre { font-family: var(--serif-titre); font-weight: 700; font-size: 16px; letter-spacing: .12em; color: var(--or-clair); text-align: center; }
.booster-ext { font-style: italic; font-size: 18px; color: var(--or); }
.booster-sceau {
  margin: 14px 0;
  width: 68px; height: 68px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif-titre); font-weight: 700; font-size: 30px;
  color: #f3c7b5;
  background: radial-gradient(circle at 35% 30%, #c0463a, #7d1d1a 70%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5), inset 0 -3px 6px rgba(0, 0, 0, .35), inset 0 2px 3px rgba(255, 255, 255, .2);
}
.booster-info { font-family: var(--serif-titre); font-size: 11px; letter-spacing: .3em; color: var(--texte-doux); text-transform: uppercase; }

.booster.ouverture { animation: secouer .55s ease-in-out, eclater .35s .55s ease-in forwards; }

@keyframes flotter { 50% { transform: translateY(-8px); } }
@keyframes secouer {
  20% { transform: rotate(-4deg) scale(1.03); }
  40% { transform: rotate(4deg) scale(1.05); }
  60% { transform: rotate(-3deg) scale(1.06); }
  80% { transform: rotate(2deg) scale(1.07); }
}
@keyframes eclater { to { transform: scale(1.3); opacity: 0; filter: brightness(2.5); } }

.consigne { font-style: italic; color: var(--texte-doux); text-align: center; margin: 0; max-width: 32ch; }

.slogan {
  font-family: var(--serif-titre);
  font-style: italic;
  letter-spacing: .08em;
  text-align: center;
  margin: 6px 0 0;
  background: linear-gradient(180deg, var(--or-clair), var(--or) 60%, var(--or-sombre));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Tirage ---------- */

.tirage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
  max-width: 1200px;
  margin: 0 auto;
  perspective: 1400px;
}

.emplacement {
  position: relative;
  width: min(43vw, 210px);
  aspect-ratio: 63 / 88;
  padding: 0;
  border: 0;
  background: none;
  container-type: inline-size;
  animation: distribuer .5s cubic-bezier(.2, .8, .3, 1.2) both;
}
@keyframes distribuer { from { opacity: 0; transform: translateY(-60px) scale(.6) rotate(-8deg); } }

.emplacement-interieur {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.3, .7, .2, 1);
}
.emplacement.revelee .emplacement-interieur { transform: rotateY(180deg); }
.emplacement:not(.revelee):hover .emplacement-interieur { transform: translateY(-6px); }

.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face-avant { transform: rotateY(180deg); }

/* Halo à la révélation selon la rareté */
.emplacement.revelee.rarete-epique .face-avant { animation: halo-epique 1.4s .4s ease-out; }
.emplacement.revelee.rarete-legendaire .face-avant { animation: halo-legendaire 1.8s .4s ease-out; }
.emplacement.revelee.rarete-mythique .face-avant { animation: halo-mythique 2.2s .4s ease-out; }
@keyframes halo-epique { 0% { filter: drop-shadow(0 0 0 transparent); } 30% { filter: drop-shadow(0 0 26px #b07de0); } }
@keyframes halo-legendaire { 0% { filter: drop-shadow(0 0 0 transparent); } 30% { filter: drop-shadow(0 0 40px #ffd772) brightness(1.15); } }
@keyframes halo-mythique { 0% { filter: drop-shadow(0 0 0 transparent); } 30% { filter: drop-shadow(0 0 52px #ff5fb0) brightness(1.2); } }

.nouvelle {
  position: absolute; top: -8px; right: -6px; z-index: 2;
  font-family: var(--serif-titre); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(180deg, #e3c682, #b18d45); color: var(--encre);
  padding: 4px 8px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
  animation: apparaitre .4s .6s both;
}
@keyframes apparaitre { from { opacity: 0; transform: scale(.5); } }

/* ---------- Pile de cartes (ouverture type Pokémon) ---------- */

.tirage.pile {
  position: relative;
  width: min(74vw, 300px);
  aspect-ratio: 63 / 88;
  margin: 8px auto 0;
  perspective: 1400px;
  flex-wrap: nowrap;
}

/* Chaque carte occupe toute la pile ; les cartes du dessous sont décalées. */
.tirage.pile .emplacement {
  position: absolute;
  inset: 0;
  width: 100%;
  animation: none;
  transform:
    translate(calc(var(--profondeur, 0) * 5px), calc(var(--profondeur, 0) * 9px))
    scale(calc(1 - var(--profondeur, 0) * 0.035));
  transition: transform .45s cubic-bezier(.3, .7, .2, 1);
}

/* Sur smartphone, la pile laisse défiler la page verticalement, mais le
   glissement horizontal sert à écarter la carte (voir activerGlissement dans app.js). */
.tirage.pile .emplacement { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.tirage.pile .emplacement.glisse { transition: none; }

/* Appui simple sur une carte déjà révélée (smartphone) : petit frémissement
   qui invite à la faire glisser. */
.tirage.pile .emplacement.fremit { animation: fremir .5s ease; }
@keyframes fremir {
  25% { translate: 14px 0; rotate: 2deg; }
  55% { translate: -8px 0; rotate: -1deg; }
  80% { translate: 4px 0; rotate: 0deg; }
}

/* La carte révélée que l'on écarte : elle s'envole sur le côté (droite par
   défaut, ou du côté où on l'a fait glisser : --sens = -1 ou 1) et disparaît. */
.tirage.pile .emplacement.ecartee {
  transform: translateX(calc(var(--sens, 1) * 120%)) rotate(calc(var(--sens, 1) * 13deg)) scale(.92);
  opacity: 0;
  transition: transform .55s cubic-bezier(.4, 0, .5, 1), opacity .55s ease;
}

#consigne-pile { margin: 22px auto 0; }

/* ---------- Étalement final des 5 cartes ---------- */

.tirage.etalement {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
  max-width: 1200px;
  margin: 0 auto;
  perspective: 1400px;
}

.carte-etalee {
  position: relative;
  width: min(43vw, 200px);
  aspect-ratio: 63 / 88;
  padding: 0;
  border: 0;
  background: none;
  container-type: inline-size;
  cursor: pointer;
  transition: transform .2s;
  animation: distribuer .5s cubic-bezier(.2, .8, .3, 1.2) both;
}
.carte-etalee:hover { transform: translateY(-6px); }

.actions { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.bouton {
  border: 1px solid rgba(212, 178, 106, .5);
  background: var(--encre-2);
  padding: 12px 26px;
  border-radius: 999px;
  font-family: var(--serif-titre);
  font-size: 14px;
  letter-spacing: .08em;
  transition: background .2s, transform .2s;
}
.bouton:hover { background: var(--encre-3); transform: translateY(-2px); }
.bouton-or { background: linear-gradient(180deg, #e3c682, #b18d45); color: var(--encre); border-color: transparent; }
.bouton-or:hover { background: linear-gradient(180deg, #ecd39a, #c19c52); }

/* ---------- Dos de carte ---------- */

.dos {
  width: 100%; height: 100%;
  border-radius: 4.5cqw;
  background:
    repeating-linear-gradient(60deg, rgba(212, 178, 106, .06) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(-60deg, rgba(212, 178, 106, .06) 0 1px, transparent 1px 9px),
    linear-gradient(160deg, #283055, #11152a);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .8), 0 0 0 1px rgba(212, 178, 106, .5) inset;
  display: grid; place-items: center;
  position: relative;
}
.dos::before { content: ""; position: absolute; inset: 6%; border: 1px solid rgba(212, 178, 106, .5); border-radius: 3cqw; }
.dos-motif { width: 62%; color: var(--or); }
.dos-motif svg { display: block; width: 100%; }

/* ---------- Carte ---------- */

.carte {
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 63 / 88;
  position: relative;
  text-align: center;
  color: var(--texte-carte);
}

.carte-cadre {
  position: absolute; inset: 0;
  padding: 3.6cqw;
  border-radius: 4.5cqw;
  background: var(--cadre);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .8), inset 0 0 0 .6cqw rgba(255, 255, 255, .25), inset 0 0 0 1.2cqw rgba(0, 0, 0, .15);
  overflow: hidden;
}

.carte-interieur {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 2.6cqw;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .55), transparent 65%),
    linear-gradient(180deg, var(--parchemin), var(--parchemin-2));
  box-shadow: inset 0 0 0 .5cqw var(--filet), inset 0 0 6cqw rgba(120, 90, 40, .18);
}

.carte-tete { padding: 2.6cqw 3cqw 2cqw; }
.carte-nom {
  margin: 0;
  font-family: var(--serif-titre);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #231d12;
}

.carte-illus {
  position: relative;
  margin: 0 3.4cqw;
  aspect-ratio: 4 / 3;
  border-radius: 1.2cqw;
  overflow: hidden;
  box-shadow: 0 0 0 .5cqw var(--filet), 0 0 0 1.2cqw rgba(255, 255, 255, .5), 0 1cqw 2cqw rgba(0, 0, 0, .25);
  background: #1a1a22;
}
.carte-illus svg, .carte-illus img { display: block; width: 100%; height: 100%; object-fit: cover; }

.carte-bandeau {
  margin: 2.6cqw 6cqw 0;
  padding: 1cqw 0;
  display: flex; align-items: center; justify-content: center; gap: 2.4cqw;
  font-family: var(--serif-titre);
  font-size: 3.4cqw;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--encre-bandeau);
  border-top: .3cqw solid var(--filet);
  border-bottom: .3cqw solid var(--filet);
}
.gemme { width: 2.2cqw; height: 2.2cqw; transform: rotate(45deg); background: var(--gemme); box-shadow: 0 0 1.5cqw var(--gemme); flex: none; }

/* --reduction : rétrécit le texte si le téléphone l'agrandit et qu'il déborde (voir carte.js). */
.carte-corps { --reduction: 1; flex: 1; min-height: 0; padding: 2cqw 6cqw 0; overflow: hidden; display: flex; flex-direction: column; }
.carte-dates { margin: 0; font-family: var(--serif-titre); font-size: calc(3.9cqw * var(--reduction)); font-weight: 600; letter-spacing: .03em; }
.carte-lieu { margin: .4cqw 0 1.6cqw; font-style: italic; font-size: calc(4.1cqw * var(--reduction)); color: #5d4f36; }
.carte-texte { margin: 0; font-size: calc(4.35cqw * var(--reduction)); line-height: 1.22; font-weight: 500; text-align: left; hyphens: auto; color: #2f2819; }

.carte-pied {
  display: flex; justify-content: space-between;
  padding: 1.4cqw 5cqw 2.4cqw;
  font-family: var(--serif-titre);
  font-size: 2.8cqw;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7a6a4a;
}

/* Raretés : couleurs de cadre, filet, gemme */
.rarete-ordinaire {
  --cadre: linear-gradient(150deg, #a59c8b, #6e6758 45%, #9a917f 70%, #5d574a);
  --filet: #9b8e72; --gemme: #8a8170; --encre-bandeau: #5a5240;
}
.rarete-notable {
  --cadre: linear-gradient(150deg, #edc699, #8f5d2e 40%, #d9a26b 65%, #6a4120);
  --filet: #a87443; --gemme: #c9793a; --encre-bandeau: #5e3a17;
}
.rarete-rare {
  --cadre: linear-gradient(150deg, #e3eaf2, #8798ad 40%, #cdd7e3 65%, #627389);
  --filet: #7d8ea4; --gemme: #4f7fbf; --encre-bandeau: #34506f;
}
.rarete-epique {
  --cadre: linear-gradient(150deg, #a57ccc, #4f2c74 40%, #8b62b5 65%, #3a1f58);
  --filet: #8a69a8; --gemme: #a25ee0; --encre-bandeau: #4e2a72;
}
.rarete-legendaire {
  --cadre: linear-gradient(150deg, #fff1b8, #c99a3b 30%, #f7da84 52%, #9c6f22 78%, #e8c46a);
  --filet: #b8913f; --gemme: #e8a92c; --encre-bandeau: #7a5410;
}
.rarete-mythique {
  --cadre: linear-gradient(150deg, #ff6fd8, #7c3bd4 28%, #43e0e0 52%, #ffd36e 78%, #ff6fd8);
  --filet: #c86ad0; --gemme: #ff5fb0; --encre-bandeau: #561a66;
}

/* Reflet animé (légendaires et mythiques) : une bande lumineuse, trois fois
   plus large que la carte, glisse de gauche à droite. Pas de mix-blend-mode
   ni d'animation du fond : beaucoup de téléphones ne les affichent pas sur
   les cartes en 3D ; un simple déplacement (transform) marche partout. */
.rarete-legendaire .carte-cadre::after,
.rarete-mythique .carte-cadre::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 300%;
  animation: reflet 4.5s ease-in-out infinite;
  will-change: transform;
  pointer-events: none;
}
.rarete-legendaire .carte-cadre::after {
  background: linear-gradient(115deg, transparent 40%, rgba(255, 248, 215, .32) 47%, rgba(255, 225, 150, .14) 51%, transparent 57%);
}
@keyframes reflet { 0% { transform: translateX(-64%); } 60%, 100% { transform: translateX(-3%); } }

/* Lueur discrète sur les épiques */
.rarete-epique .carte-cadre { box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .8), 0 0 18px rgba(162, 94, 224, .25), inset 0 0 0 .6cqw rgba(255, 255, 255, .2); }

/* Mythique : le palier ultime, éclat iridescent animé et forte lueur */
.rarete-mythique .carte-cadre {
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .85), 0 0 26px rgba(255, 95, 176, .45), inset 0 0 0 .6cqw rgba(255, 255, 255, .28);
}
.rarete-mythique .carte-cadre::after {
  background: linear-gradient(115deg, transparent 37%, rgba(255, 170, 235, .26) 43%, rgba(130, 235, 235, .22) 48%, rgba(255, 220, 140, .22) 53%, transparent 59%);
  animation-duration: 3.2s;
}

/* ---------- Collection ---------- */

.collection-entete { text-align: center; max-width: 520px; margin: 0 auto 34px; }
.collection-entete h1 { font-family: var(--serif-titre); font-weight: 600; letter-spacing: .14em; font-size: clamp(26px, 5vw, 36px); margin: 0; color: var(--or-clair); }
.collection-entete p { margin: 4px 0 0; font-style: italic; color: var(--texte-doux); }
.progression { margin-top: 18px; height: 6px; border-radius: 999px; background: var(--encre-3); overflow: hidden; }
#barre-progression { height: 100%; background: linear-gradient(90deg, var(--or-sombre), var(--or-clair)); transition: width .6s ease; }
.texte-progression { font-size: 15px; }

.grille-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(40vw, 170px), 1fr));
  gap: clamp(12px, 2vw, 22px);
  max-width: 1200px;
  margin: 0 auto;
}
.case-collection { position: relative; padding: 0; border: 0; background: none; text-align: inherit; transition: transform .2s; }
button.case-collection:hover { transform: translateY(-4px); }

.exemplaires {
  position: absolute; bottom: -6px; right: -6px;
  font-family: var(--serif-titre); font-size: 12px; font-weight: 700;
  background: var(--encre); color: var(--or-clair);
  border: 1px solid var(--or);
  padding: 3px 8px; border-radius: 999px;
}

.manquante {
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  border: 1px dashed rgba(212, 178, 106, .25);
  background: rgba(255, 255, 255, .02);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--serif-titre);
  color: rgba(212, 178, 106, .4);
  font-size: 13px;
  letter-spacing: .1em;
}
.manquante-rarete { font-size: 10px; text-transform: uppercase; letter-spacing: .2em; }

/* ---------- Modale ---------- */

.modale {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(6, 8, 16, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s;
  perspective: 1200px;
}
.modale.ouverte { opacity: 1; }
/* touch-action: none : sur téléphone, glisser le doigt sur la carte la penche au lieu de faire défiler la page. */
.modale-contenu { width: min(86vw, 400px, calc((100vh - 150px) * 63 / 88)); transition: transform .15s ease-out; touch-action: none; }
.modale.ouverte .modale-contenu { animation: zoom .3s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes zoom { from { transform: scale(.8); } }
.modale-fermer {
  position: absolute; top: 14px; right: 16px;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(212, 178, 106, .4);
  background: var(--encre-2); color: var(--or-clair);
  font-size: 24px; line-height: 1;
}

/* ---------- Partage : affiche photographiée hors de l'écran (voir partage.js) ---------- */

.coulisse-partage { position: fixed; left: -10000px; top: 0; pointer-events: none; }
.affiche-partage {
  width: 540px; height: 675px;            /* ×2 à l'export = 1080×1350, format portrait des réseaux */
  box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background:
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--gemme, #d4b26a) 38%, transparent), transparent 58%),
    linear-gradient(170deg, #1d2342, #0b0d18);
  color: var(--texte);
  text-align: center;
}
.affiche-partage > p { margin: 0; white-space: nowrap; }
.affiche-titre { font-family: var(--serif-titre); font-weight: 700; font-size: 34px; letter-spacing: .16em; color: var(--or-clair); }
.affiche-sous { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--texte-doux); margin-bottom: 6px !important; }
.affiche-carte { width: 330px; }
.affiche-carte .carte-cadre::after { animation: none; transform: translateX(-30%); }  /* reflet figé au milieu */
.affiche-pied { margin-top: 10px !important; font-family: var(--serif-titre); font-size: 17px; letter-spacing: .12em; color: var(--or); }

/* Boutons Partager : icône (flèche qui sort d'une boîte) + texte */
.bouton-partage { display: inline-flex; align-items: center; gap: 9px; }
.icone-partage { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; margin-top: -2px; }

/* Boutons sous la carte agrandie (Partager ; sur iPhone : Pencher avec le téléphone) */
.modale-actions {
  position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 12px;
}
.modale-actions .bouton { white-space: nowrap; padding: 10px 14px; font-size: 12px; letter-spacing: .04em; gap: 7px; }
.activer-gyroscope {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px;
  padding: 9px 13px; font-size: 11px; letter-spacing: .04em; gap: 7px; white-space: nowrap;
}

/* « En savoir plus » : panneau de parchemin qui monte du bas, par-dessus la carte */
.savoir-plus {
  position: absolute; left: 50%; bottom: 0; z-index: 2;
  width: min(100%, 560px); max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 26px clamp(20px, 5vw, 34px) max(28px, env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .5), transparent 60%),
    linear-gradient(180deg, var(--parchemin), var(--parchemin-2));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(140, 105, 45, .45);
  color: #2f2819;
  text-align: left;
  transform: translateX(-50%);
  animation: monter .32s cubic-bezier(.2, .8, .3, 1);
}
@keyframes monter { from { transform: translate(-50%, 100%); } }
.savoir-plus-sur {
  margin: 0; font-family: var(--serif-titre); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: #8a6a2c;
}
.savoir-plus-nom { margin: 4px 40px 12px 0; font-family: var(--serif-titre); font-weight: 700; font-size: clamp(20px, 5vw, 24px); color: #231d12; }
.savoir-plus-texte { margin: 0; font-size: 19px; line-height: 1.5; font-weight: 500; hyphens: auto; }
.savoir-plus-fermer {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(140, 105, 45, .45); background: rgba(255, 255, 255, .35);
  color: #5d4f36; font-size: 22px; line-height: 1;
}

/* ---------- Divers ---------- */

.notification {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translate(-50%, 30px);
  opacity: 0;
  max-width: calc(100vw - 32px);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--encre-2);
  border: 1px solid var(--or);
  color: var(--or-clair);
  font-size: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.notification.visible { opacity: 1; transform: translate(-50%, 0); }

.pied { text-align: center; padding: 24px 16px 32px; color: var(--texte-doux); font-size: 14px; font-style: italic; }
.pied p { margin: 0 0 6px; }
.pied .pied-geo { max-width: 60ch; margin: 0 auto 6px; font-size: 12px; opacity: .8; }
.lien { border: 0; background: none; color: var(--texte-doux); text-decoration: underline; font-size: 13px; padding: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
