:root {
  --bg: #0a0714;
  --bg-2: #120b26;
  --panel: rgba(24, 16, 46, 0.72);
  --line: rgba(196, 166, 255, 0.18);
  --text: #f2ecff;
  --muted: #b9aed6;
  --gold: #f5c86b;
  --lilac: #c4a6ff;
  --pink: #ff9ecb;
  --green: #7ef0c0;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% -10%, #241446 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 62%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 70%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 35%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 85%, rgba(255,255,255,.45) 50%, transparent 51%);
  opacity: .7;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(10, 7, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .5px;
}
.brand span { color: var(--gold); }
.topnav { display: flex; gap: 18px; flex-wrap: wrap; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
  transition: color .2s;
}
.topnav a:hover { color: var(--gold); }

main { position: relative; z-index: 1; }

.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 110px) 20px 40px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lilac);
  margin-bottom: 12px;
}
h1, h2, h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; margin: 0; }
h1 {
  font-size: clamp(2.8rem, 9vw, 5.4rem);
  line-height: .95;
  letter-spacing: -.02em;
}
h1 em { color: var(--gold); font-style: italic; }
.lead {
  color: var(--muted);
  font-size: clamp(.98rem, 2.2vw, 1.12rem);
  line-height: 1.65;
  max-width: 620px;
  margin: 18px auto 0;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.mini { color: var(--muted); font-size: .78rem; margin-top: 16px; opacity: .8; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--gold), #ffb35c);
  color: #1a1023;
  font-weight: 800;
  font-size: .92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
  box-shadow: 0 12px 30px rgba(245, 200, 107, .22);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(245, 200, 107, .3); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn.small { padding: 9px 18px; font-size: .82rem; }

.panel {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) 20px;
}
.panel-head { text-align: center; margin-bottom: 28px; }
.panel-head h2 { font-size: clamp(2rem, 5vw, 2.9rem); }
.panel-head p { color: var(--muted); margin: 10px auto 0; max-width: 560px; line-height: 1.6; }

/* ---------- Carta ---------- */
.tarot-card {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 2 / 3;
  perspective: 1200px;
  flex: none;
}
.tarot-card .face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(245, 200, 107, .55);
  box-shadow: var(--shadow), inset 0 0 40px rgba(245, 200, 107, .08);
  overflow: hidden;
}
.tarot-card .front {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(196, 166, 255, .28), transparent 60%),
    linear-gradient(180deg, #241445, #150d2b 70%, #0e0820);
  transform: rotateY(180deg);
}
.tarot-card .backface {
  background:
    repeating-linear-gradient(45deg, rgba(196,166,255,.12) 0 8px, transparent 8px 16px),
    radial-gradient(circle at 50% 40%, #2a1850, #130b29 70%);
}
.tarot-card .back-mark { font-size: 3.6rem; color: var(--gold); opacity: .9; }
.tarot-card.flipped .front { transform: rotateY(0deg); }
.tarot-card.flipped .backface { transform: rotateY(-180deg); }
.tarot-card .num {
  font-size: .78rem;
  letter-spacing: .22em;
  color: var(--gold);
  font-weight: 700;
}
.tarot-card .symbol { font-size: clamp(3.4rem, 10vw, 5.4rem); line-height: 1; filter: drop-shadow(0 0 18px rgba(245,200,107,.35)); }
.tarot-card .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  text-align: center;
  padding: 0 14px;
}

.daily-wrap {
  display: flex;
  gap: clamp(20px, 5vw, 54px);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.daily-copy { max-width: 420px; }
.streak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 200, 107, .12);
  border: 1px solid rgba(245, 200, 107, .35);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.result h3 { font-size: 1.6rem; margin-bottom: 6px; }
.result p { color: var(--muted); line-height: 1.6; }
.result .hint {
  color: var(--lilac);
  font-size: .88rem;
  background: rgba(196, 166, 255, .08);
  border-left: 3px solid var(--lilac);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  margin-top: 12px;
}
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.countdown { color: var(--muted); font-size: .78rem; margin-top: 16px; }

