/* 스페셜 콤보 (/combos, js/combos.js) — docs/special-combo-sian 시안 G
   클래스 초상 탭 → 콤보 × 클래스 활용도 표 → 콤보 타일. 타일 · 표 줄을 누르면 공통 모달(DND.modal, .cb-modal)에 영상 + 입력 순서 + 설명
   모달 테두리 · 제목은 사이트 공통 모달(dnd2-ui.css) 그대로. 클래스 색은 --cls-*, 등급 색은 사이트 변수(--gold · --accent · --green) */

/* ---------- 클래스: 색 · 초상 얼굴 자리 ----------
   얼굴 그림 주소(--cb-face-키)는 js/combos.js 가 공략 콘텐츠 그림 'panel.키'로 :root 에 넣음
   --tab-face = 위 초상 탭에서 자르는 자리, --face-pos · --face-zoom = 작은 동그라미 얼굴 (docs/special-combo-sian/face-picker.html 로 정한 값) */
.cb-c-f { --cc: var(--cls-fighter); --face-img: var(--cb-face-f); --tab-face: 30% 10%; --face-pos: 14% 11%; --face-zoom: 180%; }
.cb-c-c { --cc: var(--cls-cleric); --face-img: var(--cb-face-c); --tab-face: 60% 9%; --face-pos: 61% 4%; --face-zoom: 160%; }
.cb-c-e { --cc: var(--cls-elf); --face-img: var(--cb-face-e); --tab-face: 55% 12%; --face-pos: 62% 9%; --face-zoom: 140%; }
.cb-c-d { --cc: var(--cls-dwarf); --face-img: var(--cb-face-d); --tab-face: 50% 26%; --face-pos: 67% 25.5%; --face-zoom: 150%; }
.cb-c-m { --cc: var(--cls-muser); --face-img: var(--cb-face-m); --tab-face: 45% 11%; --face-pos: 53% 11.5%; --face-zoom: 170%; }
.cb-c-t { --cc: var(--cls-thief); --face-img: var(--cb-face-t); --tab-face: 70% 11%; --face-pos: 30% 7%; --face-zoom: 160%; }

/* 작은 동그라미 얼굴 (타일 아래 · 클래스 이름 앞) */
.cb-face { flex: none; width: var(--sp-6); height: var(--sp-6); border-radius: 50%; border: 1px solid var(--cc, var(--line));
  background: var(--face-img) var(--face-pos) / var(--face-zoom) auto no-repeat, var(--surface); }
/* 클래스 이름 (얼굴 + 클래스색 글자) */
.cb-name { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--cc, var(--text-sub)); font-weight: var(--fw-semibold); white-space: nowrap; }

/* 활용도 등급 딱지: S 금 · A 보라 · B 초록 · C~E 회색 · – 못 씀 · 가능(등급 없이 된다는 것만) */
.cb-grade { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 var(--sp-1); border-radius: var(--radius-sm);
  background: var(--line-strong); color: var(--text-strong); font: var(--fw-black) var(--fs-md)/1 var(--font-display, var(--font)); }
.cb-grade[data-g="S"] { background: var(--gold); color: var(--bg); }
.cb-grade[data-g="A"] { background: var(--accent); color: var(--bg); }
.cb-grade[data-g="B"] { background: var(--green); color: var(--bg); }
.cb-grade[data-g="-"] { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); font-weight: var(--fw-regular); }
.cb-grade[data-g="O"] { background: transparent; border: 1px solid var(--accent-line, var(--accent)); color: var(--accent); font-size: var(--fs-xs); }

/* 난이도 칸 4개 */
.cb-level { display: inline-flex; gap: var(--sp-1); vertical-align: middle; }
.cb-level i { width: 10px; height: 10px; border-radius: 2px; background: var(--line-strong); }
.cb-level i.on { background: var(--accent); }

/* ---------- 페이지 ---------- */
.cb { --name-w: 168px; display: flex; flex-direction: column; gap: var(--sp-8); padding-bottom: var(--sp-16); }   /* 머리말은 다른 공략 페이지처럼 본문 맨 위에서 바로 (dnd2.css .page-head--hud) */

