/* Modos de juego y presentación: Torre, capítulos, colección, invocación animada. */

/* ---------- Inicio ---------- */
.tile-tower { grid-column: 1 / -1; background: linear-gradient(135deg, #1d2b3f, var(--panel)); border-color: #34506f; }
.soon { grid-template-columns: repeat(2, 1fr); }

/* ---------- Capítulos ---------- */
.chapters { margin-bottom: 8px; }
.chip:disabled { opacity: .45; }
.chapter-tag { margin: -6px 0 10px; font-style: italic; }

/* ---------- Colección ---------- */
.coll-head { margin-top: 22px; }
.coll-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.ccard {
  --c: var(--r);
  position: relative; overflow: hidden; aspect-ratio: 3 / 4;
  border-radius: 10px; border: 2px solid var(--c); background: var(--bg2);
}
.ccard::after {
  content: ""; position: absolute; inset: 50% 0 0;
  background: linear-gradient(180deg, transparent, rgba(8,6,12,.95)); pointer-events: none;
}
.ccard .hname { font-size: 11px; bottom: 3px; }
.ccard .rar { font-size: 9px; }
.ccard .hel { width: 18px; height: 18px; }
.ccard.miss { border-color: color-mix(in srgb, var(--c) 45%, #1b1726); }
.ccard.miss .portrait { filter: brightness(.1) saturate(0); }
.ccard.miss .hel, .ccard.miss .hname { opacity: .55; }
.ccard.miss .rar { opacity: .7; }
.ccard.miss::before {
  content: "?"; position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  font: 700 26px var(--serif); color: rgba(255,255,255,.25);
}

/* ---------- Banner destacado ---------- */
.banner-art.featured { display: grid; grid-template-columns: 1.3fr 1fr; height: 200px; }
.banner-main { position: relative; overflow: hidden; border-right: 2px solid var(--ssr); box-shadow: inset 0 0 30px -8px var(--ssr); }
.banner-main .portrait { width: 100%; height: 100%; display: block; }
.banner-star {
  position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  background: var(--ssr); color: #120d05; padding: 2px 8px; border-radius: 99px;
}
.banner-side { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; opacity: .75; }
.banner-side .banner-hero:nth-child(even) { transform: none; }
.banner-side .banner-hero:nth-child(3) { grid-column: 1 / -1; }

/* ---------- Torre ---------- */
.tower .bar { margin-bottom: 8px; }
.tower-now { margin-top: 10px; }
.tower-now.boss { border-color: #6b2a38; background: linear-gradient(180deg, #2d1a24, var(--panel)); }
.tower-foes { display: flex; gap: 8px; margin: 10px 0; }
.tfoe {
  position: relative; flex: 1; aspect-ratio: 3 / 4; max-width: 84px; overflow: hidden;
  border-radius: 10px; border: 2px solid #5a2a35; background: var(--bg2);
}
.tfoe.boss { border-color: var(--bad); box-shadow: 0 0 14px -4px var(--bad); }
.tfoe .portrait { width: 100%; height: 100%; display: block; }
.tfoe span { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.55); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }
.tower-reward { margin-bottom: 10px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tfloors { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.tfloor {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13px;
}
.tfloor b { font-family: var(--serif); font-size: 16px; color: var(--muted); }
.tfloor em { font-style: normal; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; }
.tfloor.done b { color: var(--good); }
.tfloor.now { border-color: var(--gold); }
.tfloor.now b { color: var(--gold); }
.tfloor.locked { opacity: .5; }
.tfloor.boss { background: linear-gradient(90deg, #3d1a22, var(--panel)); border-color: #6b2a38; }
.tfloor.boss b { color: var(--bad); }

/* ---------- Lore ---------- */
.lore-text { margin: 0; font-family: var(--serif); font-style: italic; color: var(--muted); line-height: 1.5; }

/* ---------- Invocación animada ---------- */
.summon-stage {
  position: absolute; inset: 0; overflow: hidden;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #1b1233 0%, #07050d 75%);
  cursor: pointer;
}
.summon-stage.best-SSR { background: radial-gradient(ellipse at center, #33260d 0%, #07050d 75%); }
.portal { position: relative; width: 240px; height: 240px; display: grid; place-items: center; animation: portal-in .6s ease-out backwards; }
.portal .ring, .portal .core, .portal .rays { position: absolute; border-radius: 50%; }
.ring { border: 3px solid transparent; }
.ring.r1 { inset: 0; border-top-color: #7c5cff; border-bottom-color: #7c5cff; animation: spin 2.2s linear infinite; box-shadow: 0 0 24px #7c5cff66; }
.ring.r2 { inset: 22px; border-left-color: #b585ff; border-right-color: #5fd3e8; animation: spin 1.5s linear infinite reverse; }
.ring.r3 { inset: 48px; border-top-color: #f0c04a; border-left-color: #f0c04a; animation: spin 1s linear infinite; }
.best-SSR .ring.r1 { border-top-color: #f5c542; border-bottom-color: #f5c542; box-shadow: 0 0 30px #f5c542aa; }
.core {
  inset: 80px; background: radial-gradient(circle, #fff 0%, #cdb6ff 35%, #5a35c9 70%, transparent 72%);
  animation: core-pulse 2.6s ease-in forwards;
}
.best-SSR .core { background: radial-gradient(circle, #fff 0%, #ffe9a0 35%, #d89a12 70%, transparent 72%); }
.rays {
  inset: -60px; opacity: .35;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.55) 0 4deg, transparent 4deg 20deg);
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 30%, transparent 70%); mask: radial-gradient(circle, transparent 28%, #000 30%, transparent 70%);
  animation: spin 8s linear infinite;
}
.portal-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: flash 2.6s ease-in forwards; }
.best-SSR .portal-flash { background: #ffe9a0; }
.portal-hint { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; animation: blink 1.4s ease-in-out infinite; }
.reveal-wrap { display: none; width: 100%; padding: 20px 14px; flex-direction: column; gap: 18px; align-items: center; cursor: default; max-height: 100%; overflow-y: auto; }
.phase-portal .reveal-wrap { display: none; }
.phase-reveal .portal, .phase-reveal .portal-flash, .phase-reveal .portal-hint { display: none; }
.phase-reveal { cursor: default; }
.phase-reveal .reveal-wrap { display: flex; animation: portal-in .35s ease-out; }
.reveal-btns { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.reveal-btns .btn { flex: 1; }
.reveal-btns [data-action="summon-close"] { opacity: .35; pointer-events: none; transition: opacity .3s; }
.summon-stage.done [data-action="summon-close"], .summon-stage.done [data-action="summon-flip"] { opacity: 1; pointer-events: auto; }
.summon-stage.done [data-action="summon-flip"] { display: none; }
.summon-stage.done .reveal-btns [data-action="summon-close"] { flex: 1; }

.scard { aspect-ratio: 3 / 4; perspective: 700px; }
.scard-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .8, .3, 1.1); }
.scard.flipped .scard-in { transform: rotateY(180deg); }
.scard-back, .scard-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.scard-back {
  border-radius: 12px; border: 2px solid #4a3d78; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, #1c1531 0 8px, #241a40 8px 16px);
  color: #7c5cff; font-size: 28px;
}
.scard-face.sresult { transform: rotateY(180deg); animation: none; }
.scard.flipped[data-r="SSR"] .scard-face { animation: glow 1.6s infinite; }
.sresults { width: 100%; max-width: 420px; }
.summon-stage.ssr-burst::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, #fff6c8 0%, rgba(245,197,66,.55) 35%, transparent 70%);
  animation: burst .9s ease-out forwards;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes portal-in { from { opacity: 0; transform: scale(.5); } }
@keyframes core-pulse { 0% { transform: scale(.4); } 70% { transform: scale(1); } 100% { transform: scale(3.2); } }
@keyframes flash { 0%, 78% { opacity: 0; } 100% { opacity: 1; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes burst { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ring, .rays { animation-duration: 6s; }
}

@media (min-width: 960px) {
  .sresults { max-width: 640px; }
  .modal .summon-stage { border-radius: inherit; }
}

.first-ten {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px; text-align: center; font-weight: 600;
  color: #1d1405; background: linear-gradient(90deg, #f4cd62, #ffe9a8, #f4cd62); box-shadow: 0 0 18px -6px var(--gold);
}

.welcome { text-align: center; padding-top: 8px; }
.welcome-art { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.welcome-art span { aspect-ratio: 5 / 6; border-radius: 12px; overflow: hidden; border: 2px solid var(--ssr); filter: brightness(.35) saturate(.6); }
.welcome-art .portrait { width: 100%; height: 100%; display: block; }
.welcome h1 { margin: 6px 0 8px; }
.welcome p { max-width: 380px; margin: 0 auto; }
