/* ════════════════════════════════════════════════════════════════
   龙与地牢：二十面骰传说 — 新版 UI 设计系统
   设计语言：暗夜地牢 · 鎏金（Volcanic Gold）
   ────────────────────────────────────────────────────────────────
   层次：tokens → 基础 → 组件 → 界面 → 响应式
   原则：① 一切数值走 CSS 变量 ② 撑满视口，单一主滚动区
        ③ 材质分层靠「底色 + 描边 + 内高光 + 外阴影」四件套
   ════════════════════════════════════════════════════════════════ */

/* ── 1. 设计令牌 ───────────────────────────────────────────── */
:root {
  /* 底色阶梯（越往后越亮） */
  --bg-void:  #06080d;
  --bg:       #0c0f17;
  --bg-2:     #12161f;
  --panel:    #171c28;
  --panel-2:  #1e2434;
  --panel-3:  #262e42;
  --raise:    #2f3950;

  /* 描边 */
  --line:      rgba(255, 255, 255, .065);
  --line-2:    rgba(255, 255, 255, .12);
  --line-warm: rgba(224, 176, 85, .28);

  /* 主色：鎏金 */
  --gold:      #e2b25c;
  --gold-hi:   #f7d891;
  --gold-deep: #a8802f;
  --gold-a12:  rgba(226, 178, 92, .12);
  --gold-a22:  rgba(226, 178, 92, .22);

  /* 语义色 */
  --blood:     #e2585c;   /* 伤害 / 危险 */
  --blood-hi:  #ff8589;
  --jade:      #4fb87d;   /* 治疗 / 资源 / 成功 */
  --jade-hi:   #7ddda5;
  --arcane:    #9b83e8;   /* 法术 / 增益 */
  --frost:     #52a8e8;   /* 信息 / 冰霜 */
  --amber:     #e8954a;   /* 警示 / 火焰 */
  --venom:     #7fbf4f;   /* 毒素 */

  /* 文字 */
  --ink:    #e9edf7;
  --ink-2:  #9ba4bb;
  --ink-3:  #626b83;
  --ink-4:  #414962;

  /* 品质色（装备） */
  --q-common:   #8d97ad;
  --q-fine:     #5fb1e8;
  --q-rare:     #a98ce8;
  --q-epic:     #e0954a;
  --q-legend:   #e8c14a;

  /* 圆角 */
  --r-xs: 4px;
  --r-sm: 7px;
  --r:    11px;
  --r-lg: 16px;
  --r-full: 999px;

  /* 间距 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 30px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(0,0,0,.5);
  --sh-2: 0 6px 20px rgba(0,0,0,.5);
  --sh-3: 0 18px 48px rgba(0,0,0,.62);
  --sh-in: inset 0 1px 0 rgba(255,255,255,.075);
  --glow-gold: 0 0 0 1px var(--line-warm), 0 0 26px rgba(226,178,92,.16);
  --glow-blood: 0 0 0 1px rgba(226,88,92,.4), 0 0 24px rgba(226,88,92,.2);

  /* 字体 */
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --font-dis: "Songti SC", "Noto Serif CJK SC", Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* 动效 */
  --ease: cubic-bezier(.22, .68, .36, 1);
}

/* ── 2. 基础 ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 全局氛围层：极光辉光 + 细噪点 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(226,178,92,.075), transparent 62%),
    radial-gradient(760px 520px at 88% 108%, rgba(155,131,232,.06), transparent 60%),
    radial-gradient(700px 460px at 6% 96%, rgba(82,168,232,.05), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

#app { position: relative; z-index: 1; width: 100%; height: 100vh; height: 100dvh; }

/* 屏幕外壳 */
.screen { display: none; width: 100%; height: 100%; flex-direction: column; overflow: hidden; }
.screen.on { display: flex; }

.topbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3);
  min-height: 58px; padding: 0 var(--s5);
  background: linear-gradient(180deg, var(--bg-2), rgba(12,15,23,.94));
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.topbar-title {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: var(--s3);
  font-family: var(--font-dis); font-size: 19px; font-weight: 700;
  letter-spacing: .04em; color: var(--gold-hi);
  text-shadow: 0 0 22px rgba(226,178,92,.28);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title small {
  font-family: var(--font-ui); font-size: 12px; font-weight: 400;
  letter-spacing: 0; color: var(--ink-3); text-shadow: none;
}

.body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s5);
  scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent;
}
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: var(--panel-3); border-radius: var(--r-full);
  border: 2px solid transparent; background-clip: padding-box;
}
.scroll::-webkit-scrollbar-thumb:hover { background: var(--raise); background-clip: padding-box; }

