/* Card Full View — magical-girl Starlight character details.
   Loads AFTER qol-ui.css / legacy so .card-analyzer-open beats width clamps + flex-start. */

@keyframes analyzer-flip-to-back {
  0%, 8% { transform: rotateY(0deg) scale(1) !important; filter: brightness(1); }
  44% { transform: rotateY(200deg) scale(1.06) !important; filter: brightness(1.14) drop-shadow(0 0 22px rgba(255, 143, 208, 0.38)); }
  100% { transform: rotateY(540deg) scale(1) !important; filter: brightness(1); }
}

@keyframes analyzer-flip-to-front {
  0%, 8% { transform: rotateY(180deg) scale(1) !important; filter: brightness(1); }
  44% { transform: rotateY(380deg) scale(1.06) !important; filter: brightness(1.14) drop-shadow(0 0 22px rgba(122, 208, 255, 0.32)); }
  100% { transform: rotateY(720deg) scale(1) !important; filter: brightness(1); }
}

@keyframes analyzer-modal-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes analyzer-sparkle-twinkle {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.08);
  }
}

/* True viewport center — beat binder/qol flex-start + overflow-y:auto */
html.starlight-embedded #cardOverlay.open.card-analyzer-open,
#cardOverlay.card-analyzer-open,
#cardOverlay.open.card-analyzer-open {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  place-items: unset !important;
  align-content: unset !important;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left)) !important;
  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 186, 228, 0.32), transparent 38%),
    radial-gradient(circle at 86% 16%, rgba(168, 226, 255, 0.34), transparent 36%),
    radial-gradient(circle at 50% 90%, rgba(255, 236, 196, 0.18), transparent 42%),
    rgba(36, 44, 88, 0.74) !important;
  backdrop-filter: blur(16px) saturate(1.12) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.12) !important;
}

#cardOverlay.card-analyzer-open .st-modal-backdrop,
#cardOverlay.open.card-analyzer-open .st-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: default;
}

#cardOverlay.card-analyzer-open .full-card-stage,
#cardOverlay.open.card-analyzer-open .full-card-stage {
  position: relative;
  z-index: 1;
}

/* Beat qol-ui `#cardOverlay .analyzer-full-stage { width:min(720px) }` and legacy shells */
html.starlight-embedded #cardOverlay.card-analyzer-open .analyzer-full-stage.analyzer-sekai-stage,
#cardOverlay.card-analyzer-open .analyzer-full-stage.analyzer-sekai-stage,
#cardOverlay .analyzer-full-stage.analyzer-sekai-stage {
  --ca-ink: var(--st-color-ink, #3a4a72);
  --ca-muted: var(--st-color-muted, #7480a0);
  --ca-blue: var(--st-color-blue, #7ad0ff);
  --ca-pink: var(--st-color-pink, #ff8fd0);
  --ca-gold: var(--st-color-gold, #ffd56a);
  --ca-cream: #fffdf9;
  --ca-soft: #f6f9ff;
  --ca-panel: #eef3fa;
  --ca-blush: #ffe8f4;
  --ca-sky: #e4f6ff;
  --ca-radius: 28px;
  position: relative !important;
  inset: auto !important;
  width: min(1100px, calc(100vw - 20px)) !important;
  max-width: min(1100px, calc(100vw - 20px)) !important;
  height: min(820px, calc(100dvh - 20px)) !important;
  max-height: min(820px, calc(100dvh - 20px)) !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  display: grid !important;
  place-items: center !important;
  flex: 0 1 auto !important;
  transform: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-bg {
  display: none !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-modal {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  max-height: inherit;
  min-height: 0;
  overflow: hidden;
  border-radius: calc(var(--ca-radius) + 6px);
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.99) 0%, var(--ca-cream) 42%, #fff4fa 78%, var(--ca-sky) 100%);
  box-shadow:
    0 32px 80px rgba(48, 62, 120, 0.34),
    0 0 0 1px rgba(255, 143, 208, 0.18) inset,
    0 0 0 3px rgba(122, 208, 255, 0.12),
    0 0 48px rgba(255, 143, 208, 0.22),
    0 0 72px rgba(122, 208, 255, 0.16);
  animation: analyzer-modal-in 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#cardOverlay .analyzer-sekai-stage .analyzer-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 10% 6%, rgba(255, 213, 106, 0.22), transparent 20%),
    radial-gradient(circle at 92% 8%, rgba(122, 208, 255, 0.2), transparent 22%),
    radial-gradient(circle at 88% 88%, rgba(255, 143, 208, 0.14), transparent 26%),
    radial-gradient(circle at 8% 84%, rgba(255, 255, 255, 0.45), transparent 24%);
  opacity: 0.95;
  z-index: 0;
}

#cardOverlay .analyzer-sekai-stage .analyzer-modal::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border-radius: calc(var(--ca-radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 24px rgba(255, 186, 228, 0.12) inset;
  z-index: 0;
}

/* Decorative corner sparkles (markup spans) */
#cardOverlay .analyzer-sekai-stage .analyzer-spark {
  position: absolute;
  z-index: 3;
  width: 1.1rem;
  height: 1.1rem;
  pointer-events: none;
  color: var(--ca-gold);
  font-size: 1.05rem;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 213, 106, 0.75),
    0 0 18px rgba(255, 143, 208, 0.35);
  animation: analyzer-sparkle-twinkle 4.8s ease-in-out infinite;
}

#cardOverlay .analyzer-sekai-stage .analyzer-spark-tl {
  top: 14px;
  left: 16px;
  color: #ffd56a;
}

#cardOverlay .analyzer-sekai-stage .analyzer-spark-tr {
  top: 18px;
  right: 58px;
  color: #9adbff;
  animation-delay: 0.55s;
  font-size: 0.85rem;
}

