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

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh; /* 动态视口，规避移动端地址栏导致的高度抖动 */
  overflow: hidden;
  background: #09131b; /* 桌面两侧留白底色（舞台外区域） */
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  overscroll-behavior: none; /* 禁止下拉刷新 / 橡皮筋 */
  touch-action: none; /* 禁止浏览器手势（滚动/缩放） */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* 竖屏舞台：手机下铺满，桌面上居中成手机宽列（max-width 480） */
#stage {
  position: fixed;
  inset: 0;
  margin: 0 auto;        /* 配合 left/right:0 实现水平居中 */
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #10202b;
}

#game-root {
  position: absolute;
  inset: 0;
}

#game-root canvas {
  display: block;
  touch-action: none;
}

/* ---------- 暗角叠层 ---------- */
#vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 46%,
    rgba(0, 0, 0, 0) 50%,
    rgba(8, 18, 26, 0.42) 100%
  );
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none; /* 不挡地图点击 */
}

#hud .panel {
  position: absolute;
  background: rgba(20, 41, 61, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#hud-title {
  top: calc(env(safe-area-inset-top) + 14px);
  left: calc(env(safe-area-inset-left) + 14px);
  padding: 4px 8px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  border-radius: 8px;
  border-width: 1px;
}
#hud-title .t1 {
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

#hud-readout {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 16px);
  right: calc(env(safe-area-inset-right) + 16px);
  font-size: 13px;
  line-height: 1.5;
  color: #ffffff;
  text-align: right;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#hud-tip {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  padding: 8px 16px;
  font-size: 13px;
  color: #e8f2f8;
  white-space: nowrap;
  transition: opacity 0.8s ease;
}
#hud-tip.fade {
  opacity: 0;
}

/* ---------- 载入层 ---------- */
#loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #1c3346 0%, #10202b 72%);
  transition: opacity 0.55s ease;
}
#loading.hide {
  opacity: 0;
  pointer-events: none;
}
#loading .l-inner {
  text-align: center;
  color: #cfe3f0;
}
#l-emoji {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
  -webkit-user-drag: none;
}
#l-emoji.pop {
  animation: lpop 0.45s ease;
}
@keyframes lpop {
  0% {
    transform: scale(0.55) rotate(-10deg);
    opacity: 0.15;
  }
  62% {
    transform: scale(1.1) rotate(3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
#loading p {
  font-size: 14px;
  letter-spacing: 2px;
  opacity: 0.85;
}

/* ---------- 传送提示（瞬显瞬隐） ---------- */
#hud-toast {
  position: absolute;
  z-index: 13;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(20, 41, 61, 0.74);
  border: 1.5px solid rgba(143, 227, 255, 0.55);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}
#hud-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- 成长记录入口按钮（M6，右下角；不占右上角） ---------- */
#hud-growth {
  position: absolute;
  right: calc(env(safe-area-inset-right) + 14px);
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  z-index: 20;
  padding: 8px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(20, 41, 61, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
#hud-growth:active { transform: scale(0.95); }

/* ---------- 成长面板（M6） ---------- */
#growth-panel {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 18, 26, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.25s ease;
}
#growth-panel.hide { opacity: 0; pointer-events: none; }
.gp-card {
  width: min(420px, 88vw);
  max-height: 84vh;
  overflow-y: auto;
  background: rgba(18, 36, 52, 0.96);
  border: 1.5px solid rgba(143, 227, 255, 0.35);
  border-radius: 18px;
  padding: 18px 18px 14px;
  color: #eaf4fa;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.gp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
#gp-level {
  font-size: 20px;
  font-weight: 800;
  color: #9fd0ef;
  letter-spacing: 1px;
}
#gp-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
#gp-close:active { transform: scale(0.92); }
.gp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 2px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.gp-row span { color: #9fb4c4; }
.gp-row b { color: #fff; font-weight: 600; }
.gp-sep { height: 10px; }
.gp-ach-title {
  font-size: 13px;
  color: #9fd0ef;
  margin: 10px 2px 6px;
  letter-spacing: 1px;
}
.gp-ach {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 10px;
  opacity: 0.45;
}
.gp-ach.on { opacity: 1; background: rgba(143, 227, 255, 0.1); }
.gp-ach-dot { font-size: 18px; color: #ffd76a; }
.gp-ach.on .gp-ach-dot { color: #ffd76a; }
.gp-ach div { display: flex; flex-direction: column; }
.gp-ach b { font-size: 14px; color: #fff; }
.gp-ach i { font-size: 12px; color: #9fb4c4; font-style: normal; }
.gp-foot {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #7f93a3;
  letter-spacing: 1px;
}

/* ---------- 竖屏锁定提示（仅手机横屏触发） ---------- */
#rotate-tip {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d1c28;
  color: #cfe3f0;
  text-align: center;
  pointer-events: all;
}
#rotate-tip .rt-ico {
  font-size: 60px;
  animation: rtSpin 2.2s ease-in-out infinite;
}
#rotate-tip .rt-text {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 1px;
  opacity: 0.9;
}
@keyframes rtSpin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}
/* 仅在「横屏 且 窄屏(手机/小平板)」时提示旋转；桌面横屏不受影响 */
@media (orientation: landscape) and (max-width: 920px) {
  #rotate-tip { display: flex; }
}