/* ---------- Tirada ---------- */
.spread {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}
.pick-card {
  width: clamp(64px, 11vw, 104px);
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 1px solid rgba(196, 166, 255, .35);
  background:
    repeating-linear-gradient(45deg, rgba(196,166,255,.12) 0 6px, transparent 6px 12px),
    radial-gradient(circle at 50% 40%, #2a1850, #130b29 70%);
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform .25s, border-color .2s, opacity .3s;
}
.pick-card:hover { transform: translateY(-8px); border-color: var(--gold); }
.pick-card.picked { opacity: .18; pointer-events: none; transform: translateY(10px) scale(.94); }
.spread-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.spread-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.pos {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.pos h3 { color: var(--gold); font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; font-family: 'Inter', sans-serif; font-size: .74rem; }
.pos .cardline { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.pos .cardline .em { font-size: 1.7rem; }
.pos .cardline strong { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 600; }
.pos p { color: var(--muted); font-size: .9rem; line-height: 1.55; margin: 6px 0 0; }

/* ---------- Compatibilidad ---------- */
.compat-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.compat-form input {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 13px 16px;
  border-radius: 12px;
  min-width: 200px;
  font: inherit;
}
.compat-form input:focus { outline: none; border-color: var(--lilac); box-shadow: 0 0 0 3px rgba(196,166,255,.15); }
.amp { color: var(--gold); font-size: 1.4rem; }
.compat-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p, 0) * 1%), rgba(255,255,255,.08) 0);
  position: relative;
  flex: none;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #120b26;
}
.ring span { position: relative; font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; color: var(--gold); }
.compat-copy { max-width: 380px; }
.compat-copy h3 { font-size: 1.5rem; margin-bottom: 8px; }
.compat-copy p { color: var(--muted); line-height: 1.6; }

/* ---------- Colección ---------- */
.collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.mini-card {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1d1236, #120b26);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  color: var(--muted);
  filter: grayscale(1) brightness(.55);
  transition: filter .3s, transform .2s;
}
.mini-card.seen { filter: none; border-color: rgba(245, 200, 107, .5); }
.mini-card:hover { transform: translateY(-3px); }
.mini-card .s { font-size: 1.6rem; }
.mini-card .n { font-size: .62rem; line-height: 1.15; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 28px 20px 44px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.7;
}
.footer a { color: var(--lilac); }
.tiny { font-size: .74rem; opacity: .7; }

/* ---------- Modal compartir ---------- */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 3, 12, .82);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 18px;
}
.share-modal[hidden] { display: none; }
.share-box {
  background: #140d28;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.share-box img { width: 100%; border-radius: 12px; margin: 12px 0; display: block; }
.share-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .topnav { display: none; }
  .hero { padding-top: 42px; }
  .tarot-card { width: min(230px, 64vw); }
  .daily-wrap { gap: 18px; }
}

/* ===== Ajustes majestuosos ===== */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 30% at 18% 8%, rgba(120, 80, 255, .24), transparent 70%),
    radial-gradient(35% 26% at 82% 16%, rgba(255, 120, 180, .18), transparent 70%),
    radial-gradient(32% 26% at 50% 82%, rgba(245, 200, 107, .12), transparent 70%);
  filter: blur(24px);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  to { transform: translate3d(0, -3%, 0) scale(1.06); }
}

