/* 화면은 집에 내어주고, 글자는 최소한만 얹는다.
   안도의 집을 보러 왔는데 UI 가 앞에 서면 안 된다. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d1116;
  color: #e8eaec;
  font-family: "Pretendard", -apple-system, "Segoe UI", "맑은 고딕", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* 웹캠 미리보기 — 좌우를 뒤집어 거울처럼 보여야 손을 맞추기 쉽다 */
#camwrap {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 200px;
  height: 150px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  pointer-events: none;
  opacity: 0.72;
}

#cam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);   /* 거울 */
  display: block;
}

/* 오버레이는 이미 거울 좌표로 그리므로 여기서 또 뒤집지 않는다 */
#camfx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hud {
  position: fixed;
  left: 18px;
  top: 16px;
  font-size: 13px;
  line-height: 1.55;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

#title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}
#title span {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.6;
  margin-left: 6px;
}

#hud dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 12px;
}
#hud dt { opacity: 0.5; }
#hud dd { margin: 0; }

#status {
  margin-top: 8px;
  color: #ffd79a;
  min-height: 1.2em;
}

#help {
  position: fixed;
  left: 18px;
  bottom: 16px;
  font-size: 12.5px;
  line-height: 1.85;
  opacity: 0.62;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: opacity 0.4s;
}
#help b { font-weight: 600; opacity: 0.95; }

/* 글이 올라오면 조작 안내는 물러난다. 둘이 겹치면 둘 다 안 읽힌다. */
body.reading #help { opacity: 0; }
#help .alt { opacity: 0.6; font-size: 11.5px; }

/* 좁은 화면에서는 안내가 화면을 다 덮으므로 접는다 */
@media (max-height: 560px), (max-width: 620px) {
  #help { display: none; }
  #camwrap { width: 132px; height: 99px; }
}

/* ── 공간에 놓인 글 ─────────────────────────────────────────
   화면 아래 가운데에 조용히 올라온다. 읽는 동안 집을 가리면 안 되므로
   위쪽은 비워 두고, 배경은 글자가 읽힐 만큼만 어둡게 깐다. */
#voice {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  width: min(680px, calc(100vw - 260px));
  padding: 18px 22px 20px;
  background: rgba(10, 13, 17, 0.82);
  backdrop-filter: blur(6px);
  border-left: 2px solid rgba(255, 220, 170, 0.55);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
#voice.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#voice .where {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin-bottom: 9px;
}

/* 지금 몸으로 겪고 있는 것 — 글의 입구 */
#voice .lead {
  font-size: 14.5px;
  line-height: 1.7;
  color: #ffe6bf;
  margin-bottom: 12px;
}

/* 안도 본인의 말. 들여쓰고 세로줄을 둬서 해석과 구분한다. */
#voice .quote {
  font-size: 14px;
  line-height: 1.82;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  margin: 0 0 10px;
}
#voice .quote::before { content: '“'; opacity: 0.5; }
#voice .quote::after  { content: '”'; opacity: 0.5; }

/* 해석. 인용이 아니라는 게 눈으로도 구분돼야 한다. */
#voice .read {
  font-size: 13.5px;
  line-height: 1.8;
  opacity: 0.88;
}

#voice .source {
  margin-top: 11px;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.48;
}

/* 여섯 자리를 다 밟았는지 — 가볍게 세어 준다.
   다 채우려고 한 바퀴 돌게 만드는 게 목적이다. */
#progress {
  position: fixed;
  right: 16px;
  top: 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.55;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
#progress b { font-weight: 600; opacity: 0.95; }

@media (max-height: 560px), (max-width: 620px) {
  #voice { width: calc(100vw - 32px); bottom: 14px; padding: 13px 15px 15px; }
  #voice .quote { font-size: 12.5px; }
  #voice .read { font-size: 12px; }
}
