/* 슬라이드 엔진(assets/deck.js) 스킨 — 뷰포트를 꽉 채우는 반응형 슬라이드(고정 px 축소 없음).
   글자는 clamp() — 먼저 vw 값(옛 브라우저), 이어서 슬라이드 칸 기준 cqw/cqh 값(container query)이 덮는다.
   넘치면 슬라이드 안쪽(.slide-in)만 스크롤. 전환은 CSS 애니메이션만(prefers-reduced-motion 이면 끔). */
.deck { position: relative; display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; outline: none; }
.deck.is-fs { border-radius: 0; border: 0; background: var(--bg); }
.deck-bar { height: 4px; background: var(--bg-2); flex: none; }
.deck-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.deck-stage { position: relative; flex: 1 1 auto; min-height: 0; container-type: size; overflow: hidden; }
.slide { position: absolute; inset: 0; }
.slide[hidden] { display: none !important; }
.slide-in { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: clamp(14px, 2.4vw, 40px) clamp(14px, 3vw, 56px); padding: clamp(14px, 3.2cqh, 40px) clamp(14px, 4cqw, 60px); }
.slide-box { max-width: 1100px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.slide-box.fill, .slide-box.media { max-width: none; height: 100%; min-height: 0; }
.slide-box.s-center { justify-content: center; text-align: center; align-items: center; }
.slide.in-next { animation: deck-in-next .24s ease-out; }
.slide.in-prev { animation: deck-in-prev .24s ease-out; }
@keyframes deck-in-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes deck-in-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .slide.in-next, .slide.in-prev { animation: none; }
  .deck-bar i, .deck .bl { transition: none !important; }
}

/* 블록 슬라이드 머리 */
.s-head { flex: none; }
.s-kind { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; font-size: clamp(12px, 1.6cqw, 16px); font-weight: 700; color: var(--muted); }
.s-kind .s-stage { font-weight: 500; }
.s-badge { font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 0 9px; margin-left: 4px; }
.s-title { margin-top: 4px; color: var(--accent-dd); line-height: 1.25; font-size: clamp(22px, 2.6vw, 44px); font-size: clamp(22px, 4.2cqw, 48px); }
.s-note { margin-top: 8px; color: var(--muted); white-space: pre-line; font-size: clamp(14px, 1.4vw, 20px); font-size: clamp(14px, 2.1cqw, 21px); }
.s-body { margin-top: clamp(10px, 2.2cqh, 22px); flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.slide-box.fill .s-body, .slide-box.media .s-body { min-height: 0; }

/* 제목·단계·끝 슬라이드 */
.ts-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ts-meta .chip { font-size: clamp(13px, 1.9cqw, 18px); }
.ts-title { margin-top: 14px; color: var(--accent-dd); line-height: 1.18; font-size: clamp(30px, 5vw, 76px); font-size: clamp(30px, 7.2cqw, 80px); }
.ts-sub { margin-top: 10px; color: var(--text); font-size: clamp(16px, 2.6cqw, 28px); }
.ts-std { margin-top: 4px; color: var(--muted); font-size: clamp(13px, 1.9cqw, 18px); font-family: 'Roboto Mono', monospace; }
.ts-code { margin-top: 22px; display: inline-flex; align-items: baseline; gap: 10px; padding: 6px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--accent-l); color: var(--accent-dd); font-size: clamp(14px, 2cqw, 20px); }
.ts-code b { font-family: 'Roboto Mono', monospace; letter-spacing: 3px; font-size: clamp(18px, 3.2cqw, 34px); }
.ts-hint { margin-top: 22px; color: var(--muted); font-size: clamp(13px, 1.7cqw, 17px); }
.ss-step { color: var(--muted); font-weight: 700; font-size: clamp(15px, 2.2cqw, 24px); }
.ss-title { color: var(--accent-dd); line-height: 1.1; font-size: clamp(54px, 9vw, 140px); font-size: clamp(54px, 15cqw, 150px); }
.ss-list { list-style: none; margin-top: 18px; display: grid; gap: 6px; text-align: left; font-size: clamp(15px, 2.2cqw, 24px); counter-reset: ss; }
.ss-list li { display: flex; gap: 10px; align-items: baseline; counter-increment: ss; }
.ss-list li::before { content: counter(ss) "."; color: var(--muted); font-family: 'Roboto Mono', monospace; font-size: .85em; min-width: 1.6em; text-align: right; }
.ss-k { flex: none; }
.end-title { color: var(--accent-dd); font-size: clamp(36px, 8cqw, 90px); }

/* 설명(text) */
.text-body { display: flex; flex-direction: column; }
.bullets { list-style: none; display: grid; gap: clamp(8px, 2cqh, 20px); margin-top: 4px; }
.bullets .bl { position: relative; padding-left: 1.3em; line-height: 1.45; font-size: clamp(18px, 2.4vw, 36px); font-size: clamp(18px, 3.4cqw, 38px); transition: opacity .28s ease, transform .28s ease; }
.bullets .bl::before { content: ''; position: absolute; left: .25em; top: .58em; width: .42em; height: .42em; border-radius: 50%; background: var(--accent); }
.bullets .bl.off { opacity: 0; transform: translateY(8px); visibility: hidden; }
.reveal-hint { margin-top: 16px; color: var(--accent-d); font-weight: 700; font-size: clamp(13px, 1.7cqw, 17px); }
.reveal-hint[hidden] { display: none; }
.text-note { margin-top: clamp(14px, 3cqh, 28px); padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); white-space: pre-line; font-size: clamp(14px, 2cqw, 22px); }