.footer {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3);
  min-height: 68px; padding: var(--s3) var(--s5);
  background: linear-gradient(0deg, var(--bg-2), rgba(12,15,23,.94));
  border-top: 1px solid var(--line);
}
.spacer { flex: 1; }

/* 通知横幅 */
.notice {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px var(--s5); font-size: 13px; font-weight: 600;
  color: #bff0d2; background: linear-gradient(90deg, rgba(79,184,125,.06), rgba(79,184,125,.16), rgba(79,184,125,.06));
  border-bottom: 1px solid rgba(79,184,125,.28);
}

/* ── 3. 按钮 ───────────────────────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2); min-height: 42px; padding: 0 20px;
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: var(--sh-in), var(--sh-1);
  cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: rgba(255,255,255,.2); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .38; cursor: not-allowed; filter: saturate(.4); }
.btn small { font-size: 11px; font-weight: 400; opacity: .75; }

.btn-gold {
  color: #23180a;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 46%, var(--gold-deep));
  border-color: rgba(255,236,186,.5);
  box-shadow: var(--sh-in), 0 4px 18px rgba(226,178,92,.28);
  text-shadow: 0 1px 0 rgba(255,255,255,.22);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe6ad, var(--gold-hi) 46%, var(--gold));
  box-shadow: var(--sh-in), 0 6px 26px rgba(226,178,92,.42);
}
.btn-jade {
  color: #06251a;
  background: linear-gradient(180deg, #7fd9a6, var(--jade) 48%, #2e8a5c);
  border-color: rgba(160,240,196,.42);
  box-shadow: var(--sh-in), 0 4px 18px rgba(79,184,125,.24);
}
.btn-blood {
  color: #2b0709;
  background: linear-gradient(180deg, #ff8f92, var(--blood) 48%, #a93438);
  border-color: rgba(255,170,172,.35);
  box-shadow: var(--sh-in), 0 4px 18px rgba(226,88,92,.24);
}
.btn-arcane {
  color: #150c2c;
  background: linear-gradient(180deg, #c2aeff, var(--arcane) 48%, #6a52bd);
  border-color: rgba(206,190,255,.4);
  box-shadow: var(--sh-in), 0 4px 18px rgba(155,131,232,.26);
}
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: rgba(255,255,255,.045); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 15.5px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { min-width: 38px; padding: 0; }

/* ── 4. 面板 / 卡片 ────────────────────────────────────────── */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.card-pad { padding: var(--s4); }
.card-hi { border-color: var(--line-warm); box-shadow: var(--glow-gold); }

.section { margin-bottom: var(--s5); }
.section > h2 {
  display: flex; align-items: center; gap: var(--s2);
  margin: 0 0 var(--s2); font-size: 14px; font-weight: 700;
  letter-spacing: .08em; color: var(--gold);
  text-transform: uppercase;
}
.section > h2::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-warm), transparent);
}
.section > .hint { margin: 0 0 var(--s3); font-size: 13px; color: var(--ink-3); line-height: 1.65; }

