/* ================================================================
   Gacha Builder v0.5.0 — Neon Arcade × Showcase Theme
   philosophy: ネオンが灯るゲームセンターの一角に、宝物のショーケース
   based on Claude Design handoff (player-design)
   ============================================================== */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@500;700&family=Cormorant+Garamond:ital,wght@1,400;1,700&display=swap');

/* ----------------------------------------------------------------
   1. TOKENS
   ---------------------------------------------------------------- */
:root {
  /* 夜空 */
  --bg-0: #0a0e1c;
  --bg-1: #0d1830;
  --bg-2: #1a1240;

  /* ライト */
  --cream:    #fbf6e8;
  --cream-d:  rgba(251, 246, 232, 0.7);
  --cream-dd: rgba(251, 246, 232, 0.5);

  /* ネオン4色 */
  --orange:   #e64a19;
  --orange-2: #ff7043;
  --gold:     #ffb74d;
  --cyan:     #00bcd4;
  --pink:     #ff4fa1;

  /* アクセント色（ビルダーで選択した色を JS が上書き、未指定時は orange）
     accent-2 は accent から自動で明色化（color-mix 対応ブラウザ） */
  --accent:   #e64a19;
  --accent-2: color-mix(in srgb, var(--accent) 65%, #ffffff);

  /* レア度 */
  --r-n:  #7d7a72;
  --r-r:  #1976d2;
  --r-sr: #7b1fa2;
  --r-ur: #ffb74d;

  /* 機能色 */
  --danger: #ff5252;
  --focus:  #ffb74d;

  /* 強度 */
  --neon-intensity: 0.7;
  --shelf-bright:   0.4;

  --font-jp:  'M PLUS Rounded 1c', "Hiragino Sans", system-ui, sans-serif;
  --font-num: 'Cormorant Garamond', 'Times New Roman', serif;

  --space-xs:  4px;
  --space-sm:  8px;
  --space:     16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  64px;

  --ease:     cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --radius:    10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ----------------------------------------------------------------
   2. BASE / BACKGROUND
   ---------------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-jp);
  font-weight: 500;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

/* ガチャ系ページの夜空背景を fixed overlay で最下層に敷く（テーマCSSに勝つ） */
/* body にクラスが付くケース（フロントの[gacha_builder]/[gacha_player]ページ） */
body.gacha-builder-page {
  background-color: var(--bg-1) !important;
  color: var(--cream) !important;
  min-height: 100vh;
  position: relative;
}
body.gacha-builder-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(123, 31, 162, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 60% at 80% 90%, rgba(0, 188, 212, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-1) 100%);
  pointer-events: none;
}

/* body にクラスが付かないケース（管理画面、ブロックエディタ、SWELL LPテンプレ等）
   ラッパー div 自体で夜空ブロックを完結させる
   border-radius は付けない: 親テーマ側で角丸コンテナがある場合に外側の白が見えるのを防ぐ */
.gacha-builder-page:not(body):not(html) {
  background-color: var(--bg-1);
  color: var(--cream);
  position: relative;
  isolation: isolate;
  padding: var(--space-md);
  overflow: hidden;
}
.gacha-builder-page:not(body):not(html)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(123, 31, 162, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 60% at 80% 90%, rgba(0, 188, 212, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-1) 100%);
  pointer-events: none;
}
.gacha-builder-page:not(body):not(html) > * {
  position: relative;
  z-index: 1;
}

/* html にもクラスが付くようテンプレで JS 注入してるので、html にも夜空背景を当てる
   → SWELLが body 背景を白にしてても、html 側で夜空にできる */
html.gacha-builder-page,
html.gacha-builder-page body {
  background-color: var(--bg-1) !important;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(123, 31, 162, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 60% at 80% 90%, rgba(0, 188, 212, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-1) 100%) !important;
  background-attachment: fixed !important;
}

/* テーマのコンテンツラッパーが白背景や角丸を当ててる場合の透過化（広範囲セレクタ）
   html.gacha-builder-page を起点にすることで、body にクラスがない SWELL LP でも効く */
html.gacha-builder-page #page,
html.gacha-builder-page #wrapper,
html.gacha-builder-page #content,
html.gacha-builder-page #primary,
html.gacha-builder-page #main,
html.gacha-builder-page main,
html.gacha-builder-page article,
html.gacha-builder-page .site,
html.gacha-builder-page .site-content,
html.gacha-builder-page .site-main,
html.gacha-builder-page .entry,
html.gacha-builder-page .entry-content,
html.gacha-builder-page .post,
html.gacha-builder-page .post-content,
html.gacha-builder-page .single-content,
html.gacha-builder-page .page-content,
html.gacha-builder-page .l-content,
html.gacha-builder-page .l-mainContent,
html.gacha-builder-page .l-mainContent__inner,
html.gacha-builder-page .c-postContent,
html.gacha-builder-page .p-postContent,
html.gacha-builder-page .swl-post-content,
html.gacha-builder-page .container,
html.gacha-builder-page .wrap,
html.gacha-builder-page .content-area,
/* SWELL LP テンプレ専用ラッパー */
html.gacha-builder-page .lp-content,
html.gacha-builder-page .lp-content__inner,
html.gacha-builder-page .lp-content__postContent,
html.gacha-builder-page .post_content {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--cream) !important;
}

/* 見出しの色も白系に（body と div ラッパー両対応） */
body.gacha-builder-page .gb-app h1,
body.gacha-builder-page .gb-app h2,
body.gacha-builder-page .gb-app h3,
body.gacha-builder-page .gp-app h1,
body.gacha-builder-page .gp-app h2,
body.gacha-builder-page .gp-app h3,
.gacha-builder-page .gb-app h1,
.gacha-builder-page .gb-app h2,
.gacha-builder-page .gb-app h3,
.gacha-builder-page .gp-app h1,
.gacha-builder-page .gp-app h2,
.gacha-builder-page .gp-app h3 {
  color: var(--cream) !important;
}

/* ====================================
   SWELLテーマ専用 上書き（詳細度2倍） */
body.gacha-builder-page.swell.swell .l-content,
body.gacha-builder-page.swell.swell .l-mainContent,
body.gacha-builder-page.swell.swell .l-mainContent__inner,
body.gacha-builder-page.swell.swell .l-content__inner,
body.gacha-builder-page.swell.swell .c-postContent,
body.gacha-builder-page.swell.swell .p-postContent,
body.gacha-builder-page.swell.swell .swl-post-content,
body.gacha-builder-page.swell.swell .p-articleThumb,
body.gacha-builder-page.swell.swell article,
body.gacha-builder-page.swell.swell .post_content {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border: none !important;
}
body.gacha-builder-page.swell.swell {
  background: transparent !important;
}
/* SWELL の固定ページタイトル・パンくずも非表示にしたいなら（ラケ判断） */
/* body.gacha-builder-page.swell .p-pageTitle,
   body.gacha-builder-page.swell .p-breadcrumb { display: none; } */

/* ====================================
   SWELL本文用 h2 / h3 の装飾打ち消し
   `.post_content h2 { border-top/border-bottom; padding: 1em .75em; }` を完全無効化 */
html.gacha-builder-page .post_content h1,
html.gacha-builder-page .post_content h2,
html.gacha-builder-page .post_content h3,
html.gacha-builder-page .post_content h4,
html.gacha-builder-page .post_content h5,
html.gacha-builder-page .post_content h6 {
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
  margin: 0 !important;
}
html.gacha-builder-page .post_content h2::before,
html.gacha-builder-page .post_content h2::after,
html.gacha-builder-page .post_content h3::before,
html.gacha-builder-page .post_content h3::after {
  content: none !important;
  display: none !important;
}

/* ====================================
   余計な余白の打ち消し（SWELL/LP のコンテンツラッパー）
   margin は 0 auto にして中央寄せを維持（左右だけ auto で SWELLの max-width 中央配置を残す） */
html.gacha-builder-page .l-content,
html.gacha-builder-page .lp-content,
html.gacha-builder-page .lp-content__inner,
html.gacha-builder-page .lp-content__postContent,
html.gacha-builder-page .post_content,
html.gacha-builder-page #lp-content,
html.gacha-builder-page #body_wrap {
  padding: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* prefers-reduced-motion（光過敏性発作対策） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-curtain, .anim-bg-aura, .anim-beams,
  .anim-particle, .anim-ripple, .anim-aura,
  .anim-shimmer, .marquee-bulb, .cta-pulse-glow {
    display: none !important;
  }
  .gp-pull-btn, .gb-build-btn { animation: none !important; }
}

/* キーボードフォーカス */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ================================================================
   3. ARCADE MARQUEE（アーケード看板ヘッダー、共通）
   ============================================================== */
