/* ===== Variables & reset ===== */
:root {
  --bg: #050308;
  --gold: #c9a96a;
  --gold-soft: #e6cf9b;
  --ink: #f3ead8;
  /* Dimensions de référence du "poster" (mises à l'échelle par script.js) */
  --poster-w: 1600px;
  --poster-h: 1000px;
  --card-w: 114px;
  --card-h: calc(var(--card-w) * 1.5);
  /* Origine de la fumée (bout incandescent de la cigarette) — % de la zone portrait */
  --smoke-x: 1.5%;
  --smoke-y: 48%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(120% 80% at 50% 8%, #140d1f 0%, #0a0610 45%, var(--bg) 100%);
  color: var(--ink);
  font-family: "EB Garamond", Georgia, serif;
  overflow: hidden;
  min-height: 100vh;
}

/* ===== Étoiles ===== */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.starfield .star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: var(--o, .8);
  animation: twinkle var(--t, 4s) ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: calc(var(--o, .8) * .25); }
  to   { opacity: var(--o, .8); }
}

/* ===== Conteneur d'échelle : centre et met le poster à l'échelle de l'écran ===== */
.viewport {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

/* ===== Scène (poster à dimensions fixes, scalé+centré par JS) ===== */
.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  /* transform appliqué par script.js : translate(-50%,-50%) scale(...) */
  transform: translate(-50%, -50%);
  transform-origin: center center;
  width: var(--poster-w);
  height: var(--poster-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 24px 48px;
}

/* ===== En-tête ===== */
.intro { text-align: center; }
.kicker {
  font-family: "Cinzel", serif;
  letter-spacing: .35em;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: .85;
}
.title {
  font-family: "Cinzel", serif;
  font-weight: 600;
  letter-spacing: .5em;
  font-size: 68px;
  text-indent: .5em;
  color: var(--ink);
  text-shadow: 0 0 24px rgba(201,169,106,.35);
  margin: .12em 0;
}
/* Entrée animée lettre par lettre (flou + glissement, en cascade lente) */
.title .ch {
  display: inline-block;
  opacity: 0;
  filter: blur(.28em);
  transform: translateY(.45em);
  animation: letterIn 1.8s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--ci) * .32s + .4s);
}
@keyframes letterIn {
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* Emblème soleil sous le titre */
.sun-emblem {
  display: block;
  width: 30px;
  height: 30px;
  margin: 4px auto 0;
  opacity: .85;
  filter: drop-shadow(0 0 6px rgba(201,169,106,.5));
  animation: emblemIn 1.2s ease 2.6s both;
}
@keyframes emblemIn {
  from { opacity: 0; transform: scale(.6) rotate(-30deg); }
  to   { opacity: .85; transform: none; }
}

/* ===== Couche céleste (orbites / astrolabe) ===== */
.cosmos {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(115vh, 115vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: .28;
  z-index: 0;
  pointer-events: none;
  animation: spin 240s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* 2e couche : plus petite, plus discrète, tourne en sens inverse */
.cosmos-2 {
  width: min(92vh, 92vw);
  opacity: .2;
  animation: spin 320s linear infinite reverse;
}

/* ===== Centre (portrait) ===== */
.center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.portrait {
  position: relative;
  height: 520px;
  /* Pas de largeur fixe : la zone épouse l'image -> la fumée (%) tombe pile sur la cigarette */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
}
.portrait img {
  height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,.6));
  /* Fondu du bas pour masquer la coupe nette de l'image */
  -webkit-mask: linear-gradient(to bottom, #000 80%, transparent 99%);
          mask: linear-gradient(to bottom, #000 80%, transparent 99%);
}
/* Si le PNG n'est pas encore déposé */
.portrait.no-portrait::after {
  content: "Dépose assets/evoxia.png";
  font-family: "Cinzel", serif;
  letter-spacing: .2em;
  font-size: 12px;
  color: var(--gold-soft);
  opacity: .5;
}

/* ===== Fumée de cigarette (panache SVG ondulé) ===== */
.cig-smoke {
  position: absolute;
  left: var(--smoke-x);
  bottom: calc(100% - var(--smoke-y));  /* base du panache = bout de la cigarette */
  transform: translateX(-50%);
  width: 84px;
  height: 250px;
  pointer-events: none;
  z-index: 6;
  opacity: .22;
}
.cig-smoke svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ===== Fumée mystique au curseur (canvas plein écran) ===== */
.smoke-canvas {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

/* ===== Tagline (plaque ornementée, collée au bas du portrait) ===== */
.tagline {
  position: absolute;
  bottom: 0;
  left: 0;
  /* Largeur fixe = largeur du portrait, pour masquer toute la coupe du bas */
  width: 100%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 18px 28px 26px;
  border: 1px solid rgba(201,169,106,.55);
  border-radius: 14px;
  /* Fond opaque : masque la coupe nette de l'image */
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(201,169,106,.16), transparent 70%),
    #0b0712;
  font-family: "Cinzel", serif;
  letter-spacing: .22em;
  font-size: 13px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-soft);
}
/* Cadre intérieur fin */
.tagline::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201,169,106,.3);
  border-radius: 10px;
  pointer-events: none;
}
/* Médaillon circulaire chevauchant la bordure du bas (pochette pour le soleil) */
.tagline::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(201,169,106,.55);
  background: #0b0712;
}
/* Emblème soleil centré dans le médaillon */
.tagline-sun {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  margin: 0;
  z-index: 1;
  animation: none;
}

