/* ===================================================
   tokens.css - デザイントークン（Aurora Glass）
   サイト全体で参照するCSSカスタムプロパティ定義。
   =================================================== */

:root {
  /* 基本色 */
  --bg: #1a1a2e;
  --panel: rgba(26, 38, 71, 0.55);
  --panel-solid: #1b2547;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #e94560;
  --accent-soft: rgba(233, 69, 96, 0.35);
  --text: #e8e8f0;
  --text-sub: #9aa0b5;

  /* 形状・動き */
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 64px;

  /* カード色定数 */
  --c-blue: #1565c0;
  --c-green: #2e7d32;
  --c-white: #cfd8dc;
  --c-red: #c62828;
  --c-yellow: #f9a825;
  --c-black: #616161;

  /* スコア4段階（modal.js の scoreColor と対応） */
  --score-4: #4caf50;
  --score-3: #ff9800;
  --score-2: #ff5722;
  --score-1: #f44336;
}
/* ===================================================
   base.css - リセット・ボディ・オーロラ背景・共通アニメーション
   =================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  /* モバイルのダブルタップズーム抑止 */
  touch-action: manipulation;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #1e1e36 0%, #1a1a2e 40%, #16162a 100%);
  background-color: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* オーロラグロー背景（bodyグラデーションの上・コンテンツの下） */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(700px 500px at 15% -5%, rgba(233, 69, 96, 0.13), transparent 70%),
    radial-gradient(900px 600px at 85% 5%, rgba(84, 88, 228, 0.12), transparent 70%),
    radial-gradient(800px 700px at 50% 110%, rgba(233, 69, 96, 0.07), transparent 70%);
}

/* 画像保護（右クリック/ドラッグ抑止は site.js 側。ここでは選択・ドラッグを抑止） */
img {
  -webkit-user-drag: none;
  user-select: none;
}

/* 共通キーフレーム */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
}
/* ===================================================
   layout.css - 共通シェル（notice / header / page tabs / footer）
   =================================================== */

/* === Site Notice Banner === */
.site-notice {
  font-size: 0.72rem;
  color: #f5c842;
  text-align: center;
  padding: 6px 16px;
  line-height: 1.5;
  background: rgba(42, 26, 0, 0.6);
  border-bottom: 1px solid rgba(245, 200, 66, 0.15);
}

.site-notice-icon {
  margin-right: 0.3rem;
}

/* === Glass Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 20, 40, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

@supports not (backdrop-filter: blur(1px)) {
  .header {
    background: rgba(20, 20, 40, 0.96);
  }
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(233, 69, 96, 0.28), rgba(84, 88, 228, 0.22));
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 18px rgba(233, 69, 96, 0.25);
}

.brand-name {
  margin: 0;
  font-weight: 900;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--text);
}

.brand-name small {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: 0.14em;
}

/* === Page Tabs (pill) === */
.site-page-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.site-page-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
  white-space: nowrap;
}

.site-page-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.site-page-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #d63955);
  box-shadow: 0 4px 16px var(--accent-soft);
}

.site-page-tab.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.site-page-tab-soon {
  font-size: 0.6rem;
  margin-left: 4px;
  opacity: 0.8;
  font-weight: normal;
}

/* === Footer === */
.site-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 28px 20px 40px;
  text-align: center;
}

.site-footer .copyright {
  color: var(--text);
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}

.site-footer .disclaimer {
  color: var(--text-sub);
  font-size: 0.68rem;
  margin: 0;
}

.site-footer .footer-links {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
}

.site-footer .footer-links a {
  color: var(--text-sub);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s, border-color 0.2s;
}

.site-footer .footer-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-footer .footer-sep {
  color: #555;
  margin: 0 0.5rem;
}

/* === Responsive === */
@media (max-width: 640px) {
  .header-inner {
    padding: 10px 14px;
    gap: 8px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 0.88rem;
  }

  .brand-name small {
    font-size: 0.54rem;
  }

  .site-page-tabs {
    width: 100%;
    overflow-x: auto;
    margin-left: 0;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .site-page-tab {
    padding: 6px 12px;
    font-size: 0.74rem;
  }

  .site-page-tab-soon {
    font-size: 0.5rem;
  }
}
/* ===================================================
   components.css - 共通コンポーネント
   （ガラスパネル / チップ / モーダル外殻 / スケルトン /
     empty-state / スクロールトップボタン）
   =================================================== */

/* === Glass Panel（汎用） === */
.glass-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

@supports not (backdrop-filter: blur(1px)) {
  .glass-panel {
    background: var(--panel-solid);
  }
}

/* === Chip（汎用ピルボタン） === */
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.on,
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === Modal Shell === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 15, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 2rem 0 6rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s var(--ease);
}

.modal-content {
  width: 92%;
  max-width: 960px;
  margin: 2rem auto 6rem;
  position: relative;
  background: rgba(24, 30, 58, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: slideUp 0.4s var(--ease);
}

@supports not (backdrop-filter: blur(1px)) {
  .modal-content {
    background: #181e3a;
  }
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-sub);
  font-size: 0.9rem;
  max-width: 1050px;
  margin: 0 auto;
}

/* === Skeleton Loader === */
.skeleton-loader {
  padding: 1.5rem;
}

.skeleton-header {
  display: flex;
  gap: 1.5rem;
}

.skeleton-image {
  width: 240px;
  height: 335px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.skeleton-body {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line-title {
  height: 22px;
  width: 60%;
}

.skeleton-line-short {
  width: 40%;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* === Scroll to Top Button === */
.fixed-bottom-actions {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.scroll-top-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 38, 71, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* === Responsive === */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
  }

  .modal-content {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .skeleton-image {
    width: 120px;
    height: 167px;
  }

  .skeleton-header {
    gap: 0.75rem;
  }

  .skeleton-loader {
    padding: 1rem;
  }

  .fixed-bottom-actions {
    bottom: 1rem;
    right: 1rem;
  }
}
/* === Loading Progress Bar === */
.load-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: rgba(13, 27, 62, 0.95);
  backdrop-filter: blur(4px);
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.5s, transform 0.5s;
}

.load-progress.done {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.load-progress-text {
  font-size: 0.82rem;
  color: #e0e0e0;
  white-space: nowrap;
  flex-shrink: 0;
}

.load-progress-track {
  flex: 1;
  height: 10px;
  background: #1a1a2e;
  border-radius: 5px;
  overflow: hidden;
}

.load-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e94560, #ff6b81);
  border-radius: 5px;
  transition: width 0.3s;
}

.load-progress-pct {
  font-size: 0.85rem;
  font-weight: bold;
  color: #e94560;
  min-width: 3.5rem;
  text-align: right;
  flex-shrink: 0;
}

/* === Controls (sticky glass panel) === */
.controls {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px 0;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
}

.controls-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

@supports not (backdrop-filter: blur(1px)) {
  .controls-panel {
    background: var(--panel-solid);
  }
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border-radius: 999px;
  background: rgba(13, 27, 62, 0.6);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.18);
}

.search-input::placeholder {
  color: #667;
}

/* === Color Filter Pills === */
.color-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.color-filter-btn {
  --c: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
  opacity: 0.45;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

.color-filter-btn::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  flex-shrink: 0;
}

.color-filter-btn:hover {
  opacity: 0.8;
}

.color-filter-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--c);
  color: #fff;
}

.color-filter-btn[data-color="青"] { --c: var(--c-blue); }
.color-filter-btn[data-color="緑"] { --c: var(--c-green); }
.color-filter-btn[data-color="白"] { --c: var(--c-white); }
.color-filter-btn[data-color="赤"] { --c: var(--c-red); }
.color-filter-btn[data-color="黄"] { --c: var(--c-yellow); }
.color-filter-btn[data-color="黒"] { --c: var(--c-black); }

/* === SP Filter Toggle (hidden on PC) === */
.sp-filter-toggle {
  display: none;
}