.arcade-marquee {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 36px 22px;
  margin: 0 auto var(--space-lg);
  max-width: 720px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 183, 77, 0.08) 0%, transparent 100%);
  border-top: 2px solid rgba(255, 183, 77, 0.55);
  border-bottom: 2px solid rgba(255, 183, 77, 0.25);
  box-shadow:
    inset 0 14px 28px -14px rgba(255, 183, 77, 0.35),
    0 0 60px rgba(255, 183, 77, calc(0.18 * var(--neon-intensity)));
}
.arcade-marquee::before, .arcade-marquee::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  background-image: radial-gradient(circle, var(--gold) 1.5px, transparent 2px);
  background-size: 14px 2px;
  background-repeat: repeat-x;
  opacity: 0.5;
}
.arcade-marquee::before { top: -1px; }
.arcade-marquee::after  { bottom: -1px; }

.marquee-bulb {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold);
  box-shadow:
    inset 0 0 4px rgba(255, 255, 255, 0.8),
    0 0 12px var(--gold),
    0 0 24px rgba(255, 183, 77, 0.8);
  animation: bulb-blink 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
.marquee-bulb:nth-of-type(2) {
  background: var(--pink);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.8), 0 0 12px var(--pink), 0 0 24px rgba(255, 79, 161, 0.8);
  animation-delay: 0.3s;
}
.marquee-bulb:nth-of-type(3) {
  background: var(--cyan);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.8), 0 0 12px var(--cyan), 0 0 24px rgba(0, 188, 212, 0.8);
  animation-delay: 0.6s;
}
.marquee-bulb.right-1 {
  background: var(--cyan);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.8), 0 0 12px var(--cyan), 0 0 24px rgba(0, 188, 212, 0.8);
  animation-delay: 0.9s;
}
.marquee-bulb.right-2 {
  background: var(--pink);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.8), 0 0 12px var(--pink), 0 0 24px rgba(255, 79, 161, 0.8);
  animation-delay: 1.2s;
}
@keyframes bulb-blink {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.marquee-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cream);
  text-shadow:
    0 0 calc(16px * var(--neon-intensity)) rgba(255, 183, 77, 0.9),
    0 0 calc(36px * var(--neon-intensity)) rgba(230, 74, 25, 0.55);
  white-space: nowrap;
}

/* ================================================================
   4. BUILDER
   ============================================================== */
.gb-app {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space) var(--space-xl);
  color: var(--cream);
  font-family: var(--font-jp);
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  font-feature-settings: "palt";
}

.gb-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.gb-title {
  /* arcade marquee 内で使う想定。単独使用時のフォールバック */
  font-weight: 700;
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-sm);
  color: var(--cream);
}
.gb-subtitle {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.16em;
  margin: 0;
}

.gb-step {
  margin-bottom: var(--space-lg);
  background: rgba(251, 246, 232, 0.04);
  border: 1px solid rgba(255, 183, 77, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gb-step-head {
  display: flex;
  align-items: baseline;
  gap: var(--space);
  margin-bottom: var(--space);
}
.gb-step-label {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  flex-shrink: 0;
  text-shadow: 0 0 8px rgba(255, 183, 77, 0.5);
}
.gb-step-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  color: var(--cream);
}
.gb-hint {
  font-size: 14px;
  color: var(--cream-d);
  margin: 0 0 var(--space) 0;
  line-height: 1.7;
}

/* STEP 1: style cards */
.gb-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}
.gb-style-card {
  position: relative;
  display: block;
  padding: var(--space-md) var(--space-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid rgba(255, 183, 77, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s var(--ease);
}
.gb-style-card:hover {
  border-color: var(--gold);
  background: rgba(255, 183, 77, 0.08);
}
.gb-style-card input { position: absolute; opacity: 0; pointer-events: none; }
.gb-style-card:has(input:checked) {
  background: linear-gradient(180deg, rgba(255, 183, 77, 0.18), rgba(230, 74, 25, 0.12));
  border-color: var(--gold);
  box-shadow:
    0 0 24px rgba(255, 183, 77, calc(0.4 * var(--neon-intensity))),
    inset 0 0 20px rgba(255, 183, 77, 0.08);
}
.gb-style-card:has(input:checked) .gb-style-icon svg * {
  stroke: var(--gold);
}
.gb-style-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
}
.gb-style-icon svg {
  width: 100%; height: 100%; display: block;
  stroke: rgba(251, 246, 232, 0.7);
}
.gb-style-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--cream);
  margin-bottom: 2px;
  letter-spacing: 0.06em;
}
.gb-style-desc {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.06em;
}

/* STEP 2: character grid */
.gb-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: var(--space-sm);
}
.gb-char-card {
  position: relative;
  padding: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 183, 77, 0.18);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s var(--ease);
  overflow: hidden;
}
.gb-char-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.gb-char-card.is-on {
  border-color: var(--gold);
  background: rgba(255, 183, 77, 0.08);
  box-shadow: 0 0 16px rgba(255, 183, 77, 0.3);
}
.gb-char-card.is-on::after {
  content: "";
  position: absolute;
  top: 5px; right: 6px;
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 8px var(--gold);
}
.gb-char-card.is-on::before {
  content: "";
  position: absolute;
  top: 8px; right: 9.5px;
  width: 4px; height: 7px;
  border-right: 2px solid var(--bg-1);
  border-bottom: 2px solid var(--bg-1);
  transform: rotate(45deg);
  z-index: 4;
}
.gb-char-card.is-off {
  opacity: 0.32;
  filter: saturate(0.3);
}
.gb-char-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  background: rgba(251, 246, 232, 0.92);
  border-radius: 6px;
  padding: 4px;
}
.gb-char-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 6px;
  color: var(--cream);
}
.gb-char-rarity {
  display: inline-block;
  font-family: var(--font-num);
  font-style: italic;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 1px 8px;
  border-radius: 999px;
  margin-top: 3px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 6px currentColor;
}
.rarity-N   { color: var(--r-n); }
.rarity-R   { color: var(--r-r); }
.rarity-SR  { color: var(--r-sr); }
.rarity-UR  {
  color: var(--gold);
  border-image: conic-gradient(from 0deg, var(--pink), var(--gold), var(--cyan), var(--r-sr), var(--pink)) 1;
}

/* キャラカードの編集ボタン（v0.6.0以降） / 旧アップロード（v0.5以前互換） */
.gb-char-card .gb-char-edit,
.gb-char-card .gb-char-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 6px;
  background: rgba(255, 183, 77, 0.08);
  color: var(--gold);
  border: 1.5px dashed rgba(255, 183, 77, 0.4);
  border-radius: 8px;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  line-height: 1.2;
  min-height: 36px;
}
.gb-char-card .gb-char-edit svg,
.gb-char-card .gb-char-upload svg {
  flex-shrink: 0; stroke-width: 2.2;
}
.gb-char-card .gb-char-edit:hover,
.gb-char-card .gb-char-edit:focus-visible,
.gb-char-card .gb-char-upload:hover,
.gb-char-card .gb-char-upload:focus-visible {
  background: var(--gold);
  color: var(--bg-1);
  border-color: var(--gold);
  border-style: solid;
  box-shadow: 0 0 16px rgba(255, 183, 77, 0.6);
}
.gb-char-card.is-custom img {
  box-shadow: 0 0 0 2px var(--gold);
}
.gb-char-card.is-custom .gb-char-edit,
.gb-char-card.is-custom .gb-char-upload {
  background: var(--gold);
  color: var(--bg-1);
  border-style: solid;
}

/* 追加分（is-added）には水色アクセント */
.gb-char-card.is-added img {
  box-shadow: 0 0 0 2px var(--cyan);
}
.gb-char-added-badge {
  position: absolute;
  top: 3px; left: 3px;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  color: var(--bg-1);
  font-family: var(--font-jp);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.2;
  z-index: 2;
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.6);
}

/* 追加スロット「キャラをつくる」 */
.gb-char-add-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  min-height: 100%;
  background: rgba(0, 188, 212, 0.06);
  border: 2px dashed rgba(0, 188, 212, 0.45);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-jp);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.gb-char-add-slot:hover,
.gb-char-add-slot:focus-visible {
  background: rgba(0, 188, 212, 0.16);
  border-color: var(--cyan);
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(0, 188, 212, 0.4);
}
.gb-char-add-slot .gb-add-icon {
  font-size: 36px;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 188, 212, 0.6);
}
.gb-char-add-slot .gb-add-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.gb-char-custom-badge {
  position: absolute;
  top: 3px; left: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--cream);
  font-family: var(--font-num);
  font-style: italic;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.2;
  z-index: 2;
  box-shadow: 0 0 12px rgba(230, 74, 25, 0.6);
}

.gb-custom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space);
  padding-top: var(--space);
  border-top: 1px dashed rgba(255, 183, 77, 0.18);
  flex-wrap: wrap;
}
.gb-custom-note {
  font-size: 12px;
  color: var(--cream-d);
}
.gb-btn-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 10px 18px;
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s var(--ease);
}
.gb-btn-ghost:hover { background: var(--danger); color: var(--cream); }