h1 {
  background: linear-gradient(180deg, #ffffff 20%, #f0dcae 70%, #d9b877 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 50px rgba(245, 200, 107, .18);
}
h1 em { color: var(--gold); -webkit-text-fill-color: var(--gold); }

.panel-head h2 {
  background: linear-gradient(180deg, #fff 30%, #e9d6ab 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Chips de tema */
.chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto 24px;
}
.chip {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { color: var(--text); border-color: rgba(196, 166, 255, .5); }
.chip.active {
  color: #1a1023;
  background: linear-gradient(135deg, var(--gold), #ffcb7d);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(245, 200, 107, .25);
}

/* Carta con acento por arcano */
.tarot-card .front {
  background:
    radial-gradient(120% 80% at 50% 0%, hsl(var(--hue, 270) 75% 62% / .38), transparent 62%),
    linear-gradient(180deg, #241445, #150d2b 70%, #0e0820);
  overflow: hidden;
}
.tarot-card .front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .18) 46%, transparent 60%);
  transform: translateX(-130%);
  transition: transform .9s ease;
  pointer-events: none;
}
.tarot-card.flipped .front::after { transform: translateX(130%); }
.tarot-card.flipped { animation: cardIn .85s cubic-bezier(.2, .8, .2, 1); }
@keyframes cardIn {
  0% { transform: scale(.92) rotate(-2.5deg); opacity: .55; filter: blur(2px); }
  100% { transform: none; opacity: 1; filter: none; }
}

/* Badges de lectura */
.orientation {
  display: inline-block;
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: #1a1023;
  background: var(--gold);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.revtag {
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pink);
  border: 1px solid rgba(255, 158, 203, .45);
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: middle;
}

/* Síntesis de la tirada */
.synthesis {
  margin-top: 18px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(245, 200, 107, .32);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(245, 200, 107, .12), transparent 60%),
    rgba(20, 13, 40, .75);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}
.synthesis .eyebrow { margin-bottom: 6px; color: var(--gold); }
.synthesis p { margin: 0; line-height: 1.7; color: var(--text); }

/* Resultado con más aire */
.result { animation: fadeUp .5s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.pos { transition: border-color .2s, transform .2s; }
.pos:hover { border-color: rgba(245, 200, 107, .35); transform: translateY(-2px); }

/* Footer y enlaces */
.footer a:hover { color: var(--gold); }

[hidden] { display: none !important; }

/* ===== Capa de videojuego ===== */
.sky-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255, 236, 189, .6), rgba(245, 200, 107, .12) 40%, transparent 70%);
}
.flash.on { animation: flashHit .6s ease-out; }
@keyframes flashHit {
  0% { opacity: 0; }
  10% { opacity: .9; }
  100% { opacity: 0; }
}

.burst-layer {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  overflow: hidden;
}
.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold), 0 0 4px #fff;
  animation: sparkFly var(--dur, .9s) cubic-bezier(.1, .7, .3, 1) forwards;
}
.spark.pink { background: var(--pink); box-shadow: 0 0 14px var(--pink); }
.spark.lilac { background: var(--lilac); box-shadow: 0 0 14px var(--lilac); }
@keyframes sparkFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* HUD */
.hud {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 11, 38, .85), rgba(10, 7, 20, .45));
  backdrop-filter: blur(10px);
}
.hud-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: 'Orbitron', sans-serif;
  font-size: .72rem;
  letter-spacing: .04em;
}
.hud-item .ico { font-size: .95rem; }
.hud-level { gap: 9px; }
.lvl {
  color: var(--gold);
  font-weight: 800;
  font-size: .68rem;
  border: 1px solid rgba(245, 200, 107, .45);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(245, 200, 107, .08);
}
.xp {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.xp i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ff9ecb);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 0 12px rgba(245, 200, 107, .6);
}
.hud-sound {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .9rem;
  transition: border-color .2s, background .2s;
}
.hud-sound:hover { border-color: var(--gold); background: rgba(245, 200, 107, .1); }
.hud-sound.on { border-color: var(--gold); color: var(--gold); }

