/* ============================================================================
   HiveGuys — teaser one-page (hiveguys.fr)
   DA « matières réelles » : pierre, noyer, laiton, parchemin, cire, lanterne.
   Autonome : aucun framework, tokens repris de l'app (globals.css).
   ========================================================================== */

/* ── Polices du jeu ───────────────────────────────────────────────────── */
@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/Cinzel-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/Cinzel-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/EBGaramond-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/EBGaramond-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/EBGaramond-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ── Tokens (repris de src/app/globals.css) ───────────────────────────── */
:root {
  --stone: #2a2733;
  --stone-2: #3a3644;
  --stone-3: #1c1a23;
  --walnut: #2b1a10;
  --walnut-3: #1a0f08;
  --brass: #b8893a;
  --brass-2: #e9c97e;
  --brass-3: #6e4e16;
  --parch: #e6d6b4;
  --parch-2: #cdb88c;
  --parch-3: #a68e62;
  --ink: #261b13;
  --wax: #8a2626;
  --wax-2: #c0433c;
  --moon: #f3eedf;

  --brass-grad: linear-gradient(
    135deg,
    #6e4e16 0%,
    #b8893a 18%,
    #e9c97e 38%,
    #fff3cf 50%,
    #e9c97e 62%,
    #b8893a 82%,
    #6e4e16 100%
  );

  --fd: "Cinzel", Georgia, serif; /* display */
  --fb: "EB Garamond", Georgia, serif; /* body */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  /* empêche le pull-to-refresh / overscroll de Chrome Android qui mange
     le swipe vers le bas (impossible de remonter d'un écran sinon) */
  overscroll-behavior: none;
}

body {
  margin: 0;
  font-family: var(--fb);
  color: var(--parch);
  background: #0e0c12;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Le deck gère le défilement — le corps ne scrolle pas. */
  overflow: hidden;
}

/* ── Deck plein écran ─────────────────────────────────────────────────── */
.deck {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--active, 0) * -100svh));
  transition: transform 0.8s var(--ease-out);
  will-change: transform;
}
.screen {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain; /* pas de chaînage de scroll vers le pull-to-refresh */
  background: #0e0c12; /* fond profond uniforme : pas de bande claire au scroll */
  isolation: isolate; /* contexte d'empilement : le fond-image reste au-dessus */
  /* masque les barres de défilement internes (secours petit mobile) */
  scrollbar-width: none;
}
.screen::-webkit-scrollbar {
  display: none;
}
/* Fond propre à chaque écran + voile de lisibilité. */
.screen-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}
.screen-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(135% 100% at 50% 40%, transparent 0%, rgba(10, 9, 14, 0.26) 62%, rgba(8, 7, 11, 0.82) 100%),
    linear-gradient(180deg, rgba(14, 12, 18, 0.26), rgba(10, 9, 14, 0.5));
}
/* Contenu centré, et scrollable en secours si plus haut que l'écran. */
.screen-inner {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 92px 20px 48px;
  max-width: 1080px;
  margin: 0 auto;
}