/* STEP 3: color */
.gb-color-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space);
}
.gb-color-row input[type=color] {
  width: 48px; height: 48px;
  border: 1px solid rgba(255, 183, 77, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0; background: none;
}
.gb-color-row input[type=text] {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 183, 77, 0.3);
  border-radius: var(--radius);
  width: 130px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--cream);
}
.gb-color-row input[type=text]:focus {
  outline: none; border-color: var(--gold);
}
.gb-color-preview {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  border: 1px solid rgba(255, 183, 77, 0.3);
  box-shadow: 0 0 12px currentColor;
}
.gb-color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.gb-color-presets button {
  font-family: var(--font-jp);
  font-size: 13px; font-weight: 700;
  padding: 10px 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  min-height: 44px;
  transition: transform 0.15s var(--ease);
}
.gb-color-presets button[data-color="#ffc107"] { color: var(--bg-1); }
.gb-color-presets button[data-color="#7ac943"] { color: var(--bg-1); }
.gb-color-presets button:hover { transform: translateY(-1px); }
.gb-color-presets button.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--gold);
}

/* STEP 4: title */
.gb-title-input {
  width: 100%;
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: var(--space) var(--space-md);
  border: 2px solid rgba(255, 183, 77, 0.3);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  color: var(--cream);
  transition: border-color 0.2s var(--ease);
  box-sizing: border-box;
}
.gb-title-input:focus { outline: none; border-color: var(--gold); }

/* finalize */
.gb-finalize {
  text-align: center;
  margin-top: var(--space-md);
}
.gb-build-btn {
  position: relative;
  font-family: var(--font-jp);
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  color: var(--cream);
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.16em;
  padding: 20px 56px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s var(--ease);
  box-shadow:
    0 0 calc(40px * var(--neon-intensity)) rgba(230, 74, 25, 0.7),
    0 8px 24px rgba(230, 74, 25, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 0 12px rgba(255, 183, 77, 0.8);
}
.gb-build-btn:hover { transform: translateY(-2px); }
.gb-build-btn:active { transform: translateY(2px); }
.gb-build-btn:disabled {
  background: rgba(125, 122, 114, 0.3);
  color: var(--cream-dd);
  border-color: rgba(125, 122, 114, 0.4);
  cursor: not-allowed;
  box-shadow: none;
  text-shadow: none;
}

.gb-result-box {
  background: rgba(251, 246, 232, 0.04);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  text-align: center;
  animation: fadeUp 0.5s var(--ease-out);
  box-shadow: 0 0 40px rgba(255, 183, 77, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gb-result-label {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 var(--space);
  letter-spacing: 0.1em;
  text-shadow: 0 0 12px rgba(255, 183, 77, 0.6);
}
.gb-result-desc {
  font-size: 13px;
  color: var(--cream-d);
  margin: 0 0 var(--space-md);
}
.gb-play-btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--cream);
  padding: 18px 48px;
  font-family: var(--font-jp);
  font-weight: 700;
  text-decoration: none;
  font-size: 17px;
  letter-spacing: 0.16em;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  min-height: 44px;
  box-shadow:
    0 0 32px rgba(230, 74, 25, 0.7),
    0 4px 12px rgba(230, 74, 25, 0.4);
  transition: all 0.2s var(--ease);
}
.gb-play-btn:hover { transform: translateY(-1px); }

/* ================================================================
   5. PLAYER
   ============================================================== */
.gp-app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space) var(--space-lg);
  color: var(--cream);
  font-family: var(--font-jp);
  letter-spacing: 0.04em;
  font-feature-settings: "palt";
}
.gp-header {
  margin-bottom: var(--space-md);
}
.gp-nav {
  display: flex;
  padding: 4px; gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  position: relative;
  z-index: 3;
  margin: 0 auto;
  max-width: 320px;
}
.gp-nav button {
  flex: 1;
  background: transparent;
  border: 0;
  color: rgba(251, 246, 232, 0.5);
  padding: 12px 16px;
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  letter-spacing: 0.06em;
  transition: color 0.2s, background 0.2s;
}
.gp-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.gp-nav button.is-active {
  background: linear-gradient(180deg, #fff7e1 0%, var(--gold) 100%);
  color: #2a1100;
  box-shadow: 0 0 calc(20px * var(--neon-intensity)) rgba(255, 183, 77, 0.6);
}

.gp-stage {
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%,
      rgba(255, 183, 77, calc(0.18 * var(--neon-intensity))),
      rgba(255, 79, 161, calc(0.06 * var(--neon-intensity))) 40%,
      transparent 70%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(255, 183, 77, 0.25);
  padding: var(--space-lg) var(--space);
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 60px rgba(255, 183, 77, calc(0.15 * var(--neon-intensity))),
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* IDLE — ガチャ装置とCTA */
.gp-idle {
  text-align: center;
  position: relative;
  z-index: 1;
}
.gp-machine {
  display: flex;
  justify-content: center;
  margin: var(--space-md) 0 var(--space-lg);
  position: relative;
}
.gp-machine::before {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 24px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.6), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.gp-machine svg,
.gp-machine img {
  width: 240px;
  height: auto;
  filter: drop-shadow(0 0 calc(28px * var(--neon-intensity)) rgba(255, 183, 77, 0.6));
  animation: device-bob 4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
.gp-machine img {
  border-radius: 18px;
  box-shadow:
    0 0 calc(40px * var(--neon-intensity)) rgba(255, 183, 77, 0.45),
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1.5px rgba(255, 183, 77, 0.4);
  display: block;
  max-width: 100%;
  background: rgba(0, 0, 0, 0.4);
}
.gp-machine-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 320px; height: 320px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255, 183, 77, calc(0.4 * var(--neon-intensity))) 0%,
    rgba(123, 31, 162, calc(0.2 * var(--neon-intensity))) 40%,
    transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
  animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.95); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.05); }
}
@keyframes device-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.gp-pull-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-jp);
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  color: var(--cream);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 22px 56px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  min-height: 64px;
  transition: all 0.15s var(--ease);
  box-shadow:
    0 0 calc(40px * var(--neon-intensity)) rgba(230, 74, 25, 0.8),
    0 8px 24px rgba(230, 74, 25, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  text-shadow: 0 0 12px rgba(255, 183, 77, 0.8);
  overflow: hidden;
}
.gp-pull-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  pointer-events: none;
  animation: cta-pulse 2.4s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
.gp-pull-btn:hover { transform: translateY(-2px); }
.gp-pull-btn:active { transform: translateY(2px); }
.gp-pull-btn:disabled,
.gp-pull-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
  transform: none !important;
  animation: none !important;
}
.gp-pull-btn:disabled::before,
.gp-pull-btn[disabled]::before { animation: none !important; opacity: 0.2 !important; }

/* ====================================
   ジェム表示（プレイヤー） */
.gp-gem {
  margin: 0 auto var(--space-md);
  max-width: 360px;
  padding: 10px 14px;
  background: rgba(13, 24, 48, 0.6);
  border: 1px solid rgba(251, 246, 232, 0.18);
  border-radius: 14px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.gp-gem-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gp-gem-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px var(--accent));
}
.gp-gem-icon svg { width: 100%; height: 100%; }
.gp-gem-text {
  flex: 1;
  font-family: var(--font-num);
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--cream);
}
.gp-gem-text #gpGemNow {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.gp-gem-sep { margin: 0 4px; color: var(--cream-dd); }
.gp-gem-reset {
  background: transparent;
  border: 1px solid rgba(251, 246, 232, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--cream-d);
  font-family: var(--font-jp);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.gp-gem-reset:hover,
.gp-gem-reset:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gp-gem-bar {
  margin-top: 8px;
  height: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  overflow: hidden;
}
.gp-gem-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 0.35s var(--ease-out);
  box-shadow: 0 0 8px var(--accent);
}
.gp-gem.is-empty .gp-gem-bar-fill {
  background: linear-gradient(90deg, #555, #777);
  box-shadow: none;
}
.gp-gem.is-empty .gp-gem-text #gpGemNow { color: var(--cream-dd); }
.gp-gem.is-empty .gp-gem-icon { color: var(--cream-dd); filter: none; }

.gp-empty-msg {
  margin: var(--space-sm) auto 0;
  max-width: 360px;
  text-align: center;
  font-size: 13px;
  color: var(--cream-d);
  letter-spacing: 0.04em;
}

/* ====================================
   ジェム入力（ビルダー STEP 5） */
.gb-gem-row {
  display: flex;
  gap: var(--space);
  margin-top: var(--space-sm);
}
.gb-gem-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gb-gem-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--cream-d);
  letter-spacing: 0.04em;
}
.gb-gem-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(13, 24, 48, 0.6);
  border: 1px solid rgba(251, 246, 232, 0.25);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--font-num);
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.06em;
  transition: border-color 0.15s var(--ease);
}
.gb-gem-input:focus {
  outline: none;
  border-color: var(--accent);
}
.gb-gem-preview {
  margin: var(--space-sm) 0 0;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-left: 0;
  border-radius: 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-block;
}
@media (max-width: 599px) {
  .gb-gem-row { flex-direction: column; gap: var(--space-sm); }
  .gp-gem-text { font-size: 16px; }
  .gp-gem-text #gpGemNow { font-size: 20px; }
}

