:root {
  --ink: #4d5144;
  --ink-soft: rgba(77, 81, 68, 0.62);
  --paper: #eeece3;
  --pill: rgba(255, 253, 246, 0.52);
  --pill-line: rgba(120, 120, 104, 0.24);
  --pill-active: rgba(77, 81, 68, 0.82);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* 顶部柔和渐变，保证标题在场景上可读 */
#ui::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 168px;
  background: linear-gradient(rgba(238, 236, 227, 0.82), rgba(238, 236, 227, 0));
  pointer-events: none;
}

/* 顶部标题 */
#brand {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  text-align: center;
}

#brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

#brand p {
  margin: 6px 0 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

/* 右上角状态 */
#hud {
  position: absolute;
  top: 246px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hud-pill {
  padding: 8px 15px;
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: var(--pill);
  border: 1px solid var(--pill-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hud-pill.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
}

/* 最近交互点提示 */
#context {
  position: absolute;
  left: 50%;
  bottom: 122px;
  transform: translateX(-50%);
  padding: 7px 16px;
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.6);
  border: 1px solid var(--pill-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

#context.hidden {
  opacity: 0;
}

/* 轻提示 */
#toast {
  position: absolute;
  left: 50%;
  bottom: 186px;
  transform: translateX(-50%);
  padding: 9px 18px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(77, 81, 68, 0.86);
  color: #f3f1e7;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#toast.hidden {
  opacity: 0;
  transform: translate(-50%, 6px);
}

/* 底部操作栏 */
#bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(26px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}

#hint {
  position: absolute;
  right: 24px;
  bottom: calc(30px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-align: right;
}

#netHint {
  position: absolute;
  right: 24px;
  bottom: calc(50px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-align: right;
  transition: opacity 0.4s ease;
}

#netHint.hidden {
  opacity: 0;
}

#actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 2px 4px;
  overflow-x: auto;
  pointer-events: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

#actions::-webkit-scrollbar {
  display: none;
}

#actions button {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  min-width: 76px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--pill);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(90, 86, 70, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

#actions button:hover {
  background: rgba(255, 253, 246, 0.78);
}

#actions button:active {
  transform: scale(0.96);
}

#actions button.active {
  background: var(--pill-active);
  color: #f3f1e7;
  border-color: transparent;
}

#actions button.disabled {
  opacity: 0.42;
  cursor: default;
}

#actions button.disabled:hover {
  background: var(--pill);
}

#ctxBtn.hidden {
  display: none;
}

#ctxBtn:not(.hidden) {
  background: rgba(255, 253, 246, 0.74);
}

/* 念珠模式：镜头前的念珠串与计数条 */
#beadHud {
  position: absolute;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 9px 8px 20px;
  border-radius: 999px;
  background: rgba(40, 31, 21, 0.6);
  border: 1px solid rgba(255, 233, 196, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f6e8cf;
  letter-spacing: 0.1em;
  white-space: nowrap;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 30;
}

#beadHud.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 8px);
}

#beadHud .bead-num b {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

#beadHud i {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  opacity: 0.62;
}

#beadClose {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #f6e8cf;
  background: rgba(255, 233, 196, 0.14);
  border: 1px solid rgba(255, 233, 196, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

#beadClose:hover {
  background: rgba(255, 233, 196, 0.26);
}

#beadClose:active {
  transform: scale(0.95);
}

body.beading #bottom,
body.beading #hint,
body.beading #context {
  opacity: 0;
  pointer-events: none;
}

#bottom,
#hint,
#context {
  transition: opacity 0.3s ease;
}


/* 心愿面板 / 瓦供养面板 */
#wishPanel,
#tilePanel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(77, 81, 68, 0.26);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto;
  z-index: 30;
}

#wishPanel.hidden,
#tilePanel.hidden {
  display: none;
}

.wish-card {
  width: min(380px, 86vw);
  padding: 26px 24px 20px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid rgba(120, 120, 104, 0.25);
  box-shadow: 0 18px 50px rgba(40, 40, 32, 0.22);
}