/* Points de navigation */
.deck-dots {
  position: fixed;
  right: 16px;
  top: 50%;
  z-index: 50;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deck-dots button {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1px solid var(--brass-3);
  border-radius: 50%;
  background: rgba(20, 18, 26, 0.5);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.deck-dots button:hover {
  border-color: var(--brass);
}
.deck-dots button.on {
  background: var(--brass-grad);
  border-color: var(--brass-2);
  transform: scale(1.25);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Accessibilité : contour de focus clavier visible (pas à la souris). */
:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── Écran de chargement ──────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 46%, #17131f, #08070b 72%);
  transition: opacity 0.85s ease;
}
#preloader.done {
  opacity: 0;
  pointer-events: none;
}
.pre-logo {
  width: clamp(120px, 30vw, 176px);
  height: auto;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 26px rgba(233, 201, 126, 0.35));
  animation: pre-pulse 1.5s ease-in-out infinite;
}
#preloader.spin .pre-logo {
  animation: pre-spin 1.4s cubic-bezier(0.45, 0, 1, 1) forwards;
  filter: drop-shadow(0 0 40px rgba(233, 201, 126, 0.6));
}
.pre-text {
  position: absolute;
  bottom: 12%;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: var(--parch-3);
  animation: pre-text-blink 1.5s ease-in-out infinite;
}
/* Petites particules d'ambiance qui montent, présentes tout le chargement. */
.pre-dust {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.pre-dust::before,
.pre-dust::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}
.pre-dust::before {
  background-image:
    radial-gradient(1.6px 1.6px at 18% 88%, rgba(243, 238, 223, 0.5), transparent),
    radial-gradient(1.4px 1.4px at 62% 68%, rgba(255, 224, 170, 0.4), transparent),
    radial-gradient(1.2px 1.2px at 42% 42%, rgba(243, 238, 223, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 85% 22%, rgba(255, 224, 170, 0.35), transparent);
  background-size: 140px 140px;
  opacity: 0.55;
  animation: dust-up 22s linear infinite;
}
.pre-dust::after {
  background-image:
    radial-gradient(1px 1px at 30% 80%, rgba(243, 238, 223, 0.45), transparent),
    radial-gradient(1px 1px at 72% 50%, rgba(255, 224, 170, 0.35), transparent),
    radial-gradient(1px 1px at 55% 25%, rgba(243, 238, 223, 0.35), transparent);
  background-size: 90px 90px;
  opacity: 0.4;
  animation: dust-up 15s linear infinite;
}
.pre-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pre-particles i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff3cf, #c9972f 70%);
  opacity: 0;
}
#preloader.spin .pre-particles i {
  animation: pre-spark 0.85s ease-out infinite;
  animation-delay: calc(var(--i) * 0.05s);
}
@keyframes pre-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}
@keyframes pre-spin {
  0% {
    transform: rotate(0) scale(1.08);
  }
  100% {
    transform: rotate(2160deg) scale(1.08);
  }
}
@keyframes pre-text-blink {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}
@keyframes pre-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateX(10vmin) scale(0.4);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateX(var(--d)) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  #preloader {
    display: none;
  }
}

/* ── En-tête fixe ─────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(8, 7, 11, 0.92), rgba(8, 7, 11, 0.45));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--brass-3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.brand-word {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  background: var(--brass-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Bouton son — coin droit du header */
.sound-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--parch-3);
  border: 1px solid var(--brass-3);
  border-radius: 50%;
  background: rgba(14, 12, 18, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sound-toggle:hover {
  color: var(--brass-2);
  border-color: var(--brass);
}
.sound-toggle.on {
  color: var(--brass-2);
  border-color: var(--brass);
}
.sound-toggle .ico {
  width: 19px;
  height: 19px;
}
.sound-toggle .ico-on {
  display: none;
}
.sound-toggle.on .ico-on {
  display: block;
}
.sound-toggle.on .ico-off {
  display: none;
}

/* ── Héros ────────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 96px 20px 64px;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("assets/tavern.webp") center 28% / cover no-repeat;
  transform: scale(1.06);
  animation: drift 32s var(--ease-out) infinite alternate;
}
/* Vignette + fondu bas : la lumière de la lanterne au centre, les bords sombres. */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(130% 90% at 50% 34%, transparent 0%, rgba(14, 12, 18, 0.35) 52%, rgba(14, 12, 18, 0.9) 100%),
    linear-gradient(180deg, rgba(20, 18, 26, 0.3) 0%, transparent 28%, rgba(28, 26, 35, 0.95) 100%);
}
/* Halo chaud de lanterne, respiration lente. */
.hero-lantern {
  position: absolute;
  top: 24%;
  left: 50%;
  z-index: -1;
  width: min(72vw, 560px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(233, 201, 126, 0.26), rgba(233, 201, 126, 0.08) 42%, transparent 68%);
  animation: flicker 6s ease-in-out infinite;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 620px;
  text-align: center;
}
.hero-logo {
  width: min(84vw, 460px);
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.8));
}
.hero-title {
  margin: 0 auto 14px;
  max-width: 16ch;
  font-family: var(--fd);
  font-weight: 700;
  font-size: clamp(1.5rem, 5.4vw, 2.6rem);
  line-height: 1.18;
  color: var(--brass-2);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}