/* 装饰分隔线（菱形） */
.rule { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
.rule span { color: var(--gold-deep); font-size: 10px; letter-spacing: .5em; }

/* ── 5. 血条 / 资源条 ──────────────────────────────────────── */
.bar {
  position: relative; height: 9px; border-radius: var(--r-full);
  background: rgba(0,0,0,.6); overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.05);
}
.bar > i {
  position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  transition: width .5s var(--ease);
}
.bar > i.hp   { background: linear-gradient(180deg, #6fd99a, var(--jade) 55%, #2d7f54); box-shadow: 0 0 12px rgba(79,184,125,.4); }
.bar > i.hp.mid { background: linear-gradient(180deg, #f0c05a, var(--amber) 55%, #a35f1f); box-shadow: 0 0 12px rgba(232,149,74,.4); }
.bar > i.hp.low { background: linear-gradient(180deg, #ff8f92, var(--blood) 55%, #8e2a2e); box-shadow: 0 0 12px rgba(226,88,92,.45); }
.bar > i.xp  { background: linear-gradient(180deg, #d9c2ff, var(--arcane) 55%, #5b45a3); }
.bar > i.mp  { background: linear-gradient(180deg, #a5d8ff, var(--frost) 55%, #2b6a9e); }
.bar > i.buf { background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.35)); }
.bar.lg { height: 13px; }
.bar.sm { height: 6px; }

/* ── 6. 徽章 / 标签 / 数值 ─────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-2); background: rgba(255,255,255,.05);
  border: 1px solid var(--line); border-radius: var(--r-full);
  white-space: nowrap;
}
.chip.gold  { color: var(--gold-hi);  background: var(--gold-a12);   border-color: var(--line-warm); }
.chip.jade  { color: #a5ecc2;         background: rgba(79,184,125,.13);  border-color: rgba(79,184,125,.32); }
.chip.blood { color: #ffb3b5;         background: rgba(226,88,92,.13);   border-color: rgba(226,88,92,.32); }
.chip.arcane{ color: #cbbaff;         background: rgba(155,131,232,.14); border-color: rgba(155,131,232,.32); }
.chip.frost { color: #aad9ff;         background: rgba(82,168,232,.13);  border-color: rgba(82,168,232,.32); }

.stat { display: flex; align-items: baseline; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.stat b { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink); }
.stat .k { color: var(--ink-4); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* 品质色 */
.q-common { color: var(--q-common); }
.q-fine   { color: var(--q-fine); }
.q-rare   { color: var(--q-rare); }
.q-epic   { color: var(--q-epic); }
.q-legend { color: var(--q-legend); }

/* ── 7. 标题页 ─────────────────────────────────────────────── */
.title-screen {
  position: relative; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s6);
  height: 100%; padding: var(--s6);
}
.title-screen.on { display: flex; }

.title-hero { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }

.title-dice { position: relative; margin-bottom: var(--s2); animation: float 5.5s ease-in-out infinite; }
.title-dice svg { display: block; filter: drop-shadow(0 0 26px rgba(226,178,92,.45)); }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }

.title-name {
  margin: 0; font-family: var(--font-dis); font-size: clamp(38px, 6.2vw, 68px);
  font-weight: 700; letter-spacing: .16em; text-indent: .16em; line-height: 1.1;
  background: linear-gradient(180deg, #fff6dd 6%, var(--gold-hi) 38%, var(--gold) 62%, #8a6421 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 18px rgba(226,178,92,.42));
}
.title-sub {
  font-size: 13.5px; letter-spacing: .58em; text-indent: .58em;
  color: var(--ink-2); text-transform: uppercase;
}
.title-flavor {
  max-width: 480px; margin: var(--s3) 0 0; font-size: 13.5px; line-height: 2;
  color: var(--ink-3); font-family: var(--font-dis); letter-spacing: .05em;
}
.title-actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; }
.title-actions .btn { min-width: 210px; flex-direction: column; gap: 2px; padding: 10px 26px; }
.btn-sub { font-size: 11px; font-weight: 400; opacity: .72; letter-spacing: .04em; }
.title-foot { position: absolute; bottom: var(--s5); font-size: 11px; color: var(--ink-4); letter-spacing: .1em; }

/* ── 8. 存档列表 ───────────────────────────────────────────── */
.slot {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s3) var(--s4);
  padding: var(--s4); margin-bottom: var(--s3);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r);
  border-left: 3px solid var(--gold-deep);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.slot:hover { border-color: var(--line-2); border-left-color: var(--gold); transform: translateX(3px); box-shadow: var(--sh-2); }
.slot-head { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.slot-name { font-family: var(--font-dis); font-size: 17px; font-weight: 700; color: var(--gold-hi); letter-spacing: .04em; }
.slot-members { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); }
.slot-member {
  display: flex; align-items: center; gap: var(--s2);
  padding: 5px 11px 5px 6px; font-size: 12.5px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: var(--r-full);
}
.slot-member .av {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: #0e1119;
  background: linear-gradient(150deg, var(--gold-hi), var(--gold-deep));
}
.slot-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s3); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.slot-actions { display: flex; gap: var(--s2); margin-left: auto; }

/* ── 9. 角色创建 / 组队 ───────────────────────────────────── */
.field { margin-bottom: var(--s4); }
.field > label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.input {
  width: 100%; min-height: 44px; padding: 0 var(--s4);
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: rgba(0,0,0,.34); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 6px rgba(0,0,0,.5), 0 0 0 3px var(--gold-a12); }
.input::placeholder { color: var(--ink-4); }

.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s3); }
.opt {
  position: relative; padding: var(--s3) var(--s4); text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: all .16s var(--ease);
}
.opt:hover { border-color: var(--line-2); background: linear-gradient(180deg, var(--panel-2), var(--panel)); transform: translateY(-2px); }
.opt.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(226,178,92,.13), rgba(226,178,92,.04)); box-shadow: var(--glow-gold); }
.opt.on::after {
  content: "✓"; position: absolute; top: 9px; right: 11px;
  width: 19px; height: 19px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #23180a;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); border-radius: 50%;
}
.opt-t { display: flex; align-items: baseline; gap: var(--s2); font-size: 14.5px; font-weight: 700; color: var(--ink); }
.opt-t em { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--ink-4); letter-spacing: .04em; }
.opt-d { margin-top: 5px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.opt-bonus { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }

/* 队员条 */
.member {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s2);
  background: linear-gradient(90deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r);
  transition: all .16s var(--ease);
}
.member:hover { border-color: var(--line-2); }
.member.on { border-color: var(--line-warm); background: linear-gradient(90deg, rgba(226,178,92,.1), var(--bg-2)); box-shadow: var(--glow-gold); }
.member .av {
  width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center;
  font-family: var(--font-dis); font-size: 18px; font-weight: 700; color: var(--gold-hi);
  background: radial-gradient(circle at 34% 26%, var(--panel-3), var(--bg-void));
  border: 1px solid var(--line-2); box-shadow: var(--sh-in);
}
.member-name { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.member-meta { font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: 3px; }
.rowtoggle { display: flex; padding: 2px; background: rgba(0,0,0,.4); border-radius: var(--r-sm); border: 1px solid var(--line); }
.rowtoggle button {
  min-width: 46px; padding: 5px 9px; font-family: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--ink-3); background: transparent; border: 0; border-radius: var(--r-xs); cursor: pointer;
  transition: all .16s var(--ease);
}
.rowtoggle button.on { color: #23180a; background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); }
.check {
  width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--line-2); border-radius: var(--r-xs);
  background: rgba(0,0,0,.34); transition: all .16s var(--ease);
}
.check.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); border-color: var(--gold-hi); color: #23180a; font-weight: 700; }