/* ===== Cartes en ellipse ===== */
.cards {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.card {
  position: absolute;
  /* Position et inclinaison définies dans le style inline de chaque carte (--top/--left/--tilt) */
  top: var(--top, 50%);
  left: var(--left, 50%);
  width: var(--card-w);
  height: var(--card-h);
  /* Centre la carte sur son point d'ancrage + léger éventail (--tilt) */
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg));
  /* Apparence carte : rectangle arrondi, cadre doré */
  border: 1.5px solid rgba(201,169,106,.55);
  border-radius: 16px;
  background:
    radial-gradient(1.5px 1.5px at 24% 26%, rgba(230,207,155,.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 76% 22%, rgba(230,207,155,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 30% 80%, rgba(230,207,155,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 84%, rgba(230,207,155,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 50% 90%, rgba(230,207,155,.35), transparent 60%),
    radial-gradient(120% 60% at 50% 0%, rgba(201,169,106,.16), transparent 60%),
    radial-gradient(80% 50% at 50% 100%, rgba(40,28,60,.5), transparent 70%),
    linear-gradient(160deg, rgba(34,25,46,.94), rgba(9,6,15,.96));
  box-shadow: 0 10px 30px rgba(0,0,0,.55), inset 0 0 24px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6px 12px;
  text-decoration: none;
  color: var(--gold-soft);
  animation: float 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.7s);
  transition:
    top .9s cubic-bezier(.2,.7,.2,1) calc(var(--i) * .06s),
    left .9s cubic-bezier(.2,.7,.2,1) calc(var(--i) * .06s),
    opacity .6s ease calc(var(--i) * .06s),
    transform .4s ease,
    box-shadow .35s ease,
    border-color .35s ease;
}
/* Cadre intérieur arrondi */
.card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(201,169,106,.32);
  border-radius: 12px;
  pointer-events: none;
  transition: border-color .35s ease;
}
.card:hover::before { border-color: rgba(230,207,155,.6); }

/* Chiffre romain logé dans un arc en haut au centre */
.card .num {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(201,169,106,.6);
  border-top: none;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, rgba(42,31,54,.98), rgba(18,12,26,.98));
  font-family: "Cinzel", serif;
  letter-spacing: .1em;
  font-size: 12px;
  color: var(--gold-soft);
  z-index: 3;
  transition: border-color .35s ease, color .35s ease;
}
.card:hover .num { border-color: var(--gold-soft); color: var(--ink); }

.card .icon { position: relative; display: grid; place-items: center; flex: 1; }
/* Halo de rayons mystiques derrière l'icône (bien visible au repos) */
.card .icon::before {
  content: "";
  position: absolute;
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(201,169,106,.18), transparent 60%),
    repeating-conic-gradient(from 0deg, rgba(201,169,106,.4) 0deg 0.7deg, transparent 0.7deg 9deg);
  -webkit-mask: radial-gradient(circle, #000 16%, rgba(0,0,0,.65) 40%, transparent 70%);
          mask: radial-gradient(circle, #000 16%, rgba(0,0,0,.65) 40%, transparent 70%);
  opacity: .85;
  z-index: 0;
  transition: opacity .35s ease, transform 12s linear;
}
.card:hover .icon::before { opacity: 1; transform: rotate(20deg); }
/* Cercle fin autour du logo (médaille) */
.card .icon::after {
  content: "";
  position: absolute;
  width: 66px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(201,169,106,.3);
  z-index: 0;
}
.card .icon svg,
.card .icon img {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
  transition: filter .35s ease, transform .35s ease;
}
.card:hover .icon img { filter: drop-shadow(0 0 10px rgba(201,169,106,.7)); transform: scale(1.08); }
.card .label {
  font-family: "Cinzel", serif;
  letter-spacing: .12em;
  font-size: 11px;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
}

/* La position de chaque carte (--top / --left / --tilt) est définie dans son
   style inline directement dans index.html — voir README pour ajouter/retirer une carte. */

/* Flottement — via la propriété `translate` pour ne pas écraser le transform de centrage */
@keyframes float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -12px; }
}