.hero-sub {
  margin: 0 auto 30px;
  max-width: 38ch;
  font-size: clamp(1.02rem, 3.3vw, 1.25rem);
  line-height: 1.5;
  color: var(--parch-2);
}

/* Trois écussons de factions qui se chevauchent — cliquables (bulle de réplique). */
.hero-crests {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.crest-btn {
  position: relative;
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.crest-btn img {
  display: block;
  width: clamp(72px, 19vw, 104px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.7));
  transition: transform 0.2s var(--ease-out);
}
.crest-btn:hover img {
  transform: translateY(-3px);
}
.crest-mid {
  z-index: 2;
  animation: crest-float 5s ease-in-out infinite;
}
.crest-mid img {
  width: clamp(84px, 22vw, 122px);
}
.crest-left {
  z-index: 1;
  margin-right: -22px;
  animation: crest-float 5.6s ease-in-out infinite;
  animation-delay: -1.6s;
}
.crest-left img {
  rotate: -9deg;
}
.crest-right {
  z-index: 1;
  margin-left: -22px;
  animation: crest-float 5.6s ease-in-out infinite;
  animation-delay: -3.1s;
}
.crest-right img {
  rotate: 9deg;
}
.crest-btn.show {
  z-index: 6;
}
.crest-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 6;
  width: max-content;
  max-width: 220px;
  padding: 9px 13px;
  transform: translateX(-50%) scale(0.9);
  transform-origin: bottom center;
  background: linear-gradient(180deg, var(--stone-2), var(--stone-3));
  border: 1px solid var(--brass);
  border-radius: 11px;
  color: var(--parch);
  font-family: var(--fb);
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.32;
  text-align: center;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.crest-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--brass);
}
.crest-btn.show .crest-bubble {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.hero-seal-label {
  display: block;
  margin-top: 30px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--parch-3);
  animation: label-pulse 2.6s ease-in-out infinite;
}
@keyframes label-pulse {
  0%, 100% {
    color: var(--parch-3);
    text-shadow: none;
  }
  50% {
    color: var(--brass-2);
    text-shadow: 0 0 12px rgba(233, 201, 126, 0.55);
  }
}

/* Indice de scroll */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 24px;
  height: 38px;
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid var(--brass-3);
  border-radius: 12px;
  background: rgba(20, 18, 26, 0.3);
  opacity: 0.7;
  cursor: pointer;
  z-index: 2;
}
.scroll-dot {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 7px;
  border-radius: 3px;
  background: var(--brass-2);
  transform: translateX(-50%);
  animation: scroll-bob 1.8s ease-in-out infinite;
}

/* Brume légère et discrète (écran des cartes). */
.mist {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.mist span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 214, 180, 0.08), transparent 70%);
  filter: blur(34px);
}
.mist span:nth-child(1) {
  width: 62vw;
  height: 42vh;
  left: -16vw;
  top: 26%;
  animation: mist-drift-a 28s ease-in-out infinite;
}
.mist span:nth-child(2) {
  width: 52vw;
  height: 38vh;
  right: -14vw;
  top: 44%;
  animation: mist-drift-b 34s ease-in-out infinite;
}
.mist span:nth-child(3) {
  width: 72vw;
  height: 32vh;
  left: 8vw;
  bottom: -6%;
  animation: mist-drift-a 40s ease-in-out infinite reverse;
}
@keyframes mist-drift-a {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.8;
  }
  50% {
    transform: translateX(8vw);
    opacity: 1;
  }
}
@keyframes mist-drift-b {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-8vw);
    opacity: 0.75;
  }
}