.gp-counter {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--cream-dd);
  margin-top: var(--space-md);
}
.gp-counter span { color: var(--gold); font-weight: 700; }

/* anim canvas */
.gp-anim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(123, 31, 162, 0.5), transparent 70%),
    linear-gradient(180deg, #050818 0%, var(--bg-0) 50%, #14082a 100%);
  z-index: 2;
}
.gp-anim-stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* RESULT — Showcase frame */
.gp-result {
  text-align: center;
  padding: var(--space-lg) var(--space) var(--space-md);
  position: relative;
  z-index: 1;
  animation: resultIn 0.6s var(--ease-out);
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* NEW! バッジ — 額縁の左上に被せる */
.gp-new-badge {
  display: none;
  position: absolute;
  top: 70px;
  left: calc(50% - 130px);
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--cream);
  border-radius: 6px;
  font-family: var(--font-num);
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 18px rgba(255, 183, 77, 0.7), 0 4px 12px rgba(0,0,0,0.4);
  z-index: 5;
  transform: rotate(-8deg);
  animation: newBadgeIn 0.5s 0.3s var(--ease-out) both;
}
.gp-result.is-new .gp-new-badge { display: inline-block; }
@keyframes newBadgeIn {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(-10deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 1; }
}

/* レア度バッジ（結果画面、キャラより上に） */
.gp-result-rarity {
  display: block;
  width: fit-content;
  margin: 0 auto var(--space);
  padding: 6px 20px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  border: 1.5px solid currentColor;
  font-family: var(--font-num);
  font-style: italic;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-shadow: 0 0 8px currentColor;
  box-shadow: 0 0 calc(20px * var(--neon-intensity)) currentColor;
  text-align: center;
  /* 字間が右に偏るので相殺 */
  padding-right: 14px;
}
.gp-result-rarity.rarity-N  { color: var(--r-n); }
.gp-result-rarity.rarity-R  { color: var(--r-r); }
.gp-result-rarity.rarity-SR { color: var(--r-sr); }
.gp-result-rarity.rarity-UR {
  color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 183, 77, 0.2), rgba(0, 0, 0, 0.4));
  border-color: var(--gold);
  animation: ur-rarity-pulse 1.6s ease-in-out infinite;
}
@keyframes ur-rarity-pulse {
  0%, 100% { box-shadow: 0 0 16px var(--gold); }
  50%      { box-shadow: 0 0 32px var(--gold), 0 0 48px var(--accent); }
}

/* Showcase: 全体ラッパー（オーラ + フレーム + 床光） */
.gp-result-char {
  position: relative;
  display: inline-block;
  margin: 0 auto var(--space-md);
  width: 240px;
  padding: 30px 0 50px; /* 上下にオーラ・床光のスペース */
}
.gp-result.rarity-N  { --showcase-color: var(--r-n); }
.gp-result.rarity-R  { --showcase-color: var(--r-r); }
.gp-result.rarity-SR { --showcase-color: var(--r-sr); }
.gp-result.rarity-UR { --showcase-color: var(--gold); }

/* showcase の周辺アウラ */
.gp-result-char::before {
  content: "";
  position: absolute;
  inset: -10px;
  background: radial-gradient(ellipse 60% 50% at 50% 65%, var(--showcase-color, var(--gold)), transparent 70%);
  opacity: 0.45;
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}
/* 床のスポット光（額縁の下） */
.gp-result-char::after {
  content: "";
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 24px;
  background: radial-gradient(ellipse 50% 100% at 50% 0%, var(--showcase-color, var(--gold)), transparent 70%);
  opacity: 0.7;
  filter: blur(4px);
  pointer-events: none;
  z-index: 0;
}

/* showcase frame: ガラスケース風 */
.gp-result-char .showcase-frame {
  position: relative;
  width: 200px;
  height: 240px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(251, 246, 232, 0.03) 0%, rgba(0, 0, 0, 0.15) 100%);
  border-radius: 14px 14px 6px 6px;
  border: 1px solid rgba(255, 183, 77, 0.45);
  border-top: 2.5px solid var(--showcase-color, var(--gold));
  box-shadow:
    inset 0 0 40px rgba(255, 183, 77, 0.08),
    0 0 calc(36px * var(--neon-intensity)) var(--showcase-color, var(--gold)),
    0 8px 16px rgba(0, 0, 0, 0.4);
  z-index: 1;
}
/* 左右の柱（ガラスケースの縦エッジ光） */
.gp-result-char .showcase-frame::before,
.gp-result-char .showcase-frame::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--showcase-color, var(--gold)), transparent 85%);
  opacity: 0.6;
  filter: blur(0.5px);
}
.gp-result-char .showcase-frame::before { left: 10px; }
.gp-result-char .showcase-frame::after  { right: 10px; }

/* キャラ画像 */
.gp-result-char img {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  width: 150px; height: 150px;
  object-fit: contain;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 4px 8px rgba(0,0,0,0.6))
    drop-shadow(0 0 18px var(--showcase-color, var(--gold)));
  z-index: 3;
}
.gp-result.rarity-UR .gp-result-char img {
  animation: char-float 3s ease-in-out infinite;
}
@keyframes char-float {
  0%, 100% { transform: translate(-50%, -52%); }
  50%      { transform: translate(-50%, -60%); }
}

/* 床のプレート（ステージ） */
.gp-result-char .showcase-frame::backdrop { content: ""; }

.gp-result-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 var(--space-lg);
  color: var(--cream);
  text-shadow: 0 0 calc(16px * var(--neon-intensity)) var(--showcase-color, var(--gold));
}

.gp-again-btn {
  font-family: var(--font-jp);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--cream);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px 36px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  box-shadow:
    0 0 24px rgba(230, 74, 25, 0.6),
    0 4px 12px rgba(230, 74, 25, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.15s var(--ease);
}
.gp-again-btn:hover { transform: translateY(-1px); }
.gp-again-btn:active { transform: translateY(2px); }

.gp-footer {
  text-align: center;
  margin-top: var(--space-md);
}
.gp-footer a {
  font-family: var(--font-num);
  font-style: italic;
  color: var(--cream-dd);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.16em;
}
.gp-footer a:hover { color: var(--gold); }

/* ================================================================
   6. COLLECTION — 展示棚
   ============================================================== */
.gp-collection {
  position: relative;
  z-index: 1;
  padding: var(--space-md) var(--space-sm);
  animation: resultIn 0.5s var(--ease-out);
}
.gp-col-head {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.gp-col-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cream);
  margin: 0 0 var(--space-sm);
  text-shadow: 0 0 12px rgba(255, 183, 77, 0.4);
}
.gp-col-progress {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(255, 183, 77, 0.6);
}
.gp-col-progress .max {
  font-size: 18px;
  color: var(--cream-dd);
}
.gp-col-bar {
  width: 80%;
  max-width: 320px;
  height: 8px;
  margin: var(--space-sm) auto 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.gp-col-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 35%, var(--cyan) 70%, var(--pink) 100%);
  border-radius: 999px;
  transition: width 0.5s var(--ease-out);
  box-shadow: 0 0 12px rgba(255, 183, 77, 0.6);
  position: relative;
}
.gp-col-bar-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: bar-shine 2.4s linear infinite;
}
@keyframes bar-shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.gp-col-complete {
  display: block;
  margin: var(--space) auto;
  padding: 10px 20px;
  background: conic-gradient(from 0deg, var(--pink), var(--gold), var(--cyan), var(--r-sr), var(--pink));
  background-size: 200% 200%;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 14px;
  color: var(--bg-1);
  animation: bg-spin 6s linear infinite;
  text-align: center;
  width: fit-content;
}
@keyframes bg-spin {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}

