:root {
  /* palette */
  --p1: #ff2e88;
  --p2: #22e0ff;
  --gold: #ffd23f;
  --gold-2: #ffb02e;
  --ink: #10001f;
  --bg: #07000f;

  /* surfaces + lines */
  --surface: rgba(16, 0, 31, 0.82);
  --surface-strong: rgba(16, 0, 31, 0.7);
  --border: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.1);
  --fill: rgba(255, 255, 255, 0.08);
  --fill-2: rgba(255, 255, 255, 0.1);
  --blur: 8px;

  /* text */
  --text: rgba(255, 255, 255, 0.85);
  --text-dim: rgba(255, 255, 255, 0.6);
  --text-faint: rgba(255, 255, 255, 0.45);

  /* radii */
  --r-sm: 7px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* elevation */
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);

  /* gradients */
  --grad-gold: linear-gradient(92deg, var(--gold), var(--gold-2));
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: 'Poppins', system-ui, sans-serif;
  overflow: hidden;
}

#app {
  position: fixed;
  inset: 0;
}

/* webcam fills the screen; mirror is set inline by JS (the global Mirror toggle),
   defaulting to scaleX(-1) so dancers see themselves naturally */
#cam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  filter: saturate(1.12) brightness(0.85) contrast(1.05);
}

/* 3D avatar layer: above the mirror, below the 2D game UI */
#stage3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- menu overlay ---- */
#menu {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,46,136,0.25), transparent 45%),
    radial-gradient(circle at 75% 80%, rgba(34,224,255,0.25), transparent 45%),
    rgba(7, 0, 15, 0.82);
  backdrop-filter: blur(6px);
  z-index: 10;
  transition: opacity 0.4s ease;
}
#menu.hidden { opacity: 0; pointer-events: none; }

.card {
  width: min(560px, 92vw);
  padding: 40px 42px;
  border-radius: var(--r-lg);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  text-align: center;
}

h1 {
  font-weight: 900;
  font-size: 76px;
  letter-spacing: 0.08em;
  background: linear-gradient(92deg, var(--p1), var(--gold) 55%, var(--p2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255,210,63,0.25));
}

.tag {
  margin: 4px 0 22px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--text-dim);
}

.how {
  text-align: left;
  margin: 0 auto 22px;
  padding-left: 20px;
  max-width: 440px;
  line-height: 1.65;
  font-size: 15px;
  color: var(--text);
}
.how li { margin-bottom: 8px; }
.p1 { color: var(--p1); font-weight: 700; }
.p2 { color: var(--p2); font-weight: 700; }

/* technical spec sheet on the landing */
.specs {
  list-style: none;
  margin: 18px auto 16px;
  max-width: 340px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-dim);
  text-align: left;
}
.specs li {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.specs li:last-child { border-bottom: 0; }
.specs li span {
  color: var(--gold);
  min-width: 74px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hint { margin-top: 10px; font-size: 11.5px; color: var(--text-faint); font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.hint b { color: var(--gold); }

/* ---- unified control panel ---- */
#panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 222px;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-soft);
}
.panel-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.panel-min { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: #fff; cursor: pointer; line-height: 1; }
#panel.collapsed .panel-body { display: none; }
.panel-body { padding: 11px; display: flex; flex-direction: column; gap: 8px; }

/* tabbed sections — keeps the panel short, no scroll */
.tabs { display: flex; gap: 3px; margin: 2px 0 2px; border-bottom: 1px solid var(--border-soft); }
.tab {
  flex: 1; background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--text-faint); padding: 6px 2px; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover { color: var(--text); }
.tabpane { display: flex; flex-direction: column; gap: 9px; padding-top: 2px; }
.tabpane[hidden] { display: none; }
.prow { display: flex; flex-direction: column; gap: 5px; }
.prow > span { color: var(--text-dim); }
.prow b { color: var(--gold); font-weight: 700; }
.prow-group {
  display: flex; flex-direction: column; gap: 9px;
  padding: 10px; border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint);
  transition: opacity 0.2s ease;
}
.prow-group.irrelevant { opacity: 0.32; pointer-events: none; }
.prow.irrelevant { opacity: 0.4; pointer-events: none; transition: opacity 0.2s ease; }
.prow.check { flex-direction: row; align-items: center; gap: 9px; }
.prow.check input { width: 15px; height: 15px; accent-color: var(--gold); }
.prow select, .prow input[type="range"] { width: 100%; }
.prow select {
  font-family: inherit; font-size: 12.5px; color: #fff;
  background: var(--fill); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 8px;
}
.prow select option { color: #111; }
.prow input[type="range"] { accent-color: var(--gold); }
.panel-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.btn {
  font-family: inherit; font-weight: 700; font-size: 12px; cursor: pointer;
  width: 100%; text-align: center;
  color: #fff; background: var(--fill-2);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 9px 12px;
}
.btn.primary { color: var(--ink); background: var(--grad-gold); border: none; }
.btn.rec { color: var(--p1); }
.btn.rec.recording { color: #fff; background: var(--p1); border-color: var(--p1); animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.btn:hover { filter: brightness(1.1); }
.panel-status { margin: 2px 0 0; font-size: 11px; color: var(--text-faint); min-height: 1.3em; }

#startBtn {
  font-family: inherit;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--grad-gold);
  border: none;
  border-radius: var(--r-pill);
  padding: 16px 38px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255,178,46,0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#startBtn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(255,178,46,0.45); }
#startBtn:active { transform: translateY(0); }
#startBtn:disabled { opacity: 0.6; cursor: wait; }

.status {
  margin-top: 18px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.5);
  min-height: 1.4em;
}