#cardOverlay .analyzer-sekai-stage .analyzer-spark-bl {
  bottom: 18px;
  left: 20px;
  color: #ff9fd8;
  animation-delay: 1.1s;
  font-size: 0.9rem;
}

#cardOverlay .analyzer-sekai-stage .analyzer-spark-br {
  bottom: 22px;
  right: 22px;
  color: #ffe08a;
  animation-delay: 1.7s;
  font-size: 0.78rem;
}

#cardOverlay .analyzer-sekai-stage .analyzer-chrome,
#cardOverlay .analyzer-sekai-stage .analyzer-body,
#cardOverlay .analyzer-sekai-stage .analyzer-footer {
  position: relative;
  z-index: 1;
}

/* —— Chrome: bubbly tab pills + close —— */
#cardOverlay .analyzer-sekai-stage .analyzer-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 4px;
  min-height: 52px;
}

#cardOverlay .analyzer-sekai-stage .analyzer-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 4px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(228, 246, 255, 0.85), rgba(255, 232, 244, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 16px rgba(90, 110, 160, 0.08) inset;
}

#cardOverlay .analyzer-sekai-stage .analyzer-tab {
  appearance: none;
  border: 0;
  margin: 0;
  min-height: 38px;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: #6a7494;
  font: inherit;
  font-weight: 850;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

#cardOverlay .analyzer-sekai-stage .analyzer-tab.is-active {
  background: linear-gradient(145deg, #fff, #fff7fc);
  color: var(--ca-ink);
  box-shadow:
    0 6px 16px rgba(255, 143, 208, 0.2),
    0 0 0 1px rgba(255, 143, 208, 0.22);
  transform: translateY(-1px) scale(1.02);
}

#cardOverlay .analyzer-sekai-stage .analyzer-tab:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ca-ink);
}

