:root {
  color-scheme: dark;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050505;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050505;
}

button {
  font: inherit;
}

.app,
.ar-container,
.screen {
  position: fixed;
  inset: 0;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #050505;
}

.ar-container {
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  background: #050505;
}

.ar-container canvas,
.ar-container video {
  max-width: none;
}

.screen {
  z-index: 30;
  display: grid;
  place-items: center;
  padding:
    calc(28px + env(safe-area-inset-top))
    calc(24px + env(safe-area-inset-right))
    calc(28px + env(safe-area-inset-bottom))
    calc(24px + env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.1), transparent 40%),
    #050505;
}

.screen[hidden],
.status-overlay[hidden],
.status-overlay__button[hidden] {
  display: none;
}

.screen--error {
  z-index: 50;
  background: rgba(5, 5, 5, 0.96);
}

.screen__content {
  width: min(100%, 420px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-size: clamp(30px, 8vw, 48px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}

h2 {
  font-size: clamp(28px, 7vw, 40px);
}

.screen__description {
  margin: 20px auto 0;
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.5;
}

.button {
  width: 100%;
  min-height: 56px;
  margin-top: 32px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #080808;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.button:focus-visible,
.status-overlay__button:focus-visible {
  outline: 3px solid #86d7ff;
  outline-offset: 3px;
}

.status-overlay {
  position: fixed;
  z-index: 20;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.7);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.status-overlay[data-state="found"] {
  border-color: rgba(101, 255, 151, 0.45);
  color: #caffdc;
}

.status-overlay[data-state="error"] {
  border-radius: 18px;
  border-color: rgba(255, 184, 101, 0.55);
  color: #ffe0b7;
}

.status-overlay__button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #080808;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.debug-panel {
  position: fixed;
  z-index: 60;
  right: calc(8px + env(safe-area-inset-right));
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 16px));
  max-height: 42vh;
  margin: 0;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #9dffb2;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

@media (orientation: landscape) and (max-height: 520px) {
  .screen {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .screen__content {
    width: min(100%, 640px);
  }

  h1,
  h2 {
    font-size: clamp(26px, 6vw, 38px);
  }

  .screen__description {
    margin-top: 12px;
  }

  .button {
    min-height: 48px;
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
