/* =========================================================
   小小遠征 — 介面樣式（參考 LAYERLAB「GUI - The Stone」石材奇幻風）
   ========================================================= */
:root {
  --bg: #2b241e;
  --panel: #4a4037;
  --panel-hi: #574b40;
  --panel-lo: #3b332c;
  --tile: #3a322b;
  --tile-hi: #463c34;
  --edge: #8f7f6a;
  --edge-lo: #211b16;
  --text: #f4ead8;
  --muted: #b3a38b;
  --title: #ffb338;
  --gold: #ffd24a;
  --green: #95c21e;
  --teal: #1f9aa0;
  --blue: #3f78d6;
  --red: #e0452f;
  --purple: #9b35d8;
  --font: 'Huninn', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --num: 'Lilita One', 'Huninn', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.num { font-family: var(--num); letter-spacing: .02em; font-weight: 400; }
input, select { font: inherit; padding: 9px 12px; border: 2px solid var(--edge-lo); border-radius: 10px; background: #1f1a15; color: var(--text); width: 100%; min-width: 0; box-shadow: inset 0 2px 4px #0008; outline: none; }
input:focus, select:focus { border-color: var(--title); }
input::placeholder { color: #7d6f5c; }
label { display: block; margin: 10px 0; color: var(--muted); font-size: 13px; }
label input { margin-top: 5px; }
#field { position: fixed; inset: 0; display: block; touch-action: manipulation; }
body.town #field { touch-action: none; } /* 主城：雙指縮放、拖曳由遊戲自己處理（battle.js zoomTownAt） */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }

/* ---------- 共用圖示（資源） ---------- */
.ci { display: inline-block; width: 18px; height: 18px; background: center/contain no-repeat; vertical-align: -4px; flex: none; }
.ci-stone { background-image: url('../assets/ui/px/icon_stone.png'); }
.ci-iron { background-image: url('../assets/ui/px/icon_iron.png'); }
.ci-herb { background-image: url('../assets/ui/px/icon_herb.png'); }
.ci-insight { background-image: url('../assets/ui/px/icon_insight.png'); }
.ci-ticket { background-image: url('../assets/ui/px/icon_ticket.png'); }
.ci-jade { background-image: url('../assets/ui/px/icon_jade.png'); }
.ci-power { background-image: url('../assets/ui/px/nav_arena.png'); }
/* 裝備升星素材：星核（藍色星形核心）、神匠晶（紅水晶）——unTied「Super Pixel Objects And Items 2」單張圖示（tools/import_untied_monsters.mjs） */
.ci-core { background-image: url('../assets/ui/ut/core.png'); image-rendering: pixelated; }
.ci-crystal { background-image: url('../assets/ui/ut/crystal.png'); image-rendering: pixelated; }
.cost { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.cost + .cost { margin-left: 6px; }
.cost.lack { color: #ff8a7a; }

/* ---------- 頂欄 ---------- */
.topbar { position: absolute; top: calc(6px + var(--safe-t)); left: 8px; right: 8px; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.profile { display: flex; align-items: center; }
.avatar { position: relative; z-index: 1; width: 60px; height: 60px; flex: none; border: 0; padding: 0; background: url('../assets/ui/ts/round_wood.png') center/contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 3px 3px #0008); }
#seal { position: absolute; inset: 10px; display: grid; place-items: center; border-radius: 50%; font: 900 20px var(--font); color: #fff; background: #6a5a48; box-shadow: inset 0 3px 6px #0006; text-shadow: 0 2px 0 #0008; }
#vip { position: absolute; right: -2px; bottom: -2px; min-width: 24px; height: 24px; padding: 0 5px; display: grid; place-items: center; font: 400 12px var(--num); font-style: normal; color: #fff; background: radial-gradient(circle at 40% 30%, #3fdc9a, #13986b); border: 2px solid #0e5c42; border-radius: 12px; text-shadow: 0 1px 0 #0008; }
.who { min-width: 0; background: linear-gradient(#2a221cdd, #1d1813dd); border: 2px solid #5d5040; border-radius: 0 12px 12px 0; margin-left: -14px; padding: 4px 12px 5px 18px; box-shadow: 0 3px 8px #0006; }
.nameline { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.nameline b { font-size: 14px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
#netstate { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #0006; color: var(--muted); }
#netstate.on::before, #netstate.off::before { content: '●'; margin-right: 3px; }
#netstate.on::before { color: #5f5; }
#netstate.off::before { color: #f55; }
.powerline { display: flex; align-items: center; gap: 4px; margin-top: 1px; transform-origin: left center; }
.powerline .ci { width: 16px; height: 16px; }
.powerline b { font-size: 17px; color: var(--gold); text-shadow: 0 2px 0 #0009; }
.res { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; max-width: 70%; }
.res > div { position: relative; display: flex; align-items: center; height: 30px; padding: 0 10px 0 28px; min-width: 88px; background: linear-gradient(#1c1713e6, #2a231ce6); border: 2px solid #564a3c; border-radius: 9px; box-shadow: inset 0 2px 4px #0008, 0 2px 4px #0005; }
.res > div.jade { padding-right: 32px; cursor: pointer; }
.res b { color: #fff; font-size: 15px; text-shadow: 0 2px 0 #000a; margin-left: auto; }
.ic { position: absolute; left: -10px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; font: 900 12px var(--font); font-style: normal; color: #fff; border-radius: 50%; background: #666; }
.ic:has(img) { background: none; }
.ic img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 1px #000a); }
.plus { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 30px; height: 32px; background: url('../assets/ui/ts/smallbluesquarebutton_regular.png') center/100% 100% no-repeat; image-rendering: pixelated; }
.plus::after { content: '+'; position: absolute; inset: 0 0 3px; display: grid; place-items: center; font: 400 20px var(--pixel); color: #fff; text-shadow: 0 2px 0 #1a3a55; }
.res > div.pulse { animation: respulse .45s; }
@keyframes respulse { 30% { transform: scale(1.12); border-color: var(--gold); box-shadow: 0 0 14px #ffd24a; } }

.stagebar { position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 5px 14px; border-radius: 10px; background: linear-gradient(#2a221ce8, #1d1813e8); border: 2px solid #5d5040; box-shadow: 0 3px 10px #0007; white-space: nowrap; transition: transform .25s; }
#stageName { font-size: 15px; color: var(--title); text-shadow: 0 2px 0 #000a; }
/* 數值去膨脹：戰場上方「你 Lv X vs 首領 Lv Y」，掛在關卡列正下方 */
.lv-vs { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; padding: 1px 9px; border-radius: 8px; font-size: 11px; line-height: 15px; color: #e8dcc4; background: rgba(18, 14, 10, 0.78); box-shadow: inset 0 0 0 1px rgba(232, 197, 121, 0.35); white-space: nowrap; pointer-events: none; }
.lv-vs b { color: #ffd98a; font-weight: normal; }
.lv-vs b.up { color: #7dff9a; }
.lv-vs b.down { color: #ff7a6a; }
#killbar { position: relative; width: 120px; height: 16px; border-radius: 8px; background: #120e0b; overflow: hidden; border: 2px solid #5d5040; box-shadow: inset 0 2px 3px #000; }
#killbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffcf5a, #f08a1c 60%, #d0660e); transition: width .3s; box-shadow: inset 0 -3px 0 #0003; }
#killbar span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 12px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }

/* ---------- 左側活動 ---------- */
.side-left { position: absolute; left: 8px; top: calc(120px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.side-left button { pointer-events: auto; }
.medal { position: relative; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; width: 60px; }
.medal span { position: relative; display: grid; place-items: center; width: 48px; height: 50px; padding: 9px; font: 900 18px var(--font); color: #fff; background: url('../assets/ui/ts/round_wood.png') center/contain no-repeat; filter: drop-shadow(0 3px 2px #0008); transition: transform .12s; }
.medal span img { width: 100%; height: 100%; object-fit: contain; }
.medal em { font-style: normal; font-size: 11px; color: #fff; margin-top: -2px; white-space: nowrap; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.medal.hot span { animation: wiggle 2.4s infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-10deg); } 88% { transform: rotate(10deg); } 92% { transform: rotate(-6deg); } }
.medal:active span, .bottom-nav button:active span { transform: scale(.9); }
.dot::after { content: ''; position: absolute; top: 0; right: 6px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff7a5a, #d8261a); border: 2px solid #fff; box-shadow: 0 1px 2px #0008; z-index: 2; }

/* ---------- 任務 & 聊天 ---------- */
.quest { position: absolute; left: 8px; bottom: calc(100px + var(--safe-b)); max-width: min(300px, 62vw); display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; padding: 7px 12px 7px 8px; border-radius: 10px; background: linear-gradient(#3b322ae8, #2a231ce8); border: 2px solid #6b5c49; color: var(--text); box-shadow: 0 4px 10px #0007; }
.quest .qtag { grid-row: span 2; font-size: 12px; color: #fff; padding: 7px 6px; border-radius: 6px; writing-mode: vertical-rl; background: linear-gradient(#ff9a3a, #d9611a); box-shadow: inset 0 -2px 0 #0003, 0 2px 0 #7a3000; text-shadow: 0 1px 0 #0006; }
.quest #questText { font-size: 13px; }
.quest small { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.quest.done { border-color: var(--gold); animation: glow 1.2s infinite; }
.quest.done small { color: var(--gold); }
@keyframes glow { 50% { transform: scale(1.03); } }
.quest.done, #legacyBtn.hot { box-shadow: 0 0 0 2px #ffd24a, 0 0 18px #ffd24a; }
.ticker { position: absolute; left: 8px; bottom: calc(76px + var(--safe-b)); max-width: min(420px, 70vw); font-size: 12px; color: var(--text); background: #1d1813c8; border-radius: 8px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border: 1px solid #5d504088; }
.ticker em { font-style: normal; color: var(--title); }
.ticker em.srv { color: #ffb35a; } /* 全服系統訊息：和自己的提示分開（外部試玩回饋） */
.ticker b { color: #8fd3ff; font-weight: 400; }

/* ---------- 底部導航（石塊按鈕） ---------- */
.bottom-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 8px 6px calc(6px + var(--safe-b)); background: linear-gradient(transparent, #1a1511e0 35%); }
.bottom-nav button { position: relative; flex: 1; max-width: 86px; background: none; border: 0; display: flex; flex-direction: column; align-items: center; padding: 0; }
.bottom-nav span { position: relative; display: grid; place-items: center; width: 54px; height: 54px; padding: 9px; font: 900 20px var(--font); color: #fff; background: url('../assets/ui/ts/square_wood.png') center/100% 100% no-repeat; filter: drop-shadow(0 3px 2px #0009); transition: transform .12s; }
.bottom-nav span img { width: 100%; height: 100%; object-fit: contain; }
.bottom-nav .center-btn span { width: 66px; height: 70px; margin-top: -16px; padding: 14px; background-image: url('../assets/ui/ts/smallblueroundbutton_regular.png'); }
.bottom-nav em { font-style: normal; font-size: 12px; color: #fff; margin-top: 1px; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.bottom-nav button.active span, .medal.active span { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 0 6px #ffd24a) drop-shadow(0 3px 2px #0009); }
.bottom-nav button.active em { color: var(--gold); }
.bottom-nav .dot::after { right: 10px; }

/* ---------- 面板（石框） ---------- */
.sheet, .modal-card {
  background: radial-gradient(ellipse at 50% 0%, #5c5044, var(--panel) 45%, #3f362e);
  border: 3px solid var(--edge);
  box-shadow: 0 0 0 3px var(--edge-lo), inset 0 0 0 2px #00000030, inset 0 3px 0 2px #ffffff12, 0 14px 40px #000c;
}
.sheet { position: fixed; left: 6px; right: 6px; bottom: 0; height: min(80vh, calc(100% - 96px)); display: flex; flex-direction: column; border-radius: 16px 16px 0 0; border-bottom: 0; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.9,.3,1); z-index: 20; padding-bottom: var(--safe-b); }
.sheet.open { transform: none; }
.sheet::before, .sheet::after { content: ''; position: absolute; width: 12px; height: 12px; background: var(--edge); transform: rotate(45deg); top: -8px; box-shadow: 0 0 0 3px var(--edge-lo); z-index: 1; }
.sheet::before { left: 20px; }
.sheet::after { right: 20px; }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px 56px 8px; }
.sheet-head h2 { margin: 0; padding: 4px 30px; font-size: 20px; font-weight: 400; color: var(--title); letter-spacing: 3px; text-shadow: 0 2px 0 #000a; background: linear-gradient(90deg, transparent, #00000055 20%, #00000055 80%, transparent); }
.sheet-head { z-index: 5; }
.close-btn { z-index: 6; position: absolute; right: 8px; top: 6px; width: 44px; height: 46px; border: 0; background: url('../assets/ui/ts/smallredsquarebutton_regular.png') center/contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 3px 2px #0008); }
.close-btn::after { content: '×'; position: absolute; inset: 0 0 5px; display: grid; place-items: center; font: 400 28px var(--pixel); color: #fff; text-shadow: 0 2px 0 #5a1414; }
.close-btn:active { transform: scale(.92); }
.sheet-body { flex: 1; overflow-y: auto; overflow-x: hidden; /* 面板內頁只上下捲：裡面有元素過寬時不讓整頁左右滑（公會遠征跑版回報） */ padding: 4px 14px 14px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #8f7f6a transparent; }
.sheet-body h4 { margin: 18px 0 8px; font-size: 15px; font-weight: 400; color: var(--title); display: flex; align-items: center; gap: 8px; }
.sheet-body h4::before { content: ''; width: 8px; height: 8px; background: var(--title); transform: rotate(45deg); flex: none; }
.sheet-body h4 small { color: var(--muted); font-size: 12px; }
.sheet-body.enter > * { animation: enterUp .32s cubic-bezier(.2,.9,.3,1) both; }
.sheet-body.enter > *:nth-child(2) { animation-delay: .04s; }
.sheet-body.enter > *:nth-child(3) { animation-delay: .08s; }
.sheet-body.enter > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes enterUp { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 900px) {
  .sheet { left: auto; right: 14px; top: calc(84px + var(--safe-t)); bottom: 100px; width: 460px; height: auto; border: 3px solid var(--edge); border-radius: 16px; transform: translateX(calc(100% + 40px)); }
  .sheet.open { transform: none; }
  .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: 700px; background: linear-gradient(#2a221ce0, #1a1511e0); border: 2px solid #5d5040; border-bottom: 0; border-radius: 18px 18px 0 0; }
  .medal { width: 64px; }
  .medal span { width: 54px; height: 56px; padding: 10px; }
}

/* ---------- 按鈕（石材 9-slice） ---------- */
.btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 44px; padding: 0 8px 2px; border-style: solid; border-width: 10px 14px 13px; border-image: url('../assets/ui/ts/btn_brown.png') 24 30 30 30 fill / 10px 14px 13px stretch; background: none; color: #fff; font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-shadow: 0 2px 0 #0008, 1px 0 0 #0006, -1px 0 0 #0006; transition: transform .08s, filter .15s; }
.btn small { font-size: 11px; opacity: .95; display: inline-flex; align-items: center; gap: 3px; margin-top: 1px; }
.btn small .ci { width: 14px; height: 14px; vertical-align: -2px; }
.btn:active:not(:disabled) { transform: translateY(2px) scale(.98); }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn.gold { border-image-source: url('../assets/ui/ts/btn_gold.png'); }
.btn.green { border-image-source: url('../assets/ui/ts/btn_green.png'); }
.btn.blue { border-image-source: url('../assets/ui/ts/btn_blue.png'); }
.btn.red, .btn.danger { border-image-source: url('../assets/ui/ts/btn_red.png'); }
.btn.purple { border-image-source: url('../assets/ui/ts/btn_purple.png'); }
.btn.confirm { border-image-source: url('../assets/ui/ts/btn_red.png'); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.btn.sm { min-height: 36px; font-size: 13px; border-width: 8px 11px 10px; border-image-width: 8px 11px 10px; padding: 0 4px 1px; }
.btn.big { min-height: 54px; font-size: 16px; min-width: 120px; }
.btn.block { width: 100%; }
.btn:disabled { filter: grayscale(.9) brightness(.8); opacity: .7; cursor: not-allowed; }
.btn.gold:not(:disabled)::after { content: ''; position: absolute; top: -6px; bottom: -8px; width: 30%; left: -40%; background: linear-gradient(100deg, transparent, #ffffff55, transparent); animation: sheen 3.4s ease-in-out infinite; pointer-events: none; }
/* 常駐動畫只動 transform／opacity：動 left／box-shadow／filter 會讓手機每幀重新光柵（120 Hz 的 iPhone 一直發燙） */
@keyframes sheen { 0%, 70% { transform: translateX(0); } 100% { transform: translateX(533%); } }
.link { background: none; border: 0; color: var(--title); padding: 4px 0; font-size: 14px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 8px; }
.row.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* 內嵌磚塊 */
.card, .bld, .tech, .opp, .mail { background: linear-gradient(var(--tile-hi), var(--tile)); border: 2px solid var(--edge-lo); border-radius: 10px; box-shadow: inset 0 2px 0 #ffffff0d, 0 2px 0 #00000040; }
.card { padding: 12px; margin: 10px 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.rar { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; color: #fff; font-size: 12px; box-shadow: inset 0 -2px 0 #0003, 0 1px 2px #0008; text-shadow: 0 1px 0 #0008; }
.stars { color: #ffc81e; letter-spacing: -1px; font-size: 12px; text-shadow: 0 1px 0 #000; }

/* 分頁（六角形） */
.tabs, .seg { display: flex; gap: 4px; margin: 2px 0 12px; }
.tabs button, .seg button, .chip { flex: 1; border: 0; padding: 8px 6px; font-size: 13px; color: var(--muted); background: linear-gradient(#3a322b, #2a231d); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.tabs button.on, .seg button.on, .chip.on { color: #fff; background: linear-gradient(#ffb74a, #d9761c); text-shadow: 0 1px 0 #0008; }
.chips { display: flex; gap: 2px; overflow-x: auto; margin: 10px 0 4px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 16px; }

/* ---------- 英雄 ---------- */
.formation { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; border-radius: 12px; background: #1d1813; border: 2px solid var(--edge-lo); box-shadow: inset 0 3px 8px #000a; }
.formation .slot { position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(#3a322b, #2d2621); border: 2px dashed #5d5040; color: #6b5c49; font-size: 22px; overflow: hidden; cursor: pointer; padding: 0; }
.formation .slot.filled { border-style: solid; border-color: var(--rc, #5d5040); background: radial-gradient(circle at 50% 60%, #6a5a48, #2d2621); }
.formation .slot.locked { opacity: .45; cursor: default; font-size: 11px; }
.formation .slot .px-av { width: 100% !important; height: 100% !important; }
.formation .slot b { position: absolute; bottom: 1px; left: 0; right: 0; font: 400 10px var(--num); color: #fff; text-align: center; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
.formation-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 6px; }
.formation-head .pw { font-size: 13px; color: var(--muted); }
.formation-head .pw b { color: var(--gold); font: 400 16px var(--num); }
.grid.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.dcard { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 4px 7px; border-radius: 10px; border: 2px solid var(--edge-lo); background: linear-gradient(#4a4037, #362e27); color: var(--text); overflow: hidden; transition: transform .15s; box-shadow: inset 0 2px 0 #ffffff10, 0 2px 0 #0005; }
.dcard::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, var(--glow, #ffffff14), transparent 60%); pointer-events: none; }
.dcard:hover { transform: translateY(-2px); }
.dcard.r1 { --glow: #4fb35a40; border-color: #2f6a35; }
.dcard.r2 { --glow: #3f8ee055; border-color: #2a5a96; }
.dcard.r3 { --glow: #a653ea66; border-color: #7a3aae; }
.dcard.r4 { --glow: #ff8f1f80; border-color: #d0741a; box-shadow: 0 0 10px #ff9f2f66, inset 0 2px 0 #ffffff10; }
.dcard.on { outline: 2px solid #7ddc3a; outline-offset: -2px; }
.dcard .rar { position: absolute; left: 4px; top: 4px; z-index: 1; }
.dcard .tag { position: absolute; right: 4px; top: 4px; z-index: 1; background: linear-gradient(#8ee04a, #4f9a1e); color: #fff; font-size: 10px; border-radius: 6px; padding: 1px 5px; text-shadow: 0 1px 0 #0008; }
.dcard .uparrow { position: absolute; right: 6px; bottom: 36px; z-index: 1; width: 14px; height: 14px; background: #7ddc3a; clip-path: polygon(50% 0, 100% 60%, 70% 60%, 70% 100%, 30% 100%, 30% 60%, 0 60%); animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.dcard .px-av { position: relative; }
.dcard .nm { position: relative; font-size: 13px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dcard .sub { position: relative; font-size: 10px; color: var(--muted); }
.dcard .sub i { font-style: normal; margin-right: 2px; }
.dcard .stars { position: absolute; top: 28px; left: 5px; writing-mode: vertical-rl; font-size: 9px; z-index: 1; }
.dcard.r3::after, .dcard.r4::after { content: ''; position: absolute; inset: -50% auto -50% -60%; width: 30%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, #ffffff40, transparent); animation: cardshine 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes cardshine { 0%, 60% { transform: rotate(20deg) translateX(0); } 100% { transform: rotate(20deg) translateX(733%); } }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-nav { display: flex; gap: 6px; }
.detail { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; margin-top: 6px; }
.detail h3 { margin: 0 0 4px; font-size: 19px; font-weight: 400; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stage-box { position: relative; width: 150px; height: 170px; border-radius: 12px; background: radial-gradient(ellipse at 50% 88%, #00000070 18%, transparent 30%), radial-gradient(circle at 50% 40%, var(--rc, #888888), #1d1813 72%); border: 2px solid var(--rc, var(--edge-lo)); box-shadow: inset 0 0 24px #000c; overflow: hidden; }
.stage-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.anim-btns { position: absolute; bottom: 4px; left: 2px; right: 2px; display: flex; justify-content: center; gap: 2px; }
.anim-btns button { font-size: 10px; padding: 2px 3px; white-space: nowrap; line-height: 1.3; border-radius: 6px; border: 1px solid #0008; background: #000a; color: var(--muted); }
.anim-btns button.on { color: #fff; background: #d9761c; }
.portrait-lg { width: 128px; height: 128px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, #6a5a48, #1d1813); border: 3px solid var(--rc); }
.portrait-lg .px-av, .portrait-lg img { width: 100% !important; height: 100% !important; }
.realm { margin: 4px 0 8px; font-size: 14px; color: var(--title); display: flex; align-items: center; gap: 8px; }
.lvbar { flex: 1; height: 10px; border-radius: 5px; background: #120e0b; border: 1px solid #5d5040; overflow: hidden; }
.lvbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf5a, #f08a1c); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.stats div { display: flex; justify-content: space-between; align-items: center; background: #00000035; border-radius: 7px; padding: 4px 8px; border: 1px solid #00000040; }
.stats span { font-size: 11px; color: var(--muted); }
.stats b { font: 400 14px var(--num); }
.stats .pw b { color: var(--gold); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.actions .btn { flex: 1 1 130px; }
@media (max-width: 420px) { .detail { grid-template-columns: 120px 1fr; } .stage-box { width: 120px; height: 150px; } }

/* ---------- 招募 ---------- */
.gacha-banner { position: relative; text-align: center; padding: 14px 8px 10px; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 110%, #ffb74a88, transparent 60%), linear-gradient(#3a2a5a, #1d1426); border: 2px solid #8a6ad0; box-shadow: inset 0 0 30px #0008; margin-bottom: 10px; }
.gacha-banner::before { content: ''; position: absolute; left: 50%; top: 60%; width: 460px; height: 460px; margin: -230px 0 0 -230px; background: repeating-conic-gradient(#ffffff00 0 12deg, #ffd24a14 12deg 20deg); animation: spin 30s linear infinite; }
.gb-title { position: relative; font-size: 26px; letter-spacing: 6px; color: var(--gold); text-shadow: 0 3px 0 #5a2a00, 0 0 18px #ff9f2f; }
.gb-sub { position: relative; font-size: 12px; color: #e3d4ff; }
.gb-heroes { position: relative; display: flex; justify-content: center; margin-top: 4px; }
.gb-heroes .px-av { filter: drop-shadow(0 0 6px #ffd24a88); }
.pity { display: flex; gap: 8px; }
.pity > div { flex: 1; padding: 6px 10px; border-radius: 8px; background: #00000035; font-size: 12px; color: var(--muted); }
.pity b { color: var(--text); font: 400 15px var(--num); }
.pbar { height: 6px; border-radius: 3px; background: #120e0b; margin-top: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, #a653ea, #ff8f1f); }
.gacha-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.rates { width: 100%; border-collapse: separate; border-spacing: 3px; text-align: center; }
.rates th, .rates td { padding: 5px 2px; font-size: 13px; background: #00000035; border-radius: 6px; font-weight: 400; }
.rates td { font-family: var(--num); }

.gacha-modal { background: radial-gradient(ellipse at top, #3a2a5a, #120a1a) !important; }
.gacha-modal h2 { color: var(--gold) !important; }
.summon { height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; position: relative; overflow: hidden; }
.summon .chest { position: relative; width: 220px; height: 190px; background: url('../assets/ui/ut/chest.png') center bottom/contain no-repeat; image-rendering: pixelated; animation: chestShake .9s ease-in-out infinite; }
.summon .chest.rare { background-image: url('../assets/ui/ut/chest_rare.png'); }
.summon .chest.light { animation: chestPop .5s cubic-bezier(.2,1.6,.4,1) forwards; filter: drop-shadow(0 0 14px var(--gc)) drop-shadow(0 0 30px var(--gc)) brightness(1.15); }
.summon .beam { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -300px 0 0 -260px; background: repeating-conic-gradient(from 0deg, transparent 0 10deg, var(--gc) 10deg 16deg); opacity: .35; border-radius: 50%; animation: spin 5s linear infinite; -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%); mask-image: radial-gradient(circle, #000 20%, transparent 65%); }
.summon-text { position: relative; margin-top: 10px; font-size: 22px; letter-spacing: .3em; color: var(--gc); text-shadow: 0 0 12px var(--gc), 0 2px 0 #000; }
@keyframes chestShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg) scale(1.02); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-2deg) scale(1.04); } }
@keyframes chestPop { from { transform: scale(.8); } to { transform: scale(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 12px 0; }
.reveal.single { grid-template-columns: 160px; justify-content: center; }
.rv { perspective: 600px; min-height: 150px; }
.rv-in { position: relative; width: 100%; height: 100%; min-height: 150px; transform-style: preserve-3d; animation: flip .6s cubic-bezier(.3,1.4,.5,1) both; animation-delay: calc(var(--d) + .2s); }
.rv-back, .rv-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rv-back { background: #3a2618; border: 9px solid transparent; border-image: url('../assets/ui/ts/btn_brown.png') 47 45 47 45 fill / 9px stretch; image-rendering: pixelated; font: 400 34px var(--pixel); color: #ffe08a; text-shadow: 0 2px 0 #000; }
.rv-front { transform: rotateY(180deg); background: linear-gradient(#4a4037, #2d2621); border: 2px solid var(--edge-lo); overflow: hidden; padding: 6px 4px; color: var(--text); }
.rv-front > * { position: relative; }
.rv-front b { font-size: 13px; font-weight: 400; }
.rv-front small { font-size: 10px; color: var(--muted); }
.rv-front em { font-style: normal; font-size: 11px; color: var(--gold); }
.rv-front .rar { position: absolute; left: 4px; top: 4px; z-index: 1; }
.rv-front .px-av { border-radius: 10px; background-color: #00000030; }
.rv.r2 .rv-front { border-color: #3f8ee0; }
.rv.r3 .rv-front { border-color: #a653ea; box-shadow: 0 0 16px #a653ea; }
.rv.r4 .rv-front { border-color: #ff8f1f; box-shadow: 0 0 24px #ff9f2f; }
.rays { position: absolute !important; left: 50%; top: 40%; width: 260px; height: 260px; margin: -130px 0 0 -130px; background: repeating-conic-gradient(from 0deg, #ffffff00 0 10deg, #ffe08a55 10deg 16deg); border-radius: 50%; animation: spin 6s linear infinite; }
.rv.r3 .rays { background: repeating-conic-gradient(from 0deg, #ffffff00 0 10deg, #c9a2ff44 10deg 16deg); }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }

/* ---------- 主城 ---------- */
.bld { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px; }
.bicon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: radial-gradient(circle, #6a5a48, #2d2621); border: 2px solid var(--edge-lo); font-size: 22px; }
.bicon img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px #0008); }
.binfo { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.binfo b { font-weight: 400; font-size: 15px; }
.binfo b small { color: var(--gold); font-family: var(--num); }
.binfo .eff { font-size: 12px; color: var(--muted); }
.binfo .eff em { font-style: normal; color: #9fe05a; }
.ascend { background: linear-gradient(#4a3a62, #2d2240) !important; border-color: #1a1226 !important; }
.ascend h3 { margin: 0 0 4px; font-size: 16px; font-weight: 400; color: #d8b8ff; }

/* ---------- 公會 ---------- */
.sect-head { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, var(--sc), #1d1813 85%); border: 2px solid var(--edge-lo); box-shadow: inset 0 0 20px #0008; }
.sect-head h3 { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: 2px; text-shadow: 0 2px 0 #000; }
.seal-lg { flex: none; display: grid; place-items: center; width: 60px; height: 72px; color: #ffd24a; font-size: 30px; background: var(--sc); clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); box-shadow: inset 0 0 0 3px #0005; text-shadow: 0 2px 0 #000; }
.motto { color: #e8dcc6; margin: 2px 0 4px; font-size: 13px; }
.tech { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; }
.tech > div { display: flex; flex-direction: column; min-width: 0; }
.tech b { font-weight: 400; }
.tech b small { color: var(--gold); font-family: var(--num); }
.tech.art { background: linear-gradient(#4a3a62, #33284a); }
.artform { display: flex; flex-direction: column; gap: 8px; }
.artform select { flex: 1; }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.path { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 2px solid var(--edge-lo); border-radius: 10px; background: #00000030; cursor: pointer; color: var(--text); }
.path input { display: none; }
.path b { font-size: 16px; font-weight: 400; color: var(--title); }
.path span { font-size: 11px; color: var(--muted); }
.path:has(input:checked) { border-color: var(--title); background: #ffb33822; box-shadow: 0 0 0 2px #ffb33844; }
.colors { display: flex; gap: 8px; margin: 6px 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #1d1813; box-shadow: 0 0 0 2px #5d5040; }
.swatch.on { box-shadow: 0 0 0 3px var(--title); }

/* ---------- 競技場 ---------- */
.opp { display: flex; align-items: center; gap: 10px; padding: 8px; }
.opp .rank { font: 400 20px var(--num); color: var(--title); min-width: 46px; text-align: center; }
.opp b, .opp span { display: block; }
.opp b { font-weight: 400; }
.mini-team { display: flex; gap: 2px; margin-top: 3px; }
.mini-team .px-av { border-radius: 6px; background-color: #00000040; }
.big-num { font: 400 28px var(--num); color: var(--title); }
.toplist { padding-left: 0; margin: 0; list-style: none; counter-reset: r; }
.toplist li { counter-increment: r; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; }
.toplist li:nth-child(odd) { background: #00000025; }
.toplist li::before { content: counter(r); width: 26px; height: 26px; display: grid; place-items: center; flex: none; font: 400 14px var(--num); border-radius: 50%; background: #2a231d; color: var(--muted); }
.toplist li:nth-child(1)::before { background: linear-gradient(#ffe27a, #d99a1c); color: #5a3a00; }
.toplist li:nth-child(2)::before { background: linear-gradient(#f2f2f2, #a8b0b8); color: #333; }
.toplist li:nth-child(3)::before { background: linear-gradient(#f0b27a, #a8642e); color: #3a1a00; }
.toplist li b { font-weight: 400; }
.toplist li span { font-size: 12px; color: var(--muted); }
.toplist li em { margin-left: auto; font-style: normal; font-family: var(--num); color: var(--gold); }
.fight { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.fside { display: flex; flex-direction: column; gap: 6px; }
.vs { width: 44px; height: 44px; background: url('../assets/ui/px/misc_vs.png') center/contain no-repeat; font-size: 0; }
.fu { position: relative; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; background: #00000035; border-radius: 8px; padding: 3px; border: 1px solid #00000050; }
.fu .px-av, .fu img { grid-row: span 2; }
.fu span { font-size: 12px; white-space: nowrap; overflow: hidden; }
.fu i { display: block; height: 8px; background: #120e0b; border-radius: 4px; overflow: hidden; }
.fu i b { display: block; height: 100%; background: linear-gradient(#b8f05a, #5aa01e); transition: width .15s; }
.fu em { position: absolute; right: 6px; top: -4px; font: 400 14px var(--num); font-style: normal; color: #ff6a5a; animation: floatUp .6s forwards; pointer-events: none; text-shadow: 0 1px 0 #000; }
.fu em.crit { color: var(--gold); font-size: 17px; }
.fu em.heal { color: #7ddc3a; }
.fu.ko { filter: grayscale(1); opacity: .45; }
@keyframes floatUp { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-16px); } }
.result { width: fit-content; margin: 8px auto; padding: 6px 30px 14px; border-style: solid; border-width: 0 34px; border-image: url('../assets/ui/ts/ribbon2.png') 0 97 0 98 fill / 0 34px stretch; image-rendering: pixelated; font: 400 34px var(--pixel); letter-spacing: 10px; text-indent: 10px; color: #fff6c8; text-shadow: 0 3px 0 #5a3a00; }
.result.win { animation: chestPop .5s cubic-bezier(.2,1.6,.4,1); }
.result.lose { border-image-source: url('../assets/ui/ts/ribbon4.png'); color: #e6eef5; text-shadow: 0 3px 0 #1a2430; }

/* ---------- 世界 ---------- */
.boss-card { text-align: center; padding: 14px; border-radius: 12px; background: radial-gradient(ellipse at top, #6a2a2a, #1a0a0a); border: 2px solid #3a0e0e; box-shadow: inset 0 0 30px #000a; margin-bottom: 10px; }
.boss-name { font-size: 22px; letter-spacing: 3px; color: #ffcf7a; margin-bottom: 8px; text-shadow: 0 2px 0 #000, 0 0 14px #ff3b3b; }
.bossbar { position: relative; height: 22px; border-radius: 11px; background: #120e0b; overflow: hidden; border: 2px solid #5d2020; margin-bottom: 6px; }
.bossbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ff7a5a, #c8201a); transition: width .5s; }
.bossbar span { position: relative; font: 400 13px var(--num); line-height: 18px; text-shadow: 0 1px 0 #000; }
.chatbox { height: calc(100% - 110px); min-height: 240px; max-height: 50vh; overflow-y: auto; background: #1d1813; border-radius: 10px; padding: 8px 10px; border: 2px solid var(--edge-lo); box-shadow: inset 0 3px 8px #000a; }
.msg { padding: 5px 0; font-size: 14px; border-bottom: 1px dashed #3a322b; }
.msg b { color: #8fd3ff; margin-right: 6px; font-weight: 400; }
.msg b small { color: var(--muted); }
.msg b .lord-face { margin-right: 5px; vertical-align: middle; } /* 聊天名字前的領主頭像框 */
.msg.sys { color: var(--title); font-size: 13px; }
.vipb { font-style: normal; font: 400 10px var(--num); background: linear-gradient(#3fdc9a, #13986b); color: #fff; border-radius: 4px; padding: 0 4px; margin-right: 3px; }
/* 小國旗（ui/flag.js）：emoji 國旗；Windows 改顯示兩碼代碼小方塊 */
.flag { font-style: normal; margin-right: 3px; font-size: 1em; line-height: 1; vertical-align: baseline; }
.flag-code { display: inline-block; font: 700 9px/1 var(--num); letter-spacing: .5px; color: #2a2a2a; background: linear-gradient(#f3f0e6, #cfc8b4); border: 1px solid rgba(0, 0, 0, .35); border-radius: 3px; padding: 2px 3px; vertical-align: 1px; }
.flag-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flag-pick .btn { min-width: 40px; padding: 4px 6px; }
.flag-pick .flag { margin: 0; font-size: 18px; }
.chat-tr { margin-left: 6px; padding: 0 5px; font-size: 11px; line-height: 16px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: inherit; opacity: .75; cursor: pointer; }
.chat-tr.on { opacity: 1; background: rgba(255, 210, 90, .25); }
.chat-trtext { margin-top: 2px; padding-left: 8px; border-left: 2px solid rgba(255, 210, 90, .5); font-size: .92em; opacity: .9; }
.chatform { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }

/* ---------- 商城 ---------- */
.vipcard { background: linear-gradient(135deg, #3a2e1a, #1d1813) !important; border-color: #6b5220 !important; }
.vipcard b { font: 400 22px var(--num); color: var(--gold); }
.hotlabel { display: inline-block; font-size: 11px; color: #fff; padding: 2px 12px; background: linear-gradient(#ff6a5a, #c8201a); clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%, 8% 50%); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.grid.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 0; border-radius: 10px; border: 2px solid var(--edge-lo); background: linear-gradient(#4a4037, #2d2621); color: var(--text); overflow: hidden; box-shadow: inset 0 2px 0 #ffffff10; }
.prod b { font: 400 20px var(--num); color: #8fd3ff; text-shadow: 0 2px 0 #000; }
.prod b small { color: var(--gold); font-size: 13px; }
.prod > span { font-size: 11px; color: var(--muted); }
.prod em { align-self: stretch; margin-top: 6px; font: 400 15px var(--num); font-style: normal; color: #fff; padding: 7px 0 8px; background: linear-gradient(#a6d62e, #6a9a12); box-shadow: inset 0 -3px 0 #0003; text-shadow: 0 1px 0 #0008; }
.prod .ribbon { position: absolute; top: 4px; right: -2px; font-size: 10px; color: #fff; padding: 2px 8px 2px 10px; background: linear-gradient(#ff6a5a, #c8201a); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 6px 50%); }
.prod .ribbon.best { background: linear-gradient(#c890ff, #7a3ad0); }
.prod:active { transform: scale(.97); }
.gemimg { width: 70px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 3px #0008); }
.gem { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 2px; border-radius: 8px; transform: rotate(45deg); background: linear-gradient(135deg, #b4e6ff, #3f8ee0); color: #fff; font-size: 13px; }
.firstpay { text-align: center; }
.firstpay .portrait-lg, .firstpay .stage-box { margin: 0 auto; }
.firstpay h3 { font-size: 22px; font-weight: 400; color: var(--gold); margin: 8px 0 0; }
.firstpay ul { text-align: left; display: inline-block; color: var(--text); }
.signin { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.sday { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: linear-gradient(#4a4037, #2d2621); border: 2px solid var(--edge-lo); text-align: center; font-size: 11px; }
.sday b { font-size: 11px; font-weight: 400; }
.sday .px-av { margin: 0 auto; }
.sday .ci { width: 34px; height: 34px; }
.sday.special { grid-column: span 2; background: linear-gradient(#4a3a62, #2d2240); border-color: #1a1226; }
.sday.today { border-color: var(--title); box-shadow: 0 0 12px #ffb33888; }
.sday.got { opacity: .45; }
.sday.got::after { content: '✓'; position: absolute; top: 30%; font-size: 30px; color: #7ddc3a; text-shadow: 0 2px 0 #000; }
.mail { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; }
.mail > div { display: flex; flex-direction: column; gap: 2px; }
.mail.read { opacity: .55; }

/* ---------- 彈窗 / 通知 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: #000b; padding: 16px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal.show { display: grid; }
.modal-card { position: relative; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; border-radius: 14px; padding: 18px 16px 16px; animation: popin .28s cubic-bezier(.2,1.4,.4,1); color: var(--text); }
@keyframes popin { from { transform: scale(.85); opacity: 0; } }
.modal-card.narrow { width: min(380px, 100%); }
.modal-card h2 { font-size: 22px; font-weight: 400; color: var(--title); margin: 0 0 10px; text-shadow: 0 2px 0 #000a; }
.title-logo { text-align: center; font-size: 42px; letter-spacing: 8px; color: var(--gold); text-shadow: 0 3px 0 #7a3d0a, 0 6px 0 #3a1a00, 0 0 24px #ff9f2f; margin: 6px 0 2px; animation: floaty 3s ease-in-out infinite; }
.offline-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.offline-list div { display: flex; align-items: center; gap: 8px; background: #00000035; border-radius: 8px; padding: 8px 10px; border: 1px solid #00000050; }
.offline-list .ci { width: 26px; height: 26px; }
.offline-list b { margin-left: auto; font: 400 16px var(--num); color: #9fe05a; }
.offline-chest { width: 170px; height: 130px; margin: 0 auto; background: url('../assets/ui/ut/chest.png') center/contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 0 16px #ffd24a99); animation: floaty 2.4s ease-in-out infinite; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
#toasts { position: fixed; top: calc(126px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 420px); }
.toast { background: linear-gradient(#3b322af2, #2a231cf2); color: var(--text); padding: 9px 16px; border-radius: 10px; font-size: 14px; border: 2px solid #6b5c49; transition: opacity .4s, transform .4s; text-align: center; box-shadow: 0 4px 14px #0008; }
.toast.err { border-color: #c8201a; color: #ffc4b8; }
/* 獎勵提示：標題＋一排「圖示＋數字」（ui.js richToast） */
.toast.rich { padding: 8px 12px 10px; border-color: #c89a3a; animation: toastPop .35s cubic-bezier(.2, 1.6, .4, 1); }
.toast.rich .tt { font-size: 13px; color: #f6d27a; margin-bottom: 6px; letter-spacing: .05em; }
.toast.rich .tcs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.toast.rich .tc { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 999px; background: #0004; box-shadow: inset 0 0 0 1px #ffffff14; }
.toast.rich .tc .ci, .toast.rich .tc .tc-img { width: 22px; height: 22px; image-rendering: pixelated; }
.toast.rich .tc small { font-size: 12px; color: #d8c9a8; }
.toast.rich .tc b { font-size: 15px; color: #fff3c4; }
@keyframes toastPop { from { opacity: 0; transform: translateY(-6px) scale(.9); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(-10px); }
.banner { position: fixed; top: 34%; left: 50%; transform: translate(-50%, -50%) scale(.6); z-index: 75; pointer-events: none; opacity: 0; text-align: center; transition: opacity .25s, transform .3s cubic-bezier(.2,1.5,.4,1); padding: 10px 40px; }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner::before { content: ''; position: absolute; inset: 6px -20px; z-index: -1; background: linear-gradient(90deg, transparent, #000b 20%, #000b 80%, transparent); }
.banner img { display: block; margin: 0 auto 2px; max-height: 70px; max-width: 80vw; }
.banner b { display: block; font-size: 38px; font-weight: 400; letter-spacing: 4px; white-space: nowrap; background: linear-gradient(#fff3a0, #ffc53a 50%, #f08a1c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px #5a2a00; filter: drop-shadow(0 3px 0 #3a1a00) drop-shadow(0 0 12px #ff9f2f88); }
.banner span { display: block; font-size: 14px; color: #fff; text-shadow: 0 1px 3px #000; }
.banner.small b { font-size: 28px; }

/* ---------- 開場 ---------- */
#splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text); background: radial-gradient(ellipse at 50% 30%, #5c5044, #2b241e 60%, #120e0b); transition: opacity .6s, visibility .6s; }
#splash.gone { opacity: 0; visibility: hidden; }
.splash-logo { font-size: clamp(44px, 12vw, 84px); letter-spacing: .2em; color: var(--gold); text-shadow: 0 4px 0 #7a3d0a, 0 8px 0 #3a1a00, 0 0 40px #ff9f2f; animation: floaty 3s ease-in-out infinite; }
.splash-sub { font-size: 14px; letter-spacing: .3em; color: var(--muted); }
.splash-bar { width: 200px; height: 10px; border-radius: 5px; background: #120e0b; border: 2px solid #5d5040; overflow: hidden; margin-top: 18px; position: relative; }
.splash-bar i { position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, #ffb338, transparent); animation: sweep 1.1s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes floaty { 50% { transform: translateY(-6px); } }

/* ---------- 像素頭像 ---------- */
.px-av { display: inline-block; flex: none; background-repeat: no-repeat; image-rendering: pixelated; } /* 像素英雄放大：一律最近鄰（原本只有部分容器繼承到 pixelated，排行榜、社交名片等處會被平滑糊掉） */

/* ---------- 手機 ---------- */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .avatar { width: 52px; height: 52px; }
  #seal { inset: 9px; font-size: 17px; }
  .res { width: 100%; max-width: none; justify-content: space-between; gap: 4px 14px; padding-left: 10px; }
  .res > div { min-width: 0; flex: 1 1 26%; height: 26px; padding: 0 6px 0 22px; }
  .res > div.jade { padding-right: 26px; }
  .res b { font-size: 13px; }
  .ic { width: 28px; height: 28px; left: -9px; }
  .plus { width: 26px; height: 28px; }
  .stagebar { top: calc(126px + var(--safe-t)); padding: 4px 10px; }
  #stageName { font-size: 13px; }
  #killbar { width: 84px; }
  .side-left { top: calc(170px + var(--safe-t)); gap: 2px; }
  .medal { width: 52px; }
  .medal span { width: 42px; height: 44px; padding: 8px; }
  .bottom-nav { gap: 0; padding-left: 2px; padding-right: 2px; }
  .bottom-nav span { width: 44px; height: 44px; padding: 7px; }
  .bottom-nav em { font-size: 11px; }
  .bottom-nav .center-btn span { width: 58px; height: 62px; padding: 12px; }
  .grid.products { grid-template-columns: repeat(2, 1fr); }
  .gacha-btns .btn.big { min-width: 0; font-size: 14px; }
  .banner b { font-size: 30px; }
  #toasts { top: calc(160px + var(--safe-t)); }
}
@media (max-height: 560px) and (orientation: landscape) {
  .side-left { flex-direction: row; top: auto; bottom: calc(84px + var(--safe-b)); left: auto; right: 8px; }
  .quest { bottom: calc(84px + var(--safe-b)); }
  .ticker { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }
.banner-imgs { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin-bottom: 2px; }
.banner .banner-label { display: inline-block; padding: 4px 26px 13px; border-style: solid; border-width: 0 30px; border-image: url('../assets/ui/ts/ribbon1.png') 0 97 0 98 fill / 0 30px stretch; image-rendering: pixelated; font: 400 30px var(--pixel); letter-spacing: 6px; text-indent: 6px; white-space: nowrap; color: #fff; text-shadow: 0 3px 0 #4a1010; filter: drop-shadow(0 4px 0 #0008); }
.banner .banner-label.gold { border-image-source: url('../assets/ui/ts/ribbon2.png'); color: #fff6c8; text-shadow: 0 3px 0 #5a3a00; }

/* ---------- 全員出戰 ---------- */
.roster-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-radius: 10px; background: #1d1813; border: 2px solid var(--edge-lo); box-shadow: inset 0 3px 8px #000a; }
.roster-bar span { flex: 1; min-width: 54px; display: flex; flex-direction: column; align-items: center; padding: 3px 2px; border-radius: 6px; background: #ffffff08; }
.roster-bar em { font-style: normal; font-size: 11px; color: var(--muted); }
.roster-bar b { font-size: 16px; color: var(--text); }
.roster-bar .cap b { color: var(--gold); }
.arena-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 4px 8px; border-radius: 8px; background: #00000030; }
.dcard .tag { background: linear-gradient(#ffb74a, #d9761c) !important; }

/* ---------- /dev/environment 檢查面板 ---------- */
#devpanel { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 90; width: 150px; padding: 10px; border-radius: 10px; background: #000c; border: 1px solid #fff4; color: #fff; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
#devpanel b { color: var(--title); font-weight: 400; margin-bottom: 4px; }
#devpanel label { margin: 0; color: #fff; display: flex; align-items: center; gap: 6px; cursor: pointer; }
#devpanel input { width: auto; padding: 0; box-shadow: none; }
#devpanel .devrow { display: flex; gap: 4px; margin-top: 6px; }
#devpanel button { flex: 1; font-size: 11px; padding: 5px 2px; border-radius: 6px; border: 1px solid #fff4; background: #333; }
body.hide-ui #hud, body.hide-ui .sheet, body.hide-ui #toasts, body.hide-ui #banner { display: none !important; }

/* ---------- 技能卡 ---------- */
.skill-card { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--kc) 22%, #2a231d), #2a231d); border: 2px solid color-mix(in srgb, var(--kc) 55%, #211b16); }
.skill-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 20px; color: #fff; background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--kc) 70%, #fff), color-mix(in srgb, var(--kc) 80%, #000)); box-shadow: 0 0 10px var(--kc), inset 0 -3px 0 #0004; text-shadow: 0 2px 0 #0008; }
.skill-card > div:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.skill-card b { font-weight: 400; color: var(--kc); font-size: 15px; }
.skill-card span { font-size: 12px; color: var(--text); }
.legend-tag { font-style: normal; font-size: 10px; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: linear-gradient(#ffb74a, #d9761c); color: #fff; vertical-align: 2px; }
#devfps { font-family: var(--num); color: #7dff9a; font-size: 14px; }

/* ================= 進階系統 ================= */
.gold-t { color: var(--gold); }
.tabdot { position: relative; }
.tabdot::after { content: ''; position: absolute; top: 3px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #ff4a3a; }
.skill-icon img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.skill-icon:has(img) { padding: 0; overflow: hidden; }
/* 裝備 */
.eq-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
/* 一鍵穿戴：按鈕與預覽（每個部位 A → B、單體戰力變化） */
.eq-best-btn { margin-top: 8px; justify-content: center; }
.eq-best { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.eq-best .eb-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: #0003; }
.eq-best .eb-slot { flex: none; min-width: 2.5em; color: var(--muted, #b8a98f); font-size: 12px; }
.eq-best .eb-chg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.eq-best .eb-chg small { display: block; }
.eq-best .eb-pow { text-align: center; margin-top: 4px; }
.eq-best .up-t { color: #4ae06a; margin-left: 4px; }
.eq-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; border: 2px solid var(--rc, #5d5040); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc, #555) 35%, #2d2621), #1d1813); color: var(--text); box-shadow: inset 0 0 12px #0008; }
.eq-slot img { width: 44px; height: 44px; filter: drop-shadow(0 2px 2px #000a); }
.eq-slot b { position: absolute; top: 3px; right: 6px; font-size: 12px; color: #fff; text-shadow: 0 1px 0 #000; }
.eq-slot small { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-slot.empty { border-style: dashed; color: var(--muted); }
.eq-slot.empty span { font-size: 26px; line-height: 44px; }
.item-list { max-height: 60vh; overflow-y: auto; }
.item-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 18%, #2d2621), #2a231d); border: 2px solid color-mix(in srgb, var(--rc) 55%, #211b16); }
.item-row .grow { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.item-row b { font-weight: 400; }
.item-icon { position: relative; flex: none; width: 44px; height: 44px; border-radius: 8px; background: #0005; display: grid; place-items: center; }
.item-icon img { width: 40px; height: 40px; }
.item-icon b { position: absolute; bottom: -2px; right: 0; font-size: 11px; text-shadow: 0 1px 0 #000; }
.item-btns { display: flex; flex-direction: column; gap: 4px; flex: none; width: 122px; }
.item-btns .btn { min-height: 30px; width: 100%; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
/* 按鈕欄固定寬度：進化要兩種材料、各帶「還要多久」時，改成上下疊，不要把左邊的名稱和屬性擠成好幾行 */
.item-btns .btn small { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.item-btns .cost + .cost { margin-left: 0; }
.item-btns .cost .eta { font-size: 10px; }
/* 背包精簡列（docs/design/BAG_UX_2026-10-01.md）：一列一件、固定高度，點整列開詳情；只有「鎖」一個按鈕 */
.bag-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bag-row { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 8px; border-radius: 10px; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 56px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 16%, #2d2621), #2a231d); border: 2px solid color-mix(in srgb, var(--rc) 45%, #211b16); }
.bag-row.worn { opacity: .78; }
.bag-row .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bag-row .grow b { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-row .grow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-row .item-icon b { right: 2px; bottom: 0; padding: 0 3px; border-radius: 4px; background: #000a; font-size: 11px; line-height: 14px; }
/* 名稱列：名稱可縮（省略號），星級與進化徽章不縮，窄螢幕也看得到 */
.bag-row .grow b.bag-name { display: flex; align-items: center; min-width: 0; overflow: visible; }
.bag-row .bag-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-row .bag-name .up-arrow, .bag-row .bag-name .item-stars { flex: none; }
.bag-row .evo-lv { flex: none; margin-left: 6px; padding: 0 5px; border-radius: 7px; font-style: normal; font-size: 11px; line-height: 15px; color: #f1d6ff; background: #6a3f8f99; box-shadow: inset 0 0 0 1px #c58cff66; }
.bag-row .evo-lv em { display: none; font-style: normal; }
@media (max-width: 520px) {
  .bag-row .evo-lv span { display: none; }
  .bag-row .evo-lv em { display: inline; }
  .bag-row .bag-name .item-stars { margin-left: 4px; }
}
.bag-row .bag-sub { display: flex; align-items: center; gap: 6px; }
.ready-tag { flex: none; font-style: normal; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 8px; color: #1f1a14; background: #7fe08a; font-weight: 700; }
/* 篩選列自動換行（使用者：手機上最右邊「傳說以上」被切到，看不出還能往右滑） */
.bag-chips { margin: 6px 0 0; flex-wrap: wrap; row-gap: 4px; overflow: visible; }
/* 鍛造附贈的升星素材：圖示＋名稱＋數量 */
.forge-gift { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 4px; font-size: 12px; }
.forge-gift > span { color: var(--muted); }
.mat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; background: #0004; border: 1px solid #ffffff22; font-size: 12px; }
.mat-chip .ci { width: 18px; height: 18px; }
.mat-chip small { color: var(--muted); font-size: 11px; }
.mat-chip b { color: #ffd84a; font-weight: 400; }
.bag-chips .chip { padding: 5px 12px; }
.up-arrow { color: #5dff7a; font-style: normal; margin-right: 3px; text-shadow: 0 1px 0 #000; }
.lock-btn { flex: none; min-width: 44px; min-height: 36px; border-radius: 8px; border: 2px solid #6b5a45; background: #1d1712; color: var(--muted); font-size: 13px; }
.lock-btn.on { color: #ffd66b; border-color: #d9a43a; background: #3a2c14; }
.more-btn { align-self: center; margin: 6px auto; }
.info-lock { margin-top: 8px; align-items: center; gap: 8px; }
.tidy { display: flex; flex-direction: column; gap: 6px; }
.tidy .chips { margin: 0 0 4px; }
.tidy-sum { display: flex; flex-direction: column; gap: 4px; padding: 10px; }
/* 兩張卡分開：上面常駐設定（藍邊）、下面一次性分解（紅邊），一眼看出是兩件事 */
.tidy-auto, .tidy-now { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.tidy-auto { border-left: 4px solid #4aa3ff; }
.tidy-auto b { display: inline-flex; align-items: center; gap: 6px; }
.tidy-now { border-left: 4px solid #e0584a; }
.tidy-h { color: #ffd9a0; font-size: 15px; }
/* 每日任務、戰令 */
.act-card .act-bar { position: relative; height: 12px; margin: 22px 6px 26px; border-radius: 6px; background: #120e0b; border: 1px solid #5d5040; }
.act-bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffcf5a, #f08a1c); }
.act-chest { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border: 0; padding: 0; background: none; filter: grayscale(.8) brightness(.7); }
.act-chest img { width: 36px; height: 36px; }
.act-chest small { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.act-chest.ready { filter: drop-shadow(0 0 8px #ffd24a); animation: bob 1s infinite; }
.act-chest.got { filter: grayscale(1) brightness(.5); }
.pass-head .lvbar { margin: 8px 0 4px; }
.pass-cols, .pass-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: center; }
.pass-cols { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 4px; }
.pass-list { display: flex; flex-direction: column; gap: 5px; }
.pass-lv { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #2a231d; color: var(--muted); font-size: 14px; }
.pass-row.reached .pass-lv { background: linear-gradient(#ffcf5a, #f08a1c); color: #3a1a00; }
.pass-cell { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 40px; padding: 4px; border-radius: 8px; border: 2px solid var(--edge-lo); background: #00000035; color: var(--text); font-size: 12px; }
.pass-cell.paid { background: linear-gradient(#4a3a62, #2d2240); }
.pass-cell.ready { border-color: var(--gold); box-shadow: 0 0 8px #ffd24a88; }
.pass-cell.got { opacity: .4; }
.pass-cell.locked { filter: grayscale(.6); }
.pass-cell:disabled { cursor: default; }
.legend-pick { color: #ff9f2f; font-size: 11px; }
.cost img.ci { width: 18px; height: 18px; }
/* 禮包、基金 */
.pack-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: linear-gradient(90deg, #4a3a22, #2d2621); border: 2px solid #6b5220; }
.pack-card .grow { display: flex; flex-direction: column; gap: 2px; }
.pack-card b { font-weight: 400; font-size: 15px; color: var(--gold); }
.pack-items { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.fund-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; background: linear-gradient(#4a3a22, #2d2621) !important; }
.fund-head b { font-weight: 400; font-size: 18px; color: var(--gold); }
/* 公會 */
.guild-badge { flex: none; width: 40px; height: 48px; display: grid; place-items: center; color: #ffd24a; font-size: 20px; background: var(--gc); clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); }
.sect-head .lvbar { margin: 4px 0; max-width: 240px; }
.guild-boss { background: radial-gradient(ellipse at top, #3a4a2a, #121a0a) !important; border-color: #2a3a1a !important; }
.guild-log { max-height: 180px; overflow-y: auto; font-size: 12px; background: #1d1813; border-radius: 8px; padding: 6px 8px; border: 1px solid var(--edge-lo); }
.guild-log > div { padding: 2px 0; border-bottom: 1px dashed #3a322b; }
.guild-log small { color: var(--muted); margin-right: 4px; }
.leader-tag { font-style: normal; font-size: 10px; padding: 0 4px; margin-right: 4px; border-radius: 4px; background: var(--gold); color: #3a1a00; }
/* 首領戰 */
.bf-stage { height: 220px; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 70% 80%, #5a2a2a, #1a0e0e 70%); border: 2px solid var(--edge-lo); margin-bottom: 8px; }
.bf-stage canvas { width: 100%; height: 100%; display: block; }
.result-text { font-size: 26px; color: var(--gold); margin: 6px 0; text-shadow: 0 2px 0 #000; }
.fu-skill { position: absolute; left: 50px; top: -8px; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #d9761c; color: #fff; white-space: nowrap; animation: floatUp .7s forwards; pointer-events: none; }
.credits p { font-size: 13px; line-height: 1.6; }
.credits a { color: #8fd3ff; }
body.sheet-open .banner { top: 18%; }
body.sheet-open .banner.show { transform: translate(-50%, -50%) scale(.6); opacity: .85; }
@media (min-width: 900px) { body.sheet-open .banner { top: 34%; } body.sheet-open .banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* ================= 神話稀有度 ================= */
@keyframes rainbow { to { filter: hue-rotate(360deg); } } /* hue-rotate 每幀重算，只給短暫出現的東西用（連擊、抽卡結果）；常駐的用 breathe */
@keyframes breathe { 50% { opacity: .55; } }
.dcard.r5 { border-color: #ff3b6b; background: linear-gradient(135deg, #5a1a3a, #2a1a4a 50%, #1a3a5a); box-shadow: 0 0 14px #ff3b6baa; }
.dcard.r5::before { background: conic-gradient(from 0deg, #ff3b6b44, #ffd24a44, #4cc38a44, #3f8ee044, #9b35d844, #ff3b6b44); animation: breathe 3s ease-in-out infinite; }
.dcard.r5::after { content: ''; position: absolute; inset: -50% auto -50% -60%; width: 30%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, #fff8, transparent); animation: cardshine 1.8s ease-in-out infinite; pointer-events: none; }
.dcard.r5 .rar, .rv.r5 .rar { background: linear-gradient(90deg, #ff3b6b, #ffd24a, #4cc38a, #3f8ee0, #9b35d8) !important; }
.rv.r5 .rv-front { border-color: #ff3b6b; background: linear-gradient(135deg, #5a1a3a, #2a1a4a, #1a3a5a); box-shadow: 0 0 30px #ff3b6b, 0 0 60px #ffd24a88; color: #fff; }
.rv.r5 .rays { background: repeating-conic-gradient(from 0deg, #ffffff00 0 8deg, #ffffffaa 8deg 14deg); animation: spin 3s linear infinite, rainbow 2s linear infinite; }
.gacha-modal.mythic .summon .beam { opacity: .7; animation: spin 2s linear infinite, rainbow 1.5s linear infinite; }
.gacha-modal.mythic .summon-text { font-size: 28px; animation: rainbow 1s linear infinite; color: #ff3b6b; }
.gacha-modal.mythic .chest { animation: chestShake .3s ease-in-out infinite; }
body.mythic-flash::after { content: ''; position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle, #fff 0%, #ffd24a88 30%, transparent 70%); animation: flash 2.6s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 55% { opacity: 0; } 62% { opacity: 1; } 100% { opacity: 0; } }
.pity .mr b { color: #ff6b8b; }
.pity .mr .pbar i { background: linear-gradient(90deg, #ff3b6b, #ffd24a, #4cc38a, #3f8ee0); }
.pity { flex-wrap: wrap; }
.pity > div { min-width: 30%; }
.detail.r5 .stage-box { border-color: #ff3b6b; }
/* 神話：只讓背景光暈變色，角色本身不套濾鏡 */
.detail.r5 .stage-box::before { content: ''; position: absolute; inset: -30%; background: conic-gradient(from 0deg, #ff3b6b55, #ffd24a55, #4cc38a55, #3f8ee055, #9b35d855, #ff3b6b55); animation: spinBg 6s linear infinite; }
@keyframes spinBg { to { transform: rotate(360deg); } }

/* ================= 戰鬥互動 ================= */
.cmd-bar { position: absolute; right: 10px; bottom: calc(96px + var(--safe-b)); display: flex; align-items: flex-end; gap: 8px; }
.cmd-energy { position: absolute; left: 0; right: 0; top: -16px; height: 10px; border-radius: 5px; background: #120e0bd0; border: 1px solid #5d5040; overflow: hidden; }
.cmd-energy i { display: block; height: 100%; background: linear-gradient(90deg, #ff6a2a, #ffd24a); transition: width .2s; box-shadow: 0 0 8px #ffb03a; }
.cmd-energy span { position: absolute; right: 4px; top: -1px; font: 400 9px var(--num); color: #fff; text-shadow: 0 1px 0 #000; }
.cmd-bar button { position: relative; width: 50px; height: 50px; padding: 0; border-radius: 50%; border: 3px solid #5d5040; background: #1d1813; overflow: hidden; filter: grayscale(.85) brightness(.7); transition: transform .1s; box-shadow: 0 3px 8px #000a; }
.cmd-bar button.big { width: 64px; height: 64px; }
.cmd-bar button img { width: 100%; height: 100%; object-fit: cover; }
.cmd-bar button em { position: absolute; left: 0; right: 0; bottom: 0; font: 400 11px var(--num); font-style: normal; color: #fff; background: #000a; text-align: center; }
.cmd-bar button.ready { filter: none; border-color: #ffd24a; animation: cmdReady 1.2s ease-in-out infinite; }
.cmd-bar button.ready em { background: linear-gradient(#ffb03a, #d9611a); }
.cmd-bar button:active { transform: scale(.88); }
@keyframes cmdReady { 50% { transform: scale(1.04); } }
.cmd-bar button.ready { box-shadow: 0 0 0 3px #ffd24a88, 0 0 18px #ffd24a; }
.combo { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 35; pointer-events: none; display: none; text-align: center; }
.combo.show { display: block; animation: comboPop .25s cubic-bezier(.2,1.8,.4,1); }
.combo-label { display: block; width: fit-content; margin: 0 auto -2px; padding: 2px 14px 9px; border-style: solid; border-width: 0 20px; border-image: url('../assets/ui/ts/ribbon1.png') 0 97 0 98 fill / 0 20px stretch; image-rendering: pixelated; font: 400 18px var(--pixel); letter-spacing: 4px; color: #fff; text-shadow: 0 2px 0 #4a1010; }
.combo b { font: 400 44px var(--num); color: #fff; -webkit-text-stroke: 2px #5a2a00; text-shadow: 0 4px 0 #3a1a00, 0 0 18px #ffb03a; }
.combo.warm b { color: #ffd24a; font-size: 54px; }
.combo.hot b { color: #ff6a3a; font-size: 64px; animation: rainbow 1s linear infinite; }
@keyframes comboPop { from { transform: translate(-50%, -50%) scale(1.5); } to { transform: translate(-50%, -50%) scale(1); } }
/* 狂熱的畫面提亮改在畫布內畫（battle.js draw），不用 CSS filter：手機上整張畫布每幀跑濾鏡很傷 */
body.frenzy::before { content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 80px #ff2a1a88; animation: pulse 0.8s infinite; }
body.fever::before { content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 90px #ffd24aaa; }
@media (max-width: 640px) { .cmd-bar { bottom: calc(150px + var(--safe-b)); right: 6px; } .cmd-bar button { width: 44px; height: 44px; } .cmd-bar button.big { width: 56px; height: 56px; } }
@media (min-width: 900px) { body.sheet-open .cmd-bar { right: 490px; } }

/* ================= 城堡經營 ================= */
.castle-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: radial-gradient(ellipse at 30% 100%, #4a6a3a, #1d2a16); border: 2px solid var(--edge-lo); box-shadow: inset 0 0 20px #0008; }
.castle-img { width: 42%; max-width: 200px; image-rendering: pixelated; filter: drop-shadow(0 4px 4px #0008); }
.castle-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.castle-info > b { font-weight: 400; font-size: 20px; }
.castle-bld { grid-template-columns: 52px 1fr 60px; }
.castle-bld .binfo .btn, .castle-bld .binfo .build-prog { margin-top: 5px; align-self: flex-start; }
.build-prog { display: flex; align-items: center; gap: 6px; width: 100%; }
.build-prog .lvbar { flex: 1; }
.build-prog small { font: 400 12px var(--num); color: var(--gold); white-space: nowrap; }
.post-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 60px; padding: 4px 2px; border-radius: 10px; border: 2px dashed #5d5040; background: #00000030; color: var(--muted); }
.post-slot span { font-size: 24px; line-height: 44px; }
.post-slot small { font-size: 10px; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-slot.filled { border: 2px solid var(--gold); color: var(--text); background: #ffd24a18; }
.mission { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(var(--tile-hi), var(--tile)); border: 2px solid var(--edge-lo); }
.mission .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mission b { font-weight: 400; }
.mission.taken { opacity: .45; }
.mission.run { border-color: #3f78d6; }
.mission.done { border-color: var(--gold); box-shadow: 0 0 10px #ffd24a66; }
.m-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(#6a5a48, #3a322b); font-size: 18px; border: 2px solid #211b16; }
.m-side { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.m-side small { font: 400 12px var(--num); color: var(--gold); }
.dcard .tag.away { background: linear-gradient(#6fa8e0, #3f78d6) !important; }
.dcard .tag.bench { background: linear-gradient(#8a8a8a, #555) !important; }
.gacha-opts { display: flex; flex-direction: column; gap: 8px; }
.gacha-opts .opt { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); }
.gacha-opts .opt input { width: auto; }
.roster-bar .cap em { display: block; font-size: 10px; color: var(--muted); font-style: normal; }

/* ================= 主城地圖 ================= */
.town-title, .town-back, .town-theme, .town-tools { display: none; }
body.town .town-title { display: none !important; } /* 主城標題框拿掉：畫面本身就是主城，操作提示改由待辦列與卡片表達 */
body.town .town-tools { display: flex; flex-direction: column; gap: 6px; position: absolute; right: 10px; bottom: calc(148px + var(--safe-b)); }
body.town .town-tools button { padding: 7px 12px; border-radius: 10px; border: 2px solid #8a7a5a; background: linear-gradient(#3a2f25, #221a14); color: #ffe9b0; font-size: 13px; box-shadow: 0 3px 8px #0009; }
body.town .town-tools button.on { border-color: #6dff7a; color: #b8ffb8; }
body.town .town-theme { display: flex; flex-direction: column; align-items: center; position: absolute; right: 10px; bottom: calc(146px + var(--safe-b)); padding: 4px 12px; border-radius: 10px; border: 2px solid #8a7a5a; background: linear-gradient(#3a2f25, #221a14); color: #ffe9b0; font-size: 13px; box-shadow: 0 3px 8px #0009; }
body.town .town-theme small { font-size: 10px; color: var(--muted); }
body.town .town-title { display: block; position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 4px 22px 6px; border-radius: 10px; background: linear-gradient(#2a221ce8, #1d1813e8); border: 2px solid #5d5040; text-align: center; font-size: 18px; color: var(--title); letter-spacing: 4px; pointer-events: none; }
body.town .town-title small { display: block; font-size: 10px; letter-spacing: 0; color: var(--muted); }
body.town .town-back { display: flex; align-items: center; gap: 6px; position: absolute; right: 10px; bottom: calc(96px + var(--safe-b)); min-height: 42px; padding: 0 6px 2px; border-style: solid; border-width: 9px 11px 11px; border-image: url('../assets/ui/stone/btn_red.png') 22 24 30 24 fill / 9px 11px 11px stretch; image-rendering: pixelated; background: none; color: #fff; font-size: 14px; text-shadow: 0 2px 0 #0008; filter: drop-shadow(0 3px 4px #0009); }
/* 主城鏡頭「全景／拉近」小圓鈕（battle.js toggleTownZoom）：.in＝目前是全景，顯示放大鏡＋ */
.town-zoom { display: none; }
body.town .town-zoom { display: grid; place-items: center; position: absolute; right: 14px; bottom: calc(150px + var(--safe-b)); width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid #c9a45c; background: rgba(34,24,16,.85); box-shadow: 0 3px 6px #0009; touch-action: manipulation; }
body.town .town-zoom svg { width: 22px; height: 22px; fill: none; stroke: #ffe9b0; stroke-width: 2.4; stroke-linecap: round; }
body.town .town-zoom .pl { display: none; }
body.town .town-zoom.in .pl { display: inline; }
body.town .town-zoom:active { transform: scale(.92); }
body.arena .town-zoom { display: none !important; }
body.town .town-back img { width: 20px; height: 20px; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #0008); }
body.town .stagebar, body.town .cmd-bar, body.town #combo { display: none !important; }
/* 主城待辦列與建築卡片（ui-town.js）：手機優先，待辦列在底部導覽上方，卡片在待辦列上方 */
.town-bar, .town-card { display: none; }
/* 主城下方按鈕列（ui-town.js barHtml，使用者：下方按鈕很醜、很多東西不夠顯眼）：上面一條領地進度、下面一排圖示按鈕 */
body.town .town-bar { display: flex; flex-direction: column; gap: 6px; position: absolute; left: 8px; right: 8px; max-width: 640px; margin: 0 auto; bottom: calc(112px + var(--safe-b)); z-index: 6; padding: 6px; border-radius: 16px; background: linear-gradient(#2a1f16f2, #1a130df2); box-shadow: 0 6px 16px #000a, inset 0 0 0 2px #c9a45c55, inset 0 2px 0 #ffffff14; }
.town-bar button { position: relative; border: 0; background: none; color: #fff3d6; font: inherit; padding: 0; }
.town-bar button:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.town-bar .tb-ic { width: 26px; height: 26px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #0008); }
.town-bar .tb-row { display: flex; align-items: stretch; gap: 6px; }
.town-bar .tb-b { flex: none; width: 56px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; background: linear-gradient(#5a4632, #3a2c1f); box-shadow: inset 0 -3px 0 #0006, inset 0 1px 0 #ffffff26, 0 2px 0 #0008; }
.town-bar .tb-b small { font-size: 12px; line-height: 1; text-shadow: 0 1px 0 #000; }
.town-bar .tb-b:disabled { filter: grayscale(.6) brightness(.75); }
.town-bar .tb-b.on { background: linear-gradient(#7fb832, #4d7a17); box-shadow: inset 0 -3px 0 #0005, inset 0 1px 0 #ffffff44, 0 0 10px #a8ff4a88; }
.town-bar .tb-collect.on { animation: tbGlowBtn 1.6s ease-in-out infinite; }
@keyframes tbGlowBtn { 50% { box-shadow: inset 0 -3px 0 #0005, inset 0 1px 0 #ffffff44, 0 0 18px #c8ff6acc; } }
.town-bar .tb-b > i:not(.ci) { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; border: 2px solid #fff; background: #e5484d; color: #fff; font: 700 11px/14px inherit; font-style: normal; }
.town-bar .tb-bp small { font: 400 13px 'Lilita One', sans-serif; color: #8fd0ff; }
.town-bar .tb-queue { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.town-bar .tb-q { flex: 1 0 120px; max-width: 170px; display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px; border-radius: 12px; background: #0005; box-shadow: inset 0 0 0 1px #ffffff1a; text-align: left; overflow: hidden; }
.town-bar .tb-q > span { display: flex; flex-direction: column; min-width: 0; }
.town-bar .tb-q b { font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.town-bar .tb-q small { color: #ffd24a; font: 400 13px 'Lilita One', sans-serif; }
.town-bar .tb-qbar { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 4px; border-radius: 2px; background: #0008; overflow: hidden; }
.town-bar .tb-qbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb03a, #ffd24a); }
.town-bar .tb-q.free { background: linear-gradient(#2f7f86, #1d5a60); box-shadow: inset 0 -3px 0 #0005, inset 0 1px 0 #ffffff33; }
.town-bar .tb-q.free small { color: #d8f6ff; font-family: inherit; font-size: 11px; }
.town-bar .tb-auto { gap: 6px; }
.town-bar .tb-auto.on { background: linear-gradient(#3e7fc0, #285a8c); box-shadow: inset 0 -3px 0 #0005, inset 0 1px 0 #ffffff44; }
.town-bar .tb-sw { position: relative; display: block; width: 30px; height: 14px; border-radius: 7px; background: #0009; box-shadow: inset 0 1px 2px #000c; transition: background .15s; }
.town-bar .tb-sw b { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #b8a88a; transition: left .15s, background .15s; }
.town-bar .tb-auto.on .tb-sw { background: #7fe06a; }
.town-bar .tb-auto.on .tb-sw b { left: 18px; background: #fff; }
.town-bar .tb-prosper { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 6px; border-radius: 10px; background: #0004; font-size: 12px; white-space: nowrap; }
.town-bar .tb-prosper .tb-ic { width: 18px; height: 18px; }
.town-bar .tb-prosper b { color: #ffd24a; font-weight: 400; font-family: 'Lilita One', sans-serif; }
.town-bar .tb-prosper .tp-bar { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; background: #0008; overflow: hidden; }
.town-bar .tb-prosper .tp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb03a, #ffd24a); }
.town-bar .tb-prosper .tp-bar.res i { background: linear-gradient(90deg, #6dbf4a, #ffd24a); }
.town-bar .tb-prosper .tp-n { overflow: hidden; text-overflow: ellipsis; }
.town-bar .tb-prosper.ready { box-shadow: inset 0 0 0 2px #ffd24a; animation: tbGlowProg 1.6s ease-in-out infinite; }
@keyframes tbGlowProg { 50% { box-shadow: inset 0 0 0 2px #ffd24a, 0 0 12px #ffd24a99; } }
@media (max-width: 760px) { body.town .town-bar { bottom: calc(76px + var(--safe-b)); left: 6px; right: 6px; } }
/* 待辦列按鈕：石材 9-slice（棕＝一般、綠＝可收成／可交單、藍＝自動開、青＝空位） */
@keyframes tbPulse { 50% { transform: scale(1.05); } }
/* 自動建造開關：小撥桿（開＝綠、關＝暗） */
/* 領地進度：貼在待辦列上緣的小條（繁榮度 → 下一片領地） */
@keyframes tbGlow { 50% { box-shadow: 0 0 0 2px #ffd24a, 0 0 20px #ffd24ae6; } }
/* 訂單（規則版本 31，ui-town.js）：待辦列的按鈕、訂單面板 */
/* 寶庫（TOWN_EXPLORE 第 1 批，ui-town.js）：待辦列的藍圖數、產出表、開箱結果 */
.vt-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; max-height: 55vh; overflow-y: auto; }
.vt-row { display: grid; grid-template-columns: 1fr auto 52px; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: #0003; font-size: 13px; }
.vt-row b { font-weight: 700; }
.vt-row small { text-align: right; color: var(--muted); font-family: 'Lilita One', sans-serif; }
.vt-row.rare { background: linear-gradient(90deg, #6a4a1a66, #0003); }
.vt-row.rare b { color: #ffd24a; }
.vt-row.locked { opacity: .5; grid-template-columns: 1fr auto; }
/* 開箱演出（ui-town.js vaultBox）：寶箱晃動 → 打開（光芒）→ 合併後的戰利品一格一格彈出；動畫只動 transform／opacity */
.vault-box .vbx-title { margin-bottom: 0; }
.vault-box .vbx-title em { margin-left: 8px; font: 400 18px 'Lilita One', 'Huninn', sans-serif; font-style: normal; color: #ffd24a; }
.vault-box .vbx-sub { margin: 2px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.vbx-stage { position: relative; height: 112px; margin: 2px auto 4px; display: flex; align-items: flex-end; justify-content: center; }
.vbx-chest { position: relative; z-index: 1; width: 96px; height: 96px; background: url('../assets/ui/ut/chest.png') center / contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 4px 0 #0008); transform-origin: 50% 90%; }
.vbx-chest.rare { background-image: url('../assets/ui/ut/chest_rare.png'); }
.playing .vbx-stage:not(.open) .vbx-chest { animation: vbxShake .26s ease-in-out infinite; }
.vbx-stage.open .vbx-chest { background-image: url('../assets/ui/ut/chest_open.png'); animation: vbxBurst .4s cubic-bezier(.2, 1.6, .4, 1); }
.vbx-stage.skip .vbx-chest { animation: none; }
.vbx-rays { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -118px 0 0 -110px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #ffe27a66 0 10deg, #ffe27a00 10deg 30deg); -webkit-mask: radial-gradient(circle, #000 18%, #0000 68%); mask: radial-gradient(circle, #000 18%, #0000 68%); opacity: 0; transform: scale(.3); transition: opacity .3s, transform .4s; }
.vbx-stage.open .vbx-rays { opacity: .8; transform: scale(1); animation: vbxSpin 9s linear infinite; }
.vbx-stage.flash .vbx-rays { animation: vbxSpin 9s linear infinite, vbxFlash .6s ease-out; }
.vbx-stage::after { content: ''; position: absolute; left: 50%; top: 50%; width: 160px; height: 160px; margin: -96px 0 0 -80px; border-radius: 50%; background: radial-gradient(circle, #fff6c0 0, #ffd24a88 30%, #ffd24a00 70%); opacity: 0; pointer-events: none; }
.vbx-stage.open::after { animation: vbxPuff .5s ease-out; }
.vbx-stage.flash::after { animation: vbxPuff .6s ease-out; }
.vbx-stage.skip::after { animation: none; }
@keyframes vbxShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg) translateY(-2px); } 75% { transform: rotate(7deg) translateY(-2px); } }
@keyframes vbxBurst { 0% { transform: scale(.8, 1.15); } 60% { transform: scale(1.18, .9); } 100% { transform: none; } }
@keyframes vbxSpin { to { transform: scale(1) rotate(360deg); } }
@keyframes vbxFlash { 0% { opacity: 1; } 100% { opacity: .8; } }
@keyframes vbxPuff { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.4); } }
/* 戰利品格子：手機直式 3 欄（少於 4 格時 2 欄放大），圖示＋大數字＋名稱，不換行 */
.vbx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 46vh; overflow-y: auto; margin: 6px 0 10px; padding: 4px 2px; }
.vbx-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 8px 2px 6px; border-radius: 12px; border: 2px solid #5d5040; background: linear-gradient(#3a2f25, #1d1712); box-shadow: inset 0 1px 0 #ffffff14; opacity: 0; transform: scale(.3) translateY(-30px); }
.vbx-it.on { animation: vbxPop .42s cubic-bezier(.2, 1.5, .45, 1) forwards; }
.vbx-it.skip { animation: none; opacity: 1; transform: none; }
.vbx-it .ci { width: 38px; height: 38px; filter: drop-shadow(0 2px 0 #0008); }
.vbx-it b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 20px/1.15 'Lilita One', 'Huninn', sans-serif; color: #fff3d6; text-shadow: 0 2px 0 #000a; }
.vbx-it small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.vbx-it.rare { border-color: #ffd24a; background: radial-gradient(circle at 50% 35%, #a07a1e, #3a2a0e 75%); box-shadow: 0 0 14px #ffd24a99, inset 0 0 10px #fff3b055; }
.vbx-it.rare b { color: #ffe27a; }
.vbx-it.rare small { color: #ffe9b0; }
.vbx-it em { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 0 6px; border-radius: 6px; background: #ffd24a; color: #3a2400; font-size: 10px; font-style: normal; line-height: 15px; font-weight: 700; white-space: nowrap; }
@keyframes vbxPop { 0% { opacity: 0; transform: scale(.3) translateY(-30px); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
.vault-box .vbx-ok { display: block; width: 100%; }
.vault-box.playing .vbx-ok { opacity: 0; pointer-events: none; }
.vault-box.done .vbx-ok { animation: vbxPop .35s ease-out; }
.vbx-skip { margin: 4px 0 0; text-align: center; font-size: 11px; color: var(--muted); }
.vault-box.done .vbx-skip { visibility: hidden; }
/* 主城待收成摘要（ui-town.js sumHtml）：手機在左上角（返回戰場同一列），電腦版在上方置中；可收成時金邊 */
.town-sum { display: none; }
body.town .town-sum { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; position: fixed; z-index: 6; left: 50%; top: calc(112px + var(--safe-t)); transform: translateX(-50%); }
.town-sum .ts-row { display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 150px); min-height: 30px; padding: 3px 10px 3px 6px; border: 0; border-radius: 10px; background: #1a130dd9; box-shadow: 0 3px 8px #0008, inset 0 0 0 2px #ffffff1a; color: #fff3d6; font: inherit; font-size: 12px; white-space: nowrap; overflow: hidden; }
.town-sum .ts-row.on { box-shadow: 0 3px 8px #0008, inset 0 0 0 2px #ffd24a; }
.town-sum .ts-row.city { min-height: 24px; padding: 1px 10px 1px 6px; background: #1a130dbf; font-size: 11px; }
.town-sum .ts-h { padding: 1px 5px; border-radius: 6px; background: #ffffff1a; color: #ffe9b0; font-size: 11px; }
.town-sum .ts-row.on .ts-h { background: #3fae3a; color: #fff; }
.town-sum .ts-i { display: inline-flex; align-items: center; gap: 2px; font-family: 'Lilita One', 'Huninn', sans-serif; }
.town-sum .ts-i .ci { width: 16px; height: 16px; }
.town-sum .ts-i .est-ic { image-rendering: pixelated; }
.town-sum .ts-i.full { color: #ff8a7a; }
.town-sum .ts-none { color: var(--muted); }
@media (max-width: 699px) { body.town .town-sum { left: 8px; transform: none; } }
/* 打開面板（建築卡、底部面板、彈窗）時收起待收成／城內兩條和探索中提示，關掉再出現（使用者：展開面板會被那兩行擋住） */
body.town.sheet-open .town-sum, body.town:has(#modal.show) .town-sum, body.town:has(#townCard:not([hidden])) .town-sum,
body.town.sheet-open .ex-live, body.town:has(#modal.show) .ex-live { visibility: hidden; pointer-events: none; }
/* 探索圖（TOWN_EXPLORE 第 2 批，ui-explore.js）：下一個要打的探索點一張大卡、霧裡的下一個地區一行預告、探索完的收成一行摘要 */
.ex-top .ex-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: 13px; }
.ex-top .ex-stats b { font-family: 'Lilita One', sans-serif; font-weight: 400; }
.ex-map { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: linear-gradient(#e9d8ae, #d9c08a); box-shadow: inset 0 0 0 3px #8a6a3a, inset 0 0 24px #7a5a2a66; }
.ex-reg { position: relative; overflow: hidden; padding: 10px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--g1, #4f8a3a), var(--g2, #9fd27a)); box-shadow: 0 2px 0 #6a4a2a, inset 0 0 0 2px #0003; text-shadow: 0 1px 2px #000c; }
.ex-reg.fogged { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #7a7468; }
.ex-reg.fogged > b, .ex-reg.fogged > small { position: relative; z-index: 1; }
.ex-reg.fogged > small { font-size: 11px; }
.ex-reg.ex-done { text-align: center; }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ex-head b { font-size: 17px; }
.ex-head small { font-size: 11px; opacity: .9; }
.ex-newtag { margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: #ffd24a; color: #3a2a10; font-style: normal; text-shadow: none; }
.ex-steps { display: flex; gap: 4px; margin: 6px 0; }
.ex-steps span { flex: 1; min-width: 0; padding: 2px 4px; border-radius: 6px; background: #0005; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .65; }
.ex-steps span.done { background: #2f6a2acc; opacity: .9; }
.ex-steps span.on { background: #ffd24a; color: #3a2a10; text-shadow: none; font-weight: 700; opacity: 1; }
.ex-pt { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border-radius: 8px; background: #0007; }
.ex-pt > i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: #ffd24a; color: #3a2a10; text-shadow: none; font-weight: 700; }
.ex-pt .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ex-pt small { font-size: 11px; }
.ex-pt.open { box-shadow: inset 0 0 0 2px #ffd24a99; }
.ex-rew { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; }
.ex-acts { display: flex; gap: 8px; margin-top: 8px; }
.ex-acts .btn { flex: 1; margin: 0; }
.ex-acts .btn + .btn { flex: 0 0 34%; }
.ex-sum { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #0004; font-size: 13px; }
.ex-sum b { font-family: 'Lilita One', sans-serif; font-weight: 400; color: #ffd24a; }
.ex-sum .btn { flex: none; margin: 0; }
.ex-more { margin-top: 8px; }
.ex-more > summary { cursor: pointer; padding: 6px 4px; font-size: 13px; color: var(--muted); }
.ex-lines { display: flex; flex-direction: column; gap: 5px; }
.ex-line { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--g1, #4f8a3a), var(--g2, #9fd27a)); text-shadow: 0 1px 2px #000c; }
.ex-line .grow { display: flex; flex-direction: column; min-width: 0; }
.ex-line small { font-size: 11px; opacity: .9; }
.ex-line .btn { flex: none; margin: 0; }
.ex-fog { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 30% 40%, #fffe, #cfd3d6ee 45%, #9aa0a4f2); }
.ex-fog.still { background: linear-gradient(100deg, #c8cdd1d0, #9aa0a4e0 60%, #c8cdd1d0); }
.ex-reg.ex-new .ex-fog { animation: exFog 1.6s ease-out .3s forwards; }
@keyframes exFog { to { opacity: 0; transform: scale(1.3); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .ex-reg.ex-new .ex-fog { animation: none; opacity: 0; } }
.ex-entry .grow { display: flex; flex-direction: column; }
/* 出發轉場（ui/transition.js depart：探索、秘境、塔、競技場、首領戰…）：半透明深色底＋依玩法上色的雲從兩側合上（0.25 秒）
   → 中間顯示玩法圖示與名稱、等伺服器、切場 → 雲散開（0.35 秒）＋標題卡；散開後不擋點擊。
   蓋在競技場、國戰畫面（z 80）上面；顏色來自 --c1（雲亮部）、--c2（雲暗部）、--c3（底色）；.waiting＝等超過 0.25 秒才出現進度條 */
.ex-depart { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: auto; }
.ex-depart.open { pointer-events: none; }
/* 公會遠征全螢幕地圖（.gxm-fs，z 900）開著時從地圖出發／回來：雲要蓋在地圖上面，不然轉場整段被地圖擋住 */
body:has(.gxm-fs) .ex-depart { z-index: 950; }
.exd-veil { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease-out;
  background: radial-gradient(ellipse at 50% 46%, color-mix(in srgb, var(--c2) 50%, transparent), color-mix(in srgb, var(--c3) 85%, transparent) 75%); }
.ex-depart.shut .exd-veil { opacity: 1; }
.ex-depart.open .exd-veil { opacity: 0; transition: opacity .35s ease-in; }
/* 雲：transition.js 用小畫布畫的像素雜訊雲（--px 一格的大小、--pw 寬、--th 一個循環的高度），
   每側兩層——i.b 後層（暗、伸得遠）、i.f 前層（亮、短一點），前後層往相反方向上下流動 */
.exd-cl { position: absolute; top: 0; bottom: 0; width: var(--pw); overflow: hidden; will-change: transform; transition: transform .25s cubic-bezier(.25,.8,.35,1); }
.exd-cl i { position: absolute; left: 0; right: 0; top: calc(-1 * var(--th)); bottom: 0; background-repeat: repeat-y; background-size: var(--pw) var(--th); image-rendering: pixelated; animation: exdFlow 5s linear infinite; }
.exd-cl i.f { animation-duration: 3.2s; animation-direction: reverse; }
.exd-cl.l { left: 0; transform: translateX(-102%); }
.exd-cl.r { right: 0; transform: translateX(102%) scaleX(-1); }
.exd-cl.r i.b { animation-direction: reverse; }
.exd-cl.r i.f { animation-direction: normal; }
.ex-depart.shut .exd-cl.l { transform: translateX(0); }
.ex-depart.shut .exd-cl.r { transform: translateX(0) scaleX(-1); }
.ex-depart.open .exd-cl { transition: transform .35s cubic-bezier(.4,0,.7,.7); }
.ex-depart.open .exd-cl.l { transform: translateX(-104%); }
.ex-depart.open .exd-cl.r { transform: translateX(104%) scaleX(-1); }
@keyframes exdFlow { to { transform: translateY(var(--th)); } }
/* 中間的玩法牌：圖示（浮動）＋名稱；等伺服器時外圈轉動、下方細進度條跑動 */
.exd-sign { position: absolute; left: 50%; top: 45%; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.6);
  transition: opacity .18s, transform .25s cubic-bezier(.2,1.6,.4,1); }
.ex-depart.shut .exd-sign { opacity: 1; transform: translate(-50%, -50%) scale(1); transition-delay: .06s; }
.ex-depart.open .exd-sign { opacity: 0; transform: translate(-50%, -50%) scale(1.12); transition: opacity .15s, transform .2s; }
.exd-emb { position: relative; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c2) 60%, #000) 55%, var(--c3)); box-shadow: 0 0 0 3px var(--c3), 0 0 0 5px var(--c1), 0 0 26px 6px color-mix(in srgb, var(--c1) 55%, transparent); }
.exd-emb .skic { image-rendering: pixelated; filter: drop-shadow(0 3px 0 #0009); animation: exdBob .9s ease-in-out infinite alternate; }
.exd-emb::after { content: ''; position: absolute; inset: -11px; border-radius: 50%; opacity: 0; transition: opacity .2s; animation: exdSpin 1.2s linear infinite;
  background: conic-gradient(var(--c1) 0 16%, transparent 16% 50%, var(--c1) 50% 66%, transparent 66%);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); }
.ex-depart.waiting .exd-emb::after { opacity: 1; }
.exd-kind { font: 400 22px var(--pixel); letter-spacing: 4px; text-indent: 4px; white-space: nowrap; color: #fff; text-shadow: 0 2px 0 var(--c3), 0 0 12px var(--c2), 0 0 2px #000; }
.exd-wait { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0; transition: opacity .2s; }
.ex-depart.waiting .exd-wait { opacity: 1; }
.exd-bar { position: relative; width: 132px; height: 4px; border-radius: 2px; overflow: hidden; background: #0008; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c1) 45%, transparent); }
.exd-bar u { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--c1), #fff); animation: exdRun 1s cubic-bezier(.45,0,.55,1) infinite; }
.exd-wait small { font-size: 12px; letter-spacing: 2px; color: #fffd; text-shadow: 0 1px 2px #000; }
@keyframes exdRun { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes exdBob { from { transform: translateY(2px); } to { transform: translateY(-4px); } }
@keyframes exdSpin { to { transform: rotate(360deg); } }
/* 散開後的標題卡（關卡名、對手名） */
.exd-card { position: absolute; left: 50%; top: 30%; width: max-content; max-width: 92vw; transform: translate(-50%, -50%) scale(.7); opacity: 0; text-align: center; pointer-events: none; padding: 8px 36px 10px; transition: opacity .25s, transform .35s cubic-bezier(.2,1.5,.4,1); }
.exd-card::before { content: ''; position: absolute; inset: 14px -16px 0; z-index: -1; background: linear-gradient(90deg, transparent, #000a 22%, #000a 78%, transparent); }
.ex-depart.open .exd-card { opacity: 1; transform: translate(-50%, -50%) scale(1); transition-delay: .18s; }
.ex-depart.done .exd-card { opacity: 0; transform: translate(-50%, -60%) scale(1); transition: opacity .4s, transform .4s; }
.exd-rib { display: inline-block; padding: 3px 22px 11px; border-style: solid; border-width: 0 26px; border-image: url('../assets/ui/ts/ribbon1.png') 0 97 0 98 fill / 0 26px stretch; image-rendering: pixelated; font: 400 20px var(--pixel); letter-spacing: 4px; text-indent: 4px; white-space: nowrap; color: #fff; text-shadow: 0 2px 0 #4a1010; filter: drop-shadow(0 3px 0 #0008); }
.exd-card b { display: block; margin-top: 2px; font-size: clamp(20px, 6.4vw, 32px); font-weight: 400; letter-spacing: 2px; white-space: nowrap; background: linear-gradient(#fff3a0, #ffc53a 50%, #f08a1c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.2px #5a2a00; filter: drop-shadow(0 2px 0 #3a1a00); }
.exd-card small { display: block; font-size: 13px; color: #fff; text-shadow: 0 1px 3px #000; }
/* 減少動態：不滑雲、不流動，只淡入淡出底色與玩法牌 */
@media (prefers-reduced-motion: reduce) {
  .exd-cl { display: none; }
  .exd-cl i, .exd-emb .skic, .exd-emb::after { animation: none; }
  .exd-bar u { animation: none; width: 100%; opacity: .6; }
  .exd-sign, .ex-depart.shut .exd-sign, .ex-depart.open .exd-sign { transform: translate(-50%, -50%); }
  .ex-depart.shut .exd-veil { background: color-mix(in srgb, var(--c3) 88%, transparent); }
}
/* 探索清完、等最短秒數時的「探索完成・結算倒數」（ui-explore.js exploreClear）：不擋點擊 */
.ex-clear { position: fixed; left: 50%; top: calc(30% + var(--safe-t)); z-index: 30; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 200px; padding: 10px 22px 12px; border-radius: 14px; background: #1a130de6; color: #fff3d6; box-shadow: 0 4px 16px #000a, inset 0 0 0 2px #ffd24a; pointer-events: none; animation: exClearIn .35s cubic-bezier(.2,1.5,.4,1) both; }
.ex-clear b { font-size: 22px; font-weight: 400; color: #ffd24a; letter-spacing: 2px; text-shadow: 0 2px 0 #000a; }
.ex-clear small { font-size: 13px; }
.ex-clear em { font-style: normal; font-family: 'Lilita One', sans-serif; color: #ffd24a; }
.ex-clear i { display: block; width: 100%; height: 6px; border-radius: 3px; background: #0008; overflow: hidden; }
.ex-clear u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffcf5a, #f08a1c); transition: width .2s linear; }
@keyframes exClearIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
/* 主城：探索進行中的橫幅（ui-town.js），點了回戰場觀戰 */
.ex-live { display: none; position: fixed; left: 50%; top: calc(78px + var(--safe-t)); transform: translateX(-50%); z-index: 7; align-items: center; gap: 6px; padding: 6px 14px; border: 0; border-radius: 999px; background: #1a130de6; color: #fff3d6; font: inherit; font-size: 14px; white-space: nowrap; box-shadow: 0 3px 10px #0009, inset 0 0 0 2px #ffd24a99; animation: exLive 1.6s ease-in-out infinite; }
body.town .ex-live.on { display: flex; }
.ex-live b { color: #ffd24a; font-family: 'Lilita One', sans-serif; font-weight: 400; }
.ex-live em { font-style: normal; color: #9fe0ff; }
@keyframes exLive { 50% { transform: translateX(-50%) scale(1.04); } }
/* 新手：夜刃第一次上場的提示卡（ui-unlocks.js），放畫面上方、不蓋住推近的英雄 */
.nb-tip { position: fixed; left: calc(50% + 24px); top: calc(132px + var(--safe-t)); z-index: 58; width: min(76vw, 320px); transform: translate(-50%, -12px); opacity: 0; padding: 10px 14px; border-radius: 12px; background: #1a130deb; color: #fff3d6; box-shadow: 0 4px 14px #000a, inset 0 0 0 2px #ffd24aaa; transition: opacity .3s, transform .3s; cursor: pointer; }
.nb-tip.show { opacity: 1; transform: translate(-50%, 0); }
.nb-tip b { display: block; margin-bottom: 4px; color: #ffd24a; font-size: 15px; }
.nb-tip p { margin: 2px 0; font-size: 14px; line-height: 1.35; }
.nb-tip small { display: block; margin-top: 4px; text-align: right; color: var(--muted); font-size: 11px; }
.est-ic { image-rendering: pixelated; vertical-align: middle; }
.est-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.est-head .est-icons { display: flex; flex: none; }
.est-head p { margin: 0; }
.est-stocks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.est-stock { display: flex; align-items: center; gap: 4px; }
.est-stock b { font-family: 'Lilita One', sans-serif; font-weight: 400; color: #fff; }
.est-stock.off { opacity: .6; }
.est-order { display: flex; flex-direction: column; gap: 6px; min-height: 132px; }
.est-order.wait { opacity: .75; justify-content: center; align-items: center; gap: 4px; }
.est-wait-ic { font-size: 26px; }
.est-order.wait .num { font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 20px; color: #fff; }
/* 訂單交付演出（ui-town.js orderFx）：蓋在卡片上的獨立圖層 */
.ord-fx { position: fixed; z-index: 9000; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.ord-flash { position: absolute; inset: 0; border-radius: 10px; background: radial-gradient(circle, rgba(255, 228, 120, .85), rgba(255, 190, 60, .25) 60%, transparent 75%); animation: ordFlash .6s ease-out forwards; }
.ord-stamp { position: absolute; top: 38%; left: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 4px solid #ffd24a; border-radius: 50%; color: #ffd24a; font: 400 40px/56px 'Lilita One', sans-serif; text-align: center; text-shadow: 0 2px 0 #7a4a00; box-shadow: 0 0 18px rgba(255, 210, 74, .8); animation: ordStamp .35s cubic-bezier(.2, 1.6, .5, 1) both; }
.ord-gains { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 78px; }
.ord-gain { font: 400 20px 'Lilita One', sans-serif; color: #fff; text-shadow: 0 2px 0 #000; animation: ordPop .35s cubic-bezier(.2, 1.6, .5, 1) var(--d) both; transition: transform .5s cubic-bezier(.5, 0, .9, .5), opacity .5s; }
.ord-gain .cost { font-size: 20px; }
.ord-gain.pop { color: #ffd24a; }
.ord-gain.fly, .ord-gain.fade { animation: none; }
.ord-gain.fade { opacity: 0; }
.ord-fx.out .ord-stamp, .ord-fx.out .ord-flash { transition: opacity .4s; opacity: 0; }
@keyframes ordFlash { from { opacity: 1; transform: scale(.9); } to { opacity: 0; transform: scale(1.15); } }
@keyframes ordStamp { from { opacity: 0; transform: scale(2.4) rotate(-20deg); } to { opacity: 1; transform: scale(1) rotate(-8deg); } }
@keyframes ordPop { from { opacity: 0; transform: translateY(14px) scale(.4); } to { opacity: 1; transform: none; } }
.est-who b { color: #ffd24a; margin-right: 4px; }
.est-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.est-need { display: inline-flex; align-items: center; gap: 3px; font-family: 'Lilita One', sans-serif; }
.est-need.ok { color: #b8ffb8; }
.est-need.lack { color: #ff9a8a; }
.est-rew { font-size: 13px; }
/* 修練場（ui-town.js trainBox）：修練位、修練值進度、挑英雄 */
.tr-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.tr-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 2px solid #8a7a5a; border-radius: 10px; background: #0004; color: #fff3d6; font: inherit; }
.tr-slot small { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-slot.empty { border-style: dashed; color: var(--muted); min-height: 72px; justify-content: center; }
.tr-slot.empty span { font-size: 22px; line-height: 1; }
.tr-slot .tr-note { color: #ffb03a; }
.tr-bar { width: 100%; height: 6px; border-radius: 3px; background: #0008; overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6dff7a, #ffd24a); }
.tr-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.tr-cand { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 2px solid #5d5040; border-radius: 10px; background: #0004; color: #fff3d6; font: inherit; }
.tr-cand small { font-size: 11px; }
/* 英雄殿堂的遠征紀錄分頁 */
.rec-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rec-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #0003; }
.rec-row i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.rec-row b { flex: 1; font-weight: 700; }
.rec-row small { color: var(--muted); }
/* 英雄殿堂（ui-town.js PANELS.hall）：大頭像展示牆，框色＝稀有度，神話與滿星金框 */
.hall-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 8px; }
.hall-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 8px; border-radius: 12px; border: 2px solid var(--rc); background: linear-gradient(#2e241c, #1c1611); color: #fff3d6; font: inherit; }
.hall-card b { font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hall-card small { font-size: 11px; color: var(--muted); }
.hall-card.gold { border-color: #ffd24a; background: linear-gradient(#5a4214, #2a1e0a); box-shadow: 0 0 12px #ffd24a66, inset 0 0 10px #ffd24a33; }
.hall-card.gold b { color: #ffe08a; }
.hall-peek { display: flex; gap: 4px; flex-wrap: wrap; }
body.town .town-card:not([hidden]) { display: block; position: absolute; left: 8px; right: 8px; bottom: calc(222px + var(--safe-b)); z-index: 7; max-width: 460px; margin: 0 auto; padding: 10px 12px; border-radius: 12px; border: 2px solid #ffd24a; background: linear-gradient(#2e2620f5, #1d1813f5); color: var(--text); box-shadow: 0 6px 18px #000c; animation: tcIn .18s ease-out; }
@keyframes tcIn { from { transform: translateY(12px); opacity: 0; } }
/* 建築卡片（使用者：建築面板好醜——圖多、字少）：大圖＋名稱＋等級＋一句話、存量列、大升級鈕、同大小按鈕列、說明收進「?」 */
.town-card .bc-top { display: flex; align-items: center; gap: 10px; }
.town-card .bc-art { flex: none; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 50% 60%, #ffe9b033, #0000 70%), #0004; overflow: hidden; }
.town-card .bc-art img { max-width: 72px; max-height: 72px; image-rendering: pixelated; filter: drop-shadow(0 3px 2px #0008); }
.town-card .bc-art.ghost img { opacity: .5; filter: grayscale(.7); }
.town-card .bc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.town-card .bc-title b { font-size: 18px; font-weight: 400; color: var(--title); line-height: 1.15; }
.town-card .bc-lv { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 8px; background: linear-gradient(#ffe27a, #e9a92a); color: #3a2410; font: 400 13px 'Lilita One', sans-serif; vertical-align: 2px; }
.town-card .bc-title small { color: #e8dcc0; font-size: 12.5px; line-height: 1.3; }
.town-card .bc-help, .town-card .bc-x { flex: none; align-self: flex-start; width: 32px; height: 32px; border: 0; background: #0006; color: #ffe9b0; font: 700 17px/1 inherit; }
.town-card .bc-help { border-radius: 50%; border: 2px solid #ffe9b066; }
.town-card .bc-x { border-radius: 8px; color: #fff; font-size: 20px; }
.town-card .bc-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.town-card .bc-stat { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: #0004; }
.town-card .bc-sic { display: grid; place-items: center; }
.town-card .bc-sic img, .town-card .bc-sic .ci { width: 28px; height: 28px; image-rendering: pixelated; }
.town-card .bc-sbar { min-width: 0; }
.town-card .bc-sbar .lvbar { height: 10px; }
.town-card .bc-sbar small { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: #fff3d6; white-space: nowrap; }
.town-card .bc-sbar small b { font: 400 14px 'Lilita One', sans-serif; color: #ffd24a; }
.town-card .bc-pi { width: 14px; height: 14px; image-rendering: pixelated; vertical-align: -2px; }
.town-card .bc-upbtn { width: 100%; min-height: 52px; flex-direction: row; justify-content: space-between; gap: 10px; padding-left: 6px; padding-right: 6px; }
.town-card .bc-upbtn.lock { justify-content: center; gap: 8px; }
.town-card .bc-upbtn.lock .bc-pi { width: 20px; height: 20px; }
.town-card .bc-uplv { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 15px; }
.town-card .bc-uplv b { font-weight: 400; }
.town-card .bc-uplv small { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.town-card .bc-cost { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; font-size: 14px; }
.town-card .bc-acts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.town-card .bc-acts .btn { width: 100%; min-height: 36px; }
.town-card .bc-post { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; background: #0003; font-size: 12.5px; }
.town-card .bc-post em { font-style: normal; color: #b8ffb8; }
.town-card .bc-seg { margin: 0; }
.town-card .bc-chest { width: 28px; height: 28px; object-fit: contain; }
.bc-helptext { font-size: 14px; line-height: 1.6; }
.town-card .bc-ub { margin-top: 0; }
/* 遠征世界地圖（ui-town.js expMapView）：從下（王城）往上一條蜿蜒的路，每個地區一站 */
.em-map { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.em-map::before { content: ''; position: absolute; left: 50%; top: 20px; bottom: 30px; border-left: 4px dashed #c9a45c88; transform: translateX(-2px); }
.em-node { position: relative; display: flex; align-items: center; gap: 10px; width: 78%; padding: 8px 10px; border: 2px solid #5d5040; border-radius: 14px; background: #2a1f16e6; color: #fff3d6; font: inherit; text-align: left; }
.em-node.l { align-self: flex-start; } .em-node.r { align-self: flex-end; flex-direction: row-reverse; text-align: right; }
.em-node.home { align-self: center; width: 70%; border-color: #ffd24a; }
.em-node span { display: flex; flex-direction: column; min-width: 0; }
.em-node b { font-weight: 400; font-size: 15px; } .em-node small { font-size: 12px; color: #e8dcc0; }
.em-dot { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff3; background: radial-gradient(circle at 35% 30%, var(--g2, #777), var(--g1, #333)); color: #fff; font: 700 17px/1 inherit; font-style: normal; text-shadow: 0 1px 2px #000; overflow: hidden; }
.em-node.done .em-dot { border-color: #6dff7a; }
.em-node.cur { border-color: #ffd24a; box-shadow: 0 0 12px #ffd24a66; } .em-node.cur .em-dot { border-color: #ffd24a; animation: tbPulse 1.6s ease-in-out infinite; }
.em-node.fog { border-style: dashed; border-color: #5d504088; } .em-node.fog > * { opacity: .5; filter: grayscale(.8); }
.em-node.home .em-dot { background: radial-gradient(circle at 35% 30%, #ffe27a, #b07a20); }
.em-older { text-align: center; font-size: 12px; margin: 0; }
/* 外圈分批投入（ui-town.js expandView）：每種資源一條進度 */
.ob-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.ob-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; }
.ob-bar { position: relative; height: 18px; border-radius: 9px; background: #0007; overflow: hidden; }
.ob-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6dbf4a, #ffd24a); }
.ob-bar span { position: relative; display: block; text-align: center; font: 400 12px/18px 'Lilita One', sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
.town-card .bc-cond { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #e8dcc0; }
.town-card .tc-head { display: flex; align-items: center; gap: 8px; }
.town-card .tc-head b { font-size: 17px; font-weight: 400; color: var(--title); }
.town-card .tc-more { margin-left: auto; }
.town-card .tc-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #0005; color: #fff; font-size: 20px; line-height: 1; }
.town-card .tc-body { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.town-card .tc-body p { margin: 0; }
.town-card .tc-store { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.town-card .tc-prog { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; }
.town-card .tc-prog .lvbar { grid-column: 1 / -1; }
.town-card .tc-up { width: 100%; }
.town-card .tc-post { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.town-card .tc-focus { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.town-card .tc-focus .seg { margin: 0; }
/* 回到主城的總結小卡片（ui-town.js welcomeCard）：頂欄下方置中，停 6 秒 */
.town-welcome { position: fixed; left: 50%; top: calc(96px + var(--safe-t)); z-index: 30; transform: translate(-50%, -12px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; min-width: 220px; max-width: calc(100vw - 32px); border-radius: 12px; background: rgba(34,24,16,.93); border: 2px solid #c9a45c; color: #fff3d6; font-size: 14px; text-align: center; }
.town-welcome.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.town-welcome b { font-family: var(--pixel); font-size: 18px; color: #ffd24a; margin-bottom: 2px; }
body:not(.town) .town-welcome { display: none; }
@media (max-width: 699px) {
  body.town .town-title { display: none; } /* 手機：省空間，名稱在建築卡片裡 */
  body.town .town-back { top: calc(112px + var(--safe-t)); bottom: auto; right: 8px; min-height: 36px; font-size: 13px; }
  body.town .town-zoom { top: calc(158px + var(--safe-t)); bottom: auto; right: 10px; width: 36px; height: 36px; }
}

@media (max-width: 640px) { body.town .town-title { top: calc(126px + var(--safe-t)); } }
.bld-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.bld-head img { width: 110px; max-height: 110px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 4px #0008); }
.bld-head h3 { margin: 0 0 4px; font-weight: 400; }
.store-box { margin: 10px 0; padding: 10px; border-radius: 10px; background: #00000035; display: flex; flex-direction: column; gap: 6px; }
.post-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }

/* ---------- 戰力跑馬燈 ---------- */
#powpop { position: fixed; left: 50%; top: calc(150px + var(--safe-t)); z-index: 60; transform: translateX(-50%) scale(.6); opacity: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; padding: 8px 28px 10px; border-radius: 16px; background: radial-gradient(ellipse at center, #3a2a08f0 0%, #1d1406e8 70%); border: 2px solid #ffd24a; box-shadow: 0 0 24px #ffb03a88, inset 0 0 18px #ffd24a33; }
#powpop.show { animation: ppIn .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
#powpop.hide { animation: ppOut .35s ease-in forwards; }
#powpop .pp-lbl { font-size: 13px; color: #ffe9b0; letter-spacing: 2px; display: flex; align-items: center; gap: 4px; }
#powpop .pp-num { font-family: 'Lilita One', sans-serif; font-size: 38px; line-height: 1.1; background: linear-gradient(#fff6c8, #ffd24a 45%, #ff9a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #7a3a00) drop-shadow(0 0 8px #ffb03a); animation: ppJit .09s steps(2) infinite; }
#powpop .pp-gain { font-style: normal; font-family: 'Lilita One', sans-serif; font-size: 18px; color: #6dff7a; text-shadow: 0 2px 0 #0a4a10, 0 0 8px #3aff5a; }
#powpop .pp-gain::before { content: '▲ '; font-size: 13px; }
#powpop .pp-rays { position: absolute; inset: -40px -60px; z-index: -1; background: repeating-conic-gradient(from 0deg, #ffd24a33 0deg 8deg, transparent 8deg 20deg); border-radius: 50%; mask: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); animation: ppSpin 4s linear infinite; }
#powpop.mega { border-color: #fff; box-shadow: 0 0 40px #ffd24a, 0 0 80px #ff6a3a88; }
#powpop.mega .pp-num { font-size: 50px; }
#powpop.mega .pp-rays { background: repeating-conic-gradient(from 0deg, #ff5a5a44 0deg 6deg, #ffd24a44 6deg 12deg, #5affc844 12deg 18deg, transparent 18deg 26deg); }
@keyframes ppIn { 0% { opacity: 0; transform: translateX(-50%) scale(.5); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes ppOut { to { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.8); } }
@keyframes ppJit { 50% { transform: translateY(-1px); } }
@keyframes ppSpin { to { transform: rotate(360deg); } }
.powerline.bump { animation: hudBump .5s ease-out; }
@keyframes hudBump { 0% { transform: scale(1); } 30% { transform: scale(1.35); color: #6dff7a; filter: drop-shadow(0 0 6px #ffd24a); } 100% { transform: scale(1); } }
body.pow-flash::after { content: ''; position: fixed; inset: 0; z-index: 59; pointer-events: none; background: radial-gradient(circle at 50% 25%, #fff6c8aa, transparent 60%); animation: powFlash .6s ease-out forwards; }
@keyframes powFlash { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 640px) { #powpop { top: calc(200px + var(--safe-t)); } #powpop .pp-num { font-size: 32px; } #powpop.mega .pp-num { font-size: 42px; } }

/* ---------- 國戰／公會戰 ---------- */
.war-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 8px; }
.war-head > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: linear-gradient(#2a221c, #1d1813); border: 1px solid #4d4234; }
.war-head.guild > div:first-child { border-color: var(--gc); }
.war-flag { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; color: #fff; background: linear-gradient(#b8452f, #7a2a1a); border: 2px solid #ffd24a; flex: none; }
.war-flag.bot { background: linear-gradient(#5a5a66, #33333d); border-color: #aaa; }
.war-opp .grow { display: flex; flex-direction: column; gap: 1px; }
.war-log { display: flex; flex-direction: column; gap: 4px; }
.war-log > div { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #221b15; font-size: 12px; }
.war-log > div b { text-align: center; border-radius: 4px; color: #fff; }
.war-log .win b { background: #2f8a3a; } .war-log .lose b { background: #8a2f2f; }
.war-log em { font-style: normal; color: #ffd24a; } .war-log small { color: var(--muted); }
#warView { position: fixed; inset: 0; z-index: 80; background: #1a2217; touch-action: none; user-select: none; }
#warView canvas { position: absolute; inset: 0; }
.wv-top { position: absolute; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; pointer-events: none; }
.wv-side { display: flex; flex-direction: column; gap: 3px; padding: 6px 10px; border-radius: 10px; background: #000a; font-size: 13px; }
.wv-side b { color: #fff; } .wv-side span { font-family: 'Lilita One'; font-size: 12px; color: #ddd; }
.wv-side i { height: 8px; border-radius: 4px; background: #0008; overflow: hidden; }
.wv-side em { display: block; height: 100%; }
.wv-side.a { border-left: 4px solid #4aa3ff; } .wv-side.a em { background: linear-gradient(90deg, #2a6ad8, #4aa3ff); }
.wv-side.b { border-right: 4px solid #ff5a4a; text-align: right; } .wv-side.b em { background: linear-gradient(90deg, #ff5a4a, #c02a1a); margin-left: auto; }
.wv-mid { display: flex; flex-direction: column; align-items: center; padding: 4px 12px; border-radius: 10px; background: #000a; }
.wv-mid b { font-family: 'Lilita One'; font-size: 22px; color: #ffd24a; } .wv-mid small { font-size: 10px; color: #ccc; }
.wv-ctrl { position: absolute; bottom: calc(10px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
/* 競技場 5 對 5：只留「跳過」（使用者：競技場不應該有離開，就是跳過而已）；倍速、鏡頭、離開收掉，結束畫面照常有離開 */
#warView.small .wv-ctrl > :not([data-wv="skip"]) { display: none; }
.wv-ctrl button { white-space: nowrap; padding: 7px 10px; border-radius: 8px; border: 1px solid #6a5a44; background: #2a221cdd; color: #ffe9b0; font-size: 13px; }
.wv-ctrl button.on { background: #b8862a; color: #fff; }
/* 大軍分戰場：上路／中路／下路切換，顯示各戰場雙方存活數 */
.wv-lanes { position: absolute; top: calc(96px + var(--safe-t, 0px)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.wv-lanes button { display: flex; align-items: center; gap: 5px; white-space: nowrap; padding: 5px 10px; border-radius: 8px; border: 1px solid #6a5a44; background: #2a221cdd; color: #ffe9b0; font-size: 13px; }
.wv-lanes button.on { background: #b8862a; color: #fff; border-color: #ffd24a; }
.wv-lanes .a { color: #7cc4ff; font-family: 'Lilita One'; } .wv-lanes .b { color: #ff8a7a; font-family: 'Lilita One'; } .wv-lanes i { color: #fff8; font-style: normal; }
.wv-hint { position: absolute; bottom: calc(52px + var(--safe-b)); left: 0; right: 0; text-align: center; font-size: 11px; color: #fff9; pointer-events: none; }
.wv-focus { position: absolute; right: 10px; top: calc(76px + var(--safe-t)); width: 230px; padding: 10px; border-radius: 12px; background: #120e0bee; border: 1px solid #6a5a44; font-size: 12px; }
.wv-x { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: #ccc; font-size: 18px; }
.wv-f-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 6px; padding-right: 16px; }
.wv-f-head b { font-size: 15px; } .wv-f-head small { width: 100%; color: #bbb; }
.wv-f-hp { position: relative; height: 14px; border-radius: 7px; background: #0008; overflow: hidden; margin-bottom: 6px; }
.wv-f-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3ac05a, #7aff8a); }
.wv-f-hp span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 14px; color: #fff; text-shadow: 0 1px 1px #000; }
.wv-f-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.wv-f-stats div { display: flex; justify-content: space-between; padding: 3px 6px; border-radius: 6px; background: #2a221c; }
.wv-f-stats span { color: #aaa; } .wv-f-stats b { font-family: 'Lilita One'; color: #ffe9b0; }
.wv-end { position: absolute; inset: 0; display: grid; place-items: center; background: #0008; }
.wv-end-card { width: min(520px, 94vw); max-height: 86vh; overflow: auto; padding: 16px; border-radius: 16px; background: linear-gradient(#2a221c, #16110d); border: 2px solid #8a7a5a; }
.wv-end-card > h2 { text-align: center; font-size: 30px; margin: 0 0 8px; letter-spacing: 8px; }
.wv-end-card.win h2 { color: #ffd24a; text-shadow: 0 0 16px #ffb03a; } .wv-end-card.lose h2 { color: #aab; }
.wv-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wv-sum > div { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; background: #0006; font-size: 12px; }
.wv-sum > div:first-child { border-left: 3px solid #4aa3ff; } .wv-sum > div:last-child { border-left: 3px solid #ff5a4a; }
.wv-mvp, .wv-reward { text-align: center; margin: 8px 0; } .wv-mvp b { color: #ffd24a; }
.wv-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; }
.wv-tops h4 { margin: 6px 0 4px; }
.wv-tops ol { margin: 0; padding-left: 18px; }
.wv-tops li { display: grid; grid-template-columns: 1fr auto auto; gap: 4px; padding: 2px 0; cursor: pointer; }
.wv-tops li small { grid-column: 1 / -1; color: #999; font-size: 10px; margin-top: -2px; }
.wv-tops li em { font-style: normal; color: #ffe9b0; }
/* 結算面板（圖為主，war.js finish）：勝負大字演出、雙方頭像、MVP、輸出橫條、獎勵圖示、醒目按鈕 */
.wv-end-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 16px; }
.wv-banner { position: relative; display: grid; place-items: center; height: 64px; margin: -4px 0 0; overflow: hidden; }
.wv-banner h2 { position: relative; z-index: 1; margin: 0; font-size: 40px; letter-spacing: 10px; animation: wvPop .55s cubic-bezier(.2, 1.7, .4, 1) both; }
.wv-end-card.win .wv-banner h2 { color: #ffe27a; text-shadow: 0 3px 0 #8a4a00, 0 0 22px #ffb03a; }
.wv-end-card.lose .wv-banner h2 { color: #c8ccd8; text-shadow: 0 3px 0 #2a2e3a; }
.wv-rays { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px; border-radius: 50%; background: repeating-conic-gradient(#ffd24a33 0 10deg, transparent 10deg 20deg); animation: wvSpin 9s linear infinite; mask: radial-gradient(#000 20%, transparent 68%); -webkit-mask: radial-gradient(#000 20%, transparent 68%); }
.wv-end-card.lose .wv-rays { display: none; }
@keyframes wvPop { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wvSpin { to { transform: rotate(360deg); } }
.wv-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.wv-team { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: #0005; min-width: 0; }
.wv-team.a { box-shadow: inset 0 0 0 2px #4aa3ff66; } .wv-team.b { box-shadow: inset 0 0 0 2px #ff5a4a66; }
.wv-team > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wv-team.a > b { color: #8ac8ff; } .wv-team.b > b { color: #ff9a8a; }
.wv-team small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #ddd; }
.wv-heads { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.wv-hd { position: relative; display: inline-block; zoom: .82; cursor: pointer; }
.wv-hd.dead { filter: grayscale(1) brightness(.55); }
.wv-hd.dead::after { content: ''; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 46%, #ff4a3acc 46% 54%, transparent 54%); }
.wv-hd em { position: absolute; right: -3px; bottom: -3px; min-width: 16px; padding: 0 3px; border-radius: 8px; background: #c8201a; color: #fff; font: 700 11px/16px sans-serif; font-style: normal; text-align: center; }
.wv-vs { font: 900 18px 'Lilita One', sans-serif; color: #ffd24a; text-shadow: 0 2px 0 #6a3a00; }
.wv-ic { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.wv-ic.alive { background: #4ae070; } .wv-ic.kill { background: #ff5a4a; margin-left: 6px; } .wv-ic.dmg { background: #ffb03a; }
.wv-mvp2 { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; background: linear-gradient(90deg, #ffd24a33, #0004 70%); box-shadow: inset 0 0 0 2px #ffd24a88; cursor: pointer; }
.wv-mvp-face { position: relative; zoom: 1.6; }
.wv-mvp-face::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(#ffd24a99, transparent 70%); animation: wvGlow 1.6s ease-in-out infinite; z-index: -1; }
@keyframes wvGlow { 50% { opacity: .4; transform: scale(1.15); } }
.wv-mvp-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wv-mvp-txt span { font: 900 14px 'Lilita One', sans-serif; letter-spacing: 2px; color: #ffd24a; }
.wv-mvp-txt b { font-size: 18px; color: #fff3c4; }
.wv-mvp-txt small { display: flex; align-items: center; gap: 4px; color: #ddd; }
.wv-end-card .wv-reward { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin: 0; padding: 8px; border-radius: 12px; background: #0005; font-size: 14px; }
.wv-end-card .wv-reward .cost { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 999px; background: #ffffff10; font-size: 16px; font-weight: 700; color: #fff3c4; }
.wv-end-card .wv-reward .cost .ci { width: 24px; height: 24px; }
.wv-tops2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wv-tops2 ol { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 6px; list-style: none; border-radius: 10px; background: #0004; }
.wv-tops2 li { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.wv-tops2 li > :first-child { zoom: .7; flex: none; }
.wv-bar { position: relative; flex: 1; height: 18px; border-radius: 9px; background: #ffffff10; overflow: hidden; }
.wv-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 9px; }
.wv-tops2 .a .wv-bar i { background: linear-gradient(90deg, #2a6fd0, #6ab8ff); } .wv-tops2 .b .wv-bar i { background: linear-gradient(90deg, #b02a20, #ff7a6a); }
.wv-bar b { position: relative; display: block; padding: 0 6px; font-size: 11px; line-height: 18px; color: #fff; text-shadow: 0 1px 2px #000; }
.wv-gap2 { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: #bbb; }
.wv-gap2 span { display: inline-flex; align-items: baseline; gap: 3px; } .wv-gap2 small { color: #999; }
.wv-gap2 b.up { color: #7dff9a; } .wv-gap2 b.down { color: #ff8a7a; } .wv-gap2 i { font-style: normal; color: #777; }
.wv-end-card .wv-why { margin: -4px 0 0; text-align: center; font-size: 12px; color: #ffcf8a; }
.wv-btns { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.wv-btns .btn { min-height: 44px; font-size: 15px; }
.wv-btns .btn.gold { font-size: 17px; box-shadow: 0 0 14px #ffb03a88; }
.wv-init { display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; }
@media (max-width: 640px) {
  .wv-focus { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(96px + var(--safe-b)); }
  .wv-f-stats { grid-template-columns: repeat(3, 1fr); }
  .wv-ctrl { width: calc(100% - 16px); justify-content: center; }
  .wv-ctrl button { padding: 6px 6px; font-size: 12px; flex: 0 1 auto; }
  .wv-hint { bottom: calc(50px + var(--safe-b)); padding: 0 12px; }
}

/* ---------- 第三方登入 ---------- */
.sso-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0; }
.sso-item { display: flex; justify-content: center; min-height: 40px; }
.sso-btn { width: 240px; height: 40px; border-radius: 20px; border: 0; font: inherit; font-size: 15px; cursor: pointer; }
.sso-apple { background: #000; color: #fff; }
.sso-gamecenter { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
/* App 版自製的 Google 按鈕（網頁版用 Google 官方按鈕）：照 Google 品牌規範的淺色款——白底、深灰字、灰框、彩色 G */
.sso-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.sso-google::before { content: ''; width: 18px; height: 18px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center / contain no-repeat; }
.sso-line { background: #06c755; color: #fff; }
.sso-or { margin: 12px 0 0; }

/* ---------- 英雄聚焦戰績卡 ---------- */
#heroFocus { position: fixed; right: 10px; top: calc(150px + var(--safe-t)); z-index: 40; width: 220px; padding: 10px; border-radius: 12px; background: #120e0bee; border: 1px solid #8a7a5a; box-shadow: 0 6px 18px #000a; font-size: 12px; animation: hfIn .25s ease-out; }
@keyframes hfIn { from { opacity: 0; transform: translateX(20px); } }
#heroFocus .hf-x { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: #ccc; font-size: 18px; }
.hf-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; padding-right: 14px; }
.hf-head b { display: flex; gap: 4px; align-items: center; font-size: 14px; } .hf-head small { display: block; color: #bbb; }
.hf-hp { position: relative; height: 14px; border-radius: 7px; background: #0008; overflow: hidden; }
.hf-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3ac05a, #7aff8a); transition: width .3s; }
.hf-hp span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 14px; color: #fff; text-shadow: 0 1px 1px #000; }
#heroFocus h5, .hero-record h5 { margin: 8px 0 4px; font-size: 11px; color: var(--title); }
.hf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.hf-stats div { display: flex; justify-content: space-between; padding: 2px 6px; border-radius: 5px; background: #2a221c; }
.hf-stats span { color: #aaa; } .hf-stats b { font-family: 'Lilita One'; color: #ffe9b0; font-weight: 400; }
#heroFocus .btn { width: 100%; margin-top: 8px; }
.hf-stats.wide { grid-template-columns: 1fr 1fr; gap: 8px; }
.hf-stats.wide .hf-col { display: flex; flex-direction: column; gap: 3px; background: none; padding: 0; }
.hero-record { margin-top: 8px; }
@media (max-width: 640px) { #heroFocus { top: auto; bottom: calc(150px + var(--safe-b)); right: 8px; width: 200px; } }

/* ---------- 神匠鍛造 ---------- */
.forge-banner { display: flex; gap: 12px; align-items: center; padding: 14px; margin: 6px 0; border-radius: 14px; background: radial-gradient(circle at 20% 50%, #ff8a2a55, transparent 60%), linear-gradient(135deg, #3a2412, #1a120c); border: 2px solid #8a5a2a; }
.forge-banner b { display: block; font-size: 22px; color: #ffd24a; letter-spacing: 4px; text-shadow: 0 0 10px #ff8a2a; }
.forge-banner span { font-size: 12px; color: #e8d8c0; }
.forge-banner .myth { font-style: normal; background: linear-gradient(90deg, #ff3b6b, #ffd24a, #4cc38a, #3f8ee0, #9b35d8); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.forge-anvil { width: 64px; height: 64px; flex: none; background: url('../assets/ui/px/eq/weapon_4.png') center/80% no-repeat, radial-gradient(circle, #ff8a2a88, transparent 70%); animation: anvilGlow 1.6s ease-in-out infinite; }
@keyframes anvilGlow { 50% { transform: scale(1.06); } }
.forge-rates { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.forge-rates span { padding: 2px 8px; border-radius: 10px; font-size: 11px; background: #2a221c; border: 1px solid #4d4234; }
.forge-rates .r1 { color: #6fd36f; } .forge-rates .r2 { color: #4aa3ff; } .forge-rates .r3 { color: #c07aff; } .forge-rates .r4 { color: #ffb03a; }
.forge-rates .r5 { color: #fff; background: linear-gradient(90deg, #ff3b6b88, #ffd24a88, #4cc38a88, #3f8ee088, #9b35d888); }
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 10px 0; }
.fg-grid:not(.ten) { grid-template-columns: 160px; justify-content: center; }
.fg-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; background: #221b15; border: 2px solid #5a4a3a; text-align: center; opacity: 0; transform: rotateY(90deg) scale(.8); animation: fgFlip .45s cubic-bezier(.2, 1.4, .4, 1) forwards; overflow: hidden; }
.fg-card img { width: 52px; height: 52px; image-rendering: auto; position: relative; }
.fg-card b { font-size: 13px; position: relative; } .fg-card span { font-size: 11px; color: #bbb; position: relative; } .fg-card small { font-size: 11px; color: #6dff9a; position: relative; }
.fg-glow { position: absolute; inset: 0; opacity: .6; }
.fg-card.r1 { border-color: #3f8a3f; } .fg-card.r2 { border-color: #2a6ad8; } .fg-card.r2 .fg-glow { background: radial-gradient(circle, #2a6ad855, transparent 70%); }
.fg-card.r3 { border-color: #9b35d8; box-shadow: 0 0 12px #9b35d888; } .fg-card.r3 .fg-glow { background: radial-gradient(circle, #9b35d877, transparent 70%); }
.fg-card.r4 { border-color: #ffb03a; box-shadow: 0 0 18px #ffb03aaa; } .fg-card.r4 .fg-glow { background: radial-gradient(circle, #ffb03a88, transparent 70%); animation: fgPulse 1.2s infinite; }
.fg-card.r5 { border-color: #fff; box-shadow: 0 0 26px #ff3b6b, 0 0 40px #ffd24a88; background: linear-gradient(135deg, #5a1a3a, #2a1a4a, #1a3a5a); }
.fg-card.r5 .fg-glow { background: conic-gradient(from 0deg, #ff3b6b66, #ffd24a66, #4cc38a66, #3f8ee066, #9b35d866, #ff3b6b66); animation: rainbow 2s linear infinite; }
.fg-card.r4 b, .fg-card.r5 b { color: #ffd24a; }
@keyframes fgFlip { to { opacity: 1; transform: none; } }
@keyframes fgPulse { 50% { opacity: 1; } }
.forge-modal.mythic { box-shadow: 0 0 60px #ff3b6b, 0 0 120px #ffd24a66; }
@media (min-width: 640px) { .fg-grid.ten { grid-template-columns: repeat(5, 1fr); } .forge-modal { width: min(720px, 94vw); } }

/* ---------- 大招特寫 ---------- */
.cutin { position: fixed; left: 0; right: 0; top: 36%; height: 128px; z-index: 70; pointer-events: none; display: flex; align-items: center; gap: 16px; padding-left: max(8%, 20px); animation: ciWrap 1.25s ease-in-out forwards; }
.ci-bar { position: absolute; inset: 14px -10%; transform: skewY(-4deg); background: linear-gradient(90deg, transparent, #000c 12%, #000c 88%, transparent); border-top: 3px solid var(--kc); border-bottom: 3px solid var(--kc); box-shadow: 0 0 24px var(--kc); }
.ci-lines { position: absolute; inset: 14px -10%; transform: skewY(-4deg); background: repeating-linear-gradient(90deg, transparent 0 40px, color-mix(in srgb, var(--kc) 35%, transparent) 40px 44px); animation: ciLines .4s linear infinite; opacity: .7; }
.ci-hero { position: relative; transform: scale(1.1); filter: drop-shadow(0 0 12px var(--kc)); animation: ciHero 1.25s ease-out forwards; }
.ci-hero .px-av, .ci-hero img { image-rendering: pixelated; }
.ci-text { position: relative; display: flex; flex-direction: column; }
.ci-text small { font-size: 14px; color: #fff; letter-spacing: 2px; text-shadow: 0 0 4px #000, 0 2px 0 #000; }
.ci-text b { font-size: 38px; letter-spacing: 6px; white-space: nowrap; color: #fff;
  /* 用陰影做外框（不用 text-stroke：中文筆畫密，描邊會吃掉白色字心變成黑字） */
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000, 0 0 14px var(--kc), 0 0 28px var(--kc), 0 5px 0 #000;
  animation: ciText 1.25s ease-out forwards; }
.cutin.myth .ci-bar { border-image: linear-gradient(90deg, #ff3b6b, #ffd24a, #4cc38a, #3f8ee0, #9b35d8) 1; box-shadow: 0 0 36px #ffd24a; }
.cutin.myth .ci-text b { background: linear-gradient(90deg, #ff9ab0, #fff3a0, #9affc8, #9ad0ff, #e0a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 0; text-shadow: none; filter: drop-shadow(0 0 8px #ffd24a) drop-shadow(0 3px 0 #000) drop-shadow(0 0 2px #000); }
@keyframes ciWrap { 0% { transform: translateX(-110%); } 14% { transform: translateX(0); } 82% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(40%); opacity: 0; } }
@keyframes ciLines { to { background-position: 44px 0; } }
@keyframes ciHero { 0% { transform: scale(1.4) translateX(-30px); } 20% { transform: scale(1.1); } 100% { transform: scale(1.15) translateX(10px); } }
@keyframes ciText { 0% { transform: scale(1.6); opacity: 0; } 20% { transform: scale(.95); opacity: 1; } 28% { transform: scale(1); } 100% { transform: translateX(16px); } }
@media (max-width: 640px) { .cutin { height: 104px; top: 34%; } .ci-text b { font-size: 26px; letter-spacing: 3px; } .ci-hero { transform: scale(.85); } }

/* ---------- 首領血條 ---------- */
#bossbar { position: absolute; top: calc(140px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(460px, 76vw); z-index: 12; pointer-events: none; padding: 5px 10px 7px; border-radius: 10px; background: linear-gradient(#2a0e0ce8, #1a0806e8); border: 2px solid #8a2a1a; box-shadow: 0 3px 12px #000a, 0 0 14px #ff3a2a55; }
#bossbar.in { animation: bbIn .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes bbIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.9); } }
.bb-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.bb-el { flex: none; padding: 0 5px; border-radius: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 0 #0008; }
.bb-name { flex: 1; font-size: 13px; color: #ffd8c8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-pct { font-style: normal; font-family: 'Lilita One'; font-size: 15px; color: #ffe27a; }
.bb-bar { position: relative; height: 14px; border-radius: 7px; background: #0009; overflow: hidden; border: 1px solid #000; }
.bb-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 7px; }
.bb-trail { background: #fff6e0; transition: width .6s ease-out .25s; }
.bb-hp { background: linear-gradient(#ff7a5a, #d02a1a 60%, #8a1208); transition: width .15s linear; box-shadow: inset 0 1px 0 #ffb0a0; }
.bb-num { position: relative; display: block; text-align: center; font-size: 10px; line-height: 14px; color: #fff; text-shadow: 0 1px 1px #000, 0 0 2px #000; }
#bossbar.low .bb-hp { animation: bbLow .5s ease-in-out infinite alternate; }
@keyframes bbLow { to { opacity: .6; } }
body.town #bossbar { display: none; }
@media (max-width: 640px) { #bossbar { top: calc(166px + var(--safe-t)); width: calc(100vw - 140px); } }

/* ---------- 世界地圖 ---------- */
#worldMap { position: fixed; inset: 0; z-index: 78; background: #47aba9; touch-action: none; user-select: none; }
#worldMap canvas { position: absolute; inset: 0; }
.wm-top { position: absolute; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; gap: 8px; align-items: center; }
.wm-title { display: flex; flex-direction: column; padding: 6px 12px; border-radius: 10px; background: #000b; }
.wm-title b { font-size: 16px; color: #ffd24a; letter-spacing: 2px; } .wm-title small { font-size: 11px; color: #ddd; }
.wm-orders { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; padding: 6px 12px; border-radius: 10px; background: #000b; }
.wm-orders b { color: #fff; font-size: 14px; } .wm-orders small { font-size: 10px; color: #bbb; }
.wm-x { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #8a7a5a; background: #2a221cdd; color: #fff; font-size: 18px; }
.wm-x.sm { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; font-size: 14px; }
.wm-guild { position: absolute; top: calc(66px + var(--safe-t)); left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: #000a; font-size: 12px; color: #eee; }
.wm-war { width: 100%; color: #ffb0a0; }
.wm-panel { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(460px, 94vw); padding: 12px; border-radius: 14px; background: #120e0bf0; border: 1px solid #8a7a5a; box-shadow: 0 6px 20px #000a; font-size: 13px; }
.wm-p-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; padding-right: 30px; } .wm-p-head b { font-size: 16px; } .wm-p-head small { color: #aaa; }
.wm-hp { position: relative; height: 14px; border-radius: 7px; background: #0008; overflow: hidden; margin: 6px 0; }
.wm-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #d8a030, #ffd24a); }
.wm-hp span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 14px; color: #fff; text-shadow: 0 1px 1px #000; }
.wm-hint { position: absolute; bottom: calc(4px + var(--safe-b)); left: 0; right: 0; text-align: center; font-size: 11px; color: #fffa; pointer-events: none; }
.world-hero { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; margin: 6px 0; border-radius: 14px; background: linear-gradient(135deg, #1f5a58, #173a2a); border: 2px solid #4a9a8a; }
.world-hero > div { display: flex; flex-direction: column; gap: 2px; } .world-hero b { font-size: 17px; color: #ffe9b0; } .world-hero span { font-size: 12px; color: #d0e8e0; }

/* ---------- 陣營連動、羈絆、卡池、稱號 ---------- */
.fc-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.fc-chip { padding: 2px 8px; border-radius: 10px; font-size: 11px; background: #221b15; border: 1px solid color-mix(in srgb, var(--fc, #888) 50%, transparent); color: #ccc; }
.fc-chip.on { background: color-mix(in srgb, var(--fc, #ffd24a) 25%, #221b15); color: #fff; border-color: var(--fc, #ffd24a); }
.bond-chip { --fc: #ffd24a; }
.faction-card { border-left: 4px solid var(--fc); }
.fc-badge { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 5px; background: var(--fc); color: #000; font-size: 12px; }
.bond { margin-top: 3px; color: #aaa; } .bond.on { color: #ffe9b0; } .bond s { color: #777; }
.banner-sel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
.banner-sel button { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; border-radius: 10px; background: #221b15; border: 1px solid #4d4234; color: #ddd; text-align: center; }
.banner-sel button b { font-size: 13px; } .banner-sel button small { font-size: 10px; color: #aaa; }
.banner-sel button.on { background: linear-gradient(#5a3a8a, #2a1a4a); border-color: #c07aff; color: #fff; box-shadow: 0 0 10px #9b35d888; }
.ptitle { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: linear-gradient(90deg, #b8862a, #ffd24a); color: #3a2000; font-style: normal; font-size: 10px; font-weight: 700; }
.prosper .lvbar { margin: 6px 0; }

/* ---------- 名將圖鑑 ---------- */
.cx-head .lvbar { margin: 6px 0; }
.cx-tabs .fc-chip { cursor: pointer; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cx-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 18px 4px 6px; border-radius: 10px; background: #221b15; border: 2px solid #4d4234; color: #eee; }
.cx-card .rar { position: absolute; left: 4px; top: 4px; }
.cx-card .stars { position: absolute; right: 4px; top: 3px; font-size: 9px; color: #ffd24a; }
.cx-card b { font-size: 11px; text-align: center; line-height: 1.2; } .cx-card small { font-size: 10px; color: #aaa; }
.cx-card.r3 { border-color: #7a3aaa; } .cx-card.r4 { border-color: #c06a10; } .cx-card.r5 { border-color: #ff3b6b; box-shadow: 0 0 8px #ff3b6b66; }
.cx-card.lock .px-av, .cx-card.lock img { filter: grayscale(1) brightness(.45); }
.cx-card.lock b { color: #888; }
.cx-up { position: absolute; bottom: 38px; font-style: normal; font-size: 9px; padding: 0 4px; border-radius: 4px; background: #9b35d8; color: #fff; }
.cx-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0; }
.cx-tiers div { display: flex; flex-direction: column; padding: 4px; border-radius: 6px; background: #1a1511; font-size: 10px; color: #888; text-align: center; }
.cx-tiers div.on { background: color-mix(in srgb, var(--fc) 30%, #1a1511); color: #fff; }
.cx-bond { padding: 8px; border-radius: 10px; background: #221b15; border: 1px solid #4d4234; }
.cx-bond.on { border-color: #ffd24a; box-shadow: 0 0 8px #ffd24a55; }
.cx-bond-heroes { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.cx-bond-heroes span { padding: 1px 6px; border-radius: 6px; font-size: 11px; background: #1a1511; color: #777; }
.cx-bond-heroes span.own { background: #3a5a2a; color: #dfffd0; }
/* 卡池橫幅依選擇變化 */
.gacha-banner { border-color: var(--bc, #8a6ad0); background: radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--bc, #ffb74a) 55%, transparent), transparent 60%), linear-gradient(color-mix(in srgb, var(--bc, #3a2a5a) 35%, #1d1426), #1d1426); transition: background .3s, border-color .3s; }
.gb-h { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.gb-h i { font-style: normal; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; margin-top: -6px; white-space: nowrap; }
.gb-up { position: absolute; right: 10px; top: 10px; padding: 2px 8px; border-radius: 8px; background: linear-gradient(#ff6a9a, #c02a5a); color: #fff; font-size: 13px; font-weight: 700; animation: anvilGlow 1.4s ease-in-out infinite; }
.gb-heroes { display: flex; flex-wrap: wrap; justify-content: center; }
.gb-h i { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
/* 手機主城：收起左側按鈕與任務欄，讓出畫面給建築 */
@media (max-width: 700px) { body.town .side-left, body.town .quest, body.town .ticker { display: none !important; } body.town .town-title { top: calc(126px + var(--safe-t)); padding: 2px 16px 4px; font-size: 15px; } }
.war-on { color: #ff8a6a; animation: anvilGlow 1.4s ease-in-out infinite; }
.wm-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0; color: #ddd; }
.rules ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.rules summary { cursor: pointer; }

/* =========================================================
   Tiny Swords 像素介面皮膚（取代石材風）：木桌面板、石板卡片、像素按鈕、緞帶標題、Cubic 11 像素字型
   素材：public/assets/ui/ts（tools/build_ts_ui.py 產生）
   ========================================================= */
@font-face { font-family: 'Cubic11'; src: url('../assets/fonts/Cubic_11.woff2') format('woff2'); font-display: swap; }
:root { --pixel: 'Cubic11', 'Huninn', 'PingFang TC', sans-serif; --num: 'Cubic11', 'Lilita One', sans-serif; --title: #ffe08a; }
.btn, .sheet-head h2, .modal-card h2, .tabs button, .seg button, .res b, .bottom-nav em, .medal em, .num, .big-num, .town-title, .stagebar, .gb-title, .bb-name, .bb-pct { font-family: var(--pixel); }
/* 按鈕 */
.btn { border-width: 12px; border-image: url('../assets/ui/ts/btn_brown.png') 47 45 47 45 fill / 12px stretch; image-rendering: pixelated; padding: 0 6px 2px; text-shadow: 0 2px 0 #0009; }
.btn.gold { border-image-source: url('../assets/ui/ts/btn_gold.png'); color: #3a2000; text-shadow: 0 1px 0 #fff6; }
.btn.green { border-image-source: url('../assets/ui/ts/btn_green.png'); color: #0f2a0a; text-shadow: 0 1px 0 #fff5; }
.btn.blue { border-image-source: url('../assets/ui/ts/btn_blue.png'); }
.btn.red, .btn.danger, .btn.confirm { border-image-source: url('../assets/ui/ts/btn_red.png'); }
.btn.purple { border-image-source: url('../assets/ui/ts/btn_purple.png'); }
.btn:not(:disabled):active { transform: translateY(2px); }
.btn.gold:not(:disabled):active { border-image-source: url('../assets/ui/ts/btn_gold_p.png'); }
.btn.red:not(:disabled):active { border-image-source: url('../assets/ui/ts/btn_red_p.png'); }
.btn.blue:not(:disabled):active { border-image-source: url('../assets/ui/ts/btn_blue_p.png'); }
.btn:disabled { filter: grayscale(.85) brightness(.8); }
.btn.sm { border-width: 9px; border-image-width: 9px; min-height: 34px; }
/* 面板：木桌 */
.sheet { background: none !important; border: 0 !important; border-radius: 0; border-style: solid !important; border-width: 22px 20px 0 !important; border-image: url('../assets/ui/ts/wood.png') 85 84 0 84 / 22px 20px 0 20px stretch !important; image-rendering: pixelated; box-shadow: 0 -6px 18px #0008; background: linear-gradient(#3a2618, #2a1b12) padding-box !important; }
@media (min-width: 900px) { .sheet { border-width: 22px 20px 26px !important; border-image: url('../assets/ui/ts/wood.png') 85 84 103 84 / 22px 20px 26px 20px stretch !important; } }
.sheet::before, .sheet::after { display: none; }
.sheet-head { padding: 0 48px 6px; margin-top: -8px; }
.sheet-head h2 { background: none; padding: 2px 44px 10px; border-style: solid; border-width: 0 34px; border-image: url('../assets/ui/ts/ribbon0.png') 0 97 0 98 fill / 0 34px stretch; image-rendering: pixelated; font-size: 18px; letter-spacing: 2px; color: #fff; text-shadow: 0 2px 0 #1a3a44, 1px 0 0 #1a3a44, -1px 0 0 #1a3a44; }
.sheet-body { scrollbar-color: #c89a5a transparent; }
.sheet-body h4 { color: #ffe08a; text-shadow: 0 2px 0 #3a1f0a; }
.sheet-body h4::before { background: #ffe08a; }
/* 卡片：深色石板 */
.card, .bld, .tech, .opp, .mail, .war-head > div, .cx-bond, .pack-card, .world-hero { background: none !important; border-style: solid !important; border-width: 11px 13px !important; border-color: transparent; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 11px 13px stretch !important; border-radius: 0 !important; box-shadow: none !important; image-rendering: pixelated; }
.card { padding: 4px 2px; }
.opp, .tech, .bld, .mail { padding: 2px 0; }
.dcard { background: linear-gradient(#56606a, #3e454d); border-radius: 6px; }
/* 分頁 */
.tabs button, .seg button { clip-path: none; background: none; border-style: solid; border-width: 8px; border-image: url('../assets/ui/ts/btn_brown.png') 47 45 47 45 fill / 8px stretch; color: #f4e2c4; padding: 2px 4px; image-rendering: pixelated; }
.tabs button.on, .seg button.on { background: none; border-image-source: url('../assets/ui/ts/btn_gold.png'); color: #3a2000; text-shadow: 0 1px 0 #fff6; }
/* 彈窗 */
.modal-card { background: linear-gradient(#3a2618, #2a1b12) padding-box !important; border-radius: 0; border-style: solid; border-width: 22px 20px 26px; border-image: url('../assets/ui/ts/wood.png') 85 84 103 84 / 22px 20px 26px 20px stretch; image-rendering: pixelated; }
/* 頂部資源列、關卡列 */
.res > div { background: none; border-style: solid; border-width: 7px 9px; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 7px 9px stretch; border-radius: 0; box-shadow: none; height: 32px; }
.stagebar { background: none !important; border-style: solid !important; border-width: 9px 12px !important; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 9px 12px stretch !important; border-radius: 0 !important; }
/* 底部導覽：木條 */
.bottom-nav { background: linear-gradient(#3a2618f0, #2a1b12f0) padding-box; border-style: solid; border-width: 14px 12px 0; border-image: url('../assets/ui/ts/wood.png') 85 84 0 84 / 14px 12px 0 stretch; image-rendering: pixelated; }
@media (min-width: 900px) { .bottom-nav { border-radius: 0; border-color: transparent; border-style: solid; border-width: 14px 12px 0; } }
/* 像素圖示（SPUM 復古介面包，tools/build_px_icons.py 產生）：清晰像素顯示＋小小劍士按鈕底座 */
.ic img, .ci, .bottom-nav span img, .medal span img, .skill-icon img, .bicon img, .gemimg, .cmd-bar img, [data-cmd] img, .eq-icon img, .fg-glow + img, .act-chest img, img[src*="assets/ui/px/eq/"], img[src*="assets/ui/px/icon_"] { image-rendering: pixelated; }
.bottom-nav span { background-image: url('../assets/ui/ts/square_wood.png'); padding: 10px; image-rendering: pixelated; }
.bottom-nav .center-btn span { background-image: url('../assets/ui/ts/smallblueroundbutton_regular.png'); padding: 15px; }
.medal span { background-image: url('../assets/ui/ts/round_wood.png'); padding: 10px; image-rendering: pixelated; }
.ci-power { background-image: url('../assets/ui/px/misc_vs.png'); image-rendering: pixelated; }
/* 戰場畫布：像素清晰放大（避免降畫質時整片糊掉） */
#field { image-rendering: pixelated; }
/* iPhone 加到主畫面（獨立模式）：100dvh 會少算狀態列高度，底部露出黑邊 → 改用整個螢幕 */
@media (display-mode: standalone) { html, body { height: 100vh; } body { position: fixed; inset: 0; height: auto; } }

/* =========================================================
   手機直式介面重新編排：頂部壓縮成三排、左側按鈕縮小、底部依序為「導覽列 → 世界聊天 → 任務／技能」不互相遮擋
   ========================================================= */
@media (max-width: 640px) {
  /* 頂部：頭像列 → 資源一排 6 格 → 關卡列 */
  .topbar { top: calc(4px + var(--safe-t)); left: 6px; right: 6px; row-gap: 4px; }
  .avatar { width: 40px; height: 40px; }
  #seal { inset: 7px; font-size: 13px; }
  #vip { min-width: 18px; height: 16px; font-size: 9px; padding: 0 3px; border-width: 1px; right: -4px; bottom: -3px; }
  .who { margin-left: -10px; padding: 2px 10px 3px 14px; }
  .nameline b { font-size: 12px; max-width: 110px; }
  #netstate { font-size: 9px; }
  .powerline b { font-size: 14px; }
  .powerline .ci { width: 13px; height: 13px; }
  .res { flex-wrap: nowrap; gap: 3px; padding-left: 0; }
  .res > div { flex: 1 1 0; min-width: 0; height: 24px; padding: 0 3px 0 17px; border-width: 5px 6px; border-image-width: 5px 6px; }
  .res > div.jade { padding-right: 3px; }
  .res > div .plus { display: none; }
  .res b { font-size: 11px; }
  .ic { width: 20px; height: 20px; left: -7px; }
  .stagebar { top: calc(78px + var(--safe-t)); padding: 1px 6px; gap: 6px; border-width: 6px 8px !important; border-image-width: 6px 8px !important; }
  #stageName { font-size: 12px; }
  #killbar { width: 70px; }
  #bossBtn { padding: 0 6px; min-height: 26px; font-size: 12px; }
  #bossbar { top: calc(134px + var(--safe-t)); width: calc(100vw - 110px); padding: 3px 8px 5px; } /* 讓出關卡列下方的「你 Lv vs 首領 Lv」 */
  #toasts { top: calc(118px + var(--safe-t)); }
  body.town .town-title { top: calc(78px + var(--safe-t)) !important; }
  /* 左側按鈕：縮小、緊湊 */
  .side-left { top: calc(118px + var(--safe-t)); left: 4px; gap: 1px; }
  .medal { width: 44px; }
  .medal span { width: 34px; height: 35px; padding: 7px; }
  .medal em { font-size: 9px; margin-top: -3px; }
  .medal.dot::after, .medal .dot::after { transform: scale(.75); }
  /* 直式一欄太長會擋到戰場：拆到畫面左右兩邊各一欄（中間不擋點擊），左邊每日與付費，右邊排行、任務、郵件、社交；按鈕一個都不藏
     右欄往下讓開首領血條與右上的目標提示（收成等），下方離擂鼓／戰鼓列還很遠 */
  .side-left { left: 4px; right: 4px; display: grid; grid-template-columns: 44px 1fr 44px; grid-auto-flow: row dense; align-items: start; gap: 1px 0; }
  .side-left > * { grid-column: 1; }
  .side-left > :is([data-open=seven], [data-open=rank], [data-open=tasks], [data-open=signin], [data-open=mail], [data-open=social]) { grid-column: 3; transform: translateY(86px); }
  .side-left > :is([data-open=seven], [data-open=rank], [data-open=tasks], [data-open=signin], [data-open=mail], [data-open=social]).locked::before { left: auto; right: 0; transform: none; } /* 右欄的「第 N 關」鎖頭標籤靠右對齊，不超出畫面 */
  /* 底部：導覽列變矮 */
  .bottom-nav { padding: 2px 2px calc(2px + var(--safe-b)); border-width: 10px 8px 0; border-image-width: 10px 8px 0; }
  .bottom-nav span { width: 40px; height: 40px; padding: 7px; }
  .bottom-nav em { font-size: 10px; }
  .bottom-nav .center-btn span { width: 52px; height: 54px; margin-top: -14px; padding: 12px; }
  /* 世界聊天：緊貼導覽列上方整排 */
  .ticker { left: 6px; right: 6px; max-width: none; bottom: calc(72px + var(--safe-b)); font-size: 11px; padding: 2px 8px; }
  /* 任務卡（左）與技能（右）在聊天上方同一列 */
  .quest { bottom: calc(96px + var(--safe-b)); left: 6px; max-width: 54vw; padding: 4px 8px 4px 5px; column-gap: 6px; }
  .quest .qtag { font-size: 10px; padding: 4px 3px; }
  .quest #questText { font-size: 12px; }
  .quest small { font-size: 10px; }
  .cmd-bar { bottom: calc(98px + var(--safe-b)); right: 6px; gap: 6px; }
  .cmd-bar button { width: 40px; height: 40px; }
  .cmd-bar button.big { width: 50px; height: 50px; }
  #heroFocus { bottom: calc(160px + var(--safe-b)); }
  /* 主城（ui-town.js）：待辦列貼在導覽列上方、卡片在待辦列上方；返回戰場移到右上 */
  body.town .town-bar { bottom: calc(76px + var(--safe-b)); left: 6px; right: 6px; }
  body.town .town-card:not([hidden]) { bottom: calc(184px + var(--safe-b)); left: 6px; right: 6px; }
  body.town .town-back img { width: 16px; height: 16px; }
}
/* 首領戰場：隱藏一般戰場介面，只留首領血條、跳過鈕與結算卡 */
body.arena .side-left, body.arena .quest, body.arena .ticker, body.arena .cmd-bar, body.arena .stagebar, body.arena #combo, body.arena .town-tools, body.arena .town-back, body.arena .town-title, body.arena #heroFocus { display: none !important; }
body.arena #bossbar { display: block !important; top: calc(84px + var(--safe-t)); }
#arenaHud .ar-skip { position: absolute; right: 10px; top: calc(128px + var(--safe-t)); z-index: 30; }
#arenaHud .ar-res { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 30; min-width: 240px; padding: 16px 22px; text-align: center; border-style: solid; border-width: 22px 20px 26px; border-image: url('../assets/ui/ts/wood.png') 85 84 103 84 / 22px 20px 26px 20px stretch; background: linear-gradient(#3a2618, #2a1b12) padding-box; image-rendering: pixelated; animation: arIn .35s cubic-bezier(.2, 1.4, .4, 1); }
#arenaHud .ar-res b { display: block; font: 26px var(--pixel); color: #ffd24a; text-shadow: 0 3px 0 #4a1a00; margin-bottom: 6px; }
#arenaHud .ar-res div { margin-bottom: 12px; font-size: 14px; }
@keyframes arIn { from { opacity: 0; transform: translate(-50%, -40%) scale(.8); } }
/* 傳承 */
.legacy-card { display: flex; align-items: center; justify-content: space-around; gap: 8px; text-align: center; }
.legacy-card > div { display: flex; flex-direction: column; gap: 2px; }
.legacy-card b { font-size: 26px; }
.legacy-arrow { font-size: 22px; color: var(--title); }
.legacy-rules .card { margin: 0; }
#legacyBtn.hot { animation: glow 1.2s infinite; }
@media (max-width: 640px) { #legacyBtn { padding: 0 6px; min-height: 26px; font-size: 12px; } }
/* 招募：卡池選擇、新手自選、限時大保底、印記 */
.banner-sel { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin-bottom: 8px; }
.banner-sel .bs-newbie b { color: #7dff9a; } .banner-sel .bs-limited b { color: #ff8ac0; }
.gb-h.picked { outline: 3px solid #7dff9a; border-radius: 10px; }
.gb-h[data-act] { cursor: pointer; }
.gb-guar { position: absolute; left: 10px; top: 10px; padding: 2px 8px; border-radius: 8px; background: #ff4a8a; color: #fff; font-size: 12px; box-shadow: 0 0 10px #ff4a8a; }
.gacha-btns em.off { font-style: normal; color: #7dff9a; margin-left: 4px; }
.gacha-well .row { margin-bottom: 6px; }
.gacha-log div { padding: 4px 0; border-bottom: 1px solid #ffffff14; font-size: 13px; }
.dcard.on { outline: 3px solid var(--gold); }
/* 分批解鎖與新手引導 */
.bottom-nav button.locked span { filter: grayscale(1) brightness(.55); }
.bottom-nav button.locked::after { content: '🔒 ' attr(data-lock); position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: 9px; color: #fff; background: #000b; padding: 0 4px; border-radius: 4px; white-space: nowrap; }
/* 左側選單的未開放入口：一樣顯示，掛鎖＋「第 N 關」（紅點用 ::after，這裡用 ::before） */
.medal.locked span { filter: grayscale(1) brightness(.55) drop-shadow(0 3px 2px #0008); }
.medal.locked::before { content: '🔒 ' attr(data-lock); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 4; font-size: 9px; color: #fff; background: #000b; padding: 0 4px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.tabs button.locked { opacity: .45; }
.tut-ring { position: fixed; z-index: 60; pointer-events: none; border: 3px solid #ffe27a; border-radius: 14px; box-shadow: 0 0 0 4000px #0005, 0 0 18px #ffd24a; animation: tutPulse 1.2s ease-in-out infinite; }
.tut-tip { position: fixed; z-index: 61; width: 220px; padding: 8px 10px; border-radius: 10px; background: #2a1b12; border: 2px solid #ffe27a; color: #fff; font-size: 13px; pointer-events: none; box-shadow: 0 4px 12px #000a; }
@keyframes tutPulse { 50% { transform: scale(1.06); } }
.tut-ring.top { z-index: 90; } .tut-tip.top { z-index: 91; } /* 疊在招募結果（.gx）上面 */
/* 升星導引小卡（ui-unlocks.js starIntro）：同名英雄 → 碎片 → 星星 */
.star-intro { text-align: center; padding: 6px 2px 2px; }
.star-intro .si-flow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.star-intro .si-arr { color: #ffd24a; font-style: normal; font-size: 14px; animation: siArr 1s ease-in-out infinite; }
.star-intro .si-dup { position: relative; display: inline-flex; width: 64px; height: 50px; }
.star-intro .si-dup > * { position: absolute; top: 0; left: 0; }
.star-intro .si-dup > * + * { left: 18px; top: 6px; }
.star-intro .si-sh { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.star-intro .si-sh .ci { width: 34px; height: 34px; }
.star-intro .si-sh b { color: #ffd24a; font-size: 13px; }
.star-intro .si-st { font-size: 22px; }
.star-intro p { margin: 0 0 12px; font-size: 14px; color: #fff3d6; }
@keyframes siArr { 50% { transform: translateX(3px); opacity: .6; } }
/* 按住地面集結的教學（ui-unlocks.js rallyTut）：中心對準英雄前方的空地，不擋點擊 */
.rally-tut { position: fixed; z-index: 55; width: 0; height: 0; pointer-events: none; transition: left .6s, top .6s; }
.rally-tut .rt-ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #ffe27a; box-shadow: 0 0 12px #ffd24a; animation: rtPress 1.4s ease-out infinite; }
.rally-tut .rt-ring.r2 { animation-delay: .7s; }
.rally-tut::before { content: ''; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #ffe27a; box-shadow: 0 0 10px #ffd24a; animation: tutPulse 1.4s ease-in-out infinite; }
.rally-tut .rt-ic { position: absolute; left: -2px; top: -4px; animation: rtHand 1.4s ease-in-out infinite; filter: drop-shadow(0 2px 3px #000c); }
.rally-tut .rt-tx { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); white-space: nowrap; padding: 5px 10px; border-radius: 10px; background: #2a1b12e6; border: 2px solid #ffe27a; color: #fff; font-size: 13px; box-shadow: 0 4px 12px #000a; }
@keyframes rtPress { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes rtHand { 0%, 100% { transform: translate(6px, 8px); } 40%, 70% { transform: translate(0, 0) scale(.92); } }
/* 戰團 */
.band-sum { display: flex; justify-content: space-around; text-align: center; gap: 6px; }
.band-sum > div { display: flex; flex-direction: column; }
.band-sum b { font-size: 20px; }
.band .band-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.band-heroes { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px 0; }
.band-heroes span { cursor: pointer; }
.band.locked { opacity: .6; }

/* 戰團 */
.band-how { display: flex; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; counter-reset: bh; }
.band-how li { flex: 1; font-size: 12px; line-height: 1.35; color: var(--muted); background: #0003; border-radius: 6px; padding: 6px 6px 6px 24px; position: relative; counter-increment: bh; }
.band-how li::before { content: counter(bh); position: absolute; left: 6px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #ffb74a; color: #3a2000; font-size: 11px; text-align: center; line-height: 14px; }
.band-how b { color: #ffe08a; font-weight: 400; }
.band .band-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bchip { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: #0005; color: var(--muted); white-space: nowrap; }
.bchip.push { background: #c0392b; color: #fff; }
.bchip.farm { background: #2f7a3a; color: #fff; }
.bchip.idle { background: #7a5a2a; color: #ffe08a; }
.band-where { margin: 6px 0 2px; font-size: 16px; color: #ffe08a; }
.band-where small { margin-left: 8px; font-size: 12px; color: var(--muted); }
.band-mode { margin: 8px 0 0; }
.band-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; margin: 10px 0 6px; }
.band-slot { position: relative; aspect-ratio: 1; border: 1px solid #0006; border-radius: 6px; background: #0004; padding: 0; display: grid; place-items: center; overflow: hidden; }
.band-slot em { position: absolute; right: 1px; top: -2px; font-style: normal; font-size: 12px; color: #fff; text-shadow: 0 1px 0 #000; opacity: .7; }
.band-slot.empty { border: 1px dashed #ffe08a88; color: #ffe08a; font-size: 20px; background: #ffe08a10; }
.band-station { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; background: #0003; border-radius: 8px; padding: 6px; }
.band-station > div { flex: 1; text-align: center; display: flex; flex-direction: column; }
.band-station b { font-weight: 400; color: #ffe08a; font-size: 15px; }
.band-station small { font-size: 11px; color: var(--muted); }
.band-station .btn { min-width: 44px; }
.band-income { text-align: center; margin: 6px 0 8px; font-size: 13px; }
.band-income b { color: #9fe07a; font-weight: 400; }
.band-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.band-acts .wide { grid-column: 1 / -1; }
.band-acts .btn { padding-left: 2px; padding-right: 2px; }
.band-acts .btn small { display: block; }
.band-foot { text-align: right; margin-top: 4px; }
.danger-t { color: #ff8a7a !important; }
.band-pick { max-height: 55vh; overflow-y: auto; }
.tag.band { background: #2f7a3a; }

/* 手機：金幣、鑽石和玩家名片同一排，其餘 4 種資源第二排（一排 6 格太擠，數字會換行） */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; align-items: center; column-gap: 4px; }
  .topbar::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
  .res { display: contents; }
  .profile { order: 0; flex: none; }
  .res > div[data-res="stone"], .res > div.jade { order: 1; flex: 1 1 0; height: 28px; }
  .res > div[data-res="stone"] { margin-left: 8px; }
  .res > div:not([data-res="stone"]):not(.jade) { order: 3; flex: 1 1 0; }
  .res > div { margin-left: 7px; }
  .res > div:not([data-res="stone"]):not(.jade):first-of-type { margin-left: 7px; }
  .res b { white-space: nowrap; overflow: hidden; text-overflow: clip; font-size: 12px; }
  .res > div.jade { padding-right: 22px; }
  .res > div.jade .plus { display: block; width: 22px; height: 24px; }
  .nameline b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 數字一定完整顯示（11.3億、5773 不被切或被 + 蓋住）：資源格不再縮到比數字窄，改由名片讓位（稱號、名字省略號） */
  .res > div { min-width: max-content; }
  .res > div[data-res="stone"], .res > div.jade { flex: 0 0 auto; min-width: 72px; }
  .profile { flex: 1 1 0; min-width: 0; }
  .who { min-width: 0; overflow: hidden; }
  .nameline { min-width: 0; overflow: hidden; }
  .nameline b { flex: none; }
  .ptitle { flex: 0 1 auto; min-width: 3.4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 2px; }
  #netstate { flex: none; }
}

/* 英雄頁：陣營加成與競技場陣容收合 */
.hero-more { margin: 4px 0 8px; border-radius: 8px; background: #00000030; }
.hero-more-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 8px 10px; text-align: left; }
.hero-more-head b { color: #ffe08a; font-weight: 400; }
.hero-more-head i { font-style: normal; font-size: 11px; }
.hero-more-body { padding: 0 8px 8px; }
.hero-more-body .arena-line { margin-top: 6px; }
.chips .chip small { opacity: .75; font-size: 11px; }

/* 招募：卡池切換改成一排可橫向滑動；多位英雄時一排排完不換行 */
.banner-sel { display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none !important; gap: 5px; }
.banner-sel button { min-width: 0; padding: 7px 4px; }
.banner-sel button b, .banner-sel button small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-heroes { flex-wrap: nowrap !important; gap: 2px; }
.gb-heroes .gb-h { flex: 0 1 auto; min-width: 0; }
.gb-h i { max-width: 64px; font-size: 10px; }

/* 回歸：離線推關演出 */
.offline-push { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0 4px; padding: 12px; border-radius: 10px; background: radial-gradient(circle, #ffb74a33, transparent 70%); }
.offline-push b { font-size: 26px; color: #ffe08a; text-shadow: 0 2px 0 #3a1f0a; }
.offline-push b span { display: inline-block; min-width: 1.5em; text-align: center; }
.offline-push small { color: var(--muted); font-size: 12px; }

/* 主將 */
.lead-bar { margin: 4px 0 8px; padding: 8px; border-radius: 10px; background: linear-gradient(#3a2a12cc, #1d160dcc); border: 1px solid #a8802a88; }
.lead-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.lead-stat { margin-top: 4px; font-size: 13px; opacity: .9; }
.lead-head > b { color: #ffe08a; font-size: 15px; font-weight: 400; }
.lead-head small { color: var(--muted); font-size: 11px; }
.lead-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 4px; }
/* 主力欄位：依稀有度上色的卡框（角色依實際範圍置中）、加成在右下角小標籤、名字在框下方 */
.lead-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; min-width: 0; background: none; border: 0; --rc: #8a8f99; }
.ls-tile { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 55%, #3a2f52), color-mix(in srgb, var(--rc) 38%, #241c3a)); border: 2px solid var(--rc); box-shadow: inset 0 2px 0 #fff3, 0 2px 0 #0007; }
.lead-slot.r5 .ls-tile { box-shadow: inset 0 2px 0 #fff3, 0 2px 0 #0007, 0 0 10px color-mix(in srgb, var(--rc) 60%, transparent); }
.ls-tile > .px-av, .ls-tile > img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } /* 頭像和卡框差不多大、中心對齊卡框，超出的部分裁掉：卡框多寬都填滿 */
.ls-tile > i { position: absolute; right: 2px; bottom: 2px; font-style: normal; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 4px; background: #000b; color: #9fe07a; }
.lead-slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #f4e2c4; }
.lead-slot.empty { aspect-ratio: 1; justify-content: center; border-radius: 8px; border: 2px dashed #ffe08a66; background: #0004; color: #ffe08a; font-size: 22px; }
.lead-bar p { margin: 2px 0 0; font-size: 11px; }
.tag.lead { background: linear-gradient(#ffd24a, #d9901c); color: #3a2000; }
.rv-tag { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #2f7a3a; color: #fff; z-index: 2; }
.rv-tag.lead { background: linear-gradient(#ffd24a, #d9901c); color: #3a2000; }
.rv-army .rv-front { justify-content: center; }

/* 深度養成 */
.sk-lv { font-style: normal; font-size: 12px; color: #9fe07a; margin-left: 4px; }
.card.mastery { padding: 8px 10px; }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #ffffff10; }
.mast-row:last-of-type { border-bottom: 0; }
.mast-row > div { display: flex; flex-direction: column; min-width: 0; }
.mast-row b { font-weight: 400; color: #ffe08a; }
.mast-row small { font-size: 11px; color: var(--muted); }
.mast-row .btn { flex: none; }
.mast-row .btn small { display: block; color: inherit; }

/* 平行戰線：深淵塔、懸賞令、邊境開拓 */
.front-seg button { font-size: 12px; padding-left: 2px; padding-right: 2px; }
.front-hero { display: flex; align-items: center; justify-content: space-between; background: radial-gradient(circle at 80% 50%, #7a2a8a55, transparent 60%), linear-gradient(#2a1a33, #140c18) !important; }
.front-hero > div { display: flex; flex-direction: column; }
.front-hero small { color: var(--muted); }
.front-hero b { font-size: 28px; color: #e8b8ff; text-shadow: 0 2px 0 #000; }
.front-hero span { font-size: 12px; color: var(--muted); }
.src-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
.src-pick button { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 8px; border: 1px solid #0008; background: #0004; color: #f4e2c4; }
.src-pick button.on { border-color: #ffd24a; background: #ffd24a22; box-shadow: 0 0 8px #ffd24a44; }
.src-pick button:disabled { opacity: .45; }
.src-pick b { font-weight: 400; font-size: 13px; }
.src-pick small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.odds { font-size: 12px; padding: 1px 8px; border-radius: 8px; }
.odds.ok { background: #2f7a3a; color: #fff; } .odds.mid { background: #7a6a2a; color: #fff; } .odds.warn { background: #a8601a; color: #fff; } .odds.bad { background: #a83a2a; color: #fff; }
.card.bounty { display: flex; flex-direction: column; gap: 6px; }
.card.bounty.t1 { border-color: #7a3aae; } .card.bounty.t2 { border-color: #d0741a; box-shadow: 0 0 8px #d0741a44; }
.card.bounty .btn small { display: block; font-size: 10px; }
.outposts { display: flex; flex-direction: column; gap: 6px; }
.card.outpost { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.card.outpost.locked { opacity: .5; }
.card.outpost.owned { border-color: #2f7a3a; }
.card.outpost .btn small { display: block; }
.evo-tag { position: absolute; left: 2px; top: 1px; font-style: normal; font-size: 10px; color: #e8b8ff; text-shadow: 0 1px 0 #000; }
/* 裝備升星（shared/rules/gear.js GEAR_STAR） */
.star-tag, .eq-star { position: absolute; left: 2px; bottom: 1px; font-style: normal; font-size: 10px; color: #ffd84a; text-shadow: 0 1px 0 #000; }
.eq-slot .eq-star { left: 5px; bottom: auto; top: 3px; }
.item-stars { margin-left: 6px; font-size: 11px; letter-spacing: -1px; color: #ffd84a; vertical-align: 1px; }
.item-stars i { font-style: normal; color: #ffffff30; }
.btn.star-ready { box-shadow: 0 0 0 1px #ffd84a, 0 0 8px #ffd84a88; }
.star-up { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.star-up .star-big { text-align: center; font-size: 22px; color: #ffd84a; letter-spacing: 1px; }
.star-up .star-big i { font-style: normal; color: #ffffff30; }
.star-up .star-gain { text-align: center; }
.star-up .star-mats { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px; background: #0005; }
.star-up .star-mats > div { display: flex; justify-content: space-between; gap: 8px; }
.star-up .star-mats .lack { color: #ff7a6a; }

/* 今日 */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.today-head b { font-weight: 400; color: #ffe08a; }
.today-list { display: flex; flex-direction: column; gap: 6px; }
.today-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: #0003; border: 1px solid #0006; }
.today-row.ready { border-color: #ffd24a88; background: #ffd24a14; }
.today-row > div { display: flex; flex-direction: column; min-width: 0; }
.today-row b { font-weight: 400; }
.today-row small { font-size: 11px; color: var(--muted); }
/* 公告（ui-notice.js）：分類標籤、今日頁公告欄、公告列表 */
.notice-tag { display: inline-block; flex: none; padding: 1px 7px; margin-right: 6px; border-radius: 6px; font-size: 12px; background: #4a6fa5; color: #fff; vertical-align: 2px; }
.notice-update { background: #3f8f5a; } .notice-event { background: #9a4fc8; } .notice-maint { background: #c8573f; }
.notice-strip { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.notice-strip b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.notice-new { flex: none; padding: 1px 8px; border-radius: 10px; background: #e5484d; color: #fff; font-size: 12px; }
.notice-card summary { display: flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; }
.notice-card summary b { flex: 1; font-weight: 400; }
.notice-body { margin-top: 8px; line-height: 1.7; white-space: normal; word-break: break-word; }
.today-events { display: flex; flex-direction: column; gap: 6px; background: linear-gradient(90deg, #5a2a8a88, #2a1a3a88) !important; border-color: #c07aff88 !important; }
.today-events div { display: flex; flex-direction: column; }
.today-events b { font-weight: 400; color: #ffd6ff; }
.today-events small { font-size: 12px; color: #e8d0ff; }
.guild-goal .goal-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0 4px; }
.guild-goal .goal-tiers .btn { padding: 4px 2px; font-size: 12px; }
.guild-goal .goal-tiers small { display: block; font-size: 10px; line-height: 1.2; }
.cx-miles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
.cx-miles .btn { padding: 4px 2px; font-size: 12px; }
.cx-miles small { display: block; font-size: 10px; }
.hero-story { font-size: 13px; line-height: 1.7; color: #f4e2c4; margin: 6px 0 0; }
s.was { opacity: .6; font-size: .9em; margin-left: 2px; }
.pity .done .pbar i { background: linear-gradient(90deg, #ffd24a, #ff9f2f); }
.tut-ring.passive { box-shadow: 0 0 18px #ffd24a; animation: none; }
.cost .eta { font-style: normal; font-size: .85em; opacity: .8; margin-left: 3px; }
.tag.new { background: #e8453c; color: #fff; left: auto; right: 4px; top: auto; bottom: 34%; }
.gacha-btns .btn small { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.gacha-btns .off-line { flex-basis: 100%; text-align: center; font-size: 11px; margin: 1px 0 0 !important; white-space: nowrap; }
.gacha-btns .btn.gold em.off { color: #1d6a2a; text-shadow: none; }
.btn.train-all { flex: none; }
/* 英雄面板「隊伍」分頁：每隊一張卡 */
.team-hint { margin: 2px 0 8px; }
.team-list { display: grid; gap: 6px; margin-bottom: 8px; }
.team-card { padding: 8px 10px; margin: 0; }
.team-card.locked { opacity: .5; padding: 6px 10px; }
.tc-head { display: flex; align-items: baseline; gap: 8px; }
.team-card.idle .tc-head { align-items: center; }
.tc-head > b { font-size: 14px; white-space: nowrap; }
.tc-head > small { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-pw { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tc-pw b { color: var(--gold); font: 400 14px var(--num); }
.tc-body { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tc-leads { flex: 1; min-width: 0; display: flex; gap: 3px; overflow: hidden; }
.tc-leads .px-av { border-radius: 6px; background-color: #00000040; }
.tc-n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tc-combo { margin-top: 4px; font-size: 11px; color: #ffe08a; }
.troop-line { display: block; font-size: 13px; color: var(--muted); margin: 0 2px 6px; }
.troop-line b { color: var(--gold); font: 400 15px var(--num); }
.team-back { display: inline-block; margin: 0 0 6px; }
.bad-t { color: #ff8a7a; }
.tower-bar i { background: linear-gradient(90deg, #7a2a9a, #c07aff) !important; }
.view-btn { flex: none; border: 1px solid #c07aff; background: #2a1a3acc; color: #e8d0ff; border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.view-btn.on { background: #c07aff; color: #1a0a2a; }
.bb-time { font-style: normal; margin-left: auto; margin-right: 8px; color: #ffe08a; font-size: 14px; }
.bb-time.urgent { color: #ff5a4a; animation: pulse .5s infinite; }
#stageName { cursor: pointer; }
#stageName .mode { font-style: normal; font-size: .82em; padding: 0 6px; margin-right: 6px; border-radius: 6px; }
#stageName .mode.push { background: #c0392b; color: #fff; }
#stageName .mode.farm { background: #2f7a3a; color: #fff; }
#stageName small { margin-left: 6px; font-size: .8em; color: #ffe08a; }

/* ============================================================
   抽卡結果：全畫面「恭喜獲得」（showGachaResults）
   英雄依序彈跳出現；底色依稀有度（--rc）；傳說以上爆光、神話全螢幕閃光
   ============================================================ */
.gx { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 12px calc(24px + env(safe-area-inset-bottom)); overflow: hidden; opacity: 0; transition: opacity .25s; background: radial-gradient(ellipse at 50% 40%, #34496f 0%, #1b2440 55%, #0f1426 100%); font-family: var(--pixel); }
.gx.show { opacity: 1; }
.gx.out { opacity: 0; }
.gx-rays { position: absolute; left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; pointer-events: none; opacity: .22; background: repeating-conic-gradient(from 0deg, var(--gc) 0deg 6deg, transparent 6deg 22deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 38%); mask: radial-gradient(circle, #000 0, transparent 38%); animation: gxSpin 24s linear infinite; }
.gx.r4 .gx-rays, .gx.r5 .gx-rays { opacity: .3; animation-duration: 14s; }
.gx-stars { position: absolute; inset: 0; pointer-events: none; }
.gx-stars i { position: absolute; width: var(--ss); height: var(--ss); background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 4px #9ff); animation: gxTwinkle 2.4s ease-in-out infinite; animation-delay: var(--sd); }
.gx-stars i:nth-child(3n) { background: #f7b6ff; filter: drop-shadow(0 0 4px #f6f); }
.gx-stars i:nth-child(4n) { background: #ffe08a; filter: drop-shadow(0 0 4px #fc6); }
.gx-title { position: relative; margin: 0; padding: 6px 26px 12px; font: 400 44px var(--pixel); letter-spacing: 8px; text-indent: 8px; color: #ffc6ff; text-shadow: 0 3px 0 #5b2a86, 0 0 14px #d77bff99; background: linear-gradient(#40306f, #2a1f4d); border-bottom: 8px solid #1a1433; box-shadow: 0 6px 0 #0006; transform: perspective(300px) rotateX(8deg); animation: gxTitle .45s cubic-bezier(.2,1.6,.4,1) both; }
.gx.r4 .gx-title { color: #ffe08a; text-shadow: 0 3px 0 #7a4a00, 0 0 16px #ffb03a; }
.gx.r5 .gx-title { color: #fff; text-shadow: 0 3px 0 #8a1030, 0 0 18px #ff3b6b, 0 0 32px #ffd24a; animation: gxTitle .45s cubic-bezier(.2,1.6,.4,1) both, gxGlow 1.2s ease-in-out infinite; }
.gx-grid { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; max-width: min(620px, 96vw); }
.gx.many .gx-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 8px; width: min(560px, 96vw); }
.gx-item { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; opacity: 0; transform: scale(0) rotate(-12deg); animation: gxPop .5s cubic-bezier(.2,1.8,.4,1) forwards; animation-delay: var(--d); }
.gx-item.r4, .gx-item.r5 { animation-name: gxPopBig; animation-duration: .7s; }
.gx-item::before { content: ''; position: absolute; left: 50%; top: 38%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid #fff; opacity: 0; pointer-events: none; animation: gxRing .55s ease-out forwards; animation-delay: var(--d); }
.gx-item.r3::before, .gx-item.r4::before, .gx-item.r5::before { border-color: var(--rc); box-shadow: 0 0 12px var(--rc); }
.gx-tile { position: relative; padding: 7px; border-radius: 8px; background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 80%, #fff) 0%, var(--rc) 45%, color-mix(in srgb, var(--rc) 60%, #000) 100%); border: 3px solid color-mix(in srgb, var(--rc) 45%, #000); box-shadow: inset 0 2px 0 #fff6, 0 4px 0 #0007; }
.gx-tile::after { content: ''; position: absolute; top: -3px; right: -3px; width: 16px; height: 16px; background: linear-gradient(225deg, #1b2440 50%, color-mix(in srgb, var(--rc) 55%, #fff) 50%); border-radius: 0 6px 0 0; }
.gx-tile .px-av, .gx-tile img { position: relative; display: block; image-rendering: pixelated; }
.gx-item.r4 .gx-tile, .gx-item.r5 .gx-tile { box-shadow: inset 0 2px 0 #fff8, 0 4px 0 #0007, 0 0 18px var(--rc), 0 0 36px color-mix(in srgb, var(--rc) 60%, transparent); }
.gx-burst { position: absolute; left: 50%; top: 50%; width: 260%; height: 260%; transform: translate(-50%, -50%); pointer-events: none; background: repeating-conic-gradient(var(--rc) 0deg 8deg, transparent 8deg 30deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%); opacity: .5; animation: gxSpin 6s linear infinite; }
.gx-item.r3 .gx-burst { opacity: .28; }
.gx-rar { position: absolute; left: -4px; top: -6px; padding: 1px 5px; border-radius: 4px; font-size: 11px; color: #fff; background: color-mix(in srgb, var(--rc) 70%, #000); box-shadow: 0 2px 0 #0008; }
.gx-tag { position: absolute; right: -6px; bottom: -6px; padding: 1px 5px; border-radius: 4px; font-style: normal; font-size: 11px; color: #0f2a0a; background: #7dff9a; box-shadow: 0 2px 0 #0008; }
.gx-tag.lead { color: #3a2000; background: #ffd24a; }
.gx-name { max-width: 100%; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 400; color: color-mix(in srgb, var(--rc) 55%, #fff); text-shadow: 0 2px 0 #000; }
.gx-item small { max-width: 100%; font-size: 11px; color: #9fb0cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-item em { max-width: 100%; margin-top: 2px; font-style: normal; font-size: 11px; line-height: 1.25; color: #ffd24a; overflow-wrap: anywhere; }
.gx-note { max-width: 100%; font-size: 11px; color: #c9a2ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-note:empty { display: none; }
.gx.many .gx-name { font-size: 12px; }
.gx.many .gx-item small, .gx.many .gx-item em { font-size: 10px; }
.gx.single .gx-name { font-size: 20px; }
.gx-foot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; pointer-events: none; }
.gx.done .gx-foot { opacity: 1; transform: none; pointer-events: auto; }
.gx-foot small { font-size: 12px; color: #9fb0cc; animation: gxBlink 1.6s ease-in-out infinite; }
.gx.skip .gx-item, .gx.skip .gx-item::before { animation-duration: .01s !important; animation-delay: 0s !important; }
.gx-flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, #fff 0%, #ffd24acc 30%, #ff3b6b55 60%, transparent 80%); opacity: 0; animation: gxFlash 1.3s ease-out .25s; }
@keyframes gxSpin { to { transform: rotate(360deg); } }
@keyframes gxTwinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes gxTitle { from { opacity: 0; transform: perspective(300px) rotateX(8deg) translateY(-40px) scale(.6); } to { opacity: 1; transform: perspective(300px) rotateX(8deg); } }
@keyframes gxPop { 0% { opacity: 0; transform: scale(0) rotate(-12deg); } 60% { opacity: 1; transform: scale(1.18) rotate(3deg); } 100% { opacity: 1; transform: none; } }
@keyframes gxPopBig { 0% { opacity: 0; transform: scale(0) rotate(-20deg); filter: brightness(3); } 45% { opacity: 1; transform: scale(1.35) rotate(4deg); filter: brightness(2); } 70% { transform: scale(.94); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes gxRing { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(5); } }
@keyframes gxFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes gxGlow { 0%, 100% { text-shadow: 0 3px 0 #8a1030, 0 0 14px #ff3b6b, 0 0 24px #ffd24a; } 50% { text-shadow: 0 3px 0 #8a1030, 0 0 22px #ff3b6b, 0 0 44px #ffd24a; } }
@keyframes gxBlink { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (min-width: 900px) { .gx-title { font-size: 56px; } .gx:not(.many) .gx-grid { zoom: 1.5; } .gx.many .gx-grid { zoom: 1.25; } }
@media (prefers-reduced-motion: reduce) { .gx-rays, .gx-burst, .gx-stars i { animation: none; } }


/* 主視覺 v16：方向切換使用不同構圖；新路徑避免沿用舊圖快取。 */
#splash { background: #082d43 url('../brand/approved-v16/landing-wide.webp') center/cover no-repeat; }
#splash .splash-logo { position:absolute; left:5%; top:25%; font-size:clamp(36px,6vw,84px); letter-spacing:.08em; animation:none; color:#fff0c7; text-shadow:0 3px #422c1a; }
.splash-tagline { position:absolute; left:6%; top:calc(25% + clamp(36px,6vw,84px) + 18px); color:#f6ce70; letter-spacing:.4em; font-size:18px; text-shadow:0 2px 3px #082d43; }
/* 標題標誌（client/brand/logo/title-v1.webp，不在 git）：中文顯示圖、英文顯示文字；標誌已含「放置冒險」，副標隱藏 */
#splash .splash-logo-img { display:none; position:fixed; left:4%; top:12%; width:min(46vw,620px); height:auto; filter:drop-shadow(0 6px 10px #0008); }
html[data-boot="zh"] #splash .splash-logo-img:not(.splash-logo-en) { display:block; }
html[data-boot="en"] #splash .splash-logo-en { display:block; }
html[data-boot="en"] #splash .splash-logo-txt, html[data-boot="en"] .splash-tagline { display:none; }
html[data-boot="zh"] #splash .splash-logo-txt, html[data-boot="zh"] .splash-tagline { display:none; }
#splash .splash-sub { position:absolute; bottom:7%; left:5%; width:30%; text-align:center; color:#f4e9ce; font-size:12px; letter-spacing:.1em; text-shadow:0 1px 3px #000; }
#splash .splash-bar { position:absolute; bottom:11%; left:5%; width:30%; margin:0; }
@media (orientation:portrait) {
 #splash { background-image:linear-gradient(#07233e55,transparent 35%),url('../brand/approved-v16/landing-tall.webp'); }
 #splash .splash-logo { top:8%; left:0; width:100%; text-align:center; font-size:clamp(40px,11vw,76px); }
 .splash-tagline { top:calc(8% + clamp(40px,11vw,76px) + 18px); left:0; width:100%; text-align:center; }
 #splash .splash-sub { left:15%; width:70%; bottom:6%; }
 #splash .splash-logo-img { left:50%; top:2%; transform:translateX(-50%); width:min(88vw,520px); }
 #splash .splash-bar { left:15%; width:70%; bottom:10%; }
}
/* 手機長按不要選取文字、跳出複製／查詢選單（遊戲畫面不是文件）；輸入框與 .selectable 照常可選 */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }

/* 英文版：左側按鈕名稱比較長（Top-up Rewards、Quests & Pass），允許斷成兩行、字小一點，不超出按鈕、不被螢幕邊切掉 */
html[lang="en"] .medal em { width: 54px; white-space: normal; text-align: center; line-height: 1.05; font-size: 9.5px; padding: 0 2px; word-break: normal; }
html[lang="en"] .bottom-nav em { font-size: 11px; letter-spacing: 0; }
/* 限時清怪：進度條底部的倒數細條，剩 10 秒變紅閃爍 */
#wavebar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #7fd4ff; transition: width .25s linear; }
#killbar.hurry #wavebar { background: #ff4a3a; animation: wavePulse .5s infinite alternate; }
#killbar.hurry { border-color: #c0392b; }
@keyframes wavePulse { to { opacity: .35; } }
/* 橫幅：手機上長標題換行、副標限制寬度（不超出畫面） */
.banner { width: max-content; max-width: 96vw; box-sizing: border-box; padding: 10px 16px; }
.banner b { white-space: normal; letter-spacing: 2px; line-height: 1.15; }
.banner span { max-width: 88vw; margin: 2px auto 0; }

/* 面板標題緞帶不換行：窄手機（375 寬）上「任務與戰令」會被擠成兩行，縮小緞帶內距 */
.sheet-head h2 { white-space: nowrap; }
@media (max-width: 420px) { .sheet-head h2 { padding: 2px 16px 10px; letter-spacing: 1px; } .sheet-head { padding-left: 44px; padding-right: 44px; } }

/* 世界魔王（規則 80）：每天一隻打不死、全服里程碑、次數可累積 */
.wb-card .wb-el { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; color: #1a0c05; font-size: 12px; vertical-align: 2px; }
.wb-barno { margin: 4px 0 6px; font-size: 14px; color: #ffd9a8; }
.wb-barno b { font-size: 22px; color: #fff3c4; }
.wb-miles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 4px; }
.wb-mile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 10px; border: 2px solid #4a3a2a; background: #1e1712; color: #bfae8c; font: inherit; cursor: pointer; }
.wb-mile b { font-size: 12px; } .wb-mile span { font-size: 11px; }
.wb-mile.open { border-color: #ffcf4a; background: linear-gradient(#5a3d12, #2a1d0c); color: #fff3c4; box-shadow: 0 0 10px #ffcf4a55; }
.wb-mile.got { border-color: #3d6b3a; color: #8fd68a; opacity: .8; }
.wb-mile:disabled { cursor: default; }
.wb-mget { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 10px; border-radius: 8px; background: #ffcf4a; color: #3a2508; }
.wb-me { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.wb-me > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: 10px; background: #00000030; }
.wb-me small { color: #bfae8c; } .wb-me b { font-size: 16px; }
.wb-acts .btn { flex: 1; }
.wb-r { display: inline-flex; align-items: center; gap: 3px; margin: 0 4px; white-space: nowrap; }
.wb-honor { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; margin: 6px 0; padding: 6px; border-radius: 10px; background: #3a1414aa; font-size: 13px; }
.toplist li.me { box-shadow: inset 0 0 0 2px #ffcf4a88; }
/* 左側按鈕高度不夠時排成兩欄（外部試玩回饋：1280×800 下最下面的按鈕跑到任務卡底下，點不到） */
@media (min-width: 701px) and (max-height: 1080px) { .side-left { display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, auto); gap: 4px 6px; } }
@media (min-width: 701px) and (max-height: 720px) { .side-left { grid-template-rows: repeat(5, auto); } }
@media (min-width: 701px) and (max-height: 620px) and (orientation: portrait) { .side-left { grid-template-rows: repeat(4, auto); } }

/* 世界魔王：只留數字（參戰人數、換魔王倒數），不放說明文案 */
.wb-meta { display: flex; justify-content: center; gap: 16px; opacity: .85; }
/* 額外參與箱（開根號獎勵分）：箱子圖＋分數＋預估內容 */
.wb-part { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: #2a2010; border: 1px solid #6a5430; }
.wb-part .wb-pbox { width: 40px; height: 40px; flex: none; background: url('../assets/ui/ut/chest.png') center/contain no-repeat; image-rendering: pixelated; }
.wb-part b { display: block; font-size: 14px; color: #ffe08a; }
.wb-part b em { font-style: normal; font-size: 16px; color: #fff; }
.wb-part b small { color: #bfae8c; font-size: 11px; }
.wb-part .wb-mr { display: flex; flex-wrap: wrap; gap: 2px; font-size: 12px; }
.wb-part .wb-help { min-width: 30px; font-weight: 900; }
/* 機制說明的「?」（ui.js helpBtn）：主畫面不放說明句，點了才看 */
.q-help { min-width: 30px; font-weight: 900; flex: none; }
.q-help.float { float: right; margin-left: 6px; }
.wb-mile .wb-mr { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }

/* 註冊卡：名稱錯誤（重複、不合規）寫在欄位下面 */
.reg-err { margin: 4px 0 0; color: #ff8a7a; font-size: 13px; line-height: 1.35; }
#regName.bad { border-color: #ff6b5a !important; box-shadow: 0 0 0 2px #ff6b5a55; }

/* 戰力拆解（ui-power.js）：英雄詳情標題戰力（點了到資料分頁）、提升提示、戰力組成、隊伍戰力 */
.stats button.pw { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; background: #00000035; border-radius: 7px; padding: 4px 8px; border: 1px solid #00000040; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stats button.pw { flex-wrap: wrap; }
.stats button.pw > span { white-space: nowrap; }
.stats button.pw > b { margin-right: auto; }
.stats button.pw::after { content: '›'; color: var(--muted); font-size: 14px; order: 1; }
.hero-pw-up { order: 2; flex-basis: 100%; font-size: 11px; color: #c8ffd0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: hpwUp .35s ease-out; }
.hero-pw-up b { font: 400 12px var(--num); color: #6dff7a; }
@keyframes hpwUp { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }
.pow-parts .ppt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pow-parts .ppt-head .num { font-size: 18px; }
.ppt-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #0005; margin-bottom: 8px; }
.ppt-stack i { display: block; height: 100%; }
.ppt-row { display: grid; grid-template-columns: 76px 1fr auto 40px; align-items: center; gap: 6px; width: 100%; padding: 4px 2px; background: none; border: 0; border-bottom: 1px solid #ffffff10; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ppt-row.on { background: #ffffff0d; }
.ppt-n { font-size: 12px; white-space: nowrap; }
.ppt-n::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: var(--pc); }
.ppt-bar { height: 8px; border-radius: 4px; background: #0005; overflow: hidden; }
.ppt-bar i { display: block; height: 100%; background: var(--pc); }
.ppt-row b { font: 400 13px var(--num); text-align: right; }
.ppt-row small { font-size: 11px; color: var(--muted); text-align: right; }
.ppt-desc { padding: 4px 6px 8px 14px; font-size: 12px; color: var(--muted); }
.ppt-desc p { margin: 0 0 4px; }
.ppt-desc ul { margin: 0; padding: 0; list-style: none; }
.ppt-desc li { display: flex; justify-content: space-between; padding: 1px 0; }
.ppt-desc li b { font: 400 12px var(--num); color: var(--text); }
.tc-solo { display: block; font-size: 11px; margin: -2px 0 2px; }
.team-pow { margin-top: 8px; padding-top: 6px; border-top: 1px solid #ffffff14; }
.tpw-eq { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tpw-eq span { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.tpw-eq small { font-size: 11px; color: var(--muted); }
.tpw-eq b { font: 400 15px var(--num); }
.tpw-eq i { font-style: normal; color: var(--muted); }
.tpw-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.tpw-chip { font-size: 11px; padding: 2px 6px; border-radius: 9px; background: #ffd24a1f; border: 1px solid #ffd24a55; white-space: nowrap; }
.tpw-chip b { font: 400 12px var(--num); color: var(--gold); }
.tpw-chip.neg { background: #e0452f1f; border-color: #e0452f66; }
.tpw-chip.neg b { color: #ff8a7a; }
.tpw-est { margin: 4px 0 0; }
.lu-pw { font-size: 12px; color: var(--muted); }
.lu-pw b { font: 400 13px var(--num); color: var(--text); }
.lu-pw .up { color: #6dff7a; }
.lu-pw .down { color: #ff8a7a; }
.lu-swap { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid #ffffff10; }
.lu-swap .grow { flex: 1; min-width: 0; font-size: 12px; }
#powpop .pp-was { font-size: 13px; color: #ffe9b0cc; font-family: var(--num); }
/* 競技場「我的排名」：上陣英雄頭像＋競技戰力（和左上角總戰力區分） */
.ar-me .ar-team { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.ar-me .ar-team em { margin-left: 6px; font-style: normal; color: #ffe08a; }

/* 競技場「我的排名」：戰力放第一行，頭像列不換行也不擠到按鈕底下（使用者：跑版） */
.ar-me .grow { min-width: 0; }
.ar-me .ar-pw { margin-left: 10px; font-style: normal; color: #ffe08a; }
.ar-me .ar-team { flex-wrap: nowrap; overflow: hidden; }
/* 排行榜頒獎台（左側「排行」按鈕打開的面板）：第一名中間最高、二三名兩側 */
.rk-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 6px; margin: 10px 0 8px; }
.rk-pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 26px; border-radius: 10px 10px 4px 4px; background: linear-gradient(#3a2d48, #221a2c); border: 2px solid #7a6a9a; cursor: pointer; min-width: 0; }
.rk-pod.p1 { padding-bottom: 40px; background: linear-gradient(#5a4214, #2a1d0c); border-color: #ffcf4a; box-shadow: 0 0 16px #ffcf4a55; }
.rk-pod.p2 { border-color: #cfd8e8; }
.rk-pod.p3 { border-color: #d08a4a; }
.rk-pod.me { outline: 2px solid #7cc4ff; }
.rk-pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.rk-pod em { font-style: normal; font-size: 12px; color: #ffe08a; }
.rk-crown { font-size: 20px; line-height: 1; }
.rk-step { position: absolute; bottom: 4px; font-style: normal; font-family: 'Lilita One', var(--font); font-size: 18px; color: #fff; text-shadow: 0 2px 0 #000; }
.rk-gap { display: block; font-size: 12px; color: #ffb38a; margin-top: 2px; }

/* 上線前介面打磨（LAUNCH_READINESS 第四節） */
/* 英雄列表：職業篩選 6 格平分一列，400px 寬手機不超出；排序、隱藏普通各自不斷行，放不下就整段換到下一行 */
.chips.role-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
.chips.role-chips .chip { padding: 6px 2px; font-size: 12px; white-space: nowrap; }
@media (max-width: 340px) { .chips.role-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 4px; } }
.row.hero-sort { flex-wrap: wrap; gap: 2px 10px; }
.row.hero-sort > span { white-space: nowrap; }
/* 今日：一鍵全部領取（數量放在按鈕上的角標） */
.today-head .btn { flex: 1; position: relative; }
/* 數量角標跟在文字後面（使用者：一鍵全部領取的紅色數字跑版——原本絕對定位在按鈕右上角，壓到按鈕框） */
.today-head .today-n { position: static; display: inline-block; vertical-align: middle; margin-left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e04a3a; color: #fff; font: 400 13px/22px var(--pixel); box-shadow: 0 1px 0 #0008; }
/* 公會週目標：獎勵用圖示＋數字，放不下就換行，不截斷 */
.guild-goal .goal-tiers .btn { white-space: normal; height: auto; }
.guild-goal .goal-tiers small { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; white-space: nowrap; }
.guild-goal .goal-tiers small .ci, .guild-goal .goal-tiers small img { width: 14px; height: 14px; vertical-align: -3px; }
/* 塔之恩賜：面板、視窗開著時先收起，關掉再出現（倒數也暫停，ui-rogue.js） */
body.sheet-open .rg-pick, .rg-pick.held { display: none; }
/* 機率公示的規則說明收進「?」 */
.vt-help { margin: 6px 0; }
.vt-help > summary { list-style: none; display: inline-block; cursor: pointer; }
.vt-help > summary::-webkit-details-marker { display: none; }
/* 無盡之塔本週可能出現的恩賜：只放名字（說明在「?」） */
.rg-boon-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.rg-boon-chips span { padding: 2px 8px; border-radius: 10px; background: #0004; font-size: 12px; color: #7fe0ff; }
.rg-boon-chips span.rec { box-shadow: inset 0 0 0 1px #ffd24a; }
.rg-boon-chips span.on { background: #ffd24a33; }
.rg-boon-chips em { font-style: normal; color: #ffd24a; margin-left: 3px; }
/* ===== 商城（2026-10-04 版面重做，ui-systems.js PANELS.shop）：左側直排分類＋右側兩欄大圖示卡片，沿用石板卡片、木框、像素按鈕 ===== */
.sheet-body:has(.shop2) { padding: 2px 6px 12px; }
@media (min-width: 900px) { .sheet:has(.shop2) { width: 560px; } body.sheet-open:has(.shop2) .cmd-bar { right: 590px; } }
.shop2 { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px; align-items: start; }
/* 左側分類：和分頁按鈕同一套棕／金按鈕，選中的往右凸出 */
.sr { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 4px; padding: 2px 0 4px; }
.sr-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 2px 0 1px; border-style: solid; border-width: 8px; border-image: url('../assets/ui/ts/btn_brown.png') 47 45 47 45 fill / 8px stretch; background: none; color: #f4e2c4; image-rendering: pixelated; font-family: var(--pixel); text-shadow: 0 1px 0 #000a; transition: transform .12s; }
.sr-tab.on { border-image-source: url('../assets/ui/ts/btn_gold.png'); color: #3a2000; text-shadow: 0 1px 0 #fff6; transform: translateX(4px); }
.sr-tab:active { transform: translateY(2px); }
.sr-ic { display: grid; place-items: center; width: 30px; height: 30px; overflow: hidden; }
.sr-ic img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #0008); }
.sr-tab em { font-style: normal; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.sr-dot { position: absolute; top: -9px; right: -9px; width: 11px; height: 11px; border-radius: 50%; background: #ff4a3a; box-shadow: 0 0 0 2px #2a1b12; }
.sb { min-width: 0; }
.sb > .tabs:first-child, .sb > .card:first-child, .sb > .list:first-child { margin-top: 0; }
.sb .shc-sec { margin: 12px 0 4px; }
.sb .shc-sec small { display: inline-flex; align-items: center; }
/* 商品卡 */
.shc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 2px 0 6px; }
.shc { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 12px 0 0; border-style: solid; border-width: 11px 12px; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 11px 12px stretch; image-rendering: pixelated; }
.shc::before { content: ''; position: absolute; left: 50%; top: 4px; width: 84px; height: 70px; transform: translateX(-50%); background: radial-gradient(closest-side, #ffe9a655, transparent); pointer-events: none; }
.shc.shc-gem::before { background: radial-gradient(closest-side, #8fd3ff55, transparent); }
.shc.hero::before { background: radial-gradient(closest-side, #c79bff88, transparent); }
.shc-lim { position: absolute; z-index: 2; top: -7px; left: -8px; padding: 1px 5px; font: 11px var(--num); color: #ffe08a; background: #000a; border-radius: 0 0 6px 0; white-space: nowrap; }
.shc-tag { position: absolute; z-index: 2; top: -9px; right: -11px; display: flex; flex-direction: column; align-items: center; padding: 2px 5px 2px 9px; font: 13px/1.05 var(--num); color: #fff; background: linear-gradient(#ff6a5a, #c8201a); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 6px 50%); text-shadow: 0 1px 0 #0008; white-space: nowrap; }
.shc-tag em { font-style: normal; font-size: 10px; }
.shc-tag.dbl { background: linear-gradient(#ffe25a, #e08a12); color: #3a1a00; text-shadow: 0 1px 0 #fff6; }
.shc-tag.perm { background: linear-gradient(#c890ff, #7a3ad0); }
.shc-tag.time { background: #000b; color: #ffe08a; font-size: 11px; }
.shc-tag.time em { font-size: 11px; }
.shc-art { position: relative; display: grid; place-items: center; width: 66px; height: 66px; filter: drop-shadow(0 3px 3px #0009); }
.shc-art[data-act] { cursor: pointer; }
.shc-art img { width: 66px; height: 66px; object-fit: contain; image-rendering: pixelated; }
.shc-art .ci, .shc-art .shop-ic { width: 46px; height: 46px; }
.shc-art .shop-ic > * { transform: scale(1); }
.shc.mini .shc-art { width: 54px; height: 54px; }
.shc-hero { display: grid; place-items: center; width: 66px; height: 66px; }
.shc-name { display: flex; align-items: center; justify-content: center; min-height: 2.3em; padding: 0 2px; font-weight: 400; font-size: 13px; line-height: 1.15; text-align: center; color: var(--gold); text-shadow: 0 1px 0 #000; overflow-wrap: anywhere; }
.shc-items { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 1px 7px; margin: 2px 0 5px; }
.shc-it { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: #e9dcc6; white-space: nowrap; }
.shc-it b { font: 400 14px var(--num); color: #fff; text-shadow: 0 1px 0 #000; }
.shc-it b small { margin-left: 2px; font-size: 11px; color: #ffd34a; }
.shc-it .ci { width: 20px; height: 20px; }
.shc-it .ci-aw, .sbn .ci-aw, .hp-it .ci-aw, .hp-goal .ci-aw { mix-blend-mode: lighten; }
.shc .hp-goal.mini { padding: 1px 6px; }
.shc-buy.btn { align-self: stretch; margin: 0 -4px -4px; min-height: 40px; font-size: 15px; }
.shc-buy.btn small { font-size: 10px; }
.shc-buy .cost { display: inline-flex; align-items: center; gap: 2px; font: 15px var(--num); }
.shc-buy .cost .ci { width: 18px; height: 18px; }
.shc.sold .shc-art, .shc.sold .shc-name, .shc.sold .shc-items, .shc.sold::before { filter: grayscale(1) brightness(.6); opacity: .8; }
.shc.owned .shc-art::after { content: ''; position: absolute; right: -2px; bottom: 0; width: 24px; height: 24px; background: url('../assets/ui/stone/picto_check.png') center / contain no-repeat; image-rendering: pixelated; }
/* 推薦頁最上方的大橫幅（每天可領、首充） */
.sbn { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr); grid-template-areas: 'art main' 'art btn'; align-items: center; gap: 2px 8px; margin: 0 0 8px; padding: 2px 2px 2px 0; border-style: solid; border-width: 11px 12px; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 11px 12px stretch; image-rendering: pixelated; }
.sbn::before { content: ''; position: absolute; inset: -6px; background: radial-gradient(circle at 16% 50%, #ffd24a44, transparent 45%); pointer-events: none; }
.sbn.hot { filter: drop-shadow(0 0 5px #ffd24aaa); }
.sbn.first::before { background: radial-gradient(circle at 16% 50%, #ff7a5a55, transparent 48%); }
.sbn-art { grid-area: art; position: relative; display: grid; place-items: center; width: 74px; height: 74px; }
.sbn-art img { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 4px #000a); }
.sbn-main { grid-area: main; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sbn-title { font-weight: 400; font-size: 16px; color: #ffe08a; text-shadow: 0 2px 0 #3a1f0a; }
.sbn-items { display: flex; flex-wrap: wrap; align-items: center; gap: 1px 8px; }
.sbn-face { display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 50%; background: radial-gradient(#ffd24a66, transparent 70%); }
.sbn-btn { grid-area: btn; }
.sbn-btn .btn { width: 100%; min-width: 0; min-height: 44px; }
.sbn .shc-tag { top: -9px; right: -12px; }
/* VIP 進度（鑽石頁） */
.shc-vip { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 4px 8px; background: #0006; border: 1px solid #6b5220; border-radius: 8px; }
.shc-vip b { flex: none; font: 400 18px var(--num); color: var(--gold); }
.shc-vip .lvbar { flex: 1; margin: 0; }
.shc-vip .num { font-size: 12px; color: #e9dcc6; }
/* 窄欄裡的戰令、基金列表 */
.sb .pass-cell { font-size: 12px; }
.sb .tech { gap: 6px; }

/* 英雄養成禮包（renderHeroPack）：上方大立繪舞台＋下方 7 階階梯 */
.hp-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 8px; padding: 2px 0 6px; overflow: hidden; border-style: solid; border-width: 11px 12px; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 11px 12px stretch; image-rendering: pixelated; }
.hp-stage::before { content: ''; position: absolute; inset: -12px; background: radial-gradient(ellipse 60% 48% at 50% 40%, #c79bffaa 0, #6a3fb066 45%, transparent 75%), linear-gradient(#2c1a44, #160d22); }
.hp-stage::after { content: ''; position: absolute; left: 50%; top: 38%; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%; background: repeating-conic-gradient(#ffffff16 0 7deg, transparent 7deg 22deg); -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 65%); mask-image: radial-gradient(circle, #000 15%, transparent 65%); animation: hpSpin 40s linear infinite; }
@keyframes hpSpin { to { transform: rotate(360deg); } }
.hp-stage > * { position: relative; z-index: 1; }
.hp-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.hp-time { padding: 2px 8px; font: 12px var(--num); color: #ffe08a; background: #000a; border-radius: 10px; white-space: nowrap; }
.hp-pips { display: flex; gap: 4px; padding-right: 2px; }
.hp-pips i { width: 9px; height: 9px; transform: rotate(45deg); background: #0009; border: 1px solid #b07cff; }
.hp-pips i.on { background: #ffd24a; border-color: #fff3a8; box-shadow: 0 0 4px #ffd24a; }
.hp-hero { display: grid; place-items: center; width: 150px; height: 132px; margin-top: -4px; filter: drop-shadow(0 0 8px #e0c8ff) drop-shadow(0 6px 4px #0008); }
.hp-hero::after { content: ''; position: absolute; z-index: -1; left: 28px; right: 28px; bottom: 4px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, #000a, transparent); }
.hp-name { font-weight: 400; font-size: 19px; color: #ffd86b; text-shadow: 0 2px 0 #2a1040, 1px 0 0 #2a1040, -1px 0 0 #2a1040; }
.hp-goal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 12px; padding: 4px 12px; font: 15px var(--num); color: #fff; background: #000a; border: 1px solid #b07cffaa; border-radius: 8px; }
.hp-goal span { display: inline-flex; align-items: center; gap: 3px; }
.hp-goal .stars { font-size: 17px; letter-spacing: 0; }
.hp-goal .ci { width: 22px; height: 22px; }
.hp-goal .sig-ic { width: 22px !important; height: 22px !important; image-rendering: pixelated; }
.hp-own { position: absolute; top: 26px; left: 2px; padding: 0 6px; background: #0008; border-radius: 8px; }
.hp-claim { margin: 0 0 8px; }
.hp-ladder { position: relative; display: flex; flex-direction: column; gap: 5px; }
.hp-ladder::before { content: ''; position: absolute; left: 15px; top: 20px; bottom: 20px; width: 4px; background: linear-gradient(#ffd24a, #8a6a2a 60%, #4a3a2a); border-radius: 2px; }
.hp-row { position: relative; display: flex; align-items: center; gap: 4px; }
.hp-n { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 34px; height: 36px; padding-bottom: 2px; background: url('../assets/ui/ts/round_gold.png') center / contain no-repeat; image-rendering: pixelated; font: 16px var(--num); color: #3a2000; text-shadow: 0 1px 0 #fff8; }
.hp-row.lock .hp-n { filter: grayscale(1) brightness(.75); }
.hp-row.done .hp-n { filter: saturate(.5) brightness(.8); }
.hp-card { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 52px; border-style: solid; border-width: 9px 10px; border-image: url('../assets/ui/ts/slate.png') 44 55 43 55 fill / 9px 10px stretch; image-rendering: pixelated; }
.hp-row.open .hp-card { border-image-source: url('../assets/ui/ts/btn_gold.png'); border-image-slice: 47 45 47 45 fill; border-width: 9px; filter: drop-shadow(0 0 6px #ffd24acc); }
.hp-row.open .hp-items { padding: 0 2px; border-radius: 4px; background: #3a2618; }
.hp-row.open .hp-card { background: none; }
.hp-row.done .hp-items { filter: saturate(.4) brightness(.7); }
.hp-row.lock .hp-items { filter: grayscale(.6) brightness(.85); opacity: .85; }
.hp-items { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; align-self: stretch; align-content: center; gap: 3px 9px; }
.hp-it { display: inline-flex; align-items: center; gap: 2px; font: 400 14px var(--num); color: #fff; text-shadow: 0 1px 0 #000; }
.hp-it b { font-weight: 400; }
.hp-it .ci { width: 24px; height: 24px; }
.hp-it.hero b { color: #ffd86b; }
.hp-face { display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 6px; background: radial-gradient(closest-side, #ffd24a88, transparent); }
/* 同名碎片：英雄圓框頭像＋右下角升星碎片（和升星卡同一個 ci-shard 圖示） */
.hp-shard { position: relative; flex: none; width: var(--s); height: var(--s); }
.hp-shard-face { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: radial-gradient(#7b48b8, #2a1840); box-shadow: inset 0 0 0 2px #e0c070, 0 0 0 1px #000; }
.hp-shard .ci-shard { position: absolute; right: -5px; bottom: -4px; width: 17px; height: 17px; filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 2px #000); }
.hp-buy.btn { flex: none; min-width: 78px; min-height: 40px; font-size: 15px; }
.hp-ok { flex: none; width: 30px; height: 30px; margin: 0 14px; background: url('../assets/ui/stone/picto_check.png') center / contain no-repeat; image-rendering: pixelated; }
.hp-price { flex: none; display: flex; align-items: center; gap: 3px; padding: 0 4px; font: 14px var(--num); color: #c8b8a2; }
.hp-lock { width: 16px; height: 16px; background: url('../assets/ui/stone/picto_lock.png') center / contain no-repeat; image-rendering: pixelated; }
.shop2 { padding-top: 6px; }
@media (min-width: 900px) { .sbn { grid-template-columns: 80px minmax(0, 1fr) 150px; grid-template-areas: 'art main btn'; } }
.shc.ft { padding-top: 16px; }
.shc.ft .shc-items { margin: 0 0 6px; }
.shc.ft.got .shc-items, .shc.ft.got .shc-lim { filter: grayscale(.8) brightness(.7); }
.shc-it.legend-pick { font-size: 11px; color: #ffd86b; white-space: normal; text-align: center; }
/* 主城按鈕列手機版（使用者：下方按鈕很難按、左右滑也有問題，最右邊的「自動」被切一半）：
   按鈕平分一整排不再橫向捲動，建造佇列換到第二排，和底部導覽多留間距；卡片跟著往上 */
@media (max-width: 760px) {
  body.town .town-bar { bottom: calc(86px + var(--safe-b)); overflow: hidden; touch-action: manipulation; }
  .town-bar .tb-row { flex-wrap: wrap; }
  .town-bar .tb-b { flex: 1 1 0; width: auto; min-width: 0; min-height: 56px; }
  .town-bar .tb-queue { order: 9; flex: 1 0 100%; overflow: hidden; }
  .town-bar .tb-queue:empty { display: none; }
  .town-bar .tb-q { flex: 1 1 0; max-width: none; min-height: 42px; }
  body.town .town-card:not([hidden]) { bottom: calc(244px + var(--safe-b)); }
}
/* 升級按鈕灰掉時旁邊的「去取得」（ui-town.js lackGo）：圖示＋數字，點了跳到來源 */
.ub-btns .btn.ub-go { flex: 0 0 auto; min-width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-image: none; border: 2px solid #8fd06a; border-radius: 8px; background: linear-gradient(#4f8a44, #2f5a2a); color: #e8ffd8; text-shadow: 0 1px 0 #0008; }
.ub-btns .btn.ub-go small { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: #fff3c0; }
.ub-btns .btn.ub-go .bc-pi, .ub-btns .btn.ub-go .est-ic { width: 18px; height: 18px; }
/* 商隊驛站極簡版（使用者：商隊會跑版、很多按鈕好醜）：一排商隊格＋一顆大按鈕（ui-town.js stationCard） */
.cv-slots { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 6px; }
.cv-slot { position: relative; min-width: 0; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; border-radius: 10px; background: #0004; box-shadow: inset 0 0 0 1px #ffffff1a; color: #fff3d6; }
.cv-slot.empty { border: 2px dashed #ffe9b04d; background: none; box-shadow: none; }
.cv-slot.empty .cv-ic { width: 28px; height: 28px; opacity: .3; image-rendering: pixelated; object-fit: contain; filter: grayscale(1); }
.cv-slot.go .num { font: 400 15px 'Lilita One', sans-serif; color: #ffd24a; line-height: 1; white-space: nowrap; }
.cv-bar { display: block; width: 84%; height: 6px; border-radius: 3px; background: #0008; overflow: hidden; }
.cv-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e9a92a, #ffe27a); }
.cv-spd { display: inline-flex; align-items: center; gap: 3px; min-height: 26px; padding: 0 8px; border: 0; border-radius: 13px; background: linear-gradient(#8a5ad8, #5a2fa0); color: #fff; font: 400 13px 'Lilita One', sans-serif; box-shadow: inset 0 -2px 0 #0005; }
.cv-spd .ci { width: 14px; height: 14px; }
.cv-slot.ready { border: 2px solid #ffd24a; background: radial-gradient(circle at 50% 45%, #ffe27a55, #0000 70%), linear-gradient(#5a4214, #2a1e0a); box-shadow: 0 0 12px #ffd24a88; flex-direction: row; gap: 2px; cursor: pointer; animation: cvGlow 1.4s ease-in-out infinite; }
.cv-slot.ready .bc-pi { width: 18px; height: 18px; align-self: flex-end; }
@keyframes cvGlow { 50% { box-shadow: 0 0 20px #ffd24acc; } }
@media (prefers-reduced-motion: reduce) { .cv-slot.ready { animation: none; } }
.town-card .cv-main { width: 100%; min-height: 52px; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; font-size: 17px; }
.town-card .cv-main small { font: 400 15px 'Lilita One', sans-serif; opacity: .9; }
.town-card .cv-main .bc-pi { width: 20px; height: 20px; }
.town-card .bc-art .cv-art { width: 48px; height: 48px; image-rendering: pixelated; object-fit: contain; opacity: .85; }
.cv-bi { width: 26px; height: 26px; image-rendering: pixelated; object-fit: contain; }
.town-bar .tb-trade .tb-ic { object-fit: contain; }
/* 手機橫放：只支援直式（index.html #rotateHint）。觸控、橫放、高度很矮才出現；桌機寬螢幕不受影響 */
#rotateHint { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  #rotateHint { display: flex; position: fixed; inset: 0; z-index: 10000; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #120e0b; color: #fff0c7; font-size: 18px; }
  #rotateHint svg { animation: rotHint 2.4s ease-in-out infinite; }
}
@keyframes rotHint { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }

/* ---------- 英雄養成列與「下一步」（樣稿 2026-10-04，client/js/ui/ui-grow.js） ---------- */
.btn.big.next-step { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; width: 100%; margin: 10px 0 4px; text-align: left; min-height: 56px; height: auto; padding-top: 0; padding-bottom: 0; }
.next-step .ns-ic { flex: none; display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; }
.next-step .ns-ic .ci { width: 30px; height: 30px; }
.next-step .ns-tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.next-step .ns-tx b { font-size: 17px; }
.next-step .ns-tx small { font-size: 12px; }
.next-step .ns-go { font-style: normal; font-size: 14px; opacity: .8; }
.next-step.lack .ns-tx small { color: #ff8a7a; }
.gr-card { padding: 6px 10px; }
.gr-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 64px; align-items: center; column-gap: 6px; padding: 8px 0; border-bottom: 1px solid #ffffff14; }
.gr-row:last-of-type { border-bottom: 0; }
.gr-main { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; cursor: pointer; }
.gr-ic { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.gr-ic .ci.gr-ci { width: 26px; height: 26px; }
.gr-ic .sig-ic { width: 28px !important; height: 28px !important; }
.gr-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; white-space: nowrap; min-width: 0; overflow: hidden; }
.gr-top b { flex: none; font-size: 13px; color: #fff; }
.gr-sub { font-size: 11px; color: #c8b890; overflow: hidden; text-overflow: ellipsis; }
.gr-num { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 400 12px var(--num); font-style: normal; color: var(--gold); }
.gr-num small { color: #c8b890; font-size: 11px; }
.gr-bar { height: 6px; border-radius: 3px; background: #120e0b; border: 1px solid #5d5040; overflow: hidden; }
.gr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf5a, #f08a1c); }
.gr-res { display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; white-space: nowrap; font-size: 12px; cursor: pointer; min-width: 0; overflow: hidden; }
.gr-rv { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.gr-res .ci { width: 18px; height: 18px; }
.gr-res b { color: #fff; font: 400 13px var(--num); }
.gr-res small { color: #c8b890; font-size: 11px; }
.gr-res.lack b { color: #ff8a7a; }
.gr-btn.btn.sm { min-width: 0; width: 70px; padding: 0 2px 1px; font-size: 13px; }
.gr-btn.btn.sm small { font-size: 10px; color: #ff8a7a; margin: 0; }
.gr-btn.ub-no { flex-direction: column; line-height: 1.1; }
.gr-max { text-align: center; font: 400 13px var(--num); color: var(--gold); }
.gr-row.ready .gr-ic { filter: drop-shadow(0 0 4px #ffd24a); }
.gr-chips { grid-column: 1 / -1; display: flex; gap: 3px; padding: 6px 0 0 40px; cursor: pointer; flex-wrap: wrap; }
.gr-chips i { font-style: normal; font-size: 10px; padding: 0 4px; border-radius: 6px; background: #2a2418; color: #8a7a5a; border: 1px solid #4a3a20; }
.gr-chips i.on { color: #ffd23a; background: #4a3a10; border-color: #ffd23a88; }
.gr-detail { margin: 2px 0 8px; }
.gr-detail > .card { margin: 6px 0; }
.gr-detail .sig-stages, .gr-detail .sig-note { display: none; }
.gr-stars { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gr-stars li { display: flex; gap: 8px; font-size: 12px; color: #8a7a5a; padding: 4px 8px; border-radius: 6px; background: #1a1510; }
.gr-stars li b { flex: none; width: 34px; }
.gr-stars li.on { color: #f0e6cc; }
.gr-stars li.on b { color: #ffd23a; }
.gr-lock { display: flex; align-items: center; gap: 6px; padding: 8px 0 4px; font-size: 12px; color: #8a7a5a; border-top: 1px dashed #ffffff1c; }
.gr-lock .skic { opacity: .5; filter: grayscale(1); }
.gr-lock i { font-style: normal; font-size: 10px; }
.gr-lock b { color: #c8b890; }

/* 等待第三方付款（platform/pay.js waitPanel）：置中小卡，不是全螢幕；背景只淡淡一層 */
.pay-wait { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: #0005; padding: 16px; }
.pw-card { width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 16px 14px; border-radius: 12px; background: #2a1d14; border: 2px solid #c9a15a; box-shadow: 0 8px 24px #000a; color: #f5e6c8; text-align: center; }
.pw-card b { font: 400 17px var(--pixel); color: #ffe08a; }
.pw-card p { margin: 0; font-size: 13px; color: #d9c8a8; }
.pw-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #ffffff22; border-top-color: #ffd36b; animation: pwspin .9s linear infinite; }
@keyframes pwspin { to { transform: rotate(360deg); } }
.pw-btns { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.pw-btns .btn { flex: 1; }
/* 數位內容付款同意（ui-pay.js setConsentGate）：一行說明＋退款說明連結＋勾選＋前往付款 */
.pay-consent { text-align: center; }
.pay-consent .pc-msg { margin: 4px 0 6px; font-size: 14px; line-height: 1.5; }
.pay-consent .pc-link { margin: 0 0 12px; font-size: 13px; }
.pay-consent .pc-link a { color: #ffd36b; text-decoration: underline; }
.pay-consent .pc-agree { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; cursor: pointer; }
.pay-consent .pc-agree input { width: 20px; height: 20px; accent-color: #d9a43c; }
.pay-consent .btn[disabled] { filter: grayscale(.8); opacity: .6; }
/* 登入／取名字時載入畫面只當背景（boot/main.js registerFlow） */
#splash.idle .splash-sub, #splash.idle .splash-bar { visibility: hidden; }
