/* ============================================================
   Prismaera v1.1.1 — 演出スタイル (Season 1 第1章)
   ============================================================ */
:root {
  --bg: #05060d;
  --bg-2: #0a0e1d;
  --text: #e8ecff;
  --muted: #7e86a6;
  --r: #6fa8ff;
  --sr: #c87dff;
  --ssr: #ffd96a;
  --ur-a: #ff5faa;
  --ur-b: #ffd84d;
  --ur-c: #5fffd4;
  --ur-d: #7ea8ff;
  --ur-e: #c87dff;
  --lr-a: #ffffff;
  --lr-b: #ffe9a8;
  --lr-c: #ff5faa;
  --lr-d: #5fffd4;
  --lr-e: #7ea8ff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, "Segoe UI", "Yu Gothic UI", system-ui, sans-serif;
  color: var(--text);
  background: #000;
  overflow-x: hidden;
}

/* background layer — tier によって明度/色を変化 */
#bg-layer {
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 30%, #121a36 0%, #05060d 50%, #000 100%);
  transition: filter 1.2s ease, background 1.2s ease;
}
body.t-100 #bg-layer { filter: hue-rotate(20deg) saturate(1.3); }
body.t-500 #bg-layer {
  background: radial-gradient(ellipse at 50% 30%, #2a1f56 0%, #0b0a22 50%, #000 100%);
  filter: saturate(1.5);
}
body.t-1000 #bg-layer {
  background: conic-gradient(from 0deg at 50% 50%, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff, #ff5faa);
  filter: saturate(1.5) brightness(0.45) blur(1px);
  animation: slow-spin 60s linear infinite;
}
@keyframes slow-spin { to { transform: rotate(360deg); } }

/* オーロラドリフト (決定テーマ aurora) */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(120deg,
      transparent 0%,
      rgba(95, 255, 212, 0.22) 25%,
      rgba(200, 125, 255, 0.28) 45%,
      rgba(255, 95, 170, 0.22) 65%,
      transparent 90%);
  transform: skewY(-8deg);
  animation: aurora-drift 18s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  filter: blur(30px);
}
@keyframes aurora-drift {
  0%   { transform: skewY(-8deg) translateX(-10%); opacity: 0.9; }
  50%  { transform: skewY(-6deg) translateX(5%);   opacity: 1; }
  100% { transform: skewY(-10deg) translateX(-5%); opacity: 0.85; }
}

/* starfield */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent 50%),
    radial-gradient(1px 1px at 80% 30%, #fff, transparent 50%),
    radial-gradient(1.5px 1.5px at 30% 70%, #fff, transparent 50%),
    radial-gradient(1px 1px at 60% 80%, #fff, transparent 50%),
    radial-gradient(1px 1px at 90% 60%, #fff, transparent 50%),
    radial-gradient(1px 1px at 25% 90%, #fff, transparent 50%),
    radial-gradient(1px 1px at 45% 15%, #fff, transparent 50%),
    radial-gradient(1px 1px at 70% 45%, #fff, transparent 50%);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from {opacity:.3;} to {opacity:.9;} }

/* ======= topbar ======= */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: rgba(10,14,29,0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 10;
}
.title {
  font-size: 20px; font-weight: 700; letter-spacing: 0.08em;
  background: linear-gradient(90deg, #ffd84d, #5fffd4, #c87dff, #ff5faa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ver { font-size: 11px; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.title-kana {
  font-size: 12px; color: var(--muted); margin-left: 6px;
  letter-spacing: 0.06em; font-weight: 400;
  background: none; -webkit-text-fill-color: currentColor;
}
.stats { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stat {
  font-size: 12px; color: var(--muted); padding: 6px 10px;
  background: rgba(255,255,255,0.04); border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
.stat b { color: var(--text); font-weight: 700; margin-left: 4px; }
.reset {
  font-family: inherit; font-size: 11px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  background: rgba(255,255,255,0.04); color: var(--muted);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ======= hero ======= */
main { max-width: 1100px; margin: 0 auto; padding: 40px 22px 60px; }

.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center;
  margin-bottom: 48px;
}
.hero h1 {
  font-size: 42px; margin: 0 0 8px; letter-spacing: 0.1em;
  background: linear-gradient(90deg, #fff, #ffd84d 30%, #c87dff 60%, #5fffd4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.rate { display: flex; gap: 10px; flex-wrap: wrap; }
.rate span {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.rate .r { color: var(--r); }
.rate .sr { color: var(--sr); }
.rate .ssr { color: var(--ssr); }
.rate .ur { color: #fff; background: linear-gradient(90deg, var(--ur-a), var(--ur-b), var(--ur-c), var(--ur-d)); }
.rate .lr {
  color: #111; font-weight: 800;
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-size: 300% 300%;
  animation: rate-shine 2s linear infinite;
  border: 1px solid rgba(255,255,255,0.5);
}

/* summon buttons */
.cta { display: flex; gap: 14px; }
.summon {
  position: relative; cursor: pointer;
  min-width: 140px; padding: 22px 28px;
  font-family: inherit; font-size: 18px; font-weight: 700; letter-spacing: 0.1em;
  color: #fff; background: transparent;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.summon::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(200,125,255,0.15), rgba(95,255,212,0.15));
  opacity: 0.7; z-index: -1;
}
.summon:hover {
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 30px rgba(200,125,255,0.4);
  transform: translateY(-2px);
}
.summon:active { transform: translateY(0); }
.summon .lbl { display: block; }
.summon .hint {
  display: block; font-size: 10px; margin-top: 4px;
  color: rgba(255,255,255,0.5); letter-spacing: 0.2em;
}
.summon.ten {
  border-color: rgba(255,216,77,0.5);
  box-shadow: 0 0 20px rgba(255,216,77,0.15);
}
.summon.ten::before {
  background: linear-gradient(135deg, rgba(255,95,170,0.2), rgba(255,216,77,0.2), rgba(95,255,212,0.2));
}

/* ======= Prism Defense CTA ======= */
.td-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 14px 18px;
  background: linear-gradient(120deg, rgba(255,95,170,0.12), rgba(200,125,255,0.12) 50%, rgba(126,168,255,0.12));
  border: 1px solid rgba(255,140,240,0.3);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  cursor: pointer;
}
.td-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  background-size: 300% 100%;
  animation: tdShine 5s linear infinite;
  pointer-events: none;
}
@keyframes tdShine {
  0% { background-position: 100% 50%; }
  100% { background-position: -100% 50%; }
}
.td-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,95,170,0.2);
  border-color: rgba(255,140,240,0.55);
}
.td-cta:active { transform: translateY(0); }
.td-cta-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff5faa, #c87dff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: 0 0 42px;
  box-shadow: 0 4px 12px rgba(255,95,170,0.35);
}
.td-cta-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.td-cta-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.td-cta-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
}
.td-cta-arrow {
  font-size: 20px;
  color: rgba(255,140,240,0.75);
  flex: 0 0 auto;
  transition: transform .2s ease;
}
.td-cta:hover .td-cta-arrow { transform: translateX(4px); }

/* TDサブボタン (ホーム下部の控えめリンク) */
.td-cta-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  align-self: flex-start;
}
.td-cta-sub:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,140,240,0.45);
  transform: translateY(-1px);
}
.td-cta-sub-icon { font-size: 14px; }
.td-cta-sub-arrow { font-size: 14px; transition: transform 0.15s; }
.td-cta-sub:hover .td-cta-sub-arrow { transform: translateX(3px); }

/* ======= history ======= */
.history h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); font-size: 11px; }
.history-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.hcard {
  aspect-ratio: 2/3; border-radius: 6px;
  background: #0a0e1d; border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: end; justify-content: center;
  padding: 4px; font-size: 10px; color: #fff;
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.hcard.r { border-color: var(--r); box-shadow: 0 0 8px rgba(111,168,255,0.2); }
.hcard.sr { border-color: var(--sr); box-shadow: 0 0 10px rgba(200,125,255,0.35); }
.hcard.ssr { border-color: var(--ssr); box-shadow: 0 0 14px rgba(255,217,106,0.5); }
.hcard.ur {
  border: 2px solid transparent;
  background-image:
    linear-gradient(#0a0e1d, #0a0e1d),
    linear-gradient(135deg, var(--ur-a), var(--ur-b), var(--ur-c), var(--ur-d), var(--ur-e));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 18px rgba(255,95,170,0.6);
}
.hcard.lr {
  border: 3px solid transparent;
  background-image:
    linear-gradient(#0a0e1d, #0a0e1d),
    linear-gradient(135deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 22px rgba(255,255,255,0.6), 0 0 40px rgba(255,216,77,0.4);
}
.hcard-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
}
.hcard-name {
  position: relative;
  background: rgba(0,0,0,0.6); padding: 2px 4px; border-radius: 3px;
}

/* ======= stage overlay ======= */
.stage {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: none;
  overflow: hidden;
}
.stage.active { display: block; }
#stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.stage-skip {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 0.2em;
}

/* tier colors during summon */
.stage.tier-r { background: radial-gradient(circle at 50% 50%, #112a4a 0%, #000 70%); }
.stage.tier-sr { background: radial-gradient(circle at 50% 50%, #2a1a4a 0%, #000 70%); }
.stage.tier-ssr { background: radial-gradient(circle at 50% 50%, #4a3a10 0%, #000 70%); }
.stage.tier-ur { background: #000; }
.stage.tier-lr { background: radial-gradient(circle at 50% 50%, #1a1030 0%, #000 80%); }

/* character reveal */
.char-reveal {
  max-height: 82vh; max-width: 80vw;
  filter: drop-shadow(0 0 30px rgba(255,255,255,0.4));
  animation:
    char-pop .6s cubic-bezier(.2,1.3,.4,1),
    idle-breath 4s ease-in-out infinite 0.6s;
}
.tier-ur .char-reveal {
  filter:
    drop-shadow(0 0 30px rgba(255,95,170,0.8))
    drop-shadow(0 0 60px rgba(255,216,77,0.6));
  animation:
    char-pop .6s cubic-bezier(.2,1.3,.4,1),
    idle-float 3s ease-in-out infinite 0.6s,
    idle-breath 4s ease-in-out infinite 0.6s;
}
.tier-lr .char-reveal {
  filter:
    drop-shadow(0 0 40px rgba(255,255,255,0.95))
    drop-shadow(0 0 80px rgba(255,216,77,0.7))
    drop-shadow(0 0 140px rgba(255,95,170,0.5));
  animation:
    char-pop .6s cubic-bezier(.2,1.3,.4,1),
    idle-float 3s ease-in-out infinite 0.6s,
    idle-breath 4s ease-in-out infinite 0.6s;
}
.char-reveal.lr-aura {
  position: relative;
}
.tier-lr .stage-chars::before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 800px; height: 800px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255,255,255,0.4) 0%,
    rgba(255,216,77,0.3) 30%,
    rgba(255,95,170,0.2) 60%,
    transparent 80%);
  filter: blur(40px);
  animation: lr-halo-pulse 2.5s ease-in-out infinite;
  z-index: -1;
}
@keyframes lr-halo-pulse {
  0%,100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}
.tier-ssr .char-reveal {
  filter:
    drop-shadow(0 0 25px rgba(255,216,77,0.55))
    drop-shadow(0 0 50px rgba(255,185,60,0.35));
  animation:
    char-pop .6s cubic-bezier(.2,1.3,.4,1),
    idle-sway 5s ease-in-out infinite 0.6s,
    idle-breath 4s ease-in-out infinite 0.6s;
}
@keyframes char-pop {
  0% { transform: scale(0.3) translateY(0); opacity: 0; filter: blur(20px); }
  100% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
}
/* 浮遊(縦揺れ) */
@keyframes idle-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
/* ゆらぎ(軽い左右) */
@keyframes idle-sway {
  0%,100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(3px) translateY(-3px); }
  75% { transform: translateX(-3px) translateY(-3px); }
}
/* 呼吸(スケール微) */
@keyframes idle-breath {
  0%,100% { scale: 1; }
  50% { scale: 1.015; }
}

/* VFX pillar */
.fx-pillar {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 300px; transform: translateX(-50%);
  background-size: contain; background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  mix-blend-mode: screen;
}
.fx-pillar.show {
  animation: pillar-in 0.5s ease-out forwards;
}
@keyframes pillar-in {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0.1); }
  60% { opacity: 1; transform: translateX(-50%) scaleY(1.1); }
  100% { opacity: 1; transform: translateX(-50%) scaleY(1); }
}

/* text "gacha!" intro */
.fx-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 88px; font-weight: 900; letter-spacing: 0.15em;
  color: transparent; -webkit-text-stroke: 2px #fff;
  text-shadow: 0 0 40px currentColor;
  opacity: 0;
}
.fx-text.pop { animation: text-pop 0.7s ease-out forwards; }
@keyframes text-pop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0.4); letter-spacing: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.4); letter-spacing: 0.3em; }
}

/* Crack VFX (fake break) */
.fx-crack {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0;
}
.fx-crack.show {
  animation: crack-in 0.7s ease-out forwards;
}

/* ───── LR専用: 画面シャター(破砕) ───── */
.fx-shatter {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 6;
  background: #000;
  opacity: 0;
}
.fx-shatter.on { animation: shatter-bg 1.1s ease-in forwards; }
@keyframes shatter-bg {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}
.fx-shatter::before,
.fx-shatter::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url('images/fx/crack_burst.png');
  background-size: cover; background-position: center;
  filter: brightness(1.3);
  opacity: 0;
}
.fx-shatter.on::before {
  animation: shatter-layer-a 1.1s ease-out forwards;
}
.fx-shatter.on::after {
  animation: shatter-layer-b 1.1s ease-out forwards;
}
@keyframes shatter-layer-a {
  0%   { opacity: 0; transform: scale(0.7) rotate(0deg); }
  30%  { opacity: 1; transform: scale(1.1) rotate(0deg); }
  70%  { opacity: 1; transform: scale(1.2) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.6) rotate(0deg); }
}
@keyframes shatter-layer-b {
  0%   { opacity: 0; transform: scale(0.9) rotate(120deg); }
  35%  { opacity: 0.85; transform: scale(1.15) rotate(120deg); }
  75%  { opacity: 0.7; transform: scale(1.3) rotate(120deg); }
  100% { opacity: 0; transform: scale(1.8) rotate(120deg); }
}

/* 画面を4分割してシャードが散っていく (CSSのみで実装) */
.fx-shard {
  position: absolute;
  width: 55vmax; height: 55vmax;
  background-image: var(--shard-bg, linear-gradient(135deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff));
  background-size: 200% 200%;
  opacity: 0;
  filter: brightness(1.5);
  pointer-events: none;
  z-index: 7;
}
.fx-shard.s1 { top: -10%; left: -10%; clip-path: polygon(0 0, 100% 0, 20% 100%, 0 40%); }
.fx-shard.s2 { top: -10%; right: -10%; clip-path: polygon(0 0, 100% 0, 100% 40%, 80% 100%); }
.fx-shard.s3 { bottom: -10%; left: -10%; clip-path: polygon(0 60%, 20% 0, 80% 100%, 0 100%); }
.fx-shard.s4 { bottom: -10%; right: -10%; clip-path: polygon(20% 0, 100% 60%, 100% 100%, 80% 100%); }
.fx-shard.on.s1 { animation: shard-out-tl 1.0s cubic-bezier(.3,.2,.4,1) forwards; }
.fx-shard.on.s2 { animation: shard-out-tr 1.0s cubic-bezier(.3,.2,.4,1) forwards; }
.fx-shard.on.s3 { animation: shard-out-bl 1.0s cubic-bezier(.3,.2,.4,1) forwards; }
.fx-shard.on.s4 { animation: shard-out-br 1.0s cubic-bezier(.3,.2,.4,1) forwards; }
@keyframes shard-out-tl {
  0%   { opacity: 0; transform: translate(0,0) rotate(0deg); }
  20%  { opacity: 0.95; transform: translate(0,0) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50vw, -50vh) rotate(-25deg); }
}
@keyframes shard-out-tr {
  0%   { opacity: 0; transform: translate(0,0) rotate(0deg); }
  20%  { opacity: 0.95; transform: translate(0,0) rotate(0deg); }
  100% { opacity: 0; transform: translate(50vw, -50vh) rotate(25deg); }
}
@keyframes shard-out-bl {
  0%   { opacity: 0; transform: translate(0,0) rotate(0deg); }
  20%  { opacity: 0.95; transform: translate(0,0) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50vw, 50vh) rotate(25deg); }
}
@keyframes shard-out-br {
  0%   { opacity: 0; transform: translate(0,0) rotate(0deg); }
  20%  { opacity: 0.95; transform: translate(0,0) rotate(0deg); }
  100% { opacity: 0; transform: translate(50vw, 50vh) rotate(-25deg); }
}
@keyframes crack-in {
  0% { opacity: 0; transform: scale(0.85); }
  40% { opacity: 0.95; transform: scale(1.05); filter: brightness(1.6); }
  100% { opacity: 0; transform: scale(1.25); filter: brightness(1); }
}

