* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: #f8f6ff;
}

body {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 206, 235, 0.72), transparent 26%),
    radial-gradient(circle at 82% 24%, rgba(196, 226, 255, 0.72), transparent 24%),
    radial-gradient(circle at 50% 82%, rgba(216, 205, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #fdfcff 0%, #f4f3ff 46%, #eef5ff 100%);
  color: #473d67;
  overflow: hidden;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Landing page (single button) ---------- */
.landing {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 219, 239, 0.65), transparent 24%),
    radial-gradient(circle at 12% 88%, rgba(184, 224, 255, 0.55), transparent 26%),
    radial-gradient(circle at 88% 72%, rgba(225, 205, 255, 0.44), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 243, 255, 0.92));
}

.landing.hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-evenly;
  gap: 22px;
  width: min(100%, 360px);
  min-height: min(82vh, 720px);
  padding: 30px 22px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 38px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 245, 255, 0.94)),
    linear-gradient(135deg, rgba(255, 222, 236, 0.28), rgba(201, 231, 255, 0.22) 56%, rgba(227, 213, 255, 0.22));
  box-shadow:
    0 22px 55px rgba(168, 169, 222, 0.26),
    0 4px 10px rgba(255, 255, 255, 0.8) inset,
    0 -10px 20px rgba(204, 219, 255, 0.42) inset;
  backdrop-filter: blur(18px) saturate(1.2);
}

.landing-content::before,
.landing-content::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.landing-content::before {
  top: 24px;
  right: 24px;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(255, 185, 226, 0.3), transparent 72%);
  filter: blur(6px);
}

.landing-content::after {
  left: 20px;
  bottom: 90px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(156, 220, 255, 0.28), transparent 70%);
  filter: blur(8px);
}

.landing-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.landing-kicker {
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(235, 223, 255, 0.9));
  color: #8357d8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow:
    0 8px 18px rgba(196, 174, 255, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

.landing-title {
  font-size: 32px;
  line-height: 1.12;
  font-weight: 700;
  color: #5e4a93;
  margin-top: 10px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.landing-notes {
  position: relative;
  z-index: 1;
  list-style: disc;
  padding-left: 26px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #685b8d;
}

.landing-notes li {
  font-size: 19px;
  line-height: 1.58;
  padding-left: 4px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.landing-notes li::marker {
  color: #f08fd4;
}

.load-status {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(240, 239, 255, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 14px 30px rgba(196, 190, 240, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

.load-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #7c73a0;
  font-size: 13px;
}

.load-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(210, 216, 246, 0.7);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(255, 255, 255, 0.85) inset;
}

.load-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #7fd8ff 0%, #66bbff 28%, #ab87ff 62%, #ff88da 100%);
  transition: width 0.25s ease;
  box-shadow:
    0 0 18px rgba(164, 139, 255, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.enter-btn {
  position: relative;
  width: 76%;
  align-self: center;
  background:
    linear-gradient(180deg, #ffe0f4 0%, #ffb8e5 22%, #caa7ff 62%, #8ec8ff 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  padding: 20px 28px;
  border-radius: 50px;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 22px 36px rgba(212, 139, 230, 0.34),
    0 10px 22px rgba(126, 194, 255, 0.24),
    0 4px 12px rgba(255, 255, 255, 0.55) inset,
    0 -10px 18px rgba(171, 132, 255, 0.28) inset,
    0 0 0 6px rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
  text-shadow: 0 2px 10px rgba(124, 78, 204, 0.38);
}

.enter-btn:disabled {
  cursor: wait;
  opacity: 0.9;
  filter: saturate(1);
}

.enter-btn:active {
  transform: scale(0.97);
  box-shadow:
    0 14px 24px rgba(212, 139, 230, 0.28),
    0 6px 14px rgba(126, 194, 255, 0.2),
    0 4px 10px rgba(255, 255, 255, 0.5) inset,
    0 -8px 14px rgba(171, 132, 255, 0.24) inset;
}

.enter-btn::before {
  content: "";
  position: absolute;
  inset: 3px 12% auto;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.1));
  pointer-events: none;
}

/* ---------- 3D viewer (hidden until AR triggers) ---------- */
model-viewer {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  --poster-color: transparent;
}

/* In admin mode, show model-viewer so user can preview */
body.is-admin model-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
}

body.is-admin .landing {
  display: none;
}

/* Hide landing when browser is unsupported */
body.is-unsupported .landing {
  display: none;
}

/* AR message */
.ar-message {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88);
  color: #665a90;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 90%;
  text-align: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 24px rgba(182, 181, 221, 0.2);
}

/* Browser incompatibility warning */
.browser-warning {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  background: rgba(248, 246, 255, 0.96);
}

.warning-content {
  text-align: center;
  padding: 0 32px;
  max-width: 360px;
}

.warning-text {
  color: #7a63c6;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.5;
}

.warning-sub {
  color: #7f789d;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.open-link {
  display: inline-block;
  background: linear-gradient(180deg, #fff, #ecdfff 45%, #dfeeff);
  color: #7255c4;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  box-shadow:
    0 14px 24px rgba(203, 181, 255, 0.24),
    0 3px 8px rgba(255, 255, 255, 0.9) inset;
}

/* ---------- Admin Panel ---------- */
.admin-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(252, 251, 255, 0.94);
  border-top: 2px solid #d9c7ff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 -10px 34px rgba(192, 188, 235, 0.3);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a40;
}

.admin-header h3 {
  color: #68559d;
  font-size: 16px;
  margin: 0;
}

.admin-close-btn {
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid #ddd0ff;
  color: #6b5aa0;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}

.admin-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-label {
  color: #7a7198;
  font-size: 13px;
  min-width: 80px;
  flex-shrink: 0;
}

.admin-row input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #d9def6;
  border-radius: 3px;
  outline: none;
}

.admin-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff9cdb, #7acbff);
  cursor: pointer;
}

.admin-value {
  color: #61557f;
  font-size: 13px;
  font-family: monospace;
  min-width: 45px;
  text-align: right;
}

.admin-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: #6c5ce7;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4def4;
}

.admin-save-btn,
.admin-reset-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.admin-copy-btn {
  background: linear-gradient(180deg, #fff, #ecdfff 45%, #dfeeff);
  color: #7255c4;
}

.admin-reset-btn {
  background: rgba(248, 246, 255, 0.9);
  color: #82789d;
  border: 1px solid #ddd6ef;
}

@media (max-width: 480px) {
  .landing {
    padding: 20px 16px;
  }

  .landing-content {
    width: min(100%, 350px);
    min-height: min(84vh, 680px);
    padding: 28px 18px;
    border-radius: 28px;
  }

  .landing-kicker {
    font-size: 13px;
  }

  .landing-title {
    font-size: 28px;
    margin-top: 10px;
  }

  .landing-notes {
    gap: 16px;
  }

  .landing-notes li {
    font-size: 17px;
  }
}