/* ── Sections génériques ──────────────────────────────────────────────── */
.section-title {
  margin: 0 auto 10px;
  text-align: center;
  font-family: var(--fd);
  font-weight: 700;
  font-size: clamp(1.4rem, 4.6vw, 2rem);
  color: var(--brass-2);
}
.section-lede {
  margin: 0 auto 40px;
  max-width: 46ch;
  text-align: center;
  color: var(--parch-2);
  font-size: 1.08rem;
}

/* ── Vitrine : éventail de cartes ─────────────────────────────────────── */
.fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(-28px, -4vw, 10px);
  padding: 20px 0 8px;
  perspective: 1200px;
}
.fan .card {
  flex: 0 0 auto;
  width: clamp(104px, 26vw, 168px);
  margin-inline: clamp(-22px, -3.4vw, 6px);
  transform: rotate(calc(var(--n) * 6deg)) translateY(calc(abs(var(--n)) * 10px));
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.fan .card:hover {
  transform: rotate(0deg) translateY(-14px) scale(1.06);
  z-index: 5;
}

/* Carte authentique (reprise de .card dans globals.css) */
.card {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 7px 6px 7px 6px;
  padding: 4px;
  margin: 0;
  background: var(--frame);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px 0 rgba(0, 0, 0, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 10px 14px -8px rgba(0, 0, 0, 0.95),
    0 0 22px -4px var(--glow);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(147deg, rgba(255, 255, 255, 0.2), transparent 28%, transparent 68%, rgba(0, 0, 0, 0.24));
  mix-blend-mode: soft-light;
}
.card .inner {
  position: absolute;
  inset: 4px;
  z-index: 1;
  border-radius: 5px 4px 5px 4px;
  overflow: hidden;
  background: #0b0910;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.7),
    inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.card .inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .plate {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0e1bc, #cdb88c);
  color: var(--ink);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.card .gem {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 9px;
  height: 9px;
  z-index: 2;
  transform: translateX(-50%) rotate(45deg);
  background: radial-gradient(circle at 35% 30%, #fff, var(--gemc) 50%, #000 130%);
  box-shadow: 0 0 6px var(--gemc), 0 1px 1px rgba(0, 0, 0, 0.8);
}
.card .holo {
  position: absolute;
  inset: 4px;
  z-index: 1;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
  mix-blend-mode: color-dodge;
  background: linear-gradient(
    115deg,
    transparent 22%,
    rgba(255, 230, 160, 0.65) 40%,
    rgba(140, 210, 255, 0.5) 50%,
    rgba(255, 150, 220, 0.5) 60%,
    transparent 78%
  );
  background-size: 260% 260%;
  background-position: 50% 50%;
}
.card:hover .holo,
.card.holo-on .holo {
  opacity: 0.85;
  animation: holo-sweep 3.5s linear infinite;
}

.card.common {
  --frame: linear-gradient(135deg, #6b6b67, #c9c9c2 25%, #8a8a86 50%, #44443f 75%, #b4b4ad);
  --glow: rgba(138, 138, 134, 0.35);
  --gemc: #b4b4ad;
}
.card.rare {
  --frame: linear-gradient(135deg, #3a5f85, #9fc2e6 25%, #4e7baa 50%, #24405e 75%, #8fb3d8);
  --glow: rgba(78, 123, 170, 0.45);
  --gemc: #6fa3da;
}
.card.epic {
  --frame: linear-gradient(135deg, #4a2a72, #c9a2f0 25%, #7a3fb0 50%, #30194f 75%, #b48ae8);
  --glow: rgba(122, 63, 176, 0.5);
  --gemc: #b07ce8;
}
.card.legendary {
  --frame: var(--brass-grad);
  --glow: rgba(211, 160, 23, 0.55);
  --gemc: #f1c94a;
}
.card.divine {
  --frame: linear-gradient(135deg, #bfa14a, #fffdf4 25%, #f3eedf 50%, #cfc7ae 75%, #fff6da);
  --glow: rgba(243, 238, 223, 0.6);
  --gemc: #fffdf4;
}

/* Dos de carte flottant, cliquable → révélation */
.cardback-reveal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.card-back-float {
  width: clamp(166px, 44vw, 242px);
  border-radius: 12px;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.6));
  animation: cardback-bob 5.5s ease-in-out infinite;
  transition: transform 0.3s var(--ease-out), filter 0.3s ease;
}
.cardback-reveal:hover .card-back-float {
  transform: translateY(-6px) scale(1.03);
  filter:
    drop-shadow(0 22px 38px rgba(0, 0, 0, 0.7))
    drop-shadow(0 0 28px rgba(233, 201, 126, 0.4));
}
.cardback-hint {
  font-family: var(--fd);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: var(--parch-3);
}
@keyframes cardback-bob {
  0%, 100% {
    translate: 0 0;
    rotate: -1deg;
  }
  50% {
    translate: 0 -12px;
    rotate: 1deg;
  }
}

/* Révélation plein écran avec auras (reprise de la contemplation du jeu) */
.lshow {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(circle at 50% 44%, rgba(20, 18, 26, 0.82), rgba(8, 7, 11, 0.96));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lshow[hidden] {
  display: none;
}
.lshow[data-r="common"] {
  --g: rgba(200, 200, 195, 0.5);
}
.lshow[data-r="rare"] {
  --g: rgba(120, 170, 230, 0.6);
}
.lshow[data-r="epic"] {
  --g: rgba(190, 130, 255, 0.66);
}
.lshow[data-r="legendary"] {
  --g: rgba(255, 208, 120, 0.8);
}
.lshow[data-r="divine"] {
  --g: rgba(255, 250, 235, 0.9);
}
.lshow-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160vmax;
  height: 160vmax;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}
.lshow[data-r="legendary"] .lshow-rays,
.lshow[data-r="divine"] .lshow-rays {
  opacity: 1;
  background: repeating-conic-gradient(rgba(255, 220, 140, 0.12) 0 4deg, transparent 4deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 5%, transparent 44%);
  mask: radial-gradient(circle, #000 5%, transparent 44%);
  animation: lshow-rays-spin 12s linear infinite;
}
.lshow[data-r="divine"] .lshow-rays {
  background: repeating-conic-gradient(rgba(255, 252, 244, 0.16) 0 3deg, transparent 3deg 16deg);
}
.lshow-stage {
  position: relative;
  z-index: 1;
  width: min(72vw, 46vh);
  animation: lshow-flip 0.62s var(--ease-out);
}
.lshow-stage .card {
  width: 100%;
}
.lshow-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--g, rgba(255, 208, 120, 0.7)), transparent 62%);
  filter: blur(14px);
  animation: lshow-glow-in 0.7s ease;
}
@keyframes lshow-flip {
  from {
    transform: perspective(1100px) rotateY(90deg) scale(0.6);
    opacity: 0;
  }
  to {
    transform: perspective(1100px) rotateY(0deg) scale(1);
    opacity: 1;
  }
}
.lshow-hint {
  position: absolute;
  left: 50%;
  bottom: 7vh;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--fd);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: rgba(240, 224, 194, 0.78);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  animation: lshow-hint-in 0.5s ease 0.5s both;
}
@keyframes lshow-in {
  from {
    transform: perspective(1100px) rotateY(90deg) scale(0.5);
    opacity: 0;
  }
}
@keyframes lshow-glow-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
@keyframes lshow-rays-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes lshow-hint-in {
  from {
    opacity: 0;
  }
}
.booster-cap {
  margin: 14px 0 0;
  font-family: var(--fd);
  color: var(--parch-2);
  letter-spacing: 0.04em;
}
.booster-cap em {
  color: var(--brass-2);
  font-style: italic;
}

/* ── Piliers ──────────────────────────────────────────────────────────── */
/* Dernier écran : piliers centrés + pied de page collé en bas. */
.screen-last {
  display: flex;
  flex-direction: column;
}
/* Le bloc piliers pousse le footer en bas quand ça tient ; sinon l'écran
   défile jusqu'au footer (jamais coupé). */
.screen-last .screen-inner {
  flex: 1 0 auto;
  min-height: 0;
  justify-content: flex-start;
  padding: 74px 20px 14px;
}
.pillar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.pillar {
  position: relative;
  padding: 22px 20px;
  border: 1px solid var(--brass-3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(58, 54, 68, 0.5), rgba(28, 26, 35, 0.6));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 24px -16px rgba(0, 0, 0, 0.9);
  text-align: center;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}
.pillar:hover {
  transform: translateY(-4px);
  border-color: var(--brass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 30px -18px rgba(0, 0, 0, 0.95),
    0 0 26px -10px rgba(233, 201, 126, 0.5);
}
/* Icône SVG maison, teinte laiton (currentColor). */
.pillar-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  color: var(--brass-2);
  border: 1px solid var(--brass-3);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(233, 201, 126, 0.14), rgba(28, 26, 35, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 4px 10px -4px rgba(0, 0, 0, 0.7);
  transition: transform 0.35s var(--ease-out), color 0.3s ease, border-color 0.3s ease;
}
/* halo qui respire (décalé par pilier), s'intensifie au survol */
.pillar-icon::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(233, 201, 126, 0.3), transparent 70%);
  opacity: 0;
  animation: icon-glow 5s ease-in-out infinite;
  transition: opacity 0.3s ease;
}
.pillar:nth-child(2) .pillar-icon::after {
  animation-delay: -1.7s;
}
.pillar:nth-child(3) .pillar-icon::after {
  animation-delay: -3.3s;
}
.pillar-icon svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  transition: transform 0.35s var(--ease-out);
}
.pillar:hover .pillar-icon {
  transform: scale(1.1);
  color: var(--moon);
  border-color: var(--brass);
}
.pillar:hover .pillar-icon::after {
  opacity: 1;
  animation: none;
}
.pillar:hover .pillar-icon svg {
  transform: rotate(-8deg) scale(1.08);
}
@keyframes icon-glow {
  0%, 100% {
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
}
.pillar h3 {
  margin: 0 0 10px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 1.32rem;
  color: var(--brass-2);
}
.pillar p {
  margin: 0;
  color: var(--parch);
  font-size: 1.12rem;
  line-height: 1.55;
}

/* Clôture de l'écran 3 : appel à proposer sa carte. */
.pillars-cta {
  margin-top: 22px;
  margin-bottom: 12px;
  text-align: center;
}
.cta-line {
  margin: 0 0 22px;
  font-family: var(--fd);
  font-size: 1.14rem;
  color: var(--brass-2);
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 264px;
  padding: 20px 52px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--brass-2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  border: 0;
  background: url("assets/bouton-rouge.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
  animation: cta-pulse 2.6s ease-in-out infinite;
  transition: transform 0.15s var(--ease-out), filter 0.2s ease;
}
.cta-btn:hover {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)) brightness(1.08);
}
.cta-btn:active {
  transform: translateY(1px) scale(0.98);
}
@keyframes cta-pulse {
  0%, 100% {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 0 rgba(233, 201, 126, 0));
  }
  50% {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(233, 201, 126, 0.55));
  }
}