#cardOverlay .analyzer-sekai-stage .analyzer-close.overlay-close,
#cardOverlay.card-analyzer-open .analyzer-sekai-stage .analyzer-close {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  margin: 0;
  border: 1.5px solid rgba(255, 143, 208, 0.35) !important;
  border-radius: 50% !important;
  background:
    linear-gradient(145deg, #fff, #ffe8f4) !important;
  color: var(--ca-ink) !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  box-shadow:
    0 8px 20px rgba(255, 143, 208, 0.22),
    0 0 16px rgba(122, 208, 255, 0.18) !important;
  cursor: pointer;
  flex: 0 0 auto;
  z-index: 5 !important;
  transition: transform 160ms ease, box-shadow 160ms ease, color 160ms ease !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-close:hover {
  background: linear-gradient(145deg, #fff, #ffd6ec) !important;
  color: var(--ca-pink) !important;
  transform: scale(1.06) rotate(6deg);
  box-shadow:
    0 10px 24px rgba(255, 143, 208, 0.3),
    0 0 20px rgba(255, 213, 106, 0.25) !important;
}

/* —— Scroll body (modal stays centered; panel scrolls) —— */
#cardOverlay .analyzer-sekai-stage .analyzer-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 22px 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, var(--ca-soft) 55%, rgba(255, 244, 250, 0.7) 100%);
  border-top: 1px solid rgba(180, 200, 230, 0.32);
}

#cardOverlay .analyzer-sekai-stage .analyzer-panel {
  display: grid;
  gap: 12px;
  padding: 4px 0 8px;
}

#cardOverlay .analyzer-sekai-stage .analyzer-panel[hidden] {
  display: none !important;
}

/* —— Unified card header —— */
#cardOverlay .analyzer-sekai-stage .analyzer-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 4px 4px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(180, 200, 230, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
}

#cardOverlay .analyzer-sekai-stage .analyzer-header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

#cardOverlay .analyzer-sekai-stage .analyzer-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  max-width: min(220px, 42%);
}

#cardOverlay .analyzer-sekai-stage .analyzer-subtitle {
  margin: 0 0 6px;
  color: var(--ca-muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

#cardOverlay .analyzer-sekai-stage .analyzer-header-copy h2 {
  margin: 0;
  color: var(--ca-ink);
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

#cardOverlay .analyzer-sekai-stage .analyzer-series-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(122, 208, 255, 0.28), rgba(255, 143, 208, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 8px 18px rgba(90, 120, 180, 0.12),
    0 0 14px rgba(255, 143, 208, 0.1);
}

#cardOverlay .analyzer-sekai-stage .analyzer-series-spark {
  color: var(--ca-gold);
  font-size: 0.95rem;
  filter: drop-shadow(0 0 8px rgba(255, 213, 106, 0.65));
  animation: analyzer-sparkle-twinkle 5.2s ease-in-out infinite;
  flex: 0 0 auto;
}

#cardOverlay .analyzer-sekai-stage .analyzer-series-name {
  color: var(--ca-ink);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
}

#cardOverlay .analyzer-sekai-stage .analyzer-category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ca-blue), #a0dcff 55%, #ffb8e0);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow:
    0 6px 16px rgba(90, 150, 210, 0.28),
    0 0 12px rgba(255, 143, 208, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Legacy identity block removed — keep selectors from breaking cached markup. */
#cardOverlay .analyzer-sekai-stage .analyzer-identity {
  display: none;
}

/* —— Main art + stats —— */
#cardOverlay .analyzer-sekai-stage .analyzer-main-row {
  display: grid;
  grid-template-columns: minmax(250px, 0.92fr) minmax(300px, 1.08fr);
  gap: 18px 32px;
  align-items: start;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-col {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
  justify-items: center;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  min-width: 0;
  perspective: 1400px;
  padding: 8px 44px;
}

/* Soft pedestal glow behind the card — no card wash */
#cardOverlay .analyzer-sekai-stage .analyzer-card-stage::before {
  content: "";
  position: absolute;
  inset: auto 10% 4%;
  width: 80%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 208, 255, 0.28) 0%, rgba(255, 143, 208, 0.16) 42%, transparent 72%);
  filter: blur(10px);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

#cardOverlay .analyzer-sekai-stage .analyzer-rarity-stars {
  position: static;
  z-index: 1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: min(300px, 100%);
  pointer-events: none;
  color: var(--ca-gold);
  font-size: 1.05rem;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(120, 80, 0, 0.35),
    0 0 10px rgba(255, 213, 106, 0.65);
}