/* white flash — tier強度に応じて3段階 */
.fx-flash {
  position: absolute; inset: 0; background: #fff;
  opacity: 0; pointer-events: none;
}
.fx-flash.soft { animation: flash-soft .45s ease-out; }
.fx-flash.mid  { animation: flash-mid  .5s ease-out; }
.fx-flash.hard { animation: flash-hard .55s ease-out; }
@keyframes flash-soft { 0%{opacity:0;} 30%{opacity:0.35;} 100%{opacity:0;} }
@keyframes flash-mid  { 0%{opacity:0;} 25%{opacity:0.6;}  100%{opacity:0;} }
@keyframes flash-hard { 0%{opacity:0;} 20%{opacity:0.85;} 100%{opacity:0;} }

/* ======= 強化VFX ======= */

/* 煽りテキスト: 「SR確定...?」など沈黙中の表示 */
.fx-taunt {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 28px; font-weight: 600; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
  opacity: 0;
  white-space: nowrap;
}

/* キャラセリフ (Type B 用シネマティック表示) */
.fx-quote {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%);
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(18px, 5.2vw, 36px);
  font-weight: 700; letter-spacing: 0.12em;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255,255,255,0.6),
    0 0 28px rgba(255, 200, 120, 0.5),
    0 4px 18px rgba(0,0,0,0.8);
  opacity: 0;
  text-align: center;
  max-width: 92vw;
  line-height: 1.5;
  pointer-events: none;
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.fx-quote.show {
  animation: quote-in 0.7s cubic-bezier(.2,.7,.3,1) forwards, quote-fade 0.7s ease-in 3.2s forwards;
}
@keyframes quote-in {
  0%   { opacity: 0; transform: translate(-50%, -40%); letter-spacing: 0.5em; filter: blur(10px); }
  60%  { opacity: 1; transform: translate(-50%, -50%); letter-spacing: 0.18em; filter: blur(0); }
  100% { opacity: 1; transform: translate(-50%, -50%); letter-spacing: 0.15em; filter: blur(0); }
}
@keyframes quote-fade {
  0%   { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -55%); }
}
@media (max-width: 600px) {
  .fx-quote { letter-spacing: 0.08em; }
}
@media (max-width: 380px) {
  .fx-quote { letter-spacing: 0.05em; }
}
.fx-taunt.show {
  animation: taunt-in .5s ease-out forwards, taunt-fade .5s ease-in 2s forwards;
}
@keyframes taunt-in {
  0% { opacity: 0; transform: translate(-50%, -30%); letter-spacing: 0; }
  100% { opacity: 0.85; transform: translate(-50%, -50%); letter-spacing: 0.2em; }
}
@keyframes taunt-fade {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* 確率ポップ: UR時の 0.3% 表示 */
.fx-rate {
  position: absolute; top: 14%; left: 50%; transform: translateX(-50%);
  padding: 10px 22px; border-radius: 999px;
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff);
  background-size: 300% 300%;
  color: #111; font-weight: 800; font-size: 22px; letter-spacing: 0.15em;
  box-shadow: 0 0 30px rgba(255,255,255,0.5);
  opacity: 0;
  animation: rate-in .5s cubic-bezier(.2,1.4,.4,1) forwards, rate-shine 2s linear infinite;
}
@keyframes rate-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.5); }
  60% { opacity: 1; transform: translateX(-50%) translateY(5px) scale(1.15); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes rate-shine {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 波紋: UR確定時 */
.fx-ring {
  position: absolute; top: 50%; left: 50%;
  width: 20px; height: 20px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,0.8);
  opacity: 0;
  pointer-events: none;
}
.fx-ring.go {
  animation: ring-expand 1.2s cubic-bezier(.2,.6,.3,1) forwards;
}
@keyframes ring-expand {
  0% { opacity: 0.9; width: 20px; height: 20px; border-width: 6px; }
  100% { opacity: 0; width: 140vmax; height: 140vmax; border-width: 1px; }
}

/* 星屑降下: UR時にキャラ背景へ */
.fx-stars {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx-stars .star {
  position: absolute; top: -20px;
  width: 3px; height: 3px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px currentColor;
  opacity: 0;
  animation: star-fall linear forwards;
}
@keyframes star-fall {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translateY(110vh) scale(1.2); }
}

/* キャラ後方オーラ: UR時 */
.char-reveal.ur-aura {
  position: relative;
}
.tier-ur .stage-chars::before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 600px; height: 600px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,216,77,0.35) 0%, rgba(255,95,170,0.2) 40%, transparent 70%);
  filter: blur(30px);
  animation: aura-pulse 2.5s ease-in-out infinite;
  z-index: -1;
}
@keyframes aura-pulse {
  0%,100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* ============================================================
   演出バリエーション: Orb / Meteor / Portal / Cutin
   ============================================================ */

/* ───── Type A: 結晶オーブ昇格（中央の1玉が色変化） ───── */
.fx-orb {
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff 0%, var(--c, #6fa8ff) 40%, transparent 70%);
  filter: blur(6px);
  box-shadow: 0 0 80px var(--c, #6fa8ff);
  animation: orb-pulse 0.45s ease-in-out infinite alternate;
  transition: width .4s ease, height .4s ease, box-shadow .4s ease, background .4s ease;
  pointer-events: none;
}
.fx-orb.orb-r   { --c: #6fa8ff; width: 50px; height: 50px; }
.fx-orb.orb-sr  { --c: #c87dff; width: 80px; height: 80px; box-shadow: 0 0 120px #c87dff; }
.fx-orb.orb-ssr { --c: #ffd96a; width: 120px; height: 120px; box-shadow: 0 0 180px #ffd96a; }
.fx-orb.orb-ur  {
  --c: #ff5faa; width: 180px; height: 180px;
  background: radial-gradient(circle, #fff 0%, #ffd84d 20%, #ff5faa 50%, #c87dff 80%, transparent 100%);
  box-shadow: 0 0 250px #ff5faa, 0 0 400px #7ea8ff;
}
.fx-orb.orb-lr  {
  --c: #ffffff; width: 240px; height: 240px;
  background: radial-gradient(circle, #fff 0%, #ffe9a8 15%, #ffd84d 35%, #ff5faa 55%, #5fffd4 75%, #7ea8ff 90%, transparent 100%);
  box-shadow: 0 0 350px #ffffff, 0 0 500px #ffd84d, 0 0 700px #ff5faa;
}
@keyframes orb-pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1.12); }
}
.fx-orb.burst { animation: orb-burst 0.45s ease-out forwards; }
@keyframes orb-burst {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(4); opacity: 0; filter: blur(30px); }
}

/* ───── Type D: 流星群 ───── */
.fx-meteor {
  position: absolute;
  width: 4px; height: 220px; border-radius: 2px;
  background: linear-gradient(to bottom, transparent, currentColor 70%, #fff);
  color: #fff;
  opacity: 0;
  transform-origin: top center;
  filter: drop-shadow(0 0 16px currentColor);
  pointer-events: none;
}
.fx-meteor.go {
  animation: meteor-fall var(--dur, 0.65s) cubic-bezier(.3,.1,.4,1) forwards;
}
@keyframes meteor-fall {
  0%   { opacity: 0; transform: translate(var(--from-x), var(--from-y)) rotate(var(--angle)); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)); }
}

/* ───── Type E: ポータル開扉 ───── */
.fx-portal {
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, #ffd96a, #fff6c0, #ffb347, #ffd96a, #fff6c0, #ffb347, #ffd96a);
  opacity: 0;
  filter: blur(14px);
  pointer-events: none;
}
.fx-portal.go {
  animation: portal-open 1.6s ease-out forwards, portal-spin 2.2s linear infinite;
}
@keyframes portal-open {
  0%   { opacity: 0; width: 0; height: 0; filter: blur(4px); }
  20%  { opacity: 0.85; width: 120px; height: 120px; filter: blur(12px); }
  70%  { opacity: 1; width: 520px; height: 520px; filter: blur(18px); }
  100% { opacity: 0; width: 900px; height: 900px; filter: blur(40px); }
}
@keyframes portal-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.fx-portal-ring {
  position: absolute; top: 50%; left: 50%;
  width: 140px; height: 140px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 40px #fff, inset 0 0 30px #fff;
  opacity: 0;
  pointer-events: none;
}
.fx-portal-ring.go {
  animation: portal-ring 1.6s ease-out forwards;
}
@keyframes portal-ring {
  0%   { opacity: 0; width: 20px; height: 20px; border-width: 6px; }
  40%  { opacity: 1; }
  100% { opacity: 0; width: 700px; height: 700px; border-width: 1px; }
}

/* ───── Type F: カットイン ───── */
.fx-cutin {
  position: absolute; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(90deg, var(--c1, #ff5faa), var(--c2, #ffd84d));
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 60px var(--c1, #ff5faa);
}
.fx-cutin.top    { top: -50%; }
.fx-cutin.bottom { bottom: -50%; }
.fx-cutin.top.go    { animation: cutin-top    .55s cubic-bezier(.2,.8,.3,1.3) forwards; }
.fx-cutin.bottom.go { animation: cutin-bottom .55s cubic-bezier(.2,.8,.3,1.3) forwards; }
@keyframes cutin-top    { 0% { top: -55%; opacity: 0; } 80% { top: -2%; opacity: 0.95; } 100% { top: -1%; opacity: 0.9; } }
@keyframes cutin-bottom { 0% { bottom: -55%; opacity: 0; } 80% { bottom: -2%; opacity: 0.95; } 100% { bottom: -1%; opacity: 0.9; } }
.fx-cutin.exit-top    { animation: cutin-exit-top    .3s ease-in forwards; }
.fx-cutin.exit-bottom { animation: cutin-exit-bottom .3s ease-in forwards; }
@keyframes cutin-exit-top    { to { top: -60%; opacity: 0; } }
@keyframes cutin-exit-bottom { to { bottom: -60%; opacity: 0; } }

/* ============================================================
   高レア専用: 放射光 / 虹背景 / ズームバースト / 光シャワー
   ============================================================ */

/* UR専用: 画面全面が虹色でゆっくり回転 */
.fx-rainbow-bg {
  position: absolute; inset: 0;
  background: conic-gradient(from 0deg,
    rgba(255,95,170,0.55),
    rgba(255,216,77,0.55),
    rgba(95,255,212,0.55),
    rgba(126,168,255,0.55),
    rgba(200,125,255,0.55),
    rgba(255,95,170,0.55)
  );
  filter: saturate(1.3) blur(40px);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}
.fx-rainbow-bg.on {
  animation: rb-in .6s ease-out forwards, rb-spin 10s linear infinite;
}
@keyframes rb-in {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 0.8; transform: scale(1); }
}
@keyframes rb-spin { to { transform: rotate(360deg); } }

/* ゴッドレイ: 中央から放射状に光線（SSR=金 / UR=虹） */
.fx-godrays {
  position: absolute; top: 50%; left: 50%;
  width: 2000px; height: 2000px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  animation: godrays-spin 20s linear infinite;
}
.fx-godrays.on {
  animation: godrays-in .6s ease-out forwards, godrays-spin 20s linear infinite;
}
.fx-godrays::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    var(--ray, rgba(255,217,106,0.6)) 4deg,
    transparent 8deg,
    transparent 18deg
  );
  filter: blur(2px);
}
.fx-godrays.ur::before {
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(255,95,170,0.55) 3deg,
    rgba(255,216,77,0.55) 6deg,
    rgba(95,255,212,0.55) 9deg,
    rgba(126,168,255,0.55) 12deg,
    transparent 15deg,
    transparent 24deg
  );
}
@keyframes godrays-in {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.4); }
  100% { opacity: 0.85; transform: translate(-50%, -50%) rotate(30deg) scale(1); }
}
@keyframes godrays-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* キャラ降臨時のズームバースト（char-popの代替で派手化） */
.char-reveal.burst-in {
  animation:
    char-burst 0.9s cubic-bezier(.15,1.5,.35,1) forwards,
    idle-breath 4s ease-in-out infinite 0.9s;
}
.tier-ur .char-reveal.burst-in {
  filter:
    drop-shadow(0 0 40px rgba(255,95,170,0.95))
    drop-shadow(0 0 80px rgba(255,216,77,0.7))
    drop-shadow(0 0 140px rgba(95,255,212,0.6));
  animation:
    char-burst 0.9s cubic-bezier(.15,1.5,.35,1) forwards,
    idle-float 3s ease-in-out infinite 0.9s,
    idle-breath 4s ease-in-out infinite 0.9s;
}
.tier-ssr .char-reveal.burst-in {
  filter:
    drop-shadow(0 0 35px rgba(255,217,106,0.85))
    drop-shadow(0 0 70px rgba(255,185,60,0.55));
  animation:
    char-burst 0.9s cubic-bezier(.15,1.5,.35,1) forwards,
    idle-sway 5s ease-in-out infinite 0.9s,
    idle-breath 4s ease-in-out infinite 0.9s;
}
@keyframes char-burst {
  0%   { transform: scale(2.2); opacity: 0; filter: blur(30px); }
  30%  { transform: scale(0.85); opacity: 1; filter: blur(0); }
  55%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 下から上への虹色粒子噴水 */
.fx-fountain {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
  pointer-events: none;
  overflow: hidden;
}
.fx-fountain .drop {
  position: absolute; bottom: -30px;
  width: 6px; height: 20px; border-radius: 10px;
  background: currentColor;
  box-shadow: 0 0 20px currentColor;
  opacity: 0;
  animation: drop-up var(--dur, 1.6s) ease-out forwards;
}
@keyframes drop-up {
  0%   { opacity: 0; transform: translateY(0) scaleY(1); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(calc(-100vh - 60px)) scaleY(0.6); }
}

/* 上からの光の条 (god-rays descending) */
.fx-rays-down {
  position: absolute; top: -10%; left: 0; right: 0; height: 120%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}
.fx-rays-down.on { animation: rays-down-in 0.6s ease-out forwards; }
@keyframes rays-down-in { to { opacity: 1; } }
.fx-rays-down .beam {
  position: absolute; top: -20%;
  width: 80px; height: 140%;
  background: linear-gradient(to bottom, transparent, currentColor 30%, currentColor 70%, transparent);
  filter: blur(18px);
  opacity: 0.65;
  mix-blend-mode: screen;
  animation: beam-breath 2.5s ease-in-out infinite alternate;
}
@keyframes beam-breath {
  0%   { opacity: 0.3; transform: scaleY(0.9); }
  100% { opacity: 0.7; transform: scaleY(1.1); }
}

/* ───── 続行ヒント (SSR/UR演出後) ───── */
.fx-continue-hint {
  position: absolute; bottom: 4%; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 14px; letter-spacing: 0.35em;
  white-space: nowrap; font-weight: 600;
  text-shadow: 0 0 16px rgba(255,255,255,0.4);
  animation: hint-pulse 1.4s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%,100% { opacity: 0.35; }
  50% { opacity: 0.95; }
}

/* 表示前の「溜め」用 薄暗暴風 */
.stage.charge-up::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
  animation: charge-breath 1s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}
