* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #305a2f;
  font-family: -apple-system, "Apple SD Gothic Neo", sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
}

#lineLayer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#hookLine {
  stroke: #262626;
  stroke-width: 2;
  opacity: 0;
}

/* The 3D stage: everything inside #rig shares one perspective camera, so
   the caught photo can tumble/turn in real 3D instead of a flat 2D fake. */
#stage {
  position: fixed;
  inset: 0;
  perspective: 1500px;
  perspective-origin: 50% 46%;
  pointer-events: none;
}

#rig {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: flat;
  transform-origin: 50% 50%;
  will-change: transform;
}

#catchPhoto {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

#mouthMark {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#hud {
  position: fixed;
  top: 5vh;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: clamp(18px, 3.4vh, 30px);
  color: #182010;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.75), 0 0 12px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  white-space: nowrap;
}

#pip {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: min(460px, 30vw);
  aspect-ratio: 4 / 3;
  border: 2px solid #ffffff;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

#pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#start-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2b5f8a, #0e1b2a);
  z-index: 10;
}

#start-overlay.hidden {
  display: none;
}

#start-card {
  text-align: center;
  color: #f4f4f4;
  padding: 40px 56px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  backdrop-filter: blur(6px);
}

#start-card h1 {
  font-size: 40px;
  margin-bottom: 16px;
}

#start-card p {
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 28px;
}

#start-btn {
  font-size: 20px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: #e74c3c;
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

#start-btn:hover {
  background: #ff6b52;
  transform: scale(1.05);
}

#start-error {
  margin-top: 16px;
  margin-bottom: 0;
  color: #ffb4b4;
  font-size: 14px;
  min-height: 18px;
}