/* 클래스 초상 탭. '전체' 칸 너비 = 표의 콤보 이름 칸 너비(--name-w) → PC 에서 초상 아래로 표의 클래스 열이 맞음 */
.cb-classes { display: grid; grid-template-columns: var(--name-w) repeat(6, minmax(0, 1fr)); gap: var(--sp-3); }
.cb-cls { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--sp-1); min-height: 132px; padding: var(--sp-2);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-solid); color: var(--text-sub); font: inherit; cursor: pointer; overflow: hidden; }
.cb-cls img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--tab-face, 50% 0%); opacity: .7; }
.cb-cls::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--surface-solid) 12%, transparent 55%); }   /* 이름 글씨 받침 (그림 위 글자 대비용, 버튼 장식이 아니라 css-rules 5-1 그라데이션 예외) */
.cb-cls span { position: relative; z-index: 1; font-weight: var(--fw-bold); color: var(--cc, var(--text-strong)); }
.cb-cls small { position: relative; z-index: 1; font-size: var(--fs-xs); color: var(--muted); }
.cb-cls:hover img { opacity: .85; }
.cb-cls[aria-selected="true"] { border-color: var(--cc, var(--primary)); box-shadow: inset 0 0 0 1px var(--cc, var(--primary)); }
.cb-cls[aria-selected="true"] img { opacity: .9; }
.cb-cls:focus-visible { outline: 2px solid rgba(var(--focus-rgb), .8); outline-offset: 2px; }
.cb-cls--all { justify-content: center; }
.cb-cls--all span { font-size: var(--fs-lg); }

.cb-sec { display: flex; flex-direction: column; gap: var(--sp-3); }
.cb-sec__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.cb-sec__head h2 { margin: 0; font-size: var(--fs-xl); color: var(--text-strong); }
.cb-sec__head p { margin: 0; }

/* 활용도 표 (줄을 누르면 그 콤보 창) */
.cb-matrix-wrap { overflow: hidden; }
.cb-matrix { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cb-matrix th, .cb-matrix td { padding: var(--sp-2); border-bottom: 1px solid var(--line); text-align: center; }
.cb-matrix thead th { font-size: var(--fs-sm); color: var(--cc, var(--muted)); font-weight: var(--fw-semibold); }
.cb-matrix th:first-child, .cb-matrix td:first-child { width: 34%; text-align: left; padding-left: var(--sp-4); }
.cb-matrix tbody tr { cursor: pointer; }
.cb-matrix tbody tr:hover { background: var(--hover); }
.cb-matrix tbody tr:last-child > * { border-bottom: 0; }
.cb-matrix tbody th { font-weight: var(--fw-semibold); color: var(--text-strong); }
.cb-matrix tbody th a { display: flex; flex-direction: column; justify-content: center; min-height: 44px; color: inherit; }
.cb-matrix tbody th small { color: var(--muted); font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.cb-matrix .is-col { background: var(--surface); }

/* 콤보 타일 */
.cb-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.cb-tile { display: flex; flex-direction: column; gap: var(--sp-3); min-height: 168px; padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-solid); color: var(--text); }
.cb-tile:hover { background: var(--surface-2); border-color: var(--line-strong); }
.cb-tile:focus-visible { outline: 2px solid rgba(var(--focus-rgb), .8); outline-offset: 2px; }
.cb-tile__top { display: flex; align-items: center; gap: var(--sp-3); }
.cb-tile .cb-grade, .cb-tile__no { min-width: 40px; height: 40px; font-size: var(--fs-xl); }
.cb-tile__no { display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font: var(--fw-black) var(--fs-xl)/1 var(--font-display); }
.cb-tile__name { color: var(--text-strong); font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.cb-tile__name small { margin-left: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.cb-tile__sum { flex: 1; overflow: hidden; color: var(--text-sub); font-size: var(--fs-sm); line-height: var(--lh-loose);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cb-tile__foot { display: flex; align-items: center; gap: var(--sp-4); color: var(--muted); font-size: var(--fs-xs); }
.cb-tile__faces { display: flex; gap: var(--sp-1); }
.cb-tile__vids { margin-left: auto; }
.cb-empty { padding: var(--sp-6); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }

/* ---------- 모달 (.cb-modal) ---------- */
.cb-body { display: flex; flex-direction: column; gap: var(--sp-5); }
.cb-body h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); color: var(--text-sub); font-weight: var(--fw-semibold); }
.cb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); color: var(--muted); font-size: var(--fs-sm); }
.cb-summary { margin: 0; color: var(--text); font-size: var(--fs-lg); line-height: var(--lh-reading); }

