/* PokeClip 최종 발표 — 무대와 장 공통 스타일.
   장 안의 좌표·색은 tools/build.mjs 가 Figma 값 그대로 인라인으로 넣는다. */

@font-face {
  font-family: 'Pretendard';
  src: url('../assets/fonts/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 45 920;
  font-style: normal;
  font-display: block;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  font-synthesis: none;
}

body.idle {
  cursor: none;
}

/* 화면 비율이 16:9가 아니면 남는 띠를 지금 장의 배경색으로 채운다 */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg, #eef0fb);
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
}

/* ── 장 ─────────────────────────────────────────────── */
.slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
}

.slide.on {
  visibility: visible;
  opacity: 1;
}

.slide .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide .t,
.slide .b,
.slide .v,
.slide .i,
.slide .g {
  position: absolute;
  box-sizing: border-box;
}

/* 글: 상자 안에서 정렬하고, 넘치면 정렬 방향을 지키며 양쪽으로 넘친다 */
.t {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  color: #000;
}

.t.tc {
  justify-content: center;
  text-align: center;
}

.t.tr {
  justify-content: flex-end;
  text-align: right;
}

/* 줄은 왼쪽 정렬 그대로 두고 글 덩어리만 상자 가운데에 놓는다 */
.t.tcb {
  justify-content: center;
}

.t.vc {
  align-items: center;
}

.t.vb {
  align-items: flex-end;
}

.ti {
  flex: none;
  white-space: pre;
}

.t.tw .ti {
  flex: 1 1 auto;
  width: 100%;
  white-space: pre-wrap;
}

.t a {
  color: inherit;
  text-decoration: inherit;
}

.v svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.i {
  display: block;
  max-width: none;
}

[data-href] {
  cursor: pointer;
}

/* 연계 연출에서 앞 장 요소를 복사해 둔 잔상 */
.ghost {
  pointer-events: none;
}

/* ── 화면 비춤 ───────────────────────────────────────── */
#relay {
  position: absolute;
  inset: 0;
  display: flex;
  background: #0b1020;
  z-index: 20;
}

#relay[hidden] {
  display: none;
}

#relay-video {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  object-fit: contain;
  background: #0b1020;
}

#relay.lost::after {
  content: '화면 공유가 꺼져 있습니다';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9fb0d8;
  font-size: 2.4vw;
  font-weight: 700;
}

/* ── 덧씌움 ──────────────────────────────────────────── */
#blackout {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 30;
}

#blackout[hidden],
#hint[hidden],
#digits[hidden] {
  display: none;
}

#hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6vw;
  background: rgb(11 16 32 / 72%);
  z-index: 40;
}

#hint button {
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

#hint-full {
  font-size: 2.2vw;
  font-weight: 700;
  line-height: 1.5;
}

#hint #hint-skip {
  color: #b9c4e6;
  font-size: 1.2vw;
  text-decoration: underline;
}

#digits {
  position: absolute;
  right: 2vw;
  bottom: 2vw;
  padding: 0.4vw 1vw;
  border-radius: 0.6vw;
  background: rgb(11 16 32 / 80%);
  color: #fff;
  font-size: 1.6vw;
  font-weight: 700;
  z-index: 35;
}

/* ── 질의응답 부록 장 ─────────────────────────────────
   js/qa.js 가 slides/appendix.json 으로 만든다. 치수는 「세 가지를 다르게 결정했습니다」 장을 따랐다. */
.qa-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

.qa-body > * {
  margin: 0;
  white-space: nowrap;
}

.qa-label {
  color: #3b82f6;
  font-size: 42px;
  font-weight: 700;
  line-height: 50px;
}

.qa-q {
  color: #13193a;
  font-size: 82px;
  font-weight: 900;
  line-height: 111px;
}

.qa-a {
  margin-top: 2px;
  color: #6b7280;
  font-size: 34px;
  font-weight: 500;
  line-height: 41px;
}

