/* 打卡闯关 · 地图主线样式（深色 + 三套主题） */

:root {
  --bg0: #0b1220;
  --bg1: #121a2b;
  --panel: rgba(18, 28, 48, 0.92);
  --text: #e8eefc;
  --muted: #8b9bb8;
  --accent: #3dd68c;
  --accent2: #f0c14b;
  --danger: #ff6b6b;
  --locked: #3a455c;
  --path: rgba(61, 214, 140, 0.45);
  --glow: rgba(61, 214, 140, 0.55);
  --node-open: #3dd68c;
  --font-display: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 16px;
  --dock-h: 68px;
  --hud-h: 72px;
}

/* 我的世界：草地绿 + 泥土暖色 */
body.theme-minecraft {
  --accent: #5dbe3e;
  --accent2: #c4a35a;
  --path: rgba(93, 190, 62, 0.5);
  --glow: rgba(93, 190, 62, 0.6);
  --node-open: #7cf25a;
  --bg0: #0d1a12;
  --bg1: #163022;
}

/* 元气骑士：霓虹青橙 */
body.theme-yuanqi {
  --accent: #2ee6ff;
  --accent2: #ff9f43;
  --path: rgba(46, 230, 255, 0.5);
  --glow: rgba(46, 230, 255, 0.65);
  --node-open: #2ee6ff;
  --bg0: #0a0e1a;
  --bg1: #141b33;
}

/* 斗罗大陆：暗金魂环（任务书指定主题） */
body.theme-douluo {
  --accent: #d4a017;
  --accent2: #e8d48b;
  --path: rgba(212, 160, 23, 0.45);
  --glow: rgba(212, 160, 23, 0.55);
  --node-open: #ffd666;
  --bg0: #120c08;
  --bg1: #1c140e;
}

/* 拉布布：粉薄荷软糖色 */
body.theme-labubu {
  --accent: #ff7eb6;
  --accent2: #7ad7c7;
  --path: rgba(255, 126, 182, 0.45);
  --glow: rgba(122, 215, 199, 0.55);
  --node-open: #ff9ec8;
  --bg0: #1a1020;
  --bg1: #2a1830;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-display);
  color: var(--text);
  background: var(--bg0);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hud-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.72), transparent);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}
.hud-right { justify-content: flex-end; }
.avatar-chip {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--accent), #1a2438);
  border: 2px solid rgba(255,255,255,0.2);
  font-size: 20px;
  box-shadow: 0 0 16px var(--glow);
}
.nick { font-weight: 700; font-size: 15px; }
.date-line { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hud-center { flex: 1; padding: 0 12px; max-width: 280px; margin: 0 auto; }
.progress-label { font-size: 10px; color: var(--muted); margin-bottom: 4px; text-align: center; }
.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.45s ease;
  box-shadow: 0 0 12px var(--glow);
}
.progress-num { font-size: 11px; text-align: center; margin-top: 4px; color: var(--accent2); }
.score-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  font-weight: 700;
}
.score-icon { color: var(--accent2); }
.theme-btn, .btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.4);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #1f8f5a);
  border-color: transparent;
  color: #06110a;
  font-weight: 700;
}
.btn.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn.ghost { background: transparent; }
.btn.full { width: 100%; margin-top: 10px; }