/* 영상 칸 | 입력 순서. 영상 고르기는 영상 아래 따로 (폰에서 영상만 위에 붙이려고) */
.cb-stage { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "screen panel" "pick panel"; grid-template-rows: auto 1fr; gap: var(--sp-3) var(--sp-5); align-items: start; }
.cb-screen { grid-area: screen; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.cb-pickbox { grid-area: pick; min-width: 0; }
.cb-pickbox:empty { display: none; }
.cb-panel { grid-area: panel; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cb-panel h3 { margin: 0; }
.cb-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.cb-pick button { min-height: 36px; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-solid); color: var(--text-sub); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.cb-pick button[aria-pressed="true"] { border-color: var(--primary); color: var(--text-strong); background: var(--surface-2); }
.cb-select { width: 100%; }
.cb-noshot { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.cb-shots-wrap { display: flex; flex-direction: column; gap: var(--sp-3); }

/* 영상 (1배속 · 1/3배속 바꾸기) */
.cb-vid { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.cb-vid__box { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--art-bg-deep); }
.cb-vid video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--art-bg-deep); }
.cb-vid__cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); color: var(--text-sub); font-size: var(--fs-sm); }
.cb-vid__cap > span:first-child { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }   /* 얼굴 · 클래스 · 영상 이름을 한 줄 가운데로 */
.cb-speed { display: inline-flex; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.cb-speed button { min-height: 36px; padding: 0 var(--sp-3); border: 0; background: transparent; color: var(--text-sub); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.cb-speed button + button { border-left: 1px solid var(--line-strong); }
.cb-speed button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }   /* 흰 글씨 + --primary 는 4.2:1 이라 밝은 보라 + 어두운 글씨 */
.cb-speed button:focus-visible { outline: 2px solid rgba(var(--focus-rgb), .8); outline-offset: -2px; }

/* 입력 순서 */
.cb-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); counter-reset: st; }
.cb-steps li { counter-increment: st; display: grid; grid-template-columns: var(--sp-6) auto minmax(0, 1fr); align-items: center; gap: var(--sp-3); min-height: var(--sp-12); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.cb-steps li::before { content: counter(st); color: var(--muted); font: var(--fw-black) var(--fs-lg)/1 var(--font-display); text-align: center; }
.cb-steps li > span:last-child { color: var(--text-sub); font-size: var(--fs-sm); }
.cb-alt { margin: 0; color: var(--text-sub); font-size: var(--fs-sm); line-height: var(--lh-loose); }
/* 입력 순서가 없는 콤보(무한 콤보): 지금 영상이 어느 항목인지 */
.cb-now__group { margin: 0; color: var(--muted); font-size: var(--fs-xs); }
.cb-now__on { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); color: var(--text-strong); font-weight: var(--fw-bold); }
.cb-now__text { margin: 0; color: var(--text); line-height: var(--lh-loose); }
.cb-group-note { margin-bottom: var(--sp-2); }

/* 알아 둘 것 | 활용도 · 주의 */
.cb-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.cb-cols.is-one { grid-template-columns: minmax(0, 1fr); }   /* '알아 둘 것'이 없으면 한 칸 */
.cb-side { display: flex; flex-direction: column; gap: var(--sp-4); }
.cb-points { margin: 0; padding-left: 1.2em; color: var(--text); line-height: var(--lh-loose); }
.cb-points li + li { margin-top: var(--sp-1); }
.cb-grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-3); }   /* 클래스 6개를 3칸 × 2줄 */
.cb-grades > span { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.cb-note { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: var(--fs-base); line-height: var(--lh-loose); }
.cb-note b { flex: none; color: var(--accent); }
.cb-note--warn { border-left-color: var(--ui-warn); }
.cb-note--warn b { color: var(--ui-warn); }
.cb-cmdline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.cb-cmdline p { margin: 0; flex-basis: 100%; color: var(--text-sub); font-size: var(--fs-sm); line-height: var(--lh-loose); }
.cb-group { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.cb-group li { padding: var(--sp-3); border-radius: var(--radius-sm); background: var(--surface); line-height: var(--lh-loose); }
.cb-group li.is-dim { display: none; }   /* 고른 클래스 것만 */
.cb-group b { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); color: var(--text-strong); }
.cb-group p { margin: var(--sp-1) 0 0; }

/* 데미지 표: 제목(캡션)까지 한 상자로 닫음 */
.cb-table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-solid); }
.cb-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.cb-table caption { padding: var(--sp-3) var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; }
.cb-table th, .cb-table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; }
.cb-table th { color: var(--muted); font-weight: var(--fw-semibold); }
.cb-table td:nth-child(2) { color: var(--text-strong); font-weight: var(--fw-bold); white-space: nowrap; }
.cb-table tbody tr:last-child td { border-bottom: 0; }

/* 판정 그림: 원본 그대로 (그림 속 빨강 = 공격 판정, 보라 = 몸 판정) + 범례 색 --hitbox-atk · --hitbox-body */
.cb-shots-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); color: var(--text-sub); font-size: var(--fs-sm); }
.cb-legend { display: inline-flex; align-items: center; gap: var(--sp-2); }
.cb-legend i { width: var(--sp-4); height: var(--sp-3); border: 2px solid; }
.cb-legend i.cb-legend__atk { border-color: var(--hitbox-atk); background: color-mix(in srgb, var(--hitbox-atk) 28%, transparent); }
.cb-legend i.cb-legend__body { border-color: var(--hitbox-body); background: color-mix(in srgb, var(--hitbox-body) 22%, transparent); }
.cb-shots-cap { margin: 0 0 var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }
.cb-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.cb-shot { margin: 0; display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.cb-shot__img { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--art-bg-deep); }
.cb-shot__img img { display: block; width: 100%; }   /* 원본(210px)보다 작게 보일 때가 많아 pixelated 는 안 씀 (줄이면 픽셀이 고르지 않게 깨짐) */
.cb-shot figcaption { color: var(--muted); font-size: var(--fs-xs); line-height: var(--lh-snug); }

