/* =====================================================================
   精简战场界面（电脑与手机统一）：地图优先，界面贴边
   ===================================================================== */
:root { --hud-top: 50px; --chip: 58px; --menu-btn: 54px; }
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
#ui button, .modal-box button, #start button { touch-action: manipulation; }

/* ---------- 顶栏：一条细带 ---------- */
#topbar { top: 0; left: 0; right: 0; height: calc(var(--hud-top) + env(safe-area-inset-top)); border-radius: 0; border: none; gap: 12px;
  padding: env(safe-area-inset-top) calc(12px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(14,10,6,0.88), rgba(14,10,6,0.55) 80%, rgba(14,10,6,0)); box-shadow: none; flex-wrap: nowrap; }
#lordbox { min-width: 0; gap: 8px; flex-shrink: 0; }
#lordPortrait { width: 40px; height: 40px; flex-shrink: 0; }
#lordPortrait .portrait { width: 80px; height: 106px; left: -20px; top: -18px; }
#lordName { font-size: 17px; white-space: nowrap; }
#lordSub { font-size: 11px; white-space: nowrap; }
#resbar { flex: 1; justify-content: center; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; min-width: 0; }
#resbar::-webkit-scrollbar { display: none; }
.res { min-width: 0; flex-shrink: 0; background: rgba(0,0,0,0.35); padding: 2px 10px 2px 3px; gap: 5px; }
.res i { width: 20px; height: 20px; font-size: 12px; }
.res b { font-size: 13px; }
.res small { font-size: 10px; }
#timebox { font-size: 14px; gap: 8px; flex-shrink: 0; }
#speedBtns button { padding: 2px 7px; font-size: 12px; }
#muteBtn { background: rgba(0,0,0,0.4); border: 1px solid var(--line); color: var(--gold2); width: 30px; height: 26px; font-size: 14px; padding: 0; line-height: 1; }
#speedBtns button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 左侧：部队头像竖列 ---------- */
#teamPanel.chips { top: calc(var(--hud-top) + env(safe-area-inset-top) + 8px); left: calc(8px + env(safe-area-inset-left)); right: auto; width: auto; gap: 10px; flex-direction: column; }
.tchip { width: var(--chip); padding: 0; background: none !important; border: none !important; box-shadow: none !important; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; flex: none; }
.tchip:hover { transform: none; }
.tc-ava { width: var(--chip); height: var(--chip); border-radius: 50%; overflow: hidden; position: relative; border: 2px solid rgba(216,180,106,0.7);
  background: radial-gradient(circle, #3a2a18, #120c07); box-shadow: 0 3px 10px rgba(0,0,0,0.6); }
.tc-ava .portrait { position: absolute; width: 170%; height: 226%; left: -35%; top: -32%; }
.tc-plus { position: absolute; inset: 0; display: grid; place-items: center; color: #7a6a4a; font-size: 24px; }
.tc-ava em { position: absolute; right: 2px; bottom: 2px; font-style: normal; font-family: var(--font); font-size: 11px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: #2c2318; color: var(--gold2); border: 1px solid var(--gold); }
.tchip.st-march .tc-ava em, .tchip.st-battle .tc-ava em { background: #8a2a1e; color: #fff; }
.tchip.st-return .tc-ava em { background: #24476e; color: #fff; }
.tchip.sel .tc-ava { border-color: #ffd27a; box-shadow: 0 0 0 2px rgba(255,210,122,0.5), 0 0 16px rgba(255,190,90,0.6); }
.tchip .bar { width: calc(var(--chip) - 6px); height: 5px; }
.tc-name { font-family: var(--font); font-size: 12px; color: var(--gold2); text-shadow: 0 1px 2px #000; line-height: 1; }
.tc-home { position: absolute; left: calc(var(--chip) + 6px); top: calc(var(--chip) / 2 - 14px); white-space: nowrap; }

/* ---------- 左下：回城 + 小地图（电脑） ---------- */
#homeBtn { position: fixed; left: calc(10px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 9;
  width: 66px; height: 66px; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold2);
  background: radial-gradient(circle at 40% 35%, #6b4b2a, #1e140b); box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-family: var(--font); padding: 0; }
#homeBtn i { font-style: normal; font-size: 24px; line-height: 1.1; }
#homeBtn span { font-size: 11px; }
#homeBtn:hover { filter: brightness(1.15); }
#minimapWrap { left: calc(86px + env(safe-area-inset-left)); bottom: 10px; padding: 4px; background: rgba(14,10,6,0.75); }
#minimap { width: 200px; height: 163px; }

/* ---------- 右下：圆形菜单 ---------- */
#menuBar { right: calc(10px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); left: auto; gap: 8px; padding: 0; background: none; border: none; }
#menuBar button { width: var(--menu-btn); height: auto; padding: 0; border: none; background: none; box-shadow: none; gap: 3px; flex: none; }
#menuBar button i { width: var(--menu-btn); height: var(--menu-btn); font-size: calc(var(--menu-btn) * 0.42); box-shadow: 0 3px 10px rgba(0,0,0,0.6); border-width: 2px; }
#menuBar button span { font-size: 12px; color: var(--gold2); text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#menuBar b { top: -2px; right: -2px; }

/* ---------- 右侧：地块面板（可折叠详情） ---------- */
#tilePanel { top: calc(var(--hud-top) + env(safe-area-inset-top) + 8px); right: calc(10px + env(safe-area-inset-right)); bottom: auto; left: auto; width: 320px; padding: 12px 12px 8px;
  max-height: calc(100dvh - var(--hud-top) - 110px); display: flex; flex-direction: column; background: rgba(18,13,8,0.9); border-radius: 4px; }
#tilePanel.hidden { display: none; }
.tp-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; background: rgba(0,0,0,0.35); border: 1px solid var(--line); color: var(--gold2); font-size: 14px; z-index: 2; }
.tp-title { font-size: 21px; padding-right: 34px; flex-wrap: wrap; }
.tp-own { font-family: var(--ui); font-size: 12px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 2px; }
.tp-brief { font-size: 13px; color: var(--dim); margin: 4px 0 2px; }
.tp-brief b { color: #fff0d0; }
.tp-actions .tp-sec:first-child { margin-top: 8px; }
.tp-actions .hint { display: none; }
.tp-more { margin-top: 6px; background: none; border: none; border-top: 1px dashed rgba(216,180,106,0.25); color: var(--dim); font-size: 13px; padding: 6px 0 2px; }
.tp-details { display: none; }
#tilePanel.open .tp-details { display: block; }
.march-opt { padding: 6px 8px; margin-bottom: 5px; }
.march-opt .mo-info { font-size: 11px; }
.march-opt .mo-info b { font-size: 14px; }

/* ---------- 提示 ---------- */
#toasts { top: calc(var(--hud-top) + env(safe-area-inset-top) + 6px); bottom: auto; }
#toasts .toast:nth-last-child(n+4) { display: none; }
.toast { font-size: 14px; padding: 6px 16px; }
body.space-view .troop-label { display: none; }
body.space-view .city-label .cl-name { font-size: 12px; padding: 0 6px; }

/* ---------- 通用小组件 ---------- */
.chip { background: rgba(0,0,0,0.35); border: 1px solid var(--line); color: var(--dim); padding: 3px 10px; font-size: 13px; }
.chip.on { background: linear-gradient(180deg, #f3d995, #c99a45); color: #2a1a0c; }
.bar.red i { background: linear-gradient(90deg, #7a1d16, #e0533c); }
input.vol { flex: 1; max-width: 260px; accent-color: #d8b46a; }
.capital-label .cl-name { font-size: 20px; padding: 2px 14px; background: linear-gradient(90deg, #b8862f, rgba(20,14,8,0.85)); }
.capital-label .cl-lv { width: 26px; height: 26px; font-size: 13px; }

/* =====================================================================
   页面：武将
   ===================================================================== */
.hero-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; min-height: 60vh; }
.hero-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ht-label { color: var(--dim); font-size: 13px; }
.ht-count { margin-left: auto; color: var(--dim); font-size: 12px; }
.hero-list .gen-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.hero-detail { background: radial-gradient(ellipse at 40% 30%, rgba(80,55,25,0.35), rgba(0,0,0,0.25)); border: 1px solid rgba(216,180,106,0.25); padding: 14px; }
.hd-back { display: none; margin-bottom: 8px; }
.hd-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.hd-art .portrait { width: 220px; height: 293px; border: 1px solid var(--gold); box-shadow: 0 8px 26px rgba(0,0,0,0.6); }
.hd-name { font-family: var(--font); font-size: 30px; color: var(--gold2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-star { color: #ffd45a; font-size: 14px; }
.hd-team { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--dim); }
.hd-team b { color: var(--gold2); }

/* =====================================================================
   页面：部队
   ===================================================================== */
.army-page { display: grid; grid-template-columns: 150px 1fr; gap: 14px; position: relative; min-height: 60vh; }
.army-tabs { display: flex; flex-direction: column; gap: 6px; }
.army-tab { text-align: left; padding: 10px 12px; background: rgba(0,0,0,0.35); border: 1px solid rgba(216,180,106,0.2); color: var(--text); display: flex; flex-direction: column; gap: 3px; }
.army-tab b { font-family: var(--font); font-weight: normal; font-size: 18px; color: var(--gold2); }
.army-tab small { color: var(--dim); font-size: 11px; font-family: var(--ui); }
.army-tab.on { background: linear-gradient(90deg, rgba(216,180,106,0.45), rgba(216,180,106,0.08)); border-color: var(--gold); }
.army-main { display: grid; grid-template-columns: 1fr 250px; gap: 14px; align-items: start; }
.army-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.army-slot { position: relative; aspect-ratio: 3/4.6; border: 1px solid rgba(216,180,106,0.5); background: #140e09; cursor: pointer; overflow: hidden; }
.army-slot .portrait { position: absolute; left: 0; right: 0; top: 0; height: 72%; }
.army-slot.empty { border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #7a6a4a; }
.army-slot.target { border-color: #ffd27a; box-shadow: 0 0 0 2px rgba(255,210,122,0.4), 0 0 14px rgba(255,190,90,0.4) inset; }
.as-plus { font-size: 34px; line-height: 1; }
.as-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; }
.as-top span { font-size: 11px; background: rgba(0,0,0,0.65); color: #ffe2a0; padding: 0 6px; border: 1px solid rgba(216,180,106,0.5); }
.as-x { width: 24px; height: 24px; background: #8a2a1e; color: #fff; border: 1px solid #f1cc6f; font-size: 12px; padding: 0; }
.as-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; background: linear-gradient(0deg, rgba(14,10,6,0.98) 70%, rgba(14,10,6,0)); display: flex; flex-direction: column; gap: 3px; }
.as-info b { font-family: var(--font); font-weight: normal; font-size: 17px; color: var(--gold2); }
.as-info small { font-size: 10px; color: var(--dim); }
.army-side { background: rgba(0,0,0,0.3); border: 1px solid rgba(216,180,106,0.25); padding: 12px; }
.as-title { font-family: var(--font); font-size: 20px; color: var(--gold2); margin-bottom: 6px; }
.as-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.army-picker { position: absolute; inset: 0; background: rgba(16,11,7,0.97); border: 1px solid var(--gold); padding: 12px; overflow: auto; z-index: 3; }
.ap-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font); color: var(--gold2); font-size: 18px; margin-bottom: 4px; }
.army-picker .gen-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.gen-card.busy { opacity: 0.5; pointer-events: none; }

/* =====================================================================
   页面：战报
   ===================================================================== */
.rep-tabs, .rd-tabs { display: flex; gap: 0; margin-bottom: 10px; align-items: center; }
.rep-tab { padding: 8px 26px; background: rgba(0,0,0,0.35); border: 1px solid rgba(216,180,106,0.25); color: var(--dim); font-size: 16px; letter-spacing: 2px; }
.rep-tab.on { background: linear-gradient(180deg, #f3d995, #c99a45); color: #2a1a0c; border-color: var(--gold); }
.rep-list { display: flex; flex-direction: column; gap: 8px; }
.rep-row { border: 1px solid rgba(216,180,106,0.25); background: rgba(0,0,0,0.3); cursor: pointer; }
.rep-row:hover { border-color: var(--gold); }
.rep-row.win { border-left: 4px solid #d8a53a; } .rep-row.lose { border-left: 4px solid #6d6d6d; } .rep-row.draw { border-left: 4px solid #4c6d8a; }
.rr-top { display: flex; align-items: center; gap: 10px; padding: 5px 10px; background: rgba(255,255,255,0.03); font-size: 13px; color: var(--text); }
.rr-kind { font-size: 12px; padding: 0 8px; border: 1px solid; }
.rr-kind.atk { color: #ffb37a; } .rr-kind.def { color: #8fc0ff; }
.rr-where { flex: 1; }
.rr-time { color: var(--dim); font-size: 12px; }
.rr-body { display: grid; grid-template-columns: 1fr 90px 1fr; align-items: center; padding: 8px 10px; gap: 8px; }
.rr-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rr-side.right { flex-direction: row-reverse; text-align: right; }
.rr-cards { display: flex; gap: 4px; }
.mini-card { width: 52px; text-align: center; font-size: 10px; color: #f0e0c0; }
.mini-card .portrait, .mini-card .npc { width: 52px; height: 66px; border: 1px solid var(--line); }
.mini-card .npc { display: grid; place-items: center; font-family: var(--font); font-size: 22px; color: #8a7a5a; background: radial-gradient(circle, #3a2c1c, #140e09); }
.mini-card.dead .portrait, .mini-card.dead .npc { filter: grayscale(1) brightness(0.55); }
.rr-meta { display: flex; flex-direction: column; gap: 3px; min-width: 80px; flex: 1; }
.rr-meta b { font-family: var(--font); font-weight: normal; font-size: 15px; }
.rr-meta small { font-size: 11px; color: var(--dim); }
.rr-res { text-align: center; display: flex; flex-direction: column; align-items: center; }
.rr-res b { font-family: var(--font); font-size: 40px; font-weight: normal; line-height: 1; }
.rep-row.win .rr-res b { color: #ffcf5a; text-shadow: 0 0 14px rgba(255,180,60,0.5); } .rep-row.lose .rr-res b { color: #8a8a8a; } .rep-row.draw .rr-res b { color: #8fb4d8; }
.rr-res small { font-size: 10px; color: var(--dim); }

.rd-head { display: grid; grid-template-columns: 1fr 100px 1fr; align-items: center; gap: 12px; padding: 10px 12px; background: rgba(0,0,0,0.35); border: 1px solid rgba(216,180,106,0.25); margin-bottom: 10px; }
.rd-side { display: flex; flex-direction: column; gap: 4px; }
.rd-side.right { text-align: right; }
.rd-side b { font-family: var(--font); font-weight: normal; font-size: 18px; }
.rd-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--text); }
.rd-side.right .rd-nums { flex-direction: row-reverse; }
.rd-loss { color: #ff9a7a; }
.rd-res { font-family: var(--font); font-size: 52px; text-align: center; line-height: 1; }
.rd-res.win { color: #ffcf5a; text-shadow: 0 0 18px rgba(255,180,60,0.6); } .rd-res.lose { color: #9a9a9a; }
.rd-grid { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 10px; }
.rd-team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rd-col { background: rgba(0,0,0,0.3); border: 1px solid rgba(216,180,106,0.18); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rd-card { position: relative; aspect-ratio: 3/4; border: 1px solid var(--line); overflow: hidden; }
.rd-card .portrait, .rd-card .npc { position: absolute; inset: 0; }
.rd-card .npc { display: grid; place-items: center; font-family: var(--font); font-size: 30px; color: #8a7a5a; background: radial-gradient(circle, #3a2c1c, #140e09); }
.rd-card.dead .portrait, .rd-card.dead .npc { filter: grayscale(1) brightness(0.5); }
.rd-dead { position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-style: normal; font-family: var(--font); font-size: 18px; color: #ff7a6a; background: rgba(0,0,0,0.55); }
.rd-cname { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-family: var(--font); font-size: 14px; color: var(--gold2); background: linear-gradient(0deg, rgba(0,0,0,0.85), rgba(0,0,0,0)); padding-top: 10px; }
.rd-tr { font-size: 11px; text-align: center; color: var(--text); }
.rd-stat { display: grid; grid-template-columns: 1fr auto; font-size: 11px; color: #e9d8b4; border-top: 1px dashed rgba(216,180,106,0.15); padding-top: 3px; }
.rd-stat span { font-family: var(--font); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-stat b { font-weight: normal; color: var(--dim); }
.rd-stat em { grid-column: 1 / -1; font-style: normal; color: #ffb38a; text-align: right; }
.rd-stat.total em { color: #fff; }
.rd-mid { background: rgba(0,0,0,0.3); border: 1px solid rgba(216,180,106,0.18); padding: 10px; font-size: 13px; color: var(--text); }
.rd-mid-t { font-family: var(--font); color: var(--gold2); font-size: 18px; text-align: center; margin-bottom: 6px; }
.rd-mid p { margin: 6px 0; }

/* =====================================================================
   手机竖屏
   ===================================================================== */
@media (max-width: 760px) {
  :root { --hud-top: 42px; --chip: 46px; --menu-btn: 40px; }
  #lordName { font-size: 14px; } #lordSub, #gameTime { display: none; }
  #lordPortrait { width: 32px; height: 32px; }
  #lordPortrait .portrait { width: 64px; height: 85px; left: -16px; top: -15px; }
  .mp-tag { display: none; }
  #resbar { justify-content: flex-start; gap: 4px; }
  .res { padding: 1px 6px 1px 2px; gap: 3px; } .res i { width: 16px; height: 16px; font-size: 10px; } .res b { font-size: 11px; } .res small { display: none; }
  #timebox { gap: 4px; } #speedBtns button { padding: 1px 5px; font-size: 11px; } #muteBtn { width: 26px; height: 22px; font-size: 12px; }
  .tc-name { font-size: 11px; }
  #homeBtn { width: 52px; height: 52px; } #homeBtn i { font-size: 19px; } #homeBtn span { font-size: 10px; }
  #minimapWrap { display: none; }
  #menuBar { gap: 5px; } #menuBar button span { font-size: 10px; }
  #tilePanel { top: auto; left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); width: auto;
    bottom: calc(76px + env(safe-area-inset-bottom)); max-height: 52dvh; border-radius: 10px; padding: 10px 10px 6px; }
  .tp-title { font-size: 18px; } .tp-brief { font-size: 12px; }
  .city-label .cl-name { font-size: 12px; padding: 0 6px; } .city-label .cl-lv { width: 16px; height: 16px; font-size: 9px; }
  .capital-label .cl-name { font-size: 14px; }
  .troop-label { font-size: 9px; padding: 0 4px; } .troop-label b { font-size: 10px; } .troop-label em { display: none; }
  .toast { font-size: 12px; padding: 5px 10px; } .toast.big { font-size: 13px; }
  #toasts { width: 90vw; }
  #banner { font-size: 40px; letter-spacing: 8px; padding: 8px 20px; width: 92vw; } #banner small { font-size: 12px; }
  .ld-title, .st-title { font-size: 46px; letter-spacing: 12px; } .ld-sub, .st-sub { font-size: 13px; letter-spacing: 3px; margin-bottom: 18px; }
  .ld-bar { width: 72vw; }
  #lordChoices { gap: 8px; } .lord-card { width: 30vw; } .lord-card .lc-info { padding: 6px; } .lord-card .lc-info b { font-size: 14px; } .lord-card .lc-info p { display: none; }
  .mp-facs { gap: 6px; } .mp-fac .mf-info { padding: 6px; } .mp-fac .mf-info b { font-size: 13px; } .mp-fac .mf-who { font-size: 11px; }
  .room-row { flex-wrap: wrap; gap: 4px 10px; padding: 8px; } .room-row .rr-name { flex-basis: 60%; }
  .hero-page { grid-template-columns: 1fr; }
  .hero-page .hero-detail { display: none; }
  .hero-page.show-detail .hero-list { display: none; }
  .hero-page.show-detail .hero-detail { display: block; }
  .hd-back { display: inline-block; }
  .hd-wrap { grid-template-columns: 1fr; } .hd-art .portrait { width: 180px; height: 240px; margin: 0 auto; }
  .hero-list .gen-grid { grid-template-columns: repeat(3, 1fr); }
  .army-page { grid-template-columns: 1fr; }
  .army-tabs { flex-direction: row; }
  .army-tab { flex: 1; padding: 6px 8px; } .army-tab b { font-size: 15px; }
  .army-main { grid-template-columns: 1fr; }
  .army-slots { gap: 6px; } .as-info b { font-size: 14px; }
  .army-picker .gen-grid { grid-template-columns: repeat(3, 1fr); }
  .rep-tab { padding: 6px 16px; font-size: 14px; }
  .rr-body { grid-template-columns: 1fr 52px 1fr; padding: 6px; gap: 4px; }
  .rr-side, .rr-side.right { flex-direction: column; align-items: stretch; gap: 4px; text-align: left; }
  .rr-side.right { text-align: right; }
  .rr-side.right .rr-cards { justify-content: flex-end; }
  .mini-card { width: 34px; font-size: 8px; } .mini-card .portrait, .mini-card .npc { width: 34px; height: 44px; }
  .rr-res b { font-size: 28px; } .rr-res small { display: none; }
  .rr-meta b { font-size: 12px; } .rr-top { font-size: 12px; }
  .rd-head { grid-template-columns: 1fr 50px 1fr; padding: 8px; gap: 6px; } .rd-res { font-size: 34px; } .rd-side b { font-size: 14px; }
  .rd-grid { grid-template-columns: 1fr; }
  .rd-mid { order: -1; } .rd-mid p { display: inline-block; margin: 0 10px 0 0; }
}

/* ---------- 手机横屏 ---------- */
@media (max-height: 520px) and (min-width: 761px) {
  :root { --hud-top: 40px; --chip: 44px; --menu-btn: 40px; }
  #lordSub, #gameTime { display: none; } #lordName { font-size: 14px; }
  #lordPortrait { width: 32px; height: 32px; } #lordPortrait .portrait { width: 64px; height: 85px; left: -16px; top: -15px; }
  .res small { display: none; } .res b { font-size: 12px; } .res i { width: 17px; height: 17px; font-size: 10px; }
  #teamPanel.chips { gap: 6px; }
  #homeBtn { width: 50px; height: 50px; } #homeBtn i { font-size: 18px; } #homeBtn span { font-size: 10px; }
  #minimapWrap { display: none; }
  #menuBar { gap: 5px; } #menuBar button span { font-size: 10px; }
  #tilePanel { width: 280px; max-height: calc(100dvh - 110px); padding: 10px 10px 6px; }
  .tp-title { font-size: 18px; }
  .ld-title, .st-title { font-size: 48px; letter-spacing: 14px; } .ld-sub, .st-sub { margin-bottom: 12px; }
  .lord-card { width: 150px; } .lord-card .lc-info p { display: none; } .st-tip { display: none; }
  .hero-page .hero-detail { display: none; } .hero-page.show-detail .hero-list { display: none; } .hero-page.show-detail .hero-detail { display: block; }
  .hero-page { grid-template-columns: 1fr; } .hd-back { display: inline-block; }
  .hd-wrap { grid-template-columns: 170px 1fr; } .hd-art .portrait { width: 170px; height: 226px; }
}

/* ---------- 手机共用：弹窗全屏、开始界面可滚动 ---------- */
@media (max-width: 760px), (max-height: 520px) {
  #start { justify-content: flex-start; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top)) 10px 24px; }
  .st-inner { width: 100%; }
  .st-tabs { margin: 0 0 16px; } .st-tabs button { padding: 7px 18px; font-size: 15px; letter-spacing: 2px; }
  .st-tip { font-size: 11px; text-align: center; margin-top: 16px; }
  #lanPane { width: 100%; max-width: 620px; }
  .mp-box { padding: 12px; } .mp-row { flex-wrap: wrap; } .mp-row input { max-width: none; flex: 1 1 140px; } .mp-head { font-size: 16px; } .mp-actions { flex-wrap: wrap; }
  #modal { place-items: stretch; }
  .modal-box { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: none; }
  .modal-head { font-size: 18px; letter-spacing: 2px; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }
  #modalClose { width: 36px; height: 36px; }
  #modalBody { flex: 1; padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .hint { font-size: 12px; }
  .gen-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .gen-card .gc-info { font-size: 9px; padding: 4px 5px; } .gen-card .gc-info b { font-size: 13px; }
  .gen-card .gc-tag, .gen-card .gc-star { font-size: 9px; }
  .gen-card .gc-team { font-size: 11px; padding: 2px 8px; letter-spacing: 1px; bottom: 5px; }
  .battle-log { max-height: none; font-size: 12px; }
  .dom-grid { grid-template-columns: 1fr; gap: 10px; }
  .recruit-card { width: 180px; height: 240px; }
  .settings-row { flex-wrap: wrap; }
}
@media (pointer: coarse) { .gen-card:hover, .lord-card:hover { transform: none; } }

/* ---------- 开局地图选项 ---------- */
.map-opts { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: -6px 0 16px; }
.map-opts .mo-row { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.map-opts .mo-label { font-family: var(--font); color: var(--gold2); font-size: 16px; margin-right: 4px; }
.map-opts .mo-seed { color: var(--dim); font-size: 12px; margin: 0 4px 0 10px; font-variant-numeric: tabular-nums; }
.mp-size { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.mp-size span { font-family: var(--font); color: var(--gold2); }

/* ---------- 小地图：右上角；地块面板顺延到下方（电脑） ---------- */
#minimapWrap { left: auto; bottom: auto; top: calc(var(--hud-top) + env(safe-area-inset-top) + 8px); right: calc(10px + env(safe-area-inset-right)); }
#minimapWrap + #toasts { }
@media (min-width: 761px) and (min-height: 521px) {
  #tilePanel { top: calc(var(--hud-top) + env(safe-area-inset-top) + 190px); max-height: calc(100dvh - var(--hud-top) - 280px); }
}
