/* ============================================================
   デュエコンボ — 共通スタイルシート
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:        #f6f5f0;
  --c-surface:   #ffffff;
  --c-border:    #e0ddd5;
  --c-text:      #2c2c2c;
  --c-text-sub:  #6b6b6b;
  --c-accent:    #1a6dd4;
  --c-accent-hover: #1459b0;
  --c-badge:     #e63946;
  --c-badge-text:#fff;
  --c-header-bg: #1b1b2f;
  --c-header-text:#fff;
  --c-footer-bg: #1b1b2f;
  --c-footer-text:#9a9ab0;
  --c-cta:       #e63946;
  --c-cta-hover: #c5303c;
  --radius:      8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
  --font-body:   "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --max-w:       960px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--c-header-bg);
  color: var(--c-header-text);
  text-align: center;
  padding: 1.5rem 1rem 1.2rem;
}
.site-header .badge {
  display: inline-block;
  background: var(--c-badge);
  color: var(--c-badge-text);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .2em .7em;
  border-radius: 3px;
  margin-bottom: .5rem;
}
.site-header .site-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-header-text);
  text-decoration: none;
  letter-spacing: .02em;
  margin-bottom: .25rem;
}
.site-header .site-title:hover { opacity: .85; text-decoration: none; }
.site-header .tagline {
  font-size: .82rem;
  color: #b0b0c8;
  font-weight: 400;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--c-footer-bg);
  color: var(--c-footer-text);
  text-align: center;
  padding: 1.8rem 1rem;
  font-size: .8rem;
  margin-top: 3rem;
}
.site-footer div:first-child { font-weight: 700; margin-bottom: .4rem; color: #d0d0e0; }
.site-footer .footer-contact a { color: #8888cc; }

/* ============================================================
   Search Area (Home)
   ============================================================ */
.search-area {
  max-width: var(--max-w);
  margin: 1.8rem auto .8rem;
  padding: 0 1rem;
  position: relative;
}
.search-area .search-icon {
  position: absolute;
  left: 1.8rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}
.search-area input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.6rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--c-surface);
  transition: border-color .2s;
}
.search-area input:focus {
  outline: none;
  border-color: var(--c-accent);
}

/* ============================================================
   Results Info
   ============================================================ */
.results-info {
  max-width: var(--max-w);
  margin: 0 auto .6rem;
  padding: 0 1rem;
  font-size: .85rem;
  color: var(--c-text-sub);
}

/* ============================================================
   Card Grid (Home)
   ============================================================ */
.card-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
}

/* --- Tile --- */
.card-tile {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--c-text);
  transition: transform .18s, box-shadow .18s;
  animation: tileIn .4s ease both;
}
.card-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.card-tile.hidden { display: none; }

@keyframes tileIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tile-img-wrap {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #eee;
}
.tile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-name {
  padding: .5rem .6rem;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

/* --- No Results --- */
.no-results {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--c-text-sub);
  font-size: .9rem;
}
.no-results.visible { display: block; }

/* ============================================================
   Article Wrapper
   ============================================================ */
.article-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: .8rem;
  color: var(--c-text-sub);
  padding: 1rem 0 .6rem;
}
.breadcrumb a { color: var(--c-accent); }

/* --- Headings --- */
.article-wrapper h1 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  padding-bottom: .6rem;
  border-bottom: 3px solid var(--c-accent);
}
.article-wrapper h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  padding-left: .6rem;
  border-left: 4px solid var(--c-accent);
}
.article-wrapper h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1rem 0 .5rem;
}

/* ============================================================
   Section 1: Card Detail
   ============================================================ */
.card-detail {
  display: flex;
  gap: 1.2rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.card-detail-img {
  flex: 0 0 200px;
}
.card-detail-img img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-detail-info {
  flex: 1;
  min-width: 240px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.spec-table th,
.spec-table td {
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}
.spec-table th {
  width: 5.5em;
  font-weight: 600;
  color: var(--c-text-sub);
  white-space: nowrap;
}

.card-effect,
.card-decks {
  margin: 1rem 0;
}
.card-effect p,
.card-decks p {
  font-size: .92rem;
  line-height: 1.75;
}

/* ============================================================
   Section 2: Rec Cards
   ============================================================ */
.rec-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.rec-card h3 {
  margin: 0 0 .6rem;
  font-size: 1.05rem;
}
.rec-card-body {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.rec-card-img {
  flex: 0 0 120px;
}
.rec-card-img img {
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.rec-card-info {
  flex: 1;
  min-width: 200px;
}
.rec-card-info p {
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: .6rem;
}

.relation-badge {
  display: inline-block;
  background: var(--c-accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .15em .55em;
  border-radius: 3px;
  margin-bottom: .4rem;
}

/* ============================================================
   CTA Button
   ============================================================ */
.cta-btn {
  display: inline-block;
  background: var(--c-cta);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .15s, transform .1s;
}
.cta-btn:hover {
  background: var(--c-cta-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ============================================================
   Section 3: Deck List
   ============================================================ */
.deck-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .5rem 0;
}
.deck-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: .4rem .9rem;
  font-size: .88rem;
  font-weight: 500;
}

/* ============================================================
   Section 4: Summary Links
   ============================================================ */
.summary-links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}
.summary-links li .cta-btn {
  font-size: .82rem;
  padding: .45rem 1rem;
}

/* ============================================================
   Image Fallback (JS-generated)
   ============================================================ */
.img-fallback {
  background: #f0eeea;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3/4;
}
.img-fallback .inner {
  text-align: center;
  padding: .8rem;
}
.img-fallback .icon { font-size: 2rem; display: block; margin-bottom: .3rem; }
.img-fallback span { display: block; font-size: .78rem; color: var(--c-text-sub); }
.img-fallback .label { font-size: .7rem; margin-top: .2rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .site-header .site-title { font-size: 1.25rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .tile-name { font-size: .72rem; }
  .article-wrapper h1 { font-size: 1.25rem; }
  .card-detail { flex-direction: column; }
  .card-detail-img { flex: 0 0 auto; max-width: 180px; }
  .rec-card-body { flex-direction: column; }
  .rec-card-img { flex: 0 0 auto; max-width: 120px; }
}
