/* =========================================================================
   Shaiya world: hero key art, in-game window behind the hero overlay,
   hotkey-card scenes, the Light vs Fury class select and the CTA art.
   Artwork is official Shaiya promotional media (see the footer credit).
   ========================================================================= */

/* decorative art fades in once decoded (shaiya.js adds .loaded) */
.ss-art { opacity: 0; transition: opacity 1.4s var(--ease-out); }
.ss-art.loaded, html:not(.js) .ss-art { opacity: 1; }

/* ---------- hero: key art backdrop ---------- */
.hero-art { position: absolute; inset: 0; z-index: -4; overflow: hidden; pointer-events: none; }
.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 28%;
  transform-origin: 62% 36%;
  animation: heroArt 40s ease-in-out infinite alternate;
}
.hero-art img.loaded, html:not(.js) .hero-art img { opacity: .62; }
/* tint the art with the visitor's accent, then darken where the copy sits */
.hero-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, rgba(var(--a-rgb), .7), rgba(var(--a2-rgb), .5)); mix-blend-mode: color; }
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(6, 5, 10, .97) 0%, rgba(6, 5, 10, .86) 30%, rgba(6, 5, 10, .42) 56%, rgba(6, 5, 10, .3) 78%, rgba(6, 5, 10, .55) 100%),
    linear-gradient(180deg, rgba(6, 5, 10, .78) 0%, rgba(6, 5, 10, 0) 26%, rgba(6, 5, 10, 0) 60%, var(--bg) 100%);
}
@keyframes heroArt { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.2%, -.6%); } }

/* ---------- hero: the game window the overlay floats over ---------- */
.hl-screen { left: -3%; right: -7%; top: 7%; bottom: 3%; transform: translateZ(-120px); }
.game-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #07060c;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 80px 120px -60px #000, 0 0 0 1px rgba(0, 0, 0, .7), 0 0 120px -40px rgba(var(--a-rgb), .7);
}
.game-screen img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; filter: brightness(.7) saturate(.95) contrast(1.05); }
.game-screen::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(160deg, rgba(var(--a-rgb), .45), transparent 55%, rgba(var(--a2-rgb), .35)); mix-blend-mode: soft-light; }
.game-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(130% 100% at 50% 38%, transparent 42%, rgba(5, 4, 10, .78) 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
}

/* ---------- hotkey cards: the game behind each mini scene ---------- */
.hk-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .46;
  filter: saturate(.82) brightness(.78);
  transform: scale(1.02);
  transition: opacity .6s var(--ease), transform 1.4s var(--ease-out), filter .6s;
}
.hk-viz::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(var(--a-rgb), .14), transparent 70%),
    linear-gradient(180deg, rgba(7, 6, 12, .1) 0%, rgba(7, 6, 12, .42) 62%, rgba(7, 6, 12, .88) 100%);
}
.hk-viz canvas { position: relative; z-index: 2; }
.hk-viz .hk-state { z-index: 3; }
.hk-card:hover .hk-scene, .hk-card.on .hk-scene { opacity: .66; transform: scale(1.08); filter: saturate(1) brightness(.84); }

