/* ============================================================
   3D迷宫探险 —— 全局样式
   移动端优先，兼容横屏/竖屏，触控友好
   ============================================================ */

/* ---------- 主题变量（由 JS 根据主题覆盖 --wall-color 等） ---------- */
:root {
  --bg: #05070c;
  --panel-bg: rgba(14, 20, 32, 0.92);
  --panel-border: rgba(120, 190, 255, 0.28);
  --accent: #35d0ff;
  --accent-2: #7dffb0;
  --danger: #ff5d6c;
  --text: #e8f2ff;
  --text-dim: #93a7c4;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  /* 主题色（科技风默认） */
  --theme-wall: #2a4a6b;
  --theme-floor: #0e1622;
  --theme-fog: #05070c;
  --theme-sky: #0a1420;
}

/* 地牢主题 */
body[data-theme="dungeon"] {
  --accent: #ffb45c;
  --accent-2: #ff8a5c;
  --panel-border: rgba(255, 180, 92, 0.3);
  --theme-wall: #4a3a2a;
  --theme-floor: #17110c;
  --theme-fog: #0a0705;
  --theme-sky: #140e08;
}

/* 森林主题 */
body[data-theme="forest"] {
  --accent: #86e57a;
  --accent-2: #d7ff8a;
  --panel-border: rgba(134, 229, 122, 0.3);
  --theme-wall: #2f5233;
  --theme-floor: #10200f;
  --theme-fog: #071105;
  --theme-sky: #0d1c10;
}

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;          /* 移动端防止地址栏抖动与回弹 */
  inset: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  touch-action: none;       /* 阻止页面滚动/缩放 */
}

#app {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* 3D 画布 */
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: var(--theme-sky);
}

/* 视角触控层：铺满全屏，但 HUD 元素层级更高（pointer-events:auto 时才会拦截） */
#look-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  touch-action: none;
}

/* ---------- 通用屏幕/面板 ---------- */
.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r))
           calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
  background: radial-gradient(circle at 50% 20%, rgba(20, 40, 70, 0.55), rgba(3, 6, 12, 0.94));
  backdrop-filter: blur(2px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.panel {
  width: 100%;
  max-width: 620px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 18px calc(22px + var(--safe-b));
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.panel-narrow { max-width: 440px; }

.panel-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* ---------- 主菜单 ---------- */
.game-title {
  font-size: clamp(30px, 9vw, 46px);
  font-weight: 900;
  text-align: center;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(53, 208, 255, 0.35));
  margin-bottom: 6px;
}

.subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 18px;
}

.section-label {
  font-size: 13px;
  color: var(--text-dim);
  margin: 14px 0 8px;
  letter-spacing: 1px;
}

/* 难度卡片 */
.diff-list { display: flex; flex-direction: column; gap: 10px; }

.diff-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(120, 190, 255, 0.18);
  background: rgba(20, 30, 46, 0.72);
  color: var(--text);
  font-family: inherit;
  transition: all 0.18s ease;
  cursor: pointer;
  min-height: 62px;
}

.diff-card .diff-name { font-size: 17px; font-weight: 700; }
.diff-card .diff-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.diff-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(53, 208, 255, 0.16), rgba(125, 255, 176, 0.1));
  box-shadow: 0 0 0 1px rgba(53, 208, 255, 0.4), 0 6px 20px rgba(53, 208, 255, 0.18);
}

.diff-card:active { transform: scale(0.985); }

/* 种子行 */
.seed-row { display: flex; gap: 8px; }

.text-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(120, 190, 255, 0.22);
  background: rgba(10, 16, 26, 0.9);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
.text-input:focus { outline: none; border-color: var(--accent); }

/* 记录列表 */
.record-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.record-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(20, 30, 46, 0.6);
  font-size: 14px;
  color: var(--text-dim);
}
.record-list li b { color: var(--accent); font-variant-numeric: tabular-nums; }
.record-list li.done { color: var(--accent-2); }

