/* 요괴록 도감 — landing.css 의 색 팔레트(--black, --gold, --paper, --jade, --azure, --red, --pink) 를 상속 */

body.dex-body {
  /* 도감은 long page 라 hero 가 없음 → 헤더 영역에만 그라데이션 */
  background: var(--black);
}

/* ─── NAV (도감 전용 — 항상 보이는 sticky) ─────────────────────────────── */
.dex-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 22, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.dex-nav .brand-link { display: flex; align-items: center; }
.dex-nav .nav-links a.active {
  color: var(--gold);
  position: relative;
}
.dex-nav .nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--gold);
}

/* ─── HEADER ───────────────────────────────────────────────────────────── */
.dex-header {
  padding: 56px 24px 32px;
  text-align: center;
  background:
    radial-gradient(ellipse at center top, rgba(212, 160, 23, 0.12), transparent 60%),
    var(--black);
}
.dex-title {
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.dex-title-han {
  font-family: 'Noto Serif KR', serif;
  font-size: 44px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-shadow: 0 2px 16px rgba(212, 160, 23, 0.3);
}
.dex-title-kor {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px; font-weight: 500;
  color: var(--paper);
  letter-spacing: 0.15em;
  opacity: 0.85;
}
.dex-sub {
  font-size: 14px;
  color: rgba(245, 241, 232, 0.7);
  margin: 0;
}
.dex-sub b {
  color: var(--gold-bright);
  font-weight: 700;
}

/* ─── CONTROLS (검색 + 필터) ──────────────────────────────────────────── */
.dex-controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
}
.dex-search {
  width: 100%;
  padding: 14px 20px;
  background: rgba(245, 241, 232, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 120ms, background 120ms;
}
.dex-search::placeholder { color: rgba(245, 241, 232, 0.4); }
.dex-search:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(245, 241, 232, 0.08);
}

.dex-filters {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 18px;
}
.filter-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 12px;
  color: rgba(245, 241, 232, 0.6);
  font-weight: 600;
  letter-spacing: 0.05em;
  min-width: 36px;
}
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chip {
  padding: 6px 12px;
  background: rgba(245, 241, 232, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: rgba(245, 241, 232, 0.7);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 120ms;
}
.chip:hover {
  border-color: var(--gold);
  color: var(--paper);
}
.chip.active {
  background: rgba(212, 160, 23, 0.18);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
}
/* 속성 칩 색상 */
.chip.attr-fire { color: var(--red); }
.chip.attr-water { color: var(--azure); }
.chip.attr-wood { color: var(--jade); }
.chip.attr-metal { color: rgba(245, 241, 232, 0.85); }
.chip.attr-earth { color: var(--gold); }
.chip.attr-heart { color: var(--pink); }

.dex-sort {
  padding: 6px 12px;
  background: rgba(245, 241, 232, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--paper);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.dex-result {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.5);
  display: flex; align-items: center; gap: 12px;
}
.dex-result #dex-result-count {
  color: var(--gold-bright);
  font-weight: 700;
}
.btn-reset {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: rgba(245, 241, 232, 0.6);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 120ms;
}
.btn-reset:hover { color: var(--paper); border-color: var(--gold); }

/* ─── GRID ─────────────────────────────────────────────────────────────── */
.dex-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.dex-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: rgba(245, 241, 232, 0.4);
}
.dex-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: rgba(245, 241, 232, 0.5);
}
.dex-empty b { color: var(--gold-bright); }

