:root {
  --p1: #ff2e88;   /* player 1 pink */
  --p2: #00e0ff;   /* player 2 cyan */
  --bg: #0b0f2b;
  --accent: #ffd23f;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#app { height: 100%; display: grid; place-items: center; }

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
}

/* Mirror the CAMERA like a real mirror. The canvas is NOT flipped —
   pose coordinates are un-mirrored in code so drawing matches the screen. */
#cam, #scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#cam { transform: scaleX(-1); filter: saturate(1.1) brightness(0.9); }
#scene { z-index: 2; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(11,15,43,0.82), rgba(11,15,43,0.96));
  backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }

h1 {
  font-size: clamp(40px, 9vw, 96px);
  letter-spacing: 1px;
  text-shadow: 0 0 24px rgba(255,46,136,0.6), 0 0 48px rgba(0,224,255,0.4);
}
h2 { font-size: clamp(28px, 5vw, 52px); }
.tag { font-size: clamp(18px, 3vw, 28px); color: var(--accent); }
.hint { font-size: 14px; opacity: 0.7; max-width: 480px; }

button {
  font: inherit;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: bold;
  padding: 16px 34px;
  border: none;
  border-radius: 999px;
  color: #0b0f2b;
  background: linear-gradient(135deg, var(--accent), #ff9f1c);
  cursor: pointer;
  box-shadow: 0 8px 0 #b9791a, 0 12px 24px rgba(0,0,0,0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
button:active { transform: translateY(4px); box-shadow: 0 4px 0 #b9791a, 0 6px 12px rgba(0,0,0,0.4); }

/* Camera picker pill — bottom-left, above everything */
.cam-picker {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  max-width: min(70vw, 340px);
}
.cam-picker.hidden { display: none; }
.cam-ico { font-size: 20px; line-height: 1; }
#camSelect {
  font: inherit;
  font-size: 15px;
  color: #fff;
  background: transparent;
  border: none;
  outline: none;
  max-width: 260px;
  cursor: pointer;
}
#camSelect option { color: #000; }

.spinner {
  width: 64px; height: 64px;
  border: 8px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