.achievements { margin-top: 14px; }
.achievements summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dim);
  padding: 8px 0;
}

.hint-text {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-dim);
  text-align: center;
  opacity: 0.85;
}

.muted { color: var(--text-dim); font-size: 13px; text-align: center; }

/* ---------- 按钮 ---------- */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.primary-btn, .secondary-btn, .mini-btn, .action-btn, .icon-btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, filter 0.16s ease, background 0.16s ease;
}
.primary-btn:active, .secondary-btn:active,
.mini-btn:active, .action-btn:active, .icon-btn:active { transform: scale(0.96); }

.primary-btn {
  flex: 1;
  padding: 15px 18px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 22px rgba(53, 208, 255, 0.3);
  min-height: 52px;
}

.secondary-btn {
  flex: 1;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: rgba(30, 44, 66, 0.9);
  border: 1.5px solid rgba(120, 190, 255, 0.22);
  min-height: 52px;
}

.mini-btn {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: rgba(30, 44, 66, 0.9);
  border: 1.5px solid rgba(120, 190, 255, 0.2);
  min-height: 44px;
  white-space: nowrap;
}
.mini-btn.wide { width: 100%; margin-top: 10px; }

.menu-vertical { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 加载条 ---------- */
.loading-bar {
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: rgba(120, 190, 255, 0.15);
  overflow: hidden;
  margin: 10px 0 12px;
}
.loading-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

/* ============================================================
   游戏内 HUD
   ============================================================ */
#hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;    /* 默认不拦截，具体控件单独开启 */
}

/* 顶部状态栏 */
.hud-top {
  position: absolute;
  top: calc(8px + var(--safe-t));
  left: calc(8px + var(--safe-l));
  right: calc(8px + var(--safe-r));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.hud-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
  padding: 6px 10px;
  border-radius: 11px;
  background: rgba(8, 14, 24, 0.66);
  border: 1px solid rgba(120, 190, 255, 0.16);
  backdrop-filter: blur(6px);
}
.stat-label { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }
.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.hud-buttons {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 19px;
  color: var(--text);
  background: rgba(8, 14, 24, 0.7);
  border: 1px solid rgba(120, 190, 255, 0.18);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(53, 208, 255, 0.35);
}
.icon-btn.locked {
  opacity: 0.45;
  filter: grayscale(0.6);
}

/* 右侧指南针 + 小地图 */
.hud-right {
  position: absolute;
  top: calc(64px + var(--safe-t));
  right: calc(8px + var(--safe-r));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.compass { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.compass-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(8, 14, 24, 0.66);
  border: 1px solid rgba(120, 190, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.compass-arrow {
  font-size: 20px;
  color: var(--accent-2);
  transition: transform 0.08s linear;
}
.compass-dist {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.minimap-wrap {
  position: relative;
  width: min(34vw, 168px);
  height: min(34vw, 168px);
}

#minimap {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: rgba(8, 14, 24, 0.72);
  border: 1px solid rgba(120, 190, 255, 0.2);
  backdrop-filter: blur(6px);
}

/* 未找到地图时的暗色占位 */
.minimap-lock {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  background: rgba(8, 14, 24, 0.82);
  border: 1px dashed rgba(120, 190, 255, 0.28);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.minimap-lock-icon { font-size: 22px; opacity: 0.75; }
.minimap-lock-text { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }
.minimap-lock-hint {
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 9px;
  font-size: 10.5px;
  color: #ffd980;
  background: rgba(255, 210, 74, 0.12);
  border: 1px solid rgba(255, 210, 74, 0.3);
}

/* 虚拟摇杆（左下） */
.joystick {
  position: absolute;
  left: calc(16px + var(--safe-l));
  bottom: calc(20px + var(--safe-b));
  width: 130px;
  height: 130px;
  pointer-events: auto;
  touch-action: none;
  z-index: 22;
}
.joystick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 48, 72, 0.55), rgba(8, 14, 24, 0.7));
  border: 2px solid rgba(120, 190, 255, 0.24);
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent), rgba(53, 208, 255, 0.35));
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 18px rgba(53, 208, 255, 0.45);
  transition: transform 0.06s linear;
}

