html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* background on html only: AR.js puts the camera video below body
   (z-index -2), a body background would cover it */
html {
  background: #000;
}

body {
  color: #fff;
  font: 500 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.ui {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
}

.pill {
  position: absolute;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 15px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.3s ease;
}

[data-state="starting"] .pill--starting,
[data-state="scanning"] .pill--scanning {
  opacity: 1;
}

.viewfinder {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62vw, 62vh, 320px);
  height: min(62vw, 62vh, 320px);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

[data-state="scanning"] .viewfinder {
  opacity: 1;
  animation: breathe 2.4s ease-in-out infinite;
}

.viewfinder i {
  position: absolute;
  width: 18%;
  height: 18%;
  border: 0 solid rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.45));
}

.viewfinder i:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 14px; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 14px; }
.viewfinder i:nth-child(3) { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 14px; }
.viewfinder i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 14px; }

@keyframes breathe {
  50% { transform: translate(-50%, -50%) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  [data-state="scanning"] .viewfinder { animation: none; }
}

.card {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: min(86vw, 360px);
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: rgba(22, 22, 24, 0.94);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

[data-state="error"] .card {
  display: block;
}

.card__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
}

.card__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.card__hint {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.card__hint:empty {
  display: none;
}

.card__button {
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.card__button:active {
  transform: scale(0.98);
}

.noscript {
  position: fixed;
  top: 40%;
  left: 0;
  right: 0;
  padding: 0 24px;
  text-align: center;
}