/* Survol : la carte se redresse, se soulève et s'illumine */
.card:hover {
  border-color: var(--gold-soft);
  box-shadow:
    0 22px 50px rgba(0,0,0,.65),
    0 0 30px rgba(201,169,106,.6),
    inset 0 0 30px rgba(201,169,106,.14);
  transform: translate(-50%, -50%) rotate(0deg) scale(1.08);
  animation-play-state: paused;
  z-index: 10;
}
.card:hover .icon svg { filter: drop-shadow(0 0 8px rgba(201,169,106,.6)); }

/* ===== Hint bas ===== */
.hint {
  text-align: center;
  font-family: "Cinzel", serif;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--gold-soft);
  opacity: .8;
  line-height: 1.7;
}

/* ===== Bouton rond générique (musique, coins) ===== */
.round-btn,
.music-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(201,169,106,.5);
  background: rgba(8,5,12,.6);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 20px;
  line-height: 1;
  transition: transform .25s, border-color .25s, color .25s, box-shadow .25s;
}
.music-btn { position: fixed; top: 22px; right: 22px; z-index: 7; }
.music-btn:hover,
.round-btn:hover { transform: scale(1.08); border-color: var(--gold-soft); color: var(--ink); box-shadow: 0 0 16px rgba(201,169,106,.4); }
.music-btn.playing { color: #fff; border-color: var(--gold-soft); box-shadow: 0 0 16px rgba(201,169,106,.5); }

/* ===== Coins (icône ronde + libellé dessous) ===== */
.corner {
  position: fixed;
  bottom: 20px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.corner.left { left: 24px; }
.corner.right { right: 24px; }
.corner-label {
  font-family: "Cinzel", serif;
  letter-spacing: .2em;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: .85;
  transition: color .25s, opacity .25s;
}
.corner:hover .corner-label { color: var(--ink); opacity: 1; }
.corner.right .round-btn { font-size: 18px; }

/* ===== Pop-up « Qui suis-je » ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(3, 2, 6, .72);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  animation: fade .25s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: calc(100% - 48px);
  max-width: 460px;
  padding: 38px 34px 32px;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(201,169,106,.14), transparent 70%),
    rgba(12, 8, 18, .97);
  border: 1px solid rgba(201,169,106,.55);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 0 40px rgba(0,0,0,.5);
}
/* Cadre intérieur fin */
.modal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201,169,106,.3);
  border-radius: 13px;
  pointer-events: none;
}
/* Médaillon circulaire sous la modale (assorti au sous-titre) */
.modal::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(201,169,106,.55);
  background: rgba(12, 8, 18, .98);
}
.modal-sun { display: block; width: 30px; height: 30px; margin: 0 auto 10px; animation: none; }
/* Croissant de lune logé dans le médaillon du bas */
.modal-crescent {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  font-size: 18px;
  line-height: 1;
  color: var(--gold);
  z-index: 1;
}
.modal h2 {
  font-family: "Cinzel", serif;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-size: 20px;
  color: var(--gold-soft);
  margin-bottom: 14px;
}
.modal p { font-size: 17px; line-height: 1.6; margin-bottom: 10px; }
.modal .modal-sub {
  font-family: "Cinzel", serif;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold-soft);
  opacity: .8;
  margin-top: 16px;
}
.modal-sub {
  text-align: center;
  line-height: 1.6;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 14px;
  background: none;
  border: none;
  color: var(--gold-soft);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, transform .2s;
}
.modal-close:hover { color: var(--ink); transform: scale(1.1); }

.about-content{
  max-width:380px;
  margin:0 auto;
}

.about-content p{

  margin:0;

  color:rgba(240,236,228,.92);

  font-size:15px;

  line-height:1.75;

  text-align:center;
}

.about-content strong{

  color:var(--gold-soft);

  font-weight:600;
}

.about-divider{

  margin:11px 0;

  color:var(--gold);

  opacity:.75;

  font-size:14px;

  letter-spacing:.4em;

  text-align:center;
}
.tarot-profile{
  display:flex;
  justify-content:center;
  margin:1.2rem 0 1.8rem;
}