.wish-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.wish-hint {
  margin: -6px 0 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

#wishInput,
#tileInput {
  display: block;
  width: 100%;
  height: 96px;
  padding: 12px 14px;
  resize: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.72);
  border: 1px solid var(--pill-line);
  border-radius: 12px;
  outline: none;
}

#wishInput:focus,
#tileInput:focus {
  border-color: rgba(77, 81, 68, 0.45);
}

.wish-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.wish-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.wish-actions button {
  appearance: none;
  padding: 9px 20px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  border-radius: 999px;
  border: 1px solid var(--pill-line);
  background: var(--pill);
  color: var(--ink);
  cursor: pointer;
}

.wish-actions button.ghost {
  background: transparent;
}

.wish-actions button#wishOk,
.wish-actions button#tileOk {
  background: var(--pill-active);
  color: #f3f1e7;
  border-color: transparent;
}

/* 进入遮罩 */
#boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  z-index: 20;
  transition: opacity 0.9s ease;
  pointer-events: auto;
}

#boot.done {
  opacity: 0;
  pointer-events: none;
}

.boot-inner {
  width: min(260px, 68vw);
  text-align: center;
}

.boot-title {
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.bar {
  margin-top: 18px;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: rgba(77, 81, 68, 0.14);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: rgba(77, 81, 68, 0.55);
}

.boot-sub {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.hidden {
  pointer-events: none;
}

/* ---------------- 小地图 ---------------- */

#mapPanel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 220px;
  padding: 9px 10px 7px;
  border-radius: 16px;
  background: rgba(255, 253, 246, 0.46);
  border: 1px solid rgba(120, 120, 104, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  z-index: 12;
  transition: opacity 0.4s ease;
}

.map-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 3px 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.map-head i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(120, 96, 40, 0.9);
}

#minimap {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: rgba(238, 236, 227, 0.42);
}

.map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 3px 0;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.map-foot .link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 9.5px;
  color: rgba(120, 96, 40, 0.85);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-foot .link.on {
  color: rgba(60, 96, 60, 0.9);
  font-weight: 600;
}

/* ---------------- VIP 房间工具 ---------------- */

#vipTools {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.42);
  border: 1px solid var(--pill-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  transition: opacity 0.35s ease;
  z-index: 14;
}

#vipTools.hidden {
  opacity: 0;
  visibility: hidden;
}

#vipTools button {
  appearance: none;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

#vipTools button:hover {
  background: rgba(255, 253, 246, 0.7);
}

#vipTools #medBtn {
  background: rgba(77, 81, 68, 0.82);
  color: #f3f1e7;
}

/* ---------------- 黑场过渡 ---------------- */

#fade {
  position: absolute;
  inset: 0;
  background: #14140f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.36s ease;
  z-index: 40;
}

#fade.show {
  opacity: 1;
}

/* ---------------- 禅院布置面板 ---------------- */

#roomPanel,
#medPanel,
#medResult {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(77, 81, 68, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto;
  z-index: 34;
}

#roomPanel.hidden,
#medPanel.hidden,
#medResult.hidden {
  display: none;
}

.room-card {
  width: min(440px, 90vw);
  max-height: 76vh;
  overflow-y: auto;
  padding: 24px 22px 18px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid rgba(120, 120, 104, 0.25);
  box-shadow: 0 18px 50px rgba(40, 40, 32, 0.24);
}

