/* style.css v4 — AR Sticker Engine */

:root { --accent: #FFD700; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ── Camera + canvas ──────────────────────────────────────── */
#cam-feed {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#ar-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ── AR overlays container ────────────────────────────────── */
/* Holds modal, floating video, billboard callouts */
#ar-overlays {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
#ar-overlays > * { pointer-events: auto; }

/* ── Top bar ──────────────────────────────────────────────── */
#topbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: linear-gradient(to bottom,rgba(0,0,0,.6),transparent);
  pointer-events: none;
  z-index: 10;
}
#col-logo { height: 28px; object-fit: contain; }
#col-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); }

/* ── Tracker badge ────────────────────────────────────────── */
#tracker-badge {
  position: absolute; top: 56px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 100px;
  letter-spacing: .4px; text-transform: uppercase;
  pointer-events: none; white-space: nowrap; z-index: 10;
}
.badge-image  { background: rgba(29,158,117,.85); color: #e1f5ee; }
.badge-object { background: rgba(186,117,23,.85);  color: #faeeda; }

/* ── Scan ring ────────────────────────────────────────────── */
#scan-ring {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 220px; height: 220px;
  border: 2.5px solid rgba(255,255,255,.2);
  border-radius: 20px;
  pointer-events: none;
  transition: border-color .3s, box-shadow .3s;
  z-index: 5;
}
#scan-ring::before, #scan-ring::after {
  content:''; position:absolute;
  width:32px; height:32px;
  border-style:solid; border-color:var(--accent);
}
#scan-ring::before { top:-2.5px; left:-2.5px; border-width:3px 0 0 3px; border-radius:10px 0 0 0; }
#scan-ring::after  { bottom:-2.5px; right:-2.5px; border-width:0 3px 3px 0; border-radius:0 0 10px 0; }
#scan-ring.scanning { border-color:rgba(255,255,255,.35); animation:ring-pulse 1.4s ease-in-out infinite; }
#scan-ring.found    { border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,215,0,.2); animation:none; }

@keyframes ring-pulse {
  0%,100% { box-shadow:0 0 0 0 rgba(255,255,255,.15); }
  50%     { box-shadow:0 0 0 14px rgba(255,255,255,0); }
}

/* ── Status ───────────────────────────────────────────────── */
#status-msg {
  position: absolute; bottom: 116px; left: 50%;
  transform: translateX(-50%);
  font-size: 13px; font-weight: 500; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
  white-space: nowrap; pointer-events: none; z-index: 10;
}

/* ── Controls ─────────────────────────────────────────────── */
#controls {
  position: absolute; bottom: 36px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 10;
}
#controls button {
  padding: 13px 30px; border: none; border-radius: 100px;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity .2s, transform .1s;
}
#controls button:active   { transform: scale(.94); }
#controls button:disabled { opacity: .38; pointer-events: none; }
#btn-start { background: var(--accent); color: #0a1628; }
#btn-stop  { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }

/* ══════════════════════════════════════════════════════════════
   ACTION RENDERERS
   ══════════════════════════════════════════════════════════════ */

/* ── Modal backdrop + box ─────────────────────────────────── */
.ar-modal-backdrop {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5);
  padding: 20px;
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 50;
}
.ar-modal-backdrop.ar-modal-visible { opacity: 1; }

.ar-modal-box {
  background: rgba(8,16,34,.97);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  width: 100%;
  padding: 0;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform .25s ease;
  position: relative;
}
.ar-modal-backdrop.ar-modal-visible .ar-modal-box { transform: none; }

.ar-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  color: rgba(255,255,255,.5); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0;
  transition: color .15s;
}
.ar-modal-close:hover { color: #fff; }

.ar-modal-title {
  font-size: 18px; font-weight: 700;
  color: #fff; padding: 20px 44px 0 20px;
  letter-spacing: -.3px;
}

.ar-modal-body {
  font-size: 14px; color: rgba(255,255,255,.75);
  line-height: 1.6;
  padding: 12px 20px 16px;
}
.ar-modal-body p { margin: 0 0 6px; }
.ar-modal-body p:last-child { margin: 0; }

.ar-modal-footer { padding: 0 20px 20px; }

.ar-modal-cta {
  display: inline-block;
  padding: 10px 22px;
  background: var(--accent);
  color: #0a1628;
  font-weight: 700; font-size: 14px;
  border-radius: 100px;
  text-decoration: none;
  transition: opacity .2s;
}
.ar-modal-cta:hover { opacity: .85; }

/* ── Floating video ───────────────────────────────────────── */
.ar-floating-video {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  z-index: 40;
  background: #000;
}
.ar-alpha-video {
  background: transparent;
  box-shadow: none;
}

/* ── Billboard callouts ───────────────────────────────────── */
.ar-callout-billboard {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(8,16,34,.92);
  border: 1px solid rgba(255,255,255,.15);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 7px 12px 7px 10px;
  min-width: 80px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 30;
  backdrop-filter: blur(4px);
  animation: callout-in .2s ease;
}
@keyframes callout-in {
  from { opacity:0; transform:translate(-50%,-50%) scale(.85); }
  to   { opacity:1; transform:translate(-50%,-50%) scale(1); }
}

.ar-callout-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--accent);
  margin-bottom: 2px;
}
.ar-callout-text {
  font-size: 16px; font-weight: 700;
  color: #fff; line-height: 1.2;
}
.ar-callout-sublabel {
  font-size: 11px; color: rgba(255,255,255,.5);
  margin-top: 2px;
}
