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

/* ── Graphic intro overlay ── */
#intro-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #000; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 0.5s;
}
#intro-img {
  width: 100%; height: 100%; object-fit: contain;
  transition: opacity 0.2s;
}
#intro-skip {
  position: absolute; bottom: 24px; right: 32px;
  font-family: monospace; font-size: 11px; letter-spacing: 3px; color: #333;
}
body { background: #000; color: #fff; font-family: monospace; }

#landing {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; background: #000;
}
#landing-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: fill; pointer-events: none;
}
/* Transparent button overlaying the white bar in the SVG (~top 14%) */
#fs-center-btn {
  position: absolute;
  top: 14.09%; left: 10.88%; width: 78.06%; height: 5.86%;
  background: transparent; border: none; cursor: pointer;
}
/* QR section: center the QR container exactly over the ring focal point.
   room-id is absolute so it doesn't shift the centering. */
#qr-section {
  position: absolute; z-index: 2;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
#qr-container {
  width: min(46vh, 46vw, 380px);
  height: min(46vh, 46vw, 380px);
  display: none;
}
/* QRCode.js hides canvas and shows img — don't override canvas display */
#qr-container > img { width: 100% !important; height: auto !important; display: block !important; }
#qr-container > canvas { display: none !important; }
#room-id {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  color: #555; font-size: 10px; letter-spacing: 2px; font-family: monospace;
  white-space: nowrap;
}

#watermark {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity 0.6s;
}
#watermark img { width: clamp(180px, 28vw, 380px); height: auto; }
#watermark.visible { opacity: 1; }

#status-bar {
  position: fixed; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: #555;
  opacity: 1; transition: opacity 0.8s;
}
#status-bar.hidden { opacity: 0; pointer-events: none; }
#fullscreen-btn {
  background: transparent; border: 1px solid #333; color: #555;
  font-size: 14px; padding: 2px 6px; cursor: pointer; line-height: 1;
}
#fullscreen-btn:hover { border-color: #888; color: #ccc; }
#status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f00; }
#status-dot.connecting { background: #ff0; }
#status-dot.connected  { background: #0f0; }

#output {
  display: none;
  position: fixed; inset: 0;
}
#output video {
  width: 100%; height: 100%; object-fit: contain;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(180deg);
}

/* OBJ shape overlay (screen-side, used in 'screen' processing mode) */
#obj-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
}
#obj-overlay svg { width: 100%; height: 100%; }

/* WebGL canvas for screen-side effects — same positioning as video so rotation works */
#gl-canvas {
  display: none;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; height: 100%;
}

/* Live-stream fullscreen prompt — shown when output is live but not fullscreen */
#live-fs-prompt {
  display: none;
  position: fixed; bottom: 8%; left: 0; right: 0; z-index: 50;
  justify-content: center; align-items: flex-end;
  pointer-events: none; opacity: 0; transition: opacity 0.5s;
}
#live-fs-prompt.show { display: flex; opacity: 1; pointer-events: auto; }
#live-fs-btn {
  background: rgba(0,0,0,0.7); border: 1px solid #fff; color: #fff;
  font-family: monospace; font-size: 18px; letter-spacing: 4px;
  padding: 16px 40px; cursor: pointer;
}
#live-fs-btn:hover { background: rgba(255,255,255,0.1); }

/* Alignment helper overlay */
#align-overlay {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}
#align-overlay.show {
  opacity: 1; visibility: visible;
  transition: opacity 0.8s ease;
}
#align-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#align-confirmed-msg {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  font-family: monospace; font-size: clamp(32px, 8vw, 72px);
  letter-spacing: 0.2em; color: #22ff22;
  opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
#align-confirmed-msg.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

