/* 세균을 죽이세요! */
:root {
  --ink: #1d2333;
  --muted: #5c6478;
  --line: #c3c9d6;
  --accent: #2f6fed;
  --bg: #f2f4f8;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  background: var(--bg);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  overflow: hidden;
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  pointer-events: none;
}

.bar .actions { pointer-events: auto; }

.stats { display: flex; gap: 16px; align-items: baseline; }

.stat { margin: 0; display: flex; gap: 6px; align-items: baseline; }

.stat .label { font-size: 12px; color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }

.stat strong { font-size: 20px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums; }

.actions { display: flex; gap: 8px; }

button {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }

button:disabled { opacity: 0.55; cursor: default; }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #10131c;
  overflow: hidden;
}

/* 카메라 영상 자체는 화면에 보이지 않게 하고 손 골격만 캔버스에 그립니다.
   영상 요소는 프레임 분석을 위해 투명한 상태로 DOM에 남겨 둡니다. */
.stage video {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0;
  pointer-events: none;
}

.stage canvas {
  position: absolute;
  left: 0;
  top: 0;
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: rgba(12, 16, 26, 0.72);
  color: #fff;
}

.overlay[hidden] { display: none; }

.overlay p { margin: 0; max-width: 32ch; line-height: 1.55; font-size: 15px; }

.status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  margin: 0;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
  background: rgba(12, 16, 26, 0.6);
}

/* 시작 화면: 게임 시작과 튜토리얼을 고르는 창 */
.start-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: rgba(12, 16, 26, 0.85);
  color: #fff;
  overflow-y: auto;
}

.start-screen[hidden] { display: none; }

.start-inner { width: 100%; max-width: 40ch; }

.start-title { margin: 0 0 8px; font-size: 24px; }

.start-sub {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.start-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.start-buttons[hidden] { display: none; }

.tutorial { text-align: left; }
.tutorial[hidden] { display: none; }

.tutorial-title { margin: 0 0 10px; font-size: 16px; }

.tutorial-list {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
}

.tutorial-list ul { margin: 4px 0 0; padding-left: 18px; }

#tutorialBackBtn { display: block; margin: 0 auto; }