.qa-cards {
  position: absolute;
  top: 290px;
  right: 130px;
  left: 130px;
  display: grid;
  gap: 50px;
  height: 540px;
}

.qa-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 48px 30px 0;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 6px 24px 0 #00000014;
  text-align: center;
}

.qa-chip {
  box-sizing: border-box;
  min-width: 160px;
  height: 46px;
  padding: 0 28px;
  border-radius: 23px;
  background: #3b82f6;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 46px;
  white-space: nowrap;
}

.qa-value {
  height: 98px;
  margin-top: 21px;
  color: #3b82f6;
  font-size: 78px;
  font-weight: 900;
  line-height: 98px;
  white-space: nowrap;
}

.qa-head {
  margin-top: 38px;
  color: #13193a;
  font-size: 36px;
  font-weight: 900;
  line-height: 44px;
  white-space: nowrap;
}

.qa-rule {
  flex: none;
  width: 400px;
  max-width: 100%;
  height: 2px;
  margin-top: 27px;
  background: #e5e7eb;
}

.qa-text {
  margin: 27px 0 0;
  color: #4b5563;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.65;
  white-space: pre-line;
  word-break: keep-all;
}

.qa-foot {
  position: absolute;
  top: 860px;
  right: 130px;
  left: 130px;
  height: 84px;
  margin: 0;
  border-radius: 25px;
  background: #3b82f6;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  line-height: 84px;
  text-align: center;
  white-space: nowrap;
}

.qa-src {
  position: absolute;
  top: 962px;
  left: 130px;
  margin: 0;
  color: #6b7280;
  font-size: 18px;
  line-height: 22px;
  white-space: nowrap;
}

.qa-no {
  position: absolute;
  top: 1034px;
  right: 67px;
  color: #000;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
}

/* ── 인쇄 화면(?print · js/print.js) ──────────────────
   한 장이 1920×1080 한 쪽이다. 화면에서는 창 너비에 맞춰 줄여 보여 준다. */
@page {
  size: 1920px 1080px;
  margin: 0;
}

html.is-print,
html.is-print body {
  height: auto;
  overflow: visible;
  background: #0b1020;
}

html.is-print #loading {
  display: none;
}

/* 무대는 복사가 끝날 때까지 화면 밖에서 제 크기로 그려 둔다.
   display:none 으로 숨기면 글자를 나눌 때(SplitText) 자리를 재지 못해 띄어쓰기가 밀린다. */
html.is-print #viewport {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1920px;
  height: 1080px;
  visibility: hidden;
  pointer-events: none;
}

html.is-print * {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

#print {
  padding: 76px 0 40px;
}

#print .page {
  position: relative;
  width: 1920px;
  height: 1080px;
  margin: 0 auto 24px;
  overflow: hidden;
  zoom: var(--z, 1);
}

#print-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 12px 24px;
  background: #13193a;
  color: #fff;
  font-size: 15px;
}

#print-bar strong {
  font-size: 17px;
  font-weight: 800;
}

#print-bar label {
  cursor: pointer;
}

#print-bar button {
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#print-bar .help {
  color: #aab4d6;
  font-size: 13px;
}

@media print {
  html.is-print,
  html.is-print body {
    background: #fff;
  }

  #print-bar {
    display: none;
  }

  #print {
    padding: 0;
  }

  #print .page {
    margin: 0;
    zoom: 1;
    break-inside: avoid;
  }

  #print .page:not(:last-child) {
    break-after: page;
  }
}

/* 누르면 재생되는 영상 위의 재생 단추(js/engine.js 가 영상 자리에 겹쳐 둔다) */
.slide .vplay {
  position: absolute;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.slide .vplay::before {
  content: '';
  grid-area: 1 / 1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgb(19 25 58 / 62%);
  box-shadow: 0 10px 30px rgb(19 25 58 / 30%), inset 0 0 0 3px rgb(255 255 255 / 85%);
}

.slide .vplay::after {
  content: '';
  grid-area: 1 / 1;
  width: 40px;
  height: 46px;
  margin-left: 10px;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
