/* 我的世界 · 兜兜版 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #87ceeb;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#crosshair {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -52%);
  font-size: 22px; font-weight: 700;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  text-shadow: 0 0 2px #000;
}

/* ---------- 热栏 ---------- */
#hotbar {
  position: fixed;
  left: 50%; bottom: 12px;
  transform: translateX(-50%);
  display: flex; gap: 6px;
  padding: 6px;
  background: rgba(20, 20, 20, .45);
  border-radius: 12px;
}
.slot {
  width: 46px; height: 46px;
  border: 3px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  background: rgba(0, 0, 0, .35);
  padding: 0; cursor: pointer;
  position: relative;
}
.slot canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; border-radius: 4px; }
.slot .num {
  position: absolute; left: 3px; top: 1px;
  font-size: 10px; font-weight: 800;
  color: #fff; text-shadow: 0 1px 2px #000;
}
.slot.sel { border-color: #fff176; box-shadow: 0 0 10px rgba(255, 241, 88, .8); }

#blockLabel {
  position: fixed;
  left: 50%; bottom: 78px;
  transform: translateX(-50%);
  font-size: 15px; font-weight: 800;
  color: #fff; text-shadow: 0 2px 3px rgba(0, 0, 0, .7);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
#blockLabel.show { opacity: 1; }

/* ---------- 触屏控件（仅触屏显示） ---------- */
#touchUI { display: none; }
body.touch #touchUI { display: block; }
body.touch #crosshair { font-size: 30px; }

#joyBase {
  position: fixed;
  left: 26px; bottom: 90px;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .4);
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
#joyBase.on { opacity: 1; }
#joyKnob {
  position: absolute; left: 50%; top: 50%;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
}

.tbtn {
  width: 56px; height: 56px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(0, 0, 0, .3);
  color: #fff; font-size: 24px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tbtn:active { background: rgba(255, 255, 255, .35); }
.tbtn.big { width: 72px; height: 72px; font-size: 30px; }
.tbtn.on { border-color: #fff176; background: rgba(255, 241, 88, .35); }

#rightBtns { position: fixed; right: 20px; bottom: 210px; display: flex; flex-direction: column; gap: 12px; }
#actionBtns { position: fixed; right: 20px; bottom: 96px; display: flex; gap: 14px; }
#btnPause { position: fixed; right: 16px; top: 14px; }

/* ---------- 菜单 ---------- */
#overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 30, 50, .45);
}
#overlay.hidden { display: none; }

.screen {
  background: linear-gradient(180deg, #fffdf5, #f3e9d2);
  border: 4px solid #8d6e63;
  border-radius: 18px;
  padding: 26px 36px 24px;
  text-align: center;
  color: #4e342e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  animation: pop .22s ease;
  max-width: 92vw;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.screen h2 { font-size: 30px; margin-bottom: 10px; letter-spacing: 2px; }
.screen p { font-size: 14px; color: #6d4c41; margin-bottom: 16px; line-height: 1.9; }
.screen p b { color: #3e2723; }
.screen button {
  display: block; width: 230px; margin: 8px auto 0;
  padding: 11px 0;
  font-size: 16px; font-weight: 800;
  border: 2px solid rgba(0, 0, 0, .15);
  border-radius: 12px;
  background: #efebe9; color: #4e342e;
  cursor: pointer;
}
.screen button:hover { background: #e0dcd9; }
.screen button.big {
  background: #66bb6a; color: #fff; font-size: 19px; padding: 13px 0;
  border-color: #43a047;
}
.screen button.big:hover { background: #4caf50; }
.screen .seed { font-size: 12px; opacity: .6; margin-top: 10px; }