/* ─── CARD CELL ────────────────────────────────────────────────────────── */
.dex-cell {
  background: linear-gradient(180deg, rgba(245, 241, 232, 0.04), rgba(245, 241, 232, 0.01));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms, border-color 160ms, box-shadow 160ms;
  display: flex; flex-direction: column;
}
.dex-cell:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(212, 160, 23, 0.2);
}
.dex-cell-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.dex-cell-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background:
    radial-gradient(circle at 50% 30%, rgba(245, 241, 232, 0.06), transparent 60%),
    rgba(26, 22, 20, 0.6);
}
.dex-cell-image .rarity-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.dex-cell-image .attr-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.dex-cell-image .group-tag {
  position: absolute;
  bottom: 4px; right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: rgba(245, 241, 232, 0.85);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.dex-cell-info {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.dex-cell-name {
  font-size: 13px;
  color: var(--paper);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dex-cell-role {
  font-size: 11px;
  color: rgba(245, 241, 232, 0.5);
}

/* ─── 속성 액센트 (배지 색) ────────────────────────────────────────────── */
.attr-fire  .attr-badge { color: var(--red); }
.attr-water .attr-badge { color: var(--azure); }
.attr-wood  .attr-badge { color: var(--jade); }
.attr-metal .attr-badge { color: rgba(245, 241, 232, 0.85); }
.attr-earth .attr-badge { color: var(--gold); }
.attr-heart .attr-badge { color: var(--pink); }

/* ─── BOSS SECTION ─────────────────────────────────────────────────────── */
.dex-boss-section {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.boss-intro {
  color: rgba(245, 241, 232, 0.65);
  font-size: 14px;
  margin-bottom: 24px;
}
.boss-intro a { color: var(--gold); border-bottom: 1px dashed var(--gold); }
.boss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.boss-cell {
  background: linear-gradient(180deg, rgba(192, 57, 43, 0.08), rgba(245, 241, 232, 0.02));
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 160ms;
}
.boss-cell:hover {
  border-color: var(--red);
  box-shadow: 0 6px 24px rgba(192, 57, 43, 0.25);
}
.boss-cell-image {
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.4);
}
.boss-cell-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.boss-cell-info {
  padding: 12px;
}
.boss-cell-name {
  font-size: 15px;
  color: var(--paper);
  font-weight: 700;
  margin: 0 0 4px 0;
}
.boss-cell-hanja {
  font-size: 11px;
  color: rgba(245, 241, 232, 0.5);
  font-family: 'Noto Serif KR', serif;
}
.boss-cell-stats {
  display: flex; gap: 10px;
  font-size: 11px;
  color: rgba(245, 241, 232, 0.6);
  margin-top: 6px;
}
.boss-cell-stats b { color: var(--gold-bright); font-weight: 600; }

/* ─── MODAL ───────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  background: linear-gradient(180deg, #1f1b18, #16120f);
  border: 1px solid var(--gold);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper);
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
}
.modal-close:hover { border-color: var(--gold); color: var(--gold-bright); }

/* 모달 본문 */
.modal-body {
  padding: 32px 28px 24px;
}
.modal-hero {
  display: flex; gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.modal-hero-img {
  width: 120px; height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  object-fit: cover;
  flex-shrink: 0;
}
.modal-hero-info { flex: 1; min-width: 0; }
.modal-hero-rarity {
  font-size: 13px;
  color: var(--gold-bright);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.modal-hero-name {
  font-size: 22px;
  color: var(--paper);
  font-weight: 700;
  margin: 4px 0 2px;
  line-height: 1.2;
}
.modal-hero-hanja {
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.55);
  letter-spacing: 0.08em;
}
.modal-hero-tags {
  display: flex; gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.modal-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(245, 241, 232, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: rgba(245, 241, 232, 0.75);
}
.modal-tag.attr-fire  { border-color: var(--red); color: var(--red); }
.modal-tag.attr-water { border-color: var(--azure); color: var(--azure); }
.modal-tag.attr-wood  { border-color: var(--jade); color: var(--jade); }
.modal-tag.attr-metal { border-color: rgba(245, 241, 232, 0.5); }
.modal-tag.attr-earth { border-color: var(--gold); color: var(--gold); }
.modal-tag.attr-heart { border-color: var(--pink); color: var(--pink); }

.modal-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.modal-section h4 {
  font-size: 11px;
  color: rgba(245, 241, 232, 0.5);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.modal-section p {
  font-size: 14px;
  color: var(--paper);
  line-height: 1.55;
  margin: 0;
}
.modal-section .skill-kind {
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.stats-row {
  display: flex; gap: 18px;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.7);
}
.stats-row b { color: var(--gold-bright); font-weight: 700; }

.evo-chain {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.evo-step {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 120ms;
}
.evo-step:hover { background: rgba(245, 241, 232, 0.05); }
.evo-step img {
  width: 56px; height: 56px;
  border-radius: 4px;
  border: 1px solid var(--line);
  object-fit: cover;
}
.evo-step.current img { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.3); }
.evo-step-name {
  font-size: 10px;
  margin-top: 4px;
  color: rgba(245, 241, 232, 0.65);
  text-align: center;
  max-width: 64px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.evo-step.current .evo-step-name { color: var(--gold-bright); font-weight: 700; }
.evo-arrow { color: rgba(245, 241, 232, 0.4); font-size: 14px; }

.boss-pattern { font-size: 13px; line-height: 1.6; color: rgba(245, 241, 232, 0.8); }
.boss-pattern li { margin-bottom: 2px; }
.boss-pattern .pre { color: var(--red); font-weight: 600; }

/* ─── FOOTER ──────────────────────────────────────────────────────────── */
.dex-footer {
  padding: 32px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.dex-footer .footer-bottom {
  font-size: 12px;
  color: rgba(245, 241, 232, 0.5);
}
.dex-footer .footer-bottom a {
  color: rgba(245, 241, 232, 0.7);
}
.dex-footer .footer-bottom a:hover {
  color: var(--gold);
}

/* ─── 모바일 ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .dex-title-han { font-size: 32px; }
  .dex-header { padding: 36px 16px 20px; }
  .dex-controls { padding: 0 16px 20px; }
  .dex-main { padding: 0 16px 60px; }
  .dex-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .dex-cell-name { font-size: 12px; }
  .dex-cell-role { font-size: 10px; }
  .modal-panel { max-height: 95vh; }
  .modal-body { padding: 28px 18px 18px; }
  .modal-hero { gap: 12px; }
  .modal-hero-img { width: 88px; height: 88px; }
  .modal-hero-name { font-size: 18px; }
  .filter-row { gap: 8px; }
  .chip { padding: 5px 10px; font-size: 12px; }
}