/* ── 10. 营地枢纽 ──────────────────────────────────────────── */
.camp-screen { position: relative; height: 100%; }
.camp-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(620px 320px at 50% 78%, rgba(232,149,74,.13), transparent 66%),
    radial-gradient(900px 460px at 50% 118%, rgba(226,88,92,.09), transparent 62%),
    linear-gradient(180deg, var(--bg-void) 0%, #0f131d 46%, #1a1208 100%);
}
.camp-stage {
  position: relative; z-index: 1; height: 100%; display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto; overflow: hidden;
}
.camp-narr {
  max-width: 760px; margin: 0 auto; padding: var(--s5) var(--s5) var(--s3); text-align: center;
}
.camp-narr h2 {
  margin: 0 0 var(--s2); font-family: var(--font-dis); font-size: 27px; font-weight: 700;
  color: var(--gold-hi); letter-spacing: .1em; text-shadow: 0 0 30px rgba(226,178,92,.3);
}
.camp-narr p { margin: 0; font-size: 13.5px; line-height: 1.95; color: var(--ink-2); font-family: var(--font-dis); }

.camp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s4); align-content: center; padding: var(--s5); max-width: 1120px; margin: 0 auto; width: 100%;
}
.entry {
  position: relative; overflow: hidden; cursor: pointer; text-align: left;
  padding: var(--s5) var(--s4) var(--s4);
  background: linear-gradient(180deg, rgba(30,36,52,.92), rgba(12,15,23,.94));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-2); transition: all .2s var(--ease);
}
.entry::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(340px 180px at 50% 0%, var(--tint, rgba(226,178,92,.2)), transparent 70%);
  transition: opacity .24s var(--ease);
}
.entry:hover { transform: translateY(-5px); border-color: var(--tintb, var(--line-warm)); box-shadow: var(--sh-3); }
.entry:hover::before { opacity: 1; }
.entry-ico {
  position: relative; font-size: 34px; line-height: 1; margin-bottom: var(--s3);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.6));
}
.entry-t { position: relative; font-family: var(--font-dis); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: .05em; }
.entry-d { position: relative; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; min-height: 42px; }
.entry-f { position: relative; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); display: flex; gap: var(--s2); align-items: center; }

/* ── 11. 浮层 ──────────────────────────────────────────────── */
.mask {
  position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: var(--s5);
  background: rgba(4,6,11,.74); backdrop-filter: blur(7px) saturate(.85);
  animation: fade .22s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985) } to { opacity: 1; transform: none } }