#cardOverlay .analyzer-sekai-stage .analyzer-attr-chip {
  display: none;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-stage .full-card-wrap.analyzer-card-shell,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell {
  position: relative;
  z-index: 1;
  width: min(300px, 100%, 42vh) !important;
  max-width: 300px !important;
  max-height: none !important;
  aspect-ratio: 5 / 7;
  transform-style: preserve-3d;
  border-radius: 20px;
  cursor: grab;
  overflow: visible !important;
  padding: 0 !important;
  filter: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: 0 18px 36px rgba(30, 50, 90, 0.24) !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-stage .full-card-wrap.analyzer-card-shell:active {
  cursor: grabbing;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell .full-inner,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .full-inner {
  position: relative;
  display: block !important;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: inherit;
  overflow: visible !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: rotateY(0deg) !important;
  transition: none !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell.show-back .full-inner,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell.show-back .full-inner {
  transform: rotateY(180deg) !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell.flip-to-back .full-inner,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell.flip-to-back .full-inner {
  animation: analyzer-flip-to-back 0.92s cubic-bezier(0.2, 0.82, 0.18, 1) both !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell.flip-to-front .full-inner,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell.flip-to-front .full-inner {
  animation: analyzer-flip-to-front 0.92s cubic-bezier(0.2, 0.82, 0.18, 1) both !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell .face,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face {
  position: absolute !important;
  inset: 0;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
  overflow: hidden !important;
  pointer-events: auto !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  transform-style: preserve-3d;
  box-shadow:
    0 20px 44px rgba(30, 50, 90, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.45) !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell .face.front,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front {
  transform: rotateY(0deg) translateZ(1px) !important;
  z-index: 2;
  overflow: hidden !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell .face.back,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.back {
  display: block !important;
  transform: rotateY(180deg) translateZ(1px) !important;
  z-index: 1;
}

#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front > img,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front > .st-holo-spark {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  transform: none !important;
  display: block !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell .face.front img,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front img,
#cardOverlay .analyzer-sekai-stage .analyzer-card-shell .face.back img,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.back img {
  transform: none !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell img,
#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: inherit !important;
  filter: none !important;
  transform: none !important;
  opacity: 1 !important;
}

#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front > img {
  object-fit: cover !important;
  z-index: 1 !important;
}

#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front > .st-holo-spark {
  z-index: 4 !important;
  pointer-events: none !important;
}

#cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell .face.front.card-finish-holographic > img {
  position: absolute !important;
  inset: 0 !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-shell.is-holo-off .card-finish-effect,
#cardOverlay .analyzer-sekai-stage .analyzer-card-shell.is-holo-off .holo-spark,
#cardOverlay .analyzer-sekai-stage .analyzer-card-shell.is-holo-off .finish-effect {
  display: none !important;
  opacity: 0 !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-soft-note {
  margin: 0;
  padding: 0 4px;
  color: #de4da3;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
}

#cardOverlay .analyzer-sekai-stage .analyzer-soft-note span {
  margin-right: 4px;
  color: var(--ca-pink);
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-tools {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 0 8px;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-tools .analyzer-flip {
  min-width: min(180px, 80%);
  min-height: 42px;
}

/* Stats panel — card-style detail sheet */
#cardOverlay .analyzer-sekai-stage .analyzer-stats-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px 16px 14px;
  border-radius: 22px;
  border: 1px solid rgba(180, 200, 230, 0.42);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 251, 255, 0.92) 55%, rgba(255, 244, 250, 0.88) 100%);
  box-shadow:
    0 14px 32px rgba(90, 110, 160, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#cardOverlay .analyzer-sekai-stage .analyzer-stat-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

#cardOverlay .analyzer-sekai-stage .analyzer-stat-label {
  color: var(--ca-ink);
  font-size: 0.95rem;
  font-weight: 900;
  white-space: nowrap;
}

#cardOverlay .analyzer-sekai-stage .analyzer-stat-icon {
  color: var(--ca-blue);
  font-size: 0.85rem;
  font-weight: 900;
}

#cardOverlay .analyzer-sekai-stage .analyzer-stat-rule {
  display: block;
  height: 1px;
  min-width: 12px;
  background: linear-gradient(90deg, rgba(120, 140, 180, 0.45), rgba(255, 143, 208, 0.12));
}

#cardOverlay .analyzer-sekai-stage .analyzer-stat-value {
  color: var(--ca-ink);
  font-size: 1.02rem;
  font-weight: 850;
  text-align: right;
  justify-self: end;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(228, 246, 255, 0.72);
}

#cardOverlay .analyzer-sekai-stage .analyzer-stat-value b {
  font-weight: 950;
}

