/* ============================================
   像素方块世界 - 游戏界面样式
   ============================================ */

/* hidden 属性必须真正隐藏（防止 display 规则覆盖，如多人徽章/横幅） */
[hidden] { display: none !important; }

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Courier New', 'Consolas', monospace;
  user-select: none;
  -webkit-user-select: none;
}

/* 游戏画布 - 全屏 */
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

/* 十字准星 */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 24px;
  font-weight: 200;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 0 2px rgba(0,0,0,0.8);
  opacity: 0.8;
  display: none;
}

/* 物品栏 */
#hotbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 4px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.hotbar-slot {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.12s ease-out;
}

.hotbar-slot.selected {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.45), 0 0 3px rgba(255, 255, 255, 0.5);
  transform: scale(1.08);
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: -2px;
}

.hotbar-slot .block-preview {
  width: 36px;
  height: 36px;
  border-radius: 2px;
  image-rendering: pixelated;
}

.hotbar-slot .slot-key {
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.5);
  letter-spacing: 0;
  line-height: 1;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 0 2px;
  border-radius: 0 0 3px 3px;
  pointer-events: none;
}

/* 当前选中方块名称 - 热键栏上方 */
#selectedBlockName {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  z-index: 11;
  pointer-events: none;
  display: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 16px;
  border-radius: 4px;
  letter-spacing: 1px;
  transition: transform 0.12s ease-out, opacity 0.12s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 调试信息 */
#debugInfo {
  position: fixed;
  top: 12px;
  left: 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  z-index: 10;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: 4px;
  display: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

#debugInfo .hud-keys {
  display: inline-block;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255,255,255,0.35);
  color: #ffe9b0;
  font-size: 12px;
  white-space: nowrap;
}

/* 目标方块高亮提示 */
#blockHighlight {
  position: fixed;
  top: 53%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 13px;
  z-index: 10;
  pointer-events: none;
  display: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  background: rgba(0,0,0,0.4);
  padding: 4px 10px;
  border-radius: 4px;
}

/* 开始界面 - 磨砂玻璃效果叠加在游戏世界上（内容可滚动，小屏手机也不会被裁掉） */
#startScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: default;
  padding: clamp(8px, 1.8vh, 24px) clamp(12px, 5vw, 40px) clamp(20px, 4vh, 40px);
  box-sizing: border-box;
}
/* 让内容在可视区居中，但超高时可整体滚动 */
#startScreen .start-inner {
  margin: auto;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== 开始界面两步引导（第1步欢迎+留言墙 → 第2步选特工+开始） ===== */
.step-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px auto 10px;
}
.step-dots .sd {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: 'Courier New', monospace;
  font-weight: 800; font-size: 14px;
  color: rgba(255,240,210,0.6);
  background: rgba(20,12,4,0.55);
  border: 2px solid rgba(255,255,255,0.18);
}
.step-dots .sd.active {
  color: #4a2c00;
  background: linear-gradient(135deg, #ffd34d, #f4a63c);
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255,200,80,0.25), 0 4px 12px rgba(255,190,60,0.4);
}
.step-dots .sd-line {
  width: 46px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.2);
}

.start-step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.start-step[hidden] { display: none !important; }
.start-step.active { animation: stepIn .28s ease; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-title {
  font-family: 'Courier New', monospace;
  font-weight: 800;
  font-size: clamp(17px, 4.5vw, 22px);
  color: #ffe9a8;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  margin: 2px 0 14px;
  text-align: center;
}

.step-box {
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  padding: 12px 14px;
  margin: 6px 0 8px;
  background: rgba(20,12,4,0.5);
  border: 2px solid rgba(255,255,255,0.14);
  border-radius: 16px;
}
.step-box-title {
  font-family: 'Courier New', monospace;
  font-weight: 800;
  font-size: 15px;
  color: #ffd34d;
  text-shadow: 0 2px 5px rgba(0,0,0,0.6);
  margin-bottom: 8px;
  text-align: center;
}
.step-box #communityMount > * { width: 100%; max-width: none; box-sizing: border-box; }
.step-box .cm-box { margin-left: auto; margin-right: auto; }

.tab-hint {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,240,210,0.68);
  text-align: center;
  line-height: 1.6;
  max-width: 440px;
}

