/* ========================================================
   card-detail.css — 静的カード詳細ページ専用スタイル
   ======================================================== */

:root {
  --cd-bg:       #0f1117;
  --cd-surface:  #1a1d27;
  --cd-border:   #2a2d3a;
  --cd-text:     #e0e4ef;
  --cd-muted:    #7a7f99;
  --cd-accent:   #5b8af5;
  --cd-accent-h: #7ba4ff;
  --cd-rarity-lr:   #d4af37;
  --cd-rarity-lrp:  #e8c76d;
  --cd-rarity-lrpp: #f0e0a0;
  --cd-cta-bg:   #5b8af5;
  --cd-cta-text: #fff;
}

html[data-theme="light"] {
  --cd-bg:       #f7f2e8;
  --cd-surface:  #ffffff;
  --cd-border:   #cfc5aa;
  --cd-text:     #1c1710;
  --cd-muted:    #7a6e5a;
  --cd-accent:   #b8902e;
  --cd-accent-h: #a07828;
  --cd-cta-bg:   #b8902e;
  --cd-cta-text: #fff;
}

html[data-theme="light"] {
  background: #ede7d8;
}

html[data-theme="light"] body {
  background: linear-gradient(180deg, #e8edff 0%, #f5f0e8 22%, #f7f2e8 100%) fixed;
}

html[data-theme="light"] .cd-header {
  background: rgba(247, 242, 232, 0.97);
  border-bottom-color: rgba(184, 144, 46, 0.30);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cd-bg);
  color: var(--cd-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 68px;
}

a { color: var(--cd-accent); text-decoration: none; }
a:hover { color: var(--cd-accent-h); text-decoration: underline; }

/* ---- Header ---- */
.cd-header {
  background: var(--cd-surface);
  border-bottom: 1px solid var(--cd-border);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cd-logo-wrap { display: flex; align-items: baseline; gap: 12px; min-width: 0; overflow: hidden; }

.cd-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9a55a;
  white-space: nowrap;
  flex-shrink: 0;
}
.cd-logo:hover { text-decoration: none; color: #dab96d; }

.cd-subtitle {
  font-size: 11px;
  color: var(--cd-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

html[data-theme="light"] .cd-logo { color: #7a5814; }

/* ---- SPA ナビヘッダー ---- */
.cd-nav-row { display: none; width: 100%; align-items: center; }
html[data-spa-nav] .cd-logo-wrap { display: none; }
html[data-spa-nav] .cd-nav-row { display: flex; }

.cd-back-btn,
.cd-close-btn {
  background: none;
  border: 1px solid var(--cd-border);
  color: var(--cd-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.cd-back-btn:hover, .cd-close-btn:hover { color: var(--cd-text); border-color: var(--cd-accent); }
.cd-close-btn { text-decoration: none; }

.cd-nav-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--cd-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

/* ---- Main layout ---- */
.cd-main {
  display: flex;
  gap: 28px;
  max-width: 900px;
  margin: 28px auto;
  padding: 0 20px;
  flex: 1;
}

/* ---- Image column ---- */
.cd-image-col {
  flex-shrink: 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
  display: block;
}

/* ---- Variant nav ---- */
.cd-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cd-variants-label {
  font-size: 11px;
  color: var(--cd-muted);
  flex-shrink: 0;
}

.cd-variants a {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--cd-border);
  background: var(--cd-surface);
  color: var(--cd-muted);
  transition: border-color .15s, color .15s;
}
.cd-variants a:hover { border-color: var(--cd-accent); color: var(--cd-accent); text-decoration: none; }
.cd-variants a.active { border-color: var(--cd-accent); color: var(--cd-accent); background: rgba(91,138,245,.12); }

/* ---- Info column ---- */
.cd-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cd-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.cd-number {
  font-size: 13px;
  color: var(--cd-muted);
}

/* Rarity color */
.cd-rarity { font-weight: 600; }
.cd-rarity-LR   { color: var(--cd-rarity-lr); }
.cd-rarity-LRp  { color: var(--cd-rarity-lrp); }
.cd-rarity-LRpp { color: var(--cd-rarity-lrpp); }

/* ---- Stats table ---- */
.cd-stats {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.cd-stats th, .cd-stats td {
  padding: 6px 10px;
  border: 1px solid var(--cd-border);
  text-align: left;
}
.cd-stats th {
  background: var(--cd-surface);
  color: var(--cd-muted);
  font-weight: 500;
  white-space: nowrap;
  width: 80px;
}
.cd-stats td { background: var(--cd-bg); }

/* ---- Effect text ---- */
.cd-effect {
  font-size: 14px;
  line-height: 1.75;
  padding: 12px 14px;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: 6px;
}
/* キーワード効果の補足説明（紙のカードの小さめ印字に合わせる） */
.effect-reminder {
  font-size: 0.85em;
  color: var(--cd-muted);
}

/* ---- Meta ---- */
.cd-meta {
  font-size: 12px;
  color: var(--cd-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cd-meta p span { color: var(--cd-muted); opacity: .7; }

/* ---- CTA ---- */
.cd-cta-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: var(--cd-surface);
  border-top: 1px solid var(--cd-border);
  text-align: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,.15);
  z-index: 100;
}

.cd-cta {
  display: inline-block;
  background: var(--cd-cta-bg);
  color: var(--cd-cta-text);
  padding: 11px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s;
}
.cd-cta:hover { opacity: .85; text-decoration: none; color: var(--cd-cta-text); }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .cd-main {
    flex-direction: column;
    margin: 16px auto;
    gap: 16px;
  }

  .cd-image-col {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .cd-name { font-size: 18px; }

  .cd-logo-wrap { flex-direction: column; align-items: flex-start; gap: 1px; }
  .cd-logo { font-size: 13px; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; }
  .cd-subtitle { font-size: 9px; letter-spacing: 0.04em; }
}