#cardOverlay .analyzer-sekai-stage .analyzer-evo-value {
  margin-right: 0;
}

#cardOverlay .analyzer-sekai-stage .analyzer-skill-block {
  margin-top: 4px;
  padding: 12px 10px 4px;
  border-top: 1px dashed rgba(180, 160, 200, 0.45);
}

#cardOverlay .analyzer-sekai-stage .analyzer-skill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 6px;
}

#cardOverlay .analyzer-sekai-stage .analyzer-skill-name {
  color: var(--ca-muted);
  font-size: 0.92rem;
  font-weight: 750;
}

#cardOverlay .analyzer-sekai-stage .analyzer-skill-detail {
  margin: 0;
  color: var(--ca-ink);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.5;
}

/* Side story block */
#cardOverlay .analyzer-sekai-stage .analyzer-side-story,
#cardOverlay .analyzer-sekai-stage .analyzer-story-full {
  display: grid;
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(180, 200, 230, 0.35);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(90, 110, 160, 0.08);
}

#cardOverlay .analyzer-sekai-stage .analyzer-side-story-head {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #9eb0cc, #c4a8d4 55%, #f0a8c8);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(60, 40, 80, 0.2);
}

#cardOverlay .analyzer-sekai-stage .analyzer-side-story-body {
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.9), rgba(255, 244, 250, 0.65));
}

#cardOverlay .analyzer-sekai-stage .analyzer-side-story-body p {
  margin: 0;
  color: var(--ca-ink);
  font-size: 0.94rem;
  line-height: 1.55;
}

#cardOverlay .analyzer-sekai-stage .analyzer-story-link {
  appearance: none;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #de4da3;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#cardOverlay .analyzer-sekai-stage .analyzer-more {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(122, 208, 255, 0.32);
  background: rgba(255, 255, 255, 0.85);
}

#cardOverlay .analyzer-sekai-stage .analyzer-more summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--ca-ink);
}

/* Actions strip — tidy, not a clutter pile */
#cardOverlay .analyzer-sekai-stage .analyzer-actions-strip {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(122, 208, 255, 0.3);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 248, 0.75));
  box-shadow: 0 8px 20px rgba(90, 110, 160, 0.08);
}

#cardOverlay .analyzer-sekai-stage .analyzer-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#cardOverlay .analyzer-sekai-stage .analyzer-actions-strip .analyzer-display-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

#cardOverlay .analyzer-sekai-stage .analyzer-actions-strip .analyzer-display-toggles .btn {
  min-height: 40px;
  font-size: 0.82rem;
}

#cardOverlay .analyzer-sekai-stage .analyzer-actions-strip .btn[aria-pressed="true"] {
  border-color: rgba(255, 143, 208, 0.55);
  background: linear-gradient(135deg, rgba(122, 208, 255, 0.18), rgba(255, 143, 208, 0.2));
}

#cardOverlay .analyzer-sekai-stage .analyzer-evo-strip {
  margin: 0;
}

#cardOverlay .analyzer-sekai-stage .analyzer-flip {
  position: static !important;
  top: auto !important;
  left: auto !important;
}

/* —— Footer Close —— */
#cardOverlay .analyzer-sekai-stage .analyzer-footer {
  display: grid;
  place-items: center;
  padding: 10px 16px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 244, 250, 0.92));
  border-top: 1px solid rgba(180, 200, 230, 0.25);
}

#cardOverlay .analyzer-sekai-stage .analyzer-footer-close {
  appearance: none;
  min-width: min(260px, 70%);
  min-height: 46px;
  padding: 10px 32px;
  border: 2px solid rgba(255, 143, 208, 0.45);
  border-radius: 999px;
  background:
    linear-gradient(145deg, #fff, #ffe8f4 55%, #e8f7ff);
  color: var(--ca-ink);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(255, 143, 208, 0.2),
    0 0 18px rgba(122, 208, 255, 0.14);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

#cardOverlay .analyzer-sekai-stage .analyzer-footer-close:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--ca-pink);
  box-shadow:
    0 14px 28px rgba(255, 143, 208, 0.28),
    0 0 24px rgba(255, 213, 106, 0.2);
}

