:root {
  --mb-primary: #6366F1;
  --mb-secondary: #1E1B4B;
  --mb-accent: #F59E0B;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: transparent !important;
  color: #f8fafc;
  -webkit-tap-highlight-color: transparent;
}

/* Garante que o canvas WebGL fique transparente sobre o <video> da câmara do MindAR */
a-scene, .a-canvas {
  background: transparent !important;
}

/* Remove completamente os botões VR/AR nativos do A-Frame 1.5+ */
.a-enter-vr,
.a-enter-ar,
.a-enter-vr-button,
.a-enter-ar-button,
.a-orientation-modal {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Tela de boas-vindas (desbloqueio de câmara e áudio) */
#mb-welcome {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, var(--mb-secondary), #020617 75%);
  overflow-y: auto;
}

.mb-welcome-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.mb-cover {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 18px;
  margin: 0 auto 14px;
  border: 2px solid var(--mb-accent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  display: block;
}

.mb-greeting {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mb-btn-start {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--mb-primary), var(--mb-accent));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}
.mb-btn-start:active { transform: scale(0.97); }
.mb-btn-start:disabled { opacity: 0.6; cursor: not-allowed; }

.mb-https-alert {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
  padding: 12px;
  border-radius: 14px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: left;
}

/* HUD durante a câmara ativa */
#mb-hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: none;
}

.mb-top-bar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: auto;
}

.mb-pill {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}

.mb-scanner-frame {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(74vw, 300px);
  height: min(74vw, 300px);
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 26px;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mb-scanner-frame.hidden { opacity: 0; }

.mb-bottom-dock {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

#mb-caption {
  max-width: 92vw;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

#mb-speech-bubble {
  display: none;
  max-width: 90vw;
  background: #ffffff;
  color: #0f172a;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.mb-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
}

.mb-round-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.mb-photo-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--mb-primary);
  color: #fff;
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.mb-photo-btn:active { transform: scale(0.92); }

/* Modais (Foto Mágica, Extras/Upsells, Ajuda) */
.mb-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.mb-modal.open { display: flex; }

.mb-modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 24px;
  padding: 20px;
  color: #f8fafc;
}

.mb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mb-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.mb-card-box {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.mb-cta-btn {
  display: inline-block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  background: var(--mb-accent);
  color: #0f172a;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.mb-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #020617;
  color: #fff;
  font-size: 14px;
  margin-bottom: 8px;
}

/* Loading overlay */
#mb-loading {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(2, 6, 23, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
}
.mb-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--mb-accent);
  border-radius: 50%;
  animation: mbspin 0.8s linear infinite;
}
@keyframes mbspin { to { transform: rotate(360deg); } }
