/* 캐릭터 정보 창 (catmodal.js). 색은 style.css 의 변수를 그대로 씁니다. */
.prediction-item.is-clickable { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.prediction-item.is-clickable:hover { border-color: var(--ink); }
.prediction-item.is-clickable:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 캐릭터 그림. images 폴더에 파일이 없으면 img 가 스스로 사라집니다 */
.cat-icon { flex: none; width: 52px; height: 40px; object-fit: contain; border-radius: 4px; background: var(--soft); }
.cat-icon--large { width: 78px; height: 60px; }

.cm { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 860px); padding: 0; border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--ink); box-shadow: 0 20px 48px rgba(0, 0, 0, .28); overflow: hidden; }
.cm[open] { display: flex; flex-direction: column; }
.cm::backdrop { background: rgba(0, 0, 0, .5); }

.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cm-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.cm-close { flex: none; border: 1px solid var(--border); background: var(--white); color: var(--muted); border-radius: 6px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.cm-close:hover { color: var(--ink); border-color: var(--ink); }

.cm-body { padding: 14px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }

.cm-tabs { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.cm-tab { flex: 1; border: 0; border-right: 1px solid var(--border); background: var(--soft); color: var(--muted); padding: 9px 0; font-size: 13px; font-weight: 800; }
.cm-tab:last-child { border-right: 0; }
.cm-tab.is-on { background: var(--ink); color: #fff; }

.cm-desc { margin: 0 0 12px; padding: 11px 13px; background: var(--soft); border-radius: 6px; font-size: 13px; line-height: 1.6; white-space: pre-line; }

.cm-rows { margin: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cm-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.cm-row:last-child { border-bottom: 0; }
.cm-row dt { padding: 10px 12px; background: var(--soft); font-size: 12px; font-weight: 800; color: var(--muted); }
.cm-row dd { margin: 0; padding: 10px 12px; font-size: 13px; line-height: 1.55; }
.cm-none { color: var(--muted); font-size: 13px; }
.cm-lines { margin: 0; padding: 0; list-style: none; }
.cm-lines li + li { margin-top: 3px; }
.cm-lines .is-talent, .cm-talent-list span { color: inherit; }
.cm-lines .is-talent { color: #8a6a00; }
.cm-lines .is-ultra { color: #b8473c; }

.cm-targets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cm-target { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; font-weight: 700; }
.cm-target b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: #fff; font-size: 12px; background: #777; }
.cm-target.is-talent { border-style: dashed; border-color: #c9a227; }
.cm-target.is-red b { background: #d2493a; } .cm-target.is-float b { background: #4c8a3a; }
.cm-target.is-black b { background: #33333b; } .cm-target.is-metal b { background: #868b96; }
.cm-target.is-angel b { background: #b9951f; } .cm-target.is-alien b { background: #2c93ad; }
.cm-target.is-zombie b { background: #7a4ea0; } .cm-target.is-relic b { background: #5e6e2c; }
.cm-target.is-aku b { background: #2b4c88; } .cm-target.is-white b { background: #a3a3a8; }

.cm-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }
.cm-section-head h3 { margin: 0; font-size: 14px; font-weight: 800; }
.cm-link { border: 0; background: none; color: var(--ink); font-size: 12px; font-weight: 800; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; }

.cm-talent-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cm-talent-list li + li { border-top: 1px solid var(--border); }
.cm-talent-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13px; cursor: pointer; }
.cm-talent-list label:hover { background: var(--soft); }
.cm-talent-list input { flex: none; width: 16px; height: 16px; accent-color: var(--ink); }
.cm-talent-list span { flex: 1; min-width: 0; }
.cm-talent-list em { flex: none; font-style: normal; font-size: 11px; font-weight: 800; color: #b8473c; border: 1px solid #e6bdb8; border-radius: 5px; padding: 1px 6px; }

.cm-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; border: 1px solid var(--border); }
.cm-table th, .cm-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: right; }
.cm-table thead th { background: var(--soft); font-size: 12px; color: var(--muted); }
.cm-table th[scope="row"], .cm-table thead th:first-child { text-align: left; background: var(--soft); font-size: 12px; color: var(--muted); width: 72px; }
.cm-table td { font-weight: 700; }

.cm-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 0; border: 1px solid var(--border); border-right: 0; border-bottom: 0; font-variant-numeric: tabular-nums; }
.cm-fact { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.cm-fact.is-wide { grid-column: span 2; }
.cm-fact dt { padding: 6px 8px; background: var(--soft); font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); }
.cm-fact dd { margin: 0; padding: 8px 6px; font-size: 13px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.cm-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

.cm-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--soft); }
.cm-foot-note { flex: 1; min-width: 0; margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.cm-action { flex: none; border: 0; border-radius: 6px; background: var(--ink); color: #fff; padding: 11px 16px; font-size: 13px; font-weight: 800; }
.cm-action:hover:not(:disabled) { background: #000; }
.cm-action:disabled { background: #c4c0b6; color: #fff; cursor: not-allowed; }
/* 되묻는 단계 */
.cm-foot--ask { flex-direction: column; align-items: stretch; background: var(--accent-soft); border-top: 2px solid var(--ink); }
.cm-foot-question { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.6; }
.cm-ask-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.cm-action--light { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.cm-action--light:hover:not(:disabled) { background: var(--soft); }

@media (max-width: 520px) {
  .cm-row dt { padding: 10px 8px; font-size: 11px; white-space: nowrap; }
  .cm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-row { grid-template-columns: 72px minmax(0, 1fr); }
  .cm-foot { flex-direction: column; align-items: stretch; }
  .cm-table th, .cm-table td { padding: 7px 6px; font-size: 12px; }
}

/* 레전드 칸은 바탕이 먹색이라 그림 뒤를 밝게 유지합니다 */
.is-rarity-5 .cat-icon { background: #fff; }
.is-rarity-5.is-clickable:hover { border-color: var(--accent); }
