/* 선택툰: 소개 화면의 엔딩 모음·대화상자, 재생 화면 (templates/v2/choicetoon.html, choicetoon_play.html) */

/* 엔딩 모음 */
.ctn-endings { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ctn-endings li { padding: 8px 14px; border-radius: 999px; background: var(--bg-elev-2); color: var(--text-3); font-size: 13px; font-weight: 600; }
.ctn-endings li.is-seen { background: var(--brand); color: var(--brand-ink); }

/* 화면 안 대화상자 */
.ctn-dialog { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: var(--overlay); }
.ctn-dialog[hidden] { display: none; }
.ctn-dialog-card { width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px; border-radius: var(--radius-l); background: var(--bg-elev); color: var(--text); }
.ctn-dialog-card h2 { margin: 0; font-size: 18px; font-weight: 800; }
.ctn-dialog-card p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.ctn-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* 재생 화면 */
.ctn-main { padding: 0; }
.ctn-player { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--bg); }
.ctn-bar { flex: none; display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.ctn-bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ctn-bar-title strong, .ctn-bar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctn-bar-title strong { font-size: 14px; font-weight: 700; }
.ctn-bar-title span { font-size: 12px; color: var(--text-3); }
.ctn-progress { flex: none; height: 2px; background: var(--bg-elev-2); }
.ctn-progress span { display: block; width: 0; height: 100%; background: var(--brand); transition: width .15s; }

.ctn-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.ctn-stage.is-busy { cursor: progress; }
.ctn-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.ctn-stats { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 70%; pointer-events: none; }
.ctn-stat, .ctn-count { padding: 4px 10px; border-radius: 999px; background: var(--overlay); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ctn-count { position: absolute; top: 10px; right: 10px; pointer-events: none; }
.ctn-count:empty { display: none; }

.ctn-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px; max-width: 720px; margin: 0 auto; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.ctn-line { padding: 12px 16px; border-radius: var(--radius); background: var(--overlay); color: #fff; }
.ctn-line[hidden] { display: none; }
.ctn-line strong { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 800; color: var(--brand); }
.ctn-line strong:empty { display: none; }
.ctn-line p { font-size: 15px; line-height: 1.6; white-space: pre-line; }
.ctn-stage.is-text-only .ctn-bottom { position: static; width: 100%; }
.ctn-stage.is-text-only .ctn-line { background: none; color: var(--text); text-align: center; }
.ctn-stage.is-text-only .ctn-line p { font-size: 17px; }

.ctn-choices { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; pointer-events: auto; cursor: default; }
.ctn-choices[hidden] { display: none; }
.ctn-choice { width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; text-align: left; }
.ctn-choice:hover, .ctn-choice:focus-visible { border-color: var(--brand); }
.ctn-choice:disabled { opacity: .6; }

.ctn-panel { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: var(--overlay); cursor: default; }
.ctn-panel[hidden] { display: none; }
.ctn-card { width: min(420px, 100%); padding: 24px 20px; border-radius: var(--radius-l); background: var(--bg-elev); color: var(--text); text-align: center; }
.ctn-card small { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.ctn-card h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; line-height: 1.35; }
.ctn-card p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.ctn-card-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

.ctn-history { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: ctn; }
.ctn-history li { font-size: 14px; line-height: 1.5; }
.ctn-history span { display: block; font-size: 12px; color: var(--text-3); }
.ctn-history p { margin: 0; color: var(--text); }
