:root {
  color-scheme: dark;
  --cyan: #4ff5ff;
  --cyan-bright: #b9fbff;
  --blue: #168cff;
  --ink: #02070d;
  --panel: rgba(3, 13, 24, 0.78);
  --line: rgba(118, 236, 255, 0.22);
  --hologram-scale: 1;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  min-height: 100dvh;
  color: #f4fdff;
  overscroll-behavior: none;
  touch-action: none;
}

button {
  font: inherit;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 72%, rgba(20, 154, 191, 0.16), transparent 35%),
    linear-gradient(155deg, #061525 0%, #02070d 55%, #030a12 100%);
}

.camera {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.camera-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(0, 8, 18, 0.28), transparent 24%, transparent 69%, rgba(0, 8, 18, 0.45));
  transition: opacity 420ms ease;
}

.app.camera-running .camera-shade {
  opacity: 1;
}

.welcome {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    linear-gradient(rgba(79, 245, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 245, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 46%, #0b2637 0%, #06101c 38%, #02070d 76%);
  background-size: 44px 44px, 44px 44px, auto;
  transition: opacity 480ms ease, visibility 480ms ease;
}

.welcome::after {
  content: "";
  position: absolute;
  width: min(88vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(79, 245, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(22, 140, 255, 0.08), inset 0 0 70px rgba(79, 245, 255, 0.04);
}

.welcome.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.welcome-card {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  padding: clamp(28px, 7vw, 46px) clamp(22px, 7vw, 38px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(9, 30, 48, 0.72), rgba(3, 12, 22, 0.46));
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-mark {
  display: block;
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(79, 245, 255, 0.55));
  animation: mark-pulse 3.5s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 12px;
  color: rgba(185, 251, 255, 0.63);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 11vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

h1 span {
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(79, 245, 255, 0.55);
}

.welcome-copy {
  margin: 18px 0 30px;
  color: rgba(233, 252, 255, 0.72);
  font-size: 1.06rem;
  line-height: 1.5;
}

.start-button,
.error-panel button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 14px 22px;
  border: 1px solid rgba(185, 251, 255, 0.58);
  border-radius: 18px;
  color: #01131a;
  background: linear-gradient(120deg, #b9fbff, #4ff5ff 44%, #24bffc);
  box-shadow: 0 14px 34px rgba(14, 184, 218, 0.23), inset 0 1px 0 #fff;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.start-button:active,
.error-panel button:active {
  transform: scale(0.98);
}

.start-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.start-icon {
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.start-icon::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: 2px auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 19px 0 0;
  color: rgba(221, 249, 252, 0.48);
  font-size: 0.74rem;
  line-height: 1.4;
}

.privacy-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px var(--cyan);
}

.ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.75;
}

.ambient-one {
  top: 9%;
  right: -100px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 172, 255, 0.18), transparent 67%);
}

.ambient-two {
  bottom: -110px;
  left: -90px;
  width: 310px;
  height: 310px;
  background: radial-gradient(circle, rgba(79, 245, 255, 0.13), transparent 67%);
}

.ar-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 18px 12px;
  pointer-events: none;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(0, 7, 14, 0.43);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.live-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69ffac;
  box-shadow: 0 0 10px #69ffac;
}

.close-camera {
  width: 42px;
  height: 42px;
  padding: 0 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 7, 14, 0.43);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.tap-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 12;
  display: grid;
  gap: 18px;
  place-items: center;
  width: min(86vw, 330px);
  padding: 24px;
  border: 0;
  color: #fff;
  background: transparent;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  font-weight: 650;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.tap-ripple {
  position: relative;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(185, 251, 255, 0.8);
  border-radius: 50%;
  background: rgba(4, 28, 40, 0.25);
  box-shadow: 0 0 28px rgba(79, 245, 255, 0.3), inset 0 0 25px rgba(79, 245, 255, 0.15);
  backdrop-filter: blur(4px);
}

.tap-ripple::before,
.tap-ripple::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--cyan);
  border-radius: inherit;
  animation: ripple 2.2s ease-out infinite;
}

.tap-ripple::after {
  animation-delay: 1.1s;
}

.hologram {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 67%;
  width: clamp(170px, 48vw, 300px);
  height: clamp(285px, 54vh, 490px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(var(--hologram-scale));
  transform-origin: center 85%;
  touch-action: none;
  cursor: grab;
  transition: opacity 300ms ease, visibility 300ms ease, filter 200ms ease;
}

.hologram.is-visible {
  opacity: 1;
  visibility: visible;
}

.hologram.is-dragging {
  cursor: grabbing;
  filter: brightness(1.16);
}

.hologram-float {
  position: absolute;
  inset: 0 0 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: float 3.4s ease-in-out infinite;
}

.hologram-media {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0.82;
  filter:
    saturate(0.9)
    hue-rotate(153deg)
    brightness(1.22)
    contrast(1.08)
    drop-shadow(0 0 7px rgba(79, 245, 255, 0.95))
    drop-shadow(0 0 28px rgba(22, 140, 255, 0.62));
}

.hologram-video {
  display: none;
}

.hologram.use-video .hologram-image {
  display: none;
}

.hologram.use-video .hologram-video {
  display: block;
}

.hologram-media::selection {
  background: transparent;
}

.scan-beam {
  position: absolute;
  z-index: 5;
  right: 12%;
  left: 12%;
  height: 2px;
  opacity: 0.8;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--cyan);
  animation: scan 3s linear infinite;
  pointer-events: none;
}