/* Misión */
.quest {
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
}
.quest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 9px;
}
.quest-head strong { color: var(--gold); font-family: 'Orbitron', sans-serif; font-size: .72rem; }
.quest-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.quest-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ff9ecb);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.quest.done { border-color: rgba(126, 240, 192, .5); }
.quest.done strong { color: var(--green); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(245, 200, 107, .55);
  background: rgba(20, 13, 40, .97);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .55);
  transform: translate(-50%, 18px);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s;
  max-width: min(92vw, 420px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-ico { font-size: 1.1rem; }
.toast-txt { font-size: .82rem; color: var(--text); }

/* Tilt 3D */
.tarot-card { will-change: transform; transition: transform .18s ease-out; }
.tarot-card.no-tilt { transition: transform .7s cubic-bezier(.2, .8, .2, 1); }

/* Barajado */
.spread.shuffling .pick-card { animation: shuffleCard .55s cubic-bezier(.2, .8, .2, 1) both; }
.spread.shuffling .pick-card:nth-child(2) { animation-delay: .04s; }
.spread.shuffling .pick-card:nth-child(3) { animation-delay: .08s; }
.spread.shuffling .pick-card:nth-child(4) { animation-delay: .12s; }
.spread.shuffling .pick-card:nth-child(5) { animation-delay: .16s; }
.spread.shuffling .pick-card:nth-child(6) { animation-delay: .2s; }
.spread.shuffling .pick-card:nth-child(7) { animation-delay: .24s; }
@keyframes shuffleCard {
  0% { transform: none; }
  40% { transform: translateY(-16px) rotate(-6deg) scale(1.03); }
  70% { transform: translateY(4px) rotate(4deg); }
  100% { transform: none; }
}

/* Texto que se escribe */
.typing::after {
  content: "▍";
  color: var(--gold);
  margin-left: 2px;
  animation: caret .8s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* Botón de revelar con pulso */
#revealDaily:not(:disabled) { animation: btnPulse 2.6s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(245, 200, 107, .22); }
  50% { box-shadow: 0 12px 46px rgba(245, 200, 107, .48); }
}

/* Entradas */
.hero-copy { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.panel { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.mini-card.seen { animation: pop .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pop {
  from { opacity: 0; transform: scale(.86); }
  to { opacity: 1; transform: none; }
}

/* Compatibilidad animada */
.ring { transition: background .9s cubic-bezier(.2, .8, .2, 1); }

/* Accesibilidad: menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .sky-canvas, .flash, .burst-layer { display: none; }
}

@media (max-width: 640px) {
  .hud { gap: 12px; padding: 8px 12px; }
  .xp { width: 78px; }
  .hud-item { font-size: .66rem; }
}

.hud {
  position: sticky;
  top: 56px;
  z-index: 19;
}
@media (max-width: 640px) {
  .hud { top: 52px; }
}

section[id], .panel[id] { scroll-margin-top: 128px; }
@media (max-width: 640px) { section[id], .panel[id] { scroll-margin-top: 112px; } }

/* ===== Secuencia de tirada ===== */
.pick-card {
  transform-style: preserve-3d;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s, opacity .4s, filter .4s;
}
.pick-card.chosen {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-12px);
  box-shadow: 0 18px 38px rgba(245, 200, 107, .3), 0 0 0 1px rgba(245, 200, 107, .35) inset;
}
.pick-card.chosen span { font-size: 1.7rem; }
.spread.dealing .pick-card {
  opacity: .18;
  transform: scale(.92);
  filter: grayscale(.5);
  pointer-events: none;
}
.spread.dealing .pick-card.chosen {
  opacity: 1;
  filter: none;
  transform: translateY(-14px) scale(1.03);
}

.reading-stage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 26px 0 10px;
  perspective: 1300px;
}
.stage-item { text-align: center; }
.stage-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.stage-card {
  position: relative;
  margin: 0 auto;
  width: min(100%, 210px);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform .95s cubic-bezier(.2, .8, .2, 1);
}
.stage-item.flip .stage-card { transform: rotateY(180deg); }
.stage-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(245, 200, 107, .5);
  box-shadow: var(--shadow), inset 0 0 34px rgba(245, 200, 107, .07);
  overflow: hidden;
}
.sback {
  background:
    repeating-linear-gradient(45deg, rgba(196, 166, 255, .12) 0 7px, transparent 7px 14px),
    radial-gradient(circle at 50% 40%, #2a1850, #130b29 70%);
  color: var(--gold);
  font-size: 2.4rem;
}
.sback span { animation: floatMark 3.4s ease-in-out infinite alternate; }
@keyframes floatMark {
  to { transform: translateY(-5px); opacity: .8; }
}
.sfront {
  transform: rotateY(180deg);
  background:
    radial-gradient(120% 80% at 50% 0%, hsl(var(--hue, 270) 75% 62% / .42), transparent 62%),
    linear-gradient(180deg, #241445, #150d2b 70%, #0e0820);
}
.sfront .s { font-size: 2.7rem; filter: drop-shadow(0 0 16px rgba(245, 200, 107, .4)); }
.sfront .n {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.06rem;
  padding: 0 10px;
  line-height: 1.2;
}
.sfront .rev {
  font-style: normal;
  font-size: .54rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pink);
}
.stage-text {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--muted);
  min-height: 4.6em;
  margin: 12px 0 0;
  padding: 0 4px;
  text-align: left;
}
.stage-item.flip .stage-text { color: var(--text); }

@media (max-width: 640px) {
  .reading-stage { grid-template-columns: 1fr; gap: 24px; }
  .stage-card { width: min(70vw, 210px); }
  .stage-text { min-height: 0; }
}

/* ===== Arte real de las cartas ===== */
.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 0;
  background: #0e0820;
}
.card-art.rev { transform: rotate(180deg); }
.face.front { background: #0e0820; }
.face.front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(10,7,20,.18), transparent 32%, transparent 62%, rgba(10,7,20,.86));
  pointer-events: none;
}
.face.front .name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  background: rgba(10, 7, 20, .72);
  border: 1px solid rgba(245, 200, 107, .3);
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 1rem;
  line-height: 1.15;
  text-align: center;
}
.tarot-card .front::after { z-index: 4; }
.face.front .num, .face.front .symbol { display: none; }

