/* ══════════════════════════════════════════════════════════════════════════
   地下矿洞 · 页面样式
   ──────────────────────────────────────────────────────────────────────────
   🔴 界面风格（服主 2026-11-15 定）：统一成 Minecraft 原版 GUI 的样子。
   外观走 `gui.css`，这个文件只管本页布局。

   矿洞的特殊之处：界面压在「石壁」上，所以底部用深色容器面板，
   与原版「打开箱子/熔炉」时那种深色 GUI 一致。
   ══════════════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  /* 矿洞保持深色（本来就该暗），但用暖褐而非冷黑 ——
     冷色底与草地绿的入口页反差太大，来回切换像两个站。 */
  background-color: #1f1a14;
  background-image: url("assets/mc/block_deepslate.png");
  background-size: 56px 56px;
  background-blend-mode: multiply;
  color: #e0e0e0;
  font-family: var(--mc-font);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 0 0 36px;
  image-rendering: pixelated;
}

/* ── 顶栏 ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: #2b2b2b;
  border-bottom: 2px solid #000;
  box-shadow: inset 0 -2px 0 #4a4a4a;
  position: sticky;
  top: 0;
  z-index: 50;
}
.face {
  width: 34px; height: 34px; flex: 0 0 34px;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #5a5a5a;
  overflow: hidden;
  background: #1a1a1a;
}
.face img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

.who { display: flex; flex-direction: column; }
.who .n { font-size: 13px; font-weight: 700; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.who .lv { font-size: 10.5px; color: #a0a0a0; text-shadow: 1px 1px 0 #1a1a1a; }

/* 体力条：原版经验条 */
.stamina-wrap {
  display: flex; align-items: center; gap: 7px;
  background: #1a1a1a;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #4a4a4a;
  padding: 4px 10px;
}
.stamina-wrap img { width: 16px; height: 16px; }
.stamina-bar {
  width: 110px; height: 8px;
  background: #3f3f3f;
  border: 1px solid #1a1a1a;
  overflow: hidden;
}
.stamina-bar > i {
  display: block; height: 100%; width: 0;
  background: #80ff20;
  box-shadow: inset 0 1px 0 #b0ff80;
  transition: width .3s;
}
.stamina-wrap b {
  color: var(--mc-yellow); font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-shadow: 2px 2px 0 #3f3f3f;
}

.stats { display: flex; gap: 12px; margin-left: auto; font-size: 11.5px; color: #a0a0a0; text-shadow: 1px 1px 0 #1a1a1a; }
.stats b { color: #e0e0e0; font-variant-numeric: tabular-nums; }

.iconbtns { display: flex; gap: 5px; }

/* ── 主体 ── */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 14px;
  align-items: start;
}
.shell > * { min-width: 0; }

/* ── 矿壁 ── */
.mine-panel {
  background: var(--mc-bg);
  border: 2px solid var(--mc-border);
  box-shadow:
    inset 2px 2px 0 var(--mc-border-hi),
    inset -2px -2px 0 var(--mc-border-lo),
    0 0 0 2px #000;
  overflow: hidden;
}

.mine-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 11px;
  background: var(--mc-bg-dark);
  border-bottom: 2px solid var(--mc-border);
  box-shadow: inset 0 2px 0 #a8a8a8;
}
.mine-head .layer {
  font-size: 12.5px; font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  display: flex; align-items: center; gap: 6px;
}
.mine-head .layer img { width: 18px; height: 18px; }
.mine-head .btn-deeper { margin-left: auto; }

/* 矿格网格：贴在石壁上 */
.mine-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px;
  background-size: 48px 48px;
  image-rendering: pixelated;
}

.cell {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid #1a1a1a;
  cursor: pointer;
  background-size: 100% 100%;
  image-rendering: pixelated;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .16), inset -1px -1px 0 rgba(0, 0, 0, .45);
  overflow: hidden;
  padding: 0;
  transition: none;
}
.cell:hover:not(:disabled) {
  border-color: #fff;
  box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px #000;
  filter: brightness(1.3);
}
.cell:active:not(:disabled) { transform: translateY(1px); }
.cell:disabled { cursor: not-allowed; }
.mine-grid.no-stamina .cell { filter: grayscale(.75) brightness(.45); }

/* 挖到东西：白框闪一下（原版拾取没有柔光，用硬边框） */
.cell.got {
  border-color: #ffcc00;
  box-shadow: inset 0 0 0 2px #ffcc00, 0 0 0 1px #000;
  animation: mc-flash .35s steps(2);
}
@keyframes mc-flash {
  0% { filter: brightness(2.4); }
  100% { filter: brightness(1); }
}
.cell.digging { animation: mc-shake .15s steps(2) infinite; }
@keyframes mc-shake {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(1px, -1px); }
}

