#pwaBootSplash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  place-items: center;
  background: linear-gradient(150deg, #2f7f48, #87ba58);
  color: #f3fbf8;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  opacity: 1;
  transition: opacity 0.32s ease;
}

@media (display-mode: standalone) {
  #pwaBootSplash {
    display: grid;
  }
}

html.pwa-installed #pwaBootSplash {
  display: grid;
}

html.pwa-splash-skip #pwaBootSplash {
  display: none !important;
}

html.pwa-browser #pwaBootSplash {
  display: none !important;
}

html.pwa-launch-pending #pwaBootSplash {
  display: grid !important;
  opacity: 1 !important;
}

html.pwa-launch-pending body > :not(#pwaBootSplash) {
  visibility: hidden;
}

html.ios-webkit.pwa-launch-pending body > :not(#pwaBootSplash),
html.ios-webkit.pwa-launch-pending body > :not(#pwaBootSplash) * {
  animation: none !important;
  transition: none !important;
}

#pwaBootSplash.is-hide {
  opacity: 0;
  pointer-events: none;
}

.pwa-launch-splash__inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 18px;
}

.pwa-launch-splash__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26);
  background: rgba(255, 255, 255, 0.16);
  object-fit: cover;
  animation: pwaLogoPulse 1.4s ease-in-out infinite;
}

.pwa-launch-splash__title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.pwa-launch-splash__loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(243, 251, 248, 0.92);
}

.pwa-launch-splash__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  animation: pwaSpin 0.9s linear infinite;
}

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

@keyframes pwaLogoPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.045);
  }
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  transition: background 0.26s ease;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

a-scene,
.a-canvas,
#arjs-video,
.ar-overlay {
  touch-action: none;
}

.ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.ar-topbar {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.ar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(28, 74, 44, 0.56);
  color: #f4fff6;
  display: grid;
  place-items: center;
  text-decoration: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}

.ar-icon-btn svg {
  width: 20px;
  height: 20px;
}

.hud {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 96px);
  margin: 0 auto;
  padding: 10px 12px;
  color: #f6fff5;
  background: linear-gradient(145deg, rgba(37, 103, 61, 0.84), rgba(92, 153, 81, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 24px rgba(22, 62, 38, 0.26);
  animation: hudFadeDown 0.4s ease both;
  transition: background 0.26s ease, border-color 0.26s ease;
  pointer-events: auto;
}

.ar-scan-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  width: min(76vw, 340px);
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 20% 20%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  opacity: 1;
  transition: opacity 0.22s ease;
}

.ar-scan-frame.is-hidden {
  opacity: 0;
}

.ar-scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(120, 255, 180, 0),
    rgba(120, 255, 180, 0.88),
    rgba(120, 255, 180, 0)
  );
  top: 14%;
  animation: scanLineMove 2.2s ease-in-out infinite;
}

.ar-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: rgba(255, 255, 255, 0.94);
  border-style: solid;
}

.ar-corner.tl {
  top: 8px;
  left: 8px;
  border-width: 3px 0 0 3px;
  border-radius: 16px 0 0 0;
}

.ar-corner.tr {
  top: 8px;
  right: 8px;
  border-width: 3px 3px 0 0;
  border-radius: 0 16px 0 0;
}

.ar-corner.bl {
  bottom: 8px;
  left: 8px;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 16px;
}

.ar-corner.br {
  bottom: 8px;
  right: 8px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 16px 0;
}

.ar-dock {
  position: absolute;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.93), rgba(241, 250, 239, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.btn {
  border: 1px solid rgba(45, 138, 83, 0.35);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(238, 252, 236, 0.92));
  color: #1f5436;
  text-decoration: none;
  font-weight: 800;
  display: none;
}

.btn-back {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  pointer-events: auto;
  box-shadow: 0 10px 18px rgba(58, 109, 71, 0.2);
}

.btn-back svg {
  width: 20px;
  height: 20px;
}

.btn-detail {
  min-width: 180px;
  height: 52px;
  margin: 0 auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 0 20px;
  pointer-events: auto;
  box-shadow: 0 12px 24px rgba(58, 109, 71, 0.28);
}

.btn-detail svg {
  width: 20px;
  height: 20px;
}

.btn-detail-text {
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.2px;
}

html[data-theme="dark"] .hud {
  background: linear-gradient(145deg, rgba(18, 41, 28, 0.88), rgba(35, 75, 46, 0.78));
}

html[data-theme="dark"] .ar-icon-btn {
  border-color: rgba(166, 209, 181, 0.3);
  background: rgba(18, 33, 24, 0.76);
  color: #d9efdf;
}

html[data-theme="dark"] .ar-scan-frame {
  border-color: rgba(166, 209, 181, 0.24);
}

html[data-theme="dark"] .ar-dock {
  background: linear-gradient(160deg, rgba(18, 31, 24, 0.92), rgba(13, 22, 17, 0.9));
  border-color: rgba(157, 203, 173, 0.2);
}

html[data-theme="dark"] .btn {
  background: linear-gradient(150deg, rgba(23, 42, 31, 0.96), rgba(18, 32, 24, 0.92));
  color: #d9efdf;
  border-color: rgba(157, 203, 173, 0.3);
}

.btn:hover,
.ar-icon-btn:hover {
  transform: translateY(-1px);
}

.debug-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(102px + env(safe-area-inset-bottom));
  z-index: 20;
  background: rgba(21, 53, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  padding: 10px;
  color: #fff;
  display: none;
  animation: hudFadeUp 0.4s ease both;
}

.debug-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
  opacity: 0.9;
}

.debug-row {
  display: flex;
  gap: 8px;
}

.debug-select,
.debug-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.debug-select {
  flex: 1;
}

.debug-btn {
  font-weight: 700;
}

@keyframes hudFadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hudFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scanLineMove {
  0%,
  100% {
    top: 14%;
    opacity: 0.85;
  }

  50% {
    top: 84%;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
