/* AI 토론 공개 페이지(/debates, /debate/{id}) — 관리자 결과 화면(채팅형·주고받기형)과 같은 구성을 공개 테마 위에 얹는다.
   .tn-debate-* 만 쓴다. 관리자 CSS(tnews-admin.css)는 공개 화면에 싣지 않는다(600KB). 섹션 머리는 테마의 .tn-category-header. */
.tn-debate-index, .tn-debate-show { padding: 6px 0 40px; }
.tn-debate-eyebrow { display: inline-block; color: #f43f5e; font-size: 11px; font-weight: 800; letter-spacing: .14em; }

/* 섹션 머리 — 카테고리 페이지와 같은 모양. 토론 페이지는 토론 제목이 h1 이라 섹션 이름은 같은 모양의 p. */
.tn-debate-section { margin-bottom: 18px; }
.tn-category-header p.tn-debate-section-name { position: relative; margin: 0 0 8px; padding-left: 22px; color: inherit; font-size: clamp(28px, 3.2vw, 40px); font-weight: 1000; line-height: 1.12; }
.tn-category-header p.tn-debate-section-name::before { content: ""; position: absolute; left: 0; top: 10%; bottom: 10%; width: 7px; border-radius: 5px; background: linear-gradient(180deg, var(--tn-red, #2563eb), var(--tn-red-dark, #1d4ed8)); }
.tn-category-header p.tn-debate-section-name a { color: inherit; text-decoration: none; }
/* 대문 이미지(토론 코너 설정) — 목록 화면에서 제목 자리. 그림이 이름을 담고 있어 h1 의 빨간 막대는 뺀다. */
.tn-category-header h1.tn-debate-cover { margin: 0 0 14px; padding: 0; line-height: 0; }
.tn-category-header h1.tn-debate-cover::before { content: none; }
.tn-debate-cover > img { display: block; width: 100%; height: auto; border-radius: 14px; background: #0f172a; }
.tn-debate-cover.is-banner { margin: 0 0 14px; }   /* 움직이는 대문 — 생김새는 tnews-debate-banner.css */
@media (max-width: 575.98px) {
    .tn-debate-cover > img { border-radius: 10px; }
}

/* 목록 — pages/debates.php. 보기 방식(카드·목록·제목)은 같은 마크업을 #tnDebateList[data-view] 로만 바꾼다. */
.tn-debate-index .tn-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tn-debate-empty { padding: 72px 0; text-align: center; color: var(--tn-muted, #6b7280); }
.tn-debate-empty i { display: block; margin-bottom: 14px; color: #cbd5e1; font-size: 42px; }
.tn-debate-empty p { margin: 0; font-size: 15px; }

/* 정보 줄 — 왼쪽 편수·누적 조회, 오른쪽 정렬·보기 방식 */
.tn-debate-listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 22px; padding: 0 0 14px;
    border-bottom: 1px solid var(--tn-line, #e5e7eb); }
.tn-debate-listbar-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; }
.tn-debate-listbar-count strong { color: var(--tn-ink, #111827); font-size: 18px; font-weight: 900; letter-spacing: -0.01em; }
.tn-debate-listbar-count span { color: var(--tn-muted, #6b7280); font-size: 13px; font-weight: 600; }
.tn-debate-listbar-count span i { margin-right: 3px; }
.tn-debate-listbar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tn-debate-sort { display: inline-flex; padding: 3px; border-radius: 999px; background: #f1f5f9; }
.tn-debate-sort a { padding: 6px 14px; border-radius: 999px; color: #475569; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; text-decoration: none;
    transition: background .15s ease, color .15s ease; }
.tn-debate-sort a:hover { color: var(--tn-ink, #111827); text-decoration: none; }
.tn-debate-sort a.is-active { background: #fff; color: var(--tn-red, #2563eb); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.tn-debate-viewmode { display: inline-flex; gap: 4px; }
.tn-debate-viewmode[hidden] { display: none; }
.tn-debate-viewmode button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--tn-line, #e5e7eb); border-radius: 9px;
    background: #fff; color: #64748b; font-size: 14px; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.tn-debate-viewmode button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tn-debate-viewmode button:hover { border-color: #cbd5e1; color: var(--tn-ink, #111827); }
.tn-debate-viewmode button[aria-pressed="true"] { border-color: var(--tn-ink, #111827); background: var(--tn-ink, #111827); color: #fff; }

/* 카드 공통 */
.tn-debate-list { margin-bottom: 30px; }
.tn-debate-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--tn-line, #e5e7eb); border-radius: 16px; overflow: hidden;
    background: #fff; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tn-debate-card:hover, .tn-debate-card:focus-visible { border-color: transparent; box-shadow: 0 18px 40px rgba(15, 23, 42, .12); color: inherit; text-decoration: none; transform: translateY(-3px); }
.tn-debate-card-thumb { position: relative; display: block; flex: 0 0 auto; aspect-ratio: 16 / 9; overflow: hidden;
    background: linear-gradient(120deg, #111827 0%, #1e1b4b 55%, #4c1d4b 100%); }
.tn-debate-card-thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.tn-debate-card:hover .tn-debate-card-thumb > img { transform: scale(1.04); }
.tn-debate-card-faces { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 12px; }
.tn-debate-card-faces .tn-debate-face { width: 56px; height: 56px; margin-left: -12px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
.tn-debate-card-rank { display: none; }   /* 제목형의 맨 앞 칸에서만 — 아래 [data-view="compact"] */
.tn-debate-card-rankpill { padding: 1px 8px; border-radius: 4px; background: var(--tn-ink, #111827); color: #fff; font-size: 11.5px; font-weight: 900; letter-spacing: .02em; }
.tn-debate-card.is-top .tn-debate-card-rankpill { background: var(--tn-red, #2563eb); }
.tn-debate-card-play { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: var(--tn-red, #2563eb); color: #fff; font-size: 14px; box-shadow: 0 8px 20px rgba(15, 23, 42, .3); opacity: 0; transform: translateY(6px) scale(.9);
    transition: opacity .2s ease, transform .2s ease; }
.tn-debate-card-play i { margin-left: 2px; }
.tn-debate-card:hover .tn-debate-card-play, .tn-debate-card:focus-visible .tn-debate-card-play { opacity: 1; transform: none; }
@media (hover: none) { .tn-debate-card-play { opacity: .92; transform: none; } }
.tn-debate-card-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-width: 0; padding: 16px 18px 14px; }
.tn-debate-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 19px; color: #94a3b8; font-size: 12px; font-weight: 600; }
.tn-debate-card-label { color: var(--tn-red, #2563eb); font-weight: 900; letter-spacing: .02em; }
.tn-debate-card-new { padding: 1px 6px; border-radius: 4px; background: var(--tn-red, #2563eb); color: #fff; font-size: 10.5px; font-weight: 900; letter-spacing: .06em; }
.tn-debate-card-field { padding: 1px 9px; border-radius: 999px; background: #f1f5f9; background: color-mix(in srgb, var(--tn-red, #2563eb) 10%, #fff);
    color: var(--tn-red, #2563eb); font-weight: 800; }
.tn-debate-card h2 { display: -webkit-box; margin: 0; overflow: hidden; color: var(--tn-ink, #111827); font-size: 17px; font-weight: 800; line-height: 1.42;
    letter-spacing: -0.015em; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color .15s ease; }
.tn-debate-card:hover h2 { color: var(--tn-red, #2563eb); }
.tn-debate-card-intro { display: -webkit-box; overflow: hidden; color: var(--tn-muted, #6b7280); font-size: 13.5px; line-height: 1.62; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tn-debate-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid #f1f5f9;
    color: #64748b; font-size: 12.5px; }
.tn-debate-card-people { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.tn-debate-card-mini { display: none; padding-left: 6px; }
.tn-debate-card-mini .tn-debate-face { width: 24px; height: 24px; margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.tn-debate-card-mini .tn-debate-face b { font-size: 11px; }
.tn-debate-card-stats { display: flex; flex-shrink: 0; align-items: center; gap: 12px; white-space: nowrap; }
.tn-debate-card-views { color: #334155; font-weight: 800; }
.tn-debate-card-stats i { margin-right: 3px; color: #94a3b8; }

/* 카드형 — 기본. 첫 쪽 최신순의 맨 앞(is-feature)은 넓은 화면에서 한 줄 전체를 쓰는 가로 카드 */
.tn-debate-list[data-view="card"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 22px 20px; }
@media (min-width: 900px) {
    .tn-debate-list[data-view="card"] .tn-debate-card.is-feature { grid-column: 1 / -1; flex-direction: row; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-thumb { width: 54%; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-body { justify-content: center; gap: 12px; padding: 30px 34px; }
    .tn-debate-list[data-view="card"] .is-feature h2 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.32; -webkit-line-clamp: 3; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-intro { font-size: 15px; -webkit-line-clamp: 4; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-mini { display: inline-flex; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-mini .tn-debate-face { width: 30px; height: 30px; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-foot { margin-top: 6px; font-size: 13.5px; }
    .tn-debate-list[data-view="card"] .is-feature .tn-debate-card-play { width: 56px; height: 56px; font-size: 18px; opacity: .95; transform: none; }
}

/* 목록형 — 왼쪽 그림, 오른쪽 글 */
.tn-debate-list[data-view="list"] { display: flex; flex-direction: column; gap: 14px; }
.tn-debate-list[data-view="list"] .tn-debate-card { flex-direction: row; border-radius: 14px; }
.tn-debate-list[data-view="list"] .tn-debate-card-thumb { width: 300px; }
.tn-debate-list[data-view="list"] .tn-debate-card-body { justify-content: center; padding: 16px 22px; }
.tn-debate-list[data-view="list"] h2 { font-size: 18px; }
.tn-debate-list[data-view="list"] .tn-debate-card-intro { -webkit-line-clamp: 2; }
.tn-debate-list[data-view="list"] .tn-debate-card-mini { display: inline-flex; }

/* 제목형 — 그림 없이 한 줄씩(회차 목록처럼). 순위가 있으면 맨 앞 칸 */
.tn-debate-list[data-view="compact"] { display: flex; flex-direction: column; border-top: 2px solid var(--tn-ink, #111827); }
.tn-debate-list[data-view="compact"] .tn-debate-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px 6px; border: 0;
    border-bottom: 1px solid var(--tn-line, #e5e7eb); border-radius: 0; background: transparent; overflow: visible; }
.tn-debate-list[data-view="compact"] .tn-debate-card:hover { background: #f8fafc; box-shadow: none; transform: none; }
.tn-debate-list[data-view="compact"] .tn-debate-card-thumb, .tn-debate-list[data-view="compact"] .tn-debate-card-intro { display: none; }
.tn-debate-list[data-view="compact"] .tn-debate-card-rank { display: grid; flex: 0 0 auto; place-items: center; min-width: 28px; height: 28px; padding: 0 7px;
    border-radius: 8px; background: #f1f5f9; color: #475569; font-size: 14px; font-weight: 900; line-height: 1; }
.tn-debate-list[data-view="compact"] .is-top .tn-debate-card-rank { background: var(--tn-red, #2563eb); color: #fff; }
.tn-debate-list[data-view="compact"] .tn-debate-card-rankpill { display: none; }
.tn-debate-list[data-view="compact"] .tn-debate-card-body { flex-direction: row; align-items: center; gap: 18px; padding: 0; }
.tn-debate-list[data-view="compact"] h2 { flex: 1 1 auto; order: 1; font-size: 16px; -webkit-line-clamp: 1; }
.tn-debate-list[data-view="compact"] .tn-debate-card-foot { order: 2; flex: 0 0 auto; gap: 18px; margin: 0; padding: 0; border: 0; }
.tn-debate-list[data-view="compact"] .tn-debate-card-top { order: 3; flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; min-width: 76px; }
.tn-debate-list[data-view="compact"] .tn-debate-card-label { display: none; }
.tn-debate-list[data-view="compact"] .tn-debate-card-mini { display: inline-flex; }

@media (max-width: 767.98px) {
    .tn-debate-listbar { gap: 10px; }
    .tn-debate-listbar-tools { width: 100%; justify-content: space-between; margin-left: 0; }
    .tn-debate-sort a { padding: 6px 11px; font-size: 12.5px; }
    .tn-debate-list[data-view="card"] { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    /* 썸네일 안에 제목·얼굴이 그려져 있어 잘리면 안 된다 — 16:9 그대로, 카드 안쪽에 작게 */
    .tn-debate-list[data-view="list"] .tn-debate-card { align-items: flex-start; }
    .tn-debate-list[data-view="list"] .tn-debate-card-thumb { width: 42%; max-width: 168px; margin: 12px 0 12px 12px; border-radius: 8px; }
    .tn-debate-list[data-view="list"] .tn-debate-card-body { gap: 6px; padding: 12px 14px; }
    .tn-debate-list[data-view="list"] h2 { font-size: 15px; -webkit-line-clamp: 3; }
    .tn-debate-list[data-view="list"] .tn-debate-card-intro, .tn-debate-list[data-view="list"] .tn-debate-card-mini,
    .tn-debate-list[data-view="list"] .tn-debate-card-play, .tn-debate-list[data-view="list"] .tn-debate-card-audio { display: none; }
    .tn-debate-list[data-view="list"] .tn-debate-card-foot { padding-top: 8px; font-size: 12px; }
    .tn-debate-list[data-view="compact"] .tn-debate-card { align-items: flex-start; }
    .tn-debate-list[data-view="compact"] .tn-debate-card-body { flex-wrap: wrap; gap: 6px 12px; }
    .tn-debate-list[data-view="compact"] h2 { flex-basis: 100%; font-size: 15px; -webkit-line-clamp: 2; }
    .tn-debate-list[data-view="compact"] .tn-debate-card-foot { order: 3; flex: 1 1 auto; }
    .tn-debate-list[data-view="compact"] .tn-debate-card-top { order: 2; min-width: 0; }
    .tn-debate-list[data-view="compact"] .tn-debate-card-mini, .tn-debate-list[data-view="compact"] .tn-debate-card-people { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tn-debate-card, .tn-debate-card-thumb > img, .tn-debate-card-play { transition: none; }
    .tn-debate-card:hover, .tn-debate-card:hover .tn-debate-card-thumb > img { transform: none; }
}

/* 카테고리 페이지 '이 분야 AI 토론' 한 줄 */
.tn-debate-strip { margin: 4px 0 22px; padding: 14px 16px; border: 1px solid var(--tn-line, #e5e7eb); border-radius: 14px; background: #fff; }
.tn-debate-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tn-debate-strip-head strong { font-size: 15px; font-weight: 900; }
.tn-debate-strip-head strong i { color: var(--tn-red, #2563eb); }
.tn-debate-strip-head a { color: var(--tn-muted, #6b7280); font-size: 13px; text-decoration: none; }
.tn-debate-strip-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tn-debate-strip-item { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.tn-debate-strip-thumb { display: grid; place-items: center; flex: 0 0 120px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #1e1b4b; color: #fff; }
.tn-debate-strip-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tn-debate-strip-text { display: grid; gap: 3px; min-width: 0; }
.tn-debate-strip-text strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; font-weight: 800; line-height: 1.4; }
.tn-debate-strip-text small { color: #94a3b8; font-size: 12px; }
.tn-debate-strip-item:hover strong { text-decoration: underline; }

/* 얼굴 */
.tn-debate-face { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #e2e8f0; color: #475569; font-weight: 800; flex: 0 0 auto; }
.tn-debate-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tn-debate-face b { font-size: 16px; }
.tn-debate-side { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.tn-debate-side.is-pro { background: #dcfce7; color: #15803d; }
.tn-debate-side.is-con { background: #ffe4e6; color: #be123c; }
.tn-debate-phase { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; font-weight: 800; }

/* 머리 */
/* 배경은 토론마다 고른다(--tn-debate-hero-bg: 그라데이션·단색·어두운 막을 덮은 이미지 — DebatePublication::heroStyle). */
.tn-debate-hero { position: relative; margin: 0 0 18px; padding: clamp(24px, 4vw, 44px); border-radius: 18px; overflow: hidden; color: #fff;
    background: var(--tn-debate-hero-bg, linear-gradient(120deg, #111827 0%, #1e1b4b 55%, #4c1d4b 100%)); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.tn-debate-hero > * { position: relative; }
.tn-debate-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tn-debate-hero-top time { color: rgba(255, 255, 255, .7); font-size: 12.5px; }
.tn-debate-hero h1 { margin: 10px 0 8px; font-size: clamp(22px, 3vw, 34px); font-weight: 900; line-height: 1.3; letter-spacing: -0.02em; }
.tn-debate-intro { margin: 0 0 16px; max-width: 820px; color: rgba(255, 255, 255, .85); font-size: 15px; line-height: 1.7; }
.tn-debate-people { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0; padding: 0; list-style: none; }
.tn-debate-people li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.tn-debate-people .tn-debate-face { width: 30px; height: 30px; }
.tn-debate-people-name { font-size: 13.5px; font-weight: 800; }
.tn-debate-people-title { color: rgba(255, 255, 255, .7); font-size: 12px; }
.tn-debate-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; color: rgba(255, 255, 255, .7); font-size: 12.5px; }

/* 위 줄: 왼쪽 보기 바꾸기, 오른쪽 재생 막대(관리자 화면과 같은 자리). 채팅형에서는 줄 전체가 따라온다. */
.tn-debate-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 0 0 16px; }
.tn-debate-show[data-view="chat"] .tn-debate-toolbar { position: sticky; top: 8px; z-index: 6; }
.tn-debate-toolbar[hidden], .tn-debate-player[hidden] { display: none; }
.tn-debate-viewswitch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 10px; background: #eef1f6; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.tn-debate-viewswitch button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: #64748b;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: background .12s, color .12s; }
.tn-debate-viewswitch button:hover { color: #334155; }
.tn-debate-viewswitch button.is-active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* 재생 막대 — 제어 단추 셋(속도·재생/일시정지·종료) */
.tn-debate-player { display: flex; align-items: center; gap: 6px; width: max-content; max-width: 100%; margin-left: auto;
    padding: 6px 7px; border-radius: 999px; background: linear-gradient(90deg, #7c3aed, #9333ea); color: #fff; box-shadow: 0 10px 24px rgba(124, 58, 237, .32); }
.tn-debate-ctl { height: 32px; min-width: 32px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer; background: rgba(255, 255, 255, .2); color: #fff;
    font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; transition: background .12s; }
.tn-debate-ctl:hover { background: rgba(255, 255, 255, .32); }
.tn-debate-ctl.is-main { background: #fff; color: #6d28d9; }
/* 브라우저가 들어오자마자 소리 내기를 막았을 때 — 첫 클릭에서 시작한다는 것을 재생 단추로 알린다(tnews-debate.js autoStart) */
.tn-debate-player-hint { padding: 0 6px 0 8px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.tn-debate-player.is-waiting .tn-debate-ctl.is-main { animation: tnDebatePulse 1.4s ease-out infinite; }
@keyframes tnDebatePulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .75); }
    100% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .tn-debate-player.is-waiting .tn-debate-ctl.is-main { animation: none; outline: 3px solid rgba(255, 255, 255, .8); outline-offset: 2px; }
}

/* 주고받기 무대 — 참여자 수에 따라 자리 배치(2명 좌우, 3명 위 둘·아래 하나, 4명 네 귀퉁이, 5명 위 셋·아래 둘) */
.tn-debate-stage { --dbt-g1: #8b5cf6; --dbt-g2: #7c3aed; --dbt-dot: #8b5cf6; --dbt-bg: #f5f3ff; --dbt-border: #ddd6fe; --dbt-text: #6d28d9;
    display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) minmax(120px, 160px); gap: 18px 22px; align-items: center;
    margin: 0 0 22px; padding: 22px 20px 16px; border: 1px solid #e6ebf3; border-radius: 18px; background: radial-gradient(120% 80% at 50% 0%, #f8fafc 0%, #eef2f8 100%); }
.tn-debate-stage[hidden] { display: none; }
.tn-debate-stage.is-n2 { grid-template-areas: "a m b" "n n n"; }
.tn-debate-stage.is-n3 { grid-template-areas: "a . b" "m m m" ". c ." "n n n"; }
.tn-debate-stage.is-n4 { grid-template-areas: "a . b" "m m m" "c . d" "n n n"; }
.tn-debate-stage.is-n5 { grid-template-areas: "a e b" "m m m" "c . d" "n n n"; }
.tn-debate-seat { display: grid; justify-items: center; gap: 3px; text-align: center; opacity: .5; filter: saturate(.6); transition: opacity .25s, filter .25s, transform .25s; }
.tn-debate-seat.is-seat-a { grid-area: a; } .tn-debate-seat.is-seat-b { grid-area: b; } .tn-debate-seat.is-seat-c { grid-area: c; }
.tn-debate-seat.is-seat-d { grid-area: d; } .tn-debate-seat.is-seat-e { grid-area: e; }
.tn-debate-stage.is-moderating .tn-debate-seat { opacity: .8; filter: none; }
.tn-debate-seat.is-active { opacity: 1; filter: none; transform: translateY(-2px); }
.tn-debate-seat .tn-debate-face { width: 92px; height: 92px; margin-bottom: 6px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--dbt-border); font-size: 32px; }
.tn-debate-seat.is-active .tn-debate-face { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--dbt-dot), 0 10px 24px rgba(15, 23, 42, .18); }
.tn-debate-seat-name { color: #0f172a; font-size: 14px; font-weight: 800; }
.tn-debate-seat-title { color: #64748b; font-size: 11.5px; }
.tn-debate-seat.is-active::after { content: "● 발언 중"; color: var(--dbt-text); font-size: 10.5px; font-weight: 800; }
.tn-debate-stage-center { grid-area: m; display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 220px; }
.tn-debate-stage-round { padding: 3px 12px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #64748b; font-size: 11.5px; font-weight: 800; }
.tn-debate-stage-bubble { position: relative; width: 100%; max-width: 100%; margin: 0; padding: 14px 16px; border: 1px solid var(--dbt-border); border-radius: 16px; background: var(--dbt-bg); animation: tnDebateIn .28s ease; }
.tn-debate-stage-bubble.is-moderator { --dbt-bg: #f5f7fb; --dbt-border: #e5e9f0; --dbt-text: #475569; --dbt-dot: #64748b; }
.tn-debate-stage-bubble.is-moderator .tn-debate-text { font-style: italic; color: #475569; }
.tn-debate-stage-bubble[data-from]::before { content: ""; position: absolute; width: 14px; height: 14px; transform: rotate(45deg); background: var(--dbt-bg); border: 1px solid var(--dbt-border); }
.tn-debate-stage-bubble[data-from="l"]::before { top: 30px; left: -8px; border-top: 0; border-right: 0; }
.tn-debate-stage-bubble[data-from="r"]::before { top: 30px; right: -8px; border-bottom: 0; border-left: 0; }
.tn-debate-stage-bubble[data-from="tl"]::before { top: -8px; left: 18%; border-bottom: 0; border-right: 0; }
.tn-debate-stage-bubble[data-from="tr"]::before { top: -8px; right: 18%; border-bottom: 0; border-right: 0; }
.tn-debate-stage-bubble[data-from="t"]::before { top: -8px; left: calc(50% - 7px); border-bottom: 0; border-right: 0; }
.tn-debate-stage-bubble[data-from="bl"]::before { bottom: -8px; left: 18%; border-top: 0; border-left: 0; }
.tn-debate-stage-bubble[data-from="br"]::before { bottom: -8px; right: 18%; border-top: 0; border-left: 0; }
.tn-debate-stage-bubble[data-from="b"]::before { bottom: -8px; left: calc(50% - 7px); border-top: 0; border-left: 0; }
.tn-debate-stage-bubble .tn-debate-text { max-height: 260px; overflow-y: auto; font-size: 15px; line-height: 1.7; }
.tn-debate-stage-nav { grid-area: n; display: flex; align-items: center; justify-content: center; gap: 12px; }
.tn-debate-stage-nav button { height: 32px; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; color: #334155; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tn-debate-stage-nav button:disabled { opacity: .45; cursor: default; }
.tn-debate-stage-pos { min-width: 84px; color: #475569; font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
@keyframes tnDebateIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 말풍선 공통(무대·채팅) */
.tn-debate-bubble-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.tn-debate-bubble-head strong { color: var(--dbt-text, #334155); font-size: 14px; font-weight: 800; }
.tn-debate-bubble-head small { color: #64748b; font-size: 12px; }
.tn-debate-bubble-head .tn-debate-phase { margin-left: auto; }
.tn-debate-bubble-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--dbt-border, #e2e8f0); }
.tn-debate-stance { flex: 1 1 100%; color: var(--dbt-text, #475569); font-size: 12px; font-weight: 500; }
.tn-debate-voice { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-width: 0; }
.tn-debate-play { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; background: #fff; color: var(--dbt-text, #6d28d9); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); flex: 0 0 auto; }
.tn-debate-play.is-playing { background: var(--dbt-dot, #8b5cf6); color: #fff; animation: tnDebatePulse 1s ease-in-out infinite; }
@keyframes tnDebatePulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
/* 파형 — 막대 수는 JS(layoutWave)가 폭에 맞춰 정한다: 3px 막대, 2px 틈 */
.tn-debate-wave { display: flex; align-items: center; justify-content: space-between; gap: 2px; flex: 1 1 auto; min-width: 0; height: 36px; cursor: pointer; }
.tn-debate-wave i { flex: 0 0 3px; width: 3px; height: 12%; border-radius: 3px; background: #d8d4f5; background: color-mix(in srgb, var(--dbt-dot, #8b5cf6) 28%, #fff); transition: height .25s ease, background-color .15s ease; }
.tn-debate-wave i.is-played { background: var(--dbt-dot, #8b5cf6); }
.tn-debate-wave.is-loading i { animation: tnDebateWaveLoad 1.2s ease-in-out infinite; }
@keyframes tnDebateWaveLoad { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }

/* 참여자 색 — 자리 순서대로(관리자 화면과 같은 다섯 색) */
.tn-debate-stage .is-p0, .tn-debate-item.is-p0, .tn-debate-sum-person.is-p0 { --dbt-g1: #3b82f6; --dbt-g2: #2563eb; --dbt-dot: #3b82f6; --dbt-bg: #eff6ff; --dbt-border: #bfdbfe; --dbt-text: #1d4ed8; }
.tn-debate-stage .is-p1, .tn-debate-item.is-p1, .tn-debate-sum-person.is-p1 { --dbt-g1: #10b981; --dbt-g2: #059669; --dbt-dot: #10b981; --dbt-bg: #ecfdf5; --dbt-border: #a7f3d0; --dbt-text: #047857; }
.tn-debate-stage .is-p2, .tn-debate-item.is-p2, .tn-debate-sum-person.is-p2 { --dbt-g1: #8b5cf6; --dbt-g2: #7c3aed; --dbt-dot: #8b5cf6; --dbt-bg: #f5f3ff; --dbt-border: #ddd6fe; --dbt-text: #6d28d9; }
.tn-debate-stage .is-p3, .tn-debate-item.is-p3, .tn-debate-sum-person.is-p3 { --dbt-g1: #f59e0b; --dbt-g2: #d97706; --dbt-dot: #f59e0b; --dbt-bg: #fffbeb; --dbt-border: #fde68a; --dbt-text: #b45309; }
.tn-debate-stage .is-p4, .tn-debate-item.is-p4, .tn-debate-sum-person.is-p4 { --dbt-g1: #f43f5e; --dbt-g2: #e11d48; --dbt-dot: #f43f5e; --dbt-bg: #fff1f2; --dbt-border: #fecdd3; --dbt-text: #be123c; }

/* 채팅형(발언 전문) — 관리자 화면처럼 참여자 순서대로 왼쪽·오른쪽, 사회자는 가운데 */
.tn-debate-transcript-title { margin: 0 0 12px; font-size: 18px; font-weight: 900; letter-spacing: -0.01em; }
.tn-debate-show.is-enhanced .tn-debate-transcript-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tn-debate-transcript[hidden] { display: none; }
.tn-debate-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.tn-debate-round { display: flex; justify-content: center; padding: 6px 0; }
.tn-debate-round span { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px; border-radius: 999px; background: #eef1f6; color: #64748b; font-size: 11.5px; font-weight: 800; }
.tn-debate-round span::before, .tn-debate-round span::after { content: ""; width: 26px; height: 2px; border-radius: 2px; background: #cbd5e1; }
.tn-debate-item { display: flex; gap: 12px; align-items: flex-start; }
.tn-debate-item.is-right { justify-content: flex-end; }
.tn-debate-item.is-center { justify-content: center; }
.tn-debate-item .tn-debate-face { width: 40px; height: 40px; box-shadow: 0 2px 6px rgba(15, 23, 42, .12); }
.tn-debate-item .tn-debate-bubble { flex: 0 1 auto; min-width: 0; max-width: 74%; padding: 13px 15px; border: 1px solid var(--dbt-border, #e2e8f0); border-radius: 16px; background: var(--dbt-bg, #f8fafc);
    transition: box-shadow .2s, border-color .2s; }
.tn-debate-item.is-left .tn-debate-bubble { border-top-left-radius: 5px; }
.tn-debate-item.is-right .tn-debate-bubble { border-top-right-radius: 5px; }
.tn-debate-item.is-center .tn-debate-bubble { width: 82%; max-width: 82%; --dbt-bg: #f5f7fb; --dbt-border: #e5e9f0; --dbt-text: #475569; --dbt-dot: #64748b; }
.tn-debate-item.is-moderator .tn-debate-text { font-style: italic; color: #475569; }
.tn-debate-item.is-speaking .tn-debate-bubble { border-color: var(--dbt-dot, #8b5cf6); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dbt-dot, #8b5cf6) 30%, transparent); }
.tn-debate-text { font-size: 15px; line-height: 1.72; word-break: keep-all; overflow-wrap: anywhere; color: #1f2937; }
.tn-debate-audio { width: min(100%, 360px); height: 34px; }

/* 최종 요약 — 접어 두고 누르면 펼친다(관리자 화면과 같다). 칸마다 묶고, 참여자별 입장은 사람마다 카드. */
.tn-debate-summary { margin-top: 26px; border: 1px solid var(--tn-line, #e5e7eb); border-radius: 14px; background: #fff; transition: border-color .15s, background .15s; }
.tn-debate-summary:not([open]):hover { border-color: #c7d2fe; background: #f8faff; }
.tn-debate-summary > summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
.tn-debate-summary > summary::-webkit-details-marker { display: none; }
.tn-debate-summary > summary::after { content: ""; width: 9px; height: 9px; margin: -4px 2px 0 0; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(45deg); transition: transform .2s ease; }
.tn-debate-summary[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.tn-debate-summary-title { font-size: 17px; font-weight: 900; }
.tn-debate-summary-title i { color: var(--tn-red, #2563eb); }
.tn-debate-summary-hint { margin-left: auto; color: #94a3b8; font-size: 12.5px; }
.tn-debate-summary[open] .tn-debate-summary-hint { visibility: hidden; }
.tn-debate-summary-body { display: grid; gap: 14px; padding: 0 20px 20px; }
.tn-debate-sum-sec { padding: 14px 16px; border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc; }
.tn-debate-sum-sec.is-conclusion { border-color: #fde68a; background: #fffbeb; }
.tn-debate-sum-sec.is-people { background: #fff; }
.tn-debate-sum-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #0f172a; font-size: 15px; font-weight: 800; }
.tn-debate-sum-sec h3 i { color: var(--tn-red, #2563eb); font-size: 13px; }
.tn-debate-sum-sec p { margin: 0 0 6px; color: #334155; font-size: 14.5px; line-height: 1.75; }
.tn-debate-sum-sec ul { margin: 0; padding-left: 18px; }
.tn-debate-sum-sec li { color: #334155; font-size: 14px; line-height: 1.7; }
.tn-debate-sum-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tn-debate-sum-person { padding: 14px; border: 1px solid var(--dbt-border, #e2e8f0); border-top: 3px solid var(--dbt-dot, #94a3b8); border-radius: 12px; background: #fff; }
.tn-debate-sum-person header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.tn-debate-sum-person header .tn-debate-face { width: 34px; height: 34px; }
.tn-debate-sum-person header strong { color: var(--dbt-text, #0f172a); font-size: 14.5px; font-weight: 800; }
.tn-debate-sum-person header small { color: #64748b; font-size: 12px; }
.tn-debate-sum-shift { display: grid; gap: 6px; margin-bottom: 4px; }
.tn-debate-sum-shift > div { padding: 8px 10px; border-radius: 8px; background: #f8fafc; }
.tn-debate-sum-shift > div.is-final { background: var(--dbt-bg, #f8fafc); }
.tn-debate-sum-shift small { display: block; color: #64748b; font-size: 11px; font-weight: 800; }
.tn-debate-sum-shift p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.6; }
.tn-debate-sum-person h4 { margin: 10px 0 4px; color: #64748b; font-size: 12px; font-weight: 800; }
.tn-debate-sum-person p { margin: 0; font-size: 13.5px; line-height: 1.65; }
.tn-debate-sum-person ul { padding-left: 16px; }
.tn-debate-sum-person li { font-size: 13.5px; line-height: 1.65; }
.tn-debate-sum-rounds { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.tn-debate-sum-rounds b { display: inline-block; min-width: 28px; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: var(--dbt-bg, #f1f5f9); color: var(--dbt-text, #475569); font-size: 11px; text-align: center; }
/* 연관 기사(2026-10-19) — 토론 근거로 붙인 우리 기사와 같은 일을 다룬 우리 기사. 사진 없으면 매체 로고(.tn-thumb-empty). */
.tn-debate-related { margin-top: 26px; }
.tn-debate-related h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 17px; font-weight: 900; }
.tn-debate-related h2 i { color: var(--tn-red, #2563eb); }
.tn-debate-related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tn-debate-related-list a { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; height: 100%; padding: 10px; border: 1px solid var(--tn-line, #e5e7eb); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.tn-debate-related-list a:hover { border-color: #c7d2fe; background: #f8faff; }
.tn-debate-related-list a:focus-visible { outline: 2px solid var(--tn-red, #2563eb); outline-offset: 2px; }
/* 사진이 있으면 이 칸이 곧 <img>(tnews_article_thumbnail_html, 링크 없이), 없으면 매체 로고를 까는 <span> */
.tn-debate-related-thumb { display: block; width: 112px; height: auto; aspect-ratio: 16 / 10; object-fit: cover; overflow: hidden; border-radius: 8px; background: #f1f5f9; }
.tn-debate-related-body { display: grid; gap: 4px; min-width: 0; }
.tn-debate-related-body strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 800; line-height: 1.45; }
.tn-debate-related-body small { color: var(--tn-muted, #6b7280); font-size: 12px; }
.tn-debate-back { margin: 24px 0 0; }
.tn-debate-back a { color: var(--tn-muted, #6b7280); font-size: 13.5px; }

/* 좁은 화면: 자리를 위에 한 줄로, 말풍선은 넓게(꼬리는 뺀다) */
@media (max-width: 900px) {
    .tn-debate-strip-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .tn-debate-stage { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; padding: 16px 12px 12px; }
    .tn-debate-stage[hidden] { display: none; }
    .tn-debate-seat { flex: 0 0 auto; width: 72px; }
    .tn-debate-seat .tn-debate-face { width: 56px; height: 56px; margin-bottom: 3px; font-size: 20px; }
    .tn-debate-seat-name { font-size: 12px; }
    .tn-debate-seat-title { display: none; }
    .tn-debate-seat.is-active::after { content: "발언 중"; }
    .tn-debate-stage-center, .tn-debate-stage-nav { flex: 1 1 100%; }
    .tn-debate-stage-center { min-height: 0; }
    .tn-debate-stage-bubble[data-from]::before { display: none; }
    .tn-debate-hero { border-radius: 12px; }
    .tn-debate-item { gap: 8px; }
    .tn-debate-item .tn-debate-face { width: 32px; height: 32px; }
    .tn-debate-item .tn-debate-bubble { max-width: calc(100% - 44px); }
    .tn-debate-item.is-center .tn-debate-bubble { width: 100%; max-width: 100%; }
    .tn-debate-summary > summary, .tn-debate-summary-body { padding-left: 14px; padding-right: 14px; }
    .tn-debate-sum-people { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .tn-debate-stage-bubble, .tn-debate-play.is-playing, .tn-debate-wave.is-loading i { animation: none; }
    .tn-debate-seat, .tn-debate-wave i { transition: none; }
}