.sfront { padding: 0; background: #0e0820; }
.s-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  z-index: 0;
  background: #0e0820;
}
.s-art.rev { transform: rotate(180deg); }
.sfront::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
  background: linear-gradient(180deg, transparent 58%, rgba(10,7,20,.9));
  pointer-events: none;
}
.sfront .n {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(10, 7, 20, .78);
  padding: 4px 6px;
  border-radius: 8px;
  font-size: .88rem;
  line-height: 1.15;
}
.sfront .rev {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(10, 7, 20, .8);
  padding: 2px 7px;
  border-radius: 999px;
}
.sfront .rev:empty { display: none; }

.mini-card {
  display: block;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.mini-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: grayscale(1) brightness(.42);
  opacity: .55;
  transition: filter .3s, opacity .3s;
}
.mini-card.seen .mini-art { filter: none; opacity: 1; }
.mini-card .n {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 4px 5px;
  background: linear-gradient(180deg, transparent, rgba(10, 7, 20, .94));
  font-size: .58rem;
  line-height: 1.1;
}

/* ===== Carrusel 3D ===== */
.deck-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 4px;
  transition: opacity .4s, filter .4s;
}
.deck-carousel.dealing { opacity: .25; filter: blur(1px); pointer-events: none; }
.spread {
  position: relative;
  display: block;
  width: min(100%, 680px);
  height: 330px;
  margin: 0;
  flex: 1;
  perspective: 1100px;
  overflow: hidden;
  outline: none;
}
.pick-card {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 132px;
  height: 220px;
  margin-left: -66px;
  border-radius: 13px;
  font-size: 1.8rem;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .35s, border-color .25s, box-shadow .25s;
  will-change: transform;
}
.pick-card.is-center {
  border-color: var(--gold);
  box-shadow: 0 24px 55px rgba(245, 200, 107, .32), 0 0 0 1px rgba(245, 200, 107, .35) inset;
}
.pick-card.is-center span { transform: scale(1.12); }
.pick-card span { transition: transform .3s; display: inline-block; }
.pick-card.chosen { border-color: var(--gold); }
.deck-arrow {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20, 13, 40, .85);
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
  z-index: 6;
}
.deck-arrow:hover { border-color: var(--gold); background: rgba(245, 200, 107, .12); transform: scale(1.06); }
.deck-hint {
  text-align: center;
  color: var(--muted);
  font-size: .74rem;
  margin: 0 0 16px;
  opacity: .8;
}
@media (max-width: 640px) {
  .spread { height: 300px; }
  .pick-card { width: 116px; height: 194px; margin-left: -58px; }
  .deck-arrow { width: 34px; height: 34px; }
}