/* Écran de clôture (slide 4) : contenu centré, bouton centré. */
.screen-last .closing {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.closing .section-title {
  font-size: clamp(1.8rem, 5.6vw, 2.7rem);
  margin-bottom: 16px;
}
.closing .section-lede {
  margin-bottom: 8px;
  max-width: 40ch;
  font-size: clamp(1.14rem, 2.6vw, 1.4rem);
  line-height: 1.5;
}
.closing .cta-btn {
  margin-top: 24px;
}

/* ── Pied de page ─────────────────────────────────────────────────────── */
.site-footer {
  flex: 0 0 auto;
  padding: 18px 20px 22px;
  text-align: center;
  background: none;
}
.site-footer p {
  margin: 0;
  font-family: var(--fd);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  background: var(--brass-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer-link {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--fd);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--parch-3);
  border-bottom: 1px solid var(--brass-3);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer-link:hover {
  color: var(--brass-2);
  border-color: var(--brass);
}

/* ── Apparitions au scroll ────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px) scale(0.96);
  filter: blur(7px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out),
    filter 0.8s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ── Animations d'ambiance ────────────────────────────────────────────── */
@keyframes drift {
  from {
    transform: scale(1.06) translate(0, 0);
  }
  to {
    transform: scale(1.12) translate(-1.5%, -1.5%);
  }
}
@keyframes flicker {
  0%, 100% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -51%) scale(1.04);
  }
  70% {
    opacity: 0.78;
    transform: translate(-50%, -49%) scale(0.98);
  }
}
@keyframes crest-float {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -9px;
  }
}
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}
@keyframes holo-sweep {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 200% 50%;
  }
}
@keyframes scroll-bob {
  0%, 100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  60% {
    transform: translate(-50%, 12px);
    opacity: 0.2;
  }
}
/* Petites particules qui montent en continu — discrètes, générées en CSS. */
.dust {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.dust::before,
.dust::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  will-change: background-position;
}
.dust::before {
  background-image:
    radial-gradient(1.6px 1.6px at 20% 90%, rgba(243, 238, 223, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 65% 70%, rgba(243, 238, 223, 0.45), transparent),
    radial-gradient(1.2px 1.2px at 40% 40%, rgba(255, 224, 170, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 85% 20%, rgba(243, 238, 223, 0.4), transparent);
  background-size: 150px 150px;
  opacity: 0.8;
  animation: dust-up 24s linear infinite;
}
.dust::after {
  background-image:
    radial-gradient(1px 1px at 30% 80%, rgba(243, 238, 223, 0.5), transparent),
    radial-gradient(1px 1px at 75% 55%, rgba(255, 224, 170, 0.4), transparent),
    radial-gradient(1px 1px at 55% 25%, rgba(243, 238, 223, 0.4), transparent);
  background-size: 100px 100px;
  opacity: 0.6;
  animation: dust-up 16s linear infinite;
}
@keyframes dust-up {
  to {
    background-position: 0 -1500px;
  }
}

/* ── Bouton rouge « Envoyer une suggestion » ──────────────────────────── */
.suggest-btn {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-family: var(--fd);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffe9cf;
  cursor: pointer;
  border: 1px solid var(--brass);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--wax-2), var(--wax) 55%, var(--wax-3));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 4px rgba(0, 0, 0, 0.45),
    0 6px 16px -6px rgba(0, 0, 0, 0.8);
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.3s ease,
    filter 0.2s ease,
    opacity 0.3s ease;
}
/* Caché sur le dernier écran : « Propose ta carte » y est déjà. */
body.is-last .suggest-btn {
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  pointer-events: none;
}
.suggest-btn svg {
  width: 17px;
  height: 17px;
}
.suggest-btn:hover {
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 4px rgba(0, 0, 0, 0.45),
    0 8px 20px -6px rgba(0, 0, 0, 0.85),
    0 0 22px -6px rgba(233, 201, 126, 0.6);
}
.suggest-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* ── Modale « Deviens une carte » ─────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90svh;
  overflow-y: auto;
  padding: 26px 24px 24px;
  border: 1px solid var(--brass);
  border-radius: 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(233, 201, 126, 0.08), transparent 60%),
    linear-gradient(180deg, var(--stone-2), var(--stone-3));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 60px -20px rgba(0, 0, 0, 0.9);
  animation: modal-pop 0.35s var(--ease-out);
  scrollbar-width: none;
}
.modal-panel::-webkit-scrollbar {
  display: none;
}
@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--parch-2);
  cursor: pointer;
  border: 1px solid var(--brass-3);
  border-radius: 50%;
  background: rgba(20, 18, 26, 0.6);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal-close svg {
  width: 16px;
  height: 16px;
}
.modal-close:hover {
  color: var(--brass-2);
  border-color: var(--brass);
}
.modal-head h2 {
  margin: 0 0 6px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brass-2);
}
.modal-lede {
  margin: 0 0 12px;
  max-width: 46ch;
  color: var(--parch);
  font-size: 1.12rem;
  line-height: 1.5;
}
.modal-fineprint {
  margin: 0 0 22px;
  max-width: 50ch;
  color: var(--parch-3);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.45;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.suggest-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
}
.field > span {
  margin-bottom: 6px;
  font-family: var(--fd);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brass-2);
}
.field > span em {
  font-weight: 400;
  font-style: italic;
  color: var(--parch-3);
}
.suggest-form input,
.suggest-form select,
.suggest-form textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--parch);
  background: rgba(20, 18, 26, 0.6);
  border: 1px solid var(--brass-3);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.suggest-form textarea {
  resize: vertical;
}
.suggest-form input:focus,
.suggest-form select:focus,
.suggest-form textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(184, 137, 58, 0.18);
}
.field-file input {
  padding: 8px;
  font-size: 0.9rem;
  color: var(--parch-2);
}
.field-file input::file-selector-button {
  margin-right: 10px;
  padding: 7px 12px;
  font: inherit;
  color: var(--parch);
  cursor: pointer;
  border: 1px solid var(--brass-3);
  border-radius: 6px;
  background: var(--walnut-2);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.btn-ghost,
.btn-red {
  padding: 10px 18px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 9px;
  transition: transform 0.15s var(--ease-out), filter 0.2s ease;
}
.btn-ghost {
  color: var(--parch-2);
  border: 1px solid var(--brass-3);
  background: transparent;
}
.btn-ghost:hover {
  color: var(--parch);
  border-color: var(--brass);
}
.btn-red {
  color: #ffe9cf;
  border: 1px solid var(--brass);
  background: linear-gradient(180deg, var(--wax-2), var(--wax) 55%, var(--wax-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-red:hover {
  filter: brightness(1.08);
}
.btn-red:active,
.btn-ghost:active {
  transform: translateY(1px) scale(0.98);
}
.modal-note {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--brass-3);
  border-radius: 8px;
  background: rgba(138, 38, 38, 0.14);
  color: var(--parch);
  font-size: 0.95rem;
}

/* Aperçu de carte en direct */
.preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.preview-wrap .card {
  width: 170px;
}
.preview-wrap .card .inner img {
  display: none;
}
.preview-wrap .card.has-photo .inner img {
  display: block;
}
.preview-ph {
  position: absolute;
  inset: 4px;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  color: var(--parch-3);
  font-size: 0.9rem;
}
.card.has-photo .preview-ph {
  display: none;
}
.preview-cap {
  margin: 0;
  font-family: var(--fd);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--parch-3);
}

/* ── Desktop / tablette ───────────────────────────────────────────────── */
@media (min-width: 768px) {
  .pillar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  .fan {
    gap: 0;
  }
  .fan .card {
    margin-inline: -14px;
  }
  .suggest-btn {
    left: 24px;
    bottom: 24px;
  }
  .modal-body {
    flex-direction: row;
    align-items: flex-start;
  }
  .preview-wrap {
    position: sticky;
    top: 0;
    flex: 0 0 auto;
    padding-top: 22px;
  }
}

/* ── Accessibilité : mouvement réduit ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-bg {
    transform: scale(1.06);
  }
  .fan .card {
    transform: rotate(calc(var(--n) * 6deg));
  }
}
