/* ═══════════════════════════════════════════════════════
   星穹貨幣戰爭・連線對弈 — 樣式
   深空夜色 + 公司金／霓虹，搭配官網的圓角與 Quicksand。
   ═══════════════════════════════════════════════════════ */
:root {
  --bg: #0b081b;
  --bg2: #171036;
  --bg3: #221748;
  --panel: rgba(26, 20, 54, 0.74);
  --panel-solid: #1b1438;
  --panel-2: rgba(38, 29, 76, 0.78);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4efff;
  --muted: #a99ec9;
  --muted-2: #7f739f;
  --gold: #ffc14d;
  --gold-2: #ff9f1c;
  --pink: #ff9ed2;
  --cyan: #7fdcff;
  --purple: #a78bfa;
  --green: #6fdc8c;
  --red: #ff6b81;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: 'Quicksand', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(120, 70, 220, 0.28), transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 10%, rgba(255, 100, 180, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 60% at 50% 100%, rgba(40, 90, 180, 0.18), transparent 65%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg2) 55%, #0d0a22 100%);
  z-index: -2;
}
.starfield { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.75; }
.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 28% 62%, #d9ccff, transparent),
    radial-gradient(1.2px 1.2px at 44% 12%, #fff, transparent),
    radial-gradient(1.8px 1.8px at 62% 38%, #ffe6a8, transparent),
    radial-gradient(1.2px 1.2px at 76% 72%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 88% 22%, #b9f1ff, transparent),
    radial-gradient(1.3px 1.3px at 92% 86%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 8% 78%, #ffd2ea, transparent),
    radial-gradient(1.2px 1.2px at 54% 88%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 34% 32%, #fff, transparent);
  background-size: 520px 520px;
  animation: twinkle 9s ease-in-out infinite alternate;
}
.starfield::after {
  background-size: 760px 760px;
  opacity: 0.5;
  animation-duration: 13s;
  animation-direction: alternate-reverse;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.9; } }

a { color: var(--cyan); }
button { font-family: inherit; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--gold); color: #2a1a00; padding: 0.5rem 1rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

/* ───────────────── 外框 / 頁首 ───────────────── */
.cw-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 20px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.cw-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 4px 14px;
}
.cw-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.cw-brand-cat {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(255, 193, 77, 0.22), rgba(255, 158, 210, 0.18));
  border: 1px solid rgba(255, 193, 77, 0.35);
  border-radius: 14px; font-size: 1.15rem;
  box-shadow: 0 0 22px rgba(255, 193, 77, 0.18);
}
.cw-brand-text { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; display: flex; align-items: baseline; gap: 8px; }
.cw-brand-text em {
  font-style: normal; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em;
  color: var(--gold); text-transform: uppercase;
  border: 1px solid rgba(255, 193, 77, 0.35); border-radius: 999px; padding: 2px 8px;
}
.cw-nav { display: flex; gap: 4px; margin-left: auto; }
.cw-nav a {
  color: var(--muted); text-decoration: none; font-size: 0.86rem; font-weight: 600;
  padding: 7px 12px; border-radius: 10px; transition: 0.18s;
}
.cw-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.conn-pill {
  display: flex; align-items: center; gap: 7px; font-size: 0.74rem; font-weight: 700;
  color: var(--muted); background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  white-space: nowrap;
}
.conn-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.conn-pill.online { color: var(--green); }
.conn-pill.online .dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
.conn-pill.offline { color: var(--red); }
.conn-pill.offline .dot { background: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

main { flex: 1; }
.view { animation: viewFade 0.35s ease; }
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }

/* ───────────────── 按鈕 ───────────────── */
.btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-gold {
  background: linear-gradient(135deg, #ffe08a, var(--gold) 45%, var(--gold-2));
  color: #2a1700; border-color: rgba(255, 230, 160, 0.9);
  box-shadow: 0 8px 28px rgba(255, 170, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-gold:hover { box-shadow: 0 10px 34px rgba(255, 170, 40, 0.42); background: linear-gradient(135deg, #fff0bb, #ffcc66 45%, #ff9f1c); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); }
.btn-sm { padding: 8px 12px; font-size: 0.8rem; border-radius: 10px; }
.btn-mini { padding: 8px 10px; font-size: 0.76rem; border-radius: 9px; flex-direction: column; gap: 2px; }
.btn-mini span { font-size: 0.66rem; color: var(--muted); font-weight: 600; }
.btn-mini.lock.on { border-color: var(--gold); color: var(--gold); background: rgba(255, 193, 77, 0.12); }

/* ───────────────── 大廳 ───────────────── */
.lobby { max-width: 980px; margin: 2vh auto 0; text-align: center; }
.lobby-hero { padding: 3.5vh 0 2vh; }
.hero-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.22em;
  color: var(--gold); border: 1px solid rgba(255, 193, 77, 0.4);
  border-radius: 999px; padding: 5px 14px; background: rgba(255, 193, 77, 0.08);
  margin-bottom: 18px;
}
.lobby-hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.05; letter-spacing: 0.02em; font-weight: 700;
  background: linear-gradient(100deg, #fff6dc 5%, #ffd479 38%, #ff9ed2 70%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 30px rgba(255, 170, 60, 0.2));
}
.hero-sub { margin-top: 10px; font-size: 1.05rem; color: var(--gold); letter-spacing: 0.14em; font-weight: 600; }
.hero-desc { margin: 18px auto 0; max-width: 560px; color: var(--muted); font-size: 0.95rem; line-height: 1.85; }
.lobby-actions {
  display: flex; align-items: flex-end; justify-content: center; gap: 18px;
  margin: 3vh auto 0; padding: 22px 26px; max-width: 760px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.field { display: flex; flex-direction: column; gap: 7px; text-align: left; flex: 1; max-width: 230px; }
.field span { font-size: 0.72rem; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; }
input[type='text'], input[type='password'], input[type='email'], input[type='number'], input[type='search'], input:not([type]) {
  background: rgba(10, 7, 24, 0.7); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 0.95rem; font-weight: 600; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 193, 77, 0.14); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px rgba(12, 8, 28, 0.98) inset;
  box-shadow: 0 0 0 1000px rgba(12, 8, 28, 0.98) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.lobby-buttons { display: flex; flex-direction: column; gap: 10px; flex: 1.2; }
.join-row { display: flex; gap: 8px; }
.join-row input { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.85rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 4vh; }
.feature {
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px 18px; text-align: left; transition: 0.2s;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(255, 193, 77, 0.35); background: rgba(255, 255, 255, 0.055); }
.feature-icon { font-size: 1.6rem; margin-bottom: 10px; }
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { font-size: 0.8rem; color: var(--muted); line-height: 1.7; }
.disclaimer { margin-top: 3vh; color: var(--muted-2); font-size: 0.7rem; }

/* ───────────────── 房間 ───────────────── */
.room { max-width: 780px; margin: 4vh auto 0; }
.room-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  padding: 26px; box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.room-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.eyebrow { font-size: 0.7rem; letter-spacing: 0.24em; color: var(--muted); font-weight: 700; }
.room-code {
  font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: 0.28em;
  color: var(--gold); line-height: 1.1; margin-top: 2px;
  text-shadow: 0 0 28px rgba(255, 193, 77, 0.35);
}
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.room-players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.room-player {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 16px;
}
.room-player.empty { border-style: dashed; opacity: 0.55; }
.room-player .rp-avatar {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(255, 193, 77, 0.22), rgba(167, 139, 250, 0.22));
  font-size: 1.3rem; border: 1px solid var(--line-strong);
}
.room-player .rp-name { font-weight: 700; }
.room-player .rp-state { font-size: 0.72rem; color: var(--muted); }
.room-player > div:nth-child(2) { flex: 1; min-width: 0; }
.rp-rank {
  flex: none; margin-left: auto; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 193, 77, 0.14); border: 1px solid rgba(255, 193, 77, 0.42);
  color: var(--gold); font-size: 0.64rem; font-weight: 800; line-height: 1.2;
  white-space: nowrap; letter-spacing: 0.02em;
}
.rp-rank.guest {
  background: rgba(255, 255, 255, 0.04); border-color: var(--line);
  color: var(--muted);
}
.room-player .rp-state.ok { color: var(--green); }
.room-player .rp-state.host { color: var(--gold); }
.room-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.room-tip { color: var(--muted); font-size: 0.8rem; }
.room-buttons { display: flex; gap: 10px; }
.howto-strip {
  margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  font-size: 0.76rem; color: var(--muted);
}
.howto-strip div { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.howto-strip b { color: var(--gold); margin-right: 4px; }

/* ───────────────── HUD ───────────────── */
.hud {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px;
  padding: 12px 16px; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(14px);
}
.hud-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hud-player.opp { justify-content: flex-end; text-align: right; }
.hud-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.25rem; background: linear-gradient(135deg, rgba(127, 220, 255, 0.2), rgba(167, 139, 250, 0.24));
  border: 1px solid rgba(127, 220, 255, 0.3);
}
.hud-avatar.opp { background: linear-gradient(135deg, rgba(255, 158, 210, 0.22), rgba(255, 193, 77, 0.18)); border-color: rgba(255, 158, 210, 0.3); }
.hud-main { min-width: 0; width: 100%; }
.hud-line { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.hud-player.opp .hud-line { justify-content: flex-end; }
.hud-line b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-level { font-size: 0.68rem; color: var(--gold); border: 1px solid rgba(255, 193, 77, 0.3); border-radius: 999px; padding: 1px 7px; }
.hpbar {
  position: relative; height: 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--line); overflow: hidden; margin-top: 5px;
}
.hpbar-fill {
  height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ff5d7a, #ff9ed2);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hpbar.opp .hpbar-fill { background: linear-gradient(90deg, #a78bfa, #7fdcff); }
.hpbar span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.hud-res { display: flex; gap: 12px; margin-top: 5px; font-size: 0.7rem; color: var(--muted); flex-wrap: wrap; }
.hud-player.opp .hud-res { justify-content: flex-end; }
.hud-res b { color: var(--text); }
.res.gold b { color: var(--gold); }
.res.xp b { color: var(--cyan); }
.res.streak-win { color: var(--green); }
.res.streak-loss { color: var(--red); }
.hud-center { text-align: center; min-width: 118px; }
.round-label { font-size: 0.74rem; color: var(--muted); font-weight: 700; letter-spacing: 0.1em; }
.timer {
  font-size: 1.9rem; font-weight: 700; line-height: 1.05; color: var(--gold);
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; justify-content: center; gap: 3px;
}
.timer small { font-size: 0.62rem; color: var(--muted); font-weight: 600; }
.timer.urgent { color: var(--red); animation: pulse 0.9s infinite; }
.phase-label { font-size: 0.66rem; color: var(--muted); letter-spacing: 0.12em; }
.surrender-btn {
  margin-top: 2px; border: 0; background: none; color: var(--muted-2);
  font-family: inherit; font-size: 0.58rem; letter-spacing: 0.14em;
  text-decoration: underline dotted; cursor: pointer;
}
.surrender-btn:hover { color: var(--red); }

/* ───────────────── 對局主格 ───────────────── */
.game-grid {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 232px;
  gap: 12px;
  align-items: start;
}
.rail {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; backdrop-filter: blur(12px); max-height: 545px; overflow: auto;
}
.rail::-webkit-scrollbar, .trait-list::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 999px; }
.panel-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; color: var(--muted);
  margin: 2px 0 9px; display: flex; justify-content: space-between; align-items: center;
}
.panel-title:not(:first-child) { margin-top: 16px; }
.panel-sub { font-weight: 500; letter-spacing: 0; color: var(--muted-2); font-size: 0.62rem; }

/* 羈絆 */
.trait-list { display: flex; flex-direction: column; gap: 5px; }
.trait {
  display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 10px;
  border: 1px solid transparent; cursor: help; transition: 0.15s;
}
.trait:hover { background: rgba(255, 255, 255, 0.05); }
.trait.inactive { opacity: 0.45; }
.trait.active { background: rgba(255, 255, 255, 0.045); border-color: var(--line); }
.trait .t-icon {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px;
  background: rgba(0, 0, 0, 0.3); font-size: 0.82rem; border: 1px solid var(--line);
}
.trait .t-main { flex: 1; min-width: 0; }
.trait .t-name { font-size: 0.76rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.trait .t-name b { color: var(--gold); font-size: 0.66rem; }
.trait .t-group { margin-left: 5px; padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,.08); color: var(--muted-2); font-size: 0.52rem; font-weight: 600; letter-spacing: 0; }
.trait .t-pips { display: flex; gap: 3px; margin-top: 3px; }
.trait .t-pips i { height: 3px; flex: 1; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.trait .t-pips i.on { background: var(--gold); box-shadow: 0 0 8px rgba(255, 193, 77, 0.5); }
.trait .t-count { font-size: 0.68rem; font-weight: 700; color: var(--muted); }
.trait.active .t-count { color: var(--gold); }
.trait.tier-2 .t-count, .trait.tier-3 .t-count { color: var(--pink); }

/* ───────────────── 棋盤 ───────────────── */
.board-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px; backdrop-filter: blur(12px);
  background-image: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(120, 80, 220, 0.12), transparent 70%);
}
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 6px; }
.side-tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.side-tag.opp { color: var(--pink); }
.side-tag.me { color: var(--cyan); }
.side-count { font-size: 0.66rem; color: var(--muted-2); }
.board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.slot {
  position: relative; border-radius: 11px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer; transition: 0.15s; padding: 2px;
  display: flex; align-items: stretch; justify-content: stretch;
  font-family: inherit; color: inherit;
}
.slot > .ucard { flex: 1; }
.slot:hover { border-color: rgba(255, 193, 77, 0.45); background: rgba(255, 193, 77, 0.05); }
.slot.drop-ok { border-color: var(--gold); box-shadow: inset 0 0 18px rgba(255, 193, 77, 0.15); }
.board .slot { height: clamp(64px, 8.9vh, 94px); }
.board.opp .slot { cursor: default; }
.board-divider { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.board-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 193, 77, 0.35), transparent); }
.board-divider b {
  font-size: 0.66rem; letter-spacing: 0.2em; color: var(--gold);
  border: 1px solid rgba(255, 193, 77, 0.3); border-radius: 999px; padding: 1px 9px;
  background: rgba(255, 193, 77, 0.06);
}
.bench-label { display: flex; justify-content: space-between; align-items: center; margin: 10px 2px 6px; font-size: 0.68rem; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; }
.bench-label span { font-weight: 500; letter-spacing: 0; color: var(--muted-2); font-size: 0.62rem; }
.bench { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.bench .slot { height: clamp(58px, 7.2vh, 80px); }
.bench .slot .u-avatar { max-width: 40px; }
.bench .slot .u-name { font-size: 0.56rem; }
.bench .slot.filled { border-style: solid; }

/* 通用角色卡 */
.ucard {
  position: relative; width: 100%; height: 100%;
  border-radius: 10px; padding: 4px 3px 3px; cursor: grab;
  border: 1px solid var(--cost, rgba(255, 255, 255, 0.18));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.12)),
    radial-gradient(120% 80% at 50% 0%, var(--cost-soft, rgba(255, 255, 255, 0.1)), transparent 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; overflow: visible; text-align: center;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.ucard:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); z-index: 2; }