.platform {
  position: absolute;
  z-index: 1;
  bottom: 10px;
  left: 50%;
  width: 76%;
  aspect-ratio: 2.7 / 1;
  border: 2px solid rgba(98, 244, 255, 0.82);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(139, 252, 255, 0.52) 0%, rgba(35, 183, 250, 0.19) 38%, rgba(0, 73, 114, 0.05) 63%, transparent 72%);
  box-shadow: 0 0 12px var(--cyan), 0 0 42px rgba(22, 140, 255, 0.75), inset 0 0 19px rgba(185, 251, 255, 0.58);
  transform: translateX(-50%);
  animation: platform-pulse 2.5s ease-in-out infinite;
}

.platform-core,
.platform-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.platform-core {
  width: 54%;
  height: 54%;
  background: rgba(185, 251, 255, 0.22);
  filter: blur(5px);
}

.platform-orbit {
  width: 120%;
  height: 128%;
  border: 1px dashed rgba(79, 245, 255, 0.42);
  animation: orbit 9s linear infinite;
}

.platform-orbit-two {
  width: 91%;
  height: 158%;
  border-style: solid;
  border-color: rgba(79, 245, 255, 0.22);
  animation-direction: reverse;
  animation-duration: 6s;
}

.controls {
  position: absolute;
  right: 14px;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px));
  z-index: 15;
  display: grid;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 9, 17, 0.48);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.controls.is-visible {
  opacity: 1;
  visibility: visible;
}

.controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(185, 251, 255, 0.16);
  border-radius: 14px;
  color: rgba(238, 253, 255, 0.92);
  background: rgba(9, 37, 52, 0.68);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.controls button:active {
  color: var(--cyan);
  background: rgba(20, 107, 136, 0.64);
  transform: scale(0.94);
}

.drag-hint {
  position: absolute;
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px));
  left: 50%;
  z-index: 10;
  width: max-content;
  max-width: calc(100vw - 150px);
  margin: 0;
  padding: 9px 13px;
  border-radius: 999px;
  opacity: 0;
  visibility: hidden;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 7, 14, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateX(-50%);
  font-size: 0.7rem;
  text-align: center;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.drag-hint.is-visible {
  opacity: 1;
  visibility: visible;
}

.status {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(241, 254, 255, 0.9);
  background: rgba(1, 7, 13, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 0.95rem;
}

.loader {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(79, 245, 255, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.error-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 40;
  width: min(calc(100% - 36px), 430px);
  padding: 30px;
  border: 1px solid rgba(255, 136, 147, 0.28);
  border-radius: 25px;
  color: #f7fcff;
  background: rgba(5, 14, 24, 0.94);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translate(-50%, -50%);
}

.error-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 126, 139, 0.5);
  border-radius: 15px;
  color: #ffb3bb;
  background: rgba(255, 83, 101, 0.1);
  font-size: 1.35rem;
  font-weight: 800;
}

.error-panel h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.error-panel p,
.error-panel li {
  color: rgba(227, 244, 248, 0.68);
  font-size: 0.9rem;
  line-height: 1.55;
}

.error-panel ul {
  margin: 18px 0 24px;
  padding-left: 20px;
}

.error-panel button {
  min-height: 50px;
}

.is-hidden {
  display: none !important;
}

@keyframes mark-pulse {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 16px rgba(79, 245, 255, 0.45)); }
  50% { transform: translateY(-6px); filter: drop-shadow(0 0 27px rgba(79, 245, 255, 0.72)); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-0.35deg); }
  50% { transform: translateY(-12px) rotate(0.35deg); }
}

@keyframes scan {
  0% { top: 8%; opacity: 0; }
  10%, 86% { opacity: 0.8; }
  100% { top: 86%; opacity: 0; }
}

@keyframes platform-pulse {
  0%, 100% { opacity: 0.62; transform: translateX(-50%) scale(0.96); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

@keyframes orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes ripple {
  0% { opacity: 0.85; transform: scale(0.82); }
  100% { opacity: 0; transform: scale(1.65); }
}

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

@media (min-width: 720px) {
  .controls {
    right: 24px;
    bottom: 24px;
    grid-auto-flow: column;
  }

  .drag-hint {
    bottom: 29px;
  }
}

@media (max-height: 640px) {
  .welcome-card {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 15px;
  }

  .welcome-copy {
    margin: 12px 0 20px;
  }

  .privacy-note {
    margin-top: 12px;
  }

  .hologram {
    height: min(68vh, 390px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
