/* ===== Reset dasar ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05040a;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ===== Video webcam: full-screen, cover (tidak stretch, sedikit terpotong) ===== */
#webcam {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  /* Cermin horizontal supaya terasa natural seperti bercermin */
  transform: scaleX(-1);
  z-index: 1;
}

/* ===== Canvas Three.js: menumpuk di atas video, latar transparan ===== */
#scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none; /* semua interaksi lewat gestur, bukan mouse */
}

/* ===== Toast indikator ON/OFF ===== */
.toast {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 10;
  padding: 12px 28px;
  border-radius: 999px;
  background: rgba(10, 8, 20, 0.72);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #e9e4ff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.state-on {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.35);
}

.toast.state-off {
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.25);
}

/* ===== Layar loading ===== */
.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05040a;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-text {
  color: #a78bfa;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ===== Debug HUD sementara (bisa dimatikan lewat main.js: DEBUG_HUD = false) ===== */
.debug-hud {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(10, 8, 20, 0.75);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #d1d5db;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  pointer-events: none;
}