.tarot-card{

  width:151px;

  padding:10px;

  background:
          linear-gradient(
                  160deg,
                  #151625,
                  #0d0e18
          );

  border:1px solid rgba(222,184,65,.45);

  border-radius:16px;

  box-shadow:
          0 8px 22px rgba(0,0,0,.45);

  transition:
          transform .18s ease-out,
          box-shadow .18s ease-out;

  will-change:transform;
}

.tarot-card:hover{

  transform:translateY(-3px);

  box-shadow:
          0 12px 28px rgba(0,0,0,.55),
          0 0 18px rgba(222,184,65,.18);
}

.tarot-title{

  text-align:center;

  margin-bottom:8px;

  color:#deb841;

  font-size:.75rem;

  letter-spacing:.18em;

  text-transform:uppercase;

  font-family: "Cinzel", serif;
}

.tarot-photo{

  width:100%;

  /*aspect-ratio:3/4;*/

  object-fit:cover;

  border-radius:10px;

  border:1px solid rgba(222,184,65,.45);
}

.tarot-name{

  margin-top:8px;

  text-align:center;

  color:#ece8dc;

  letter-spacing:.22em;

  font-size:.9rem;

  font-family: "Cinzel", serif;
}

.tarot-ornament{

  margin-top:6px;

  text-align:center;

  color:#deb841;

  opacity:.75;

  font-size:.8rem;

  letter-spacing:.25em;
}

/* ===== Écran d'accueil (intro) : jeu empilé face cachée ===== */
.enter-screen {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  border: 0;
  background: radial-gradient(60% 60% at 50% 45%, rgba(8,5,14,.35), rgba(3,2,6,.8));
  cursor: pointer;
  transition: opacity .7s ease, visibility .7s ease;
}
/* Une fois entré : l'écran disparaît */
body:not(.locked) .enter-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Pile de cartes face cachée */
.deck {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  animation: deckFloat 4.5s ease-in-out infinite;
}
.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1.5px solid rgba(201,169,106,.55);
  background:
    radial-gradient(1.5px 1.5px at 28% 26%, rgba(230,207,155,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 32%, rgba(230,207,155,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 42% 74%, rgba(230,207,155,.4), transparent 60%),
    radial-gradient(120% 80% at 50% 0%, rgba(201,169,106,.16), transparent 60%),
    linear-gradient(160deg, rgba(34,25,46,.96), rgba(9,6,15,.98));
  box-shadow: 0 12px 30px rgba(0,0,0,.6);
}
.deck-card:nth-child(1) { transform: rotate(-8deg) translate(-6px, 4px); }
.deck-card:nth-child(2) { transform: rotate(-3deg) translate(-2px, 2px); }
.deck-card:nth-child(3) { transform: rotate(4deg) translate(3px, 1px); }
.deck-card.deck-top {
  transform: rotate(0deg);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 38px rgba(0,0,0,.65), 0 0 26px rgba(201,169,106,.3);
}
.deck-top::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201,169,106,.32);
  border-radius: 11px;
}
.deck-emblem {
  width: 46px;
  height: 46px;
  margin: 0;
  animation: none;
  filter: drop-shadow(0 0 8px rgba(201,169,106,.55));
}
.enter-prompt {
  font-family: "Cinzel", serif;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--gold-soft);
  animation: promptPulse 2.6s ease-in-out infinite;
}
.enter-screen:hover .deck { transform: scale(1.05); transition: transform .3s ease; }
@keyframes deckFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes promptPulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }

/* ===== État verrouillé (avant l'entrée) ===== */
.cosmos, .center, .intro, .hint, .corner, .music-btn { transition: opacity .9s ease; }
body.locked .cosmos,
body.locked .center,
body.locked .intro,
body.locked .hint,
body.locked .corner,
body.locked .music-btn {
  opacity: 0;
  pointer-events: none;
}
/* Cartes empilées au centre, cachées, avant déploiement */
body.locked .card {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.5);
  opacity: 0;
  pointer-events: none;
}
/* Titre + emblème : l'animation ne démarre qu'à l'entrée */
body.locked .title .ch,
body.locked .sun-emblem { animation-play-state: paused; }

/* ===== Réduction des animations ===== */
@media (prefers-reduced-motion: reduce) {
  .card, .starfield .star, .cosmos, .sun-emblem, .deck { animation: none !important; }
  .title .ch { animation: none !important; opacity: 1; filter: none; transform: none; }
}

/* ===== Mobile : le poster entier est mis à l'échelle (cf. script.js),
   on resserre juste les boutons des coins ===== */
@media (max-width: 600px) {
  .corner.left { left: 14px; }
  .corner.right { right: 14px; }
  .corner { bottom: 14px; }
  .music-btn { top: 14px; right: 14px; }
}