/* 모달 크기 · 스크롤: PC 는 내용만큼 길어지고 바깥(어두운 배경)이 스크롤 (스크롤바 숨김), 폰은 전체 화면 안에서 스크롤 (막대만 숨김) */
.cb-modal .dnd-dialog__body { padding-bottom: var(--sp-8); scrollbar-width: none; }
.cb-modal .dnd-dialog__body::-webkit-scrollbar { display: none; }
@media (min-width: 481px) {
  .dnd-backdrop:has(.cb-modal) { align-items: flex-start; overflow-y: auto; padding-block: var(--sp-8); scrollbar-width: none; }
  .dnd-backdrop:has(.cb-modal)::-webkit-scrollbar { display: none; }
  .cb-modal.dnd-dialog { flex: none; max-height: none; }
  .cb-modal .dnd-dialog__body { overflow: visible; }
}

/* ---------- 반응형 ---------- */
@media (min-width: 1025px) {
  /* 초상 칸 사이 간격(--sp-3)의 절반만큼 더해야 열 가운데가 초상 가운데와 맞음 */
  .cb-matrix th:first-child, .cb-matrix td:first-child { width: calc(var(--name-w) + var(--sp-3) / 2); }
}
@media (max-width: 1024px) {
  .cb-classes { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-2); }
  .cb-cls { min-height: 104px; }
  .cb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "screen" "pick" "panel"; grid-template-rows: none; }
  .cb-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  /* '전체'는 위 한 줄, 클래스 6개는 3칸씩 두 줄 */
  .cb-classes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-cls--all { grid-column: 1 / -1; flex-direction: row; gap: var(--sp-2); min-height: 44px; }
}
@media (max-width: 480px) {
  .cb { gap: var(--sp-6); }
  .cb-cls:not(.cb-cls--all) { min-height: 84px; padding: var(--sp-1); }
  .cb-cls:not(.cb-cls--all) small { display: none; }
  .cb-cls span { font-size: var(--fs-sm); }
  .cb-c-f { --tab-face: 30% 17%; }   /* 폰 칸은 납작해서 파이터 얼굴이 아래로 밀림 */
  .cb-matrix th, .cb-matrix td { padding: var(--sp-2) 2px; }
  .cb-matrix th:first-child, .cb-matrix td:first-child { width: 30%; padding-left: var(--sp-3); }
  .cb-matrix thead th { font-size: var(--fs-xs); }
  .cb-matrix .cb-grade { min-width: 24px; height: 24px; font-size: var(--fs-xs); }
  .cb-matrix tbody th { font-size: var(--fs-sm); }
  .cb-matrix tbody th small { display: none; }
  .cb-tiles { grid-template-columns: minmax(0, 1fr); }
  .cb-tile { min-height: 0; padding: var(--sp-4); }
  /* 모달: 영상만 위에 붙이고 (화면의 1/3 쯤) 아래 입력 순서를 보며 따라 하게. 판정 그림(영상 없는 콤보)은 붙이지 않음 */
  .cb-screen { position: sticky; top: calc(-1 * var(--sp-3)); z-index: var(--z-sticky); padding-bottom: var(--sp-2); background: var(--surface-solid); }
  .cb-screen:has(.cb-shots-wrap) { position: static; }
  .cb-screen .cb-vid__box { max-height: 34svh; margin-inline: auto; }
  .cb-pick button, .cb-select, .cb-speed button { min-height: 44px; }
  .cb-select { font-size: var(--fs-lg); }   /* 16px 미만이면 iOS 가 눌렀을 때 확대함 */
  .cb-panel { padding: var(--sp-3); }
  .cb-steps li { grid-template-columns: var(--sp-5) auto minmax(0, 1fr); gap: var(--sp-2); }
  .cb-points, .cb-note { font-size: var(--fs-lg); }
  /* 활용도 3칸이 칸당 110px 정도라 '매직 유저' 줄이 넘침 → 글자 · 얼굴 · 사이를 줄임 */
  .cb-grades { gap: var(--sp-2); }
  .cb-grades > span { gap: 2px; }
  .cb-grades .cb-name { gap: var(--sp-1); font-size: var(--fs-sm); }
  .cb-grades .cb-face { width: var(--sp-5); height: var(--sp-5); }
  .cb-modal .dnd-x { width: 44px; height: 44px; }
}
