:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft Yahei", -apple-system,
    BlinkMacSystemFont, sans-serif;
  background: #10141c;
  color: #f4f1ea;
  -webkit-user-select: none;
  user-select: none;
}

button {
  font-family: inherit;
}

/* ---------------- MAP SCREEN ---------------- */

#map-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(ellipse at 50% 0%, #2b3a2e 0%, #12160f 70%);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 40px;
}

.map-header {
  text-align: center;
  padding: 28px 20px 14px;
}

.map-header h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #f4ecd8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.map-header p {
  margin: 0;
  font-size: 13px;
  opacity: 0.65;
  letter-spacing: 0.05em;
}

.map-wrap {
  position: relative;
  width: min(94vw, 1400px);
  margin: 10px auto 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.map-wrap img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.map-pin .pin-dot {
  width: clamp(30px, 3.6vw, 46px);
  height: clamp(30px, 3.6vw, 46px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(15px, 1.8vw, 22px);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  animation: pin-pulse 2.6s ease-in-out infinite;
  transition: transform 0.25s ease, background 0.25s ease;
}

.map-pin:hover .pin-dot,
.map-pin:focus-visible .pin-dot {
  transform: scale(1.18);
  background: rgba(255, 255, 255, 0.34);
}

.map-pin .pin-label {
  font-size: clamp(11px, 1.3vw, 14px);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 8, 0.6);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  letter-spacing: 0.03em;
}

.map-pin:hover .pin-label,
.map-pin:focus-visible .pin-label {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.map-footer {
  max-width: 640px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  opacity: 0.55;
  padding: 18px 24px 0;
}

/* ---------------- ZONE / PANORAMA SCREEN ---------------- */

#zone-screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
  background: #000;
}

#zone-screen.active {
  display: block;
}

.panorama {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: #000;
}

.panorama.dragging {
  cursor: grabbing;
}

#pano-canvas {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  filter: blur(24px) brightness(0.7);
  transition: opacity 1.2s ease, filter 1.2s ease;
}

#pano-canvas.revealed {
  opacity: 1;
  filter: blur(0) brightness(1);
}

.creature-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pano-credit {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 18;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* ambient particles: 按园区叠加的轻量氛围层，让真实照片背景有"空气在流动"的感觉 */
.ambient-particles {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  opacity: 0;
  will-change: transform, opacity;
}

.particle.leaf { animation: p-fall linear infinite; font-size: 16px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25)); }
.particle.dust { animation: p-drift linear infinite; background: rgba(255,224,170,0.55); border-radius: 50%; filter: blur(0.5px); }
.particle.bubble { animation: p-rise linear infinite; border: 1px solid rgba(255,255,255,0.45); background: rgba(255,255,255,0.06); border-radius: 50%; }
.particle.star { animation: p-twinkle ease-in-out infinite; background: #fff; border-radius: 50%; box-shadow: 0 0 4px rgba(255,255,255,0.8); }
.particle.mist { animation: p-driftmist linear infinite; background: rgba(255,255,255,0.14); border-radius: 50%; filter: blur(8px); }
.particle.pollen { animation: p-drift linear infinite; background: rgba(255,255,255,0.65); border-radius: 50%; box-shadow: 0 0 3px rgba(255,255,255,0.5); }

@keyframes p-fall {
  0% { transform: translate(0, -8vh) rotate(0deg); opacity: 0; }
  10%, 90% { opacity: 0.8; }
  100% { transform: translate(8vw, 78vh) rotate(360deg); opacity: 0; }
}
@keyframes p-drift {
  0% { transform: translate(0, 0); opacity: 0; }
  12%, 88% { opacity: 0.7; }
  100% { transform: translate(-70vw, -6vh); opacity: 0; }
}
@keyframes p-rise {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  12%, 88% { opacity: 0.6; }
  100% { transform: translateY(-70vh) scale(1.1); opacity: 0; }
}
@keyframes p-twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.9; }
}
@keyframes p-driftmist {
  0% { transform: translateX(0); opacity: 0; }
  15%, 85% { opacity: 0.5; }
  100% { transform: translateX(40vw); opacity: 0; }
}

.creature {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.45));
  transition: filter 0.2s ease;
  will-change: transform;
}

.creature img {
  height: min(38vh, 300px);
  width: auto;
  pointer-events: none;
  animation: bob 5.5s ease-in-out infinite;
}

.creature .creature-tag {
  margin-top: 6px;
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.04em;
  opacity: 0.85;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.creature:hover img,
.creature:focus-visible img {
  filter: brightness(1.08);
}

.creature:hover .creature-tag {
  background: rgba(0, 0, 0, 0.65);
}

.creature.focused .creature-tag {
  opacity: 0;
}

/* focus card: 名称卡片，仿参考视频的 giraffe/lion 标签样式 */
.focus-card {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 8px) scale(0.85);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffaf0;
  color: #2a2118;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.creature.focused .focus-card {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.fc-name {
  cursor: pointer;
  line-height: 1.25;
  text-align: left;
}

.fc-cn {
  font-size: 15px;
  font-weight: 700;
}

.fc-en {
  font-size: 11px;
  opacity: 0.6;
  letter-spacing: 0.03em;
}

.fc-btn {
  border: none;
  background: rgba(0, 0, 0, 0.06);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.fc-btn:hover {
  background: rgba(0, 0, 0, 0.14);
}

.fc-btn:active {
  transform: scale(0.9);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.2%); }
}