@keyframes charge-breath {
  0% { opacity: 0.3; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* ───── UR超演出: 紙吹雪 / 虹大円環 / MIRACLEテロップ ───── */

.fx-confetti {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx-confetti .piece {
  position: absolute; top: -30px;
  background: currentColor;
  opacity: 0;
  box-shadow: 0 0 8px currentColor;
  animation: confetti-fall var(--dur, 3s) linear forwards;
}
@keyframes confetti-fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: 0.4; transform: translateY(110vh) rotate(720deg); }
}

.fx-halo {
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 14px solid transparent;
  background-image:
    linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0,0.85)),
    conic-gradient(from 0deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff, #ff5faa);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 40px rgba(255,95,170,0.6));
}
.fx-halo.go {
  animation: halo-appear 1.8s cubic-bezier(.2,.8,.3,1) forwards, halo-spin 12s linear infinite;
}
@keyframes halo-appear {
  0%   { opacity: 0; width: 0; height: 0; }
  40%  { opacity: 1; width: 760px; height: 760px; }
  100% { opacity: 0.75; width: 820px; height: 820px; }
}
@keyframes halo-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.fx-miracle {
  position: absolute; top: 25%; left: 50%; transform: translate(-50%, -50%);
  font-size: 72px; font-weight: 900; letter-spacing: 0.25em;
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff, #ff5faa);
  background-size: 400% 400%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,95,170,0.8));
  opacity: 0; white-space: nowrap;
}
.fx-miracle.go {
  animation:
    miracle-in .7s cubic-bezier(.2,1.4,.4,1) forwards,
    miracle-shine 1.5s linear infinite;
}