.dialog {
  width: min(880px, 100%); max-height: 88%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--bg-2));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-3), var(--glow-gold); animation: rise .26s var(--ease);
  overflow: hidden;
}
.dialog.sm { width: min(520px, 100%); }
.dialog.lg { width: min(1120px, 100%); }
.dialog-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4) var(--s3) var(--s5);
  background: linear-gradient(180deg, rgba(226,178,92,.1), transparent);
  border-bottom: 1px solid var(--line);
}
.dialog-head h3 { margin: 0; font-family: var(--font-dis); font-size: 17px; font-weight: 700; color: var(--gold-hi); letter-spacing: .06em; flex: 1; }
.dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s4) var(--s5); }
.dialog-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s5); background: rgba(0,0,0,.28); border-top: 1px solid var(--line);
}
.x-btn {
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--ink-3);
  background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: var(--r-xs);
  transition: all .16s var(--ease);
}
.x-btn:hover { color: var(--blood-hi); border-color: rgba(226,88,92,.4); background: rgba(226,88,92,.1); }

/* 商品行 */
.shop-row {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: var(--s3);
  padding: var(--s3); margin-bottom: var(--s2);
  background: rgba(255,255,255,.022); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: all .16s var(--ease);
}
.shop-row:hover { background: rgba(255,255,255,.05); border-color: var(--line-2); }
.price { display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 13.5px; font-weight: 700; color: var(--gold); }

/* 情报卡（酒馆） */
.intel {
  position: relative; padding: var(--s4) var(--s4) var(--s4) var(--s5);
  background: linear-gradient(135deg, rgba(226,178,92,.07), rgba(12,15,23,.5));
  border: 1px solid var(--line); border-left: 3px solid var(--gold-deep); border-radius: var(--r-sm);
}
.intel .cat { display: inline-block; margin-bottom: var(--s2); font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--gold); }
.intel p { margin: 0; font-size: 14px; line-height: 1.9; color: var(--ink-2); font-family: var(--font-dis); }

/* ── 12. 装备 / 背包 ───────────────────────────────────────── */
.inv-grid { display: grid; grid-template-columns: 300px 1fr; gap: var(--s4); align-items: start; }

.eq-slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.slot-box {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 78px; padding: var(--s2); text-align: center; cursor: pointer;
  background: radial-gradient(circle at 50% 22%, rgba(255,255,255,.05), rgba(0,0,0,.34));
  border: 1px dashed var(--line-2); border-radius: var(--r-sm);
  transition: all .16s var(--ease);
}
.slot-box:hover { border-color: var(--gold-deep); background: radial-gradient(circle at 50% 22%, var(--gold-a12), rgba(0,0,0,.34)); }
.slot-box.filled { border-style: solid; border-color: var(--line-2); }
.slot-box .ico { font-size: 22px; line-height: 1; }
.slot-box .nm  { font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.slot-box .lb  { font-size: 10px; letter-spacing: .1em; color: var(--ink-4); text-transform: uppercase; }
.slot-box.span2 { grid-column: span 2; }

.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: var(--s2); }
.cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; cursor: pointer;
  font-size: 24px;
  background: radial-gradient(circle at 50% 24%, rgba(255,255,255,.045), rgba(0,0,0,.4));
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: all .16s var(--ease);
}
.cell:hover { border-color: var(--gold); box-shadow: var(--glow-gold); transform: translateY(-2px); }
.cell.empty { opacity: .32; cursor: default; }
.cell.empty:hover { transform: none; border-color: var(--line); box-shadow: none; }
.cell .qty {
  position: absolute; right: 3px; bottom: 2px; font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700; color: var(--ink); text-shadow: 0 1px 3px #000;
}
.cell.q1 { border-color: rgba(141,151,173,.5) }
.cell.q2 { border-color: rgba(95,177,232,.6); box-shadow: 0 0 12px rgba(95,177,232,.16) }
.cell.q3 { border-color: rgba(169,140,232,.65); box-shadow: 0 0 14px rgba(169,140,232,.22) }
.cell.q4 { border-color: rgba(224,149,74,.7);  box-shadow: 0 0 16px rgba(224,149,74,.26) }
.cell.q5 { border-color: rgba(232,193,74,.8);  box-shadow: 0 0 20px rgba(232,193,74,.34) }

.cap-bar { display: flex; align-items: center; gap: var(--s3); font-size: 12px; color: var(--ink-3); }
.cap-bar .bar { flex: 1; }

