/* Codingmon 졸업작품 발표 — 무대와 장 공통 스타일.
   장 안의 좌표·색은 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;
}

/* 청중 창 첫 화면. 프로젝터 너머에서도 보이게 창 크기에 맞춰 키우고, 화면 전체가 「전체 화면」 단추다.
   글자 크기 하나(em)로 전부 잡아서 창이 작아도 커도 비율이 같다 */
#hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1em;
  background: rgb(8 12 26 / 86%);
  backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  font-size: clamp(16px, min(1.9vw, 3.4vh), 44px);
  cursor: pointer;
  z-index: 40;
}

#hint-title {
  margin: 0;
  font-size: 1.4em;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

#hint-sub {
  margin: 0.5em 0 0;
  color: #b9c4e6;
  font-size: 0.85em;
}

#hint-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8em;
  margin-top: 1.6em;
}

#hint-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  width: 10em;
  height: 2.9em;
  border: 2px solid transparent;
  border-radius: 0.65em;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s;
}

#hint-actions button:focus-visible {
  outline: 0.15em solid #fff;
  outline-offset: 0.2em;
}

#hint-full {
  background: #4c8dff;
  box-shadow: 0 0.3em 1.2em rgb(76 141 255 / 35%);
}

#hint-full:hover {
  background: #6a9fff;
}

#hint-full svg {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#hint-full kbd {
  padding: 0.15em 0.5em;
  border-radius: 0.35em;
  background: rgb(255 255 255 / 22%);
  font: inherit;
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1.4;
}

#hint-skip {
  background: rgb(255 255 255 / 8%);
  border-color: rgb(255 255 255 / 28%);
}

#hint-skip:hover {
  background: rgb(255 255 255 / 16%);
}

#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;
}

/* ── 인쇄 화면(?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 의 grow). 장의 다른 요소 위로 올린다 */
.slide video.full {
  z-index: 10;
}

/* 누르면 재생되는 영상 위의 재생 단추(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%);
}
