/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Container do AR */
#ar-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ─── Splash Screen ─── */
#splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), pointer-events 0.6s;
}

#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-logo-img {
  width: 250px;
  max-width: 80%;
  height: auto;
  margin-bottom: 0;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.splash-sub {
  color: #6c7a9c;
  font-size: 0.8rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.loader {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  margin: 0 auto 15px auto;
}

.splash-hint {
  color: #4f5a75;
  font-size: 0.85rem;
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
}

#loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#loading-indicator.hidden {
  display: none;
}

.start-btn {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
  margin-top: 1.5rem;
  width: 260px;
}

.start-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.start-btn.hidden {
  display: none;
}

.start-pc-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  font-family: inherit;
  width: 260px;
}

.start-pc-btn:active {
  transform: scale(0.95);
}

.start-pc-btn.hidden {
  display: none;
}

.agency-footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: #888;
}

.agency-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

/* ─── Scanning HUD ─── */
#scanning-hud {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#scanning-hud.hidden {
  opacity: 0;
}

.scan-frame {
  width: 240px;
  height: 240px;
  position: relative;
  border-radius: 20px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4);
}

.scan-frame::before,
.scan-frame::after,
.scan-corner-br,
.scan-corner-bl {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: #fff;
  border-style: solid;
}

/* Canto superior esquerdo */
.scan-frame::before {
  top: 0; left: 0;
  border-width: 4px 0 0 4px;
  border-radius: 16px 0 0 0;
}

/* Canto superior direito */
.scan-frame::after {
  top: 0; right: 0;
  border-width: 4px 4px 0 0;
  border-radius: 0 16px 0 0;
}

/* Canto inferior direito */
.scan-corner-br {
  bottom: 0; right: 0;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 16px 0;
}

/* Canto inferior esquerdo */
.scan-corner-bl {
  bottom: 0; left: 0;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 16px;
}

.scan-line {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  top: 0;
  animation: scan-anim 2s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
  border-radius: 2px;
  box-shadow: 0 0 8px #fff, 0 0 15px rgba(255, 255, 255, 0.5);
}

.scan-text {
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ─── UI Overlays ─── */
.close-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 70;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 300;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.1);
}

.close-btn.visible {
  display: flex;
}

/* Mensagem de Erro */
#error-msg {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  padding: 0.9rem 1.8rem;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  max-width: 320px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.3);
  display: none;
  animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#error-msg.visible {
  display: block;
}

/* ─── Animações ─── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scan-anim {
  0% { top: 8px; }
  50% { top: calc(100% - 10px); }
  100% { top: 8px; }
}

@keyframes logo-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

@keyframes slide-up {
  from { transform: translate(-50%, 10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ─── Editor GUI Selection Neon ─── */
.neon-highlight > .title {
  box-shadow: inset 0 0 10px #00ffff, 0 0 15px #00ffff !important;
  border: 1px solid #00ffff !important;
  color: #fff !important;
  background-color: rgba(0, 255, 255, 0.2) !important;
  transition: all 0.3s ease;
}