/* ---------- Light vs Fury ---------- */
.factions { --fa: #f5c451; --fa2: #fff1c2; --fa-rgb: 245, 196, 81; }
.factions[data-faction="fury"] { --fa: #f04444; --fa2: #fb923c; --fa-rgb: 240, 68, 68; }

.cs-factions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; }
.cs-tab {
  --t: #f5c451;
  --t-rgb: 245, 196, 81;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 22px 10px 11px;
  border-radius: 17px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  text-align: left;
  transition: border-color .3s, background-color .3s, box-shadow .3s, color .3s, transform .2s var(--ease);
}
.cs-tab[data-faction="fury"] { --t: #f04444; --t-rgb: 240, 68, 68; }
.cs-tab b { display: block; font: 600 15px/1.2 var(--ff-display); letter-spacing: -.01em; color: #fff; }
.cs-tab small { display: block; margin-top: 4px; font: 500 11px/1.2 var(--ff-mono); letter-spacing: .06em; color: var(--dim); }
.cs-tab:hover { border-color: rgba(var(--t-rgb), .5); }
.cs-tab:active { transform: translateY(1px); }
.cs-tab[aria-selected="true"] {
  border-color: rgba(var(--t-rgb), .75);
  background: linear-gradient(180deg, rgba(var(--t-rgb), .2), rgba(var(--t-rgb), .05));
  box-shadow: 0 0 0 1px rgba(var(--t-rgb), .18), 0 18px 50px -22px rgba(var(--t-rgb), .9);
}
.cs-tab[aria-selected="true"] small { color: rgba(var(--t-rgb), .95); }
.cs-crest { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); background: rgba(255, 255, 255, .05); border: 1px solid var(--line2); transition: color .3s, background-color .3s, border-color .3s, box-shadow .3s; }
.cs-crest .ico { width: 20px; height: 20px; }
.cs-tab[aria-selected="true"] .cs-crest { color: var(--t); background: rgba(var(--t-rgb), .15); border-color: rgba(var(--t-rgb), .55); box-shadow: 0 0 20px -2px rgba(var(--t-rgb), .75); }
.cs-vs { font: 800 12px var(--ff-display); letter-spacing: .14em; color: var(--dim); }

.cs-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  min-height: 620px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(var(--fa-rgb), .3);
  background: #07060c;
  box-shadow: 0 50px 130px -60px rgba(var(--fa-rgb), .75);
  transition: border-color .6s, box-shadow .6s;
}
.cs-bg { position: absolute; inset: 0; z-index: -2; }
.cs-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: saturate(.9) brightness(.6); transition: opacity 1.1s var(--ease); }
.cs-bg-light { object-position: 62% 30%; }
.cs-bg-fury { object-position: 50% 40%; }
.factions[data-faction="light"] .cs-bg-light, .factions[data-faction="fury"] .cs-bg-fury { opacity: .72; }
.cs-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(48% 58% at 70% 62%, rgba(var(--fa-rgb), .24), transparent 70%),
    linear-gradient(90deg, rgba(7, 6, 12, .97) 0%, rgba(7, 6, 12, .88) 32%, rgba(7, 6, 12, .34) 62%, rgba(7, 6, 12, .5) 100%),
    linear-gradient(180deg, rgba(7, 6, 12, .3), transparent 38%, rgba(7, 6, 12, .82));
}

.cs-info { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; padding: 56px 16px 56px 56px; }
.cs-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 600 11.5px/1.3 var(--ff-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--fa); }
.cs-kicker span + span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 10px 2px 0; border-radius: 1px; background: currentColor; transform: rotate(45deg); opacity: .7; }
.cs-name {
  margin: 16px 0 10px;
  font: 800 clamp(40px, 5vw, 70px)/.98 var(--ff-display);
  letter-spacing: -.045em;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff 35%, var(--fa2) 75%, var(--fa));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cs-role { color: #ece9f6; font-size: 18px; font-weight: 700; }
.cs-mirror { margin-top: 8px; font: 500 12.5px var(--ff-mono); color: var(--dim); }
.cs-mirror b { color: var(--muted); font-weight: 600; }
.cs-roster { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; width: 100%; max-width: 470px; margin: 30px 0 24px; }
.cs-pick { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; border-radius: 14px; color: var(--dim); font: 600 10.5px/1.2 var(--ff-mono); transition: color .25s; }
.cs-pick img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  background: #120f1b;
  border: 1px solid var(--line2);
  filter: grayscale(.6) brightness(.72);
  transition: filter .3s, border-color .3s, box-shadow .3s, transform .3s var(--ease);
}
.cs-pick span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-pick:hover { color: var(--muted); }
.cs-pick:hover img { filter: grayscale(.1) brightness(.95); transform: translateY(-2px); }
.cs-pick[aria-checked="true"] { color: #fff; }
.cs-pick[aria-checked="true"] img { filter: none; border-color: rgba(var(--fa-rgb), .95); box-shadow: 0 0 0 2px rgba(var(--fa-rgb), .25), 0 12px 28px -10px rgba(var(--fa-rgb), .95); transform: translateY(-2px); }
.cs-pick:focus-visible { outline-offset: 4px; }
.cs-accent[aria-pressed="true"] { border-color: rgba(var(--a-rgb), .7); background: rgba(var(--a-rgb), .14); }
.cs-accent [data-icon] .ico { width: 16px; height: 16px; color: var(--a); }

.cs-figure { position: relative; z-index: 1; align-self: end; width: min(100%, 600px); aspect-ratio: 1; margin: 44px auto 0; }
.cs-imgs { position: absolute; inset: 0; z-index: 1; }
.cs-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateY(18px) scale(.97);
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .7)) drop-shadow(0 0 34px rgba(var(--fa-rgb), .3));
  transition: opacity .55s var(--ease), transform .85s var(--ease-out);
}
.cs-img.in { opacity: 1; transform: none; }
.cs-img.out { opacity: 0; transform: translateY(-10px) scale(1.02); transition-duration: .4s, .6s; }

