/* style.css — 星阵少女·自走棋（暗底 + 金/蓝/紫三主色，灰度可区分） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #12141c; --bg2: #1a1e29; --bg3: #222736; --line: #2f3648;
  --fg: #e8ecf5; --dim: #8b93a7;
  --gold: #f5c542; --blue: #4aa3ff; --purple: #a67bff;
  --green: #4ad991; --red: #ff5a6e; --orange: #ff9040;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg); overflow: hidden;
  font: 15px/1.5 "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  user-select: none;
}
.hidden { display: none !important; }
.muted { color: var(--dim); font-size: 13px; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- 按钮 ---------- */
.btn {
  background: var(--bg3); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 16px; font-size: 15px; font-family: inherit;
  cursor: pointer; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { background: #2b3143; border-color: #414a63; }
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(180deg, #f7d06a, #e0a92c); color: #241a02; border-color: #b9871c; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 14px 40px; font-size: 18px; border-radius: 10px; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn.off { opacity: .45; }
.btn.on { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
#btn-cheat.hidden { display: none; }
#stat-round { user-select: none; -webkit-tap-highlight-color: transparent; }
.stat b.cheat { color: var(--gold); text-shadow: 0 0 8px rgba(245,197,66,.6); }
.btn i { font-style: normal; color: var(--gold); font-size: 12px; }
.btn.shake { animation: shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* ---------- 开始屏 ---------- */
#title { align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; overflow: auto; }
.t-mark { letter-spacing: 5px; font-size: 12px; color: var(--dim); }
.t-logo { font-size: 56px; letter-spacing: 10px; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-sub { color: var(--blue); font-size: 14px; letter-spacing: 2px; }
.t-rule { color: var(--dim); margin: 6px 0 14px; }
.t-btns { display: flex; gap: 12px; }
.t-help { margin-top: 22px; max-width: 620px; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.t-help p { font-size: 13.5px; color: #b9c1d2; margin: 3px 0; }
.t-help b { color: var(--gold); }
.t-sig { border-top: 1px dashed var(--line); margin-top: 8px !important; padding-top: 8px; }
.t-sig b { color: var(--purple); }

/* ---------- 顶栏 ---------- */
#top { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); }
#top .spacer { flex: 1; }
.stat { display: flex; align-items: baseline; gap: 5px; }
.stat span { font-size: 12px; color: var(--dim); }
.stat b { font-size: 19px; }
.stat i { font-style: normal; font-size: 12px; color: var(--green); }
.stat.gold b { color: var(--gold); }
.xpb { position: relative; display: inline-block; width: 42px; height: 11px; margin-top: 1px;
  background: #0d0f16; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.xpb i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(74,163,255,.45); transition: width .3s; }
.xpb em { position: relative; display: block; font-style: normal; font-size: 9px; line-height: 10px;
  text-align: center; color: #dbe3f2; font-variant-numeric: tabular-nums; }
.stat.hp b { color: var(--red); }

/* ---------- 主区 ---------- */
main { flex: 1; display: flex; min-height: 0; min-width: 0; }
#arena { min-width: 0; }
#top { min-width: 0; }
#rank { width: 206px; padding: 10px; overflow: auto; border-right: 1px solid var(--line); background: #161927; }
.rk { padding: 5px 6px; border-radius: 7px; font-size: 13px; margin-bottom: 5px; background: #1b2030; }
.rk.me { background: #232a3f; outline: 1px solid var(--blue); }
.rk.pve { background: #2a2018; outline: 1px dashed #ff9040; }
.rk.dead { opacity: .45; }
.rk .r1 { display: flex; align-items: center; gap: 6px; }
.rk .pos { width: 16px; height: 16px; flex: none; border-radius: 4px; background: #2f3648;
  color: #cfd6e6; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.rk.me .pos { background: var(--blue); color: #04101f; }
.rk .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .lv { font-size: 11px; color: var(--dim); width: 26px; flex: none; text-align: right; }
.rk .g { color: var(--gold); font-size: 12px; width: 26px; flex: none; text-align: right; }
.rk .hpv { font-size: 13px; font-weight: 700; width: 30px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.rk .out { font-size: 11px; color: var(--dim); width: 30px; flex: none; text-align: right; }
.rk .r2 { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.rk .tags { min-width: 46px; flex: none; display: flex; gap: 3px; justify-content: flex-end; }
.rk .hpv.ok { color: var(--green); } .rk .hpv.mid { color: var(--gold); } .rk .hpv.low { color: var(--red); }
.rk .st { font-size: 10.5px; padding: 1px 3px; border-radius: 4px; white-space: nowrap; }

.rk .st.w { background: rgba(74,217,145,.16); color: var(--green); }
.rk .st.l { background: rgba(255,90,110,.16); color: var(--red); }
.rk .vs { font-size: 10.5px; color: #04101f; background: var(--blue); padding: 1px 3px; border-radius: 4px; white-space: nowrap; }

.rk .hpb { flex: 1; height: 5px; background: #0d0f16; border-radius: 3px; overflow: hidden; }
.rk .hpf { height: 100%; border-radius: 3px; transition: width .35s ease-out; }
.rk .hpf.ok { background: var(--green); } .rk .hpf.mid { background: var(--gold); } .rk .hpf.low { background: var(--red); }
.rk-hint { font-size: 11px; color: var(--dim); margin-bottom: 6px; letter-spacing: .5px; }

#arena { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px; min-width: 0; }
#board { max-width: min(460px, 100%); max-height: 100%; width: auto; height: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #0e1119; touch-action: none; cursor: pointer; }
#arena { position: relative; }
#btn-report { position: absolute; top: 6px; right: 8px; z-index: 6; padding: 3px 10px;
  font-size: 12px; opacity: .82; }
.rbox { width: min(520px, 94vw); }
.rsw { margin-left: auto; display: flex; gap: 6px; }
.rsw .btn { padding: 3px 10px; font-size: 12px; opacity: .5; }
.rsw .btn.on { opacity: 1; border-color: var(--gold); color: var(--gold); }
#rep-body { max-height: 62vh; overflow: auto; margin-top: 8px; }
.rsec { font-size: 11px; color: var(--dim); letter-spacing: 1.5px; margin: 8px 0 4px; }
.rrow { display: grid; grid-template-columns: 1fr 62px 62px 56px 52px;
  gap: 6px; align-items: center; padding: 5px 7px; border-radius: 8px; font-size: 12.5px; }
.rrow.hd { color: var(--dim); font-size: 11px; letter-spacing: .5px; padding-bottom: 2px; }
.rrow.foe { opacity: .74; }
.rrow.win { background: rgba(74,217,145,.07); }
.rrow.sum { border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0;
  background: rgba(255,255,255,.045); font-size: 11.5px; }
.rrow.sum .rnum { color: #cfd6e4; }
.rrow.sum .rnum.hi { color: #ff9a9a; }
.rrow.sum .rnum.heal { color: #4ad991; }
.rrow.sum .rnum.sh { color: #7bc0ff; }
.rrow.sum .rnm b { color: var(--dim); }
.rnm { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0;
  padding-bottom: 3px; }
.rnm b { font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1 1 auto; min-width: 0; }
.rnm em { font-style: normal; font-size: 10.5px; color: var(--dim); flex: none;
  padding-left: 5px; border-left: 1px solid rgba(255,255,255,.10); }
.rnm .rav { flex: none; }
.rav { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none;
  border: 1.5px solid rgba(255,255,255,.22); background: #0e1119; }
.rbar { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #ff9a9a, #f5c542); max-width: 100%; }
.rnum { text-align: right; font-variant-numeric: tabular-nums; }
.rnum.hi { color: #ffb0b0; font-weight: 700; }
.rnum.heal { color: #4ad991; }
.rnum.sh { color: #7bc0ff; font-size: 11.5px; }
.rnum.nil { color: #5b6478; font-weight: 400; }
.rst { margin-left: auto; flex: none; white-space: nowrap; }
.rst.dead { color: #ff5a6e; }
.rst.awake { color: #f5c542; }
.dbox { background: #121724; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px 16px; max-height: 88dvh; overflow: auto; width: min(560px, 96vw);
  box-shadow: 0 18px 48px rgba(0,0,0,.62); }
.rbox { width: min(560px, 96vw); }
#rep-body { max-height: 60vh; overflow: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.rsec { font-size: 11px; color: var(--dim); letter-spacing: 1.5px; margin: 8px 0 4px; }
.rfoot { font-size: 11.5px; color: var(--dim); margin-top: 8px; line-height: 1.6; }
#drawer { display: contents; }
#rank { order: -1; }
#btn-panel { display: none; }
#phase { font-size: 13px; color: var(--dim); letter-spacing: 1px; height: 18px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#phase b { color: var(--gold); }

#side { width: 214px; padding: 10px; overflow: auto; border-left: 1px solid var(--line); background: #161927; }
.panel-h { font-size: 12px; color: var(--dim); letter-spacing: 2px; margin: 10px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.tr { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 7px; margin-bottom: 4px; background: #1d2231; border: 1px solid transparent; }
.tr.on { border-color: currentColor; background: #232a3d; }
.tr .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.tr .tn { flex: 1; font-size: 13.5px; color: var(--fg); }
.tr .tc { font-size: 12px; font-variant-numeric: tabular-nums; }
.tr .tiers { font-size: 11px; color: var(--dim); }
.tr.on .tiers { color: var(--fg); }
.tk { display: inline-block; font-size: 12px; background: #232a3d; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin: 2px; }
.pk { display: inline-block; font-size: 12px; margin: 2px; padding: 2px 6px; border-radius: 6px; background: #1d2231; border-left: 3px solid var(--dim); }

/* ---------- 底部 ---------- */
#bottom { background: var(--bg2); border-top: 1px solid var(--line); padding: 8px 12px; display: flex; flex-direction: column; gap: 7px; }
#shop, #bench { display: flex; gap: 7px; justify-content: center; }
#controls { display: flex; gap: 8px; justify-content: center; align-items: center; }
.card {
  width: 82px; background: #1d2231; border: 1px solid var(--line); border-radius: 9px;
  padding: 5px; text-align: center; cursor: pointer; position: relative;
  transition: transform .1s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.card:active { transform: scale(.96); }
.card .av { width: 100%; aspect-ratio: 1; border-radius: 6px; background: #0e1119; object-fit: cover; display: block; }
.card .ini { width: 100%; aspect-ratio: 1; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: #fff; }
.card .cn { font-size: 14px; margin-top: 3px; }
.card .ct { font-size: 12px; color: var(--dim); }
.kwline { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 1px; }
.kwline b { font-size: 9.5px; font-weight: 700; letter-spacing: .5px; }
.bslot .kwline { display: none; }
.dkw { display: flex; flex-direction: column; gap: 4px; }
.dkw span { display: block; border: 1px solid; border-radius: 7px; padding: 4px 8px; font-size: 12px; }
.dkw span b { letter-spacing: 1px; margin-right: 6px; }
.dkw span i { font-style: normal; color: var(--dim); font-size: 11.5px; }
.card .cost { position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--gold); color: #241a02; font-size: 12px; font-weight: 700; line-height: 19px; }
.card.sold { opacity: .3; pointer-events: none; }
.card.poor { filter: grayscale(.7); opacity: .62; }
.card.sel { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.bslot { width: 62px; touch-action: none; }
.bslot.dragging { opacity: .3; }
.dragghost { position: fixed; z-index: 90; pointer-events: none; left: 0; top: 0;
  transform: translate(-50%, -58%) scale(1.1); opacity: .95;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.65)); }
.dragghost img { width: 52px; height: 52px; border-radius: 50%; display: block;
  border: 2px solid var(--gold); }
.dragghost span { display: block; text-align: center; font-size: 10px; color: var(--gold);
  text-shadow: 0 1px 3px #000; margin-top: 2px; }
.t-diff { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 2px 0 10px; font-size: 12px; color: var(--dim); letter-spacing: 1px; }
.t-diff .btn { padding: 4px 12px; font-size: 12px; opacity: .55; }
.t-diff .btn.on { opacity: 1; border-color: var(--gold); color: var(--gold); }
.bslot.drop { border-color: var(--gold); border-style: solid; background: rgba(245,197,66,.08); }
.bslot .cost { display: none; }
.bslot .st { position: absolute; right: 4px; top: 4px; font-size: 11px; color: var(--gold); letter-spacing: -1px; }
.empty { width: 82px; height: 108px; border: 1px dashed var(--line); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.bslot.empty { width: 62px; height: 78px; }

/* ---------- 觉醒特写 ---------- */
#cutin { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(166,123,255,.28), rgba(6,8,14,.86)); z-index: 40;
  animation: ci .9s ease-out forwards; pointer-events: none; }
@keyframes ci { 0% { opacity: 0; transform: scale(1.25); } 18% { opacity: 1; transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; } }
.ci-frame { width: 210px; height: 210px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); box-shadow: 0 0 44px rgba(245,197,66,.5); background: #0e1119; position: relative; }
.ci-frame img { width: 100%; height: 100%; object-fit: cover; }
#cutin-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 84px; font-weight: 700; color: #fff; }
#cutin-name { margin-top: 14px; font-size: 26px; letter-spacing: 6px; color: #fff; text-shadow: 0 0 18px var(--purple); }
#cutin-tag { font-size: 13px; letter-spacing: 8px; color: var(--gold); margin-top: 4px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(4,6,12,.90);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px; }
.m-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; max-width: 660px; width: 100%; text-align: center; }
.m-card h2 { font-size: 22px; letter-spacing: 3px; }
.m-sub { color: var(--dim); font-size: 13px; margin: 4px 0 16px; }
#tactic-opts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tc-opt { width: 178px; background: #1d2231; border: 1px solid var(--line); border-radius: 11px; padding: 14px 12px; cursor: pointer; transition: .15s; }
.tc-opt:hover { border-color: var(--purple); transform: translateY(-3px); }
.tc-opt .ic { font-size: 30px; color: var(--purple); }
.tc-opt .nm { font-size: 17px; margin: 6px 0 4px; }
.tc-opt .ds { font-size: 12.5px; color: var(--dim); }
#r-place { font-size: 40px; letter-spacing: 4px; color: var(--gold); }
#r-line { color: var(--dim); margin: 6px 0 14px; }
#r-stats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
#r-stats div { background: #1d2231; border-radius: 9px; padding: 8px 14px; font-size: 13px; }
#r-stats b { display: block; font-size: 21px; color: var(--blue); }
#r-board { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
#r-board span { font-size: 12px; background: #1d2231; border-left: 3px solid var(--gold); border-radius: 5px; padding: 3px 8px; }
.m-btns { display: flex; gap: 12px; justify-content: center; }


/* ---------- 详情面板 ---------- */
.card, .bslot { position: relative; }
.info { position: absolute; right: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: #2f3648; color: #cfd6e6; font-size: 10px; font-style: italic; font-weight: 700;
  line-height: 15px; text-align: center; font-family: Georgia, serif; }
.info:hover { background: var(--blue); color: #04101f; }
.bslot .info { width: 13px; height: 13px; line-height: 13px; font-size: 9px; }
.tr { flex-wrap: wrap; cursor: pointer; }
.tr:hover { background: #262d40; }
.tr .teff { width: 100%; font-size: 11px; color: #9aa4bb; line-height: 1.35; margin-top: 2px; }
.tr.on .teff { color: #dbe3f2; }
.modal .m-card.detail { text-align: left; max-width: 520px; padding: 14px 18px 18px; max-height: 86dvh; overflow: auto; }
#d-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#d-title { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.dhead { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.dhead img, .dini { width: 74px; height: 74px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.dini { display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; }
.dname { font-size: 20px; letter-spacing: 1px; }
.den { font-size: 12px; color: var(--dim); letter-spacing: 1px; }
.dsub { font-size: 12px; color: var(--gold); margin: 2px 0 5px; }
.dchips { display: flex; gap: 5px; flex-wrap: wrap; }
.dchip { font-size: 11px; border: 1px solid; border-radius: 20px; padding: 1px 8px; }
.dsec { font-size: 11px; color: var(--dim); letter-spacing: 2px; margin: 12px 0 5px;
  border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; }
.dgrid .row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.dgrid .row span { color: var(--dim); }
.dgrid .row b { font-variant-numeric: tabular-nums; }
.dgrid .up { color: var(--green); font-style: normal; font-size: 12px; }
.ddesc { font-size: 13px; color: #dbe3f2; background: #1d2231; border-left: 3px solid var(--gold);
  padding: 6px 9px; border-radius: 0 6px 6px 0; }
.dtrait { font-size: 12.5px; line-height: 1.5; }
.dtrait .tier { display: block; color: var(--dim); padding-left: 8px; border-left: 2px solid #2f3648; margin: 2px 0; }
.dtrait .tier.on { color: #dbe3f2; border-left-color: var(--gold); }
.tsep { height: 6px; }
.tierline { display: flex; gap: 8px; font-size: 12.5px; padding: 4px 6px; border-radius: 6px;
  background: #1d2231; color: var(--dim); margin-bottom: 3px; }
.tierline.on { color: #fff; background: #26304a; outline: 1px solid var(--gold); }
.tierline .tnum { flex: none; width: 40px; font-weight: 700; }
.dchip2 { display: inline-block; font-size: 12px; background: #1d2231; border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px; margin: 2px; cursor: pointer; }
.dchip2:hover { border-color: var(--blue); }
.pk { cursor: pointer; }
.pk:hover { background: #262d40; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; max-width: 94vw; }
.tt { max-width: 92vw; }
.tt { background: rgba(20,24,36,.94); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  padding: 7px 16px; border-radius: 8px; font-size: 14px; animation: tt 1.9s forwards; }
.tt.bad { border-left-color: var(--red); }
.tt.good { border-left-color: var(--green); }
@keyframes tt { 0% { opacity: 0; transform: translateY(-8px); } 12%,72% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- 移动端：一屏装下 ---------- */
@media (max-width: 900px) {
  html, body { height: 100%; overflow: hidden; }
  .screen { position: absolute; inset: 0; }
  #game { height: 100dvh; }
  #top { flex-wrap: nowrap; gap: 4px; padding: 3px 5px; font-size: 12px; --topH: 46px; }
  #top .stat span { font-size: 10px; letter-spacing: 0; }
  #top .spacer { flex: 1 1 0; min-width: 0; }
  .stat { min-width: 0; }
  .stat i { font-size: 9.5px; }
  .stat.lv span { font-size: 10px; }
  #top .btn.sm { padding: 3px 5px; font-size: 12px; min-width: 22px; }
  .stat { flex-direction: column; align-items: center; gap: 0; line-height: 1.05; white-space: nowrap; }
  .stat span { font-size: 10px; opacity: .75; }
  .stat b { font-size: 15px; }
  .stat i { font-size: 10px; }
  .btn.sm { padding: 4px 8px; font-size: 12px; }
  #btn-panel { display: inline-block; }
  main { flex-direction: column; min-height: 0; }
  #arena { flex: 1 1 auto; min-height: 0; padding: 4px; }
  #board { max-width: 100%; max-height: 100%; }
  #phase { font-size: 11.5px; height: 15px; }
  /* 排名 + 羁绊进抽屉 */
  #drawer { display: block; position: fixed; left: 0; right: 0; top: var(--topH, 52px); bottom: 0;
    background: rgba(10,12,18,.97); z-index: 35; padding: 10px; overflow: auto;
    transform: translateY(105%); transition: transform .22s ease-out; }
  #drawer.open { transform: translateY(0); }
  #rank { width: auto; border: 0; padding: 0 0 8px; }
  .rk { margin-bottom: 4px; }
  .rk .nm { font-size: 12.5px; }
  #side { width: auto; border: 0; padding: 0; }
  #traits { display: flex; flex-wrap: wrap; gap: 4px; }
  .tr { width: calc(50% - 4px); }
  /* 底部三段压扁 */
  #bottom { padding: 5px 6px 6px; gap: 5px; }
  #shop, #bench { gap: 5px; }
  .card { width: 64px; padding: 4px; } .empty { width: 64px; height: 96px; font-size: 11px; }
  .card .cn { font-size: 13px; } .card .ct { font-size: 11px; }
  .bslot { width: 42px; } .bslot.empty { width: 42px; height: 56px; }
  .rbox { width: 96vw; }
  .rrow { grid-template-columns: 1fr 46px 46px 42px 40px; gap: 4px; padding: 4px 5px; font-size: 11.5px; }
  .rrow.hd { font-size: 10px; }
  .rnum.sh { font-size: 10.5px; }
  .rav { width: 22px; height: 22px; }
  .rnm em { font-size: 9.5px; }
  #rep-body { max-height: 58dvh; }
  .bslot .cn { font-size: 11px; } .bslot .ct { display: none; }
  #controls { gap: 5px; }
  #controls .btn { padding: 6px 9px; font-size: 13px; }
  .t-logo { font-size: 38px; letter-spacing: 5px; }
  #title { justify-content: flex-start; padding-top: 6dvh; }
  .t-help { margin-top: 12px; }
}
