/* 백팩 — 전체 게임 (#/catalog)
   원칙(docs/design-research.md): 무채색 바탕, Steam식 초록 할인 블록은 할인 중일 때만, 모서리 2~4px, 장식 모션 없음.
   할인정보 탭의 조각(dv-disc·dv-pc·dv-seg·dv-sel·dv-st …)을 그대로 쓰고, 표 격자만 따로 둔다. */
.cv { container-type: inline-size; padding: 18px 22px 40px; }
.cv button { font: inherit; color: inherit; }

/* ---------- 머리·요약 ---------- */
.cv-head { margin-bottom: 14px; }
.cv-head .dv-hrow { align-items: baseline; }
.cv-head .dv-meta { margin: 0; }
.cv-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; background: var(--bg1); border-radius: 4px; overflow: hidden; }
.cv-stats.is-load { display: block; padding: 12px 14px; }
.cv-stats > div { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; border-left: 1px solid var(--line); min-width: 0; }
.cv-stats > div:first-child { border-left: 0; }
.cv-stats span { font-size: 12px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-stats b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-stats b.cv-acc { color: #BEEE11; }
.cv-stats small { font-size: 12px; color: var(--tx3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-prog { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--tx2); font-variant-numeric: tabular-nums; }
.cv-prog-l { flex: none; font-weight: 600; color: var(--tx); }
.cv-prog-r { flex: none; white-space: nowrap; }
.cv-bar { position: relative; flex: 1; min-width: 60px; height: 6px; border-radius: 2px; background: var(--bg3); overflow: hidden; }
.cv-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #5C8A1E; border-radius: 2px; }

/* ---------- v9 신작 선반 (할인정보 탭 .sh-* 를 그대로 쓰고, 전체 게임 전용 부분만 .cv-shelf 아래에) ---------- */
#cvShelf:empty { display: none; }
.cv-shelf { margin-top: 12px; }
.cv-shelf .sh-head h2 { font-size: 16px; }
.cv-shc { outline: none; }
.cv-shc:focus-visible { box-shadow: inset 0 0 0 2px var(--acc); }
.cv-shelf .sh-im .dv-img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 순위 번호: 이미지 왼쪽 위 단색 칸(장식 없음, 숫자 고정폭) */
.cv-shrk { position: absolute; left: 0; top: 0; z-index: 1; min-width: 26px; height: 24px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg0); color: var(--tx); border-radius: 0 0 2px 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cv-shelf .sh-p .dv-none { font-size: 13px; }
.cv-rk { font-size: 12px; font-weight: 600; color: var(--tx2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 도구 ---------- */
.cv-tools { margin-bottom: 8px; }
.cv-q { width: 260px; }
.cv-tools .dv-sel:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 표 ---------- */
/* 썸네일 열 = var(--thw): 촘촘 120 · 보통 184 · 크게 240 (Steam 헤더 460:215) */
.cv-table { --thw: 184px; --nfs: 15px; background: var(--bg1); border-radius: 4px; }
.cv-table.d-compact { --thw: 120px; --nfs: 14px; }
.cv-table.d-large { --thw: 240px; --nfs: 16px; }
.cv-table.cv-gridwrap { background: none; }
.cv-table.is-loading [role="rowgroup"], .cv-table.is-loading .dv-grid { opacity: .55; }
.cv-row { display: grid; grid-template-columns: var(--thw) minmax(160px, 1fr) 136px 172px 60px 84px; align-items: center; gap: 0 12px; min-height: 48px; padding: 6px 12px 6px 6px; border-top: 1px solid var(--line); cursor: pointer; outline: none; }
.cv-row:hover { background: var(--bg2); }
.cv-row.is-sel { background: var(--bg3); box-shadow: inset 2px 0 0 var(--tx2); }
.cv-row:focus-visible { box-shadow: inset 0 0 0 2px var(--acc); }
.cv-hd { min-height: 34px; padding-top: 0; padding-bottom: 0; border-top: 0; cursor: default; position: sticky; top: 0; z-index: 2; background: var(--bg1); border-radius: 4px 4px 0 0; font-size: 12px; font-weight: 600; color: var(--tx3); }
.cv-hd:hover { background: var(--bg1); }
.cv-hd button { padding: 0; background: none; border: 0; font-size: 12px; font-weight: 600; color: var(--tx3); cursor: pointer; white-space: nowrap; }
.cv-hd button:hover, .cv-hd button.on { color: var(--tx); }
.cv-hd button.on::after { content: " ▼"; font-size: 8px; }
.cv-hd [aria-sort="ascending"] button.on::after { content: " ▲"; }
.cv-c { min-width: 0; }
.cv-th { position: relative; width: var(--thw); aspect-ratio: 460 / 215; border-radius: 2px; background: var(--bg3); overflow: hidden; }
.cv-ph { position: absolute; inset: 0; font-size: 12px; overflow: hidden; }
.cv-hd > :first-child { width: var(--thw); }
.d-compact .cv-name .dv-sub { display: none; }
.cv-card .dv-cp .dv-pc { flex-direction: row; align-items: baseline; gap: 6px; }
.cv-card .dv-cp .dv-pc b { font-size: 15px; }
.cv-name .dv-sub { display: flex; align-items: center; gap: 6px; }
.cv-steam, .cv-best { display: flex; align-items: center; gap: 8px; }
.cv-steam .cv-pc s { text-decoration: line-through; }
.cv-best .dv-pc { align-items: flex-end; flex: none; }
.cv-free { font-size: 13px; font-weight: 700; }
.cv-rel { font-size: 12.5px; color: var(--tx2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-soon { color: var(--warn); }
.cv-type { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 2px; background: var(--bg4); color: var(--tx2); font-size: 11.5px; font-weight: 700; }
.cv-pend { display: inline-flex; align-items: center; height: 19px; padding: 0 5px; border-radius: 2px; border: 1px solid var(--line2); color: var(--tx2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cv-row.is-pend .dv-t { color: var(--tx2); }
.cv-pendnote { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--tx2); }
.cv-full { color: var(--tx2); }
.cv-a { color: var(--acc); text-decoration: none; }
.cv-a:hover { text-decoration: underline; }
.cv-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px; color: var(--tx2); border-top: 1px solid var(--line); }
.cv-empty .dv-link { margin: 0; }
.cv-note { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; background: var(--bg1); border-radius: 4px; border-left: 3px solid var(--tx3); font-size: 13px; color: var(--tx2); }
.cv-note b { color: var(--tx); font-size: 14px; }
.cv-note .dv-btn { margin-top: 4px; }

/* ---------- 쪽 이동 ---------- */
.cv-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; padding: 14px 0 4px; }
.cv-pager:empty { display: none; }
.cv-pg { min-width: 34px; height: 32px; padding: 0 10px; border-radius: 4px; background: var(--bg3); border: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.cv-pg:hover:not(:disabled) { background: var(--bg4); }
.cv-pg.on { background: var(--tx); color: var(--bg0) !important; }
.cv-pg:disabled { opacity: .35; cursor: default; }
.cv-gap { color: var(--tx3); padding: 0 2px; }
.cv-pager .dv-count { margin-left: 8px; }

/* ---------- 영역 폭 기준 반응형 (1440: 약 880px, 1024: 약 830px, 390: 단일 열) ---------- */
@container (max-width: 860px) {
  .cv-row { grid-template-columns: var(--thw) minmax(120px, 1fr) 124px 156px 56px 78px; gap: 0 10px; }
  .cv-table.d-large { --thw: 200px; }
  .cv-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cv-stats > div:nth-child(4) { border-left: 0; }
  .cv-stats > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@container (max-width: 760px) {
  .cv-row { grid-template-columns: var(--thw) minmax(0, 1fr) 124px 150px 54px; }
  .cv-row > .cv-rel, .cv-hd > :nth-child(6) { display: none; }
  .cv-q { width: 200px; }
  .cv .dv-sp-r { display: none; }
}
@container (max-width: 640px) {
  .cv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-stats > div { padding: 7px 10px; }
  .cv-stats > div:nth-child(odd) { border-left: 0; }
  .cv-stats > div:nth-child(4) { border-left: 1px solid var(--line); }
  .cv-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cv-stats > div:nth-child(5) { grid-column: 1 / -1; }
  .cv-stats b { font-size: 16px; }
  .cv-prog { flex-wrap: wrap; }
  .cv-prog-r { white-space: normal; }
  .cv-q { width: 100%; }
  .cv-tools .dv-seg { flex: 1 1 auto; }
  .cv-tools .dv-seg button { flex: 1; }
  .cv-tools .dv-sel { flex: 1 1 40%; max-width: none; }
  /* 좁은 화면(390): 썸네일 132px(촘촘 96 · 크게 160) + 이름 두 줄 → 영어 원제 → Steam 가격 → 다른 스토어 */
  .cv-table { --thw: 132px; } .cv-table.d-compact { --thw: 96px; } .cv-table.d-large { --thw: 160px; }
  .cv-row { grid-template-columns: var(--thw) minmax(0, 1fr); grid-template-rows: auto; gap: 3px 10px; padding: 8px 10px 8px 8px; align-items: start; }
  .cv-row > .cv-th { grid-row: 1 / 5; }
  .cv-row > .cv-name, .cv-row > .cv-steam, .cv-row > .cv-best { grid-column: 2; }
  .cv-row .dv-n { height: auto; line-height: 20px; }
  .cv-row .dv-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .cv-row .cv-name .dv-sub { display: none; }
  .cv-row .dv-pc { flex-direction: row; align-items: baseline; gap: 6px; }
  .cv-row .dv-store { flex: none; }
  .cv-row > .cv-rv, .cv-row > .cv-rel { display: none; }
  .cv-hd { display: none; }
  .cv-pg { min-width: 32px; padding: 0 8px; }
  .cv-pager .dv-count { display: none; }
}
@media (max-width: 720px) { .cv { padding: 14px 12px 32px; } }