/* ===== Setup: nombre y voz ===== */
.setup {
  max-width: 640px;
  margin: 22px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.setup-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: .8rem;
  color: var(--muted);
}
.setup-field em { font-style: normal; opacity: .6; font-size: .7rem; }
.setup-field input {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font: inherit;
  min-width: 170px;
  text-align: center;
}
.setup-field input:focus {
  outline: none;
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(196, 166, 255, .15);
}
.setup-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: .8rem;
  color: var(--muted);
}
.chips-inline { margin: 0; }
.chips-inline .chip { padding: 6px 12px; font-size: .74rem; }
.setup-note { font-size: .68rem; color: var(--muted); opacity: .65; margin: 0; }
.greeting {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--gold);
  margin: 0 0 10px;
}

.setup-voice select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  min-width: 130px;
}
.setup-voice select:focus {
  outline: none;
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(196, 166, 255, .15);
}
.setup-voice option { background: #140d28; color: var(--text); }

.setup {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
}
.setup-note { flex-basis: 100%; text-align: center; }
@media (max-width: 560px) {
  .setup { flex-direction: column; }
}

.sign {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold);
  text-align: right;
  margin: 14px 0 0;
}

/* ===== Neón dorado en cartas ===== */
.pick-card {
  border-color: rgba(245, 200, 107, .7);
  box-shadow:
    0 0 10px rgba(245, 200, 107, .28),
    0 0 2px rgba(255, 223, 150, .5),
    inset 0 0 12px rgba(245, 200, 107, .14);
}
.pick-card.is-center {
  border-color: #ffd98a;
  box-shadow:
    0 0 0 1px rgba(255, 217, 138, .9),
    0 0 18px rgba(245, 200, 107, .6),
    0 0 48px rgba(245, 200, 107, .32),
    inset 0 0 26px rgba(245, 200, 107, .2);
  animation: neonCard 2.4s ease-in-out infinite;
}
@keyframes neonCard {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

.tarot-card .face {
  box-shadow:
    0 0 0 1px rgba(245, 200, 107, .55),
    0 0 22px rgba(245, 200, 107, .25),
    var(--shadow);
}
.tarot-card.flipped .face.front {
  animation: neonSoft 3s ease-in-out infinite;
}
.stage-face {
  box-shadow:
    0 0 0 1px rgba(245, 200, 107, .5),
    0 0 20px rgba(245, 200, 107, .22),
    var(--shadow);
}
.stage-item.flip .sfront {
  animation: neonSoft 3s ease-in-out infinite;
}
@keyframes neonSoft {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(245, 200, 107, .5),
      0 0 18px rgba(245, 200, 107, .22),
      var(--shadow);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 217, 138, .85),
      0 0 34px rgba(245, 200, 107, .42),
      var(--shadow);
  }
}
.deck-arrow {
  box-shadow: 0 0 12px rgba(245, 200, 107, .18);
}
.deck-arrow:hover {
  box-shadow: 0 0 20px rgba(245, 200, 107, .45);
}