/* LEGEND テロップ (LR専用、MIRACLEよりさらに大きく豪華) */
.fx-legend-intro {
  position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%);
  font-size: 88px; font-weight: 900; letter-spacing: 0.3em;
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-size: 500% 500%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(255,255,255,0.95)) drop-shadow(0 0 80px rgba(255,216,77,0.7));
  opacity: 0; white-space: nowrap;
}
.fx-legend-intro.go {
  animation:
    legend-in 1.1s cubic-bezier(.2,1.3,.4,1) forwards,
    legend-shine 1.2s linear infinite;
}
@keyframes legend-in {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.3) rotate(-8deg); letter-spacing: 0; }
  40%  { opacity: 1; transform: translate(-50%,-50%) scale(1.25) rotate(0deg); }
  70%  { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg); }
}
@keyframes legend-shine {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes miracle-in {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.4) rotate(-5deg); }
  50%  { opacity: 1; transform: translate(-50%,-50%) scale(1.2) rotate(0deg); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg); }
}
@keyframes miracle-shine {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 画面全体に軽いズームイン（UR最終演出用） */
.stage.zoom-in #stage-chars,
.stage.zoom-in #stage-vfx {
  animation: ur-zoom 0.5s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes ur-zoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ───── キャラ名プレート（降臨後に表示・SSR/URは設定も表示） ───── */
.fx-charname {
  position: absolute; bottom: 10%; left: 50%;
  transform: translateX(-50%);
  opacity: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; max-width: 90vw;
}
.fx-charname-top {
  display: flex; align-items: center; gap: 18px;
  font-size: 44px; font-weight: 800; letter-spacing: 0.18em;
  white-space: nowrap;
}
.fx-charname-sub {
  font-size: 18px; font-weight: 600; letter-spacing: 0.2em;
  opacity: 0.9;
  -webkit-text-fill-color: currentColor;
}
.fx-charname-caption {
  font-size: 16px; font-style: italic; letter-spacing: 0.1em;
  opacity: 0.85;
  padding: 5px 18px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  -webkit-text-fill-color: rgba(255,255,255,0.92);
  max-width: 80vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-charname.r   { color: #aad4ff; text-shadow: 0 0 20px var(--r); }
.fx-charname.sr  { color: #e0a0ff; text-shadow: 0 0 25px var(--sr); }
.fx-charname.ssr { color: #ffe49a; text-shadow: 0 0 28px var(--ssr); }
.fx-charname.ur {
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255,95,170,0.6));
}
.fx-charname.lr {
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(255,255,255,0.8)) drop-shadow(0 0 50px rgba(255,216,77,0.5));
  animation: rate-shine 2s linear infinite;
}
.fx-charname.lr .fx-charname-tier {
  color: #111; -webkit-text-fill-color: initial;
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff);
  background-size: 300% 300%;
  animation: rate-shine 2s linear infinite;
  border-color: rgba(255,255,255,0.9);
}
.fx-charname.go { animation: charname-in .8s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes charname-in {
  0%   { opacity: 0; transform: translateX(-50%) translateY(18px); letter-spacing: 0; }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); letter-spacing: 0.18em; }
}
.fx-charname-tier {
  font-size: 18px; font-weight: 800; letter-spacing: 0.2em;
  padding: 4px 14px; border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1.5px solid currentColor;
  -webkit-text-fill-color: initial;
}
.fx-charname-new {
  font-size: 14px; font-weight: 900; letter-spacing: 0.15em;
  padding: 3px 10px; border-radius: 4px;
  background: linear-gradient(90deg, #ff5faa, #ffd84d);
  color: #111;
  -webkit-text-fill-color: initial;
  box-shadow: 0 0 16px rgba(255,216,77,0.7);
  animation: new-pulse 1.2s ease-in-out infinite alternate;
}
/* URのバッジは虹枠 */
.fx-charname.ur .fx-charname-tier {
  color: #fff;
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff);
  background-size: 300% 300%;
  border-color: rgba(255,255,255,0.8);
  animation: rate-shine 2s linear infinite;
}

/* ───── 10連イントロ「× 10」 ───── */
.fx-ten-intro {
  position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
  font-size: 96px; font-weight: 900; letter-spacing: 0.25em;
  color: transparent; -webkit-text-stroke: 2px #fff;
  text-shadow: 0 0 40px #5fffd4, 0 0 80px #5fffd4;
  opacity: 0; white-space: nowrap;
}
.fx-ten-intro.go {
  animation: ten-intro 1.1s cubic-bezier(.2,1.3,.4,1) forwards;
}
@keyframes ten-intro {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); letter-spacing: 0; }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); letter-spacing: 0.25em; }
  80%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); letter-spacing: 0.45em; }
}

/* SSR/UR fanfare text（"SSR獲得!" などを画面下にドーン） */
.fx-win {
  position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%);
  font-size: 48px; font-weight: 900; letter-spacing: 0.25em;
  opacity: 0; white-space: nowrap;
}
.fx-win.ssr { color: #ffd96a; text-shadow: 0 0 30px rgba(255,216,77,0.8); }
.fx-win.ur  {
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(255,95,170,0.5);
}
.fx-win.go {
  animation: win-in .6s cubic-bezier(.2,1.4,.4,1) forwards;
}
@keyframes win-in {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* shake */
.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-8px, 4px); }
  40% { transform: translate(8px, -4px); }
  60% { transform: translate(-5px, 3px); }
  80% { transform: translate(5px, -3px); }
}