/* 右下动作按钮 */
.hud-bottom-right {
  position: absolute;
  right: calc(16px + var(--safe-r));
  bottom: calc(24px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.action-btn {
  min-width: 128px;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(53, 208, 255, 0.3);
}
.action-btn.danger {
  color: #fff;
  background: linear-gradient(135deg, #ff5d6c, #ff8a5c);
  box-shadow: 0 6px 20px rgba(255, 93, 108, 0.3);
}
.action-btn:disabled {
  filter: grayscale(0.7) brightness(0.7);
  cursor: not-allowed;
}

/* 消息提示 toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(34% + var(--safe-b));
  transform: translateX(-50%) translateY(10px);
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(8, 14, 24, 0.92);
  border: 1px solid rgba(120, 190, 255, 0.25);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 60;   /* 提升到屏幕层之上：菜单 / 面板内也能看到提示 */
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   设置面板
   ============================================================ */
.settings-panel { max-width: 560px; }

.settings-scroll {
  max-height: 62vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 4px;
}

.setting-group {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(20, 30, 46, 0.5);
  border: 1px solid rgba(120, 190, 255, 0.12);
}
.setting-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.setting-row:last-child { margin-bottom: 0; }

.setting-row label {
  font-size: 14px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.setting-row .val {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.switch-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.switch-row label { flex: 1; }

/* 滑块 */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(120, 190, 255, 0.2);
  outline: none;
  touch-action: manipulation;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(53, 208, 255, 0.5);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
}

/* 开关（复选框做成 iOS 风格） */
.switch {
  -webkit-appearance: none;
  appearance: none;
  width: 54px;
  height: 30px;
  border-radius: 16px;
  background: rgba(120, 190, 255, 0.22);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.switch:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch:checked::after { transform: translateX(24px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

.setting-lock {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #ffd24a;
  background: rgba(255, 210, 74, 0.12);
  border: 1px solid rgba(255, 210, 74, 0.35);
}

/* 下拉框 */
.select-input {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10, 16, 26, 0.9);
  color: var(--text);
  border: 1.5px solid rgba(120, 190, 255, 0.22);
  font-size: 14px;
  font-family: inherit;
  min-height: 44px;
}

/* ============================================================
   胜利界面
   ============================================================ */
.win-panel { text-align: center; }
.win-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.new-record {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(135deg, #ffe066, #ffb347);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.win-stats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 4px;
}
.win-stats li {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(20, 30, 46, 0.6);
  font-size: 14px;
}
.win-stats li span { color: var(--text-dim); }
.win-stats li b { color: var(--accent); font-variant-numeric: tabular-nums; }

.win-ranking {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(135deg, #7dffb0, #35d0ff);
  box-shadow: 0 4px 16px rgba(125, 255, 176, 0.28);
}

/* ============================================================
   本地排行榜
   ============================================================ */
.ranking-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ranking-tab {
  flex: 1;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: rgba(20, 30, 46, 0.72);
  border: 1.5px solid rgba(120, 190, 255, 0.18);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ranking-tab.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: linear-gradient(135deg, rgba(53, 208, 255, 0.16), rgba(125, 255, 176, 0.1));
}
.ranking-tab:active { transform: scale(0.97); }

.ranking-list {
  max-height: 44vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ranking-list li {
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}
.ranking-list .rk-rank {
  flex: 0 0 auto;
  width: 26px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dim);
}
.rk-rank.gold { color: #ffd24a; }
.rk-rank.silver { color: #c8d4e8; }
.rk-rank.bronze { color: #e8a05c; }
.ranking-list .rk-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.rk-info b { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
.rk-info em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-list .ranking-empty {
  justify-content: center;
  color: var(--text-dim);
  padding: 20px 0;
}
#btn-ranking-clear.armed {
  color: #fff;
  background: linear-gradient(135deg, #ff5d6c, #ff8a5c);
  border-color: transparent;
}

/* ============================================================
   回放控制条
   ============================================================ */
.replay-bar {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(8, 14, 24, 0.88);
  border: 1px solid rgba(120, 190, 255, 0.28);
  backdrop-filter: blur(6px);
  z-index: 45;
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
  justify-content: center;
}
.replay-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 108px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   商店系统
   ============================================================ */
.shop-panel { max-width: 560px; }

.shop-balance {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.shop-balance b {
  color: #ffd24a;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 56vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 2px;
}

.shop-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(20, 30, 46, 0.66);
  border: 1px solid rgba(120, 190, 255, 0.16);
}
.shop-icon {
  flex: 0 0 auto;
  width: 42px;
  text-align: center;
  font-size: 26px;
}
.shop-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.shop-name { font-size: 15px; font-weight: 700; }
.shop-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.shop-meta { font-size: 11px; color: #ffd24a; }
.shop-buy {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.shop-price {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffd24a;
  font-variant-numeric: tabular-nums;
}
.shop-buy-btn { min-width: 78px; }
.shop-buy-btn:disabled { opacity: 0.45; filter: grayscale(0.5); cursor: not-allowed; }
.shop-buy-btn.poor { opacity: 0.55; filter: grayscale(0.5); }

/* ============================================================
   道具面板
   ============================================================ */
.item-panel { text-align: left; }

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 30, 46, 0.62);
  border: 1px solid rgba(120, 190, 255, 0.14);
}
.item-icon { flex: 0 0 auto; font-size: 22px; }
.item-name { flex: 1; min-width: 0; font-size: 14px; }
.item-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.item-use-btn { flex: 0 0 auto; min-width: 72px; }
.item-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 18px 0;
}
.item-panel-hint {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.7;
}

/* ============================================================
   幽灵询问弹窗
   ============================================================ */
.ghost-panel { text-align: center; }
.ghost-info {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.ghost-msg {
  line-height: 1.85;
  margin-bottom: 14px;
}
.ghost-remember-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.ghost-remember-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* ============================================================
   横屏适配（矮屏时压缩面板与 HUD）
   ============================================================ */
@media (orientation: landscape) and (max-height: 520px) {
  .panel {
    max-width: 720px;
    padding: 14px 16px;
    border-radius: 16px;
  }
  .game-title { font-size: 26px; letter-spacing: 2px; }
  .subtitle { margin-bottom: 10px; }
  .diff-card { padding: 10px 12px; min-height: 50px; }
  .diff-card .diff-name { font-size: 15px; }
  .diff-card .diff-desc { font-size: 11px; }
  .settings-scroll { max-height: 52vh; }
  .hud-right { top: calc(56px + var(--safe-t)); }
  .minimap-wrap { width: min(24vh, 140px); height: min(24vh, 140px); }
  .joystick { width: 112px; height: 112px; }
  .joystick-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
}

/* 小屏手机（窄竖屏）微调 */
@media (max-width: 380px) {
  .stat { min-width: 54px; padding: 5px 8px; }
  .stat-value { font-size: 13px; }
  .icon-btn { width: 40px; height: 40px; font-size: 17px; }
  .action-btn { min-width: 110px; font-size: 14px; }
  .joystick { width: 118px; height: 118px; }
}

/* 高分屏/大屏：限制面板宽度，避免过度拉伸 */
@media (min-width: 900px) {
  .panel { max-width: 700px; }
  .panel-narrow { max-width: 460px; }
}

/* ============================================================
   隐藏彩蛋弹窗（长按商店按钮触发）
   ============================================================ */
.secret-panel { text-align: center; }

.secret-question {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 4px;
}

.secret-note { margin-bottom: 14px; }

.secret-input {
  flex: none;
  width: 100%;
  text-align: center;
  letter-spacing: 2px;
  min-height: 44px;
  margin-bottom: 4px;
}