.lang-select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  padding: 6px 8px;
  border-radius: 9px;
  cursor: pointer;
}
.lang-select:focus { outline: none; border-color: var(--gold); }
.lang-select option { background: #140d28; color: var(--text); }

/* Marco celestial de fondo (SVG original) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('bg-celestial.svg') center center / 100% 100% no-repeat;
  opacity: .22;
}
@media (max-width: 640px) {
  body::after { opacity: .16; }
}

/* Animación del marco celestial */
body {
  --frame-min: .16;
  --frame-max: .26;
}
body::after {
  animation: frameBreath 16s ease-in-out infinite alternate;
  will-change: opacity, transform;
}
@keyframes frameBreath {
  from { opacity: var(--frame-min); transform: scale(1); }
  to { opacity: var(--frame-max); transform: scale(1.018); }
}
.frame-shine {
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 43%, rgba(233, 203, 141, .055) 50%, transparent 57%);
  animation: frameShine 12s linear infinite;
}
@keyframes frameShine {
  0% { transform: translateX(-45%); }
  100% { transform: translateX(45%); }
}
@media (max-width: 640px) {
  body { --frame-min: .12; --frame-max: .19; }
}

/* Marco adaptativo (sin deformar) */
body::after { display: none !important; }

.bg-frame {
  position: fixed;
  left: 14px;
  right: 14px;
  top: 110px;
  bottom: 14px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(233, 203, 141, .32);
  border-radius: 24px;
  color: #e9cb8d;
  animation: framePulse 16s ease-in-out infinite alternate;
}
.bg-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(233, 203, 141, .15);
  border-radius: 18px;
}
.orn {
  position: absolute;
  color: #e9cb8d;
  filter: drop-shadow(0 0 6px rgba(233, 203, 141, .25));
}
.orn-sun { display: none; }
.orn-bottom-star {
  width: 32px;
  height: 32px;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  opacity: .8;
}
.orn-moon { width: 30px; height: 30px; top: 14px; opacity: .7; }
.orn-moon.tl { left: 14px; }
.orn-moon.tr { right: 14px; transform: scaleX(-1); }
.orn-corner-star { width: 22px; height: 22px; bottom: 14px; opacity: .6; }
.orn-corner-star.bl { left: 22px; }
.orn-corner-star.br { right: 22px; }
@keyframes framePulse {
  from { opacity: .55; }
  to { opacity: .9; }
}
@media (max-width: 640px) {
  .bg-frame { top: 102px; left: 8px; right: 8px; bottom: 8px; border-radius: 18px; }
  .bg-frame::before { inset: 5px; border-radius: 13px; }
  .orn-moon { width: 22px; height: 22px; top: 10px; }
  .orn-moon.tl { left: 10px; }
  .orn-moon.tr { right: 10px; }
  .orn-bottom-star { width: 24px; height: 24px; bottom: -12px; }
  .orn-corner-star { width: 16px; height: 16px; bottom: 10px; }
  .orn-corner-star.bl { left: 14px; }
  .orn-corner-star.br { right: 14px; }
}

/* ===== Mobile / touch ===== */
.spread, .pick-card { touch-action: pan-y; }
.share-box { max-height: 92vh; overflow: auto; }
.share-actions .btn { flex: 1 1 140px; }
@media (max-width: 640px) {
  .hud { gap: 8px; padding: 6px 10px; }
  .hud .xp { width: 64px; }
  .hud-item { font-size: .62rem; }
  .hud-sound { width: 28px; height: 28px; font-size: .8rem; }
  .lang-select { font-size: .66rem; padding: 5px 6px; }
  .setup-field input, .setup-voice select, .compat-form input { font-size: 16px; }
  .hero-actions .btn { flex: 1 1 160px; }
  .share-box { max-height: 94vh; padding: 14px; }
  .share-actions { gap: 8px; }
  .share-actions .btn { flex: 1 1 100%; }
  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .reading-stage { gap: 18px; }
  .stage-card { width: min(64vw, 200px); }
  .stage-text { font-size: .78rem; }
}