/* === Filter Panel (always visible on PC) === */
.filter-panel {
  display: block;
  width: 100%;
}

.filter-panel-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.level-filters-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Type Filter Buttons (chip) === */
.type-filters {
  display: flex;
  gap: 6px;
}

.type-filter-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}

.type-filter-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.type-filter-btn.active {
  background: rgba(122, 184, 255, 0.14);
  border-color: rgba(122, 184, 255, 0.45);
  color: #a8ccff;
}

.sort-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
}

.sort-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}

.sort-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.sort-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Arrow indicator for sort direction */
.sort-btn.active::after {
  content: " \25BC"; /* ▼ descending */
  font-size: 0.65rem;
}

.sort-btn.active.asc::after {
  content: " \25B2"; /* ▲ ascending */
}

/* === Section / Section Head === */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
}

.section-head .count {
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  animation: rise 0.6s var(--ease) backwards;
}

.card-item {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  aspect-ratio: 143 / 200;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  /* 1200件超のグリッドで画面外アイテムのレイアウト/描画をスキップする
     （高さは aspect-ratio から決まるためプレースホルダーサイズは概算でよい） */
  content-visibility: auto;
  contain-intrinsic-size: auto 140px auto 195px;
}

/* 事件カードは画像の向きに合わせて枠を出し分ける。
   横長デザイン（280x200 = 7:5）は横長枠、縦デザイン（.is-portrait）はキャラと同じ縦長枠。
   混在行では枠を引き伸ばさず、行の縦方向に中央揃えする */
#cases-grid {
  align-items: center;
}

#cases-grid .card-item {
  aspect-ratio: 7 / 5;
}

#cases-grid .card-item.is-portrait {
  aspect-ratio: 143 / 200;
}

#cases-grid .card-item img {
  object-fit: contain;
}

.card-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(233, 69, 96, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-soft);
}

.card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.8);
}

.card-item .card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(8, 8, 20, 0.55) 40%, rgba(8, 8, 20, 0.92));
  padding: 26px 8px 7px;
}

.card-item .card-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stars {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  line-height: 1;
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

.stars-standalone {
  color: #ffd166;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.stars-synergy {
  color: #7ab8ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 評価保留（既存プールで条件を満たせない＝未登場の事件・特徴・色等に依存） */
.card-pending {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.55rem;
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: #ffd9a0;
  background: rgba(120, 90, 40, 0.55);
  border: 1px solid rgba(255, 200, 120, 0.5);
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.meta-cell-pending .v-pending {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffb84d;
  padding: 0.3rem 0;
  white-space: nowrap;
}

/* === Modal（外殻は components.css） === */
.modal-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(24, 30, 58, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px 22px 0 0;
}

@supports not (backdrop-filter: blur(1px)) {
  .modal-top-bar {
    background: #181e3a;
  }
}

.modal-breadcrumbs {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow-x: auto;
}

.breadcrumb-item,
.breadcrumb-current {
  display: inline-block;
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.breadcrumb-item {
  color: #7ab8ff;
  cursor: pointer;
}

.breadcrumb-item:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--text-sub);
  margin: 0 0.3rem;
}

.breadcrumb-current {
  color: var(--text-sub);
}

.modal-close {
  margin-left: auto;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}

/* === Modal Body（2カラム） === */
.modal-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 26px;
  align-items: start;
}

.modal-left {
  position: sticky;
  top: 70px;
  align-self: start;
  min-width: 0;
}

.modal-card-img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  display: block;
  filter: saturate(0.8);
}

.modal-right {
  min-width: 0;
}

/* === Meta Grid（AP / LP / 評価） === */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.meta-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.meta-cell .k {
  font-size: 0.62rem;
  color: var(--text-sub);
  letter-spacing: 0.1em;
}

.meta-cell .v {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
}

.meta-cell .v small {
  font-size: 0.68rem;
  color: var(--text-sub);
  font-weight: 500;
}

/* 評価セル: スコアを円グラフ（リング）で表示 */
.meta-cell-score .score-ring {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 5px auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meta-cell-score .score-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, var(--accent)) var(--ring-deg, 0deg), rgba(255, 255, 255, 0.09) 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

.meta-cell-score .v {
  font-size: 0.95rem;
  min-height: 0;
}