/* 그림(image) */
.media-img { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
/* 그림은 남은 높이를 다 쓰고(flex) 비율은 contain — 작은 그림도 슬라이드 가운데에 크게 */
.media-img img { display: block; flex: 1 1 0; width: 100%; min-height: 160px; object-fit: contain; }
.media-img figcaption { max-width: 900px; text-align: center; color: var(--text); font-size: clamp(14px, 1.9cqw, 21px); }
.img-broken { display: grid; place-items: center; gap: 6px; width: min(100%, 520px); aspect-ratio: 4 / 3; border: 2px dashed var(--line-2); border-radius: 12px; color: var(--muted); text-align: center; padding: 16px; }
.img-broken span:first-child { font-size: 40px; }

/* 영상·시뮬·문서 */
.media-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.media-wrap.fill { align-items: stretch; justify-content: flex-start; }
.deck .frame { position: relative; border-radius: 12px; overflow: hidden; background: #0b1f26; border: 1px solid var(--line); }
.deck .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-v { width: 100%; width: min(100%, calc((100cqh - 150px) * 16 / 9)); aspect-ratio: 16 / 9; }
.media-fill { flex: 1 1 auto; min-height: 280px; width: 100%; }
.media-fill.d { background: #fff; }
.deck .sub-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; width: 100%; }
.deck .sub-actions .url { margin: 0; min-width: 0; }
.deck .url { font-size: 12.5px; color: var(--muted); word-break: normal; overflow-wrap: anywhere; }
.open-card { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.open-card .big-link { width: 100%; min-height: 72px; font-size: clamp(17px, 2.4cqw, 24px); justify-content: space-between; text-align: left; white-space: normal; border-radius: 14px; }

/* 답하는 블록(퀴즈·투표·서술·체크) — l/app.js 의 조작부를 크게 */
.deck .q { font-weight: 500; white-space: pre-line; font-size: clamp(17px, 2.3vw, 30px); font-size: clamp(17px, 3cqw, 32px); line-height: 1.5; }
.deck .choices { max-width: 980px; gap: clamp(8px, 1.6cqh, 14px); }
.deck .choice { min-height: 54px; padding: 12px 14px; font-size: clamp(16px, 2.4cqw, 26px); border-radius: 12px; }
.deck .choice { align-items: center; -webkit-tap-highlight-color: transparent; }
.deck .choice .mark { width: clamp(24px, 3.4cqw, 34px); height: clamp(24px, 3.4cqw, 34px); font-size: clamp(12px, 1.7cqw, 16px); line-height: 1; margin-top: 0; }
.deck textarea.input { min-height: clamp(110px, 24cqh, 220px); font-size: clamp(16px, 2.2cqw, 22px); }
.deck .check { font-size: clamp(16px, 2.4cqw, 26px); padding: 14px 16px; }
.deck .check input { width: 1.1em; height: 1.1em; }

/* 아래 넘김 막대 */
.deck-nav { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.deck-nav .deck-prev { flex: none; }
.deck-nav .deck-next { flex: none; min-width: 112px; margin-left: auto; }
.deck-count { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--accent-dd); font-family: 'Roboto Mono', monospace; font-weight: 500; font-size: 15px; cursor: pointer; }
.deck-count:hover { background: var(--accent-l); }
.deck-fs { flex: none; width: 44px; padding: 0; font-size: 18px; }
.deck-fs[hidden] { display: none; }

/* 슬라이드 목록 격자 */
.deck-grid { position: absolute; inset: 4px 0 0 0; z-index: 4; background: rgba(243,248,249,.97); backdrop-filter: blur(4px); display: flex; flex-direction: column; padding: 14px; }
.deck-grid[hidden] { display: none; }
.deck-grid-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: var(--accent-dd); }
.deck-grid-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-content: start; }
.dg-item { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; text-align: left; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.dg-item:hover { border-color: var(--accent); }
.dg-item[aria-current="true"] { border-color: var(--accent); background: var(--accent-l); box-shadow: inset 0 0 0 1px var(--accent); }
.dg-item.k-stage { background: var(--bg-2); font-weight: 700; }
.dg-no { font-family: 'Roboto Mono', monospace; font-size: 13px; color: var(--muted); min-width: 1.6em; text-align: right; }
.dg-t { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  .deck-nav { gap: 6px; padding: 6px 8px; }
  .deck-nav .lbl { display: none; }
  .deck-nav .deck-prev { width: 52px; padding: 0; }
  .deck-nav .deck-next { min-width: 76px; }
  .deck-nav .deck-next .lbl { display: inline; }
  .deck-grid-list { grid-template-columns: 1fr; }
  .deck .sub-actions { flex-wrap: wrap; }
}