/* Nav arrows attached to the card stage */
#cardOverlay .analyzer-sekai-stage .analyzer-arrow.overlay-arrow {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 6 !important;
  width: 40px !important;
  height: 40px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.75) !important;
  border-radius: 50% !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 232, 244, 0.94)) !important;
  color: var(--ca-ink) !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-shadow:
    0 10px 22px rgba(40, 55, 100, 0.22),
    0 0 14px rgba(255, 143, 208, 0.16) !important;
  cursor: pointer;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-stage .analyzer-arrow.left {
  left: 2px !important;
  right: auto !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-card-stage .analyzer-arrow.right {
  right: 2px !important;
  left: auto !important;
}

#cardOverlay .analyzer-sekai-stage .analyzer-reticle,
#cardOverlay .analyzer-sekai-stage .analyzer-screen::before,
#cardOverlay .analyzer-sekai-stage .analyzer-screen::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 860px) {
  html.starlight-embedded #cardOverlay.card-analyzer-open .analyzer-full-stage.analyzer-sekai-stage,
  #cardOverlay.card-analyzer-open .analyzer-full-stage.analyzer-sekai-stage,
  #cardOverlay .analyzer-full-stage.analyzer-sekai-stage {
    width: min(100vw - 12px, 680px) !important;
    max-width: calc(100vw - 12px) !important;
    height: min(900px, calc(100dvh - 12px)) !important;
    max-height: calc(100dvh - 12px) !important;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-body {
    padding: 4px 14px 6px;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-main-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-header-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    max-width: none;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-identity {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-card-stage {
    padding: 8px 40px;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-card-stage .full-card-wrap.analyzer-card-shell,
  #cardOverlay .analyzer-sekai-stage #fullCard3d.analyzer-card-shell {
    width: min(240px, 68vw, 38vh) !important;
    max-width: 240px !important;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-card-stage .analyzer-arrow.left { left: 0 !important; }
  #cardOverlay .analyzer-sekai-stage .analyzer-card-stage .analyzer-arrow.right { right: 0 !important; }

  #cardOverlay .analyzer-sekai-stage .analyzer-tab {
    padding: 8px 14px;
    font-size: 0.84rem;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-footer-close {
    min-width: min(240px, 84%);
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-spark-tr {
    right: 52px;
  }
}

@media (max-width: 520px) {
  #cardOverlay .analyzer-sekai-stage .analyzer-header-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-stat-row {
    grid-template-columns: auto 1fr auto;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-stat-icon {
    display: none;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-spark {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cardOverlay .analyzer-sekai-stage .analyzer-modal {
    animation: none !important;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-spark,
  #cardOverlay .analyzer-sekai-stage .analyzer-series-spark,
  #cardOverlay .analyzer-sekai-stage .analyzer-card-stage::before {
    animation: none !important;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-spark {
    opacity: 0.7;
  }

  #cardOverlay .analyzer-sekai-stage .analyzer-tab,
  #cardOverlay .analyzer-sekai-stage .analyzer-footer-close,
  #cardOverlay .analyzer-sekai-stage .analyzer-close,
  #cardOverlay .analyzer-sekai-stage .analyzer-card-shell .full-inner,
  #cardOverlay .analyzer-sekai-stage .analyzer-card-shell.flip-to-back .full-inner,
  #cardOverlay .analyzer-sekai-stage .analyzer-card-shell.flip-to-front .full-inner {
    transition: none !important;
    animation: none !important;
  }
}

/* Pause decorative loops while Full View is closed (overlay still in DOM). */
#cardOverlay:not(.open) .analyzer-sekai-stage .analyzer-spark,
#cardOverlay:not(.open) .analyzer-sekai-stage .analyzer-series-spark,
#cardOverlay:not(.open) .analyzer-sekai-stage .analyzer-card-stage::before {
  animation: none !important;
}
