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

/* 全局重置 */
* {
  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: 3px;
  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: 48px;
  height: 48px;
  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;
}

.hotbar-slot .slot-count {
  position: absolute;
  right: 3px;
  top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  z-index: 2;
}

#hpHud {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

#hpHud .hp-label {
  color: #ef5350;
  font-size: 16px;
}

#mobileHotbar .m-slot {
  position: relative;
}

#mobileHotbar .slot-count {
  position: absolute;
  right: 2px;
  top: 1px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* 当前选中方块名称 - 热键栏上方 */
#selectedBlockName {
  position: fixed;
  bottom: 108px;
  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);
}

/* 目标方块高亮提示 */
#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;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: auto;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: default;
  padding: 24px 16px 40px;
  box-sizing: border-box;
}

.lobby {
  width: min(1100px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-head {
  text-align: center;
}

.lobby-head .start-title {
  margin-bottom: 4px;
  font-size: clamp(28px, 5vw, 48px);
}

.lobby-head .start-subtitle {
  margin-bottom: 0;
  font-size: 13px;
  opacity: 0.9;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.lobby-card {
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 16px 16px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lobby-card-wide {
  min-height: 280px;
}

.lobby-h {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: 2px;
  color: #81C784;
  font-weight: 700;
}

.lobby-h-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.lobby-h-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.service-status.ok {
  color: #81C784;
}

.service-status.bad {
  color: #ef9a9a;
}

.waiting-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(129, 199, 132, 0.45);
  background: rgba(46, 125, 50, 0.22);
}

.waiting-title {
  color: #A5D6A7;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.waiting-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.waiting-code-row {
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.waiting-code-row b {
  letter-spacing: 3px;
  font-size: 22px;
  color: #C8E6C9;
}

.waiting-players {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.waiting-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 10px;
  line-height: 1.4;
}

.room-row.mine {
  border-color: #81C784;
  background: rgba(76, 175, 80, 0.18);
}

.game-btn.block.ghost {
  margin-top: 8px;
}

.lobby-desc {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.lobby-foot {
  margin-top: 8px;
  text-align: right;
}

.muted {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.field-label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin: 8px 0 4px;
}

.game-btn.block {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  margin-top: 10px;
}

.game-btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
}

.game-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.or-sep {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin: 14px 0 8px;
  position: relative;
}

.room-list {
  flex: 1;
  overflow-y: auto;
  max-height: min(42vh, 360px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.room-empty {
  padding: 28px 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.room-empty.err {
  color: #ef9a9a;
  border-color: rgba(239, 154, 154, 0.35);
}

.room-row {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 2px 10px;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.room-row:hover:not(:disabled) {
  background: rgba(76, 175, 80, 0.22);
  border-color: #81C784;
}

.room-row:disabled,
.room-row.full {
  opacity: 0.55;
  cursor: not-allowed;
}

.room-row-main {
  grid-column: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.room-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-code {
  font-size: 12px;
  letter-spacing: 2px;
  color: #A5D6A7;
  flex-shrink: 0;
}

.room-row-sub {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.room-row-names {
  grid-column: 1;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-row-cta {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  font-size: 12px;
  color: #A5D6A7;
  font-weight: 700;
  white-space: nowrap;
}

.lobby-help {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  max-width: 520px;
  margin: 0 auto;
}

.lobby-help summary {
  cursor: pointer;
  text-align: center;
  color: #81C784;
  list-style: none;
}

.lobby-help summary::-webkit-details-marker { display: none; }

.controls-info.nested {
  margin-top: 10px;
  max-width: none;
}

.pause-room {
  color: #A5D6A7;
  font-size: 14px;
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.pause-room b {
  letter-spacing: 2px;
}

.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),
    2px 2px 0 #1B5E20,
    0 4px 12px rgba(0,0,0,0.95);
  letter-spacing: 4px;
  margin-bottom: 8px;
  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);
}

@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); }
}

.start-hint {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 24px rgba(0, 0, 0, 0.8);
  animation: hintBlink 2s ease-in-out infinite;
  margin-bottom: 30px;
}

@keyframes hintBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.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;
}

/* ============================================
   右上角操作说明面板（桌面端常驻）
   ============================================ */
#controlsPanel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  display: none;
  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);
}

.controls-trigger {
  display: none;
}

.controls-body {
  display: block;
}

/* 面板内标题 */
.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;
  margin-top: 16px;
}

.start-actions,
.pause-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.game-btn {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.game-btn:hover {
  background: rgba(46, 125, 50, 0.55);
  border-color: #81C784;
}

.game-btn:active {
  transform: scale(0.97);
}

.game-btn.primary {
  background: rgba(76, 175, 80, 0.85);
  border-color: #A5D6A7;
  font-weight: bold;
}

.game-btn.primary:hover {
  background: rgba(102, 187, 106, 0.95);
}

.save-meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  margin-bottom: 20px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.save-toast {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, 0.75);
  color: #A5D6A7;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.online-panel {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  max-width: 360px;
  width: 90%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.online-title {
  color: #81C784;
  font-size: 13px;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 10px;
}

.online-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  justify-content: center;
  align-items: center;
}

.online-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.online-input.code {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: bold;
  text-align: center;
  max-width: 140px;
  flex: 0 0 140px;
}

.online-input:focus {
  border-color: #81C784;
}

.online-status {
  min-height: 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-top: 4px;
}

.online-status.err {
  color: #ef9a9a;
}

.room-code-show {
  text-align: center;
  color: #fff;
  font-size: 16px;
  margin: 8px 0;
}

.room-code-show b {
  color: #A5D6A7;
  letter-spacing: 4px;
  font-size: 22px;
}

.game-btn.tiny {
  padding: 6px 12px;
  font-size: 12px;
}

#roomHud {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 55;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  display: none;
  backdrop-filter: blur(4px);
  cursor: pointer;
  user-select: none;
}

#roomHud:hover {
  background: rgba(0, 0, 0, 0.75);
}

#roomHud b {
  color: #A5D6A7;
  letter-spacing: 2px;
}

#roomHud .hud-hint {
  color: #90CAF9;
  font-size: 12px;
}

#remoteLabels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

.remote-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  will-change: transform;
}

/* 加载提示 */
#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;
  }

  .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;
}

/* 虚拟摇杆 */
#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;
}

.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;
  }
}
