/* ============================================
   AR Book — Design System v21
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

:root {
  --accent: #6ee7b7;
  --accent-glow: rgba(110, 231, 183, 0.4);
  --bg-dark: #080810;
  --dev-h: 280px;
}

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

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  background: #000;
  color: #fff;
  user-select: none;
}

/* ---------- AR Viewport ---------- */
#ar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #000;
}

#ar-container video,
#ar-container canvas {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---------- Loading Screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-icon {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(110, 231, 183, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 0 10px var(--accent-glow));
  margin-bottom: 24px;
}

.loading-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  margin-bottom: 8px;
}

.loading-subtitle {
  font-size: 12px;
  color: #666;
  letter-spacing: 0.05em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Status Ribbon ---------- */
#status-ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #222;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-dot.active {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: scale(1.2);
}

.status-dot.lost {
  background: #f87171;
  animation: pulse-red 1s infinite;
}

#status-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}

@keyframes pulse-red {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

/* ---------- Start Button ---------- */
#start-ar-btn {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 18px 48px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 10px 30px rgba(110, 231, 183, 0.4);
}

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

/* ---------- Dev Console ---------- */
#dev-console {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 8, 16, 0.95);
  backdrop-filter: blur(25px);
  border-top: 1px solid rgba(110, 231, 183, 0.2);
  height: var(--dev-h);
  padding: 24px;
  z-index: 2000;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#dev-console.open {
  transform: translateY(0);
}

#dev-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--accent);
  border: none;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 2100;
  box-shadow: 0 4px 15px rgba(110, 231, 183, 0.4);
  transition: all 0.3s ease;
}

#dev-console.open~#dev-toggle {
  bottom: calc(var(--dev-h) + 20px);
  transform: rotate(90deg);
}

.ctrl {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ctrl label {
  width: 60px;
  font-size: 10px;
  color: #666;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ctrl input[type="range"] {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  appearance: none;
  accent-color: var(--accent);
}

.ctrl .v {
  width: 50px;
  font-size: 11px;
  text-align: right;
  color: var(--accent);
  font-family: monospace;
}