/* rune circle under the character's feet */
.cs-ring { position: absolute; left: 13%; width: 74%; bottom: -27%; aspect-ratio: 1; transform: rotateX(77deg); transform-style: preserve-3d; pointer-events: none; }
.cs-ring::before { content: ""; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--fa-rgb), .5), rgba(var(--fa-rgb), .12) 62%, transparent); }
.cs-ring i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(var(--fa-rgb), .55); box-shadow: 0 0 34px rgba(var(--fa-rgb), .45), inset 0 0 44px rgba(var(--fa-rgb), .3); }
.cs-ring i:nth-child(2) { inset: 13%; border: 1.5px dashed rgba(var(--fa-rgb), .7); box-shadow: none; animation: csSpin 26s linear infinite; }
@keyframes csSpin { to { transform: rotate(360deg); } }

/* the overlay's ESP box locks onto the selected class */
.cs-esp {
  position: absolute;
  z-index: 2;
  left: var(--l, 28%);
  top: var(--t, 4%);
  width: var(--w, 44%);
  height: var(--h, 92%);
  pointer-events: none;
  transition: left .6s var(--ease-out), top .6s var(--ease-out), width .6s var(--ease-out), height .6s var(--ease-out);
}
.cs-esp > i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--a); filter: drop-shadow(0 0 5px rgba(var(--a-rgb), .95)); }
.cs-esp > i:nth-child(1) { --dx: -18px; --dy: -18px; left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.cs-esp > i:nth-child(2) { --dx: 18px; --dy: -18px; right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.cs-esp > i:nth-child(3) { --dx: -18px; --dy: 18px; left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.cs-esp > i:nth-child(4) { --dx: 18px; --dy: 18px; right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.cs-esp.lock > i { animation: csLock .55s var(--ease-out) both; }
@keyframes csLock {
  from { opacity: 0; transform: translate(var(--dx), var(--dy)); }
  55% { opacity: 1; transform: translate(calc(var(--dx) * -.12), calc(var(--dy) * -.12)); }
  to { opacity: 1; transform: none; }
}
.cs-hp { position: absolute; left: -10px; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: rgba(0, 0, 0, .6); overflow: hidden; }
.cs-hp b { position: absolute; left: 0; right: 0; bottom: 0; height: var(--hp, 100%); background: linear-gradient(0deg, #ef4444, #facc15 50%, #4ade80); transition: height .6s var(--ease); }
.cs-tag {
  position: absolute;
  left: 0;
  bottom: calc(100% + 9px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 4px;
  border-radius: 8px;
  white-space: nowrap;
  font: 600 11px/1 var(--ff-mono);
  color: #fff;
  background: rgba(8, 7, 13, .86);
  border: 1px solid rgba(var(--a-rgb), .55);
  box-shadow: 0 10px 24px -12px #000;
}
.cs-tag em { padding: 4px 6px; border-radius: 5px; font-style: normal; font-size: 9px; letter-spacing: .14em; background: var(--grad); }
.cs-dist { color: var(--muted); }
.cs-esp.lock .cs-tag { animation: csTag .45s .12s var(--ease-out) both; }
@keyframes csTag { from { opacity: 0; transform: translateY(6px); } }

.cs-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px; margin-top: 26px; }
.cs-foot-label { font: 600 11.5px var(--ff-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.factions .demo-note { margin-top: 18px; }

/* ---------- FAQ: the goddesses keep watch beside the questions ---------- */
.faq-art { position: relative; width: min(100%, 290px); margin-top: 38px; pointer-events: none; }
.faq-art::before { content: ""; position: absolute; inset: 10% 0 18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--a-rgb), .32), rgba(var(--a2-rgb), .1) 60%, transparent); filter: blur(10px); }
.faq-art img { position: relative; width: 100%; height: auto; -webkit-mask-image: linear-gradient(180deg, #000 52%, transparent 96%); mask-image: linear-gradient(180deg, #000 52%, transparent 96%); }
.faq-art img.loaded, html:not(.js) .faq-art img { opacity: .9; }

/* ---------- CTA: key art behind the closing call to action ---------- */
.cta-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: inherit; pointer-events: none; }
.cta-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
.cta-art img.loaded, html:not(.js) .cta-art img { opacity: .78; }
.cta-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(120deg, rgba(var(--a-rgb), .42), rgba(var(--a2-rgb), .3)); mix-blend-mode: color; }
.cta-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(52% 66% at 50% 48%, rgba(8, 6, 14, .8), rgba(8, 6, 14, .3) 100%),
    linear-gradient(180deg, rgba(8, 6, 14, .15), rgba(8, 6, 14, .7));
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .cs-stage { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .cs-figure { order: -1; width: min(82%, 500px); margin-top: 56px; }
  .cs-info { align-items: center; text-align: center; padding: 4px 28px 38px; }
  .cs-kicker { justify-content: center; }
  .cs-roster { margin-left: auto; margin-right: auto; }
  .cs-bg::after {
    background:
      radial-gradient(70% 45% at 50% 34%, rgba(var(--fa-rgb), .24), transparent 70%),
      linear-gradient(180deg, rgba(7, 6, 12, .4) 0%, rgba(7, 6, 12, .25) 34%, rgba(7, 6, 12, .9) 60%, rgba(7, 6, 12, .97) 100%);
  }
  .hero-art img { object-position: 50% 22%; }
  .hero-art::after { background: linear-gradient(180deg, rgba(6, 5, 10, .9) 0%, rgba(6, 5, 10, .72) 36%, rgba(6, 5, 10, .45) 62%, var(--bg) 100%); }
  .faq-art { display: none; }
}
@media (max-height: 760px) {
  .faq-art { display: none; }
}
@media (max-width: 760px) {
  .hl-screen { left: 1%; right: 1%; top: 10%; bottom: 2%; }
  .game-screen { border-radius: 14px; }
  .cs-factions { gap: 8px; margin-bottom: 16px; }
  .cs-vs { display: none; }
  .cs-tab { flex: 1 1 0; min-width: 0; min-height: 58px; gap: 9px; padding: 9px 10px 9px 9px; border-radius: 14px; }
  .cs-tab b { font-size: 12.5px; }
  .cs-tab small { font-size: 10px; letter-spacing: .02em; }
  .cs-crest { width: 32px; height: 32px; border-radius: 10px; }
  .cs-crest .ico { width: 17px; height: 17px; }
  .cs-stage { border-radius: 22px; }
  .cs-figure { width: min(88%, 420px); margin-top: 46px; }
  .cs-info { padding: 0 16px 28px; }
  .cs-name { font-size: clamp(34px, 10.5vw, 46px); margin-top: 12px; }
  .cs-role { font-size: 16px; }
  .cs-roster { gap: 6px; margin: 24px auto 20px; }
  .cs-pick { gap: 5px; font-size: 9px; }
  .cs-pick img { border-radius: 11px; }
  .cs-foot { justify-content: flex-start; }
  .cs-foot-label { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art img { animation: none; transform: none; }
}
