/* ============================================================================
 * 三國天命 v4.0 — 暗黑風格介面佈局 (v4.css)
 * 佈局：左上角色資訊＋Buff 列｜右上雷達｜左側功能列｜右下攻擊技能盤｜下方快捷欄＋經驗條＋主選單
 * 全設備自適應：桌機橫向 / 手機直向 / 手機橫向
 * ========================================================================== */
:root {
  --g1: #dcd3b7; --g2: #f5cc5c; --g3: #e6ad0f; --g4: #314678;
  --ink: #18223a; --panel: rgba(25, 36, 61, 0.86); --panel2: rgba(30, 43, 74, 0.92);
  --line: rgba(243, 194, 60, 0.55); --line2: rgba(243, 194, 60, 0.25);
  --txt: #f0ebdf; --dim: #bbc3d3; --hp: #b3201c; --hp2: #e8443a; --mp: #1d4fb8; --mp2: #4c8cff;
  --nav-h: 58px; --qb-s: 46px; --exp-h: 6px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  --font: "Noto Serif TC", "PMingLiU", "Songti TC", "Microsoft JhengHei", serif;
}
html, body { background: #141d32 !important; font-family: var(--font); }
img { -webkit-user-drag: none; }

/* ---------- 通用面板 / 按鈕 ---------- */
.v4-panel, #radar-panel #minimap-box, #quick-bar, #bottom-nav, #left-dock, .pl-plate, #live-ticker-box {
  background: linear-gradient(180deg, rgba(31, 45, 77, 0.9), rgba(23, 32, 55, 0.94));
  border: 1px solid var(--line);
  box-shadow: 0 3px 12px rgba(18, 25, 43, 0.75), inset 0 0 0 1px rgba(18, 25, 43, 0.7), inset 0 1px 0 rgba(231, 224, 205, 0.08);
}
.v4-btn {
  font-family: var(--font); font-size: 12.5px; font-weight: 700; color: var(--txt); cursor: pointer;
  padding: 6px 12px; border-radius: 3px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #304475 0%, #212f50 55%, #1b2742 100%);
  box-shadow: inset 0 1px 0 rgba(234, 228, 212, 0.15), 0 2px 4px rgba(18, 25, 43, 0.6);
  text-shadow: 0 1px 2px #12192b; transition: filter .12s, transform .08s; white-space: nowrap;
}
.v4-btn:hover { filter: brightness(1.2); }
.v4-btn:active { transform: translateY(1px); }
.v4-btn:disabled { opacity: .45; cursor: default; filter: none; }
.v4-btn small { display: block; font-size: 10px; color: var(--dim); font-weight: 400; }
.v4-btn.gold { background: linear-gradient(180deg, #e6ad0f 0%, #364e84 50%, #26375d 100%); border-color: #f5cc5c; color: #faf8f4; }
.v4-btn.red { background: linear-gradient(180deg, #8a2a22 0%, #561812 55%, #2e0b08 100%); border-color: #d06a5a; }
.v4-btn.big { font-size: 16px; padding: 12px 26px; letter-spacing: 2px; }
.v4-btn.ghost { background: transparent; border-color: transparent; color: var(--dim); box-shadow: none; }
.v4-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.v4-tab { font-family: var(--font); font-size: 12px; color: var(--dim); padding: 5px 12px; cursor: pointer; border: 1px solid var(--line2); background: rgba(18, 25, 43, 0.35); border-radius: 2px; }
.v4-tab.active { color: #f7f5ef; border-color: var(--g2); background: linear-gradient(180deg, #32487b, #212f51); }
.v4-note { margin-top: 8px; font-size: 11px; color: var(--dim); padding: 8px 10px; border-left: 2px solid var(--g3); background: rgba(18, 25, 43, 0.3); }

/* ---------- 頂部：角色資訊 ---------- */
body #top-bar {
  position: fixed; top: 6px; left: 6px; right: auto; height: auto; width: auto;
  background: none !important; border: none !important; box-shadow: none !important;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; z-index: 30; pointer-events: none;
}
#top-bar > * { pointer-events: auto; }
.pl-plate { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 40px 6px 6px 40px; min-width: 250px; }
.pl-face-wrap { position: relative; width: 58px; height: 58px; flex-shrink: 0; cursor: pointer; }
.pl-face { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 2px solid var(--g2);
  box-shadow: 0 0 0 2px #12192b, 0 0 10px rgba(245, 204, 92, 0.35); background: #1f2d4c; }
.pl-level { position: absolute; left: -2px; bottom: -2px; min-width: 24px; height: 20px; padding: 0 4px; border-radius: 10px;
  background: linear-gradient(180deg, #3b5591, #e6ad0f); border: 1px solid var(--g1); color: #f9f8f3; font-size: 12px; font-weight: 900; text-align: center; line-height: 18px; text-shadow: 0 1px 2px #12192b; }
body .class-crest { position: absolute; right: -4px; bottom: -2px; width: 20px !important; height: 20px !important; font-size: 11px !important; border-radius: 50% !important; border-width: 1px !important; }
.pl-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pl-row1 { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
body .nation-crest-btn { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 2px; border-radius: 10px; background: rgba(18, 25, 43, 0.45); border: 1px solid var(--line2); cursor: pointer; height: auto; }
body .nation-crest-btn .n-txt { font-size: 11px; font-weight: 900; }
body .player-name { font-size: 14px; font-weight: 900; color: #f2eee4; text-shadow: 0 1px 3px #12192b; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.pl-bar { position: relative; height: 13px; border-radius: 2px; background: #1b2641; border: 1px solid rgba(18, 25, 43, 0.9); box-shadow: inset 0 1px 3px #12192b, 0 0 0 1px rgba(241, 186, 35, 0.3); overflow: hidden; }
.pl-bar.mp { height: 9px; }
body .pl-bar .bar-fill-hp, body .pl-bar .bar-fill-mp { position: absolute; left: 0; top: 0; bottom: 0; transition: width .25s; }
body .pl-bar .bar-fill-hp { background: linear-gradient(180deg, #f0645a 0%, #b8231c 45%, #6e0e0b 100%); }
body .pl-bar .bar-fill-mp { background: linear-gradient(180deg, #6aa6ff 0%, #2357c8 45%, #0f2a6e 100%); }
body .pl-bar .bar-text { position: absolute; inset: 0; font-size: 10px; line-height: 13px; text-align: center; color: #faf9f5; text-shadow: 0 0 2px #12192b, 0 1px 2px #12192b; font-family: Arial, sans-serif; font-weight: 700; }
.pl-bar.mp .bar-text { line-height: 9px; font-size: 8.5px; }
.pl-row3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; white-space: nowrap; }
body .combat-power { color: #f5cc5c; font-weight: 900; font-size: 11px; }
body .adena-inline { display: inline-flex; align-items: center; gap: 3px; color: #e7e1ce; font-size: 11px; font-weight: 700; }
.adena-inline .merit { color: #93c5fd; margin-left: 4px; }

/* ---------- Buff 列 (玩家資訊下方一排) ---------- */
#buff-bar { display: flex; flex-wrap: wrap; gap: 3px; max-width: 300px; padding-left: 4px; min-height: 24px; }
#buff-bar .buff { position: relative; width: 26px; height: 26px; border-radius: 3px; border: 1px solid var(--line); background: #18233c; box-shadow: 0 1px 3px #12192b; }
#buff-bar .buff img { width: 100%; height: 100%; border-radius: 2px; }
#buff-bar .buff span { position: absolute; left: -2px; right: -2px; bottom: -3px; font-size: 8.5px; line-height: 10px; text-align: center; color: #faf9f5; text-shadow: 0 0 2px #12192b, 0 0 2px #12192b; font-family: Arial, sans-serif; font-weight: 700; white-space: nowrap; overflow: hidden; }
#buff-bar .buff.safe { border-color: #86efac; }
#buff-bar .buff.morph { border-color: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.6); }

/* ---------- 右上：雷達 ---------- */
#radar-panel { position: fixed; top: 6px; right: 6px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; width: 170px; }
#radar-panel #minimap-box { position: relative; width: 170px; height: 170px; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer; border: 2px solid var(--g3); }
#radar-panel #minimap-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border-radius: 50%; display: block; }
#radar-panel .radar-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(18, 25, 43, 0.9), inset 0 0 0 5px rgba(245, 204, 92, 0.55), inset 0 0 18px rgba(18, 25, 43, 0.9); }
#radar-panel .minimap-hdr { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none;
  font-size: 10.5px; color: #eae4d3; text-shadow: 0 0 3px #12192b, 0 1px 2px #12192b; white-space: nowrap; background: none !important; border: none !important; padding: 0 !important; }
#radar-panel .minimap-hdr #ui-coords-text { font-size: 9.5px; color: #f5cc5c; font-family: Arial, sans-serif; }
.radar-map-btn { position: absolute; top: 10px; right: 14px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--g2); background: rgba(18, 25, 43, 0.6); padding: 2px; cursor: pointer; }
.radar-map-btn img { width: 100%; height: 100%; }
body #world-boss-pill { position: static; display: flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 11px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(80, 16, 12, 0.85), rgba(30, 6, 4, 0.9)); border: 1px solid rgba(220, 90, 70, 0.6); color: #fecaca; white-space: nowrap; }
body #zoom-control-pill { position: static; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 12px; background: rgba(18, 25, 43, 0.55); border: 1px solid var(--line2); flex-direction: row; width: auto; }
#zoom-control-pill .zoom-step-btn { width: 24px; height: 22px; border-radius: 11px; border: 1px solid var(--line2); background: #1f2d4c; color: var(--g1); cursor: pointer; font-weight: 900; }
#zoom-control-pill #ui-zoom-val { font-size: 10.5px; color: var(--txt); min-width: 40px; text-align: center; cursor: pointer; font-family: Arial, sans-serif; }

/* ---------- 左側功能列 (由右側移至左側) ---------- */
#left-dock { position: fixed; left: 6px; top: 128px; z-index: 25; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px; border-radius: 6px; }
#left-dock .dock-collapse-btn { font-family: var(--font); font-size: 10px; color: var(--g1); background: rgba(18, 25, 43, 0.5); border: 1px solid var(--line2); border-radius: 3px; cursor: pointer; padding: 2px 0; }
#left-dock #right-dock-items { display: flex; flex-direction: column; gap: 3px; }
#left-dock #right-dock-items.collapsed { display: none; }
#left-dock .dock-sq-item { position: relative; width: 46px; height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  border-radius: 4px; border: 1px solid var(--line2); background: radial-gradient(circle at 50% 35%, #293a64, #18233c 80%); transition: filter .12s; }
#left-dock .dock-sq-item:hover { filter: brightness(1.3); border-color: var(--g2); }
#left-dock .dock-sq-item .dark-ico { width: 28px; height: 28px; }
#left-dock .dock-sq-item .txt { font-size: 9.5px; color: var(--txt); line-height: 1; text-shadow: 0 1px 2px #12192b; }
#left-dock .dock-badge { position: absolute; top: -4px; right: -6px; font-size: 8px; padding: 0 3px; border-radius: 6px; background: #8a1c14; color: #faf9f5; border: 1px solid #e0786a; }

/* ---------- 戰場情報 ---------- */
body #bottom-strip-container { position: fixed; left: 150px; bottom: calc(var(--nav-h) + var(--exp-h) + var(--safe-b) + 8px); width: min(380px, 34vw); z-index: 22; display: block; background: none; border: none; padding: 0; }
body #live-ticker-box { border-radius: 4px; padding: 0; width: 100%; }
body #live-ticker-box .ticker-header { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
body #live-ticker-box .ticker-tag { font-size: 10px; padding: 1px 5px; border-radius: 2px; background: #4a1a12; color: #fccf54; border: 1px solid #8a3a2a; flex-shrink: 0; }
body #live-ticker-box #ticker-latest { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ebe5d5; }
body #ticker-history { max-height: 0; overflow: hidden; transition: max-height .2s; font-size: 10.5px; color: #f5cc5c; }
body #ticker-history.expanded { max-height: 160px; overflow-y: auto; padding: 4px 8px; border-top: 1px solid var(--line2); }
body #ticker-history div { padding: 1px 0; border-bottom: 1px dashed rgba(241, 186, 35, 0.12); }

/* ---------- 快捷欄 + 經驗條 ---------- */
#quick-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--exp-h) + var(--safe-b) + 6px); z-index: 24;
  display: flex; gap: 4px; padding: 4px; border-radius: 6px; }
.qb-slot { position: relative; width: var(--qb-s); height: var(--qb-s); border-radius: 4px; cursor: pointer; border: 1px solid var(--line2); background: #18223a; }
.qb-slot img { width: 100%; height: 100%; border-radius: 3px; }
.qb-slot:hover { border-color: var(--g2); }
.qb-slot.active { box-shadow: 0 0 8px rgba(74, 222, 128, 0.7); border-color: #86efac; }
.qb-n { position: absolute; right: 2px; bottom: 0; font-size: 10.5px; font-weight: 900; color: #faf9f5; text-shadow: 0 0 2px #12192b, 0 0 3px #12192b; font-family: Arial, sans-serif; }
.qb-k { position: absolute; left: 2px; top: 0; font-size: 8.5px; color: #e0d8bf; text-shadow: 0 0 2px #12192b; font-family: Arial, sans-serif; }
#exp-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); height: var(--exp-h); z-index: 26; background: #172138; border-top: 1px solid rgba(241, 186, 35, 0.45); }
#ui-exp-fill { height: 100%; width: 0; background: linear-gradient(180deg, #eae4d4, #f4ca57 50%, #e6ad0f); box-shadow: 0 0 6px rgba(245, 204, 92, 0.6); transition: width .4s; }
#ui-exp-text { position: absolute; right: 8px; top: -14px; font-size: 9.5px; color: #e7e1ce; text-shadow: 0 0 3px #12192b; font-family: Arial, sans-serif; }

/* ---------- 右下：攻擊與技能盤 ---------- */
#action-cluster { position: fixed; right: 10px; bottom: calc(var(--nav-h) + var(--exp-h) + var(--safe-b) + 10px); width: 232px; height: 200px; z-index: 24; pointer-events: none; }
#action-cluster > * { pointer-events: auto; }
#btn-attack { position: absolute; right: 4px; bottom: 4px; width: 92px; height: 92px; border-radius: 50%; padding: 0; cursor: pointer; border: 2px solid #f2c035;
  background: radial-gradient(circle at 45% 35%, #4a1410, #12060a 70%); box-shadow: 0 0 0 3px #12192b, 0 0 16px rgba(220, 60, 40, 0.45), inset 0 0 14px #12192b; }
#btn-attack img { width: 100%; height: 100%; border-radius: 50%; }
#btn-attack:active { transform: scale(0.95); }
body #skill-hotkey-drawer { position: absolute !important; inset: 0 !important; display: block !important; background: none !important; border: none !important; box-shadow: none !important; padding: 0 !important; width: auto !important; height: auto !important; max-width: none !important; pointer-events: none; }
body #skill-hotkey-drawer .hk-slot { position: absolute; width: 52px; height: 52px; min-width: 0; border-radius: 50%; padding: 0; pointer-events: auto; cursor: pointer;
  border: 2px solid #e6ad0f; background: #18223a; box-shadow: 0 0 0 2px #12192b, 0 2px 8px rgba(18, 25, 43, 0.8); overflow: visible; display: block; }
body #skill-hotkey-drawer .hk-slot img.dark-ico { width: 100%; height: 100%; border-radius: 50%; display: block; }
body #skill-hotkey-drawer .hk-slot .key { position: absolute; left: 50%; transform: translateX(-50%); bottom: -9px; font-size: 8.5px; background: rgba(18, 25, 43, 0.8); color: #e0d8bf; padding: 0 3px; border-radius: 3px; border: 1px solid var(--line2); top: auto; right: auto; font-family: Arial, sans-serif; }
body #skill-hotkey-drawer .hk-slot .s-name { display: none; }
body #skill-hotkey-drawer .hk-slot .hk-auto-tag { position: absolute; top: -4px; right: -6px; left: auto; font-size: 7.5px; padding: 0 2px; border-radius: 3px; background: #14532d; color: #bbf7d0; border: 1px solid #22c55e; }
body #skill-hotkey-drawer .hk-slot .hk-cd-mask { position: absolute; inset: 0; border-radius: 50%; background: rgba(18, 25, 43, 0.7); color: #faf9f5; font-size: 12px; font-weight: 900; display: none; align-items: center; justify-content: center; font-family: Arial, sans-serif; }
body #skill-hotkey-drawer .hk-slot.auto-on { border-color: #4ade80; }
#hk-slot-SKILL_SONIC_BLADE { right: 104px; bottom: 6px; }
#hk-slot-SKILL_SHOCK_STUN { right: 98px; bottom: 66px; }
#hk-slot-SKILL_TRIPLE_ARROW { right: 58px; bottom: 112px; }
#hk-slot-SKILL_THUNDER_BOLT { right: 2px; bottom: 128px; }
#hk-slot-SKILL_HEAL_SELF { right: 158px; bottom: 34px; width: 44px !important; height: 44px !important; }
#hk-slot-SKILL_SOVEREIGN_DECREE { right: 150px; bottom: 94px; width: 44px !important; height: 44px !important; }
body #action-cluster #nav-hunt { position: absolute; right: 168px; bottom: 150px; width: 50px; height: 50px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid #4a5a3a; background: #18223a; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #12192b; }
body #action-cluster #nav-hunt img { width: 100%; height: 100%; border-radius: 50%; position: absolute; inset: 0; opacity: .85; }
body #action-cluster #nav-hunt #nav-hunt-label { position: absolute; bottom: -12px; font-size: 9px; color: #bbf7d0; text-shadow: 0 0 3px #12192b; white-space: nowrap; }
body #action-cluster #nav-hunt.active { border-color: #4ade80; box-shadow: 0 0 0 2px #12192b, 0 0 12px rgba(74, 222, 128, 0.7); animation: v4pulse 1.6s infinite; }
@keyframes v4pulse { 50% { box-shadow: 0 0 0 2px #12192b, 0 0 20px rgba(74, 222, 128, 0.95); } }

/* ---------- 搖桿 ---------- */
body #joystick-zone { left: 18px; bottom: calc(var(--nav-h) + var(--exp-h) + var(--safe-b) + 18px); width: 118px; height: 118px; z-index: 23;
  background: radial-gradient(circle, rgba(33, 47, 81, 0.55), rgba(22, 31, 54, 0.75)); border: 2px solid rgba(241, 186, 35, 0.45); }

/* ---------- 下方主選單 ---------- */
body #bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); z-index: 27;
  display: flex; justify-content: center; align-items: stretch; gap: 0; border-radius: 0; border-left: none; border-right: none; border-bottom: none;
  background: linear-gradient(180deg, rgba(33, 47, 81, 0.97), rgba(22, 31, 54, 0.99)); }
body #bottom-nav .nav-medallion { flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 3px 0; position: relative; }
body #bottom-nav .nav-medallion + .nav-medallion::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(180deg, transparent, var(--line2), transparent); }
body #bottom-nav .nav-circle { width: 36px; height: 36px; border-radius: 6px; border: none; background: none; box-shadow: none; display: flex; align-items: center; justify-content: center; }
body #bottom-nav .nav-circle img { width: 34px; height: 34px; }
body #bottom-nav .nav-label { font-size: 11px; color: var(--txt); text-shadow: 0 1px 2px #12192b; letter-spacing: 1px; }
body #bottom-nav .nav-medallion:hover .nav-label { color: #f7f5ef; }
body #bottom-nav .nav-medallion:hover .nav-circle img { filter: brightness(1.25) drop-shadow(0 0 4px rgba(233, 207, 140, 0.6)); }

/* ---------- 目標框 / 廣播 / 橫幅 ---------- */
body #target-lock-hud { top: 8px; left: 50%; transform: translateX(-50%); width: min(340px, 42vw); z-index: 29; }
body #world-boss-broadcast { top: 74px; z-index: 31; }
body #epic-banner { z-index: 40; top: 22% !important; }

/* ---------- 死亡畫面 ---------- */
#death-overlay { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(60, 0, 0, 0.55), rgba(18, 25, 43, 0.88)); }
#death-overlay.open { display: flex; }
.death-box { text-align: center; padding: 26px 36px; border: 1px solid #7a2a20; background: rgba(10, 4, 3, 0.85); box-shadow: 0 0 40px rgba(160, 20, 10, 0.4); }
.death-title { font-size: 42px; letter-spacing: 18px; color: #e74c3c; text-shadow: 0 0 20px rgba(200, 30, 20, 0.8), 0 2px 4px #12192b; margin-bottom: 8px; padding-left: 18px; }
#death-text { color: #e9cfc8; font-size: 13px; margin-bottom: 18px; }

/* ---------- 提示 ---------- */
#v4-toast-box { position: fixed; left: 50%; top: 32%; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.v4-toast { padding: 7px 16px; font-size: 13px; color: #f2eee4; background: rgba(23, 33, 56, 0.9); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 4px 14px #12192b; transition: opacity .4s, transform .4s; text-shadow: 0 1px 2px #12192b; max-width: 86vw; text-align: center; }
.v4-toast.warn { border-color: #e9af0e; color: #ede8da; }
.v4-toast.ok { border-color: #65a30d; color: #d9f99d; }
.v4-toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- 視窗 (Modal) 美化 ---------- */
body #modal-backdrop { background: rgba(18, 25, 43, 0.62); backdrop-filter: blur(2px); z-index: 60; }
body .modal-card { border: 1px solid #e6ad0f !important; border-radius: 4px !important;
  background: linear-gradient(180deg, rgba(32, 46, 79, 0.98), rgba(23, 34, 58, 0.99)) !important;
  box-shadow: 0 0 0 1px #12192b, 0 0 0 3px rgba(230, 173, 15, 0.35), 0 18px 60px rgba(18, 25, 43, 0.9) !important; }
body .modal-header { background: linear-gradient(180deg, #273961, #1c2844) !important; border-bottom: 1px solid #405b9c !important; }
body .modal-title { color: #e6dfcb !important; letter-spacing: 1px; }
body .modal-close { border-radius: 50% !important; width: 30px; height: 30px; }
body .modal-quick-nav { background: rgba(18, 25, 43, 0.35) !important; border-bottom: 1px solid var(--line2) !important; }
body .mqn-btn.active { background: linear-gradient(180deg, #364e84, #223154) !important; border-color: var(--g2) !important; color: #f7f5ef !important; }

/* ---------- 背包 / 商店 ---------- */
.bag-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.bag-money { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #e7e1ce; }
.bag-money img { width: 18px; height: 18px; }
.bag-money span { color: var(--dim); font-size: 11px; margin-left: 8px; }
.bag-wrap { display: flex; gap: 10px; align-items: flex-start; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; flex: 1; min-width: 0; max-height: 52vh; overflow-y: auto; padding: 6px; background: rgba(18, 25, 43, 0.35); border: 1px solid var(--line2); }
.bag-cell { position: relative; aspect-ratio: 1; border: 1px solid #283962; background: radial-gradient(circle at 50% 40%, #202f4f, #172139); border-radius: 3px; cursor: pointer; }
.bag-cell img { width: 100%; height: 100%; }
.bag-cell.empty { cursor: default; opacity: .5; }
.bag-cell.sel { outline: 2px solid var(--g1); box-shadow: 0 0 10px rgba(220, 211, 183, 0.6); }
.bag-cell.r-blue { border-color: #2c4c8a; } .bag-cell.r-red { border-color: #8a2c22; } .bag-cell.r-purple { border-color: #6a2c9a; } .bag-cell.r-gold { border-color: #efb30f; }
.bag-cell.big { width: 64px; height: 64px; flex-shrink: 0; }
.bag-n { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 900; color: #faf9f5; text-shadow: 0 0 2px #12192b, 0 0 3px #12192b; font-family: Arial, sans-serif; }
.bag-enc { position: absolute; left: 2px; top: 0; font-size: 10px; font-weight: 900; color: #fdd053; text-shadow: 0 0 2px #12192b; }
.bag-detail { width: 250px; flex-shrink: 0; padding: 10px; background: rgba(18, 25, 43, 0.4); border: 1px solid var(--line2); }
.bag-detail.empty { color: var(--dim); font-size: 12px; text-align: center; padding: 30px 10px; }
.bd-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.bd-name { font-size: 15px; font-weight: 900; color: #f2eee4; }
.bd-sub { font-size: 11px; color: var(--dim); }
.bd-desc { font-size: 12px; color: #e3dbc4; line-height: 1.6; min-height: 40px; }
.bd-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.bd-hint { margin-top: 8px; font-size: 10.5px; color: #f5cc5c; }
.shop-npc { font-size: 12px; color: #e3dbc4; font-style: italic; }
.shop-list { display: flex; flex-direction: column; gap: 5px; max-height: 56vh; overflow-y: auto; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: rgba(18, 25, 43, 0.32); border: 1px solid var(--line2); }
.shop-row .bag-cell { width: 46px; height: 46px; flex-shrink: 0; }
.shop-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-info b { font-size: 13px; color: #f2eee4; } .shop-info span { font-size: 11px; color: var(--dim); } .shop-info em { font-size: 10.5px; color: #93c5fd; font-style: normal; }
.shop-buy { display: flex; align-items: center; gap: 5px; }
.shop-price { display: inline-flex; align-items: center; gap: 3px; color: #e7e1ce; font-size: 12px; font-weight: 700; margin-right: 4px; }
.shop-price img { width: 16px; height: 16px; }
.shop-foot { margin-top: 8px; text-align: right; }

/* ---------- 國家 ---------- */
.nat-hero { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 10px; border: 1px solid var(--oc); background: linear-gradient(90deg, rgba(18, 25, 43, 0.55), rgba(18, 25, 43, 0.2)), radial-gradient(circle at 10% 50%, color-mix(in srgb, var(--oc) 25%, transparent), transparent 60%); }
.nat-medal { width: 76px; height: 76px; filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.9)); }
.nat-name { font-size: 20px; font-weight: 900; color: #f2eee4; letter-spacing: 2px; }
.nat-line { font-size: 12px; color: #e3dbc4; margin-top: 3px; }
.nat-line.buff { color: #e2dbc3; }
.nat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nat-card { padding: 10px; background: rgba(18, 25, 43, 0.35); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 4px; }
.nc-t { font-size: 11px; color: var(--dim); } .nc-v { font-size: 17px; font-weight: 900; color: #f2eee4; } .nc-s { font-size: 10.5px; color: #c7cedb; flex: 1; }
.nat-sec-t { margin: 12px 0 6px; font-size: 13px; color: var(--g1); border-bottom: 1px solid var(--line2); padding-bottom: 3px; }
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(18, 25, 43, 0.3); border: 1px solid var(--line2); font-size: 12.5px; }
.rank-row.me { border-color: var(--g2); background: rgba(50, 71, 122, 0.25); }
.rank-row em { font-style: normal; width: 18px; color: var(--g1); font-weight: 900; } .rank-row img { width: 26px; height: 26px; } .rank-row b { flex: 1; color: #f2eee4; } .rank-row span { color: #c7cedb; font-size: 11.5px; }
.terr-sums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.terr-sum { text-align: center; padding: 8px 4px; border: 1px solid var(--oc); background: rgba(18, 25, 43, 0.4); }
.terr-sum b { display: block; font-size: 22px; color: var(--oc); } .terr-sum span { font-size: 11px; color: #e3dbc4; }
.terr-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; max-height: 46vh; overflow-y: auto; }
.terr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(18, 25, 43, 0.35); border-left: 3px solid var(--oc); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); }
.terr-name { flex: 1; font-size: 13px; font-weight: 900; color: #f2eee4; } .terr-name small { display: block; font-size: 10px; color: var(--dim); font-weight: 400; }
.terr-owner { font-size: 12px; font-weight: 900; color: var(--oc); min-width: 32px; }
.terr-act { display: flex; gap: 4px; } .terr-act .v4-btn { padding: 4px 8px; font-size: 11px; } .terr-ok { font-size: 11px; color: #86efac; padding: 4px 6px; }

/* ---------- 系統設定 ---------- */
.sys-sec { margin-bottom: 12px; padding: 10px; background: rgba(18, 25, 43, 0.3); border: 1px solid var(--line2); }
.sys-t { font-size: 13px; color: var(--g1); margin-bottom: 8px; letter-spacing: 1px; }
.sys-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; color: #ebe5d5; flex-wrap: wrap; }
.sys-row > span:first-child { min-width: 110px; }
.sys-row input[type=range] { flex: 1; min-width: 120px; accent-color: #f5cc5c; }
.sys-row input[type=checkbox] { width: 18px; height: 18px; accent-color: #f5cc5c; }
.sys-btns { display: flex; gap: 5px; flex-wrap: wrap; } .sys-btns .v4-btn { padding: 4px 10px; font-size: 11.5px; }
.sys-help { font-size: 11.5px; color: var(--dim); line-height: 1.7; flex: 1; }

/* ---------- 東漢大地圖 ---------- */
#worldmap-overlay { position: fixed; inset: 0; z-index: 70; display: none; flex-direction: column; background: #151e33; }
#worldmap-overlay.open { display: flex; }
.wm-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: linear-gradient(180deg, #27385f, #1a2641); border-bottom: 1px solid #405b9c; flex-wrap: wrap; }
.wm-head > img { width: 28px; height: 28px; }
.wm-head > b { font-size: 17px; color: #e6dfcb; letter-spacing: 2px; margin-right: auto; }
.wm-filters { display: flex; gap: 3px; flex-wrap: wrap; }
.wm-filters button { font-family: var(--font); font-size: 11px; padding: 3px 9px; color: var(--dim); background: rgba(18, 25, 43, 0.4); border: 1px solid var(--line2); cursor: pointer; border-radius: 2px; }
.wm-filters button.active { color: #f7f5ef; border-color: var(--g2); background: #2a3c67; }
.wm-zoom { display: flex; align-items: center; gap: 3px; }
.wm-zoom button { width: 26px; height: 24px; color: var(--g1); background: #1f2d4c; border: 1px solid var(--line2); cursor: pointer; font-weight: 900; }
.wm-zoom span { font-size: 11px; color: var(--txt); min-width: 40px; text-align: center; font-family: Arial, sans-serif; }
.wm-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--g2); background: #243459; color: #e6dfcb; font-size: 16px; cursor: pointer; }
.wm-body { flex: 1; display: flex; min-height: 0; }
#wm-view { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; background: #0a0d10; }
#wm-view:active { cursor: grabbing; }
#wm-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#wm-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
#wm-markers { position: absolute; inset: 0; }
.wm-prov-label { position: absolute; cursor: pointer; text-align: center; white-space: nowrap; pointer-events: auto; transform-origin: center; }
.wm-prov-name { display: block; font-size: 30px; font-weight: 900; color: rgba(244, 241, 232, 0.85); letter-spacing: 6px; text-shadow: 0 0 6px #12192b, 0 2px 4px #12192b, 0 0 18px rgba(18, 25, 43, 0.9); }
.wm-prov-owner { display: block; font-size: 15px; font-weight: 900; text-shadow: 0 0 4px #12192b, 0 0 8px #12192b; }
.wm-prov-label.sel .wm-prov-name { color: #e3dbc5; }
.wm-marker { position: absolute; display: flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; transform-origin: center; }
.wm-marker img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--mc); box-shadow: 0 0 0 2px #12192b, 0 0 10px rgba(18, 25, 43, 0.8); background: #12192b; }
.wm-marker.k-CASTLE img { width: 40px; height: 40px; border-radius: 6px; }
.wm-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--mc); border: 2px solid #12192b; box-shadow: 0 0 0 1px var(--mc), 0 0 8px var(--mc); }
.wm-mk-name { font-size: 13px; font-weight: 700; color: #faf9f5; text-shadow: 0 0 3px #12192b, 0 1px 2px #12192b, 0 0 6px #12192b; padding: 1px 4px; background: rgba(18, 25, 43, 0.45); border-radius: 2px; }
.wm-mk-name em { font-style: normal; font-size: 10.5px; color: var(--mc); }
.wm-marker.sel .wm-mk-name { background: rgba(66, 94, 161, 0.75); }
.wm-marker.sel img, .wm-marker.sel .wm-dot { box-shadow: 0 0 0 2px #faf9f5, 0 0 14px #faf9f5; }
.wm-you { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: 11px; font-weight: 900; color: #052e16; background: #4ade80; border-radius: 8px; padding: 0 6px; box-shadow: 0 0 10px #4ade80; animation: v4pulse 1.4s infinite; }
.wm-legend { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; padding: 5px 8px; background: rgba(18, 25, 43, 0.65); border: 1px solid var(--line2); font-size: 11px; color: #e3dbc4; pointer-events: none; }
.wm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; }
#wm-side { width: 330px; flex-shrink: 0; overflow-y: auto; padding: 8px; background: linear-gradient(180deg, #1e2a48, #17223a); border-left: 1px solid #314678; display: flex; flex-direction: column; gap: 8px; }
.wm-ptabs { display: flex; flex-wrap: wrap; gap: 3px; }
.wm-ptab { font-family: var(--font); font-size: 12px; padding: 3px 8px; color: #ebe5d5; background: rgba(18, 25, 43, 0.45); border: 1px solid var(--line2); border-bottom: 2px solid var(--oc); cursor: pointer; }
.wm-ptab.sel { background: #2a3c67; color: #f7f5ef; border-color: var(--g2); border-bottom-color: var(--oc); }
.wm-prov-card, .wm-zone-card { padding: 9px; background: rgba(18, 25, 43, 0.35); border: 1px solid var(--line2); }
.wm-prov-title { display: flex; align-items: baseline; gap: 8px; } .wm-prov-title b { font-size: 18px; color: #f2eee4; letter-spacing: 2px; } .wm-prov-title span { font-size: 11px; color: var(--dim); }
.wm-owner { margin-left: auto; font-size: 12px !important; font-weight: 900; color: var(--oc) !important; border: 1px solid var(--oc); padding: 0 6px; }
.wm-desc { font-size: 11.5px; color: #f5cc5c; line-height: 1.6; margin: 5px 0 7px; }
.wm-zone-list { display: flex; flex-direction: column; gap: 3px; }
.wm-zone-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; font-size: 12.5px; cursor: pointer; border: 1px solid transparent; background: rgba(250, 249, 245, 0.02); }
.wm-zone-row:hover { border-color: var(--line2); }
.wm-zone-row.sel { border-color: var(--g2); background: rgba(54, 78, 132, 0.35); }
.wm-zone-row .nm { flex: 1; color: #f0ebdf; } .wm-zone-row em { font-style: normal; font-size: 11px; color: var(--dim); }
.wm-kind { font-size: 10px; padding: 1px 5px; border-radius: 2px; color: #12192b; font-weight: 900; flex-shrink: 0; }
.wm-kind.k-VILLAGE { background: #e3dbc4; } .wm-kind.k-LOW { background: #86efac; } .wm-kind.k-MID { background: #fdd053; } .wm-kind.k-HIGH { background: #fccf55; } .wm-kind.k-BOSS { background: #ef4444; color: #faf9f5; } .wm-kind.k-CASTLE { background: #f5cc5c; }
.wm-zone-head { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #f7f5ef; margin-bottom: 5px; }
.wm-row { font-size: 12px; color: #e3dbc4; margin: 3px 0; } .wm-here { color: #4ade80; }
.wm-boss { display: flex; align-items: center; gap: 6px; margin: 6px 0; padding: 5px; background: rgba(90, 10, 6, 0.35); border: 1px solid rgba(220, 80, 60, 0.4); font-size: 12px; color: #fecaca; }
.wm-boss img { width: 24px; height: 24px; } .wm-boss em { margin-left: auto; font-style: normal; color: #fca5a5; font-size: 11px; }
.wm-mobs { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.wm-chip { font-size: 10.5px; color: #ebe5d5; background: rgba(18, 25, 43, 0.45); border: 1px solid var(--line2); padding: 1px 5px; } .wm-chip em { font-style: normal; color: var(--dim); }
.wm-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; } .wm-actions .v4-btn { flex: 1; }

/* ---------- 標題 / 角色建立 ---------- */
#title-screen { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; overflow-y: auto; padding: 20px 12px; }
#title-screen.open { display: flex; }
.ts-bg { position: fixed; inset: 0; background: url('../assets/img/world_han_map.jpg') center / cover no-repeat; filter: brightness(0.32) saturate(0.7) blur(1px); transform: scale(1.06); z-index: -1; }
.ts-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(18, 25, 43, 0), rgba(18, 25, 43, 0.85)); }
.ts-logo { text-align: center; }
.ts-name { font-size: clamp(44px, 10vw, 84px); font-weight: 900; letter-spacing: 0.25em; padding-left: 0.25em; color: #e6dfcb;
  background: linear-gradient(180deg, #faf9f5 0%, #f5cc5c 45%, #e6ad0f 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 6px #000) drop-shadow(0 0 22px rgba(200, 150, 60, 0.35)); }
.ts-sub { font-size: clamp(13px, 2.6vw, 18px); color: #f5cc5c; letter-spacing: 0.6em; padding-left: 0.6em; margin-top: 4px; text-shadow: 0 2px 4px #12192b; }
#ts-loading { width: min(420px, 86vw); text-align: center; }
.ts-bar { height: 6px; background: rgba(18, 25, 43, 0.6); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
#ts-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #e6ad0f, #dbd1b4); transition: width .2s; }
#ts-load-text { display: block; margin-top: 6px; font-size: 12px; color: #f5cc5c; }
#ts-panel { width: min(900px, 96vw); display: flex; justify-content: center; }
.ts-menu { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ts-menu .v4-btn.big { min-width: 260px; }
.ts-foot { position: fixed; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11px; color: rgba(245, 204, 92, 0.6); pointer-events: none; }
.cc-wrap { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: stretch; padding: 14px; background: rgba(22, 31, 54, 0.78); border: 1px solid var(--line); box-shadow: 0 0 40px rgba(18, 25, 43, 0.8); }
.cc-title { font-size: 14px; color: var(--g1); letter-spacing: 3px; border-bottom: 1px solid var(--line2); padding-bottom: 4px; }
.cc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cc-card { position: relative; cursor: pointer; border: 1px solid #2c3f6b; transition: transform .15s, border-color .15s, box-shadow .15s; background: #12192b; }
.cc-card img { width: 100%; display: block; aspect-ratio: 3 / 4; object-fit: cover; }
.cc-card .cc-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; background: linear-gradient(0deg, rgba(18, 25, 43, 0.95), rgba(18, 25, 43, 0)); display: none; }
.cc-card:hover { transform: translateY(-3px); border-color: var(--g3); }
.cc-card.sel { border-color: var(--g1); box-shadow: 0 0 0 1px var(--g1), 0 0 22px rgba(220, 211, 183, 0.45); }
.cc-desc { font-size: 12.5px; color: #e3dbc4; line-height: 1.7; padding: 8px 10px; background: rgba(18, 25, 43, 0.4); border-left: 2px solid var(--g2); }
.cc-desc b { color: #f2eee4; }
.cc-nats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cc-nat { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; border: 1px solid var(--line2); background: rgba(18, 25, 43, 0.45); }
.cc-nat img { width: 44px; height: 44px; }
.cc-nat b { display: block; font-size: 16px; color: var(--oc); } .cc-nat span { font-size: 11px; color: var(--dim); }
.cc-nat.sel { border-color: var(--oc); box-shadow: inset 0 0 18px color-mix(in srgb, var(--oc) 30%, transparent); }
.cc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#cc-name { flex: 1; min-width: 180px; font-family: var(--font); font-size: 15px; padding: 10px 12px; color: #f2eee4; background: rgba(18, 25, 43, 0.6); border: 1px solid var(--line); outline: none; user-select: text; -webkit-user-select: text; }
#cc-name:focus { border-color: var(--g1); }

/* ============================================================ 響應式 ============================================================ */
/* 手機直向 (直版) */
@media (max-aspect-ratio: 1/1) {
  :root { --nav-h: 54px; --qb-s: 42px; }
  .pl-plate { min-width: 0; width: min(260px, 64vw); padding: 5px 8px 5px 5px; }
  .pl-face-wrap, .pl-face { width: 48px; height: 48px; }
  body .player-name { max-width: 110px; font-size: 13px; }
  #buff-bar { max-width: 64vw; }
  #radar-panel { width: 120px; }
  #radar-panel #minimap-box { width: 120px; height: 120px; }
  .radar-map-btn { top: 6px; right: 8px; width: 24px; height: 24px; }
  #left-dock { top: 118px; }
  #left-dock .dock-sq-item { width: 42px; height: 42px; }
  #left-dock .dock-sq-item .dark-ico { width: 24px; height: 24px; }
  body #target-lock-hud { top: auto; bottom: calc(var(--nav-h) + var(--exp-h) + var(--qb-s) + 250px); width: 62vw; }
  body #world-boss-broadcast { top: 132px; left: 8px !important; right: 8px !important; width: auto !important; transform: none !important; }
  #quick-bar { left: 0; right: 0; transform: none; justify-content: center; border-radius: 0; border-left: none; border-right: none; padding: 3px; }
  #action-cluster { right: 4px; bottom: calc(var(--nav-h) + var(--exp-h) + var(--qb-s) + 16px + var(--safe-b)); transform: scale(0.86); transform-origin: right bottom; }
  body #joystick-zone { left: 12px; bottom: calc(var(--nav-h) + var(--exp-h) + var(--qb-s) + 26px + var(--safe-b)); width: 108px; height: 108px; }
  body #bottom-strip-container { left: 8px; width: calc(100vw - 16px); bottom: calc(var(--nav-h) + var(--exp-h) + var(--qb-s) + 218px + var(--safe-b)); max-width: none; }
  body #live-ticker-box .ticker-header { padding: 3px 6px; font-size: 10.5px; }
  body #bottom-nav .nav-circle, body #bottom-nav .nav-circle img { width: 30px; height: 30px; }
  body #bottom-nav .nav-label { font-size: 10px; letter-spacing: 0; }
  .wm-body { flex-direction: column; }
  #wm-side { width: auto; height: 42%; border-left: none; border-top: 1px solid #314678; }
  .wm-head > b { font-size: 14px; }
  .bag-wrap { flex-direction: column; }
  .bag-detail { width: auto; align-self: stretch; }
  .bag-grid { max-height: 38vh; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
  .nat-grid { grid-template-columns: 1fr; }
  .terr-list { grid-template-columns: 1fr; }
  .cc-cards { grid-template-columns: repeat(2, 1fr); }
  .cc-cards .cc-card img { aspect-ratio: 4 / 5; }
  .cc-nats { grid-template-columns: 1fr; }
  .shop-row { flex-wrap: wrap; } .shop-buy { width: 100%; justify-content: flex-end; }
}
/* 手機橫向 (高度不足) */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  :root { --nav-h: 44px; --qb-s: 38px; --exp-h: 4px; }
  .pl-plate { min-width: 210px; padding: 3px 8px 3px 3px; }
  .pl-face-wrap, .pl-face { width: 42px; height: 42px; }
  #radar-panel { width: 110px; } #radar-panel #minimap-box { width: 110px; height: 110px; }
  #left-dock { top: 96px; padding: 2px; } #left-dock .dock-sq-item { width: 36px; height: 36px; } #left-dock .dock-sq-item .txt { display: none; }
  #action-cluster { transform: scale(0.74); transform-origin: right bottom; }
  body #joystick-zone { width: 92px; height: 92px; left: 56px; }
  body #bottom-strip-container { left: 160px; width: 30vw; }
  body #bottom-nav .nav-circle, body #bottom-nav .nav-circle img { width: 26px; height: 26px; }
  body #bottom-nav .nav-label { font-size: 9.5px; }
  #zoom-control-pill { display: none !important; }
}
/* 寬螢幕 */
@media (min-width: 1400px) and (min-aspect-ratio: 1/1) {
  #radar-panel { width: 200px; } #radar-panel #minimap-box { width: 200px; height: 200px; }
  #left-dock { top: 140px; }
}