/* shelves */
.gp-col-group {
  position: relative;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-lg);
  padding: var(--space) var(--space-sm);
  overflow: hidden;
}
.gp-col-group::before {
  /* shelf back */
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(251, 246, 232, calc(0.06 + 0.12 * var(--shelf-bright)))  0%,
      rgba(251, 246, 232, calc(0.02 + 0.06 * var(--shelf-bright))) 60%,
      transparent 100%);
  z-index: 0;
}
.gp-col-group::after {
  /* light bar (top) */
  content: "";
  position: absolute;
  top: 4px; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  filter: blur(1px);
  opacity: 0.8;
  z-index: 0;
}
/* レア度別の枠と色 */
.gp-col-group:has(.gp-col-group-rarity.rarity-UR) {
  border: 1.5px solid rgba(255, 183, 77, 0.5);
  background: rgba(255, 183, 77, 0.05);
  box-shadow: 0 0 24px rgba(255, 183, 77, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.gp-col-group:has(.gp-col-group-rarity.rarity-UR)::after {
  background: conic-gradient(from 0deg, var(--pink), var(--gold), var(--cyan), var(--r-sr), var(--pink));
  height: 3px; opacity: 1; filter: blur(0.5px);
}
.gp-col-group:has(.gp-col-group-rarity.rarity-SR) {
  border: 1px solid rgba(123, 31, 162, 0.5);
  background: rgba(123, 31, 162, 0.06);
  box-shadow: inset 0 0 30px rgba(123, 31, 162, 0.15), 0 0 12px rgba(123, 31, 162, 0.25);
}
.gp-col-group:has(.gp-col-group-rarity.rarity-R) {
  border: 1px solid rgba(25, 118, 210, 0.4);
  background: rgba(25, 118, 210, 0.04);
  box-shadow: inset 0 0 30px rgba(25, 118, 210, 0.12);
}
.gp-col-group:has(.gp-col-group-rarity.rarity-N) {
  border: 1px solid rgba(125, 122, 114, 0.35);
  background: rgba(125, 122, 114, 0.04);
}

.gp-col-group-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space);
  padding: 0 4px;
  z-index: 1;
}
.gp-col-group-rarity {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 22px;
  font-weight: 700;
  color: currentColor;
  letter-spacing: 0.04em;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.gp-col-group-rarity.rarity-N  { color: var(--r-n); text-shadow: 0 0 8px var(--r-n); }
.gp-col-group-rarity.rarity-R  { color: var(--r-r); text-shadow: 0 0 8px var(--r-r); }
.gp-col-group-rarity.rarity-SR { color: var(--r-sr); text-shadow: 0 0 12px var(--r-sr); }
.gp-col-group-rarity.rarity-UR { color: var(--gold); text-shadow: 0 0 12px var(--gold); }

.gp-col-group-count {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 13px;
  color: var(--cream-d);
  letter-spacing: 0.04em;
  margin-left: auto;
}

/* slot grid */
.gp-col-grid {
  position: relative;
  z-index: 1;
  display: grid;
  /* 全レアリティ共通の同サイズグリッド */
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.gp-col-cell {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 183, 77, 0.18);
  border-radius: 8px;
  padding: 8px 6px 6px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.15s var(--ease);
  /* button化に対応: 既定スタイルをリセット */
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  display: block;
  appearance: none;
  -webkit-appearance: none;
}
.gp-col-cell:not(.is-empty):hover,
.gp-col-cell:not(.is-empty):focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent);
}
.gp-col-cell.is-empty {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(125, 122, 114, 0.25);
  cursor: default;
}
.gp-col-cell::after {
  /* spotlight */
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: 80%; height: 60%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 70% 100% at 50% 100%, var(--cell-color, var(--gold)), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 0;
}
.gp-col-cell:not(.is-empty)::after { opacity: 0.35; }
.gp-col-cell img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  background: rgba(251, 246, 232, 0.92);
  border-radius: 6px;
  padding: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
/* 未取得: "?" マーク */
.gp-col-cell-hidden {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 6px;
  font-family: var(--font-num);
  font-style: italic;
  font-weight: 700;
  font-size: 36px;
  color: rgba(251, 246, 232, 0.35);
  letter-spacing: 0;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}
.gp-col-cell-name {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: 0.04em;
  color: var(--cream);
  /* セル幅オーバーフロー防止 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gp-col-cell.is-empty .gp-col-cell-name {
  color: rgba(125, 122, 114, 0.6);
  font-family: var(--font-num);
  font-style: italic;
  letter-spacing: 0.2em;
}
.gp-col-cell-count {
  position: absolute;
  top: 4px; right: 6px;
  font-family: var(--font-num);
  font-style: italic;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.2;
  z-index: 2;
}
/* レア度別 cell color（spotlight色とborder色だけ。サイズは共通） */
.gp-col-group:has(.gp-col-group-rarity.rarity-UR) .gp-col-cell { --cell-color: var(--gold); border-color: rgba(255, 183, 77, 0.55); }
.gp-col-group:has(.gp-col-group-rarity.rarity-SR) .gp-col-cell { --cell-color: var(--r-sr); border-color: rgba(123, 31, 162, 0.5); }
.gp-col-group:has(.gp-col-group-rarity.rarity-R)  .gp-col-cell { --cell-color: var(--r-r); border-color: rgba(25, 118, 210, 0.4); }
.gp-col-group:has(.gp-col-group-rarity.rarity-N)  .gp-col-cell { --cell-color: var(--r-n); }

/* ====================================
   ジェム回収ミニゲーム */
.gp-gem-game-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 14, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.2s var(--ease-out);
}
.gp-gem-game {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: var(--space-md) var(--space) var(--space);
  background: linear-gradient(180deg, rgba(26, 18, 64, 0.85), rgba(13, 24, 48, 0.85));
  border: 1px solid rgba(251, 246, 232, 0.15);
  border-radius: 18px;
  text-align: center;
  color: var(--cream);
  animation: cardPop 0.35s var(--ease-out);
}
.gp-gem-game-title {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent);
}
.gp-gem-game-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 var(--space-sm);
  padding: 0 var(--space-sm);
}
.gp-gem-game-timer {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 28px;
  font-weight: 700;
  color: var(--cream);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}
.gp-gem-game-counter {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent);
}
.gp-gem-game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 280px;
  margin: 0 auto var(--space);
  background: transparent;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.gp-gem-game-scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* スタイル別アニメは下で */
  transition: transform 0.06s ease-out;
}

/* タップ時の振動（共通: 強制リフロー後 trigger） */
@keyframes bump-rotate {
  0%, 100% { transform: rotate(0); }
  30%      { transform: rotate(-4deg); }
  70%      { transform: rotate(4deg); }
}
@keyframes bump-tremor {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(-3px, 1px); }
  40%      { transform: translate(2px, -2px); }
  60%      { transform: translate(-2px, 2px); }
  80%      { transform: translate(3px, -1px); }
}
@keyframes bump-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.gp-gem-game-stage.is-style-capsule.is-bumping .gp-gem-game-scene { animation: bump-rotate 0.18s ease-out; }
.gp-gem-game-stage.is-style-egg.is-bumping     .gp-gem-game-scene { animation: bump-tremor 0.16s ease-out; }
.gp-gem-game-stage.is-style-summon.is-bumping  .gp-gem-game-scene { animation: bump-pulse  0.18s ease-out; }

/* たまご & しょうかん：徐々に光るオーバーレイ
   進捗 (--progress) に応じて opacity が上がる
   しょうかんはさらに回転する */
.gp-light-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 60%);
  opacity: calc(var(--progress, 0) * 0.75);
  mix-blend-mode: screen;
  transition: opacity 0.15s var(--ease-out);
  z-index: 2;
}
.gp-gem-game-stage.is-style-summon .gp-light-overlay {
  animation: spin-light 4s linear infinite;
}
@keyframes spin-light {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

.gp-gem-game-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto var(--space);
  max-width: 280px;
}
.gp-gem-game-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  box-shadow: 0 0 8px var(--accent);
  transition: width 0.1s var(--ease-out);
}
.gp-gem-game-skip,
.gp-gem-game-close {
  display: inline-block;
  padding: 8px 20px;
  background: transparent;
  color: var(--cream-d);
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(251, 246, 232, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.gp-gem-game-skip:hover,
.gp-gem-game-skip:focus-visible,
.gp-gem-game-close:hover,
.gp-gem-game-close:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  outline: none;
}
.gp-gem-game-close {
  margin-top: var(--space);
  padding: 12px 28px;
  font-size: 15px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gp-gem-game-result {
  margin: var(--space) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gp-gem-game-result-label {
  font-size: 13px;
  color: var(--cream-d);
  letter-spacing: 0.08em;
}
.gp-gem-game-result-num {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 16px var(--accent);
  line-height: 1;
}

/* 開始カウントダウン（3 → 2 → 1 → スタート!）
   背景に乗ってもハッキリ読めるよう、白文字＋アクセント色のリング状シャドウ＋輪郭線 */
.gp-gem-game-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: var(--font-num);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(64px, 22vw, 180px);
  color: #fff;
  -webkit-text-stroke: 3px var(--accent);
  text-shadow:
    0 0 0 var(--accent),
    0 0 16px var(--accent),
    0 0 32px var(--accent),
    0 0 60px rgba(0, 0, 0, 0.95),
    0 6px 14px rgba(0, 0, 0, 0.85);
  z-index: 1010;
  letter-spacing: 0;
  filter: drop-shadow(0 0 8px var(--accent));
}
.gp-gem-game-countdown.is-pop {
  animation: cdPop 0.7s var(--ease-out) forwards;
}
@keyframes cdPop {
  0%   { opacity: 0; transform: scale(0.4); }
  20%  { opacity: 1; transform: scale(1.15); }
  60%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3); }
}
/* 「スタート！」は文字数多いので一回り小さく */
.gp-gem-game-countdown:not(:empty) {
  font-size: clamp(64px, 22vw, 180px);
}
.gp-gem-game-countdown[data-len="long"] {
  font-size: clamp(40px, 14vw, 110px);
  -webkit-text-stroke-width: 2px;
}