.room-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.room-sub {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.room-id {
  margin: -6px 0 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(140, 108, 40, 0.9);
}

.room-section {
  margin-bottom: 14px;
}

.room-section h3 {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.room-styles {
  display: flex;
  gap: 8px;
}

.room-styles button {
  flex: 1;
  appearance: none;
  padding: 9px 6px;
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.7);
  border: 1px solid var(--pill-line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.room-styles button.active {
  background: var(--pill-active);
  color: #f3f1e7;
  border-color: transparent;
}

.room-styles button.locked {
  opacity: 0.72;
  border-style: dashed;
}

.room-styles button.locked::after {
  content: " · VIP";
  font-size: 9px;
  opacity: 0.7;
}

.room-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px dashed var(--pill-line);
  padding-top: 12px;
}

#roomUnlockHint {
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.room-actions button {
  flex: 0 0 auto;
  appearance: none;
  padding: 9px 20px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  border-radius: 999px;
  border: none;
  background: var(--pill-active);
  color: #f3f1e7;
  cursor: pointer;
}

/* ---------------- 冥想 ---------------- */

.med-card {
  width: min(400px, 88vw);
}

.med-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.med-row > span {
  flex: 0 0 46px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.med-opts {
  display: flex;
  flex: 1;
  gap: 7px;
}

.med-opts button {
  flex: 1;
  appearance: none;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.72);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  cursor: pointer;
}

.med-opts button.active {
  background: var(--pill-active);
  color: #f3f1e7;
  border-color: transparent;
}

.med-big {
  margin: 8px 0 10px;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--ink);
}

#medTimer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8vh;
  pointer-events: auto;
  z-index: 36;
}

#medTimer.hidden {
  display: none;
}

.med-timer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: rgba(246, 243, 230, 0.72);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

#medClock {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.16em;
}

.med-timer-inner i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  opacity: 0.7;
}

body.meditating #brand,
body.meditating #hud,
body.meditating #mapPanel,
body.meditating #bottom,
body.meditating #hint,
body.meditating #netHint,
body.meditating #context,
body.meditating #toast,
body.meditating #vipTools {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.meditating #scene {
  cursor: none;
}

@media (max-width: 600px) {
  #brand {
    top: 18px;
  }
  #brand h1 {
    font-size: 18px;
  }
  #hud {
    top: 196px;
    right: 14px;
    gap: 5px;
  }
  #mapPanel {
    top: 14px;
    right: 12px;
    width: 156px;
    padding: 7px 8px 6px;
    border-radius: 14px;
  }
  #minimap {
    width: 140px;
    height: 140px;
  }
  #vipTools {
    bottom: calc(84px + env(safe-area-inset-bottom));
    gap: 5px;
  }
  #vipTools button {
    padding: 8px 13px;
    font-size: 11.5px;
  }
  .hud-pill {
    padding: 6px 12px;
    font-size: 11px;
  }
  #bottom {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
  #actions {
    gap: 7px;
    max-width: calc(100vw - 20px);
  }
  #actions button {
    min-width: 62px;
    padding: 10px 14px;
    font-size: 12.5px;
    letter-spacing: 0.06em;
  }
  #context {
    bottom: 108px;
    font-size: 11px;
  }
  #toast {
    bottom: 166px;
    font-size: 12px;
  }
  #hint {
    left: 0;
    right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom));
    font-size: 10px;
    letter-spacing: 0.06em;
    text-align: center;
  }
  #netHint {
    left: 0;
    right: 0;
    bottom: calc(94px + env(safe-area-inset-bottom));
    font-size: 9.5px;
    text-align: center;
  }
  .wish-card {
    padding: 22px 18px 16px;
  }
}

/* ---------------- 道具库 / 摆放工具条 ---------------- */

.prop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.prop-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  appearance: none;
  padding: 9px 9px;
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.72);
  border: 1px solid var(--pill-line);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.prop-item:hover {
  background: rgba(255, 253, 246, 0.95);
}

.prop-item i {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 5px;
  color: rgba(77, 81, 68, 0.8);
  background: rgba(77, 81, 68, 0.1);
}

.prop-item.vip-only i {
  color: #7a5a12;
  background: rgba(201, 162, 74, 0.22);
}

.prop-item.locked {
  opacity: 0.7;
  border-style: dashed;
}

#propBar {
  position: absolute;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.86);
  border: 1px solid var(--pill-line);
  box-shadow: 0 10px 30px rgba(40, 40, 32, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  z-index: 20;
}

#propBar.hidden {
  display: none;
}

#propBar > span {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}

.prop-btns {
  display: flex;
  gap: 5px;
}

.prop-btns button {
  appearance: none;
  min-width: 34px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.9);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  cursor: pointer;
}

.prop-btns button:hover {
  background: #fffdf6;
}

.prop-btns button.danger {
  color: #8a3a30;
  border-color: rgba(138, 58, 48, 0.35);
}