/* 飘字：原版拾取物品那种白字黑影 */
.cell .pop {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  pointer-events: none;
  white-space: nowrap;
  animation: mc-popup 1s steps(10) forwards;
  z-index: 3;
}
@keyframes mc-popup {
  0%   { opacity: 0; transform: translate(-50%, -30%); }
  20%  { opacity: 1; transform: translate(-50%, -55%); }
  100% { opacity: 0; transform: translate(-50%, -150%); }
}

/* ── 右栏 ── */
.side { display: flex; flex-direction: column; gap: 12px; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 3px;
}
.inv-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--mc-slot-bg);
  border: 2px solid var(--mc-border);
  box-shadow:
    inset 2px 2px 0 var(--mc-border-lo),
    inset -2px -2px 0 var(--mc-border-hi),
    0 0 0 2px #000;
  display: grid;
  place-items: center;
}
.inv-item img { width: 24px; height: 24px; image-rendering: pixelated; }
.inv-item .n {
  position: absolute; right: 1px; bottom: 0;
  font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  font-variant-numeric: tabular-nums;
}
.inv-empty { color: #5a5a5a; font-size: 11.5px; text-shadow: none; }

/* 本次收获 */
.sess-list { display: flex; flex-direction: column; gap: 4px; }
.sess-item {
  display: flex; align-items: center; gap: 7px;
  background: var(--mc-slot-bg);
  border: 2px solid var(--mc-border);
  box-shadow: inset 1px 1px 0 var(--mc-border-lo), inset -1px -1px 0 var(--mc-border-hi);
  padding: 3px 8px;
}
.sess-item img { width: 20px; height: 20px; image-rendering: pixelated; }
.sess-item b {
  color: #1a4a10;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-shadow: none;
}
.sess-item small { color: #5a5a5a; font-size: 10.5px; margin-left: auto; text-shadow: none; }

/* ── 底部提示：原版聊天栏 ── */
.tipbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 14px;
  font-size: 11.5px;
  color: #a0a0a0;
  text-shadow: 1px 1px 0 #1a1a1a;
  line-height: 1.8;
}
.tipbar b { color: var(--mc-yellow); }

/* ── 提示条 ── */
.toasts {
  position: fixed; right: 14px; bottom: 18px;
  display: flex; flex-direction: column; gap: 5px;
  z-index: 300; pointer-events: none;
}
.toast {
  background: #212121;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #4a4a4a, inset -2px -2px 0 #101010;
  color: #fff;
  text-shadow: 1px 1px 0 #3f3f3f;
  font-size: 12px;
  padding: 6px 12px;
  max-width: 300px;
  font-family: var(--mc-font);
}
.toast.gold { color: var(--mc-gold); }
.toast.err { color: var(--mc-red); }

/* ── 锁定 ── */
#lockWrap {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  z-index: 250; padding: 20px;
}
#lockWrap[hidden] { display: none; }
.lock-card {
  background: var(--mc-bg);
  border: 2px solid var(--mc-border);
  box-shadow:
    inset 2px 2px 0 var(--mc-border-hi),
    inset -2px -2px 0 var(--mc-border-lo),
    0 0 0 2px #000;
  padding: 22px 26px;
  max-width: 420px; width: 100%;
  text-align: center;
  color: var(--mc-ink);
  font-family: var(--mc-font);
}
.lock-card h2 { font-size: 16px; margin-bottom: 8px; text-shadow: none; }
.lock-card p { font-size: 12.5px; color: #4a4a4a; margin-bottom: 16px; line-height: 1.75; text-shadow: none; }

/* ── 响应式 ── */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .stats { margin-left: 0; width: 100%; }
}
@media (max-width: 620px) {
  html, body { overflow-x: hidden; }
  .shell { padding: 9px; gap: 10px; }
  .mine-grid { gap: 1px; padding: 5px; }
  .stamina-bar { width: 72px; }
  .topbar { padding: 7px 9px; gap: 7px; }
  .face { width: 28px; height: 28px; flex-basis: 28px; }
  .who .n { font-size: 12.5px; }
  .stats { font-size: 10.5px; gap: 9px; }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .inv-item img { width: 20px; height: 20px; }
  .toasts { right: 9px; left: 9px; }
  .toast { max-width: none; }
  .tipbar { font-size: 10.5px; padding: 0 9px; }
}