/* 結果画面の入力ロック中（とじるボタンと背景クリックを2秒抑制） */
.gp-gem-game-overlay.is-result-locked {
  cursor: wait;
}
.gp-gem-game-close.is-locked,
.gp-gem-game-close:disabled {
  opacity: 0.45;
  cursor: wait;
  filter: grayscale(0.4);
  pointer-events: none;
}

/* ミニトースト */
.gp-mini-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 24, 48, 0.92);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(251, 246, 232, 0.25);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  z-index: 1100;
  opacity: 0;
  animation: miniToastIn 0.2s var(--ease-out) forwards;
}
.gp-mini-toast.is-out {
  animation: miniToastOut 0.4s var(--ease-out) forwards;
}
@keyframes miniToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes miniToastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ====================================
   コレクション カード詳細モーダル */
.gp-card-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 14, 28, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s var(--ease-out);
}
.gp-card-modal {
  max-width: 320px;
  width: 100%;
  animation: cardPop 0.4s var(--ease-out);
}
@keyframes cardPop {
  0%   { opacity: 0; transform: scale(0.85) translateY(20px); }
  60%  { transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gp-card-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(251, 246, 232, 0.3);
  border-radius: 50%;
  color: var(--cream);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.gp-card-modal-close:hover,
.gp-card-modal-close:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  outline: none;
}

/* ================================================================
   7. GACHA ANIMATIONS（既存維持）
   ============================================================== */

.anim-curtain {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.7) 100%);
  opacity: 0;
  animation: curtainIn 0.7s var(--ease-out) forwards;
}
@keyframes curtainIn { from { opacity: 0; } to { opacity: 1; } }

.anim-bg-aura {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  animation: bgAuraIn 1.2s var(--ease-out) forwards;
}
.anim-bg-aura.is-n  { background: radial-gradient(ellipse at center, rgba(255,255,255,0.08), transparent 60%); }
.anim-bg-aura.is-r  { background: radial-gradient(ellipse at center, rgba(100,180,255,0.25), transparent 65%); }
.anim-bg-aura.is-sr { background: radial-gradient(ellipse at center, rgba(186,104,200,0.3), transparent 65%); }
.anim-bg-aura.is-ur {
  background:
    radial-gradient(ellipse at center, rgba(255,215,0,0.35) 0%, transparent 50%),
    conic-gradient(from 0deg, rgba(255,107,107,0.25), rgba(255,215,0,0.25), rgba(106,207,140,0.25), rgba(110,170,255,0.25), rgba(186,104,200,0.25), rgba(255,107,107,0.25));
  animation: bgAuraIn 1.2s var(--ease-out) forwards, bgAuraUrSpin 8s linear infinite 1.2s;
}
@keyframes bgAuraIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bgAuraUrSpin { to { transform: rotate(360deg); } }

.anim-image-wrap {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}
.anim-image {
  position: relative;
  width: min(78vw, 480px);
  aspect-ratio: 1;
  transform: scale(0.25) rotate(-6deg);
  opacity: 0;
  animation: imgIn 0.9s cubic-bezier(0.16, 1.1, 0.3, 1) forwards, imgBreath 3s var(--ease) infinite 0.9s;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.anim-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s var(--ease);
}
.anim-image .img-next { position: absolute; inset: 0; opacity: 0; }
.anim-image.is-upgraded .img-prev { opacity: 0; }
.anim-image.is-upgraded .img-next { opacity: 1; }
@keyframes imgIn {
  0%   { transform: scale(0.25) rotate(-6deg); opacity: 0; }
  60%  { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes imgBreath {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.015); filter: brightness(1.05); }
}
.anim-image.is-closing { animation: imgOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards !important; }
@keyframes imgOut {
  0%   { transform: scale(1); opacity: 1; filter: brightness(1); }
  60%  { transform: scale(1.15); opacity: 0.7; filter: brightness(1.8); }
  100% { transform: scale(1.3); opacity: 0; filter: brightness(2.2); }
}

.anim-image.is-r {
  box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 40px 6px rgba(100,180,255,0.5);
  animation: imgIn 0.9s cubic-bezier(0.16, 1.1, 0.3, 1) forwards, imgBreath 2.8s var(--ease) infinite 0.9s, rHalo 2.5s ease-in-out infinite 1.2s;
}
@keyframes rHalo {
  0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 40px 6px rgba(100,180,255,0.5); }
  50%      { box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 60px 12px rgba(150,200,255,0.7); }
}
.anim-image.is-sr {
  box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 50px 8px rgba(186,104,200,0.6);
  animation: imgIn 0.9s cubic-bezier(0.16, 1.1, 0.3, 1) forwards, imgBreath 2.5s var(--ease) infinite 0.9s, srHalo 2.2s ease-in-out infinite 1.2s;
}
@keyframes srHalo {
  0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 50px 8px rgba(186,104,200,0.6); }
  50%      { box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 80px 16px rgba(220,140,240,0.8); }
}
.anim-image.is-ur {
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 60px 10px rgba(255,140,0,0.7), 0 0 120px 20px rgba(255,90,44,0.5);
  animation: imgIn 0.9s cubic-bezier(0.16, 1.1, 0.3, 1) forwards, imgBreathUr 2s var(--ease) infinite 0.9s, urHalo 1.6s ease-in-out infinite 1.2s;
}
@keyframes imgBreathUr {
  0%, 100% { transform: scale(1); filter: brightness(1) saturate(1); }
  50%      { transform: scale(1.03); filter: brightness(1.15) saturate(1.2); }
}
@keyframes urHalo {
  0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 60px 10px rgba(255,140,0,0.7), 0 0 120px 20px rgba(255,90,44,0.5); }
  50%      { box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 90px 20px rgba(255,215,0,0.85), 0 0 180px 40px rgba(255,90,44,0.65); }
}

.anim-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.25) 45%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0.25) 55%, transparent 70%);
  background-size: 250% 100%;
  background-position: 250% 0;
  animation: shimmer 2.4s ease-in-out infinite 0.9s;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: overlay;
}
.anim-image.is-ur .anim-shimmer {
  animation: shimmer 1.4s ease-in-out infinite 0.9s;
  background: linear-gradient(110deg, transparent 25%, rgba(255,215,0,0.3) 45%, rgba(255,255,255,0.6) 50%, rgba(255,200,255,0.3) 55%, transparent 75%);
  background-size: 250% 100%;
  background-position: 250% 0;
}
@keyframes shimmer {
  0%   { background-position: 250% 0; }
  100% { background-position: -150% 0; }
}

.anim-aura {
  position: absolute;
  left: 50%; top: 50%;
  width: min(110vw, 720px);
  height: min(110vw, 720px);
  transform: translate(-50%, -50%) scale(0.8);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: auraIn 0.8s var(--ease-out) 0.9s forwards;
  mix-blend-mode: screen;
}
.anim-aura::before, .anim-aura::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
}
.anim-aura::before {
  background: conic-gradient(from 0deg, transparent 0deg, currentColor 40deg, transparent 90deg, transparent 180deg, currentColor 220deg, transparent 270deg);
  animation: auraSpin 6s linear infinite;
  opacity: 0.55;
  filter: blur(12px);
}
.anim-aura::after {
  background: radial-gradient(circle at center, currentColor 0%, transparent 55%);
  opacity: 0.35;
  animation: auraPulse 3s ease-in-out infinite;
}
.anim-aura.is-r  { color: rgba(100,180,255,0.9); }
.anim-aura.is-sr { color: rgba(186,104,200,0.95); }
.anim-aura.is-ur { color: rgba(255,180,80,1); }
.anim-aura.is-ur::before {
  background: conic-gradient(from 0deg, var(--pink), var(--gold), rgba(106,207,140,0.8), rgba(110,170,255,0.9), var(--r-sr), var(--pink));
  animation: auraSpin 3.5s linear infinite;
  opacity: 0.75; filter: blur(10px);
}
.anim-aura.is-ur::after {
  background: radial-gradient(circle at center, rgba(255,215,0,0.7) 0%, rgba(255,90,44,0.3) 35%, transparent 65%);
  opacity: 0.6;
  animation: auraPulse 2s ease-in-out infinite;
}
@keyframes auraIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes auraSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes auraPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.08); }
}