/* ---------------- VIP 会员弹窗 ---------------- */

#vipModal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 30, 24, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
  z-index: 38;
}

#vipModal.hidden {
  display: none;
}

.vip-card {
  width: min(420px, 90vw);
  padding: 26px 24px 20px;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid rgba(120, 120, 104, 0.25);
  box-shadow: 0 22px 60px rgba(30, 30, 24, 0.3);
}

.vip-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.vip-plans {
  display: flex;
  gap: 10px;
  margin: 18px 0 16px;
}

.vip-plans button {
  flex: 1;
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  font-family: inherit;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.8);
  border: 1px solid var(--pill-line);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.vip-plans button:hover {
  background: rgba(201, 162, 74, 0.14);
  border-color: rgba(201, 162, 74, 0.6);
}

.vip-plans b {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.vip-plans span {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

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

/* 内购模式下隐藏授权码行；非内购模式下隐藏恢复购买按钮 */
#vipCodeRow.hidden,
#vipRestore.hidden {
  display: none;
}

.vip-code-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.9);
  border: 1px solid var(--pill-line);
  border-radius: 10px;
  outline: none;
}

.vip-code-row input:focus {
  border-color: rgba(201, 162, 74, 0.8);
}

.vip-code-row button {
  flex: 0 0 auto;
  appearance: none;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #f3f1e7;
  background: var(--pill-active);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.vip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.vip-actions button {
  appearance: none;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.7);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 600px) {
  #propBar {
    bottom: calc(128px + env(safe-area-inset-bottom));
    gap: 6px;
    padding: 6px 6px 6px 10px;
  }
  .prop-btns button {
    min-width: 30px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .prop-grid {
    gap: 6px;
  }
}

/* ---------------- App / PWA ---------------- */

html,
body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  touch-action: manipulation;
}

#scene {
  touch-action: none;
}

/* 移动端把地图缩一点，给标题和场景留空间 */
@media (max-width: 600px) {
  #brand {
    top: 12px;
    left: 14px;
    right: auto;
    text-align: left;
  }
  #brand h1 {
    font-size: 15px;
    letter-spacing: 0.12em;
  }
  #brand p {
    display: none;
  }
  #mapPanel {
    width: 150px;
    top: 44px;
    right: 10px;
    padding: 7px 8px 6px;
  }
  #minimap {
    width: 130px;
    height: 130px;
  }
  .map-head {
    font-size: 9.5px;
  }
  .map-foot {
    justify-content: flex-end;
    gap: 12px;
    font-size: 9px;
  }
  .map-foot > span:first-child {
    display: none;
  }
  #hint {
    display: none;
  }
  #context {
    bottom: calc(150px + env(safe-area-inset-bottom));
    font-size: 11px;
    max-width: 88vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #hud {
    top: 214px;
    right: 14px;
  }
}

/* 横屏手机 / 矮窗口：压缩顶部与底部，把画面留给场景 */
@media (max-height: 520px) {
  #brand {
    top: 10px;
  }
  #brand h1 {
    font-size: 15px;
    letter-spacing: 0.12em;
  }
  #brand p {
    display: none;
  }
  #mapPanel {
    width: 170px;
    top: 10px;
    right: 10px;
    padding: 6px 7px 5px;
  }
  #minimap {
    width: 144px;
    height: 144px;
  }
  .map-head {
    font-size: 9px;
    padding-bottom: 4px;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }
  #mapArea {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .map-foot {
    font-size: 9px;
  }
  .map-foot > span:first-child {
    display: none;
  }
  #hud {
    top: 218px;
    right: 12px;
  }
  #hint {
    display: none;
  }
  #context {
    bottom: calc(92px + env(safe-area-inset-bottom));
    font-size: 11px;
  }
  #vipTools {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  #vipTools button {
    padding: 7px 14px;
    font-size: 11px;
  }
  #bottom {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  #actions button {
    padding: 7px 14px;
    font-size: 11.5px;
  }
  #propBar {
    bottom: calc(112px + env(safe-area-inset-bottom));
  }
}