/* ---------- 地图舞台 ---------- */
.map-stage {
  position: fixed;
  inset: 0;
  padding-top: var(--hud-h);
  padding-bottom: var(--dock-h);
  overflow: hidden;
  --map-bg: none;
  --map-aspect: 1.833333;
  --map-aspect-inverse: 0.545455;
}
/* 可滚动视口：手机拖动查看被裁切的区域 */
.map-viewport {
  position: absolute;
  top: var(--hud-h);
  left: 0;
  right: 0;
  bottom: var(--dock-h);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  cursor: grab;
}
.map-viewport.is-dragging {
  cursor: grabbing;
}
.map-world {
  position: relative;
  /* 与背景 cover 后的完整画布同尺寸，超出视口即可滚动 */
  width: max(100%, calc((100vh - var(--hud-h) - var(--dock-h)) * var(--map-aspect)));
  height: max(100%, calc(100vw * var(--map-aspect-inverse)));
  min-width: 100%;
  min-height: 100%;
  transform-origin: center center;
}
.map-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(80,140,255,0.18), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(255,180,80,0.12), transparent 45%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 70%);
  animation: skyPulse 8s ease-in-out infinite alternate;
  pointer-events: none;
}
/* 使用主题地图原画作背景 */
.map-stage.has-art-bg .map-sky {
  background-image:
    linear-gradient(180deg, rgba(6,10,18,0.35), rgba(6,10,18,0.55)),
    var(--map-bg);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  animation: none;
}
body.theme-yuanqi .map-stage.has-art-bg .map-sky {
  filter: none;
}
@keyframes skyPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.08); }
}
.map-fog {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 28px,
      rgba(255,255,255,0.015) 28px,
      rgba(255,255,255,0.015) 29px
    );
  pointer-events: none;
  opacity: 0.7;
}
.map-stage.has-art-bg .map-fog { opacity: 0.25; }
.map-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}
.map-path .trail {
  fill: none;
  stroke: var(--path);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 2.2 1.6;
  filter: drop-shadow(0 0 2px var(--glow));
  animation: dashMove 12s linear infinite;
  opacity: 0.95;
}
.map-stage.has-art-bg .map-path .trail {
  stroke-width: 2;
  stroke-dasharray: 2.5 1.8;
  opacity: 1;
}
@keyframes dashMove {
  to { stroke-dashoffset: -40; }
}
.map-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.map-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-h) + 10px);
  transform: translateX(-50%);
  z-index: 3;
  color: var(--muted);
  background: rgba(0,0,0,0.55);
  padding: 8px 12px;
  border-radius: 14px;
  pointer-events: none;
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}
.map-hint .hint-sum {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.map-hint .hint-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}
.map-hint .lg {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.map-hint .lg.open { background: var(--node-open); box-shadow: 0 0 6px var(--glow); }
.map-hint .lg.done { background: var(--accent2); }
.map-hint .lg.wait { background: var(--locked); }
.map-hint .lg.miss { background: var(--danger); }

/* 关卡节点 */
.map-node {
  position: absolute;
  width: 64px;
  --node-anchor-y: -29px;
  /* 地图坐标锚定圆形图标中心，不受下方标题和时间高度影响 */
  transform: translate(-50%, var(--node-anchor-y));
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 2;
}
.map-node:active { transform: translate(-50%, var(--node-anchor-y)) scale(0.94); }
.node-ring {
  width: 58px; height: 58px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 3px solid rgba(255,255,255,0.25);
  background: rgba(20, 28, 44, 0.9);
  position: relative;
  overflow: hidden;
}
.node-ring.has-img {
  background: rgba(8, 12, 20, 0.55);
  padding: 2px;
}
.node-ico {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}
.node-ring[data-fallback]::before {
  content: attr(data-fallback);
  font-size: 22px;
}
.hud-ico, .sheet-ico, .dock-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sheet-ico {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  display: inline-block;
}
.dock-ico {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.avatar-chip {
  overflow: hidden;
  padding: 2px;
}
.node-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 4px #000;
  white-space: nowrap;
}
.node-time {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}

/* 节点角标：一眼区分可开始 / 已完成 / 未到时间 */
.node-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.4;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.55);
  color: var(--muted);
  white-space: nowrap;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-node.state-locked .node-ring {
  border-color: var(--locked);
  filter: grayscale(0.85) brightness(0.65);
}
.map-node.state-locked .node-badge {
  color: #c5d0e6;
  border-color: rgba(138, 155, 184, 0.45);
  background: rgba(30, 38, 55, 0.9);
}
.map-node.state-locked .node-label,
.map-node.state-locked .node-time {
  opacity: 0.72;
}
.map-node.state-open .node-ring,
.map-node.state-in_progress .node-ring {
  border-color: var(--node-open);
  box-shadow: 0 0 0 0 var(--glow);
  animation: openPulse 1.6s ease-out infinite;
}
.map-node.state-open .node-badge,
.map-node.state-in_progress .node-badge {
  color: #062214;
  background: var(--node-open);
  border-color: transparent;
}
@keyframes openPulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.map-node.state-completed .node-ring {
  border-color: var(--accent2);
  background: linear-gradient(145deg, #3a3010, #1a2430);
}
.map-node.state-completed .node-ring::after {
  content: "✓";
  position: absolute;
  right: -4px; bottom: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent2);
  color: #1a1200;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}
.map-node.state-completed .node-badge {
  color: #1a1200;
  background: var(--accent2);
}
.map-node.state-missed .node-ring {
  border-color: var(--danger);
  opacity: 0.75;
  filter: grayscale(0.35);
}
.map-node.state-missed .node-badge {
  color: #fff;
  background: var(--danger);
}
.map-node.state-submitted .node-ring {
  border-color: #6aa8ff;
}
.map-node.state-submitted .node-badge {
  color: #061428;
  background: #6aa8ff;
}
.map-node.state-chest_locked .node-ring {
  filter: grayscale(1) brightness(0.55);
}
.map-node.state-chest_locked .node-badge {
  color: #c5d0e6;
  border-color: rgba(138, 155, 184, 0.45);
}
.map-node.state-chest_ready .node-ring {
  border-color: var(--accent2);
  animation: openPulse 1.2s ease-out infinite;
}
.map-node.state-chest_ready .node-badge {
  color: #1a1200;
  background: var(--accent2);
}
.map-node.is-side .node-ring {
  border-style: dashed;
}
.sheet-status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.sheet-status-pill.state-open,
.sheet-status-pill.state-in_progress,
.sheet-status-pill.state-chest_ready {
  color: #062214;
  background: var(--node-open);
}
.sheet-status-pill.state-completed {
  color: #1a1200;
  background: var(--accent2);
}
.sheet-status-pill.state-locked,
.sheet-status-pill.state-chest_locked {
  color: #c5d0e6;
  background: rgba(58, 69, 92, 0.9);
}
.sheet-status-pill.state-missed {
  color: #fff;
  background: var(--danger);
}
.sheet-status-pill.state-submitted {
  color: #061428;
  background: #6aa8ff;
}

/* ---------- 关卡抽屉 ---------- */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 40;
}
.quest-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--panel);
  border-radius: 22px 22px 0 0;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform 0.28s ease;
  border-top: 1px solid rgba(255,255,255,0.1);
  max-height: 75vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.quest-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 42px; height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.25);
  margin: 0 auto 12px;
}
.sheet-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--accent);
  margin-bottom: 8px;
}
.sheet-title { margin: 0 0 4px; font-size: 22px; }
.sheet-sub { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.sheet-desc { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: #c9d4ea; }
.sheet-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
.sheet-meta span {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.sheet-actions {
  display: flex; gap: 10px;
}
.sheet-actions .btn { flex: 1; padding: 12px; font-size: 15px; }

/* ---------- 主题弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.12);
}
.modal h3 { margin: 0 0 14px; text-align: center; }
.theme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.theme-card {
  text-align: left;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-preview {
  width: 72px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.theme-preview.mc {
  background: linear-gradient(135deg, #3a7d2c, #6b4a2b);
}
.theme-preview.yq {
  background: linear-gradient(135deg, #123, #2ee6ff 80%);
  color: #061018;
}
.theme-preview.dl {
  background: linear-gradient(135deg, #2a1808, #d4a017);
  color: #1a1000;
}
.theme-preview.lb {
  background: linear-gradient(135deg, #5a2a4a, #ff7eb6 70%, #7ad7c7);
  color: #1a1020;
}

/* ---------- Dock ---------- */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--dock-h);
  z-index: 30;
  display: flex;
  background: rgba(8, 12, 22, 0.94);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.dock-item {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 10px;
  cursor: pointer;
  min-width: 0;
  padding: 0 2px;
}
.dock-item.active { color: var(--accent); }
.dock-ico { font-size: 16px; }

/* ---------- 子页游戏化 ---------- */
.subpage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  height: 100dvh;
  z-index: 35;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 14px;
  padding-bottom: calc(var(--dock-h) + 28px);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(80,140,255,0.16), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(255,180,80,0.12), transparent 40%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 55%);
}
/* 子页打开时底层地图不抢触摸，避免滚不动 */
body.subpage-open .map-stage,
body.subpage-open .hud {
  pointer-events: none;
}
.sub-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sub-hd h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sub-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,214,102,0.28);
  background:
    linear-gradient(135deg, rgba(255,214,102,0.14), rgba(255,255,255,0.03)),
    rgba(0,0,0,0.22);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}