.anim-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  animation: flashReveal 0.6s var(--ease-out) forwards;
  pointer-events: none;
  z-index: 5;
}
@keyframes flashReveal {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  100% { opacity: 0; }
}

/* reveal */
.anim-reveal {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  animation: revealIn 0.9s var(--ease-out) forwards;
  z-index: 10;
}
.anim-reveal-frame {
  padding: 18px;
  background: rgba(251, 246, 232, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(255, 183, 77, 0.5);
  border: 1.5px solid var(--gold);
  position: relative;
}
.anim-reveal img {
  width: 180px; height: 180px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}
@keyframes revealIn {
  0%   { transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.12) rotate(3deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

/* light beams */
.anim-beams {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg, transparent 0deg 14deg, rgba(255,215,0,0.18) 14deg 20deg);
  animation: beamSpin 8s linear infinite;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
}
.anim-beams.show { opacity: 0.85; }
.anim-beams.rainbow {
  background: repeating-conic-gradient(from 0deg, rgba(255,90,44,0.18) 0deg 10deg, rgba(255,140,0,0.22) 10deg 16deg, rgba(255,215,0,0.2) 16deg 26deg, rgba(186,104,200,0.18) 26deg 36deg);
  animation: beamSpin 5s linear infinite;
}
@keyframes beamSpin { to { transform: rotate(360deg); } }

.anim-ur-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--accent) 0%, var(--accent) 30%, var(--bg-1) 70%, var(--bg-0) 100%);
  opacity: 0;
  animation: urBgIn 0.6s var(--ease-out) forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes urBgIn { 0% { opacity: 0; } 100% { opacity: 0.3; } }

.anim-ur-hush {
  position: absolute; inset: 0;
  background: var(--bg-0);
  opacity: 0;
  animation: urHush 1.8s var(--ease) forwards;
  pointer-events: none;
  z-index: 9;
}
@keyframes urHush {
  0%   { opacity: 0; }
  35%  { opacity: 0.94; }
  100% { opacity: 0; }
}

.anim-sparkle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px 3px currentColor;
  animation: sparkleRise 1.8s var(--ease-out) forwards;
  pointer-events: none;
  z-index: 6;
}
@keyframes sparkleRise {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  20%  { opacity: 1; transform: translateY(-30px) scale(1); }
  100% { transform: translateY(-260px) scale(0); opacity: 0; }
}

.anim-upgrade-flash {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: upgradeFlash 0.5s var(--ease-out) forwards;
  pointer-events: none;
  z-index: 7;
}
@keyframes upgradeFlash {
  0%   { width: 0; height: 0; opacity: 1; }
  100% { width: 600px; height: 600px; opacity: 0; }
}

.anim-particle {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px 2px currentColor;
  animation: particleFly 2s var(--ease-out) forwards;
  pointer-events: none;
  z-index: 3;
}
@keyframes particleFly {
  0%   { transform: translate(0, 0) scale(0); opacity: 0; }
  20%  { opacity: 1; transform: translate(calc((var(--rx, 0.5) - 0.5) * 100px), calc((var(--ry, 0.5) - 0.5) * 100px)) scale(1); }
  100% {
    transform: translate(calc((var(--rx, 0.5) - 0.5) * 300px), calc(-150px + (var(--ry, 0.5) - 0.5) * 200px)) scale(0);
    opacity: 0;
  }
}

.anim-ripple {
  position: absolute;
  left: 50%; top: 50%;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 3px solid rgba(255,215,0,0.9);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleOut 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
  z-index: 2;
}
@keyframes rippleOut {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; border-width: 4px; }
  100% { transform: translate(-50%, -50%) scale(4); opacity: 0; border-width: 1px; }
}

/* ================================================================
   8. TOAST & MODAL
   ============================================================== */
.gb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 24, 48, 0.95);
  border: 1.5px solid var(--gold);
  color: var(--cream);
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--font-jp);
  font-size: 14px;
  letter-spacing: 0.06em;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 24px rgba(255, 183, 77, 0.4);
  animation: toastIn 0.3s var(--ease-out);
  backdrop-filter: blur(12px);
}
.gb-toast.is-out { animation: toastOut 0.4s var(--ease) forwards; }
.gb-toast--error { border-color: var(--danger); box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 24px rgba(255, 82, 82, 0.5); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 20px); }
}

.gb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 8, 24, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 10001;
  padding: var(--space);
  animation: fadeUp 0.25s var(--ease-out);
}
.gb-modal {
  background: linear-gradient(180deg, rgba(26, 18, 64, 0.95), rgba(13, 24, 48, 0.95));
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(255, 183, 77, 0.4);
  padding: var(--space-lg) var(--space-md);
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(255, 183, 77, 0.3);
}
.gb-modal-msg {
  font-family: var(--font-jp);
  font-size: 15px;
  line-height: 1.7;
  color: var(--cream);
  margin: 0 0 var(--space-md);
  text-align: center;
}
.gb-modal-actions {
  display: flex;
  gap: var(--space);
  justify-content: center;
}
.gb-modal-cancel,
.gb-modal-confirm {
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
}
.gb-modal-cancel {
  background: rgba(255, 247, 225, 0.08);
  color: var(--cream);
  border: 1px solid rgba(255, 183, 77, 0.35);
}
.gb-modal-confirm {
  background: var(--danger);
  color: var(--cream);
}

/* ================================================================
   8b. EDIT MODAL (v0.6.0)
   ============================================================== */
.gb-edit-modal {
  max-width: 380px;
  text-align: center;
}
.gb-edit-title {
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 var(--space);
  text-shadow: 0 0 12px rgba(255, 183, 77, 0.4);
}
.gb-edit-preview-box {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  background: rgba(251, 246, 232, 0.92);
  border: 2px solid rgba(255, 183, 77, 0.4);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gb-edit-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.gb-edit-img-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px auto 0;
  padding: 8px 18px;
  background: rgba(255, 183, 77, 0.08);
  color: var(--gold);
  border: 1.5px dashed rgba(255, 183, 77, 0.45);
  border-radius: 999px;
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  min-height: 36px;
}
.gb-edit-img-btn:hover,
.gb-edit-img-btn:focus-visible {
  background: var(--gold);
  color: var(--bg-1);
  border-style: solid;
  box-shadow: 0 0 14px rgba(255, 183, 77, 0.5);
}
.gb-edit-label {
  display: block;
  text-align: left;
  margin: var(--space) 0 6px;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cream-d);
}
.gb-edit-name {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 183, 77, 0.3);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--font-jp);
  font-size: 16px;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.15s;
}
.gb-edit-name:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 183, 77, 0.2);
}
.gb-edit-rarity {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.gb-edit-rarity-btn {
  padding: 10px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid currentColor;
  border-radius: 8px;
  font-family: var(--font-num);
  font-style: italic;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  min-height: 44px;
}
.gb-edit-rarity-btn:hover {
  background: rgba(255, 183, 77, 0.08);
}
.gb-edit-rarity-btn.is-active {
  background: currentColor;
}
/* レア度別、is-active 時の前景色を反転（背景が currentColor なので、文字色を背景色相当に） */
.gb-edit-rarity-btn.rarity-N.is-active,
.gb-edit-rarity-btn.rarity-R.is-active,
.gb-edit-rarity-btn.rarity-SR.is-active {
  color: var(--bg-1);
  text-shadow: none;
  /* 背景は currentColor だが、color を変えると同時に背景もリセットされるので明示 */
}
.gb-edit-rarity-btn.rarity-N.is-active   { background: var(--r-n); }
.gb-edit-rarity-btn.rarity-R.is-active   { background: var(--r-r); }
.gb-edit-rarity-btn.rarity-SR.is-active  { background: var(--r-sr); }
.gb-edit-rarity-btn.rarity-UR.is-active {
  background: linear-gradient(135deg, var(--pink), var(--gold), var(--cyan));
  color: var(--bg-1);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 183, 77, 0.5);
}
.gb-edit-actions {
  margin-top: var(--space);
}
/* 編集モーダル内の confirm はオレンジCTA、削除系 ghost-danger と区別 */
.gb-edit-actions .gb-modal-confirm {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--cream);
  box-shadow: 0 0 14px rgba(230, 74, 25, 0.4);
}
.gb-edit-sub-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space);
  padding-top: var(--space);
  border-top: 1px solid rgba(255, 183, 77, 0.18);
}
.gb-btn-danger {
  display: inline-block;
  padding: 8px 14px;
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: 999px;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  min-height: 36px;
}
.gb-btn-danger:hover,
.gb-btn-danger:focus-visible {
  background: var(--danger);
  color: var(--cream);
}