.step-back {
  margin-top: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255,240,210,0.72);
  padding: 8px 18px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.step-back:hover { color: #ffd34d; background: rgba(255,255,255,0.06); }

#startScreen .start-step .save-menu,
#startScreen .start-step .controls-info { width: 100%; max-width: 560px; box-sizing: border-box; }

/* 第 1 步：留言板自然展开（不设内部滚动框），整页可滚动；矮屏/手机上缩小 logo 与留白 */
@media (max-height: 800px) {
  #startScreen .logo-lockup { transform: scale(0.85); margin: -8px 0; }
  #startScreen .start-welcome { font-size: 14px; margin: 2px 0 6px; }
  .step-box { padding: 12px; }
}



/* ===== 开始界面标题（专业像素游戏开场） ===== */
.start-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 4px;
  animation: heroDrop .7s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes heroDrop {
  from { opacity: 0; transform: translateY(-26px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.start-brand {
  font-family: 'Courier New', monospace;
  font-size: clamp(11px, 2.6vw, 15px);
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, rgba(244,107,149,.95), rgba(255,155,191,.95));
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 0 rgba(160,40,90,.5), 0 8px 20px rgba(244,107,149,.35);
  text-shadow: 0 1px 2px rgba(140,20,70,.55);
  display: inline-flex; align-items: center; gap: 8px;
}
.brand-cube {
  width: 12px; height: 12px; border-radius: 3px;
  background: linear-gradient(135deg, #ffe98a, #f4b942);
  box-shadow: inset -2px -2px 0 rgba(180,110,20,.6);
  display: inline-block;
}

/* 标题组合：方块吉祥物 + 中文大标 + 英文 + 基地分隔 */
.logo-lockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 20px 0;
}
/* 立体方块吉祥物（CSS 三面） */
.logo-cube {
  width: 38px; height: 38px;
  position: relative;
  margin-bottom: 2px;
  animation: cubeBob 2.6s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes cubeBob {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50%     { transform: translateY(-8px) rotate(4deg); }
}
.logo-cube .cube-face {
  position: absolute; inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), inset 0 3px 0 rgba(255,255,255,.35);
}
.cube-top   { background: linear-gradient(135deg,#8fe06a,#57b53b); transform: translateZ(6px) scale(.96); }
.cube-left  { background: #3f9a2c; transform: rotateY(-18deg) translateZ(-3px) translateX(-4px) scale(.96); opacity:.85; }
.cube-right { background: #4fba37; transform: rotateY(18deg) translateZ(-3px) translateX(4px) scale(.96); opacity:.85; }
.cube-eyes {
  position: absolute; top: 16px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 9px; z-index: 2;
}
.cube-eyes i {
  width: 8px; height: 10px; background: #fff; border-radius: 2px; display:block;
  box-shadow: inset 0 -3px 0 #2a3a6a;
}

.game-logo {
  margin: 0;
  line-height: 1;
}
.logo-zh {
  font-family: 'Courier New', monospace;
  font-weight: 900;
  font-size: clamp(30px, 7vw, 58px);
  letter-spacing: 4px;
  background: linear-gradient(180deg, #fff7c0 0%, #ffe26a 42%, #ffc233 58%, #f29422 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: clamp(1px,.35vw,3px) #5b3a12;
  filter:
    drop-shadow(0 2px 0 #c87a18)
    drop-shadow(0 4px 0 #9c5c10)
    drop-shadow(0 7px 12px rgba(0,0,0,.55));
  animation: logoFloat 3.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.logo-en {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: clamp(10px, 2.2vw, 14px);
  letter-spacing: 6px;
  color: #7fe3e0;
  margin-top: 6px;
  text-shadow: 0 0 10px rgba(127,227,224,.55), 0 2px 4px rgba(0,0,0,.8);
}
.logo-rule {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px;
  font-family: 'Courier New', monospace;
  font-size: clamp(12px, 2.8vw, 17px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}
.logo-rule span {
  width: clamp(24px, 8vw, 60px); height: 3px;
  background: linear-gradient(90deg, transparent, #ffcf5c);
  border-radius: 2px;
}
.logo-rule span:last-child {
  background: linear-gradient(90deg, #ffcf5c, transparent);
}

.start-welcome {
  font-family: 'Courier New', monospace;
  font-size: clamp(12px, 2.6vw, 15px);
  line-height: 1.55;
  color: #fff;
  margin-top: 8px;
  padding: 7px 18px;
  background: rgba(20,12,4,.42);
  border: 2px solid rgba(255,240,200,.28);
  border-radius: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  animation: welcomeFade 1s ease .35s both;
  backdrop-filter: blur(2px);
}
@keyframes welcomeFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 主角选择 ===== */
.char-select {
  margin-top: 18px;
  animation: welcomeFade 1s ease .5s both;
}
.char-select-label {
  font-family: 'Courier New', monospace;
  font-size: clamp(12px, 2.6vw, 15px);
  font-weight: 700;
  color: #ffe9a8;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
  margin-bottom: 10px;
}
.char-options { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.char-options-4 { gap: 10px; }
.char-card {
  position: relative;
  width: 92px;
  background: rgba(30,20,8,.55);
  border: 3px solid rgba(255,255,255,.22);
  border-radius: 14px;
  padding: 12px 8px 10px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s;
}
.char-options-4 .char-card { width: 84px; }
.char-card:hover { transform: translateY(-4px); }
.char-card.selected {
  border-color: #ffd34d;
  background: rgba(120,80,20,.55);
  box-shadow: 0 0 0 3px rgba(255,211,77,.35), 0 8px 22px rgba(255,190,60,.3);
}
.char-name {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  white-space: nowrap;
}
.char-select-sub { font-weight: 400; font-size: 11px; color: rgba(255,233,168,.7); margin-left: 6px; }
.char-check {
  position: absolute; top: -10px; right: -10px;
  width: 24px; height: 24px; line-height: 22px;
  background: #57b53b; color: #fff; font-weight: 900;
  border: 2px solid #fff; border-radius: 50%;
  font-size: 13px; display: none;
}
.char-card.selected .char-check { display: block; }

/* ===== 美味特工队 CSS 像素头像（3 角色） ===== */
.agent-ico {
  position: relative;
  width: 52px; height: 62px;
  display: block;
}
.agent-ico i, .agent-ico b { position: absolute; display: block; }
.agent-ico .ag-eye { width: 8px; height: 9px; background: #5b2a86; border-radius: 2px; top: 25px; z-index: 6; }
/* 通用身体（红衣，可覆盖） */
.ag-body {
  position: absolute; top: 36px; left: 50%; transform: translateX(-50%);
  width: 32px; height: 22px; border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg,#e0584a,#c24030); z-index: 1;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12);
}
.ag-body-green { background: linear-gradient(180deg,#46b87a,#2f9e5f); }
.ag-body-purple { background: linear-gradient(180deg,#8a5a9c,#6b3f7d); }

/* 脸部（共用肉色圆脸蛋，更可爱） */
.agent-ico::after {
  content: "";
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 26px; border-radius: 42% 42% 46% 46%;
  background: #f6c79c; z-index: 2;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.06);
}
/* 腮红 */
.agent-ico .ag-eye::before {
  content: ""; position: absolute; width: 6px; height: 4px; border-radius: 3px;
  background: rgba(244,120,140,.55); top: 11px;
}
.agent-ico .ag-eye:nth-of-type(odd)::before { left: -7px; }

/* —— 汉堡特工：芝麻面包帽 + 生菜 + 绿面罩，红色战衣 —— */
.agent-burger .ag-hat {
  top: 1px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 13px; border-radius: 12px 12px 3px 3px;
  background: linear-gradient(180deg,#f7d27a,#e8b24f); z-index: 5;
  box-shadow: 0 6px 0 #4caf63, 0 11px 0 #e0584a;
}
/* 面包上的芝麻 */
.agent-burger .ag-cap {
  top: 4px; left: 50%; z-index: 6;
  width: 4px; height: 3px; border-radius: 2px; background: #fff3d0;
  box-shadow: -9px 2px 0 #fff3d0, 9px 2px 0 #fff3d0, 0 6px 0 #fff3d0;
}
.agent-burger .ag-mask {
  top: 27px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 11px; background: #2f9e5f;
  border-radius: 0 0 14px 14px; z-index: 5;
}
.agent-burger .ag-eye { background: #1a0a2e; top: 23px; }
.agent-burger .ag-eye:nth-of-type(odd){left:12px;} .agent-burger .ag-eye:nth-of-type(even){right:12px;left:auto;}

/* —— 薯条厨娘：红色薯条盒造型 + 金黄薯条 + 白厨师帽 —— */
.agent-fries .ag-hair {
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 27px; border-radius: 10px;
  background: linear-gradient(180deg,#e0584a,#c63a2c); z-index: 4;
}
.agent-fries .ag-fries {
  top: -6px; left: 50%; transform: translateX(-50%);
  width: 32px; height: 20px; z-index: 6;
  background:
    linear-gradient(#ffd34d,#ffd34d) 1px 2px/7px 17px no-repeat,
    linear-gradient(#f6b83a,#f6b83a) 12px 0/7px 19px no-repeat,
    linear-gradient(#ffd34d,#ffd34d) 23px 3px/7px 16px no-repeat;
  filter: drop-shadow(0 1px 0 #d8a028);
}
.agent-fries .ag-chefhat {
  top: -8px; right: 2px; width: 17px; height: 15px;
  background: #f6f4ef; border-radius: 9px 9px 4px 4px; z-index: 7;
  box-shadow: -4px 3px 0 #f6f4ef;
}
.agent-fries .ag-mask-white { background: #f6f4ef; }
.ag-mask-white {
  top: 28px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 10px; border-radius: 3px 3px 8px 8px; z-index: 5;
}
.agent-fries .ag-eye { background: #b3202a; top: 23px; }
.agent-fries .ag-eye:nth-of-type(odd){left:12px;} .agent-fries .ag-eye:nth-of-type(even){right:12px;left:auto;}

/* —— 鸡米花小弟：橙色花椰菜头 + 白眼睛 + 紫连帽衫 —— */
.agent-popcorn .ag-puffs {
  top: -3px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 36px; z-index: 5;
  background:
    radial-gradient(circle at 30% 28%, #f7bd58 0 8px, transparent 9px),
    radial-gradient(circle at 63% 24%, #f0a83c 0 9px, transparent 10px),
    radial-gradient(circle at 50% 56%, #f2b044 0 12px, transparent 13px),
    radial-gradient(circle at 25% 60%, #f0a83c 0 8px, transparent 9px),
    radial-gradient(circle at 74% 58%, #f7bd58 0 8px, transparent 9px),
    linear-gradient(180deg,#f3b34c,#ea9e30);
  border-radius: 46% 46% 42% 42%;
}
.agent-popcorn .ag-eye { background: #fff; top: 22px; height: 10px; width: 10px; border-radius: 50%; z-index: 6; box-shadow: inset 0 0 0 2px #e8e8ef; }
.agent-popcorn .ag-eye:nth-of-type(odd){left:12px;} .agent-popcorn .ag-eye:nth-of-type(even){right:12px;left:auto;}
/* 鸡米花的脸被花椰菜头包住，不显示肉脸 */
.agent-popcorn::after { display: none; }

/* —— 魔法小女巫：紫色弯尖巫师帽 + 黄星扣 + 棕色长发 + 粉紫连身裙 —— */
.ag-body-witch { background: linear-gradient(180deg,#e58fb0,#9a5bb0); }
/* 棕色长发（在脸后方，露出两侧披肩发） */
.agent-witch .ag-hair {
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 40px; border-radius: 12px 12px 10px 10px;
  background: linear-gradient(180deg,#7a4e28,#5f3b1c); z-index: 0;
}
/* 紫色帽檐（圆宽边，带粉色帽带） */
.agent-witch .ag-hatbrim {
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 11px; border-radius: 50%;
  background: linear-gradient(180deg,#b07cc8,#8a4ea0); z-index: 7;
  box-shadow: 0 5px 0 #e58fb0;
}
/* 帽檐前方黄色星星扣 */
.agent-witch .ag-hatbrim::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%);
  width: 6px; height: 6px; background: #ffd34d; border-radius: 1px;
  box-shadow: 0 0 4px rgba(255,211,77,.8);
}
/* 紫色弯尖帽（锥体，顶端略向左弯，黄色帽尖） */
.agent-witch .ag-hat {
  top: -16px; left: 50%; margin-left: -10px;
  width: 22px; height: 30px; z-index: 8;
  background: linear-gradient(180deg,#b886cc,#8a4ea0);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(-16deg);
}
.agent-witch .ag-hat::after {
  content: ""; position: absolute; top: -4px; left: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ffd34d;
}
/* 女巫深紫大眼 */
.agent-witch .ag-eye { background: #4a2350; top: 24px; }
.agent-witch .ag-eye:nth-of-type(odd){left:12px;} .agent-witch .ag-eye:nth-of-type(even){right:12px;left:auto;}

@media (max-width: 768px) {
  .char-options-4 .char-card, .char-options .char-card { width: 74px; padding: 9px 6px 8px; }
  .char-name { font-size: 11px; }
  .agent-ico { transform: scale(.92); }
}

/* 妈妈审核台入口（低调，仅家长用，跟随开始界面内容） */
.admin-link {
  display: block;
  margin: 18px auto 4px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  z-index: 40;
  letter-spacing: 1px;
  transition: color .2s;
}
.admin-link:hover { color: #fff; text-decoration: underline; }

/* ===== 醒目的「开始游戏」大按钮（只能点它进入，防误触） ===== */
.start-play-btn {
  font-family: 'Courier New', monospace;
  cursor: pointer;
  margin: 12px auto 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(16px, 3.8vw, 22px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  padding: clamp(10px, 2vh, 15px) clamp(28px, 8vw, 52px);
  border: 3px solid rgba(255,255,255,.85);
  border-radius: 16px;
  background: linear-gradient(180deg, #6fd17e 0%, #3fae5a 55%, #2f8f47 100%);
  box-shadow: 0 6px 0 #1f6e35, 0 12px 26px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.35);
  text-shadow: 0 2px 0 rgba(0,0,0,.4);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.start-play-btn:hover { filter: brightness(1.08); }
.start-play-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1f6e35, 0 6px 14px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.3);
}
.spb-arrow { color: #ffe27a; font-size: .8em; animation: bob 1.1s ease-in-out infinite; }

/* 开始界面内的存档菜单/操作说明等块宽度对齐 */
#startScreen .save-menu,
#startScreen .controls-info,
#startScreen #communityMount { width: 100%; max-width: 560px; box-sizing: border-box; }
/* 社区面板根容器（community.js 动态插入的 box）：整宽、纵向排列、居中，避免留言板偏左 */
#startScreen #communityMount > * {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#startScreen #communityMount .cm-board,
#startScreen #communityMount .cm-visits,
#startScreen #communityMount .cm-like-btn { margin-left: auto; margin-right: auto; }

.start-title {
  font-size: 52px;
  font-weight: 800;
  color: #fff;
  text-shadow:
    0 0 10px rgba(76, 175, 80, 0.9),
    0 0 30px rgba(76, 175, 80, 0.6),
    0 0 60px rgba(76, 175, 80, 0.3),
    2px 2px 0 #1B5E20,
    0 4px 12px rgba(0,0,0,0.95),
    0 0 60px rgba(0,0,0,0.7);
  letter-spacing: 4px;
  margin-bottom: 8px;
  position: relative;
  animation: titlePulse 3s ease-in-out infinite;
}

.start-subtitle {
  font-size: 16px;
  color: #81C784;
  margin-bottom: 40px;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 20px rgba(76,175,80,0.5), 3px 3px 0 #2E7D32, 0 4px 8px rgba(0,0,0,0.5); }
  50% { text-shadow: 0 0 30px rgba(76,175,80,0.7), 3px 3px 0 #2E7D32, 0 4px 12px rgba(0,0,0,0.5); }
}

.controls-info {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 20px 30px;
  max-width: 500px;
  text-align: left;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.controls-info h3 {
  color: #81C784;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 2px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.control-row .key {
  color: #A5D6A7;
  font-weight: bold;
  min-width: 80px;
  text-align: right;
  margin-right: 12px;
}

/* ===== 折叠式键盘操作说明（默认收起，节省首屏空间） ===== */
.controls-collapse {
  width: 100%;
  max-width: 560px;
  margin: 8px auto 0;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.controls-collapse > summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  color: #ffe9a8;
  padding: 11px 16px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease;
}
.controls-collapse > summary::-webkit-details-marker { display: none; }
.controls-collapse > summary:hover { background: rgba(255, 255, 255, 0.08); }
.controls-collapse > summary::after { content: " ▾"; }
.controls-collapse[open] > summary::after { content: " ▴"; }
.controls-collapse .controls-collapse-body {
  padding: 4px 20px 16px;
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.controls-collapse .controls-collapse-body::-webkit-scrollbar { width: 7px; }
.controls-collapse .controls-collapse-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.25); border-radius: 8px;
}

/* ============================================
   右上角操作说明面板（桌面端常驻）
   ============================================ */
#controlsPanel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
}

/* 圆形 “?” 按钮：常驻右上角，点击展开/收起 */
.controls-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #81C784;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s ease, background 0.15s ease;
}

.controls-trigger:hover {
  background: rgba(60, 90, 60, 0.78);
  transform: scale(1.08);
}

.controls-body {
  display: block;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 12px 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-height: 70vh;
  overflow-y: auto;
}

/* 收起状态：只留圆形按钮 */
#controlsPanel.collapsed .controls-body {
  display: none;
}

/* ===== 世界小地图 ===== */
.world-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 4, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 16px;
}

.world-map-card {
  width: min(92vw, 460px);
  background: linear-gradient(180deg, #fff8ea, #ffefd2);
  border: 3px solid #e7b96a;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 14px 14px 12px;
  font-family: 'Courier New', monospace;
  color: #5a4326;
}

.world-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.world-map-title {
  font-size: 18px;
  font-weight: bold;
  color: #c25a7d;
  letter-spacing: 1px;
}

.world-map-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-zoom-btn,
.map-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid #e0b364;
  background: #fff;
  color: #8a6a2f;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}
.map-close-btn { border-color: #e89a9a; color: #c0504d; }
.map-zoom-btn:active, .map-close-btn:active { transform: scale(0.92); }

.map-range-label {
  min-width: 20px;
  text-align: center;
  font-weight: bold;
  color: #8a6a2f;
}

.world-map-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e7b96a;
  background: #bfe0f2;
}

#worldMapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
}

.map-compass {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #e0b364;
  color: #d24a6b;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.map-you-are {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e0b364;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: bold;
  color: #5a4326;
}

.world-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 10px 2px 6px;
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: inline-block;
}

.world-map-tip {
  text-align: center;
  font-size: 11px;
  color: #8a7250;
  line-height: 1.5;
}

/* 面板内标题 */
.controls-body::before {
  content: "操作说明";
  display: block;
  color: #81C784;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

/* 暂停界面 */
#pauseScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

#pauseScreen .pause-text {
  font-size: 36px;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#pauseScreen .pause-hint {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  animation: hintBlink 2s ease-in-out infinite;
}

/* 加载提示 */
#loadingBar {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 80;
  text-align: center;
  display: none;
}

#loadingBar .loading-text {
  color: #81C784;
  font-size: 18px;
  margin-bottom: 12px;
}

#loadingBar .loading-progress {
  width: 200px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

#loadingBar .loading-fill {
  height: 100%;
  background: #4CAF50;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

/* 响应式适配（仅按宽度判断，避免 pointer:coarse 误伤触屏笔记本） */
@media (max-width: 768px) {
  .start-title {
    font-size: 32px;
    letter-spacing: 2px;
  }

  .start-subtitle {
    font-size: 14px;
  }

  /* —— 开始界面首屏压缩：让标题+选角+开始按钮尽量落在一屏内 —— */
  #startScreen { padding-top: 10px; padding-bottom: 24px; }
  .start-brand { margin-bottom: 10px; padding: 4px 14px; }
  .logo-cube { width: 38px; height: 38px; margin-bottom: 2px; }
  .logo-lockup { padding: 2px 10px 0; }
  .logo-en { margin-top: 6px; }
  .logo-rule { margin-top: 7px; }
  .start-welcome { margin-top: 12px; padding: 7px 14px; line-height: 1.5; }
  .char-select { margin-top: 12px; }
  .char-select-label { margin-bottom: 6px; }
  .char-options-4 { gap: 8px; }
  .char-card { padding: 8px 5px 7px; gap: 3px; }
  .start-play-btn { margin: 14px auto 6px; }
  .cm-list { max-height: 92px; }
  .cm-board { padding: 8px 10px; }
  .cm-visits { font-size: 12px; padding: 6px 10px; }

  .controls-info {
    padding: 14px 18px;
    margin: 0 16px;
  }

  .control-row {
    font-size: 12px;
  }

  .hotbar-slot {
    width: 44px;
    height: 44px;
  }

  .hotbar-slot .block-preview {
    width: 30px;
    height: 30px;
  }

  .hotbar-slot .slot-key {
    font-size: 11px;
    padding: 1px 0 1px;
  }

  #debugInfo {
    font-size: 11px;
  }

  #selectedBlockName {
    bottom: 62px;
    font-size: 13px;
    padding: 4px 12px;
  }

  /* 隐藏桌面端操作说明 */
  .desktop-only {
    display: none;
  }
}

@media (max-width: 480px) {
  .start-title {
    font-size: 24px;
  }

  .hotbar-slot {
    width: 38px;
    height: 38px;
  }

  .hotbar-slot .block-preview {
    width: 26px;
    height: 26px;
  }

  .hotbar-slot .slot-key {
    font-size: 10px;
    padding: 1px 0 1px;
  }

  #hotbar {
    bottom: 10px;
  }

  #selectedBlockName {
    bottom: 54px;
    font-size: 12px;
    padding: 3px 10px;
  }
}

/* ============================================ */
/*  移动端触控 UI 样式 */
/* ============================================ */

#mobileControls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  display: none;
}

/* 移动端功能菜单（⋯） */
#mMenuBtn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(20,14,8,0.55);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  z-index: 22;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
#mMenuBtn:active { transform: scale(0.92); }

.m-menu-panel {
  position: absolute;
  top: 68px;
  right: 14px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(290px, 70vw);
  padding: 10px;
  background: rgba(24,16,10,0.86);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  pointer-events: auto;
  z-index: 22;
  box-shadow: 0 8px 26px rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  touch-action: none;
}
.m-menu-panel.open { display: grid; }
.m-fn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.m-fn span { font-size: 11px; opacity: 0.9; }
.m-fn:active { background: rgba(244,107,149,0.4); transform: scale(0.94); }

/* 移动端简易说明弹层 */
.m-help-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.m-help-card {
  background: #fff3dc;
  border: 3px solid #f46b95;
  border-radius: 18px;
  padding: 20px 18px;
  max-width: 340px;
  width: 100%;
  color: #4a3418;
  font-family: 'Courier New', monospace;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.m-help-title { font-size: 20px; font-weight: 700; text-align: center; color: #c8477a; margin-bottom: 12px; }
.m-help-row { font-size: 14px; line-height: 1.5; padding: 4px 0; border-bottom: 1px dashed rgba(0,0,0,0.12); }
.m-help-ok {
  display: block;
  margin: 14px auto 0;
  padding: 10px 28px;
  border: none;
  border-radius: 12px;
  background: #f46b95;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}
@media (min-width: 820px) {
  #mMenuBtn, .m-menu-panel { display: none !important; }
}

/* 虚拟摇杆 */
#joystickZone {
  position: absolute;
  bottom: 130px;
  left: 24px;
  width: 110px;
  height: 110px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  z-index: 21;
}

#joystickThumb {
  position: absolute;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.05s ease-out;
}

/* 操作按钮区 */
#actionButtons {
  position: absolute;
  bottom: 140px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  z-index: 21;
}

.action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transition: background 0.1s, border-color 0.1s;
}

.action-btn:active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* 移动端物品栏 */
#mobileHotbar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  pointer-events: auto;
  z-index: 21;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.m-slot {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: all 0.12s ease-out;
  position: relative;
}

.m-slot-num {
  position: absolute;
  top: -3px;
  left: 0px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: #ffd84d;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
  pointer-events: none;
  font-family: 'Courier New', monospace;
}

.m-slot.selected {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
  outline: 1px solid rgba(255, 255, 255, 0.25);
  outline-offset: -2px;
}

.m-block-preview {
  width: 26px;
  height: 26px;
  border-radius: 2px;
  image-rendering: pixelated;
}

/* 移动端暂停界面适配 */
@media (max-width: 768px) {
  #pauseScreen .pause-text {
    font-size: 28px;
  }

  #pauseScreen .pause-hint {
    font-size: 14px;
  }

  #crosshair {
    font-size: 18px;
  }

  #blockHighlight {
    top: 53%;
    font-size: 11px;
  }
}

/* ============================================
   创造模式背包
   ============================================ */
.inventory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(2px);
}
.inventory-overlay.open {
  display: flex;
}
.inventory-window {
  width: min(900px, 92vw);
  max-height: 86vh;
  background: linear-gradient(180deg, #c6c6c6, #a0a0a0);
  border: 3px solid #000;
  box-shadow: inset -3px -3px 0 #555, inset 3px 3px 0 #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  image-rendering: pixelated;
}
.inventory-title {
  font-weight: bold;
  color: #303030;
  font-size: 14px;
  text-shadow: 1px 1px 0 #e0e0e0;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  overflow-y: auto;
  padding: 8px;
  background: #8b8b8b;
  border: 2px solid #373737;
  box-shadow: inset 2px 2px 0 #555;
  max-height: 50vh;
}
.inv-cell {
  position: relative;
  aspect-ratio: 1;
  background: #8b8b8b;
  border: 2px solid #000;
  box-shadow: inset -2px -2px 0 #373737, inset 2px 2px 0 #c6c6c6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.05s;
}
.inv-cell:hover {
  transform: scale(1.06);
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.inv-cell.selected {
  outline: 3px solid #ffd700;
  outline-offset: -3px;
  box-shadow: inset -2px -2px 0 #373737, inset 2px 2px 0 #c6c6c6, 0 0 12px rgba(255,215,0,0.8);
}
.inv-icon {
  width: 70%;
  height: 70%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.inv-cell-label {
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  font-size: 9px;
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.inventory-divider {
  height: 2px;
  background: #555;
  box-shadow: 0 1px 0 #fff;
}
.inventory-hotbar-label {
  font-size: 12px;
  color: #303030;
  font-weight: bold;
}
.inventory-hotbar {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}
.inv-slot {
  position: relative;
  aspect-ratio: 1;
  background: #8b8b8b;
  border: 2px solid #000;
  box-shadow: inset -2px -2px 0 #373737, inset 2px 2px 0 #c6c6c6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.inv-slot:hover {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.inv-slot .inv-icon {
  width: 72%;
  height: 72%;
}
.inv-slot-key {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  color: #ffff55;
  text-shadow: 1px 1px 0 #000;
}
.inv-slot-empty {
  color: #555;
  font-size: 14px;
}
.inventory-tips {
  font-size: 11px;
  color: #303030;
  text-align: center;
}

/* ===== 存档菜单与提示 ===== */
.save-menu {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 3;
}
.save-btn {
  min-width: 210px;
  padding: 10px 22px;
  font-size: 15px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #fff;
  background: rgba(60, 60, 70, 0.82);
  border: 2px solid #8a8a96;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.save-btn:hover {
  background: rgba(90, 90, 110, 0.92);
  border-color: #cfcfda;
  transform: translateY(-1px);
}
.save-btn-primary {
  background: rgba(76, 175, 80, 0.9);
  border-color: #a5d6a7;
}
.save-btn-primary:hover {
  background: rgba(96, 195, 100, 0.95);
  border-color: #d2f2d4;
}
.save-note {
  margin-top: 6px;
  max-width: 340px;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255,255,255,0.6);
  font-family: 'Courier New', monospace;
}
.save-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 22px;
  background: rgba(20, 20, 28, 0.88);
  color: #fff;
  border: 2px solid #8a8a96;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1001;
}
.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 社区功能（访客计数 / 点赞 / 留言） ===== */
.start-base {
  font-size: 22px;
  font-weight: 700;
  color: #ffe08a;
  letter-spacing: 3px;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 18px rgba(0,0,0,0.7);
}
.community-box {
  margin-top: 22px;
  width: 380px;
  max-width: calc(100vw - 36px);
  background: rgba(20, 22, 30, 0.72);
  border: 2px solid rgba(244, 107, 149, 0.55);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
  position: relative;
  z-index: 5;
}
.cm-visits {
  text-align: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.cm-visits-num { color: #ffd166; font-size: 18px; }
.cm-like-btn {
  align-self: center;
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #f46b95, #e0487c);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(244,107,149,0.4);
  transition: transform 0.12s;
  position: relative;
}
.cm-like-btn:hover { transform: scale(1.05); }
.cm-like-btn.liked { background: linear-gradient(180deg, #ff8fb3, #f46b95); }
.cm-float-heart {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 20px;
  pointer-events: none;
  animation: cmFloat 1s ease-out forwards;
}
@keyframes cmFloat {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -38px); }
}
.cm-board {
  border-top: 1px dashed rgba(255,255,255,0.25);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cm-board-title { color: #ffd9e8; font-size: 13px; font-weight: 700; text-align: center; }
.cm-name, .cm-msg {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 7px 10px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.cm-msg { resize: none; }
.cm-name:focus, .cm-msg:focus { outline: 2px solid rgba(244,107,149,0.6); }
.cm-send {
  padding: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(96, 175, 100, 0.9);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.cm-send:hover { background: rgba(110, 195, 114, 0.95); }
.cm-send:disabled { opacity: 0.6; cursor: default; }
.cm-list {
  max-height: 150px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 6px 2px 2px;
  /* 专业细滚动条 */
  scrollbar-width: thin;
  scrollbar-color: rgba(244,107,149,.7) rgba(255,255,255,.08);
}
.cm-list::-webkit-scrollbar { width: 8px; }
.cm-list::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 8px; }
.cm-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f48fb2, #f46b95);
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,.15);
}
.cm-list::-webkit-scrollbar-thumb:hover { background: #f46b95; }
.cm-item {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12.5px;
  color: #f2f2f2;
  line-height: 1.5;
  word-break: break-word;
}
.cm-item-name { color: #ffd166; font-weight: 700; }
.cm-note { font-size: 12px; color: rgba(255,255,255,0.55); text-align: center; padding: 4px 0; }
@media (max-width: 768px) {
  .community-box { width: auto; }
  .start-base { font-size: 18px; letter-spacing: 2px; }
}

/* ===== 妈妈审核页（admin.html） ===== */
.admin-wrap {
  max-width: 720px;
  margin: 30px auto;
  padding: 20px;
  font-family: 'Courier New', monospace;
  color: #fff;
  background: #1d1f29;
  border-radius: 12px;
}
.admin-wrap h1 { font-size: 20px; color: #ffd166; }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.admin-row input { flex: 1; min-width: 200px; padding: 8px; border-radius: 6px; border: 1px solid #555; background: #111; color: #fff; }
.admin-row button { padding: 8px 14px; border: none; border-radius: 6px; background: #f46b95; color: #fff; font-weight: 700; cursor: pointer; }
.admin-msg { background: #262835; border-radius: 8px; padding: 12px; margin: 10px 0; }
.admin-msg .am-meta { font-size: 12px; color: #9aa; margin-bottom: 6px; }
.admin-msg .am-text { font-size: 15px; margin-bottom: 8px; }
.admin-msg button { margin-right: 8px; padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: 700; }
.am-approve { background: #60af64; color: #fff; }
.am-hide { background: #6b6b78; color: #fff; }
.am-delete { background: #c0405a; color: #fff; }
.admin-pending { color: #ffd166; font-weight: 700; }
body.admin-body { background: #0f1017; margin: 0; }

/* ===== 装备兑换商店 ===== */
.shop-window { max-width: 640px; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px;
}
.shop-cat {
  grid-column: 1 / -1;
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: bold;
  color: #ffd98a;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 3px;
}
.shop-cell {
  background: rgba(40,40,48,0.85);
  border: 2px solid #5a5a66;
  border-radius: 4px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.shop-icon img {
  width: 40px; height: 40px;
  image-rendering: pixelated;
  display: block;
}
.shop-name {
  font-size: 11px;
  color: #fff;
  font-family: 'Courier New', monospace;
}
.shop-buy {
  width: 100%;
  padding: 4px 0;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #fff;
  background: rgba(76,150,80,0.9);
  border: 1px solid #9ad69a;
  border-radius: 3px;
  cursor: pointer;
}
.shop-buy:hover { background: rgba(96,175,100,0.95); }

/* ===== 新手引导面板（向导兔子 + 任务） ===== */
.tutorial-panel {
  position: fixed;
  left: 16px;
  top: 90px;
  width: 320px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #f46b95;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 6px 24px rgba(244, 107, 149, 0.35);
  z-index: 60;
  transition: opacity .4s, transform .4s;
  pointer-events: none;
}
.tutorial-panel.tu-finished { border-color: #60af64; box-shadow: 0 6px 24px rgba(96,175,100,0.35); }
.tutorial-panel.tu-hide { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.tu-bunny { font-size: 34px; line-height: 1; animation: tu-bounce 1.2s ease-in-out infinite; }
@keyframes tu-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.tu-body { flex: 1; min-width: 180px; }
.tu-title { font-weight: 800; color: #d2457a; font-size: 15px; margin-bottom: 4px; }
.tu-text { color: #5a3a4a; font-size: 13px; line-height: 1.5; }
.tu-progress { display: flex; gap: 8px; margin-top: 8px; }
.tu-dot { font-size: 14px; color: #ccc; }
.tu-dot.cur { color: #f46b95; }
.tu-dot.done { color: #60af64; }
.tu-hint {
  flex-basis: 100%;
  text-align: center;
  font-size: 11px;
  color: #a06a80;
  background: rgba(244, 107, 149, 0.10);
  border-radius: 8px;
  padding: 4px 8px;
  margin-top: -2px;
  pointer-events: none;
}
.tu-hint b {
  display: inline-block;
  background: #f46b95;
  color: #fff;
  border-radius: 5px;
  padding: 0 7px;
  font-size: 12px;
  margin: 0 2px;
}
@media (max-width: 768px) {
  .tutorial-panel { width: auto; left: 10px; right: 10px; top: 70px; padding: 10px 12px; }
  .tu-text { font-size: 12px; }
  .tu-hint { display: none; } /* 手机端直接点 ✕，不显示按键提示 */
}

/* ===== 作品集相册 ===== */
/* 拍照 / 相册 悬浮按钮（右下角，移动端友好） */
.photo-btn {
  position: fixed;
  right: 18px;
  bottom: 150px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.85);
  background: rgba(40, 40, 55, 0.72);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: transform .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.photo-btn:active { transform: scale(0.9); background: rgba(244,107,149,0.85); }
.photo-btn.album-btn { bottom: 212px; font-size: 22px; }
/* 移动端隐藏独立拍照/相册按钮（已收进 ⋯ 操作菜单，避免与右侧跳/拆/放按钮重叠） */
@media (max-width: 768px) {
  .photo-btn { display: none !important; }
}
@media (min-width: 769px) {
  .photo-btn { bottom: 28px; right: 110px; }
  .photo-btn.album-btn { bottom: 28px; right: 176px; }
}

/* 拍照白闪反馈 */
#photoFlash {
  position: fixed; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 90;
}
#photoFlash.flashing { animation: photo-flash .45s ease-out; }
@keyframes photo-flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* 相册面板 */
.portfolio-panel {
  position: fixed; inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portfolio-mask {
  position: absolute; inset: 0;
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(3px);
}
.portfolio-dialog {
  position: relative;
  width: min(860px, 92vw);
  max-height: 86vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.4);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.portfolio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portfolio-header h2 {
  margin: 0;
  font-size: 22px;
  color: #d2457a;
}
.portfolio-close {
  border: none;
  background: #f0f0f4;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}
.portfolio-close:hover { background: #ffd6e4; color: #d2457a; }
.portfolio-tip { color: #888; font-size: 13px; margin: 6px 0 14px; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}
.photo-cell {
  border-radius: 12px;
  overflow: hidden;
  background: #f6f6f8;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .12s, border-color .12s;
}
.photo-cell:hover { transform: translateY(-3px); border-color: #f46b95; }
.photo-cell img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}
.photo-meta {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}
.photo-title { font-size: 13px; font-weight: 700; color: #444; }
.photo-date { font-size: 11px; color: #aaa; }
.portfolio-empty {
  text-align: center;
  color: #aaa;
  padding: 40px 20px;
  font-size: 15px;
}
.portfolio-empty b { color: #d2457a; }

/* 灯箱大图 */
.portfolio-lightbox {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 18px;
  padding: 20px;
}
.portfolio-lightbox img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.lightbox-bar { display: flex; gap: 10px; }
.lightbox-bar button {
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #444;
}
.lightbox-bar .lb-download { background: #60af64; color: #fff; }
.lightbox-bar .lb-delete { background: #e06464; color: #fff; }
@media (max-width: 768px) {
  .portfolio-dialog { padding: 14px; max-height: 90vh; }
  .portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .photo-title { font-size: 12px; }
}

/* 新手引导面板的关闭按钮 */
.tutorial-panel .tu-close {
  pointer-events: auto;
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(244, 107, 149, 0.15);
  color: #d2457a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.tutorial-panel .tu-close:active { background: #f46b95; color: #fff; }

/* 背包：恢复默认按钮 */
.inventory-actions { margin-top: 12px; text-align: center; }
.inv-reset-btn {
  border: 2px solid #d2457a;
  background: #fff;
  color: #d2457a;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  padding: 8px 18px;
  cursor: pointer;
}
.inv-reset-btn:hover { background: #d2457a; color: #fff; }

/* ============ 多人联机：队友过远边缘指引 ============ */
.team-pointer {
  position: fixed;
  left: 50%; top: 50%;
  width: 0; height: 0;
  z-index: 240;
  display: none;
  pointer-events: none;
  user-select: none;
  cursor: pointer;
}
.team-pointer.show {
  display: block;
  animation: tp-fade-in 0.25s ease-out;
}
@keyframes tp-fade-in { from { opacity: 0; } to { opacity: 1; } }

.tp-arrow {
  position: absolute;
  left: 0; top: 0;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  background: radial-gradient(circle at 50% 40%, rgba(244,107,149,0.95), rgba(210,69,122,0.88));
  border: 3px solid #f4c46b;
  box-shadow: 0 0 0 3px rgba(20,12,4,0.55), 0 0 18px rgba(244,107,149,0.85);
}
.tp-tri {
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 19px solid #fff;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.45));
  margin-top: -8px;
  animation: tp-pulse 1.1s ease-in-out infinite;
}
@keyframes tp-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
.tp-arrow::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px dashed rgba(244,196,107,0.65);
}

.tp-info {
  position: absolute;
  left: 0; top: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
  pointer-events: none;
}
.tp-name {
  background: rgba(20,12,4,0.85);
  color: #ffd9ec;
  border: 2px solid rgba(244,196,107,0.85);
  border-radius: 8px;
  padding: 2px 10px 3px;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.3;
}

/* ============ 多人共建：对话气泡聊天条 ============ */
.chat-dock {
  position: fixed;
  left: 14px;
  bottom: 12px;
  width: 300px;
  z-index: 235;
  display: none;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 132px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}
.chat-msg {
  align-self: flex-start;
  max-width: 92%;
  background: rgba(20,12,4,0.72);
  border: 2px solid rgba(244,196,107,0.55);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #fff6e6;
  word-break: break-word;
  animation: chatIn 0.18s ease-out;
}
.chat-msg .chat-who { color: #f4c46b; font-weight: bold; margin-right: 5px; }
.chat-msg.me {
  align-self: flex-end;
  background: rgba(244,107,149,0.22);
  border-color: rgba(244,107,149,0.75);
}
.chat-msg.me .chat-who { color: #ff9ec4; }
.chat-msg.sys {
  align-self: center;
  background: rgba(10, 6, 0, 0.55);
  border: 1px dashed rgba(244, 196, 107, 0.45);
  color: #d8c49a;
  font-size: 12px;
  padding: 2px 10px;
  text-align: center;
}
@keyframes chatIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-row { display: flex; gap: 6px; }
.chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(10,6,0,0.62);
  border: 2px solid rgba(244,196,107,0.7);
  border-radius: 8px;
  color: #fff6e6;
  font-family: 'Courier New', "Microsoft YaHei", monospace;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
}
.chat-input::placeholder { color: rgba(255,236,200,0.55); }
.chat-input:focus { border-color: #f4c46b; box-shadow: 0 0 8px rgba(244,196,107,0.5); }
.chat-send {
  flex: none;
  background: rgba(224,152,60,0.92);
  color: #2a1808;
  border: 2px solid #f4c46b;
  border-radius: 8px;
  font-family: 'Courier New', "Microsoft YaHei", monospace;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}
.chat-send:active { transform: translateY(1px); }
.chat-mic {
  flex: none;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(244,107,149,0.18);
  color: #ff9ec2;
  border: 2px solid #f46b95;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.chat-mic:active { transform: translateY(1px); }
.chat-mic.listening {
  background: #f46b95;
  color: #fff;
  animation: micPulse 1s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(244,107,149,0.8);
}
.chat-mic.unsupported { opacity: 0.35; filter: grayscale(1); }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(244,107,149,0.6); }
  50% { box-shadow: 0 0 16px rgba(244,107,149,1); }
}
@media (max-width: 640px) {
  .chat-dock { width: 58vw; left: 8px; bottom: 8px; gap: 4px; }
  .chat-log { max-height: 84px; }
  .chat-msg { font-size: 12px; padding: 3px 8px; }
  .chat-input { font-size: 12px; padding: 6px 8px; }
  .chat-send { font-size: 12px; padding: 5px 10px; }
  .chat-mic { width: 30px; height: 30px; font-size: 14px; }
}
.tp-dist {
  margin-top: 3px;
  background: rgba(20,12,4,0.75);
  color: #f4c46b;
  border-radius: 6px;
  padding: 1px 8px 2px;
  font-size: 11px;
}
/* 可点击时（桌面端）打开命中 */
@media (hover: hover) and (pointer: fine) {
  .team-pointer.show { pointer-events: auto; }
}

/* ========== 多人共建：常驻状态徽章 ========== */
.mp-badge {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 240;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(20, 12, 4, 0.78);
  border: 2px solid #f4c46b;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(20, 12, 4, 0.55), 0 4px 14px rgba(0, 0, 0, 0.4);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #ffeec9;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.mp-badge:hover { background: rgba(38, 24, 8, 0.9); }
.mpb-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #57d98a;
  box-shadow: 0 0 8px #57d98a;
  animation: mpbPulse 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes mpbPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}
.mpb-label { color: #f4c46b; font-weight: bold; letter-spacing: 1px; }
.mpb-code {
  font-weight: bold;
  font-size: 15px;
  color: #fff;
  background: rgba(244, 196, 107, 0.16);
  border: 1px solid rgba(244, 196, 107, 0.5);
  border-radius: 6px;
  padding: 1px 8px;
  letter-spacing: 2px;
}
.mpb-count { color: #bfe8c9; font-size: 12px; }

/* ========== 多人共建：进房欢迎横幅 ========== */
.mp-banner {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 0, 0.35);
  pointer-events: none;
}
.mp-banner .mpb-card {
  pointer-events: none;
  text-align: center;
  background: rgba(20, 12, 4, 0.92);
  border: 3px solid #f4c46b;
  box-shadow: 0 0 0 3px rgba(20, 12, 4, 0.6), 0 10px 40px rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  padding: 22px 38px;
  font-family: 'Courier New', monospace;
  color: #ffeec9;
  animation: mpbPop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes mpbPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.mp-banner.hide .mpb-card { opacity: 0; transform: translateY(-12px) scale(0.98); transition: opacity 0.5s, transform 0.5s; }
.mpb-title { font-size: 20px; font-weight: bold; color: #f4c46b; letter-spacing: 1px; }
.mpb-room { margin-top: 12px; font-size: 15px; color: #e9d6ad; }
.mpb-room b {
  font-size: 30px;
  color: #fff;
  letter-spacing: 5px;
  margin: 0 8px;
  text-shadow: 0 0 14px rgba(244, 196, 107, 0.7);
}
.mpb-copy {
  font-size: 12px;
  color: #f4c46b;
  border: 1px solid #f4c46b;
  border-radius: 6px;
  padding: 1px 8px;
  cursor: pointer;
  pointer-events: auto;
}
.mpb-copy:hover { background: #f4c46b; color: #2a1a06; }
.mpb-people { margin-top: 10px; font-size: 14px; color: #bfe8c9; min-height: 18px; }
.mpb-hint { margin-top: 8px; font-size: 12px; color: #c9b58d; }

@media (max-width: 700px) {
  .mp-badge { top: 8px; padding: 5px 10px; gap: 6px; font-size: 11px; }
  .mpb-code { font-size: 13px; letter-spacing: 1px; padding: 1px 6px; }
  .mpb-count { font-size: 11px; }
  .mp-banner .mpb-card { padding: 18px 22px; max-width: 86vw; }
  .mpb-title { font-size: 17px; }
  .mpb-room b { font-size: 24px; letter-spacing: 3px; }
}

@media (max-width: 700px) {
  .tp-arrow { width: 46px; height: 46px; margin: -23px 0 0 -23px; font-size: 22px; }
  .tp-name { font-size: 12px; }
}
/* ===== 多人共建面板（与开始界面深色毛玻璃风统一） ===== */
#startScreen .mp-card { width: 100%; max-width: 560px; box-sizing: border-box; }
.mp-card {
  margin-top: 22px;
  border-radius: 14px;
  background: rgba(20, 22, 30, 0.72);
  border: 2px solid rgba(244, 107, 149, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  font-family: 'Courier New', 'Microsoft YaHei', monospace;
  text-align: left;
  overflow: hidden;
}
.mp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(244, 107, 149, 0.28);
}
.mp-globe { font-size: 24px; line-height: 1; filter: drop-shadow(0 0 6px rgba(244,107,149,.6)); }
.mp-head-text { flex: 1 1 auto; min-width: 0; }
.mp-title {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #ffd9ec;
  text-shadow: 0 0 10px rgba(244,107,149,.55), 0 2px 4px rgba(0,0,0,.6);
}
.mp-subtitle { font-size: 11.5px; color: rgba(255,255,255,.62); margin-top: 3px; letter-spacing: 1px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:center; }
.mp-cap-badge { font-family: 'Courier New', monospace; font-size: 10px; font-weight:bold; color:#3a2405; background:linear-gradient(#fbe08b,#eab54d); border:2px solid #f6d27a; border-radius:8px; padding:1px 7px; box-shadow:0 2px 0 #a86b1e; white-space:nowrap; }
.mp-online-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 999px;
  color: #b7ffc9;
  background: rgba(76, 175, 80, 0.18);
  border: 1px solid rgba(126, 226, 150, 0.5);
  letter-spacing: 1px;
}
.mp-online-pill::before { content: '●'; color: #7ee296; margin-right: 4px; font-size: 9px; vertical-align: middle; }
.mp-card-body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 12px; }
.mp-field { display: flex; flex-direction: column; gap: 5px; }
.mp-field label { font-size: 12px; font-weight: bold; color: #ffb3cf; letter-spacing: 2px; }
.mp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.mp-input::placeholder { color: rgba(255, 255, 255, 0.42); }
.mp-input:focus {
  outline: none;
  border-color: #f46b95;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(244, 107, 149, 0.22);
}
.mp-cols { display: flex; flex-direction: column; gap: 10px; }
.mp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #fff;
  cursor: pointer;
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.mp-btn-ico { font-size: 17px; }
.mp-btn-create {
  background: linear-gradient(180deg, #f46b95, #e0487c);
  box-shadow: 0 4px 14px rgba(244, 107, 149, 0.4);
}
.mp-btn-create:hover { transform: scale(1.02); filter: brightness(1.06); }
.mp-or { display: flex; align-items: center; gap: 10px; color: rgba(255, 217, 236, 0.7); font-size: 12px; }
.mp-or i {
  flex: 1 1 auto; height: 1px;
  background: repeating-linear-gradient(90deg, rgba(244,107,149,.5) 0 6px, transparent 6px 12px);
}
.mp-or span { font-weight: bold; letter-spacing: 1px; }
.mp-join { display: flex; gap: 8px; }
.mp-join .mp-code {
  flex: 1 1 auto;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: bold;
  text-align: center;
}
.mp-btn-join {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 20px;
  background: linear-gradient(180deg, #f6d079, #e0983c);
  color: #4a2c05;
  box-shadow: 0 4px 14px rgba(224, 152, 60, 0.35);
}
.mp-btn-join:hover { transform: scale(1.03); filter: brightness(1.05); }
.mp-codebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(26, 74, 46, 0.5);
  border: 2px solid rgba(126, 226, 150, 0.55);
  animation: mpPop .25s ease;
}
.mp-codebar-label { font-size: 12px; font-weight: bold; color: #b7ffc9; letter-spacing: 2px; }
.mp-code-value {
  flex: 1 1 auto;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 6px;
  color: #a7f0c2;
  text-align: center;
  text-shadow: 0 0 12px rgba(126,226,150,.5);
}
.mp-copy {
  border: none;
  border-radius: 999px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  color: #08230f;
  background: linear-gradient(180deg, #7ee296, #3aa96e);
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.mp-copy:hover { filter: brightness(1.08); transform: scale(1.04); }
@keyframes mpPop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mp-status {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 9px 12px;
}
.mp-status.mp-error {
  color: #ffc2d6;
  background: rgba(120, 30, 60, 0.35);
  border-color: rgba(244, 107, 149, 0.5);
}
.mp-status.mp-success {
  color: #b7ffc9;
  background: rgba(26, 74, 46, 0.4);
  border-color: rgba(126, 226, 150, 0.5);
}
.mp-steps {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
}
.mp-steps span { flex: 1 1 0; text-align: center; }
.mp-btn:disabled { opacity: 0.55; cursor: default; }
.mp-btn:disabled:hover { transform: none; filter: none; }
@media (max-width: 480px) {
  .mp-steps { display: none; }
  .mp-code-value { font-size: 20px; letter-spacing: 4px; }
}