.sub-hero-ico {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.14);
  flex: 0 0 64px;
}
.sub-hero-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sub-hero-text { flex: 1; min-width: 0; }
.sub-hero-title {
  font-size: 18px;
  font-weight: 800;
}
.sub-hero-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.game-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: 0.06em;
}
.game-section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #ffe08a, #ffb84d);
  box-shadow: 0 0 8px rgba(255,200,80,0.55);
}
.bag-item, .ledger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02)),
    rgba(8,12,22,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.ledger-item.ledger-plus {
  border-color: rgba(90, 220, 140, 0.35);
}
.ledger-item.ledger-minus {
  border-color: rgba(255, 120, 120, 0.28);
}
.ledger-delta {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger-plus .ledger-delta { color: #6dffb0; }
.ledger-minus .ledger-delta { color: #ff8f8f; }
.bag-item .bag-ico {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.bag-item .bag-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bag-item .bag-main { flex: 1; min-width: 0; }
.bag-item .name { font-weight: 700; }
.bag-item .desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.coming {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 24px);
  transform: translateX(-50%);
  z-index: 80;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 80%;
}

/* ---------- 游戏风弹窗 ---------- */
.game-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.game-modal-mask.show { opacity: 1; }
.game-modal {
  position: relative;
  width: min(360px, 100%);
  padding: 28px 20px 20px;
  border-radius: 22px;
  text-align: center;
  overflow: hidden;
  border: 2px solid rgba(255, 214, 102, 0.45);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,214,102,0.22), transparent 55%),
    linear-gradient(165deg, rgba(36, 48, 72, 0.98), rgba(12, 16, 28, 0.98));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 18px 40px rgba(0,0,0,0.45),
    0 0 36px rgba(255, 200, 80, 0.18);
  transform: translateY(18px) scale(0.94);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}
.game-modal-mask.show .game-modal {
  transform: translateY(0) scale(1);
}
.game-modal-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(circle, rgba(255,220,120,0.35), transparent 70%);
  pointer-events: none;
}
.game-modal-rays {
  position: absolute;
  inset: -30%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255,214,102,0.08) 0 8deg, transparent 8deg 20deg);
  animation: gameRaySpin 14s linear infinite;
  pointer-events: none;
  opacity: 0.55;
}
@keyframes gameRaySpin {
  to { transform: rotate(360deg); }
}
.game-modal-ico {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(0,0,0,0.25));
  border: 2px solid rgba(255,214,102,0.5);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  animation: gameIcoPop 0.45s ease;
}
.game-modal-ico img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}
@keyframes gameIcoPop {
  0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.game-modal-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #1a1200;
  background: linear-gradient(90deg, #ffe08a, #ffb84d);
}
.game-modal-title {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}
.game-modal-desc {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}
.game-modal-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.game-stat {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
}
.game-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent2);
}
.game-stat-lab {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.game-modal-ok {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
}

/* ---------- 童泥转盘 ---------- */
.lottery-wheel-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 16px;
}
.lottery-wheel-mask.show { opacity: 1; }
.lottery-wheel-panel {
  width: min(360px, 94vw);
  background: linear-gradient(160deg, #1a2740, #0f1728 60%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 18px 16px 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.lw-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent2);
}
.lw-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.lw-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 16px auto 10px;
}
.lw-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: #fff;
  font-size: 22px;
  text-shadow: 0 2px 6px #000;
  line-height: 1;
}
.lw-wheel {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 0 0 6px rgba(0,0,0,0.25), 0 0 24px rgba(240,193,75,0.25);
  position: relative;
  transition: transform 0.05s linear;
}
.lw-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  margin-left: -18px;
  margin-top: -8px;
  font-size: 11px;
  font-weight: 800;
  color: #111;
  text-shadow: 0 0 2px #fff;
  transform-origin: center center;
  pointer-events: none;
}
.lw-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #c4922a);
  color: #3a2800;
  font-weight: 900;
  line-height: 42px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.lw-result {
  min-height: 28px;
  margin: 8px 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.lw-result strong {
  color: var(--accent2);
  font-size: 22px;
}
.hud-right .music-btn {
  margin-left: 6px;
}

@media (min-width: 900px) {
  .map-node { width: 78px; --node-anchor-y: -32px; }
  .node-ring { width: 64px; height: 64px; font-size: 26px; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}
