* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }

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

/* 왼쪽 아래 셀프 캠 (거울 모드) */
#cam {
  position: fixed;
  left: 2vh;
  bottom: 2vh;
  width: 38vh;
  height: 28.5vh;
  object-fit: cover;
  transform: scaleX(-1);
  border: 0.5vh solid rgba(255, 255, 255, 0.85);
  border-radius: 1.2vh;
  box-shadow: 0 0.8vh 2.4vh rgba(0, 0, 0, 0.45);
  background: #111;
  z-index: 5;
  pointer-events: none;
}

#intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0b0b10;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6vh;
  padding: 4vw;
  text-align: center;
}
#intro.hidden { display: none; }

#intro-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 72px);
  line-height: 1.4;
}
#intro-text b { color: #ffd400; }

#start-btn {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 3.6vw, 60px);
  padding: 0.5em 1.4em;
  border: none;
  border-radius: 999px;
  background: #ffd400;
  color: #111;
  cursor: pointer;
}
#start-btn:disabled { background: #555; color: #bbb; cursor: default; }

#intro-text small { display: block; margin-top: 0.8em; font-size: 0.5em; font-weight: 600; opacity: 0.8; }

#result {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 8, 14, 0.78);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2vh;
  padding: 16px;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  touch-action: manipulation;
}
#result.hidden { display: none; }
#res-title { font-weight: 900; font-size: clamp(26px, 4.4vw, 68px); }
#res-title.boom { color: #ff4040; }
#res-title.safe { color: #ffd400; }
#res-score { font-weight: 900; font-size: clamp(48px, 9vw, 150px); }
#res-new { font-weight: 900; font-size: clamp(22px, 3vw, 44px); color: #ff5ab4; animation: pop 0.6s ease-in-out infinite alternate; }
#res-best { font-weight: 700; font-size: clamp(18px, 2.4vw, 34px); opacity: 0.85; }
.res-hint { font-size: clamp(14px, 1.6vw, 22px); opacity: 0.6; }
#retry-btn {
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(24px, 3.2vw, 52px);
  padding: 0.45em 1.4em;
  border: none;
  border-radius: 999px;
  background: #ffd400;
  color: #111;
  cursor: pointer;
}
@keyframes pop { from { transform: scale(1); } to { transform: scale(1.12); } }
