:root {
  color-scheme: dark;
  --bg: #130d1c;
  --panel: #1d142a;
  --ink: #fff0dc;
  --muted: #c9bcd2;
  --neon: #e9ff77;
  --line: #63506c;
  font-family: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse 70% 29rem at 24% 9rem, #30213e, transparent), var(--bg); }
a { color: inherit; text-underline-offset: .25em; }
button, textarea { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--neon); outline-offset: 5px; }
.shell { width: min(100%, 1150px); margin-inline: auto; padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
.skip { position: absolute; top: 1rem; left: 1rem; z-index: 2; padding: .5rem; background: var(--bg); transform: translateY(-180%); }
.skip:focus { transform: none; }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-top: max(12px, env(safe-area-inset-top)); min-height: 67px; border-bottom: 1px solid #63506c70; }
.bar a { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-weight: 700; font-size: .88rem; }
.brand img { display: block; object-fit: contain; max-width: 100%; height: auto; }
.bar .deck-link { justify-self: end; color: var(--neon); }
.hero { display: grid; grid-template-columns: 1.07fr 1fr; align-items: center; gap: clamp(20px, 4.5vw, 65px); min-height: min(730px, calc(100svh - 67px)); padding-block: 34px 46px; }
.showcase { min-height: 360px; aspect-ratio: 1.025; position: relative; isolation: isolate; display: grid; place-items: center; }
.orbit { position: absolute; width: 94%; aspect-ratio: 1.12; border: 1px solid #927cb06b; border-radius: 50%; transform: rotate(-24deg); z-index: -1; }
.orbit-narrow { width: 74%; aspect-ratio: .97; transform: rotate(27deg); border-style: dashed; }
.spark { position: absolute; color: var(--neon); font-size: 1.6rem; }
.spark-left { left: 5%; bottom: 16%; }
.spark-right { right: 4%; top: 16%; }
.show-card { position: absolute; overflow: hidden; aspect-ratio: .6; width: 45%; max-width: 260px; border-radius: 13px; border: 1px solid #d1ae78; box-shadow: 0 20px 36px #050208ba; background: var(--panel); }
.show-card img, .card-face img, .pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.show-card.left { transform: translateX(-55%) rotate(-16deg) scale(.9); }
.show-card.right { transform: translateX(55%) rotate(16deg) scale(.9); }
.show-card.front { transform: translateY(-3%) rotate(-2deg); }
.kicker { margin: 0 0 9px; font-weight: 800; font-size: .74rem; color: var(--neon); letter-spacing: .16em; text-transform: uppercase; }
h1, h2, .card-name { font-family: Georgia, serif; }
h1, h2 { margin: 0; font-weight: 500; letter-spacing: -.055em; line-height: .95; }
h1 { font-size: clamp(6rem, 13vw, 12rem); }
h2 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.lead { max-width: 28rem; margin: 15px 0 26px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.5; }
#preguntar, .mode-select { display: grid; gap: 11px; }
#preguntar > label { font-weight: 700; }
textarea { width: 100%; resize: vertical; min-height: 68px; background: #20162c; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
textarea::placeholder { color: #b7a8c0; }
textarea[aria-invalid="true"] { border-color: #ffc88d; }
.question-warning {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #a57559;
  border-radius: 10px;
  background: #321f2e;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.5;
}
.question-warning strong { display: block; color: #ffc88d; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .65em; min-height: 48px; padding: .7em 1.15em; border: 1px solid transparent; border-radius: 8px; font-weight: 800; }
.button.primary { color: #161722; background: var(--neon); }
@media (hover: hover) { .button.primary:hover { background: #f6ffb9; } }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
@media (hover: hover) { .button.quiet:hover { background: var(--panel); } }
.button:active { transform: scale(.98); }
#preguntar .primary { justify-content: space-between; width: 100%; }
.pro-line { color: var(--muted); line-height: 1.5; font-size: .85rem; }
.pro-line a { color: var(--neon); font-weight: 800; }
.quick, .mode-select { display: flex; flex-wrap: wrap; gap: 7px; }
.mode-select label { display: flex; align-items: center; gap: 6px; min-height: 44px; padding-right: .55em; }
input[type=radio] { accent-color: var(--neon); }
.quick button, .filters button { border: 1px solid var(--line); border-radius: 100px; min-height: 44px; padding: .5em .85em; color: var(--ink); background: var(--panel); font-size: .85rem; font-weight: 750; }
@media (hover: hover) { .quick button:hover { background: var(--neon); color: var(--bg); border-color: var(--neon); } }
.filters button[aria-pressed=true], .quick button:active { background: var(--neon); color: var(--bg); border-color: var(--neon); }
.playing { min-height: calc(100svh - 67px); padding-block: clamp(35px, 8vh, 86px) 30px; text-align: center; }
.progress, .question, .share-status { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.fan { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(5px, 2vw, 18px); width: min(640px, 100%); margin: 35px auto 32px; align-items: center; }
.pick, .reading .card-face, #detalle-carta .card-art {
  --rx: 0; --ry: 0; --mx: 50%; --my: 50%; --sx: 0; --sy: 0; --lift: 0px;
  transform: perspective(620px) translateY(var(--lift)) rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg));
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.2,.9,.25,1.15), box-shadow .3s ease, opacity .25s ease, filter .3s ease, border-color .2s;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.pick { position: relative; min-width: 0; min-height: 44px; aspect-ratio: .6; padding: 0; overflow: hidden; border: 1px solid #bd9667; border-radius: 8px; background: var(--panel); box-shadow: calc(var(--sx) * -.6px) calc(14px + var(--sy) * .5px) 28px #08050bbf; animation: float 5.5s ease-in-out infinite; }
.pick:nth-child(2n) { animation-delay: -1.8s; }
.pick:nth-child(3n) { animation-delay: -3.4s; }
@keyframes float { 50% { translate: 0 -4px; } }
.pick::after, .reading .card-face::after, #detalle-carta .card-art::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--mx) var(--my), #ffffff6e 0, #f4e3a63a 22%, transparent 55%);
  mix-blend-mode: soft-light;
}
.pick[data-tilting], .reading .card-face[data-tilting], #detalle-carta .card-art[data-tilting] { --lift: -8px; transition-duration: .08s, .08s, .25s, .3s, .2s; }
.pick[data-tilting]::after, .reading .card-face[data-tilting]::after, #detalle-carta .card-art[data-tilting]::after { opacity: 1; }
.pick:active:not(:disabled) { --lift: -5px; }
.fan.is-shuffling .pick { pointer-events: none; animation: none; }
.fan.is-picking .pick:not(.is-turning):not([data-revealed]) { opacity: .38; filter: saturate(.55) brightness(.85); --lift: 4px; animation: none; }
.pick:disabled { opacity: .6; cursor: default; }
.pick.is-turning { z-index: 2; opacity: 1; border-color: var(--neon); animation: reveal 1.25s cubic-bezier(.22,.7,.25,1) both; }
@keyframes reveal {
  0% { transform: perspective(520px) translateY(0) rotateY(0) scale(1); box-shadow: 0 14px 28px #08050bbf; }
  8% { transform: perspective(520px) translateY(-10px) rotate(-1.6deg) scale(1.05); box-shadow: 0 0 18px #ccf35a60; }
  14% { transform: perspective(520px) translateY(-12px) rotate(1.6deg) scale(1.06); box-shadow: 0 0 26px #ccf35a90; }
  20% { transform: perspective(520px) translateY(-14px) rotate(-1.2deg) scale(1.07); box-shadow: 0 0 34px #ccf35aaa; }
  28% { transform: perspective(520px) translateY(-16px) rotateY(-18deg) scale(1.09); box-shadow: 0 0 38px #ccf35ac0; }
  42% { transform: perspective(520px) translateY(-28px) rotateY(90deg) scale(1.14); }
  60%, 74% { transform: perspective(520px) translateY(-24px) rotateY(0) scale(1.15); box-shadow: 0 0 30px #ccf35a80; }
  100% { transform: perspective(520px) translateY(0) rotateY(0) scale(1); box-shadow: 0 14px 28px #08050bbf; }
}
.reading { display: flex; justify-content: center; align-items: start; flex-wrap: wrap; gap: 22px; margin: 25px auto; }
.interpretation { width: min(245px, 100%); }
.interpretation p { line-height: 1.45; }
.interpretation .copy { color: var(--muted); }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.gallery { border-top: 1px solid var(--line); padding-block: 36px 46px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 20px 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-items: stretch; }
.card-button { min-width: 0; padding: 0; border: 0; border-radius: 10px; color: inherit; text-align: center; background: transparent; }
@media (hover: hover) { .card-button:hover .card-face { border-color: var(--neon); } }
.card-button { transition: transform .15s; }
.card-button:active { transform: scale(.96); }
.card-face { --accent: #f1cca4; margin: 0; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: #231832; }
.card-face.bastos { --accent: #ffb185; }
.card-face.copas { --accent: #bfeafa; }
.card-face.espadas { --accent: #ebd7ff; }
.card-face.oros { --accent: #ead895; }
.card-art { aspect-ratio: 2 / 3; position: relative; }
.card-mark { position: absolute; top: 7px; left: 7px; padding: 3px 6px; border: 1px solid var(--accent); border-radius: 5px; color: var(--accent); background: #1b1423; font-size: .67rem; font-weight: 800; }
.card-face figcaption { display: grid; gap: .24rem; padding: .6em .45em .78em; }
.card-name { display: block; color: var(--ink); font-size: 1.05rem; line-height: 1.07; }
.card-theme { font-size: .75rem; }
dialog { position: fixed; width: min(390px, calc(100% - 24px)); max-height: 90dvh; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: #07050bd9; }
.dialog-inner { position: relative; padding: 20px; text-align: center; }
.close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; z-index: 1; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #130d1c; font-size: 1.65rem; }
#detalle-carta { width: min(165px, 60%); margin: 0 auto 14px; }
#detalle-titulo { font-size: 2.2rem; }
#detalle-tema { color: var(--neon); }
.footer { padding-block: 20px max(22px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.footer p { margin: 0; }
.footer a { color: var(--ink); }
@media (max-width: 740px) {
  .hero { grid-template-columns: 1fr; justify-items: center; gap: 10px; padding-block: 15px 30px; }
  .intro { width: min(100%, 470px); }
  .showcase { width: min(100%, 360px); min-height: 0; height: min(36svh, 310px); }
  .orbit-wide { width: 80%; }
  .show-card { width: auto; height: 80%; }
  h1 { font-size: clamp(5rem, 21vw, 7rem); }
  .lead { margin-block: 10px 19px; }
  .reading.triple { display: grid; grid-template-columns: 1fr; }
  .reading.triple .interpretation { width: 100%; display: grid; grid-template-columns: 105px 1fr; gap: 14px; align-items: center; text-align: left; }
  .bar { gap: 8px; }
  .bar .brand img { width: 114px; }
}
@media (max-width: 360px) {
  .shell { padding-inline: 15px; }
  .bar a { font-size: .76rem; }
  .showcase { height: min(33svh, 240px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pick, .reading .card-face, #detalle-carta .card-art { transform: none; }
}
.tabletop {
  position: relative;
  isolation: isolate;
  width: min(900px, 100%);
  margin: 24px auto;
  padding: clamp(22px, 5vw, 65px) clamp(12px, 4vw, 36px);
  border: 1px solid #8e778b;
  border-radius: clamp(20px, 4vw, 60px);
  background: radial-gradient(ellipse at center, #392546 4%, #221630 70%);
  box-shadow: inset 0 0 0 4px #211629, inset 0 0 0 5px #8369857a, 0 18px 45px #05010970;
}
.tabletop .fan { margin-block: 0; }
.table-effect { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.pick[data-revealed] { opacity: 1; border-color: var(--neon); }
.reading:not(.triple) .interpretation { width: min(680px, 100%); display: grid; grid-template-columns: minmax(125px, .62fr) 1fr; gap: clamp(14px, 4vw, 33px); text-align: left; align-items: center; }
.interpretation h3 { margin-block: .75em .18em; color: var(--neon); font-size: .93rem; }
.interpretation .copy { margin-top: 0; }
@media (max-width: 460px) {
  .reading:not(.triple) .interpretation { grid-template-columns: min(175px, 70%) 1fr; justify-content: start; align-items: start; }
  .reading:not(.triple) .interpretation > .card-face { grid-column: 1 / -1; width: min(175px, 75%); justify-self: center; }
  .reading:not(.triple) .interpretation > div { grid-column: 1 / -1; }
}

.reading .card-face { position: relative; border-radius: 10px; animation: arrive .9s cubic-bezier(.2,.8,.25,1) both; animation-delay: calc(var(--i, 0) * 150ms); box-shadow: calc(var(--sx) * -.5px) calc(10px + var(--sy) * .4px) 26px #05020a80; }
.reading .card-face::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 38%, #ffffff55 50%, transparent 62%); transform: translateX(-120%); animation: sweep 1.1s ease-out both; animation-delay: calc(var(--i, 0) * 150ms + .75s); }
@keyframes arrive { from { opacity: 0; transform: perspective(700px) rotateY(-82deg) translateY(16px) scale(.94); } }
@keyframes sweep { to { transform: translateX(120%); } }
#detalle-carta .card-art { position: relative; border-radius: 10px; overflow: hidden; }

/* táctil-44 */
@media (pointer: coarse) { .footer a { display: inline-flex; align-items: center; min-height: 44px; } }
