:root {
  --bg: #120a06;
  --gold: #caa14a;
  --cream: #f3e6c8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #241407 0%, var(--bg) 70%);
  color: var(--cream);
  font-family: "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 12px 60px;
}

header {
  text-align: center;
  margin-bottom: 16px;
}

header h1 {
  margin: 0 0 4px;
  color: var(--gold);
  letter-spacing: 1px;
}

header p {
  margin: 0;
  opacity: 0.8;
  font-size: 0.95rem;
}

main {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.stage-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* "Kelir" = kain putih layar tempat bayangan wayang muncul */
.kelir {
  position: relative;
  width: min(90vw, 420px);
  aspect-ratio: 320 / 620;
  background:
    radial-gradient(circle at 55% 35%, rgba(255, 224, 150, 0.55) 0%, rgba(255, 224, 150, 0.12) 40%, transparent 70%),
    linear-gradient(#e9dfc4, #d8cba0);
  border: 10px solid #4a2f16;
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(255, 190, 90, 0.25), inset 0 0 40px rgba(0,0,0,0.15);
  overflow: hidden;
}

#wayang-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
}

#lengan-depan, #lengan-belakang {
  transition: transform 0.05s linear;
}

.cam-wrap {
  position: relative;
  width: 220px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

#video {
  width: 100%;
  display: block;
  transform: scaleX(-1); /* mirror biar natural seperti cermin */
}

#overlay {
  position: absolute;
  inset: 0;
  transform: scaleX(-1);
  pointer-events: none;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

#startBtn {
  background: var(--gold);
  color: #241407;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

#startBtn:hover { filter: brightness(1.08); }
#startBtn:disabled { opacity: 0.6; cursor: default; }

#status {
  font-size: 0.85rem;
  opacity: 0.85;
}

.help {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 14px;
}

.help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gold);
}

.help ul {
  margin: 8px 0 4px;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}