/* creature interaction animations */
.creature.playing.shimmer img { animation: bob 5.5s ease-in-out infinite, shimmer-anim 1.2s ease-in-out 2; }
@keyframes shimmer-anim {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.5) saturate(1.4) drop-shadow(0 0 24px rgba(255,255,255,0.7)); }
}

.creature.playing.fade-shy img { animation: bob 5.5s ease-in-out infinite, fade-shy-anim 1.8s ease-in-out 1; }
@keyframes fade-shy-anim {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  40% { opacity: 0.15; transform: translateY(-4%) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.creature.playing.glow img { animation: bob 5.5s ease-in-out infinite, glow-anim 1.6s ease-in-out 2; }
@keyframes glow-anim {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,240,180,0)); }
  50% { filter: drop-shadow(0 0 36px rgba(255,240,180,0.85)) brightness(1.15); }
}

.creature.playing.wing-flare img { animation: bob 5.5s ease-in-out infinite, wing-flare-anim 0.9s ease-in-out 3; }
@keyframes wing-flare-anim {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.06) rotate(-2deg); }
}

.creature.playing.ember-breath img { animation: bob 5.5s ease-in-out infinite, ember-anim 1.4s ease-in-out 2; }
@keyframes ember-anim {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,90,30,0)) brightness(1); }
  50% { filter: drop-shadow(0 0 40px rgba(255,90,30,0.8)) brightness(1.2) saturate(1.3); }
}

.creature.playing.shake img { animation: bob 5.5s ease-in-out infinite, shake-anim 0.4s ease-in-out 4; }
@keyframes shake-anim {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-2%) rotate(-1.5deg); }
  75% { transform: translateX(2%) rotate(1.5deg); }
}

.creature.playing.tail-lash img { animation: bob 5.5s ease-in-out infinite, tail-lash-anim 0.6s ease-in-out 3; }
@keyframes tail-lash-anim {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg) scale(1.02); }
}

.creature.playing.ripple-summon img { animation: bob 5.5s ease-in-out infinite, ripple-anim 1.6s ease-in-out 2; }
@keyframes ripple-anim {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(140,220,255,0)); }
  50% { filter: brightness(1.2) drop-shadow(0 0 34px rgba(140,220,255,0.85)); }
}

.creature.playing.sway img { animation: bob 5.5s ease-in-out infinite, sway-anim 1.6s ease-in-out 2; }
@keyframes sway-anim {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(2deg) translateX(2%); }
}

.creature.playing.stone-wake img { animation: bob 5.5s ease-in-out infinite, stone-wake-anim 1.8s ease-in-out 1; }
@keyframes stone-wake-anim {
  0% { filter: grayscale(1) brightness(0.8); transform: scale(1); }
  50% { filter: grayscale(0.2) brightness(1.05); transform: scale(1.04) rotate(-2deg); }
  100% { filter: grayscale(0) brightness(1); transform: scale(1); }
}

/* ---------------- ZONE UI CHROME ---------------- */

.zone-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent);
  pointer-events: none;
}

.zone-topbar > * {
  pointer-events: auto;
}

.zone-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.zone-title {
  text-align: right;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  padding-right: 104px;
}

.zone-title .cn {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.zone-title .en {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.06em;
}

/* aerial play overlay: 俯视预览 + 播放按钮 */
.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: opacity 0.5s ease;
}

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

.play-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
  animation: pin-pulse 2.2s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.08);
}

.play-hint {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 16px;
  border-radius: 999px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* tour bar: 播放/暂停 + 上一个/下一个 + 计数 */
.tour-bar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
}

.tour-counter {
  font-size: 12.5px;
  color: #fff;
  opacity: 0.75;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  min-width: 52px;
  text-align: center;
  white-space: nowrap;
}

.nav-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gyro-btn {
  position: absolute;
  top: 16px;
  right: 68px;
  z-index: 21;
  display: none;
}

.sound-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 21;
}

/* ---------------- PLACARD ---------------- */

#placard-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}

#placard-overlay.active {
  display: flex;
}

@media (min-width: 760px) {
  #placard-overlay {
    align-items: center;
  }
}

.placard {
  width: min(560px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  background: linear-gradient(165deg, #22201c, #14120f);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px 22px 0 0;
  padding: 22px 24px 28px;
  color: #f4ecd8;
  transform: translateY(30px);
  opacity: 0;
  animation: placard-in 0.32s ease forwards;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
}

@media (min-width: 760px) {
  .placard {
    border-radius: 22px;
  }
}

@keyframes placard-in {
  to { transform: translateY(0); opacity: 1; }
}

.placard-close {
  float: right;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #f4ecd8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.placard-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.placard-head img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5));
}

.placard-head .names .cn {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.placard-head .names .en {
  font-size: 12.5px;
  opacity: 0.6;
  letter-spacing: 0.04em;
}

.placard-origin {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.placard-origin.east { background: rgba(214, 92, 62, 0.25); color: #f0a98a; }
.placard-origin.west { background: rgba(90, 130, 200, 0.25); color: #9dc0f2; }

.placard-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 4px 10px;
  font-size: 13.5px;
  line-height: 1.65;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.placard-row .k {
  opacity: 0.55;
  letter-spacing: 0.03em;
  font-size: 12px;
  text-transform: uppercase;
}

.placard-interact-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #f4ecd8;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.placard-interact-btn:active {
  background: rgba(255,255,255,0.16);
}

/* scrollbar cleanup */
#map-screen::-webkit-scrollbar, .placard::-webkit-scrollbar {
  width: 6px;
}
#map-screen::-webkit-scrollbar-thumb, .placard::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

@media (max-width: 640px) {
  .zone-title .en { display: none; }
  .creature img { height: min(28vh, 220px); }
}