/* ================================================================
   8c. PLAYER: REBUILD BUTTON (header right) — v0.7.0
   ============================================================== */
.gp-header {
  position: relative;
}
.gp-rebuild-btn {
  /* タイトルマーキーの左上に「戻るボタン」的な位置で固定 */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  background: rgba(13, 24, 48, 0.7);
  color: var(--cream-d);
  border: 1px solid rgba(251, 246, 232, 0.25);
  border-radius: 999px;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gp-rebuild-btn:hover,
.gp-rebuild-btn:focus-visible {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  outline: none;
}
.gp-rebuild-btn svg { flex-shrink: 0; }
.gp-header > .gp-rebuild-btn { display: inline-flex; }
/* マーキー枠が上から始まるとボタンと被るので、ヘッダに上パディング確保
   ボタン高さ約32px + 下余白16px くらい */
.gp-header { padding-top: 52px; }
@media (max-width: 599px) {
  .gp-rebuild-btn {
    font-size: 11px;
    padding: 5px 10px 5px 8px;
  }
  .gp-rebuild-btn svg { width: 12px; height: 12px; }
  .gp-header { padding-top: 46px; }
}

/* ================================================================
   8d. POKE-STYLE RESULT CARD — v0.7.0
   ============================================================== */
.gp-card {
  --card-frame: var(--gold);
  --card-glow: 255, 183, 77;
  --card-art-bg: linear-gradient(135deg, #1a1240 0%, #3d2660 50%, #1a1240 100%);
  position: relative;
  width: min(86%, 320px);
  margin: var(--space-lg) auto var(--space-md);
  aspect-ratio: 5 / 7;
  perspective: 800px;
  animation: card-pop 0.6s var(--ease-out) backwards;
}
@keyframes card-pop {
  0%   { opacity: 0; transform: scale(0.8) rotateY(-30deg); }
  60%  { opacity: 1; transform: scale(1.05) rotateY(8deg); }
  100% { opacity: 1; transform: scale(1) rotateY(0); }
}
.gp-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 183, 77, 0.06), rgba(0,0,0,0.4) 40%, rgba(255, 183, 77, 0.04)),
    var(--card-art-bg);
  border: 3px solid var(--card-frame);
  box-shadow:
    0 0 calc(50px * var(--neon-intensity)) rgba(var(--card-glow), 0.55),
    0 24px 48px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.16),
    inset 0 0 32px rgba(var(--card-glow), 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  isolation: isolate;
}
.gp-card-holo {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg,
      transparent 0 8px,
      rgba(var(--card-glow), 0.06) 8px 12px),
    radial-gradient(ellipse 80% 50% at 30% 20%, rgba(var(--card-glow), 0.18), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1;
}
.gp-card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 255, 255, 0.32) 50%,
    rgba(255, 255, 255, 0.18) 55%,
    transparent 70%);
  background-size: 200% 200%;
  animation: card-shine 4s linear infinite;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
}
@keyframes card-shine {
  from { background-position: -100% -100%; }
  to   { background-position: 200% 200%; }
}
.gp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 3;
  margin-bottom: 8px;
}
.gp-card-no {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(251, 246, 232, 0.7);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}
.gp-card-rarity {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid currentColor;
  border-radius: 999px;
  text-shadow: 0 0 10px currentColor;
}
.gp-card-art {
  flex: 1;
  position: relative;
  z-index: 3;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%,
      rgba(var(--card-glow), 0.25),
      rgba(0, 0, 0, 0.4) 70%);
  border: 1.5px solid rgba(var(--card-glow), 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.gp-card-art img {
  max-width: 80%;
  max-height: 80%;
  width: auto; height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 16px rgba(var(--card-glow), 0.6));
}
.gp-card-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  z-index: 3;
  padding-top: 6px;
  border-top: 1.5px solid rgba(var(--card-glow), 0.35);
}
.gp-card-name {
  font-family: var(--font-jp);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cream);
  text-shadow: 0 0 8px rgba(var(--card-glow), 0.5);
  text-align: center;
}
.gp-card-count {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(251, 246, 232, 0.7);
}

/* レア度別のカード装飾 */
.gp-card.rarity-N  {
  --card-frame: var(--r-n);
  --card-glow: 200, 195, 180;
  --card-art-bg: linear-gradient(135deg, #2a2620 0%, #4a4540 50%, #2a2620 100%);
}
.gp-card.rarity-R  {
  --card-frame: var(--r-r);
  --card-glow: 25, 118, 210;
  --card-art-bg: linear-gradient(135deg, #0d2238 0%, #1a4870 50%, #0d2238 100%);
}
.gp-card.rarity-SR {
  --card-frame: var(--r-sr);
  --card-glow: 187, 134, 252;
  --card-art-bg: linear-gradient(135deg, #2a0e3d 0%, #5e1a8c 50%, #2a0e3d 100%);
}
.gp-card.rarity-UR {
  --card-frame: transparent;
  --card-glow: 255, 183, 77;
}
.gp-card.rarity-UR .gp-card-inner {
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 183, 77, 0.06), rgba(0,0,0,0.4) 40%, rgba(255, 79, 161, 0.04)),
    linear-gradient(135deg, #1a1240 0%, #3d2660 50%, #1a1240 100%);
  background-clip: padding-box;
  position: relative;
}
.gp-card.rarity-UR .gp-card-inner::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  background: conic-gradient(
    from 0deg,
    var(--pink), var(--gold), var(--cyan), var(--r-sr), var(--pink));
  z-index: -1;
  animation: rotate-frame 6s linear infinite;
  filter: blur(0.5px);
}
@keyframes rotate-frame {
  to { transform: rotate(360deg); }
}
.gp-card.rarity-UR .gp-card-holo {
  background:
    repeating-linear-gradient(115deg,
      transparent 0 6px,
      rgba(255, 79, 161, 0.08) 6px 9px,
      rgba(0, 188, 212, 0.08) 9px 12px),
    radial-gradient(ellipse 80% 50% at 30% 20%, rgba(255, 183, 77, 0.25), transparent 60%);
}

/* NEW! バッジ */
.gp-card .gp-new-badge {
  position: absolute;
  top: -10px;
  left: -10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--cream);
  font-family: var(--font-num);
  font-style: italic;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow:
    0 0 16px rgba(230, 74, 25, 0.7),
    0 4px 12px rgba(0, 0, 0, 0.5);
  transform: rotate(-12deg);
  z-index: 4;
  display: none;
}
.gp-card.is-new .gp-new-badge { display: inline-block; }

/* ================================================================
   9. RESPONSIVE
   ============================================================== */
@media (max-width: 600px) {
  .gb-app, .gp-app { padding: var(--space-md) var(--space-sm); }
  .gb-step { padding: var(--space) var(--space-sm); }

  /* 看板（電球はみ出し対策）— v0.7.2 */
  .arcade-marquee {
    padding: 14px 14px 16px;
    gap: 6px;
    overflow: hidden;
  }
  .marquee-title {
    font-size: 22px;
    letter-spacing: 0.04em;
    min-width: 0;
    /* スマホは黒シャドウ強めにしてコントラスト確保 */
    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.7),
      0 0 10px rgba(255, 183, 77, 0.7);
  }
  .marquee-bulb {
    width: 8px;
    height: 8px;
    box-shadow:
      inset 0 0 3px rgba(255, 255, 255, 0.8),
      0 0 8px currentColor;
  }

  .gb-step-title { font-size: 17px; }
  .gb-style-grid { grid-template-columns: 1fr; gap: 6px; }
  .gb-char-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .gp-stage { min-height: 460px; padding: var(--space-md) var(--space-sm); }
  .gp-pull-btn { font-size: 17px; letter-spacing: 0.08em; padding: 16px 36px; }
  .gp-machine img { width: 200px; }
  .anim-reveal img { width: 140px; height: 140px; }
  .gp-result-char { width: 200px; height: 240px; }
  .gp-result-char .showcase-frame { width: 180px; height: 220px; }
  .gp-result-char img { width: 140px; height: 140px; }
}
@media (max-width: 420px) {
  /* 極小スマホ：電球は内側ペアだけ残して数を減らす */
  .marquee-bulb:nth-of-type(1),
  .marquee-bulb:nth-of-type(2),
  .marquee-bulb.right-1,
  .arcade-marquee > .marquee-bulb:last-of-type {
    display: none;
  }
  .marquee-title { font-size: 20px; }
  .arcade-marquee { gap: 8px; padding: 14px 12px 16px; }
}
@media (max-width: 380px) {
  .gp-stage { min-height: 400px; }
  .gp-machine img { width: 170px; }
  .gp-pull-btn { padding: 14px 28px; font-size: 16px; }
}
