/* 全局：竖屏优先，触屏友好 */
:root {
  --bg: #12100e;
  --bg2: #1a1714;
  --card: #221e1a;
  --line: #362e26;
  --ink: #f0e6d8;
  --ink2: #a89880;
  --gold: #e0b64a;
  --red: #c0392b;
  --green: #4e9c6a;
  --purple: #8e6bc0;
  --star: #ffcc44;
  --tap: 44px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/**
 * 必须有这条。HTML 的 hidden 属性只依赖浏览器默认的 `display: none`，
 * 任何显式 `display` 都会让它失效 —— 而结算层写了 `display: flex`，
 * 于是那块 85% 黑的全屏遮罩一直铺着、还吃掉所有点击：
 * 战斗在它背后播放，玩家看到的是「一进去就结算」。
 */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
  touch-action: manipulation;
}

.app {
  height: var(--app-h, 100dvh);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex; flex-direction: column;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ── 顶栏 ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #241d17, #1a1512);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.stat { display: flex; flex-direction: column; line-height: 1.15; }
.stat__k { font-size: 11px; color: var(--ink2); }
.stat__v { font-size: 15px; color: var(--gold); font-variant-numeric: tabular-nums; }
.topbar__right { margin-left: auto; display: flex; gap: 6px; }
.tab {
  min-height: 36px; padding: 6px 12px;
  background: #2a231c; border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink2); font-size: 13px;
}
.tab.is-on { background: #3a2f22; color: var(--gold); border-color: #5a4526; }

/* ── 面板 ─────────────────────────────────────────── */
.pane { display: none; flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pane.is-on { display: flex; flex-direction: column; }

.btn {
  min-height: var(--tap); padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #2a231c; color: var(--ink);
}
.btn--go {
  background: linear-gradient(180deg, #b8482f, #8e2f1e);
  border-color: #c9603f; color: #fff; font-weight: 600;
}
.btn:disabled { opacity: .4; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 10px 16px; background: #000c; border: 1px solid var(--line);
  border-radius: 10px; z-index: 50; font-size: 13px; max-width: 80vw;
}

/* ── 英雄头像卡片通用 ─────────────────────────────── */
.hero { position: relative; border-radius: 12px; overflow: hidden; background: var(--card); border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(60, 180, 150, .25), inset 0 0 0 1px rgba(255,255,255,.06); }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero__name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 4px; font-size: 11px; text-align: center;
  background: linear-gradient(180deg, transparent, #000d);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero__lv {
  position: absolute; top: 2px; left: 2px;
  font-size: 10px; padding: 1px 4px; border-radius: 5px;
  background: #000b; color: var(--ink2);
}
.hero__stars {
  position: absolute; top: 2px; right: 2px;
  font-size: 9px; color: var(--star); text-shadow: 0 0 3px #000;
}
.hero__tag {
  position: absolute; bottom: 18px; left: 2px;
  font-size: 9px; padding: 0 3px; border-radius: 4px;
  background: #000b; color: #e0b64a;
}