.ucard.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 193, 77, 0.55), 0 0 24px rgba(255, 193, 77, 0.35); z-index: 3; }
.ucard.dragging { opacity: 0.45; }
.ucard .u-avatar {
  position: relative; width: 100%; max-width: 52px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-size: clamp(1rem, 2.1vw, 1.45rem);
  background: radial-gradient(circle at 32% 26%, var(--el, #8f8bff), rgba(12, 8, 28, 0.92) 78%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.35);
  flex: none;
}
.ucard .u-stars {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  font-size: 0.52rem; letter-spacing: -0.04em; color: var(--gold); white-space: nowrap;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(255, 193, 77, 0.6);
}
.ucard .u-name {
  font-size: clamp(0.5rem, 0.82vw, 0.62rem);
  font-weight: 700; line-height: 1.08; margin-top: 2px;
  max-width: 100%; min-height: 1.05em;
  white-space: normal; word-break: keep-all; overflow: visible; text-overflow: clip;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.ucard .u-cost {
  position: absolute; top: 2px; left: 3px; font-size: 0.52rem; font-weight: 700;
  color: var(--cost, #fff); opacity: 0.9;
}
.ucard .u-pos {
  position: absolute; top: 2px; right: 3px; font-size: 0.46rem; font-weight: 700;
  padding: 0 3px; border-radius: 4px; color: var(--muted); background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ucard .u-pos.on { color: #2a1700; background: var(--gold); border-color: var(--gold); }
.ucard .u-items { display: flex; gap: 2px; margin-top: 2px; height: 13px; }
.ucard .u-items i {
  font-style: normal; font-size: 0.55rem; line-height: 1;
  width: 13px; height: 13px; display: grid; place-items: center;
  border-radius: 3px; background: rgba(255, 193, 77, 0.16);
  border: 1px solid rgba(255, 193, 77, 0.45);
}
.ucard.has-items { box-shadow: inset 0 0 0 1px rgba(255, 193, 77, 0.4), 0 0 14px rgba(255, 193, 77, 0.16); }
.ucard .u-dmg {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px;
  font-size: 0.8rem; font-weight: 700; color: #fff; background: rgba(255, 60, 90, 0.35);
  animation: cardHit 0.4s ease-out forwards; pointer-events: none;
}
@keyframes cardHit { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.12); } }

/* 費用色 */
.cost-1 { --cost: #b9c3d6; --cost-soft: rgba(185, 195, 214, 0.16); }
.cost-2 { --cost: #6fdc8c; --cost-soft: rgba(111, 220, 140, 0.16); }
.cost-3 { --cost: #64b5ff; --cost-soft: rgba(100, 181, 255, 0.18); }
.cost-4 { --cost: #c08bff; --cost-soft: rgba(192, 139, 255, 0.2); }
.cost-5 { --cost: #ffc14d; --cost-soft: rgba(255, 193, 77, 0.2); }

/* ───────────────── 右側資訊 ───────────────── */
.item-panel {
  margin: 0 0 4px; padding: 9px 9px 8px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 193, 77, 0.13), rgba(167, 139, 250, 0.06));
  border: 1px solid rgba(255, 193, 77, 0.42);
  box-shadow: inset 0 0 22px rgba(255, 193, 77, 0.05);
}
.item-panel .panel-title { margin: 0 0 8px; color: var(--gold); font-size: 0.78rem; }
.item-panel .panel-sub { color: var(--muted); font-size: 0.62rem; }
.item-help { margin-top: 7px; color: var(--muted-2); font-size: 0.6rem; letter-spacing: 0.02em; }
.item-bench { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; }
.item-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 10px;
  background: rgba(255, 193, 77, 0.09); border: 1px solid rgba(255, 193, 77, 0.42); cursor: pointer;
  font-size: 0.76rem; font-weight: 700; transition: 0.15s; color: var(--text);
}
.item-chip:hover { border-color: var(--gold); background: rgba(255, 193, 77, 0.18); transform: translateY(-1px); }
.item-chip.selected { border-color: var(--gold); background: rgba(255, 193, 77, 0.22); box-shadow: 0 0 0 2px rgba(255, 193, 77, 0.35), 0 0 18px rgba(255, 193, 77, 0.2); }
.item-chip .ic { font-size: 1.15rem; filter: drop-shadow(0 0 6px rgba(255,193,77,.35)); }
.item-chip.empty { opacity: 0.5; cursor: default; background: rgba(255,255,255,.03); border-color: var(--line); font-size: .7rem; }
.ucard .u-items { height: 16px; gap: 3px; }
.ucard .u-items i {
  font-size: 0.66rem; width: 16px; height: 16px; border-radius: 4px;
  background: rgba(255, 193, 77, 0.22); border-color: rgba(255, 193, 77, 0.65);
  box-shadow: 0 0 6px rgba(255, 193, 77, 0.18);
}
.detail-panel { font-size: 0.74rem; }
.detail-panel .muted { color: var(--muted-2); font-size: 0.7rem; line-height: 1.6; }
.detail-unit-head { display: flex; gap: 9px; align-items: center; margin-bottom: 8px; }
.detail-unit-head .du-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.35rem; background: radial-gradient(circle at 32% 26%, var(--el), rgba(10, 8, 26, 0.9) 78%);
  border: 1px solid var(--line-strong);
}
.detail-unit-head .du-name { font-size: 0.86rem; font-weight: 700; }
.detail-unit-head .du-sub { font-size: 0.62rem; color: var(--muted); }
.du-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 8px 0; font-size: 0.68rem; color: var(--muted); }
.du-stats b { color: var(--text); float: right; }
.du-traits { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.du-traits span { font-size: 0.6rem; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.du-skill { color: var(--muted); font-size: 0.66rem; line-height: 1.55; margin: 6px 0; }
.du-items { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.du-items button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); border-radius: 7px; padding: 3px 6px; font-size: 0.62rem; cursor: pointer; }
.du-actions { display: flex; gap: 6px; margin-top: 8px; }
.du-actions .btn { flex: 1; padding: 7px; font-size: 0.68rem; }
.log-panel { display: flex; flex-direction: column; gap: 4px; font-size: 0.65rem; color: var(--muted); max-height: 130px; overflow: auto; }
.log-panel div { padding: 3px 6px; border-left: 2px solid var(--line); background: rgba(255, 255, 255, 0.025); border-radius: 0 6px 6px 0; }
.log-panel div.win { border-color: var(--green); color: var(--green); }
.log-panel div.loss { border-color: var(--red); color: var(--red); }

/* ───────────────── 商店 ───────────────── */
.shop-bar {
  display: grid; grid-template-columns: 208px minmax(0, 1fr) 170px; gap: 12px;
  margin-top: 12px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(14px);
}
.shop-side { display: flex; flex-direction: column; gap: 6px; }
.shop-level { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.shop-level b { color: var(--gold); font-size: 0.9rem; }
.xp-track { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.xp-track div { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--purple)); transition: width 0.4s; }
.shop-actions { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 5px; }
.moon-rule-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.moon-rule-row span { font-size: .6rem; color: var(--muted); }
.moon-rule-row button { padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font: inherit; font-size: .6rem; cursor: pointer; }
.moon-rule-row button.on { background: var(--gold); border-color: var(--gold); color: #2a1700; }
.bond-shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.bond-offer { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; background: rgba(255,255,255,.04); }
.bond-offer .bo-icon { font-size: 1.5rem; }
.bond-offer .bo-name { font-weight: 700; margin: 4px 0; }
.bond-offer .bo-price { color: var(--gold); font-size: .7rem; margin-bottom: 6px; }
@media (max-width: 520px) { .bond-shop-grid { grid-template-columns: 1fr; } }
.odds-line { font-size: 0.56rem; color: var(--muted-2); letter-spacing: 0.02em; }
.shop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.shop-card {
  position: relative; border-radius: 12px; padding: 8px 6px 6px; cursor: pointer;
  border: 1px solid var(--cost, var(--line));
  font-family: inherit; color: inherit; appearance: none; -webkit-appearance: none; text-align: center;
  background:
    radial-gradient(130% 90% at 50% 0%, var(--cost-soft, rgba(255, 255, 255, 0.08)), transparent 72%),
    rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform 0.14s, box-shadow 0.14s;
  min-height: 104px;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); border-color: var(--cost); }
.shop-card.empty { opacity: 0.25; cursor: default; border-style: dashed; border-color: var(--line); }
.shop-card .sc-cost {
  position: absolute; top: 4px; left: 6px; font-size: 0.58rem; font-weight: 700; color: var(--cost);
}
.shop-card .sc-avatar {
  width: clamp(34px, 4vw, 44px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-size: clamp(1rem, 2vw, 1.3rem); margin-top: 3px;
  background: radial-gradient(circle at 32% 26%, var(--el, #8f8bff), rgba(10, 8, 26, 0.92) 78%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.shop-card .sc-name { font-size: 0.72rem; font-weight: 700; }
.shop-card .sc-traits { display: flex; gap: 2px; font-size: 0.5rem; opacity: 0.8; }
.shop-card .sc-price { font-size: 0.62rem; color: var(--gold); font-weight: 700; }
.shop-card.cant { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; }
.shop-ready { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.btn-ready { width: 100%; padding: 14px 8px; font-size: 0.9rem; border-radius: 12px; }
.ready-hint { font-size: 0.58rem; color: var(--muted-2); text-align: center; line-height: 1.4; }

/* ───────────────── 戰鬥 ───────────────── */
.battle-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgba(120, 70, 200, 0.22), transparent 65%),
    linear-gradient(180deg, #120d28f2, #0a0718f7 70%, #0a0718);
  backdrop-filter: blur(8px);
  padding: 14px clamp(10px, 3vw, 30px) 16px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.battle-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 6px 10px; }
.battle-side { display: flex; flex-direction: column; font-size: 0.78rem; min-width: 100px; }
.battle-side.opp { text-align: right; }
.battle-side .battle-name { font-weight: 700; }
.battle-side .battle-hp { color: var(--muted); font-size: 0.7rem; }
.battle-round { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; color: var(--gold); border: 1px solid rgba(255, 193, 77, 0.3); padding: 4px 14px; border-radius: 999px; background: rgba(255, 193, 77, 0.07); }
.battlefield { position: relative; flex: 1; min-height: 300px; border-radius: 22px; border: 1px solid var(--line); background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(100, 80, 200, 0.1), transparent 70%); overflow: hidden; }
.battlefield::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 193, 77, 0.28), transparent);
}
.battlefield::after {
  content: '⌁'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: rgba(255, 193, 77, 0.35); font-size: 1.4rem;
}
.battlefield.flash { box-shadow: inset 0 0 140px rgba(196, 155, 255, 0.55); }
.battlefield.flash-soft { box-shadow: inset 0 0 90px rgba(143, 139, 255, 0.4); }
.btoken {
  position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%);
  transform: translate(-50%, -50%); width: clamp(54px, 7.2vw, 86px);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: opacity 0.3s, filter 0.3s; z-index: 2;
}
.btoken.dead { opacity: 0; filter: grayscale(1); pointer-events: none; transform: translate(-50%, -50%) scale(0.7); }
.bt-avatar {
  position: relative; width: clamp(40px, 5.4vw, 62px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  background: radial-gradient(circle at 32% 26%, var(--el, #8f8bff), rgba(8, 6, 22, 0.94) 78%);
  border: 2px solid var(--side, rgba(255, 255, 255, 0.25));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.4);
}
.btoken.side-A .bt-avatar { --side: var(--cyan); }
.btoken.side-B .bt-avatar { --side: var(--pink); }
.btoken .bt-name { font-size: 0.58rem; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.btoken .bt-stars { position: absolute; top: -5px; right: -3px; font-size: 0.5rem; color: var(--gold); text-shadow: 0 1px 2px #000; }
.btoken .bt-hp { width: 100%; height: 5px; background: rgba(0, 0, 0, 0.5); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); }
.btoken .bt-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), #d7ff9e); transition: width 0.18s linear; }
.btoken.side-B .bt-hp i { background: linear-gradient(90deg, var(--pink), #ffd1e8); }
.btoken .bt-energy { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); width: 72%; height: 3px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.btoken .bt-energy i { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--cyan), #fff); }
.btoken.hit { animation: tokenHit 0.3s; }
@keyframes tokenHit { 0%, 100% { transform: translate(-50%, -50%); } 35% { transform: translate(calc(-50% + 5px), calc(-50% - 3px)); filter: brightness(1.7); } 65% { transform: translate(calc(-50% - 4px), calc(-50% + 2px)); } }
.btoken.casting .bt-avatar { animation: castGlow 0.9s; }
@keyframes castGlow { 0% { box-shadow: 0 0 0 0 rgba(255, 193, 77, 0); } 40% { box-shadow: 0 0 0 8px rgba(255, 193, 77, 0.35), 0 0 34px rgba(255, 193, 77, 0.8); } 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); } }
.float-dmg {
  position: absolute; z-index: 5; font-weight: 700; font-size: 0.9rem; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); pointer-events: none;
  animation: floatUp 0.85s ease-out forwards;
}
.float-dmg.crit { color: var(--gold); font-size: 1.2rem; }
.float-dmg.heal { color: var(--green); }
.float-dmg.shield { color: var(--cyan); }
.float-dmg.dot { color: #c49bff; font-size: 0.78rem; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -38px) scale(1); } }
.proj {
  position: absolute; z-index: 4; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--cyan) 45%, transparent 70%);
  filter: drop-shadow(0 0 6px var(--cyan)); pointer-events: none;
  transform: translate(-50%, -50%);
}
.proj.opp { background: radial-gradient(circle, #fff, var(--pink) 45%, transparent 70%); filter: drop-shadow(0 0 6px var(--pink)); }
.ult-banner {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  z-index: 8; padding: 10px 34px; border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 193, 77, 0.22), transparent);
  border-top: 1px solid rgba(255, 193, 77, 0.6); border-bottom: 1px solid rgba(255, 193, 77, 0.6);
  font-size: clamp(0.9rem, 2.2vw, 1.45rem); font-weight: 700; letter-spacing: 0.08em;
  color: #fff4cf; text-shadow: 0 0 18px rgba(255, 193, 77, 0.9);
  animation: bannerIn 0.45s ease-out; white-space: normal; text-align: center;
  max-width: calc(100% - 24px); line-height: 1.35;
}
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -50%) scaleX(0.6); } to { opacity: 1; transform: translate(-50%, -50%) scaleX(1); } }
.battle-controls { display: flex; justify-content: center; gap: 8px; padding: 8px 0 0; }
.battle-result {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(8, 5, 20, 0.72); backdrop-filter: blur(6px); text-align: center; padding: 20px;
  animation: fadeIn 0.35s ease;
}
.result-burst {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 193, 77, 0.22), transparent 65%);
  animation: burst 1.4s ease-out forwards; pointer-events: none;
}
@keyframes burst { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.result-title { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 700; letter-spacing: 0.12em; position: relative; }
.result-title.win { color: var(--gold); text-shadow: 0 0 40px rgba(255, 193, 77, 0.5); }
.result-title.loss { color: var(--red); text-shadow: 0 0 40px rgba(255, 107, 129, 0.4); }
.result-title.draw { color: var(--cyan); }
.result-sub { margin-top: 6px; color: var(--muted); font-size: 0.9rem; position: relative; }
.result-stats { display: flex; gap: 18px; margin-top: 18px; position: relative; flex-wrap: wrap; justify-content: center; }
.result-stats div { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; font-size: 0.78rem; color: var(--muted); }
.result-stats b { color: var(--text); font-size: 1rem; display: block; }
.battle-result { overflow-y: auto; justify-content: flex-start; padding-top: 7vh; }
.battle-damage { width: min(760px, 100%); margin-top: 14px; position: relative; text-align: left; }
.battle-damage:empty { display: none; }
.battle-damage .dmg-total { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 0.76rem; color: var(--muted); margin-bottom: 8px; }
.battle-damage .dmg-total b { color: var(--text); font-size: 0.92rem; }
.battle-damage .dmg-total .mine-total b { color: var(--gold); }
.battle-damage .dmg-total .opp-total b { color: var(--pink); }
.dmg-table { width: 100%; border-collapse: collapse; font-size: 0.68rem; background: rgba(10, 7, 24, 0.55); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dmg-table th { text-align: right; font-size: 0.6rem; color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dmg-table th:nth-child(1), .dmg-table td:nth-child(1),
.dmg-table th:nth-child(2), .dmg-table td:nth-child(2) { text-align: left; }
.dmg-table td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.05); text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.dmg-table tr:last-child td { border-bottom: 0; }
.dmg-table .side-me { color: var(--gold); font-weight: 700; }
.dmg-table .side-opp { color: var(--pink); font-weight: 700; }
.dmg-table .skill-val { color: #ffd76a; }
.dmg-table .zero { color: var(--muted-2); }
.float-dmg.skill { color: var(--gold); font-size: 1.05rem; font-weight: 800; text-shadow: 0 0 12px rgba(255,193,77,.7); }
@media (max-width: 760px) {
  .battle-result { padding: 3vh 10px 20px; justify-content: flex-start; }
  .battle-damage { margin-top: 10px; }
  .dmg-table { font-size: 0.62rem; }
  .dmg-table th, .dmg-table td { padding: 4px 5px; }
}
.result-wait { margin-top: 22px; font-size: 0.74rem; color: var(--muted-2); position: relative; }

/* ───────────────── Modal / Toast / Tip ───────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(5, 3, 14, 0.7);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: min(560px, 100%); max-height: 86vh; overflow: auto;
  background: linear-gradient(180deg, #211a44, #15102f);
  border: 1px solid var(--line-strong); border-radius: 22px; padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { width: min(720px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal h2 { font-size: 1.2rem; margin-bottom: 12px; }
.modal h3 { font-size: 0.9rem; margin: 16px 0 6px; color: var(--gold); }
.modal p, .modal li { font-size: 0.82rem; color: var(--muted); line-height: 1.75; }
.modal ul { padding-left: 1.2rem; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.bottom-stats {
  position: fixed; left: 16px; bottom: 16px; z-index: 70; display: flex; gap: 10px;
  padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: rgba(18, 13, 40, .92); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(8px); font-size: .82rem;
}
.bottom-stats[hidden] { display: none; }
.bs-item { display: flex; align-items: center; gap: 4px; }
.bs-item b { color: var(--gold); font-size: .9rem; font-variant-numeric: tabular-nums; }
.intro-steps { display: grid; gap: 8px; margin: 14px 0; }
.intro-step { display: grid; grid-template-columns: 28px 1fr; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.intro-step > b { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #2a1700; font-size: .8rem; }
.intro-step h3 { margin: 0 0 3px; font-size: .88rem; color: var(--gold); }
.intro-step p { margin: 0; font-size: .76rem; line-height: 1.6; }
.intro-tip { padding: 9px 11px; border-radius: 8px; background: rgba(255,193,77,.08); border: 1px solid rgba(255,193,77,.22); font-size: .75rem; }
.modal .close-x { float: right; background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.result-modal-title { font-size: 1.8rem; text-align: center; margin-bottom: 4px; }
.result-modal-sub { text-align: center; color: var(--muted); font-size: 0.8rem; margin-bottom: 14px; }
.score-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-top: 8px; }
.score-table th, .score-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.score-table th { color: var(--muted); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.06em; }
.score-table td:first-child { text-align: left; font-weight: 700; }
.toast-root { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 9px 18px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: rgba(24, 18, 48, 0.95); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); animation: toastIn 0.25s ease, toastOut 0.3s ease 2.4s forwards;
}
.toast.err { border-color: rgba(255, 107, 129, 0.5); color: #ffd0d7; }
.toast.ok { border-color: rgba(111, 220, 140, 0.5); color: #d8ffe2; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
.tip {
  position: fixed; z-index: 400; max-width: 280px; pointer-events: none;
  background: rgba(16, 12, 34, 0.97); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 12px; font-size: 0.7rem; color: var(--muted);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); line-height: 1.55;
}
.tip b { color: var(--text); }
.tip .tip-title { font-size: 0.8rem; font-weight: 700; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.tip .tip-row { display: flex; justify-content: space-between; gap: 12px; }
.tip .tip-row b { color: var(--text); }
.tip .tip-traits { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tip .tip-traits span { border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; font-size: 0.6rem; }
.tip .tip-active { color: var(--gold); }

/* ───────────────── 頁尾 ───────────────── */
.cw-footer {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 22px 4px 0; color: var(--muted-2); font-size: 0.68rem;
}
.cw-footer a { color: var(--muted); text-decoration: none; }
.cw-footer a:hover { color: var(--gold); }

/* ───────────────── 牌位 ───────────────── */
.rank-card {
  display: flex; align-items: center; gap: 12px;
  max-width: 760px; margin: 2.2vh auto 0; padding: 10px 16px;
  background: linear-gradient(120deg, rgba(255, 193, 77, 0.1), rgba(167, 139, 250, 0.08));
  border: 1px solid rgba(255, 193, 77, 0.26); border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.rank-badge {
  min-width: 52px; width: auto; height: 52px; flex: none; padding: 0 8px;
  border-radius: 15px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.02rem; line-height: 1; text-align: center;
  font-variant-numeric: tabular-nums; color: #2a1700; letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffe9a8, var(--gold) 55%, var(--gold-2));
  border: 1px solid rgba(255, 236, 180, 0.9);
  box-shadow: 0 6px 18px rgba(255, 170, 40, 0.25);
}
.rank-info { display: flex; flex-direction: column; gap: 1px; min-width: 128px; }
.rank-info b { font-size: 0.86rem; }
.rank-info span { font-size: 0.66rem; color: var(--muted); }
.rank-progress { flex: 1; height: 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); overflow: hidden; border: 1px solid var(--line); }
.rank-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width 0.5s; }
.rank-card .btn { flex: none; }
.rank-guest { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.rank-guest .guest-icon { font-size: 1.3rem; }
.rank-guest b { display: block; font-size: 0.82rem; }
.rank-guest span { display: block; font-size: 0.64rem; color: var(--muted); }
.rank-card.guest .rank-badge,
.rank-card.guest .rank-info,
.rank-card.guest .rank-progress { display: none; }
.rank-card.guest .rank-guest { display: flex; }
.rank-card.account .rank-guest { display: none; }
.rank-card.account .rank-badge { display: inline-flex; }
.rank-card.account .rank-info { display: flex; }
.rank-card.account .rank-progress { display: block; }

/* 登入 / 註冊 */
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.auth-tabs button {
  flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--muted);
  font-family: inherit; font-weight: 700; font-size: 0.78rem; cursor: pointer;
}
.auth-tabs button.on { color: #2a1700; background: var(--gold); border-color: var(--gold); }
.auth-form { display: flex; flex-direction: column; gap: 9px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.auth-form input { font-size: 0.9rem; }
.auth-error { min-height: 1.1em; margin: 4px 0; font-size: 0.7rem; color: var(--red); }
.auth-note { font-size: 0.66rem; color: var(--muted-2); line-height: 1.5; }
.lobby-tools { max-width: 760px; margin: 10px auto 0; display: flex; justify-content: flex-end; }
.pool-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 10px; }
.pool-controls input { max-width: 220px; }
.pool-cost { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-family: inherit; font-weight: 700; font-size: .7rem; cursor: pointer; }
.pool-cost.on { background: var(--gold); border-color: var(--gold); color: #2a1700; }
.pool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pool-card { border: 1px solid var(--line); border-radius: 12px; padding: 9px; background: rgba(255,255,255,.035); min-width: 0; }
.pool-card.compact { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 11px; transition: border-color .15s, background .15s; }
.pool-card.compact:hover { border-color: var(--gold); background: rgba(255,193,77,.08); }
.pool-card .pc-open { display: block; margin-top: 6px; font-size: .62rem; color: var(--gold); }
.bond-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.bond-guide-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(255,255,255,.035); }
.bg-head { display: flex; align-items: center; gap: 6px; }
.bg-head .bg-icon { font-size: 1.15rem; }
.bg-head b { font-size: .9rem; }
.bg-group { margin-left: auto; font-size: .58rem; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.bg-group.faction { color: #8fd8ff; } .bg-group.path { color: #ffd76a; } .bg-group.exclusive { color: #ff9ed2; }
.bg-thresholds { display: flex; gap: 4px; align-items: center; margin: 7px 0; flex-wrap: wrap; }
.bg-thresholds i { font-style: normal; font-size: .58rem; padding: 1px 5px; border-radius: 4px; background: rgba(255,193,77,.12); color: var(--gold); }
.bg-thresholds em { font-style: normal; font-size: .55rem; color: var(--muted); }
.bg-effects { display: grid; gap: 3px; }
.bg-effect { display: grid; grid-template-columns: 44px 1fr; gap: 5px; font-size: .65rem; line-height: 1.5; }
.bg-effect b { color: var(--gold); font-weight: 600; }
.bg-effect span { color: var(--muted); }
.bg-members { margin-top: 7px; font-size: .6rem; color: var(--muted-2); line-height: 1.6; }
.bg-members b { color: var(--muted); margin-right: 3px; }
.bg-members span { display: inline-block; margin-right: 3px; }
.pool-detail-head { display: flex; align-items: center; gap: 12px; }
.pool-detail-head h2 { margin: 0 0 3px; }
.pool-detail-head p { margin: 0; color: var(--muted); }
.pool-detail-head .pd-emoji { font-size: 2.4rem; }
.pd-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pd-trait { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: .72rem; }
.pd-trait b { display: block; color: var(--gold); }
.pd-trait span { color: var(--muted); font-size: .65rem; }
.pd-stars { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-star { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: .68rem; color: var(--muted); }
.pd-star span { color: var(--gold); font-weight: 700; margin-right: 4px; }
.pd-star b { color: var(--text); }
.pd-skill { border-top: 1px solid var(--line); padding: 8px 0; font-size: .75rem; }
.pd-skill b { display: inline-block; min-width: 48px; color: var(--gold); }
.pd-skill span { font-weight: 700; }
.pd-skill p { margin: 4px 0 0; color: var(--muted-2); line-height: 1.55; font-size: .7rem; }
.pool-card .pc-head { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.pool-card .pc-cost { font-size: .6rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; color: #1a1020; background: var(--c, var(--gold)); }
.pool-card .pc-pos { font-size: .58rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; }
.pool-card .pc-special { margin-left: auto; font-size: .55rem; color: #ff9ed2; border: 1px solid rgba(255,158,210,.4); border-radius: 999px; padding: 1px 5px; }
.pool-card .pc-name { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.pool-card .pc-name span { font-size: 1.3rem; }
.pool-card .pc-traits { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.pool-card .pc-trait { font-size: .62rem; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.06); color: var(--muted); }
.pool-card .pc-trait.faction { color: #8fd8ff; background: rgba(143,216,255,.1); }
.pool-card .pc-trait.path { color: #ffd76a; background: rgba(255,215,106,.1); }
.pool-card .pc-trait.exclusive { color: #ff9ed2; background: rgba(255,158,210,.1); }
.pool-card .pc-trait em { font-style: normal; opacity: .72; font-size: .5rem; margin-left: 2px; }
.pool-card .pc-stats { font-size: .58rem; color: var(--muted); line-height: 1.5; }
.pool-card .pc-growth { font-size: .55rem; color: #8fd8ff; margin-top: 2px; line-height: 1.4; }
.pool-card .pc-skill { font-size: .58rem; color: var(--muted-2); margin-top: 4px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pool-count { font-size: .68rem; color: var(--muted); margin-left: auto; }
@media (max-width: 760px) {
  .pool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bond-guide-grid { grid-template-columns: 1fr; }
  .lobby-tools { justify-content: center; }
}
@media (max-width: 460px) { .pool-grid { grid-template-columns: 1fr; } }
.join-gate-code { color: var(--gold); letter-spacing: 0.12em; font-size: 1rem; }
.join-gate-form { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.join-gate-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.join-gate-form .hint { margin: 2px 0 0; }
.profile-summary { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: rgba(255, 193, 77, 0.08); border: 1px solid rgba(255, 193, 77, 0.25); margin-bottom: 12px; }
.profile-summary .rank-badge { min-width: 48px; width: auto; height: 48px; padding: 0 7px; font-size: 0.92rem; }
.profile-summary b { display: block; font-size: 0.9rem; }
.profile-summary span { font-size: 0.7rem; color: var(--muted); }
.hud-rank {
  font-size: 0.58rem; font-weight: 700; color: #2a1700;
  background: var(--gold); border-radius: 6px; padding: 1px 5px;
  letter-spacing: 0.04em;
}

/* ───────────────── 資源列 ───────────────── */
.resource-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px; margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(255, 193, 77, 0.11), rgba(127, 220, 255, 0.06));
  border: 1px solid rgba(255, 193, 77, 0.24); border-radius: 14px;
  font-size: 0.76rem; color: var(--muted);
}
.rs-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.rs-item b { color: var(--text); font-size: 0.92rem; }
.rs-item.gold b { color: var(--gold); font-size: 1.15rem; }
.rs-item.rank { color: var(--gold); font-weight: 700; }
.rs-xp {
  flex: 0 1 230px; min-width: 120px; height: 11px; position: relative;
  border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; border: 1px solid var(--line);
}
.rs-item.rank { margin-left: auto; }
.rs-xp div { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--purple)); transition: width 0.4s; }
.rs-xp span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 0.55rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000;
}

/* ───────────────── 玩家名單 ───────────────── */
.roster { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 3px; margin-bottom: 8px; }
.roster::-webkit-scrollbar { height: 4px; }
.roster::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }
.roster-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  font-size: 0.68rem; color: var(--muted);
}
.roster-chip { cursor: pointer; }
.roster-chip:hover { border-color: var(--gold); background: rgba(255,193,77,.10); }
.player-board-preview { margin: 12px 0; max-width: 100%; overflow: auto; }
.roster-chip b { color: var(--text); font-weight: 700; }
.roster-chip.me { border-color: var(--cyan); background: rgba(127, 220, 255, 0.08); }
.roster-chip.opp { border-color: var(--pink); background: rgba(255, 158, 210, 0.09); box-shadow: 0 0 0 1px rgba(255, 158, 210, 0.2); }
.roster-chip.dead { opacity: 0.4; }
.roster-chip.dead b { text-decoration: line-through; }
.roster-chip .rc-hp { width: 42px; height: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.roster-chip .rc-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff5d7a, #ff9ed2); }
.roster-chip.opp .rc-hp i { background: linear-gradient(90deg, #a78bfa, #7fdcff); }
.roster-chip .rc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.roster-chip.offline .rc-dot { background: var(--muted-2); }

/* ───────────────── 淘汰 / PvE ───────────────── */
.eliminated-banner {
  padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; text-align: center;
  font-size: 0.8rem; font-weight: 700; color: #ffd0d7;
  background: rgba(255, 107, 129, 0.12); border: 1px solid rgba(255, 107, 129, 0.45);
}
.pve-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.6rem; font-weight: 700; color: #2a1700;
  background: linear-gradient(135deg, #ffe08a, var(--gold)); border-radius: 999px; padding: 1px 8px;
}

/* ───────────────── 賣出區 / 裝備 ───────────────── */
.sell-zone {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 4px; border-radius: 10px; cursor: pointer;
  border: 1px dashed rgba(255, 107, 129, 0.5);
  background: rgba(255, 107, 129, 0.05);
  color: #ffc7d2; font-size: 0.64rem; font-weight: 600; line-height: 1.2; text-align: center;
}
.sell-zone .sell-icon { font-size: 1rem; }
.sell-zone:hover, .sell-zone.drop-ok {
  border-color: var(--red); color: #ffd0d7; background: rgba(255, 107, 129, 0.14);
}
.item-bench .item-chip {
  padding: 6px 9px; font-size: 0.72rem;
  border-color: rgba(255, 193, 77, 0.3); background: rgba(255, 193, 77, 0.06);
}
.item-bench .item-chip .ic { font-size: 1rem; }
.du-actions .btn-sell {
  background: linear-gradient(135deg, #ff9ead, #ff5d7a); color: #2a0008;
  border-color: #ffc0cb; font-weight: 700;
}

/* ───────────────── 排名結算 ───────────────── */
.rank-result {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
  font-size: 0.78rem; color: var(--muted);
  background: rgba(255, 193, 77, 0.08); border: 1px solid rgba(255, 193, 77, 0.3);
}
.rank-result b { color: var(--gold); }
.rank-result .delta-up { color: var(--green); font-weight: 700; }
.rank-result .delta-down { color: var(--red); font-weight: 700; }

/* ───────────────── 響應式 ───────────────── */
@media (max-width: 1120px) {
  .game-grid { grid-template-columns: 190px minmax(0, 1fr) 200px; }
  .rail { max-height: 510px; }
  .shop-bar { grid-template-columns: 190px minmax(0, 1fr) 132px; }
}
@media (max-width: 940px) {
  .cw-shell { padding: 0 10px 18px; }
  .cw-header { flex-wrap: wrap; gap: 10px; }
  .cw-nav { order: 3; width: 100%; justify-content: center; }
  .conn-pill { margin-left: auto; }
  .lobby-actions { flex-direction: column; align-items: stretch; }
  .field { max-width: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .rail { max-height: none; }
  .rail-left { order: 1; }
  .board-wrap { order: 2; }
  .rail-right { order: 3; }
  .trait-list { flex-direction: row; flex-wrap: wrap; }
  .trait { flex: 1 1 44%; }
  .view.game { padding-bottom: 200px; }
  .shop-bar {
    display: flex; flex-wrap: wrap; gap: 6px;
    position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 45;
    grid-template-columns: none;
    padding: 8px;
    background: rgba(20, 15, 44, 0.97);
    border-color: rgba(255, 193, 77, 0.28);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
  }
  .shop { order: 1; flex: 1 1 100%; gap: 5px; }
  .shop-card { min-height: 60px; padding: 4px 3px 3px; }
  .shop-card .sc-avatar { width: 26px; font-size: 0.85rem; margin-top: 1px; }
  .shop-card .sc-name { font-size: 0.6rem; }
  .shop-card .sc-price { font-size: 0.54rem; }
  .shop-card .sc-traits { display: none; }
  .shop-side { order: 2; flex: 1 1 auto; flex-direction: row; align-items: center; gap: 6px; }
  .shop-level, .xp-track, .odds-line { display: none; }
  .shop-actions { flex: 1 1 auto; grid-template-columns: repeat(3, 1fr); }
  .shop-actions .btn-mini { padding: 5px 3px; font-size: 0.68rem; }
  .shop-ready { order: 3; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; }
  .ready-hint { display: none; }
  .btn-ready { padding: 8px 12px; font-size: 0.76rem; }
  .sell-zone { display: none; }
  .rank-card { flex-wrap: wrap; margin-top: 1.2vh; }
  .rank-progress { flex-basis: 100%; order: 5; }
  .resource-strip { gap: 8px; font-size: 0.7rem; padding: 7px 10px; }
  .rs-xp { flex-basis: 100%; order: 6; }
  .roster { margin-bottom: 6px; }
  .room-players { grid-template-columns: 1fr; }
  .howto-strip { grid-template-columns: 1fr; }
  .hud { grid-template-columns: 1fr auto; }
  .hud-center { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 14px; }
  .hud-center .timer { font-size: 1.4rem; }
  .battlefield { min-height: 46vh; }
}
@media (max-width: 620px) {
  .cw-brand-text { font-size: 0.92rem; }
  .cw-brand-text em { display: none; }
  .lobby-hero h1 { font-size: 2.5rem; }
  .lobby-actions { padding: 16px; margin-top: 2vh; }
  .room-card { padding: 18px; }
  .room-head { flex-direction: column; }
  .room-actions { justify-content: flex-start; }
  .hud { padding: 10px; gap: 8px; }
  .hud-avatar { width: 36px; height: 36px; }
  .hud-res { gap: 7px; font-size: 0.62rem; }
  .board { gap: 3px; }
  .board .slot { border-radius: 8px; }
  .ucard { border-radius: 8px; padding: 3px 2px 2px; }
  .ucard .u-name { font-size: 0.52rem; }
  .ucard .u-avatar { max-width: 32px; }
  .resource-strip { gap: 6px; font-size: 0.66rem; }
  .rs-item.gold b { font-size: 1rem; }
  .roster-chip { font-size: 0.6rem; padding: 4px 8px; }
  .roster-chip .rc-hp { width: 30px; }
  .rank-card { padding: 8px 12px; }
  .rank-badge { width: 44px; height: 44px; font-size: 0.95rem; }
  .ucard .u-pos { font-size: 0.4rem; padding: 0 2px; }
  .board-wrap { padding: 8px; }
  .bench { gap: 3px; }
  .shop { gap: 5px; }
  .shop-card { min-height: 58px; padding: 3px 2px 2px; }
  .shop-card .sc-name { font-size: 0.58rem; }
  .shop-card .sc-traits { display: none; }
  .shop-card .sc-price { font-size: 0.54rem; }
  .shop-bar { padding: 8px; }
  .rail { padding: 9px; }
  .battle-top { padding: 2px 0 6px; }
  .btoken { width: 46px; }
  .btoken .bt-name { font-size: 0.48rem; }
  .btoken .bt-avatar { width: 36px; }
  .bt-avatar { font-size: 1rem; }
  .cw-footer { font-size: 0.62rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
