
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --gold: #c89d59;
  --gold-strong: #b67b30;
  --paper: rgba(255, 249, 240, 0.9);
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: #120807;
  color: #fff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity .9s ease, transform 1s ease;
  background: #120807;
}
.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.screen-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.screen--cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, transparent 0 42%, rgba(0,0,0,.06) 72%, rgba(0,0,0,.18) 100%);
  pointer-events: none;
}

.door-hotspot {
  position: absolute;
  left: 50%;
  top: 74.8%;
  transform: translate(-50%, -50%);
  width: min(22vw, 98px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.door-hotspot::before,
.door-hotspot::after,
.door-hotspot__pulse {
  content: "";
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}
.door-hotspot::before {
  width: 100%; height: 100%;
  border: 1.6px solid rgba(230, 188, 113, .96);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 20px rgba(230,188,113,.32);
}
.door-hotspot::after {
  width: 138%; height: 138%;
  border: 1px solid rgba(230,188,113,.22);
}
.door-hotspot__pulse {
  width: 176%; height: 176%;
  border: 1px solid rgba(230,188,113,.12);
  animation: pulse 2.1s ease-in-out infinite;
}
.door-hotspot:active { transform: translate(-50%, -50%) scale(.98); }
@keyframes pulse {
  0%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(.94); }
  50% { opacity: .82; transform: translate(-50%, -50%) scale(1.03); }
}

.screen--inside { transform: translateY(26px); }
.screen--inside.is-active { transform: translateY(0); }

.toolbar {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: calc(12px + var(--safe-right));
  z-index: 5;
}
.tool-button {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(167, 125, 65, .34);
  border-radius: 50%;
  background: rgba(255, 249, 239, .72);
  backdrop-filter: blur(8px);
  color: #8c6332;
  box-shadow: var(--shadow);
}
.tool-button svg {
  width: 20px; height: 20px;
  fill: currentColor; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.tool-button.is-muted .wave { opacity: .2; }
.tool-button.is-muted { color: #a49178; }

.nav-wrap {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 4;
  width: min(calc(100% - 26px), 430px);
}

.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px 12px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,250,244,.96), rgba(244,232,213,.96));
  border: 1px solid rgba(184, 137, 70, .34);
  box-shadow: 0 10px 26px rgba(95, 58, 24, .16), 0 2px 0 rgba(255,255,255,.6) inset;
  overflow: hidden;
}
.nav-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.28), transparent 35%, transparent 65%, rgba(208,165,101,.12));
  pointer-events: none;
}
.nav-button__ornament {
  position: relative;
  flex: 0 0 46px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(190, 145, 79, .36);
  background: radial-gradient(circle at 35% 30%, #fffef9, #f3e0bf 72%, #ecd2a7 100%);
  box-shadow: 0 4px 12px rgba(133, 90, 34, .16);
}
.nav-button__ornament::before,
.nav-button__ornament::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.nav-button__ornament::before {
  width: 14px; height: 14px;
  border: 1.6px solid var(--gold-strong);
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -55%) rotate(-45deg);
}
.nav-button__ornament::after {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-strong);
  box-shadow: 0 16px 0 -1px rgba(182,123,48,.55);
}
.nav-button__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.nav-button__content small {
  font-size: 11px;
  letter-spacing: .16em;
  color: #b2864f;
  line-height: 1.2;
}
.nav-button__content strong {
  margin-top: 4px;
  color: #6f4b25;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-button__arrow {
  position: relative;
  z-index: 1;
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a87231;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(190,145,79,.28);
}
.nav-button__arrow svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-button:active { transform: scale(.992); }

@media (min-width: 700px) {
  .screen-image { object-fit: contain; background: #120807; }
  .door-hotspot { width: min(13vw, 112px); top: 74.6%; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .screen.is-active, .door-hotspot__pulse { transition: none !important; animation: none !important; }
}
