/* CG 갤러리 도감 + 라이트박스 + 오프라인 보상 리포트.
   모달 껍데기(.modal / .modal-content / .modal-body)는 shop.css 것을 그대로 쓴다. */

/* ═══════════════════ 갤러리 도감 ═══════════════════ */

.gallery-summary { margin: 0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.cg-card {
  display: grid;
  gap: 6px;
  padding: 8px;
  margin: 0;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cg-card.unlocked {
  cursor: pointer;
  border-color: rgba(216, 180, 90, 0.4);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.cg-card.unlocked:hover,
.cg-card.unlocked:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
.cg-card.locked { opacity: 0.75; }

/* 썸네일 — 16:9 로 통일. 이미지가 없으면 어두운 실루엣만 남는다 */
.cg-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: calc(var(--radius) - 3px);
  background: linear-gradient(160deg, #1a2044, #0b0f20 75%);
}

.cg-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 미해금/이미지 없음 표시 — 가운데 문양 하나 */
.cg-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(216, 180, 90, 0.35);
  font-size: 1.3rem;
}

.cg-title {
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.cg-card.locked .cg-title { color: var(--muted); letter-spacing: 0.14em; }

.cg-chapter { font-size: 0.7rem; color: var(--muted); margin-top: -3px; }

/* ═══════════════════ 라이트박스 ═══════════════════ */

.cg-lightbox {
  /* showModal() 이 top layer 로 올려 갤러리 모달 위에 겹친다 (pull-overlay 와 같다) */
  border: 0;
  padding: 16px;
  margin: auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: transparent;
  color: var(--text);
  place-items: center;
}
.cg-lightbox[open] { display: grid; }
.cg-lightbox::backdrop {
  background: rgba(4, 6, 14, 0.92);
  backdrop-filter: blur(4px);
}

.cg-lightbox-panel {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: min(920px, 100%);
  max-height: 92vh;
}

.cg-lightbox-image {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid rgba(216, 180, 90, 0.3);
  background: #0b0f20;
}

.cg-lightbox-caption {
  margin: 0;
  color: var(--gold-bright);
  font-size: 0.95rem;
  text-align: center;
}

/* ═══════════════════ 오프라인 보상 리포트 ═══════════════════ */

.idle-modal .modal-content { width: min(400px, calc(100vw - 24px)); }
.idle-body { gap: 10px; }
.idle-line { margin: 0; font-size: 0.92rem; }
.idle-gain { color: var(--gold-bright); font-size: 1.15rem; }
.idle-body .btn-block { margin-top: 6px; }
