/* ───────────────────────────────────────────── */
/*  style.css — 전체 스타일                        */
/* ───────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden; background: #000; color: #fff;
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
}
.hidden { display: none !important; }

/* ── 시작 / 오류 화면 ── */
#start-screen, #error-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #2a1a4a, #0a0a1a);
  overflow: auto; padding: 24px;
}
.start-box {
  max-width: 420px; width: 100%; text-align: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 32px 28px; backdrop-filter: blur(8px);
}
.start-box h1 { font-size: 26px; margin-bottom: 12px; }
.start-box p { color: #c9c9e0; line-height: 1.6; margin-bottom: 8px; font-size: 15px; white-space: pre-line; }
.gesture-guide { list-style: none; text-align: left; margin: 18px 0; }
.gesture-guide li {
  padding: 9px 12px; margin: 6px 0; font-size: 14px;
  background: rgba(255,255,255,.05); border-radius: 10px;
}
#start-btn {
  margin-top: 14px; padding: 14px 34px; font-size: 18px; font-weight: 700; color: #fff;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, #ff2d95, #8a2be2);
  box-shadow: 0 6px 20px rgba(255,45,149,.4); transition: transform .1s;
}
#start-btn:hover { transform: translateY(-2px); }
#start-btn:disabled { opacity: .6; cursor: default; transform: none; }
.hint { font-size: 13px !important; color: #9a9ab5 !important; margin-top: 14px !important; }

/* ── 메인 앱 ── */
#app { position: fixed; inset: 0; }

/* 웹캠 + 스켈레톤 캔버스 : 둘 다 화면 꽉 채우고 좌우반전(거울) */
#webcam, #overlay-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;              /* 화면을 꽉 채움 */
  transform: scaleX(-1);          /* 거울 모드 */
}
#overlay-canvas { pointer-events: none; }

/* 상단 상태 바 */
#status-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 20; padding: 10px 22px; border-radius: 999px;
  font-size: 16px; font-weight: 600; white-space: nowrap;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15);
  transition: background .2s;
}
#status-bar.active { background: rgba(255,45,149,.8); border-color: #ff2d95; }

/* 밈 영상 오버레이 */
#meme-overlay {
  position: absolute; inset: 0; z-index: 30; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.88); opacity: 0; transition: opacity .25s ease;
}
#meme-overlay.visible { opacity: 1; }
.meme-video {
  display: none; max-width: 100vw; max-height: 100vh;
  border-radius: 8px; box-shadow: 0 0 60px rgba(255,45,149,.5);
}
.meme-video.shown { display: block; }
#meme-fallback {
  color: #fff; font-size: 22px; text-align: center; line-height: 1.7;
  padding: 24px; white-space: pre-line;
}
#audio-hint {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; font-size: 15px;
  background: rgba(0,0,0,.7);
}

/* 디버그 / 보정 패널 */
#debug-panel {
  position: absolute; left: 12px; bottom: 12px; z-index: 40;
  width: 320px; max-width: calc(100vw - 24px);
  background: rgba(10,10,25,.8); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 10px 12px; font-size: 12px;
  font-family: Consolas, 'D2Coding', monospace;
}
.debug-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; font-weight: 700;
}
#debug-toggle {
  font-size: 11px; padding: 3px 10px; border-radius: 8px; cursor: pointer;
  color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.25);
}
#debug-panel.collapsed #debug-body { display: none; }
#debug-body .fps { margin-bottom: 6px; color: #9ff; }
#debug-body table { width: 100%; border-collapse: collapse; }
#debug-body td {
  padding: 3px 4px; white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
#debug-body td.ex { color: #cdd; }
#debug-body .thr { margin-top: 6px; color: #9a9ab5; }
.on  { color: #39FF14; }
.off { color: #666; }
