/* DELVE — 掘光：暖褐/余烬橙主题 */

:root {
  --bg: #0d1420; --ink: #f4ead9; --soft: #b8ab99;
  --line: rgba(232, 217, 190, 0.16); --glass: rgba(20, 16, 12, 0.74); --accent: #e88a2a; --accent2: #5fa832;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* 结算面板的玩家名输入框是唯一需要打字的地方，其余界面一律不让 iPad 弹出输入法/选中菜单 */
#player-name { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15); }

.touch-zone { position: fixed; top: 0; bottom: 150px; z-index: 8; touch-action: none; }
.touch-zone.left { left: 0; width: 42%; } .touch-zone.right { right: 0; width: 58%; }

/* 虚拟摇杆：跟随按下点出现，拖动范围内实时反馈，松手归位 */
.joy-base { position: fixed; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%;
  background: rgba(20,16,12,.32); border: 2px solid rgba(232,217,190,.28); z-index: 9; pointer-events: none;
  transition: opacity .12s ease; }
.joy-knob { position: fixed; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(232,217,190,.42); border: 2px solid rgba(232,217,190,.55); z-index: 9; pointer-events: none;
  transition: opacity .12s ease; }
.aim-ping { position: fixed; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 2px solid rgba(255,220,150,.75); z-index: 9; pointer-events: none; animation: pingFade .32s ease forwards; }
@keyframes pingFade { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

.ov { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(60, 40, 20, .5), rgba(8, 10, 8, .92)); overflow-y: auto; }
.ov.show { display: flex; }
.pnl { width: min(560px, 100%); padding: 26px 24px; border-radius: 20px; animation: rise .28s ease; }
.pnl.wide { width: min(880px, 100%); } .pnl.center { text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.logo { margin: 6px 0 2px; font-size: clamp(30px, 8vw, 48px); letter-spacing: .1em; font-weight: 800;
  background: linear-gradient(100deg, #f4ead9, #e88a2a 45%, #5fa832 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.zh-title { margin: 0 0 12px; letter-spacing: .6em; font-size: 15px; color: var(--soft); text-indent: .6em; }
.tagline { margin: 0 auto 18px; max-width: 44ch; color: var(--soft); font-size: 14px; line-height: 1.7; }
.pnl-title { margin: 0 0 16px; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pnl-sub { margin: 10px 0 0; font-size: 12.5px; color: var(--soft); } .pnl-sub.accent { color: var(--accent); }

button { font: inherit; cursor: pointer; }
.b-pri, .b-sec { border-radius: 12px; padding: 13px 20px; font-weight: 700; font-size: 15px; border: 1px solid transparent;
  transition: transform .12s ease, filter .12s ease; }
.b-pri { width: 100%; background: linear-gradient(100deg, #e88a2a, #f4ead9); color: #241a0e; box-shadow: 0 10px 26px rgba(232, 138, 42, .25); }
.b-sec { background: rgba(232, 217, 190, .1); border-color: var(--line); color: var(--ink); }
.b-pri:hover, .b-sec:hover { transform: translateY(-1px); filter: brightness(1.1); }
.row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.row > button { flex: 1 1 130px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; background: rgba(232, 217, 190, .12); border: 1px solid var(--line); color: var(--ink); font-size: 18px; line-height: 1; }
.text-link { color: var(--accent); text-decoration: none; } .text-link:hover { text-decoration: underline; }
.howto { margin: 18px 0 0; padding: 14px 16px; list-style: none; text-align: left; border-radius: 12px;
  background: rgba(24, 20, 14, .5); border: 1px solid var(--line); font-size: 13px; line-height: 1.9; color: var(--soft); }
.meta-row { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--soft); flex-wrap: wrap; }
.meta-dot { opacity: .4; } .meta-row b { color: var(--accent); }
.soft { font-size: 12px; color: var(--soft); }
.version-tag { font-size: 10.5px; color: var(--soft); opacity: .7; font-family: ui-monospace, monospace; }

/* ---------------------------------------------------------------- 世界选择 */
.slot-list { display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.slot-card { padding: 14px; border-radius: 14px; background: rgba(232,217,190,.06); border: 1px solid var(--line); text-align: left; }
.slot-card b { font-size: 14px; }
.slot-card .row { justify-content: flex-start; }
.slot-card .row > button { flex: 0 0 auto; }
.slot-card input.sm, .text-input.sm { padding: 8px 10px; font-size: 12.5px; width: 130px; }
.round-btn.sm { touch-action: manipulation; }

/* ---------------------------------------------------------------- HUD */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 12; display: flex; justify-content: space-between; gap: 8px; padding: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; padding: 8px 12px; }
.hud-l { display: flex; align-items: center; gap: 10px; }
.hp-wrap { display: flex; align-items: center; gap: 7px; }
.hp-bar { width: 108px; height: 10px; border-radius: 6px; background: rgba(0,0,0,.4); overflow: hidden; border: 1px solid var(--line); }
.hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #e35b5b, #ff9a5b); transition: width .15s ease; }
.hp-wrap span { font: 800 12px/1 ui-monospace, monospace; color: var(--soft); }
.hud-r { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.hud-r b { font: 800 14px/1 ui-monospace, monospace; }
.sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
.daily-timer { margin-left: 6px; font: 800 13px/1 ui-monospace, monospace; color: var(--accent); }

.summon-btn { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 13;
  padding: 10px 18px; border-radius: 999px; background: linear-gradient(100deg, #8a4bd6, #e88a2a);
  color: #fff; font-weight: 800; font-size: 13.5px; border: none; box-shadow: 0 8px 22px rgba(138,75,214,.4);
  animation: pulseGlow 1.6s ease-in-out infinite; }
@keyframes pulseGlow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }

/* ---------------------------------------------------------------- 底部：热键栏 + 操作按钮 */
.hotbar { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 12; display: flex; gap: 6px; touch-action: manipulation; }
.hb-slot { position: relative; width: 46px; height: 46px; border-radius: 10px; background: rgba(20,16,12,.72); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; transition: transform .08s ease; }
.hb-slot.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,138,42,.35); }
.hb-slot:active { transform: scale(.9); }
.hb-swatch { position: absolute; inset: 6px; border-radius: 6px; opacity: .85; }
.hb-slot b { position: relative; z-index: 1; font: 800 11px/1 ui-monospace, monospace; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.hb-slot i { display: none; }

.action-col { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 10px; touch-action: manipulation; }
.util-col { position: fixed; top: 56px; right: 10px; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 8px; touch-action: manipulation; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; border: none; background: linear-gradient(140deg, #e88a2a, #a05a1a);
  color: #241a0e; font-weight: 800; font-size: 18px; box-shadow: 0 6px 16px rgba(232,138,42,.3); transition: transform .08s ease, filter .08s ease; }
.round-btn.lg { width: 66px; height: 66px; font-size: 24px; }
.round-btn.sm { width: 42px; height: 42px; font-size: 15px; background: rgba(232,217,190,.14); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.round-btn.sm.pulse { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,138,42,.3); }
.round-btn:active { transform: scale(.88); filter: brightness(1.15); }

.topright { position: fixed; top: 10px; right: 10px; z-index: 30; }
.chip { padding: 6px 10px; border-radius: 999px; background: rgba(20,16,12,.72); border: 1px solid var(--line); color: var(--soft); font-size: 13px; backdrop-filter: blur(8px); }

/* ---------------------------------------------------------------- 背包 / 合成 / 商店 / 图鉴 */
.station-state { font-size: 12px; color: var(--soft); margin-bottom: 10px; }
.pnl h4 { margin: 14px 0 8px; font-size: 13px; color: var(--soft); font-weight: 600; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; max-height: 22vh; overflow-y: auto; }
.inv-cell { position: relative; aspect-ratio: 1; border-radius: 10px; background: rgba(232,217,190,.06); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; overflow: hidden; }
.inv-cell.hb { border-color: rgba(232,138,42,.35); }
.inv-cell .sw { position: absolute; inset: 4px; border-radius: 6px; opacity: .5; }
.inv-cell b { position: relative; z-index: 1; font: 800 12px/1 ui-monospace, monospace; }
.inv-cell i { position: relative; z-index: 1; font-style: normal; font-size: 8.5px; color: var(--soft); }
.recipe-list { display: grid; gap: 7px; max-height: 34vh; overflow-y: auto; }
.recipe { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; text-align: left;
  background: rgba(232,217,190,.07); border: 1px solid var(--line); color: var(--ink); }
.recipe.off { opacity: .45; }
.recipe .sw { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; }
.rc-main { display: flex; flex-direction: column; gap: 2px; }
.rc-main b { font-size: 13px; }
.rc-main small { font-size: 10.5px; color: var(--soft); display: flex; gap: 6px; flex-wrap: wrap; }
.rc-main small .have { color: #7fd858; } .rc-main small .lack { color: #e35b5b; }
.tag { font-size: 9.5px; color: var(--accent); font-style: normal; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.shop-card { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; padding: 10px; border-radius: 12px; text-align: left;
  background: rgba(232,217,190,.07); border: 1px solid var(--line); color: var(--ink); }
.shop-card.on { border-color: var(--accent); background: rgba(232,138,42,.14); }
.shop-card .sw { width: 22px; height: 22px; border-radius: 6px; }
.shop-card b { font-size: 13px; } .shop-card i { font-style: normal; font-size: 11px; color: var(--soft); }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.codex-grid.wide { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.codex-item { padding: 10px; border-radius: 12px; background: rgba(24,20,14,.5); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.codex-item.lock { opacity: .4; }
.codex-item .sw { width: 20px; height: 20px; border-radius: 6px; }
.codex-item b { font-size: 12.5px; } .codex-item p { margin: 0; font-size: 11px; color: var(--soft); line-height: 1.6; }

/* ---------------------------------------------------------------- 结算 */
.res-detail { text-align: left; display: grid; gap: 6px; margin-bottom: 14px; }
.res-row { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; border-radius: 10px;
  background: rgba(24,20,14,.5); border: 1px solid var(--line); font-size: 13px; }
.res-row span { color: var(--soft); min-width: 42px; } .res-row b { font: 800 15px/1 ui-monospace, monospace; margin-left: auto; }
.submit-row { display: flex; gap: 8px; margin: 12px 0 6px; }
.text-input { flex: 1; padding: 11px 13px; border-radius: 11px; background: rgba(24,20,14,.7); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 14px; }
.board-card { margin-top: 12px; padding: 12px; border-radius: 12px; text-align: left; background: rgba(24,20,14,.5); border: 1px solid var(--line); }
.card-title { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
.board-list { display: grid; gap: 5px; }
.board-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.board-rank { color: var(--accent); font-weight: 700; } .board-name { font-weight: 600; }
.board-meta { font-size: 10.5px; color: var(--soft); } .board-score { font: 800 13px/1 ui-monospace, monospace; }
.board-empty { font-size: 12px; color: var(--soft); }

.toast { position: fixed; left: 50%; bottom: 78px; transform: translate(-50%, 12px); z-index: 40; padding: 10px 16px; border-radius: 999px;
  background: rgba(20,16,12,.9); border: 1px solid var(--line); font-size: 13px; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; backdrop-filter: blur(10px); max-width: 84vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .hud-r { font-size: 12px; } .hp-bar { width: 84px; }
  .pnl { padding: 20px 16px; }
}
@media (max-width: 720px) and (max-height: 420px) {
  /* 移动端横屏矮屏：动作按钮再收紧一档，给触屏区域留够高度 */
  .round-btn { width: 46px; height: 46px; font-size: 16px; }
  .round-btn.lg { width: 58px; height: 58px; font-size: 20px; }
  .round-btn.sm { width: 38px; height: 38px; }
  .action-col { gap: 8px; }
  .touch-zone { bottom: 128px; }
}