/* ── 13. 地牢场景 ──────────────────────────────────────────── */
.scene-wrap { display: grid; grid-template-columns: 1fr 320px; gap: var(--s4); height: 100%; padding: var(--s5); }
.scene-text {
  font-family: var(--font-dis); font-size: 15px; line-height: 2.15; color: var(--ink-2);
  letter-spacing: .03em;
}
.scene-text p { margin: 0 0 var(--s4); }
.scene-text p:first-of-type::first-letter {
  float: left; margin: 4px 10px 0 0; font-size: 44px; line-height: .82;
  color: var(--gold); font-weight: 700; text-shadow: 0 0 22px rgba(226,178,92,.36);
}
.enemy-line { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ── 14. 战斗 ──────────────────────────────────────────────── */
.combat {
  display: grid; height: 100%; overflow: hidden;
  grid-template-columns: minmax(0,1fr) 336px;
  grid-template-rows: auto auto minmax(0,1fr) auto;
}
.combat-top { grid-column: 1 / -1; grid-row: 1; }
.round-pill {
  display: flex; align-items: center; gap: var(--s3); padding: 7px 16px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 1px solid var(--line-warm); border-radius: var(--r-full);
  font-size: 12.5px; color: var(--ink-2);
}
.round-pill b { font-family: var(--font-dis); font-size: 14px; color: var(--gold-hi); letter-spacing: .05em; }

/* 先攻轨道 */
.initiative {
  grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s5); overflow-x: auto;
  background: rgba(0,0,0,.34); border-bottom: 1px solid var(--line);
}
.initiative::-webkit-scrollbar { height: 6px }
.initiative::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 3px }
.init-tick {
  display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px;
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: var(--r-full);
  transition: all .2s var(--ease);
}
.init-tick .n {
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  background: rgba(0,0,0,.5);
}
.init-tick.now {
  color: var(--gold-hi); background: var(--gold-a12); border-color: var(--line-warm);
  box-shadow: 0 0 18px rgba(226,178,92,.2);
}
.init-tick.now .n { color: #23180a; background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); }
.init-tick.done { opacity: .34; text-decoration: line-through; }
.init-tick.foe .n { color: #ffb3b5; }
.init-tick.foe.now { color: #ffb3b5; background: rgba(226,88,92,.13); border-color: rgba(226,88,92,.35); box-shadow: 0 0 18px rgba(226,88,92,.18); }

/* 战场 */
.field { grid-column: 1; grid-row: 3; min-height: 0; overflow-y: auto; padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.field::-webkit-scrollbar { width: 8px }
.field::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 4px }
.line { display: flex; flex-direction: column; gap: var(--s2); }
.line-head {
  display: flex; align-items: center; gap: var(--s3);
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-4);
}
.line-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.line-body { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-start; }

/* 单位卡 */
.unit {
  position: relative; width: 196px; padding: var(--s3);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--sh-1); cursor: pointer;
  transition: all .18s var(--ease); overflow: hidden;
}
.unit::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--gold-deep)), transparent);
}
.unit:hover { transform: translateY(-3px); border-color: var(--line-warm); box-shadow: var(--sh-2); }
.unit.foe { border-color: rgba(226,88,92,.32); }
.unit.foe::before { background: linear-gradient(90deg, transparent, var(--blood), transparent); }
.unit.foe:hover { border-color: rgba(226,88,92,.6); }
.unit.sel { border-color: var(--gold); box-shadow: var(--glow-gold); }
.unit.now { border-color: var(--gold); box-shadow: var(--glow-gold); }
.unit.now::after {
  content: ""; position: absolute; inset: -1px; border-radius: var(--r);
  border: 1px solid var(--gold); animation: pulse 1.9s ease-in-out infinite; pointer-events: none;
}
@keyframes pulse { 0%,100% { opacity: .9; box-shadow: 0 0 0 0 rgba(226,178,92,.35) } 50% { opacity: .4; box-shadow: 0 0 22px 3px rgba(226,178,92,.14) } }
.unit.dead { opacity: .34; filter: grayscale(1); }
.unit-target {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  padding: 1px 10px; font-size: 10px; font-weight: 700; letter-spacing: .1em;
  color: #23180a; background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep));
  border-radius: 0 0 var(--r-xs) var(--r-xs);
}
.unit-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.unit-av {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--r-sm); display: grid; place-items: center;
  font-size: 17px; background: radial-gradient(circle at 34% 26%, var(--panel-3), var(--bg-void));
  border: 1px solid var(--line-2);
}
.unit-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-sub { font-size: 11px; color: var(--ink-4); letter-spacing: .04em; }
.unit-hp { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.unit-hp b { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--ink); }
.unit-hp i { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }
.unit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.unit-stats div { text-align: center; }
.unit-stats .k { display: block; font-size: 10.5px; letter-spacing: .1em; color: var(--ink-4); text-transform: uppercase; }
.unit-stats .v { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.unit-buffs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--s2); }
.buff { padding: 1px 7px; font-size: 10px; font-weight: 600; border-radius: var(--r-full); border: 1px solid; }
.buff.b { color: #a5ecc2; border-color: rgba(79,184,125,.4); background: rgba(79,184,125,.12); }
.buff.d { color: #ffb3b5; border-color: rgba(226,88,92,.4); background: rgba(226,88,92,.12); }
.mp-dots { display: flex; gap: 3px; margin-top: 5px; }
.mp-dots i { width: 100%; height: 4px; border-radius: 2px; background: rgba(82,168,232,.22); }
.mp-dots i.on { background: linear-gradient(180deg, #a5d8ff, var(--frost)); box-shadow: 0 0 7px rgba(82,168,232,.6); }

/* 日志栏 */
.log {
  grid-column: 2; grid-row: 2 / 5; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(18,22,31,.9), rgba(6,8,13,.94));
  border-left: 1px solid var(--line);
}
.log-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
}
.log-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: 5px; }
.log-body::-webkit-scrollbar { width: 7px }
.log-body::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 4px }
.log-i {
  padding: 6px 10px; font-size: 13px; line-height: 1.62; color: var(--ink-2);
  background: rgba(255,255,255,.022); border-left: 2px solid var(--line-2); border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
.log-i.dmg  { color: #ffbfc1; border-left-color: var(--blood);  background: rgba(226,88,92,.07); }
.log-i.heal { color: #b3ecc9; border-left-color: var(--jade);   background: rgba(79,184,125,.07); }
.log-i.cast { color: #d3c7ff; border-left-color: var(--arcane); background: rgba(155,131,232,.08); }
.log-i.crit { color: var(--gold-hi); border-left-color: var(--gold); background: var(--gold-a12); font-weight: 600; }
.log-i.sys  { color: var(--ink-4); font-style: italic; }
.log-i .roll {
  display: inline-block; min-width: 22px; padding: 0 5px; margin-right: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-align: center;
  color: var(--gold-hi); background: rgba(0,0,0,.45); border: 1px solid var(--line-warm); border-radius: var(--r-xs);
}

/* 行动栏 */
.actions {
  grid-column: 1; grid-row: 4; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s5); background: rgba(0,0,0,.34); border-top: 1px solid var(--line);
}
.actions .who { font-size: 12.5px; color: var(--ink-3); }
.actions .who b { color: var(--gold-hi); font-family: var(--font-dis); font-size: 14.5px; }
.actions .btns { display: flex; gap: var(--s2); margin-left: auto; }
.actions .btn { min-width: 104px; }
.kbd {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 3px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--ink-3);
  background: rgba(0,0,0,.42); border: 1px solid var(--line-2); border-radius: var(--r-xs);
}

/* 底部抽屉（法术） */
.drawer {
  position: absolute; left: 0; right: 336px; bottom: 0; z-index: 30;
  max-height: 56%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(30,36,52,.99), rgba(12,15,23,.99));
  border-top: 1px solid var(--line-warm); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -18px 48px rgba(0,0,0,.62); animation: rise .24s var(--ease);
}
.drawer-head { flex: 0 0 auto; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s4) var(--s5); }
.spells { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.spell {
  display: flex; flex-direction: column; gap: 6px; padding: var(--s3) var(--s4); cursor: pointer; text-align: left;
  background: linear-gradient(135deg, rgba(155,131,232,.1), rgba(12,15,23,.6));
  border: 1px solid rgba(155,131,232,.28); border-radius: var(--r-sm);
  transition: all .16s var(--ease);
}
.spell:hover:not(.off) { transform: translateY(-2px); border-color: var(--arcane); box-shadow: 0 0 22px rgba(155,131,232,.24); }
.spell.off { opacity: .4; cursor: not-allowed; filter: saturate(.35); }
.spell-t { display: flex; align-items: center; gap: var(--s2); font-size: 14px; font-weight: 700; color: #d3c7ff; }
.spell-d { font-size: 11.8px; color: var(--ink-3); line-height: 1.6; }

/* ── 15. 结算 ──────────────────────────────────────────────── */
.settle { display: flex; flex-direction: column; gap: var(--s4); }
.settle-hero { text-align: center; padding: var(--s3) 0; }
.settle-hero h2 {
  margin: 0; font-family: var(--font-dis); font-size: 34px; font-weight: 700; letter-spacing: .22em;
  background: linear-gradient(180deg, #fff6dd, var(--gold) 70%, #8a6421);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 20px rgba(226,178,92,.4));
}
.settle-hero.lose h2 {
  background: linear-gradient(180deg, #ffd3d4, var(--blood) 70%, #7d262a);
  -webkit-background-clip: text; background-clip: text;
}
.xp-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s3); padding: var(--s2) 0; }
.xp-row .nm { font-size: 13.5px; font-weight: 600; }
.xp-row .bar { width: 100%; }
.loot-row {
  display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: var(--s3);
  padding: var(--s3); margin-bottom: var(--s2);
  background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.loot-row .ico { width: 42px; height: 42px; display: grid; place-items: center; font-size: 21px; background: rgba(0,0,0,.36); border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ── 16. 提示气泡 / 详情 ───────────────────────────────────── */
.tip {
  position: absolute; z-index: 60; width: 268px; padding: var(--s3) var(--s4);
  background: linear-gradient(180deg, rgba(30,36,52,.99), rgba(10,13,20,.99));
  border: 1px solid var(--line-warm); border-radius: var(--r-sm);
  box-shadow: var(--sh-3); pointer-events: none; animation: fade .16s var(--ease);
}
.tip h4 { margin: 0 0 6px; font-size: 14px; }
.tip .kv { display: flex; justify-content: space-between; gap: var(--s3); padding: 3px 0; font-size: 12px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.tip .kv:last-child { border-bottom: 0 }
.tip .kv b { font-family: var(--font-mono); color: var(--ink); }
.tip .desc { margin-top: var(--s2); font-size: 11.5px; line-height: 1.7; color: var(--ink-3); font-style: italic; }

/* 分页器 */
.pager { display: flex; align-items: center; gap: var(--s3); margin: 0 auto; }
.pager span { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── 17. Demo 导航（非游戏 UI，方便预览） ─────────────────── */
.demo-nav {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--s2);
}
.demo-nav .toggle {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  font-size: 19px; color: #23180a;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep));
  border: 0; border-radius: 50%; box-shadow: var(--sh-2), 0 0 22px rgba(226,178,92,.34);
}
.demo-nav .list {
  display: none; flex-direction: column; gap: 3px; padding: var(--s2);
  width: 190px; max-height: 62vh; overflow-y: auto;
  background: rgba(10,13,20,.96); border: 1px solid var(--line-warm);
  border-radius: var(--r); box-shadow: var(--sh-3); backdrop-filter: blur(10px);
}
.demo-nav.open .list { display: flex; }
.demo-nav .list button {
  padding: 7px 11px; text-align: left; font-family: inherit; font-size: 12.5px; color: var(--ink-2);
  background: transparent; border: 0; border-radius: var(--r-xs); cursor: pointer;
  transition: all .14s var(--ease);
}
.demo-nav .list button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.demo-nav .list button.on { color: #23180a; background: linear-gradient(90deg, var(--gold-hi), var(--gold)); font-weight: 700; }
.demo-nav .list .sep { margin: 5px 8px; height: 1px; background: var(--line); }

/* ── 18. 响应式 ────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .combat { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0,1fr) auto auto; }
  .log { grid-column: 1; grid-row: auto; max-height: 190px; border-left: 0; border-top: 1px solid var(--line); }
  .drawer { right: 0; }
  .scene-wrap, .inv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar, .footer { padding-left: var(--s3); padding-right: var(--s3); }
  .scroll { padding: var(--s3); }
  .field, .opts { gap: var(--s2); }
  .opts { grid-template-columns: 1fr; }
  .member { grid-template-columns: auto 1fr; row-gap: var(--s2); }
  .unit { width: 100%; }
  .line-body { flex-direction: column; }
  .camp-grid { grid-template-columns: 1fr; }
  .title-actions .btn { min-width: 100%; }
  .dialog-foot { flex-wrap: wrap; }
  .actions { flex-wrap: wrap; }
  .actions .btns { width: 100%; margin-left: 0; }
  .actions .btn { flex: 1; min-width: 0; }
}