/* ======= result modal ======= */
.result {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.result.active { display: flex; }
.result-inner {
  max-width: 720px; width: 100%;
  background: rgba(15,20,40,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 24px;
  max-height: 90vh; overflow: auto;
}
.result-inner h2 {
  margin: 0 0 16px; font-size: 22px; text-align: center;
  letter-spacing: 0.1em;
}
.result-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.rcard {
  aspect-ratio: 2/3; border-radius: 8px;
  background: #0a0e1d; border: 1px solid rgba(255,255,255,0.1);
  background-size: cover; background-position: center top;
  display: flex; align-items: end; justify-content: center;
  padding: 6px;
  position: relative;
}
.rcard .rcard-name {
  font-size: 11px; background: rgba(0,0,0,0.75);
  padding: 3px 6px; border-radius: 4px;
}
.rcard.r { border-color: var(--r); box-shadow: 0 0 10px rgba(111,168,255,0.25); }
.rcard.sr { border-color: var(--sr); box-shadow: 0 0 12px rgba(200,125,255,0.4); }
.rcard.ssr { border-color: var(--ssr); box-shadow: 0 0 16px rgba(255,217,106,0.55); }
.rcard.ur {
  border: 2px solid transparent;
  background-image:
    linear-gradient(#0a0e1d, #0a0e1d),
    linear-gradient(135deg, var(--ur-a), var(--ur-b), var(--ur-c), var(--ur-d), var(--ur-e));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 22px rgba(255,95,170,0.7);
}
.rcard.lr {
  border: 3px solid transparent;
  background-image:
    linear-gradient(#0a0e1d, #0a0e1d),
    linear-gradient(135deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 28px rgba(255,255,255,0.7), 0 0 55px rgba(255,216,77,0.4);
}
.close {
  display: block; margin: 0 auto;
  padding: 10px 28px; border-radius: 10px;
  background: linear-gradient(135deg, #c87dff, #5fffd4);
  color: #111; font-weight: 700; letter-spacing: 0.1em;
  border: none; cursor: pointer; font-family: inherit;
}

/* ───── NEWバッジ (結果カード) ───── */
.rcard-new {
  position: absolute; top: 4px; right: 4px;
  font-size: 9px; font-weight: 900; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 3px;
  background: linear-gradient(90deg, #ff5faa, #ffd84d);
  color: #111; z-index: 2;
  box-shadow: 0 0 10px rgba(255,216,77,0.6);
  animation: new-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes new-pulse {
  0%   { transform: scale(1); box-shadow: 0 0 8px rgba(255,216,77,0.5); }
  100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(255,216,77,0.95); }
}

/* ───── 希少度セクション ───── */
.result-rarity {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}
.rarity-rank {
  font-size: 24px; font-weight: 900; letter-spacing: 0.3em;
  padding: 4px 16px; border-radius: 6px;
}
.rarity-rank.rank-c     { color: #aaa; background: rgba(255,255,255,0.05); }
.rarity-rank.rank-b     { color: #6fa8ff; background: rgba(111,168,255,0.1); }
.rarity-rank.rank-bplus { color: #6fa8ff; background: rgba(111,168,255,0.18); text-shadow: 0 0 10px rgba(111,168,255,0.6); }
.rarity-rank.rank-a     { color: #c87dff; background: rgba(200,125,255,0.1); text-shadow: 0 0 10px rgba(200,125,255,0.5); }
.rarity-rank.rank-aplus { color: #c87dff; background: rgba(200,125,255,0.2); text-shadow: 0 0 14px rgba(200,125,255,0.8); }
.rarity-rank.rank-s     { color: #ffd96a; background: rgba(255,217,106,0.1); text-shadow: 0 0 14px rgba(255,217,106,0.7); }
.rarity-rank.rank-splus { color: #ffd96a; background: rgba(255,217,106,0.2); text-shadow: 0 0 18px rgba(255,217,106,0.9); }
.rarity-rank.rank-ss,
.rarity-rank.rank-sss {
  background: linear-gradient(90deg, #ff5faa, #ffd84d, #5fffd4, #7ea8ff, #c87dff);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(255,95,170,0.8));
  animation: rate-shine 2s linear infinite;
}
.rarity-rank.rank-legend {
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-size: 400% 400%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.9)) drop-shadow(0 0 40px rgba(255,216,77,0.6));
  animation: rate-shine 1.8s linear infinite;
  font-size: 28px; letter-spacing: 0.35em;
}
.rarity-line {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  justify-content: center; font-size: 12px; color: rgba(255,255,255,0.85);
}
.rarity-line b { color: #fff; font-weight: 800; }
.rarity-line .dot { color: rgba(255,255,255,0.3); }

@media (max-width: 640px) {
  .rarity-rank { font-size: 18px; letter-spacing: 0.2em; }
  .rarity-line { font-size: 10px; gap: 6px; }
}

/* ============================================================
   キャラ図鑑
   ============================================================ */
.gallery-btn {
  font-family: inherit; font-size: 11px;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(135deg, #c87dff, #5fffd4);
  color: #111; font-weight: 700; letter-spacing: 0.05em;
  border: none;
}

.gallery-modal {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  display: none; overflow-y: auto;
  padding: 20px;
}
.gallery-modal.active { display: block; }

.gallery-inner {
  max-width: 1100px; margin: 20px auto;
  background: rgba(15,20,40,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
}
.gallery-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gallery-header h2 {
  margin: 0; font-size: 22px; letter-spacing: 0.1em;
  background: linear-gradient(90deg, #ffd84d, #5fffd4, #c87dff, #ff5faa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gallery-stats { display: flex; gap: 8px; font-size: 11px; flex-wrap: wrap; }
.gallery-stats span {
  padding: 5px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.06);
}
.gallery-stats .g-lr   {
  color: #111; background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4) !important;
  background-size: 300% 300%; animation: rate-shine 2s linear infinite;
  font-weight: 700;
}
.gallery-stats .g-ur   { color: #ffd84d; }
.gallery-stats .g-ssr  { color: var(--ssr); }
.gallery-stats .g-sr   { color: var(--sr); }
.gallery-stats .g-r    { color: var(--r); }
.gallery-inner .close {
  font-family: inherit; font-size: 11px;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  background: rgba(255,255,255,0.08); color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.gallery-card {
  aspect-ratio: 2/3; border-radius: 8px;
  background-size: cover; background-position: center top;
  background-color: #0a0e1d;
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
  border: 1.5px solid rgba(255,255,255,0.1);
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(255,255,255,0.2);
}
.gallery-card.locked {
  cursor: not-allowed;
  background-image: none !important;
  background: repeating-linear-gradient(45deg, #141828 0 12px, #0c1020 12px 24px);
}
.gallery-card.locked::after {
  content: "? ? ?"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; letter-spacing: 0.3em;
  color: rgba(255,255,255,0.35);
}
.gallery-card.locked:hover {
  transform: none;
  box-shadow: none;
}
.gallery-card .card-tier {
  position: absolute; top: 6px; left: 6px;
  padding: 2px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  z-index: 2;
}
.gallery-card.r  .card-tier { background: var(--r);   color: #fff; }
.gallery-card.sr .card-tier { background: var(--sr);  color: #fff; }
.gallery-card.ssr .card-tier { background: var(--ssr); color: #111; }
.gallery-card.ur .card-tier {
  background: linear-gradient(135deg, var(--ur-a), var(--ur-b), var(--ur-c), var(--ur-d));
  color: #111;
}
.gallery-card .card-new {
  position: absolute; top: 6px; right: 6px;
  font-size: 9px; font-weight: 900; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 3px;
  background: linear-gradient(90deg, #ff5faa, #ffd84d);
  color: #111; z-index: 2;
  box-shadow: 0 0 10px rgba(255,216,77,0.7);
  animation: new-pulse 1.2s ease-in-out infinite alternate;
}
.gallery-card .card-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 8px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.92), transparent);
  font-size: 12px; font-weight: 600;
  text-align: center;
}
.gallery-card.r  { border-color: var(--r);   box-shadow: 0 0 8px rgba(111,168,255,0.25); }
.gallery-card.sr { border-color: var(--sr);  box-shadow: 0 0 10px rgba(200,125,255,0.35); }
.gallery-card.ssr { border-color: var(--ssr); box-shadow: 0 0 14px rgba(255,217,106,0.5); }
.gallery-card.ur {
  border: 2px solid transparent;
  background-image:
    linear-gradient(#0a0e1d, #0a0e1d),
    linear-gradient(135deg, var(--ur-a), var(--ur-b), var(--ur-c), var(--ur-d), var(--ur-e));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 18px rgba(255,95,170,0.55);
}
.gallery-card.ur.locked {
  background-image: none;
  background: repeating-linear-gradient(45deg, #141828 0 12px, #0c1020 12px 24px);
  border: 1.5px solid rgba(255,95,170,0.4);
}
.gallery-card.lr .card-tier {
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff);
  background-size: 300% 300%;
  animation: rate-shine 2s linear infinite;
  color: #111; font-weight: 900;
}
.gallery-card.lr {
  border: 3px solid transparent;
  background-image:
    linear-gradient(#0a0e1d, #0a0e1d),
    linear-gradient(135deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 25px rgba(255,255,255,0.5), 0 0 50px rgba(255,95,170,0.3);
  animation: lr-card-glow 3s ease-in-out infinite alternate;
}
@keyframes lr-card-glow {
  0%   { box-shadow: 0 0 25px rgba(255,255,255,0.5), 0 0 50px rgba(255,95,170,0.3); }
  100% { box-shadow: 0 0 40px rgba(255,216,77,0.7), 0 0 80px rgba(95,255,212,0.4); }
}
.gallery-card.lr.locked {
  background-image: none;
  background: repeating-linear-gradient(45deg, #2a2a45 0 12px, #1a1a30 12px 24px);
  border: 2px solid rgba(255,216,77,0.5);
  animation: none;
}

/* ───── Character Detail (拡大) ───── */
.char-detail {
  position: fixed; inset: 0; z-index: 240;  /* relations (230) より上 */
  background: rgba(0,0,0,0.95);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.char-detail.active { display: flex; }
.char-detail-inner {
  max-width: 1000px; width: 100%;
  height: min(92vh, 900px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 30px;
  background: rgba(15,20,40,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 30px;
  position: relative;
  overflow: hidden;
}
.char-detail-img-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.char-detail-img-wrap img {
  max-width: 100%; max-height: 80vh;
  border-radius: 10px;
  filter: drop-shadow(0 0 40px rgba(255,255,255,0.35));
}
.char-detail-info {
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; padding-right: 6px;
  min-height: 0;
  height: 100%;
}
.char-detail-tier {
  display: inline-block; padding: 5px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.25em;
  width: fit-content;
}
.char-detail-tier.r  { background: var(--r);   color: #fff; }
.char-detail-tier.sr { background: var(--sr);  color: #fff; }
.char-detail-tier.ssr { background: var(--ssr); color: #111; }
.char-detail-tier.ur {
  background: linear-gradient(90deg, var(--ur-a), var(--ur-b), var(--ur-c), var(--ur-d), var(--ur-e));
  color: #111; background-size: 300% 300%;
  animation: rate-shine 2s linear infinite;
}
.char-detail-tier.lr {
  background: linear-gradient(90deg, #fff, #ffd84d, #ff5faa, #5fffd4, #7ea8ff, #fff);
  color: #111; background-size: 300% 300%;
  animation: rate-shine 2s linear infinite;
  box-shadow: 0 0 20px rgba(255,255,255,0.6);
}
.char-detail-name {
  font-size: 30px; font-weight: 800; letter-spacing: 0.12em;
  margin-top: 4px;
}

/* 凸表示 */
.char-detail-dup {
  margin-top: 8px;
}
.char-detail-dup .dup-bar {
  display: inline-flex; align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,217,122,0.12);
  border: 1px solid rgba(255,217,122,0.4);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.char-detail-dup .dup-current { color: #ffd97a; font-weight: 800; font-size: 16px; }
.char-detail-dup .dup-sep { color: rgba(255,255,255,0.4); }
.char-detail-dup .dup-max { color: rgba(255,255,255,0.7); }
.char-detail-dup .dup-levels {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.char-detail-dup .dup-lv {
  padding: 0;
  border-radius: 6px;
  font-size: 12px;
  overflow: hidden;
}
.char-detail-dup .dup-lv-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
}
.char-detail-dup .dup-lv.has-lore .dup-lv-head {
  cursor: pointer;
  user-select: none;
}
.char-detail-dup .dup-lv.has-lore .dup-lv-head:hover {
  background: rgba(255,217,122,0.14);
}
.char-detail-dup .dup-lv.unlocked {
  background: rgba(255,217,122,0.08);
  border: 1px solid rgba(255,217,122,0.25);
  color: rgba(255,255,255,0.9);
}
.char-detail-dup .dup-lv.locked {
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
}
.char-detail-dup .dup-lv-num {
  font-family: monospace; font-weight: 700;
  min-width: 40px;
  color: inherit;
}
.char-detail-dup .dup-lv-text { letter-spacing: 0.05em; flex: 1; }
.char-detail-dup .dup-lv-toggle {
  font-size: 10px;
  color: rgba(255,217,122,0.7);
  transition: transform 0.25s ease;
  margin-left: auto;
}
.char-detail-dup .dup-lv.expanded .dup-lv-toggle {
  transform: rotate(180deg);
}
.char-detail-dup .dup-lv-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
  border-top: 1px dashed rgba(255,217,122,0);
  transition: max-height 0.35s ease, padding 0.25s ease, border-color 0.25s ease;
}
.char-detail-dup .dup-lv.expanded .dup-lv-body {
  max-height: 600px;
  padding: 12px 14px 14px;
  border-top: 1px dashed rgba(255,217,122,0.25);
}

/* 結果カードの凸バッジ */
.rcard-dup {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, #ffd97a, #ffb347);
  color: #2a1a05;
  font-size: 10px; font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(255,180,80,0.4);
  z-index: 2;
}
.char-detail-title {
  font-size: 15px; color: var(--muted); letter-spacing: 0.2em;
}
.char-detail-caption {
  font-size: 17px; font-style: italic;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  color: rgba(255,255,255,0.92);
  white-space: pre-line;  /* セリフ内の \n を改行として表示 */
  line-height: 2.1;       /* ふりがな対応 */
}
.char-detail-desc { line-height: 2.1; }
.char-detail-info ruby { ruby-position: over; }
.char-detail-info rt {
  font-size: 0.5em;
  letter-spacing: 0.06em;
  font-weight: normal;
  color: rgba(255, 217, 122, 0.85);
}
.char-detail-title ruby { ruby-position: over; }
.char-detail-title rt {
  font-size: 0.55em;
  font-weight: normal;
  color: rgba(255, 217, 122, 0.85);
  letter-spacing: 0.05em;
}
.char-detail-desc {
  font-size: 14px; line-height: 1.9;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.03em;
}
.close-detail {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  border-radius: 50%; font-size: 22px; font-family: inherit;
  z-index: 2;
}
.close-detail:hover { background: rgba(255,255,255,0.15); }

/* prev/next ナビ */
.char-detail-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  border-radius: 50%; font-size: 32px; line-height: 1;
  font-family: inherit;
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: 0; padding-bottom: 4px;
  transition: background 0.15s, transform 0.15s;
}
.char-detail-nav.prev { left: 14px; }
.char-detail-nav.next { right: 14px; }
.char-detail-nav:hover { background: rgba(255,255,255,0.18); transform: translateY(-50%) scale(1.08); }

/* ズーム用ヒント */
.char-detail-img-wrap { position: relative; cursor: zoom-in; }
.char-detail-zoom-hint {
  position: absolute; bottom: 8px; right: 8px;
  font-size: 11px; color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5); padding: 4px 10px;
  border-radius: 4px; pointer-events: none;
  letter-spacing: 0.1em;
}

/* カウンタ表示 */
.char-detail-counter {
  font-size: 12px; color: var(--muted);
  text-align: right; letter-spacing: 0.15em;
  margin-top: auto; padding-top: 6px;
}

/* 関連キャラ */
.char-detail-relations {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.char-detail-relations .rel-head {
  font-size: 12px; letter-spacing: 0.2em; color: var(--muted);
  margin-bottom: 10px;
}
.char-detail-relations .rel-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.char-detail-relations .rel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  transition: background 0.15s, transform 0.15s;
}
.char-detail-relations .rel-item.clickable { cursor: pointer; }
.char-detail-relations .rel-item.clickable:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.char-detail-relations .rel-item.locked { opacity: 0.4; }
.char-detail-relations .rel-thumb {
  width: 36px; height: 36px; border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: #222;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #666; font-size: 16px;
  border: 2px solid var(--muted);
}
.char-detail-relations .rel-thumb.r  { border-color: var(--r); }
.char-detail-relations .rel-thumb.sr { border-color: var(--sr); }
.char-detail-relations .rel-thumb.ssr { border-color: var(--ssr); }
.char-detail-relations .rel-thumb.ur { border-color: var(--ur-a); }
.char-detail-relations .rel-thumb.lr { border-color: #fff; }
.char-detail-relations .rel-info {
  display: flex; flex-direction: column; gap: 1px;
  line-height: 1.2;
}
.char-detail-relations .rel-role {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
}
.char-detail-relations .rel-name {
  font-size: 12px; color: #fff;
}

/* result 画面のアクションボタン */
.result-actions {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 24px; flex-wrap: wrap;
  align-items: center;
}
.result-btn {
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 12px 28px; border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.result-btn.primary {
  background: linear-gradient(90deg, #ff5faa, #ffd84d);
  color: #111;
  border: 1px solid #ffd84d;
  font-size: 15px;
  padding: 14px 36px;
  box-shadow: 0 4px 16px rgba(255, 95, 170, 0.3);
}
.result-btn.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 95, 170, 0.45);
}
.result-btn.secondary {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
}
.result-btn.secondary:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

/* ───── ストーリーセクション (ホーム画面メイン) ───── */
.story-section {
  margin-top: 32px;
}
.story-section-title {
  font-size: 18px; font-weight: 700; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.95);
  margin: 0 0 16px 0;
}
.story-list {
  display: grid; gap: 14px;
}
.story-card {
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left; gap: 6px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(150, 110, 230, 0.22), rgba(80, 130, 220, 0.18));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  color: #fff; cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.story-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  background-size: 300% 100%;
  animation: tdShine 6s linear infinite;
  pointer-events: none;
}
.story-card:hover {
  background: linear-gradient(135deg, rgba(180, 130, 250, 0.32), rgba(100, 150, 240, 0.26));
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(120, 90, 200, 0.35);
}
.story-card.disabled {
  opacity: 0.4; cursor: default;
  background: rgba(255,255,255,0.04);
}
.story-card.disabled::before { display: none; }
.story-card.disabled:hover { transform: none; box-shadow: none; background: rgba(255,255,255,0.04); }
.story-card-meta {
  font-size: 11px; letter-spacing: 0.22em;
  color: rgba(255,255,255,0.7);
}
.story-card-title {
  font-size: 22px; font-weight: 700; letter-spacing: 0.06em;
  margin-top: 2px;
}
.story-card-desc {
  font-size: 13px; color: rgba(255,255,255,0.85);
  margin-top: 4px;
  line-height: 1.6;
}
.story-card-volume {
  font-size: 11px; color: rgba(255,255,255,0.5);
  margin-top: 8px; font-family: monospace;
}

/* ───── ストーリー目次 (モーダル内オーバーレイ) ───── */
.story-toc-btn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  border-radius: 50%; font-size: 16px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.story-toc-btn:hover { background: rgba(255,255,255,0.18); }
.story-toc {
  position: absolute;
  top: 56px; right: 0; bottom: 56px;
  width: 320px; max-width: 90%;
  background: rgba(0,0,0,0.97);
  border-left: 1px solid rgba(255,255,255,0.18);
  display: none;
  flex-direction: column;
  z-index: 5;
  backdrop-filter: blur(8px);
  box-shadow: -8px 0 24px rgba(0,0,0,0.5);
}
.story-toc.active { display: flex; }
.story-toc-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.story-toc-header h3 {
  margin: 0; font-size: 14px; letter-spacing: 0.2em;
  color: #fff;
}
.story-toc-close {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  border-radius: 50%; font-size: 16px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.story-toc-list {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
}
.story-toc-item {
  display: block; width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-family: inherit; font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.story-toc-item:hover {
  background: rgba(255,255,255,0.06);
}
.story-toc-item.current {
  background: rgba(255, 217, 122, 0.13);
  border-left-color: #ffd97a;
  color: #fff;
}
.story-toc-label {
  display: inline-block;
  font-family: monospace; font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-right: 8px;
  min-width: 30px;
}
.story-toc-title {
  display: inline;
}
.story-toc-tag {
  display: inline-block;
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  color: rgba(255,255,255,0.6);
}
@media (max-width: 600px) {
  .story-toc { width: 100%; max-width: 100%; }
  .story-toc-item { padding: 12px 16px; font-size: 14px; }
}

/* ───── ストーリーモーダル (紙芝居風) ───── */
.story-modal {
  position: fixed; inset: 0; z-index: 235;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: stretch; justify-content: center;
  backdrop-filter: blur(8px);
  padding: 0;
}
.story-modal.active { display: flex; }
.story-inner {
  max-width: 900px; width: 100%;
  height: 100vh;
  display: flex; flex-direction: column;
  background: #0a0e20;
  overflow: hidden;
}
.story-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.6);
  z-index: 2;
  flex-shrink: 0;
}
.story-header-meta { display: flex; flex-direction: column; gap: 2px; }
.story-meta {
  font-size: 10px; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.55);
}
.story-header h2 {
  margin: 0; font-size: 16px; letter-spacing: 0.06em;
  color: #fff; font-weight: 700;
}
.story-header-controls {
  display: flex; align-items: center; gap: 12px;
}
.story-progress {
  font-size: 12px; color: rgba(255,255,255,0.7);
  font-family: monospace; letter-spacing: 0.1em;
  background: rgba(255,255,255,0.06);
  padding: 4px 10px; border-radius: 999px;
}
.story-close {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  border-radius: 50%; font-size: 20px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.story-close:hover { background: rgba(255,255,255,0.18); }

/* ─ ステージ (背景+本文) ─ */
.story-stage {
  flex: 1; position: relative;
  overflow: hidden;       /* 背景は固定、内側でスクロール */
  cursor: pointer;
  user-select: text;
}
.story-bg {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 0.5s ease;
}
.story-scroll {
  position: absolute; inset: 0;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.story-bg.bg-default   { background: linear-gradient(180deg, #0a1228, #1a1538); }
.story-bg.bg-cover     { background: radial-gradient(ellipse at center, #2a1a55 0%, #0a0820 70%); }
.story-bg.bg-prologue  { background: radial-gradient(ellipse at top, #2a3870 0%, #0a1230 80%); }
.story-bg.bg-academy   { background: linear-gradient(180deg, #1a2850, #2a3870 60%, #3a5090); }
.story-bg.bg-shadow    { background: radial-gradient(ellipse at center, #2a0a30 0%, #050208 80%); }
.story-bg.bg-holy      { background: radial-gradient(ellipse at top, #f0e8c0 0%, #80a8d8 50%, #1a2850 100%); }
.story-bg.bg-flame     { background: radial-gradient(ellipse at bottom, #c83020 0%, #6a0810 60%, #1a0510 100%); }
.story-bg.bg-rainbow   { background: linear-gradient(135deg, #ff5faa, #ffd84d 25%, #5fffd4 50%, #7ea8ff 75%, #c87dff); }
.story-bg.bg-finale    { background: radial-gradient(ellipse at center, #d8c870 0%, #4a3a1a 60%, #0a0408 100%); }

.story-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.story-scene-wrap {
  position: relative; z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 32px 90px;
  min-height: 100%;
  box-sizing: border-box;
  display: flex; flex-direction: column;
}
.story-scene-label {
  font-size: 11px; letter-spacing: 0.3em;
  color: rgba(255,255,255,0.6);
  font-family: monospace;
  margin-bottom: 6px;
}
.story-scene-title {
  font-size: 26px; font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
  margin: 0 0 22px 0;
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}
.story-scene-content {
  font-size: 16px; line-height: 2.4;
  color: rgba(255,255,255,0.96);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85);
}
.story-scene-content ruby,
.story-scene-title ruby {
  ruby-position: over;
}
.story-scene-content rt,
.story-scene-title rt {
  font-size: 0.5em;
  letter-spacing: 0.06em;
  font-weight: normal;
  color: rgba(255, 217, 122, 0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
}
.story-scene-content p {
  margin: 0.9em 0;
}
.story-scene-content p:first-child { margin-top: 0; }
.story-scene-content strong { color: #ffd97a; }
.story-scene-content em { color: rgba(255,255,255,0.88); font-style: italic; }
.story-scene-content .char-link,
.story-scene-title .char-link {
  color: #ffd97a;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 217, 122, 0.6);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.story-scene-content .char-link:hover,
.story-scene-title .char-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}
.story-scene-content blockquote {
  border-left: 3px solid rgba(255,217,122,0.7);
  padding: 6px 16px;
  margin: 1em 0;
  color: rgba(255,255,255,0.82);
  font-style: italic;
  background: rgba(0,0,0,0.2);
}
.story-scene-content hr {
  border: none; border-top: 1px solid rgba(255,255,255,0.2);
  margin: 1.6em 0;
}
.story-scene-content h2,
.story-scene-content h3,
.story-scene-content h4 {
  color: #ffd97a;
  margin: 1.4em 0 0.6em;
  letter-spacing: 0.06em;
}

.story-loading, .story-error {
  text-align: center; padding: 60px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}
.story-error { color: #ff8888; }

/* 登場キャラ立ち絵 (シーンタイトル直下) */
.story-scene-chars {
  margin: 0 0 24px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.45);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}
.story-chars-label {
  font-size: 10px; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.story-chars-list {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.story-char-thumb {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  cursor: pointer;
  width: 72px;
  transition: transform 0.15s;
}
.story-char-thumb:hover {
  transform: translateY(-2px);
}
.story-char-img {
  width: 60px; height: 60px;
  border-radius: 50%;
  background-size: cover; background-position: center top;
  border: 2px solid var(--muted);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.story-char-thumb.r .story-char-img  { border-color: var(--r); }
.story-char-thumb.sr .story-char-img { border-color: var(--sr); }
.story-char-thumb.ssr .story-char-img { border-color: var(--ssr); }
.story-char-thumb.ur .story-char-img { border-color: var(--ur-a); }
.story-char-thumb.lr .story-char-img { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.5); }
.story-char-name {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  text-align: center;
  line-height: 1.2;
}

/* ─ ナビゲーションバー ─ */
.story-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px;
  background: rgba(0,0,0,0.7);
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 2;
  flex-shrink: 0;
  gap: 12px;
}
.story-nav-btn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 10px 22px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  min-width: 100px;
}
.story-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.story-nav-btn:disabled {
  opacity: 0.3; cursor: default;
}
.story-nav-btn.primary {
  background: linear-gradient(90deg, #ff5faa, #ffd84d);
  color: #111; border-color: #ffd84d;
  box-shadow: 0 3px 12px rgba(255,95,170,0.25);
}
.story-nav-btn.primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(255,95,170,0.35);
}
.story-nav-hint {
  font-size: 11px; color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  text-align: center;
  flex: 1;
}

/* モバイル */
@media (max-width: 600px) {
  .story-header { padding: 10px 14px; }
  .story-header h2 { font-size: 14px; }
  .story-meta { font-size: 9px; }
  .story-progress { font-size: 11px; padding: 3px 8px; }
  .story-close { width: 30px; height: 30px; font-size: 18px; }
  .story-scene-wrap { padding: 24px 20px 60px; }
  .story-scene-title { font-size: 20px; margin-bottom: 16px; }
  .story-scene-content { font-size: 14px; line-height: 2.2; }
  .story-nav { padding: 10px 14px; gap: 8px; }
  .story-nav-btn { font-size: 12px; padding: 8px 14px; min-width: 70px; }
  .story-nav-hint { font-size: 9px; }
  .story-card { padding: 14px 16px; }
  .story-card-title { font-size: 16px; }
  .story-scene-chars { padding: 10px 12px; margin-bottom: 18px; }
  .story-chars-list { gap: 8px; }
  .story-char-thumb { width: 60px; }
  .story-char-img { width: 48px; height: 48px; }
  .story-char-name { font-size: 10px; }
}

/* ───── 相関図 ───── */
.relations-modal {
  position: fixed; inset: 0; z-index: 230;
  background: linear-gradient(135deg, #0a0e1f 0%, #1a1530 100%);
  display: none; flex-direction: column;
}
.relations-modal.active { display: flex; }
.relations-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; gap: 16px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.relations-header h2 {
  margin: 0; font-size: 22px; letter-spacing: 0.2em;
  color: #fff;
}
.relations-legend {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: rgba(255,255,255,0.85);
  flex-wrap: wrap;
}
.relations-legend .leg-line {
  display: inline-block;
  width: 28px; height: 3px; border-radius: 2px;
  margin-right: 4px; vertical-align: middle;
}
.leg-fellow    { background: #5fffaa; }
.leg-master    { background: #ffd84d; }
.leg-blood     { background: #ff5faa; }
.leg-childhood { background: #c87dff; }
.leg-admire    { background: #7ea8ff; outline: 1px dashed #7ea8ff; outline-offset: -1px; }
.leg-rival     { background: #ff8855; outline: 1px dotted #ff8855; outline-offset: -1px; }
.leg-sister    { background: #ff9fd0; }
.relations-canvas {
  flex: 1;
  overflow: auto;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 20px;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}
.relations-canvas:active { cursor: grabbing; }
.relations-canvas svg {
  width: 2000px; height: 1400px;
  flex-shrink: 0;
  pointer-events: auto;
}
/* キャラノードはクリック可、それ以外はパン優先 */
.relations-canvas svg [data-char-name] { pointer-events: auto; }
.relations-canvas svg g[data-char-name]:hover circle:first-of-type {
  stroke-width: 4;
  filter: drop-shadow(0 0 8px currentColor);
}

@media (max-width: 720px) {
  .relations-header { padding: 8px 10px; gap: 6px; flex-direction: column; align-items: stretch; }
  .relations-header h2 { font-size: 16px; margin: 0; text-align: center; }
  .relations-legend { justify-content: center; gap: 6px; font-size: 10px; }
  .relations-legend .leg-line { width: 18px; height: 2px; margin-right: 2px; }
  .relations-header .close { font-size: 11px; padding: 6px 10px; align-self: center; }
}
/* 関連キャラパネルのモバイル調整 */
@media (max-width: 720px) {
  .char-detail-relations { margin-top: 10px; padding-top: 10px; }
  .char-detail-relations .rel-list { gap: 6px; }
  .char-detail-relations .rel-item { padding: 4px 8px 4px 4px; gap: 6px; }
  .char-detail-relations .rel-thumb { width: 30px; height: 30px; }
  .char-detail-relations .rel-role { font-size: 9px; }
  .char-detail-relations .rel-name { font-size: 11px; }
}
/* 結果画面アクションボタンのモバイル */
@media (max-width: 600px) {
  .result-actions { flex-direction: column-reverse; gap: 10px; margin-top: 16px; }
  .result-btn { width: 100%; max-width: 280px; }
  .result-btn.primary { padding: 14px 24px; }
  .result-btn.secondary { padding: 10px 24px; font-size: 13px; }
}
/* 画像ズームコントロールのモバイル */
@media (max-width: 600px) {
  .char-img-zoom-controls { bottom: 16px; padding: 6px 10px; gap: 6px; }
  .char-img-zoom-controls button { width: 32px; height: 32px; font-size: 16px; }
  #char-img-zoom-level { font-size: 12px; min-width: 32px; }
  .char-img-zoom-hint { top: 12px; font-size: 10px; padding: 4px 10px; }
}

/* 画像拡大オーバーレイ */
.char-img-zoom {
  position: fixed; inset: 0; z-index: 260;  /* char-detail (240) より上 */
  background: rgba(0,0,0,0.96);
  display: none;
  align-items: center; justify-content: center;
  padding: 0;
  overflow: hidden;
  user-select: none;
}
.char-img-zoom.active { display: flex; }
.char-img-zoom img {
  max-width: 96vw; max-height: 96vh;
  object-fit: contain;
  filter: drop-shadow(0 0 60px rgba(255,255,255,0.4));
  cursor: zoom-in;
  transform: translate(0, 0) scale(1);
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}
.char-img-zoom-controls {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 262;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.7);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}
.char-img-zoom-controls button {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  border-radius: 50%; font-size: 18px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.char-img-zoom-controls button:hover { background: rgba(255,255,255,0.2); }
#char-img-zoom-level {
  color: #fff; font: 600 14px/1 monospace;
  min-width: 40px; text-align: center;
  letter-spacing: 0.05em;
}
.char-img-zoom-hint {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 262;
  color: rgba(255,255,255,0.7);
  font-size: 12px; letter-spacing: 0.1em;
  background: rgba(0,0,0,0.5);
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
}

/* responsive */
@media (max-width: 720px) {
  .char-detail-inner { grid-template-columns: 1fr; padding: 16px; gap: 16px; overflow-y: auto; }
  .char-detail-img-wrap img { max-height: 45vh; }
  .char-detail-name { font-size: 22px; }
  .char-detail-nav { width: 42px; height: 42px; font-size: 26px; }
  .char-detail-nav.prev { left: 6px; }
  .char-detail-nav.next { right: 6px; }
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 24px; margin-bottom: 32px; }
  .cta { justify-content: center; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar {
    padding: 10px 14px;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }
  .title { font-size: 16px; }
  .ver { font-size: 9px; }
  .title-kana { font-size: 10px; margin-left: 4px; }
  .stats { font-size: 10px; flex-wrap: wrap; gap: 6px; width: 100%; }
  .stat { padding: 4px 7px; }
  .gallery-btn, .reset { font-size: 10px; padding: 5px 8px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .hero h1 { font-size: 32px; }
  main { padding: 24px 14px 48px; }
  .summon { min-width: 120px; padding: 18px 22px; font-size: 16px; }

  /* ガチャ演出のモバイル調整 */
  .fx-text { font-size: 56px; }
  .fx-win { font-size: 28px; }
  .fx-miracle { font-size: 44px; }
  .fx-ten-intro { font-size: 64px; }
  .fx-rate { font-size: 15px; padding: 8px 16px; }

  /* キャラ名プレート */
  .fx-charname { bottom: 16%; max-width: 92vw; }
  .fx-charname-top { font-size: 24px; letter-spacing: 0.1em; gap: 10px; }
  .fx-charname-tier { font-size: 12px; padding: 3px 10px; }
  .fx-charname-sub { font-size: 12px; letter-spacing: 0.12em; }
  .fx-charname-caption {
    font-size: 11px; padding: 4px 10px;
    white-space: normal;
    line-height: 1.5;
  }
  .fx-continue-hint { font-size: 11px; letter-spacing: 0.2em; }

  /* 図鑑ヘッダー */
  .gallery-inner { padding: 16px; }
  .gallery-header { gap: 8px; padding-bottom: 10px; margin-bottom: 14px; }
  .gallery-header h2 { font-size: 18px; width: 100%; }
  .gallery-stats { font-size: 10px; width: 100%; }
  .gallery-stats span { padding: 4px 7px; }
  .gallery-inner .close { font-size: 10px; padding: 5px 10px; }

  /* キャラ詳細 */
  .char-detail-name { font-size: 20px; }
  .char-detail-title { font-size: 12px; }
  .char-detail-caption { font-size: 14px; padding: 10px 12px; }
  .char-detail-desc { font-size: 13px; line-height: 1.7; }
  .char-detail-inner { padding: 14px; gap: 12px; }
}

/* iPhone safe-area (ノッチ/ホームバー対応) */
@supports (padding: env(safe-area-inset-bottom)) {
  main { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
}

/* タッチ時のhover無効化（タップ時の不自然な残留hoverを防止） */
@media (hover: none) {
  .summon:hover { transform: none; box-shadow: 0 0 20px rgba(200,125,255,0.2); }
  .gallery-card:hover { transform: none; box-shadow: none; }
}

/* ============ BGM Panel ============ */
.bgm-panel {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 12000; padding: 16px;
  backdrop-filter: blur(8px);
}
.bgm-panel.active { display: flex; }
.bgm-inner {
  background: linear-gradient(180deg, rgba(30, 24, 56, 0.98), rgba(20, 16, 40, 0.98));
  border: 1px solid rgba(200, 180, 255, 0.3);
  border-radius: 20px; padding: 24px 22px 22px;
  width: 100%; max-width: 440px;
  max-height: min(90vh, 780px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(200, 125, 255, 0.2);
  position: relative;
}
.bgm-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: #aaa;
  font-size: 22px; cursor: pointer; padding: 4px 10px;
}
.bgm-close:hover { color: #fff; }
.bgm-title {
  font-size: 18px; margin: 0 0 16px; color: #fff; text-align: center;
  letter-spacing: 0.05em;
}
.bgm-current {
  background: rgba(0, 0, 0, 0.35); border-radius: 14px;
  padding: 14px 16px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(200, 180, 255, 0.18);
  text-align: center;
}
.bgm-current-label {
  font-size: 10px; letter-spacing: 0.15em;
  color: rgba(200, 180, 255, 0.7);
  margin-bottom: 4px;
}
.bgm-current-title {
  font-size: 17px; font-weight: 600; color: #fff;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.bgm-current-controls {
  display: flex; justify-content: center; gap: 10px;
}
.bgm-ctrl {
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff; font-size: 14px;
  border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: all 0.15s;
}
.bgm-ctrl:hover {
  background: rgba(200, 125, 255, 0.2);
  border-color: rgba(200, 125, 255, 0.45);
}
.bgm-ctrl.primary {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  border: none;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  width: 48px; height: 48px;
  font-size: 16px;
}
.bgm-ctrl.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.bgm-modes {
  display: flex; gap: 6px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.3); padding: 4px;
  border-radius: 10px;
}
.bgm-mode-btn {
  flex: 1; padding: 8px 0; font-size: 12px;
  background: none; border: none; color: rgba(255, 255, 255, 0.6);
  border-radius: 7px; cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.bgm-mode-btn:hover { color: #fff; }
.bgm-mode-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.bgm-section-label {
  font-size: 11px; letter-spacing: 0.04em;
  color: rgba(200, 180, 255, 0.6);
  margin-bottom: 8px;
}

.bgm-list {
  display: flex; flex-direction: column; gap: 6px;
}
.bgm-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.15s;
}
.bgm-row.now {
  border-color: rgba(200, 125, 255, 0.5);
  background: rgba(200, 125, 255, 0.08);
  box-shadow: 0 0 14px rgba(200, 125, 255, 0.12);
}
.bgm-check {
  position: relative; display: inline-block;
  width: 18px; height: 18px;
  cursor: pointer;
}
.bgm-check input { opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.bgm-check-box {
  display: block; width: 18px; height: 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(200, 180, 255, 0.4);
  border-radius: 4px;
  transition: all 0.15s;
}
.bgm-check input:checked + .bgm-check-box {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  border-color: transparent;
}
.bgm-check input:checked + .bgm-check-box::after {
  content: '✓'; color: #fff; font-size: 13px; font-weight: 700;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.bgm-info {
  cursor: pointer; min-width: 0;
}
.bgm-row-title {
  font-size: 14px; color: #fff; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bgm-row-desc {
  font-size: 11px; color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}
.bgm-row-play {
  width: 30px; height: 30px;
  background: rgba(200, 125, 255, 0.15);
  border: 1px solid rgba(200, 125, 255, 0.3);
  color: #fff; font-size: 11px;
  border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: all 0.15s;
}
.bgm-row-play:hover {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  border-color: transparent;
  transform: scale(1.08);
}

@media (max-width: 480px) {
  .bgm-inner { padding: 20px 16px 18px; }
  .bgm-title { font-size: 17px; }
  .bgm-current-title { font-size: 15px; }
  .bgm-mode-btn { font-size: 11px; padding: 7px 0; }
  .bgm-row { padding: 9px 10px; }
}

/* ============ Account Modal ============ */
.account-modal, .collision-modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 12000; padding: 16px;
  backdrop-filter: blur(8px);
}
.account-modal.active, .collision-modal.active { display: flex; }

.account-inner {
  background: linear-gradient(180deg, rgba(30, 24, 56, 0.98), rgba(20, 16, 40, 0.98));
  border: 1px solid rgba(200, 180, 255, 0.3);
  border-radius: 20px; padding: 28px 24px 24px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(200, 125, 255, 0.2);
  position: relative;
  max-height: min(90vh, 700px);
  overflow-y: auto;
}
.account-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: #aaa;
  font-size: 24px; cursor: pointer; padding: 4px 10px;
  transition: color 0.15s;
}
.account-close:hover { color: #fff; }
.account-title {
  font-size: 20px; margin: 0 0 8px; color: #fff; text-align: center;
  letter-spacing: 0.04em;
}
.account-hint {
  font-size: 13px; color: rgba(255, 255, 255, 0.65);
  text-align: center; margin-bottom: 20px; line-height: 1.5;
}
.account-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.3); padding: 4px; border-radius: 10px;
}
.account-tab {
  flex: 1; padding: 10px 0; font-size: 14px;
  background: none; border: none; color: rgba(255, 255, 255, 0.6);
  border-radius: 8px; cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.account-tab:hover { color: #fff; }
.account-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}
.account-form { display: flex; flex-direction: column; gap: 10px; }
.account-form input {
  padding: 12px 14px; font-size: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 180, 255, 0.2);
  border-radius: 8px; color: #fff;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.account-form input:focus {
  outline: none;
  border-color: rgba(200, 125, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(200, 125, 255, 0.15);
}
.account-form input::placeholder { color: rgba(255, 255, 255, 0.35); }
.account-submit {
  padding: 13px; margin-top: 8px;
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  border: none; color: #fff;
  font-size: 15px; font-weight: 600;
  border-radius: 10px; cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}
.account-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.45);
}
.account-submit:disabled { opacity: 0.5; cursor: wait; }
.account-error {
  color: #ff6b8a; font-size: 13px;
  min-height: 18px; margin-top: 4px;
  text-align: center;
}
.account-note {
  font-size: 11px; color: rgba(255, 255, 255, 0.45);
  margin-top: 10px; line-height: 1.5; text-align: center;
}
.account-info {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px; padding: 16px;
  margin: 16px 0 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.account-info-row {
  display: flex; justify-content: space-between;
  font-size: 14px; color: rgba(255, 255, 255, 0.7);
}
.account-info-row b { color: #fff; font-weight: 600; }
.account-logout {
  width: 100%; padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px; border-radius: 10px; cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.account-logout:hover {
  background: rgba(255, 100, 120, 0.15);
  border-color: rgba(255, 100, 120, 0.4);
  color: #ffb0c0;
}

/* ============ Collision Modal ============ */
.collision-inner {
  background: linear-gradient(180deg, rgba(30, 24, 56, 0.98), rgba(20, 16, 40, 0.98));
  border: 1px solid rgba(200, 180, 255, 0.3);
  border-radius: 20px; padding: 28px 24px 24px;
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(200, 125, 255, 0.25);
  max-height: min(90vh, 700px);
  overflow-y: auto;
}
.collision-title {
  font-size: 19px; margin: 0 0 6px; text-align: center; color: #fff;
}
.collision-hint {
  font-size: 13px; color: rgba(255, 255, 255, 0.65);
  text-align: center; margin-bottom: 18px;
}
.collision-compare {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px;
  align-items: stretch; margin-bottom: 20px;
}
.collision-col {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(200, 180, 255, 0.15);
  border-radius: 12px; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.collision-label {
  font-size: 12px; color: rgba(200, 180, 255, 0.8);
  text-align: center; margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(200, 180, 255, 0.15);
  font-weight: 600;
}
.collision-stats {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: rgba(255, 255, 255, 0.85);
}
.collision-stats .cs-row {
  display: flex; justify-content: space-between;
}
.collision-stats .cs-row b { color: #fff; font-weight: 600; }
.collision-divider {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: rgba(255, 255, 255, 0.5);
  padding: 0 4px;
}
.collision-actions { display: flex; flex-direction: column; gap: 8px; }
.collision-btn {
  padding: 13px; font-size: 14px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.collision-btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}
.collision-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.45);
}
.collision-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}
.collision-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

/* アカウントボタンのラベル */
#btn-account { display: inline-flex; align-items: center; gap: 4px; }
#account-label {
  font-size: 11px; letter-spacing: 0.02em;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .account-inner, .collision-inner { padding: 22px 18px 20px; }
  .account-title, .collision-title { font-size: 18px; }
  #account-label { display: none; }
}

/* ============ Account Prompt (既存ゲスト進捗ありユーザーへの案内) ============ */
.account-prompt {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
  display: none; align-items: center; justify-content: center;
  z-index: 11800; padding: 20px;
  backdrop-filter: blur(6px);
  animation: ap-fadein 0.35s ease;
}
.account-prompt.active { display: flex; }
@keyframes ap-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.account-prompt-inner {
  background: linear-gradient(180deg, rgba(45, 32, 80, 0.98), rgba(25, 18, 48, 0.98));
  border: 1px solid rgba(200, 180, 255, 0.4);
  border-radius: 20px; padding: 28px 26px 24px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 60px rgba(200, 125, 255, 0.35);
  animation: ap-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes ap-pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.account-prompt-icon {
  font-size: 42px; margin-bottom: 10px;
  filter: drop-shadow(0 0 20px rgba(200, 125, 255, 0.6));
}
.account-prompt-title {
  font-size: 17px; margin: 0 0 14px; color: #fff;
  line-height: 1.4; letter-spacing: 0.02em;
  font-weight: 600;
}
.account-prompt-text {
  font-size: 15px; color: rgba(255, 255, 255, 0.9);
  margin: 0 0 6px;
}
.account-prompt-sub {
  font-size: 12px; color: rgba(255, 255, 255, 0.55);
  margin: 0 0 20px;
}
.account-prompt-actions {
  display: flex; gap: 8px;
}
.account-prompt-btn {
  flex: 1; padding: 13px 16px;
  font-size: 14px; font-weight: 600;
  border: none; border-radius: 10px;
  cursor: pointer; font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.account-prompt-btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}
.account-prompt-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.55);
}
.account-prompt-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}
.account-prompt-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ───── Update Notification Modal ───── */
.update-modal {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(5, 6, 13, 0.88);
  backdrop-filter: blur(6px);
  z-index: 10000;
  padding: 16px;
}
.update-inner {
  width: min(92vw, 480px);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(165deg, rgba(25, 18, 48, 0.96), rgba(10, 10, 31, 0.98));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.15) inset;
  color: #e8e8ff;
}
.update-badge {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  color: #fff;
  margin-bottom: 10px;
}
.update-title {
  font-size: 18px;
  margin: 0 0 14px;
  color: #fff;
}
.update-version {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  margin-bottom: 16px;
}
.update-version #update-from { color: rgba(255, 255, 255, 0.5); }
.update-arrow { color: rgba(255, 255, 255, 0.4); }
.update-to {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(90deg, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.update-section-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}
.update-notes {
  margin: 0 0 20px;
  padding-left: 1.1em;
  line-height: 1.7;
  font-size: 14px;
}
.update-notes li { margin-bottom: 4px; }
.update-actions {
  display: flex; gap: 10px;
  margin-bottom: 12px;
}
.update-btn {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.update-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}
.update-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
.update-btn.primary {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
.update-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}
.update-history-toggle { text-align: center; }
.update-history-btn {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
}
.update-history-btn:hover { color: #fff; }
.update-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 40vh;
  overflow-y: auto;
}
.update-history-entry { margin-bottom: 14px; }
.update-history-head {
  font-size: 13px;
  font-weight: 600;
  color: rgba(196, 181, 253, 0.95);
  margin-bottom: 4px;
}
.update-history ul {
  margin: 0; padding-left: 1.1em;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}