/* LPカギ穴（コナンモチーフ・維持） */
.lp-keyhole {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lp-keyhole-circle {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #636363;
  box-sizing: border-box;
}

.lp-keyhole-notch {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 9px solid #636363;
  margin-top: -5px;
}

.lp-keyhole-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-55%, -50%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* === 別イラスト（左カラム・横スクロール） === */
.variants-block {
  margin-top: 14px;
}

.variants-label {
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.variants-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.variant-card {
  flex: 0 0 84px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.variant-card img {
  width: 100%;
  display: block;
  filter: saturate(0.8);
}

.variant-label {
  font-size: 0.62rem;
  padding: 0.25rem 0.2rem;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 収録商品（左カラム） === */
.products-block {
  margin-top: 14px;
}

.products-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-badge {
  font-size: 0.72rem;
  color: var(--text-sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
}

/* === Name Row === */
.detail-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* SP用名前行（≤900pxで表示に切り替え、PC用と入れ替える） */
.sp-name-row {
  display: none;
}

.detail-lv {
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.detail-name {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.35;
}

.detail-no {
  color: var(--text-sub);
  font-size: 0.8rem;
}

.name-color-dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #fff;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* === Info Badges（特徴・キーワード・制限ピル） === */
.info-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.info-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(122, 184, 255, 0.12);
  border: 1px solid rgba(122, 184, 255, 0.3);
  color: #a8ccff;
  white-space: nowrap;
}

.info-badge.keyword-badge {
  background: rgba(233, 69, 96, 0.1);
  border-color: rgba(233, 69, 96, 0.3);
  color: #ff9fb0;
}

/* === Ability Box（常時インライン表示） === */
.ability-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.ability-box-label {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.ability-item {
  padding: 8px 0;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  line-height: 1.7;
}

.ability-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.ability-item:last-child {
  padding-bottom: 0;
}

.ability-timing {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.76rem;
  margin-bottom: 0.25rem;
}

.ability-turn-limit {
  color: var(--text-sub);
  font-size: 0.74rem;
  margin-top: 0.25rem;
}

/* === 能力原文ポップアップ（SP ≤900px 専用。ボタンはメタグリッド下の隙間に配置） === */
.ability-popup-btn {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #a8ccff;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
}

.ability-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100; /* カードモーダル(2000)より上 */
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}

.ability-popup {
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.ability-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.ability-popup-close {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.ability-popup-body {
  padding: 14px 16px;
  overflow-y: auto;
  font-size: 0.85rem;
}

/* === 長所・短所 2カラム === */
.analysis-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.analysis-box {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  min-width: 0;
}

.analysis-box.good {
  background: rgba(76, 175, 80, 0.07);
  border-color: rgba(76, 175, 80, 0.25);
}

.analysis-box.bad {
  background: rgba(244, 67, 54, 0.07);
  border-color: rgba(244, 67, 54, 0.25);
}

.analysis-box h4 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.analysis-box.good h4 {
  color: #7bd68a;
}

.analysis-box.bad h4 {
  color: #ff8a80;
}

.analysis-box ul,
.summary-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.analysis-box li {
  font-size: 0.78rem;
  color: #c9cede;
  line-height: 1.7;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}

.analysis-box li:first-child {
  border-top: 0;
  padding-top: 0;
}

.analysis-box li:last-child {
  padding-bottom: 0;
}

.analysis-box li b,
.summary-box li b {
  color: var(--text);
  display: block;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

/* === 総評 === */
.summary-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(100, 160, 255, 0.06);
  border: 1px solid rgba(100, 160, 255, 0.22);
}

.summary-box h4 {
  font-size: 0.78rem;
  color: #7ab8ff;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.summary-box li {
  font-size: 0.78rem;
  color: #c9cede;
  line-height: 1.7;
  padding: 8px 0;
}

.summary-box li:first-child {
  padding-top: 0;
}

.summary-box li:last-child {
  padding-bottom: 0;
}

/* === Detail Sections（右カラム内の汎用セクション） === */
/* .modal-body 配下に限定（build_guides の .detail-section と衝突するため） */
.modal-body .detail-section {
  margin-top: 22px;
}

.modal-body .detail-section h3 {
  color: var(--text);
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 900;
}

.detail-text {
  font-size: 0.85rem;
  line-height: 1.75;
  color: #c9cede;
  margin-bottom: 0.75rem;
}

.detail-text:last-child {
  margin-bottom: 0;
}

/* === Deck Type Tags === */
.deck-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deck-type-tag {
  background: rgba(160, 120, 255, 0.10);
  border: 1px solid rgba(160, 120, 255, 0.35);
  color: #c0a0ff;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
}

/* === Synergy Grid === */
.synergy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.synergy-card {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.synergy-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.synergy-card img {
  width: 100%;
  display: block;
  filter: saturate(0.8);
}

.synergy-name {
  font-size: 0.65rem;
  padding: 0.3rem;
  text-align: center;
  background: rgba(8, 8, 20, 0.8);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selected synergy card */
.synergy-card.selected {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 8px 20px rgba(233, 69, 96, 0.35);
}

/* Synergy rank badge */
.syn-rank {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.syn-rank.rank-S {
  background: linear-gradient(135deg, #f9a825, #ff6f00);
}

.syn-rank.rank-A {
  background: linear-gradient(135deg, #e94560, #ff6b81);
}

.syn-rank.rank-B {
  background: #5560c9;
}

/* Synergy detail panel */
.synergy-detail-panel {
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
}
.synergy-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.synergy-detail-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.synergy-detail-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  margin: 0 0 12px 0;
  color: #c9cede;
}
.synergy-detail-nav-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.synergy-detail-nav-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* === Card Q&A (chat bubbles) === */
.qa-section-label {
  color: #ff9fb0;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}

.qa-pair {
  margin-bottom: 0.6rem;
}

.qa-pair:last-child {
  margin-bottom: 0;
}

.qa-bubble-row {
  display: flex;
  margin-bottom: 0.4rem;
}

.qa-bubble-row.is-question {
  justify-content: flex-end;
}

.qa-bubble-row.is-answer {
  justify-content: flex-start;
}

.qa-bubble {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.65;
  position: relative;
  word-break: break-word;
}

.qa-bubble-row.is-question .qa-bubble {
  background: rgba(122, 184, 255, 0.14);
  border: 1px solid rgba(122, 184, 255, 0.3);
  color: var(--text);
  border-bottom-right-radius: 3px;
}

.qa-bubble-row.is-answer .qa-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: #c9cede;
  border-bottom-left-radius: 3px;
}

.qa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 0.5rem;
  align-self: flex-start;
  margin-top: 2px;
}

/* === Review Request Button === */
.review-request-section {
  text-align: right;
  margin-top: 14px;
}

.review-request-btn {
  background: transparent;
  border: 1px solid rgba(180, 190, 210, 0.35);
  color: #9aa5b4;
  padding: 0.45rem 1.4rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.review-request-btn:hover {
  background: rgba(180, 190, 210, 0.15);
  border-color: rgba(180, 190, 210, 0.6);
  color: #cdd4de;
}

.review-request-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.review-request-btn.sent {
  border-color: #4caf50;
  color: #4caf50;
  opacity: 1;
}

.review-request-section-inline {
  margin-top: 12px;
  text-align: right;
}

/* === Loading State === */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-sub);
  font-size: 1rem;
}

/* === Trait Filter === */
.trait-filter-row {
  width: 100%;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.trait-filter-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trait-filter-label {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.trait-toggle-all-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-sub);
  padding: 4px 12px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.trait-toggle-all-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.trait-expand-btn {
  background: none;
  border: none;
  color: #7ab8ff;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.trait-expand-btn:hover {
  color: #a8ccff;
}

.trait-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.5rem;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.trait-filter-buttons.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.trait-filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-sub);
  padding: 4px 11px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}

.trait-filter-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.trait-filter-btn.active {
  background: rgba(122, 184, 255, 0.14);
  border-color: rgba(122, 184, 255, 0.45);
  color: #a8ccff;
}

/* === Pack Filter === */
.pack-filter-row {
  width: 100%;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.pack-filter-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pack-filter-label {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.pack-toggle-all-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-sub);
  padding: 4px 12px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.pack-toggle-all-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.pack-expand-btn {
  background: none;
  border: none;
  color: #7ab8ff;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.pack-expand-btn:hover {
  color: #a8ccff;
}

.pack-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 0.5rem;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.pack-filter-buttons.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.pack-filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-sub);
  padding: 4px 11px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}

.pack-filter-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.pack-filter-btn.active {
  background: rgba(122, 184, 255, 0.14);
  border-color: rgba(122, 184, 255, 0.45);
  color: #a8ccff;
}

.pack-category-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  opacity: 0.75;
  margin-left: 0.3rem;
  margin-right: 0.1rem;
  white-space: nowrap;
}

.pack-category-label:first-child {
  margin-left: 0;
}

.level-filter-label {
  font-size: 0.82rem;
  color: var(--text-sub);
  flex-shrink: 0;
}

.level-filters {
  display: flex;
  gap: 5px;
}

.level-filter-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
  opacity: 0.4;
}

.level-filter-btn.active {
  opacity: 1;
  background: rgba(122, 184, 255, 0.14);
  border-color: rgba(122, 184, 255, 0.45);
  color: #a8ccff;
}

/* === Restriction Badge (Thumbnail) === */
.restriction-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

/* === Newness Badge (NEW / UPDATE) === */
.newness-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  line-height: 1.4;
  pointer-events: none;
}
.new-badge {
  background: #e94560;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.update-badge {
  background: #ff9800;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* === Restriction Badge (Modal) === */
.restriction-modal-0 { background: #c62828 !important; color: #fff !important; }
.restriction-modal-1 { background: #e65100 !important; color: #fff !important; }
.restriction-modal-2 { background: #f9a825 !important; color: #1a1a2e !important; }

/* === Last Updated === */
.last-updated {
  text-align: right;
  margin-top: 18px;
  font-size: 0.7rem;
  color: var(--text-sub);
  opacity: 0.75;
}

/* === Image Protection === */
.card-grid img,
.modal-content img,
.synergy-card img,
.variant-card img {
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.eval-heading {
  display: inline-block;
  margin-top: 0.6rem;
}

.detail-text .eval-heading:first-of-type {
  margin-top: 0;
}

.card-ref {
  color: #7ab8ff;
}

/* === Card Ref Tooltip === */
.card-ref-tooltip {
  position: fixed;
  z-index: 10001;
  display: none;
  filter: saturate(0.8);
}
.card-ref-tooltip img {
  width: 120px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  display: block;
}
/* PC: no pointer-events so hover doesn't flicker */
@media (hover: hover) {
  .card-ref-tooltip {
    pointer-events: none;
  }
}
/* Mobile: bubble style with arrow */
@media (hover: none) {
  .card-ref-tooltip {
    pointer-events: auto;
  }
  .card-ref-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
  }
  .card-ref-tooltip.arrow-bottom::after {
    top: 100%;
    border-top-color: rgba(0, 0, 0, 0.5);
  }
  .card-ref-tooltip.arrow-top::after {
    bottom: 100%;
    border-bottom-color: rgba(0, 0, 0, 0.5);
  }
}

/* === Responsive: モーダル 2カラム→1カラム === */
@media (max-width: 900px) {
  .modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  /* 左カラムを解体し、order で「画像/メタ → 評価コンテンツ → 別イラスト」の順に並べ替える */
  .modal-left {
    display: contents;
  }

  .modal-left-top {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: start;
    position: sticky;
    top: 60px;
    z-index: 3;
    background: rgba(24, 30, 58, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding-bottom: 8px;
  }

  .modal-right {
    order: 2;
  }

  .variants-block {
    order: 3;
    margin-top: 0;
  }

  .meta-grid {
    margin-top: 0;
  }

  /* 名前行は画像の上（モーダル冒頭）のSP用コピーに切り替える */
  .sp-name-row {
    display: flex;
  }

  .pc-name-row {
    display: none;
  }

  /* 能力原文はインライン表示をやめ、メタグリッド下のボタン→ポップアップに切替 */
  .modal-body .ability-box {
    display: none;
  }

  .ability-popup-btn {
    display: block;
  }

  .analysis-cols {
    grid-template-columns: 1fr;
  }
}

/* === Responsive === */
@media (max-width: 640px) {
  .controls {
    top: 100px;
    padding: 10px 12px 0;
  }

  .controls-panel {
    padding: 10px 12px;
    gap: 8px;
  }

  .controls-row {
    width: 100%;
  }

  .search-box {
    max-width: none;
  }

  .search-input {
    width: 100%;
    flex: 1;
    min-width: 0;
  }

  /* SP filter toggle button */
  .sp-filter-toggle {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #a8ccff;
    padding: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
  }

  .sp-filter-toggle:hover {
    border-color: rgba(122, 184, 255, 0.45);
  }

  /* SP filter panel collapse */
  .filter-panel.sp-collapsed {
    display: none;
  }

  /* SP filter panel: flex so color + type sit on one line */
  .filter-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .filter-panel-row,
  .trait-filter-row,
  .pack-filter-row {
    width: 100%;
  }

  .filter-panel-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Sort buttons: shrink font on SP */
  .sort-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }

  .sort-label {
    font-size: 0.78rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 9px;
  }

  .section {
    padding: 26px 12px 0;
  }

  .section-head h2 {
    font-size: 1.1rem;
  }

  .modal-top-bar {
    border-radius: 0;
  }

  .modal-body {
    padding: 16px;
    gap: 16px;
  }

  .modal-left-top {
    grid-template-columns: 140px 1fr;
    gap: 10px;
  }

  .detail-name {
    font-size: 1.15rem;
  }

  .name-color-dot {
    width: 14px;
    height: 14px;
  }

  .trait-filter-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.72rem;
  }

  .pack-filter-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.72rem;
  }

  .pack-category-label {
    font-size: 0.65rem;
  }

  .level-filter-btn {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .restriction-badge {
    width: 22px;
    height: 22px;
  }

  .newness-badge {
    padding: 1px 4px;
    font-size: 0.5rem;
  }
}
/* ===================================================
   tactics.css - 戦術ガイド系共通スタイル
   （サイト共通ナビゲーションは layout.css）
   =================================================== */

/* === Content wrapper === */
.tactics-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* === Color Tabs === */
.tactics-color-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tactics-color-btn {
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
  opacity: 0.45;
  position: relative;
}

.tactics-color-btn:hover {
  opacity: 0.75;
}

.tactics-color-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.tactics-color-btn.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.85);
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.tactics-color-btn[data-color="全"] { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.tactics-color-btn[data-color="赤"] { background: var(--c-red); color: #fff; }
.tactics-color-btn[data-color="青"] { background: var(--c-blue); color: #fff; }
.tactics-color-btn[data-color="緑"] { background: var(--c-green); color: #fff; }
.tactics-color-btn[data-color="白"] { background: var(--c-white); color: #1a1a2e; }
.tactics-color-btn[data-color="黄"] { background: var(--c-yellow); color: #1a1a2e; }
.tactics-color-btn[data-color="黒"] { background: var(--c-black); color: #fff; }
.tactics-color-btn[data-color="混色"] { background: linear-gradient(135deg, var(--c-blue), var(--c-red), var(--c-yellow)); color: #fff; }

.tactics-color-count {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 0.25rem;
}

/* === Combo detail page: back link + title === */
.tactics-detail-nav {
  text-align: center;
  margin-bottom: 0.75rem;
}

.tactics-back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.tactics-back-link:hover {
  opacity: 0.8;
}

.tactics-detail-title {
  color: var(--text);
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
}

/* === Effect type badges (shared across tactics pages) === */
.combo-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-removal { background: rgba(198, 40, 40, 0.25); border: 1px solid rgba(198, 40, 40, 0.6); color: #ff8a80; }
.badge-board { background: rgba(46, 125, 50, 0.25); border: 1px solid rgba(46, 125, 50, 0.6); color: #7bd68a; }
.badge-search { background: rgba(21, 101, 192, 0.25); border: 1px solid rgba(21, 101, 192, 0.6); color: #7ab8ff; }
.badge-sleep { background: rgba(106, 27, 154, 0.25); border: 1px solid rgba(106, 27, 154, 0.7); color: #ce93d8; }
.badge-stun { background: rgba(106, 27, 154, 0.25); border: 1px solid rgba(106, 27, 154, 0.7); color: #ce93d8; }
.badge-assault { background: rgba(230, 81, 0, 0.25); border: 1px solid rgba(230, 81, 0, 0.6); color: #ffab73; }
.badge-draw { background: rgba(25, 118, 210, 0.25); border: 1px solid rgba(25, 118, 210, 0.6); color: #90caf9; }

/* === Responsive === */
@media (max-width: 640px) {
  .tactics-content {
    padding: 1rem 0.5rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .tactics-color-tabs {
    gap: 4px;
  }

  .tactics-color-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
  }

  .tactics-color-count {
    font-size: 0.6rem;
  }

  .tactics-detail-title {
    font-size: 1.1rem;
  }

  .tactics-detail-nav {
    margin-bottom: 0.5rem;
  }

  .tactics-back-link {
    font-size: 0.8rem;
  }
}
/* ===================================================
   build_guides.css - 構築ガイド固有スタイル
   共通スタイル（.site-page-tab, .tactics-color-btn, .combo-badge 等）は tactics.css から再利用
   =================================================== */

/* === 一覧ヘッダー === */
.build-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.build-list-header h2 {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* === 扇グリッド一覧 === */
.bg-fan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.bg-fan-card {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-solid, #1b2547);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  aspect-ratio: 3 / 4;
  text-decoration: none;
  display: block;
  color: inherit;
}

.bg-fan-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--deck-c1, var(--accent-soft));
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    var(--deck-shadow-hover, 0 0 28px rgba(233, 69, 96, 0.45));
}

/* カラーストライプ（上部4px） */
.bg-fan-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--stripe-color, var(--accent));
  z-index: 5;
}

/* 扇コンテナ */
.bg-fan {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 65%;
  aspect-ratio: 143 / 200;
}

.bg-fan img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  filter: saturate(0.8);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.bg-fan img:nth-child(1) { transform: rotate(-10deg) translateX(-15%); z-index: 1; box-shadow: -3px 2px 10px rgba(0,0,0,0.5); }
.bg-fan img:nth-child(2) { transform: rotate(0deg); z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.bg-fan img:nth-child(3) { transform: rotate(10deg) translateX(15%); z-index: 3; box-shadow: 3px 2px 10px rgba(0,0,0,0.5); }

/* 下部オーバーレイ */
.bg-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(8, 8, 20, 0.6) 30%, rgba(8, 8, 20, 0.95));
  padding: 30px 10px 10px;
  z-index: 4;
}

.bg-axis-name {
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.bg-badge-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
}

/* カラードット */
.bg-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* 戦略バッジ */
.bg-strategy-pill {
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.bg-strategy-pill.aggro { background: rgba(230, 81, 0, 0.25); border: 1px solid rgba(230, 81, 0, 0.6); color: #ffab73; }
.bg-strategy-pill.oneshot { background: rgba(198, 40, 40, 0.25); border: 1px solid rgba(198, 40, 40, 0.6); color: #ff8a80; }
.bg-strategy-pill.control { background: rgba(21, 101, 192, 0.25); border: 1px solid rgba(21, 101, 192, 0.6); color: #7ab8ff; }

/* === 共通バッジ（詳細ページでも使用） === */
.build-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
}
.build-strategy-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: #fff;
}
.build-partner-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: #fff;
  background: #555;
}

/* === 詳細ページ === */
.detail-page { padding-bottom: 3rem; }
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ヒーローヘッダー（デッキ色ストライプ＋グロー。ERBが .detail-page に --deck-c1/c2/glow を注入） */
.detail-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 44, 84, 0.65), rgba(26, 38, 71, 0.42));
}
.detail-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--deck-c1, var(--accent)), var(--deck-c2, var(--accent)) 45%, transparent 95%);
}
.detail-header::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  height: 140%;
  background: radial-gradient(closest-side, var(--deck-glow, rgba(233, 69, 96, 0.12)), transparent);
  pointer-events: none;
}
.detail-header-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.detail-axis-name { font-size: 1.6rem; font-weight: 900; color: var(--text); letter-spacing: 0.03em; }
.detail-summary {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.7;
  max-width: 700px;
}

/* Quick Stats (hero内) */
.detail-quick-stats {
  position: relative; z-index: 1;
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.detail-quick-stat { font-size: 0.75rem; color: var(--text-sub); }
.detail-quick-stat strong { color: var(--text); }

/* キーカード 2列グリッド */
.key-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.key-card {
  display: flex; gap: 0.6rem;
  background: rgba(13, 27, 62, 0.5); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.5rem; align-items: flex-start;
}
.key-card img {
  width: 72px; flex-shrink: 0; border-radius: 4px;
  border: 1px solid var(--line-strong); filter: saturate(0.8);
}
.key-card-body { flex: 1; min-width: 0; }
.key-card-name { font-size: 0.78rem; font-weight: 900; margin-bottom: 0.1rem; color: var(--text); }
.key-card-id { font-size: 0.62rem; color: var(--text-sub); margin-bottom: 0.3rem; }
.key-card-reason { font-size: 0.72rem; color: var(--text-sub); line-height: 1.5; }

/* おすすめカード（レシピ内簡易版） */
.deck-recommend-label {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.5rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line-strong);
}
.deck-recommend-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px; margin-bottom: 1.25rem;
}
.deck-recommend-card {
  text-align: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.3rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.deck-recommend-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.deck-recommend-card.selected {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 8px 20px rgba(233, 69, 96, 0.35);
}
.deck-recommend-card img {
  width: 100%; border-radius: 3px; border: 1px solid var(--line-strong);
  display: block; filter: saturate(0.8);
}
.deck-recommend-card-name { font-size: 0.6rem; font-weight: bold; margin-top: 0.2rem; line-height: 1.2; color: var(--text); }

/* おすすめカード理由パネル */
.recommend-detail-panel {
  margin-top: 0; margin-bottom: 1.25rem;
  padding: 14px 16px;
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
}
.recommend-detail-name {
  font-weight: 700; font-size: 0.95rem;
}
.recommend-detail-desc {
  font-size: 0.82rem; line-height: 1.7;
  margin: 8px 0 0 0; color: #c9cede;
}

/* 2列レイアウト汎用 */
.two-col-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.two-col-row > .detail-section { margin-bottom: 0; }

.detail-page .detail-section {
  margin-bottom: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.detail-section-title {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 900;
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Board (Large - detail) */
.detail-board {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
  background: radial-gradient(70% 100% at 50% 0%, var(--deck-glow, rgba(233, 69, 96, 0.08)), transparent 72%), rgba(13, 27, 62, 0.5);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  min-height: 240px;
}
.detail-board-slot { width: 120px; text-align: center; flex-shrink: 0; }
.detail-board-slot img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  display: block;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}
.detail-board-slot.is-sleep img {
  transform: rotate(-90deg);
  margin: calc((120px * 1.4 - 120px) / 2) 0;
}
.detail-board-slot.is-stun img {
  transform: rotate(180deg);
}
.detail-board-slot.is-empty {
  width: 120px;
  height: 168px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  opacity: 0.3;
}
.detail-board-name { font-size: 0.75rem; color: var(--text-sub); margin-top: 4px; }
.detail-board-info { font-size: 0.7rem; color: var(--text-sub); opacity: 0.8; }
.detail-board-ap { font-size: 0.78rem; color: #7ab8ff; font-weight: bold; }
.detail-board-state { font-size: 0.65rem; color: var(--c-yellow); }

/* Combo Input Cards */
.combo-input-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(13, 27, 62, 0.5);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.combo-input-card { text-align: center; width: 100px; }
.combo-input-card img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
}
.combo-input-name { font-size: 0.7rem; color: var(--text-sub); margin-top: 3px; }
.combo-input-role { font-size: 0.6rem; color: var(--text-sub); opacity: 0.8; }
.build-combo-arrow { color: var(--text-sub); font-size: 1.5rem; }
.combo-transform-label {
  font-size: 0.55rem;
  color: #ff9fb0;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid var(--accent-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-top: 2px;
  display: inline-block;
}

/* Step Slider */
.step-slider {
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}
.step-slide {
  grid-row: 1; grid-column: 1;
  padding: 1.25rem;
  visibility: hidden;
}
.step-slide.is-active { visibility: visible; }

.step-slide-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.step-number {
  background: linear-gradient(135deg, var(--accent), #c2334d);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: bold; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.35);
}
.step-file {
  font-size: 0.7rem;
  color: #7ab8ff;
  font-weight: bold;
  background: rgba(122, 184, 255, 0.12);
  border: 1px solid rgba(122, 184, 255, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.step-badges { display: flex; gap: 0.3rem; margin-left: auto; }
.step-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: #fff;
}

/* Board snapshot (step) */
.step-board {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  min-height: 180px;
}
.step-board-slot {
  max-width: 105px;
  flex: 1;
  min-width: 0;
  text-align: center;
  position: relative;
}
.step-board-slot img {
  width: 100%;
  border-radius: 4px;
  border: 2px solid var(--line-strong);
  display: block;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step-board-slot.is-sleep img {
  transform: rotate(90deg);
}
.step-board-slot.is-stun img {
  transform: rotate(180deg);
}
.step-board-slot.is-empty {
  max-width: 105px;
  flex: 1;
  min-width: 0;
  aspect-ratio: 5 / 7;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  opacity: 0.2;
}
.step-board-slot.is-actor img { border-color: var(--accent); box-shadow: 0 0 14px rgba(233, 69, 96, 0.8); }
.step-board-slot.is-changed img { border-color: #4fc3f7; box-shadow: 0 0 6px rgba(79, 195, 247, 0.5); }
.step-board-name {
  font-size: 0.65rem;
  color: var(--text-sub);
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-board-slot.is-actor .step-board-name { color: #ff9fb0; font-weight: bold; }
.step-board-slot.is-changed .step-board-name { color: #4fc3f7; font-weight: bold; }

/* Non-actor dimming */
.step-board-slot:not(.is-actor):not(.is-changed) img { opacity: 0.35; }

/* Guard icon (shield) */
.step-board-slot.is-guard::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M12 1L2 6v7c0 7 4.3 13.5 10 15 5.7-1.5 10-8 10-15V6L12 1z' fill='%234fc3f7' fill-opacity='0.85' stroke='%23fff' stroke-width='1.5' stroke-opacity='0.5'/%3E%3Cpath d='M10 18l-3-3 1.5-1.5L10 15l5.5-5.5L17 11l-7 7z' fill='%23fff' fill-opacity='0.9'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(79, 195, 247, 0.7));
  z-index: 3;
  pointer-events: none;
}

/* Set card support in step board (card peeks above main card) */
.step-board:has(.has-set-card) {
  padding-top: 2rem;
}
.step-board-slot.has-set-card > img {
  position: relative;
  z-index: 10;
}
.step-board-slot.has-set-card .step-board-name { display: none; }
.step-board-set-card {
  position: absolute;
  top: -12%;
  left: 2%;
  right: 2%;
  z-index: 3;
  pointer-events: none;
}
.step-board-set-img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.6);
  filter: saturate(0.8);
}
/* Prevent set card from inheriting sleep rotation/margin */
.step-board-slot.is-sleep .step-board-set-card img {
  transform: none;
  margin: 0;
}

/* Step description */
.step-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.7;
}

/* Navigation bar */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.step-nav-btn {
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid var(--accent-soft);
  color: #ff9fb0;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  min-width: 80px;
}
.step-nav-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-nav-btn:disabled { opacity: 0.3; cursor: default; }
.step-nav-indicator {
  font-size: 0.82rem;
  color: var(--text-sub);
  min-width: 60px;
  text-align: center;
}
.step-nav-indicator strong { color: var(--text); }

/* Traits (Strengths / Weaknesses) */
.traits-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.traits-col-header {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: bold; margin-bottom: 0.6rem; padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line-strong);
}
.traits-col-header.is-strength { color: #7bd68a; border-bottom-color: rgba(46, 125, 50, 0.53); }
.traits-col-header.is-weakness { color: #ff8a80; border-bottom-color: rgba(198, 40, 40, 0.53); }
.traits-col-header svg { width: 16px; height: 16px; flex-shrink: 0; }
.trait-item { margin-bottom: 0.6rem; }
.trait-item:last-child { margin-bottom: 0; }
.trait-title {
  font-size: 0.82rem; font-weight: bold; color: var(--text);
  display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.15rem;
}
.trait-title::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.is-strength .trait-title::before { background: #7bd68a; }
.is-weakness .trait-title::before { background: #ff8a80; }
.trait-title a.matchup-title-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line-strong);
}
.trait-title a.matchup-title-link:hover { text-decoration-color: currentColor; }
.trait-desc { font-size: 0.78rem; color: var(--text-sub); line-height: 1.55; padding-left: 0.95rem; }

/* Matchup Section */
.matchup-list { display: flex; flex-direction: column; gap: 0.6rem; }
.matchup-item {
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  border-left: 3px solid rgba(198, 40, 40, 0.7);
}
.matchup-header {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem;
}
.matchup-name { font-size: 0.88rem; font-weight: bold; color: var(--text); }
.matchup-severity {
  font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.5rem; border-radius: 999px; margin-left: auto;
}
.matchup-severity.hard { background: rgba(198, 40, 40, 0.25); border: 1px solid rgba(198, 40, 40, 0.6); color: #ff8a80; }
.matchup-severity.even { background: rgba(230, 81, 0, 0.25); border: 1px solid rgba(230, 81, 0, 0.6); color: #ffab73; }
.matchup-reason { font-size: 0.8rem; color: var(--text-sub); line-height: 1.6; margin-bottom: 0.3rem; }
.matchup-tip { font-size: 0.78rem; color: #7ab8ff; line-height: 1.5; }
.matchup-tip::before { content: "\2192  "; }

/* Deck Skeleton */
.deck-skeleton { display: flex; flex-direction: column; gap: 0.75rem; }
.deck-group {
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}
.deck-card-list { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.deck-card {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
}
.deck-card-img { flex-shrink: 0; }
.deck-card-img img { width: 100%; border-radius: 3px; border: 1px solid var(--line-strong); }
.deck-card-info { display: flex; flex-direction: column; align-items: center; margin-top: 0.3rem; }
.deck-card-name { font-size: 0.65rem; font-weight: bold; color: var(--text); text-align: center; line-height: 1.3; }
.deck-card-meta { font-size: 0.6rem; color: var(--text-sub); margin-top: 0.15rem; }

/* Case Card Section */
.case-cards-list { display: flex; flex-direction: column; gap: 0.75rem; }
.case-card-item {
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.case-card-img { width: 72px; flex-shrink: 0; }
.case-card-img img { width: 100%; border-radius: 4px; border: 1px solid var(--line-strong); display: block; }
.case-card-body { flex: 1; }
.case-card-name { font-size: 0.85rem; font-weight: bold; color: var(--text); margin-bottom: 0.3rem; }
.case-card-reason {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.6;
}

/* Deck Recipe Grid (40 cards) */
.deck-grid-40 { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.deck-grid-40 img {
  width: 100%; aspect-ratio: 5 / 7; object-fit: cover;
  border-radius: 3px; border: 1px solid var(--line-strong);
  filter: saturate(0.8); transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.deck-grid-40 img:hover {
  transform: scale(1.08); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 2; position: relative;
}

/* Case card note (inside deck recipe) */
.deck-case-note { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; padding: 0.75rem 1rem; background: rgba(13, 27, 62, 0.5); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.deck-case-note img { width: 56px; border-radius: 4px; border: 1px solid var(--line-strong); flex-shrink: 0; filter: saturate(0.8); }
.deck-case-note-text { font-size: 0.8rem; color: var(--text-sub); line-height: 1.5; }
.deck-case-note-text strong { color: var(--text); }

/* Deck recipe note */
.deck-recipe-note { font-size: 0.75rem; color: var(--text-sub); margin-bottom: 1rem; line-height: 1.5; }

/* Alt Cards (おすすめカード) */
.alt-category { margin-bottom: 1.5rem; }
.alt-category-header {
  font-size: 0.95rem; font-weight: bold; color: var(--text);
  margin-bottom: 0.5rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line-strong);
}
.alt-category-desc {
  font-size: 0.8rem; color: var(--text-sub); margin-bottom: 0.75rem; line-height: 1.5;
}
.alt-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem;
}
.alt-card-item {
  display: flex; gap: 0.75rem;
  background: rgba(13, 27, 62, 0.5); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem;
  transition: border-color 0.25s var(--ease);
}
.alt-card-item:hover { border-color: var(--accent-soft); }
.alt-card-img { width: 70px; flex-shrink: 0; }
.alt-card-img img { width: 100%; border-radius: 4px; }
.alt-card-info { flex: 1; }
.alt-card-name { font-size: 0.82rem; font-weight: bold; color: var(--text); margin-bottom: 0.2rem; }
.alt-card-meta { font-size: 0.7rem; color: var(--text-sub); margin-bottom: 0.35rem; }
.alt-card-reason { font-size: 0.78rem; color: var(--text-sub); line-height: 1.5; }

/* Mulligan Priority */
.mulligan-howto {
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.mulligan-howto-intro { font-size: 0.8rem; color: var(--text-sub); line-height: 1.6; margin: 0 0 0.5rem; }
.mulligan-howto-list { margin: 0; padding-left: 1.2rem; }
.mulligan-howto-list li { font-size: 0.8rem; color: var(--text-sub); line-height: 1.6; margin-bottom: 0.25rem; }
.mulligan-howto-list li:last-child { margin-bottom: 0; }
.mulligan-howto-list strong { color: var(--text); }
.mulligan-groups { display: flex; flex-direction: column; gap: 0.75rem; }
.mulligan-group {
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.mulligan-group-header {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem;
}
.mulligan-rank {
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.6rem; border-radius: 999px;
}
.mulligan-rank.rank-high { background: rgba(233, 69, 96, 0.25); border: 1px solid rgba(233, 69, 96, 0.6); color: #ff9fb0; }
.mulligan-rank.rank-mid { background: rgba(230, 81, 0, 0.25); border: 1px solid rgba(230, 81, 0, 0.6); color: #ffab73; }
.mulligan-rank.rank-low { background: rgba(21, 101, 192, 0.25); border: 1px solid rgba(21, 101, 192, 0.6); color: #7ab8ff; }
.mulligan-group-label { font-size: 0.82rem; font-weight: bold; color: var(--text); }
.mulligan-cards {
  display: flex; gap: 12px; margin-bottom: 0.6rem; flex-wrap: wrap;
}
.mulligan-card { width: 72px; text-align: center; flex-shrink: 0; }
.mulligan-card img {
  width: 100%; border-radius: 4px; border: 1px solid var(--line-strong); display: block;
}
.mulligan-card-name {
  font-size: 0.62rem; color: var(--text-sub); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mulligan-group-reason { font-size: 0.8rem; color: var(--text-sub); line-height: 1.5; }
.mulligan-note {
  font-size: 0.8rem; color: var(--text-sub); line-height: 1.6;
  margin-top: 0.75rem; padding: 0.6rem 0.75rem;
  border-left: 2px solid var(--line-strong);
}

/* Win Path (試合の流れ) */
.win-path {
  background: rgba(13, 27, 62, 0.5); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1.25rem;
}
.win-path-title { font-size: 0.95rem; font-weight: 900; color: #ff9fb0; margin-bottom: 0.75rem; }
.win-path-phases { display: flex; flex-direction: column; gap: 0.75rem; }
.win-path-phase { display: flex; gap: 0.75rem; align-items: flex-start; }
.win-path-label {
  background: linear-gradient(135deg, var(--accent), #c2334d); color: #fff; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0; min-width: 64px; text-align: center;
}
.win-path-desc { font-size: 0.85rem; color: var(--text-sub); line-height: 1.5; }

/* Tips */
.tips-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.tip-card {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: rgba(13, 27, 62, 0.5); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  transition: border-color 0.25s var(--ease);
}
.tip-card:hover { border-color: rgba(79, 195, 247, 0.5); }
.tip-num {
  background: #4fc3f7; color: #1a1a2e;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: bold; flex-shrink: 0; margin-top: 0.1rem;
}
.tip-body { flex: 1; }
.tip-heading { font-size: 0.85rem; font-weight: bold; color: var(--text); margin-bottom: 0.15rem; }
.tip-desc { font-size: 0.78rem; color: var(--text-sub); line-height: 1.55; }

/* === Responsive (640px) === */
@media (max-width: 640px) {
  /* 一覧グリッド: SP 3列 + 常時うっすらグロー */
  .bg-fan-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .bg-fan-card {
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.3),
      var(--deck-shadow-sp, 0 0 20px rgba(207, 216, 220, 0.15));
  }

  /* 一覧ヘッダー */
  .build-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  /* 詳細ヘッダー */
  .detail-header { margin-bottom: 1.5rem; padding: 1rem; }
  .detail-header-top { flex-wrap: wrap; row-gap: 0.4rem; }
  .detail-axis-name { font-size: 1.3rem; }
  .detail-summary { font-size: 0.85rem; margin-top: 0.5rem; }
  .detail-quick-stats { gap: 0.5rem; }

  /* キーカード */
  .key-grid { grid-template-columns: 1fr; }

  /* 2列レイアウト */
  .two-col-row { grid-template-columns: 1fr; }

  /* セクション間の余白（パネル化は基本スタイル側で適用済み） */
  .detail-page .detail-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  .detail-section-title { font-size: 1.05rem; margin-bottom: 1rem; }

  /* Traits */
  .traits-columns { grid-template-columns: 1fr; gap: 0.75rem; }
  .trait-desc { font-size: 0.75rem; }

  /* コンボ入力カード */
  .combo-input-cards { flex-wrap: wrap; gap: 0.6rem; padding: 0.85rem; }
  .combo-input-card { width: 70px; }
  .build-combo-arrow { font-size: 1.2rem; }

  /* ステップスライダー */
  .step-slide { padding: 1rem 0.85rem; }
  .step-slide-header { margin-bottom: 0.85rem; }
  .step-board { gap: 4px; padding: 0.75rem 0.25rem; min-height: 120px; overflow-x: auto; }
  .step-board:has(.has-set-card) { padding-top: 1.5rem; }
  .step-board-slot.is-stun img { transform: rotate(180deg); }
  .step-board-name { font-size: 0.55rem; }
  .step-desc { font-size: 0.82rem; margin-top: 0.15rem; }
  .step-nav { padding: 0.65rem 0.85rem; gap: 0.75rem; }
  .step-nav-btn { padding: 0.4rem 0.75rem; font-size: 0.78rem; min-width: 68px; }

  /* 詳細ボード */
  .detail-board { gap: 6px; padding: 1rem 0.5rem; min-height: 160px; overflow-x: auto; }
  .detail-board-slot { width: 60px; }
  .detail-board-slot.is-sleep img { transform: rotate(-90deg) scale(0.72); margin: 0; }
  .detail-board-slot.is-stun img { transform: rotate(180deg); }
  .detail-board-slot.is-empty { width: 60px; height: 84px; }
  .detail-board-name { font-size: 0.6rem; margin-top: 4px; }

  /* デッキの骨格 */
  .deck-card-list { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .deck-card { padding: 0.3rem; }
  .deck-card-name { font-size: 0.6rem; }

  /* 事件カード */
  .case-card-item { padding: 0.75rem; }
  .case-card-img { width: 58px; }
  .case-card-reason { font-size: 0.78rem; }

  /* デッキレシピ SP: 8列 */
  .deck-grid-40 { grid-template-columns: repeat(8, 1fr); }

  /* 苦手な対面 */
  .matchup-item { padding: 0.75rem; }
  .matchup-reason { font-size: 0.78rem; }
  .matchup-tip { font-size: 0.75rem; }

  /* おすすめカード */
  .alt-category { margin-bottom: 1.75rem; }
  .alt-category-header { margin-bottom: 0.5rem; }
  .alt-category-desc { margin-bottom: 0.75rem; }
  .alt-cards-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .alt-card-item { padding: 0.75rem; }
  .alt-card-img { width: 60px; }
  .alt-card-reason { font-size: 0.75rem; }

  /* マリガン */
  .mulligan-group { padding: 0.75rem; }
  .mulligan-group-header { margin-bottom: 0.5rem; }
  .mulligan-card { width: 58px; }
  .mulligan-cards { gap: 10px; margin-bottom: 0.5rem; }
  .mulligan-group-reason { font-size: 0.78rem; }
  .mulligan-note { font-size: 0.75rem; margin-top: 0.75rem; }

  /* 勝ち方 */
  .win-path { padding: 1rem; }
  .win-path-phase { flex-direction: column; gap: 0.35rem; }
  .win-path-phase + .win-path-phase { margin-top: 0.25rem; }
  .win-path-desc { font-size: 0.82rem; }

  /* コツ */
  .tip-card { padding: 0.75rem 0.85rem; gap: 0.6rem; }
  .tip-num { width: 22px; height: 22px; font-size: 0.68rem; }
  .tip-heading { font-size: 0.82rem; }
  .tip-desc { font-size: 0.75rem; }
}
/* ===================================
 * glossary.css - 用語辞典ページ
 * =================================== */

/* 66語の縦長ページでは長距離smoothスクロールが遅く酔いやすいため、
 * 本ページのみ即時ジャンプにする（深スクロール描画不具合の回避も兼ねる） */
html:has(.glossary-page) {
  scroll-behavior: auto;
}

.glossary-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.glossary-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.glossary-lead {
  color: var(--text-sub);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.glossary-lead a {
  color: #7ab8ff;
}

/* === 検索＋カテゴリチップ（sticky） === */
.glossary-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  padding: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #181e3a;
}

.glossary-search {
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: none;
}

.glossary-search:focus {
  border-color: var(--accent-soft);
  background: rgba(255, 255, 255, 0.08);
}

.glossary-chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.glossary-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.glossary-chip:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

.glossary-cat-chip.active {
  background: rgba(122, 184, 255, 0.14);
  border-color: rgba(122, 184, 255, 0.45);
  color: #a8ccff;
}

.glossary-kana-chips {
  margin-top: 8px;
}

.glossary-kana-chip {
  padding: 0.25rem 0.7rem;
}

.glossary-chip-count {
  font-size: 0.68rem;
  color: var(--text-sub);
  opacity: 0.8;
}

/* === カテゴリセクション === */
.glossary-section {
  margin-bottom: 28px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--header-h) + 120px);
}

.glossary-section-title {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.glossary-section-desc {
  color: var(--text-sub);
  font-size: 0.78rem;
  margin-bottom: 14px;
}

.glossary-list {
  margin: 0;
}

.glossary-term {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 120px);
}

.glossary-term:target {
  animation: glossary-highlight 2s var(--ease);
}

@keyframes glossary-highlight {
  0%, 40% { background: rgba(233, 69, 96, 0.12); }
  100% { background: transparent; }
}

.glossary-term-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.glossary-term-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0.12rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 400;
  border-radius: 999px;
  vertical-align: 2px;
}

.badge-basics {
  background: rgba(21, 101, 192, 0.25);
  border: 1px solid rgba(21, 101, 192, 0.6);
  color: #7ab8ff;
}

.badge-keywords {
  background: rgba(46, 125, 50, 0.25);
  border: 1px solid rgba(46, 125, 50, 0.6);
  color: #7bd68a;
}

.badge-notation {
  background: rgba(106, 27, 154, 0.25);
  border: 1px solid rgba(106, 27, 154, 0.6);
  color: #ce93d8;
}

.badge-strategy {
  background: rgba(230, 81, 0, 0.25);
  border: 1px solid rgba(230, 81, 0, 0.6);
  color: #ffab73;
}

.glossary-term-sub {
  margin-left: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-sub);
}

.glossary-term-body {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text);
  opacity: 0.92;
}

/* === 図解（盤面レイアウト） === */
.glossary-board {
  display: grid;
  grid-template-areas:
    "case scene scene deck"
    "evidence partner partner remove"
    "evidence file file remove";
  gap: 5px;
  max-width: 340px;
  margin: 6px 0 12px;
  padding: 10px;
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.gboard-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 3px 4px;
  font-size: 0.62rem;
  color: var(--text-sub);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.gboard-case { grid-area: case; }
.gboard-scene { grid-area: scene; }
.gboard-deck { grid-area: deck; }
.gboard-evidence { grid-area: evidence; }
.gboard-partner { grid-area: partner; }
.gboard-remove { grid-area: remove; }
.gboard-file { grid-area: file; }

.gboard-active {
  background: rgba(233, 69, 96, 0.16);
  border-color: var(--accent-soft);
  color: #ff9fb0;
  font-weight: 700;
}

/* === 図解（カードの3状態） === */
.glossary-figure-states {
  display: flex;
  gap: 18px;
  margin: 6px 0 12px;
}

.gstate {
  margin: 0;
  text-align: center;
}

.gstate-cardbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  background: rgba(13, 27, 62, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.gstate-card-img {
  display: block;
  width: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  filter: saturate(0.8);
}

.gstate-card-sleep {
  transform: rotate(-90deg);
}

.gstate-card-stun {
  transform: rotate(180deg);
}

.gstate figcaption {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.gstate figcaption small {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-sub);
}

.glossary-related {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-sub);
}

.glossary-related-link {
  color: #7ab8ff;
  text-decoration: none;
  margin-right: 8px;
}

.glossary-related-link:hover {
  text-decoration: underline;
}

.glossary-empty {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 0;
}

/* === SP === */
@media (max-width: 640px) {
  .glossary-page {
    padding-top: 12px;
  }

  /* SPはヘッダーがブランド行+タブ行の2段になるため実高に合わせる（cards.css .controls と同じ補正値） */
  .glossary-nav {
    top: 100px;
  }

  .glossary-section {
    padding: 14px;
    scroll-margin-top: 250px;
  }

  .glossary-term {
    scroll-margin-top: 250px;
  }
}
/* === Contact Page === */
.contact-page {
  min-height: 80vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.contact-container {
  max-width: 600px;
  width: 100%;
}

.contact-title {
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
  text-align: center;
}

.contact-description {
  color: var(--text-sub);
  font-size: 0.88rem;
  text-align: center;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.contact-notice {
  background: rgba(46, 125, 50, 0.15);
  border: 1px solid rgba(46, 125, 50, 0.4);
  color: #a5d6a7;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.contact-errors {
  background: rgba(198, 40, 40, 0.15);
  border: 1px solid rgba(198, 40, 40, 0.5);
  color: #ffcdd2;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.contact-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.contact-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.form-label.required::after {
  content: " *";
  color: var(--accent);
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  box-sizing: border-box;
  font-family: inherit;
}

.form-input::placeholder {
  color: var(--text-sub);
  opacity: 0.7;
}

.form-input:focus {
  border-color: var(--accent-soft);
  background: rgba(255, 255, 255, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.form-submit {
  background: linear-gradient(135deg, #e94560, #c2334d);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 2.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 2px 10px rgba(233, 69, 96, 0.3);
}

.form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.45);
}

.contact-back {
  text-align: center;
  margin-top: 1.5rem;
}

.contact-back a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.contact-back a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .contact-page {
    padding: 1rem 0.75rem;
  }

  .contact-form {
    padding: 1rem;
  }
}
/* === Card Scanner === */

.card-scanner-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 38, 71, 0.9);
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}

.card-scanner-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.card-scanner-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Scanner Overlay */
.scanner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 3000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scanner-overlay.active {
  display: flex;
}

.scanner-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 65vh;
  width: calc(65vh * 5 / 7);
  max-width: 80vw;
  max-height: 80vh;
  border: 2px solid rgba(233, 69, 96, 0.8);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 1;
}

.scanner-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(233, 69, 96, 0.9);
  border-radius: 50%;
  z-index: 2;
}

.scanner-spinner.active {
  display: block;
  animation: scanner-spin 0.8s linear infinite;
}

@keyframes scanner-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.scanner-guide::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  pointer-events: none;
}

.scanner-status {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 2;
}

.scanner-sleeve-note {
  position: absolute;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  white-space: nowrap;
  z-index: 2;
}

.scanner-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  line-height: 1;
}

.scanner-close-btn:hover {
  background: rgba(233, 69, 96, 0.8);
}

/* Candidate Selection Screen */
.scanner-candidates {
  display: none;
  position: absolute;
  inset: 0;
  background: #0a0a14;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.scanner-candidates-header {
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  padding: 3.5rem 1rem 0.5rem;
  text-align: center;
}

.scanner-candidates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0.5rem 1rem;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.scanner-candidate {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s;
  min-width: 0;
}

.scanner-candidate:active {
  transform: scale(0.95);
}

.scanner-candidate img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  filter: saturate(0.8);
}

.scanner-candidate:hover img {
  border-color: var(--accent);
}

.scanner-candidate span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  margin-top: 4px;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.scanner-candidates-actions {
  display: flex;
  gap: 12px;
  padding: 1rem 1rem 2rem;
  justify-content: center;
}

.scanner-action-btn {
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.scanner-action-retry {
  background: rgba(233, 69, 96, 0.8);
  color: #fff;
}

.scanner-action-retry:hover {
  background: #e94560;
}

.scanner-action-close {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.scanner-action-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.scanner-candidates-note {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
  padding: 0 1rem 0.5rem;
  text-align: center;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .scanner-guide {
    height: 60vh;
    width: calc(60vh * 5 / 7);
  }
}
/*
 * application.css - サイト全体のCSSバンドル
 *
 * カスケード順を制御するため require_tree ではなく明示 require を使用する。
 * 順序: トークン → ベース → シェル → 共通コンポーネント → ページ別
 *











 */
