/* =========================================================
   英雄公會 — 介面樣式（參考 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%; 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; }
#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/icon_stone.png'); }
.ci-iron { background-image: url('../assets/ui/icon_iron.png'); }
.ci-herb { background-image: url('../assets/ui/icon_herb.png'); }
.ci-insight { background-image: url('../assets/ui/icon_insight.png'); }
.ci-ticket { background-image: url('../assets/ui/icon_ticket.png'); }
.ci-jade { background-image: url('../assets/ui/icon_jade.png'); }
.ci-power { background-image: url('../assets/ui/nav_arena.png'); }
.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/stone/profile_ring.png') center/contain no-repeat; 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/stone/btn_small_on.png') center/100% 100% no-repeat; }
.plus::after { content: ''; position: absolute; inset: 8px; background: url('../assets/ui/stone/picto_plus.png') center/contain no-repeat; }
.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; }
#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/stone/btn_circle_brown.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% { 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 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/stone/btn_square.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/stone/btn_circle_blue.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); }
.close-btn { position: absolute; right: 8px; top: 6px; width: 44px; height: 46px; border: 0; background: url('../assets/ui/stone/btn_circle_gray.png') center/contain no-repeat; filter: drop-shadow(0 3px 2px #0008); }
.close-btn::after { content: ''; position: absolute; inset: 14px; background: url('../assets/ui/stone/picto_cancel.png') center/contain no-repeat; filter: brightness(.35); }
.close-btn:active { transform: scale(.92); }
.sheet-body { flex: 1; overflow-y: auto; 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/stone/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/stone/btn_green.png'); }
.btn.green { border-image-source: url('../assets/ui/stone/btn_bluegreen.png'); }
.btn.blue { border-image-source: url('../assets/ui/stone/btn_blue.png'); }
.btn.red, .btn.danger { border-image-source: url('../assets/ui/stone/btn_red.png'); }
.btn.purple { border-image-source: url('../assets/ui/stone/btn_purple.png'); }
.btn.confirm { border-image-source: url('../assets/ui/stone/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; }
@keyframes sheen { 0%, 70% { left: -40%; } 100% { left: 120%; } }
.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% { left: -60%; } 100% { left: 160%; } }
.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: center bottom/contain no-repeat; animation: chestShake .9s ease-in-out infinite; }
.summon .chest.light { animation: chestPop .5s cubic-bezier(.2,1.6,.4,1) forwards; }
.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: url('../assets/ui/stone/btn_square.png') center/100% 100%; font-size: 34px; color: #fff; 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/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 { margin: 8px auto; height: 64px; background: center/contain no-repeat; font-size: 0; }
.result.win { background-image: url('../assets/ui/stone/text_victory.png'); animation: chestPop .5s cubic-bezier(.2,1.6,.4,1); }
.result.lose { background-image: url('../assets/ui/stone/text_defeat.png'); }

/* ---------- 世界 ---------- */
.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.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; }
.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/stone/chest_goldopenlight.png') center/contain no-repeat; 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; }
.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; }

/* ---------- 手機 ---------- */
@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-imgs img { max-height: 58px; max-width: 70vw; filter: drop-shadow(0 4px 0 #0008); }

/* ---------- 全員出戰 ---------- */
.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; }
.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 { 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; }
.item-btns .btn { min-height: 30px; }
/* 每日任務、戰令 */
.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); } }
.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: rainbow 3s linear 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% { 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 img { display: block; height: 34px; margin: 0 auto -4px; filter: drop-shadow(0 3px 0 #0008); }
.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); } }
body.frenzy #field { filter: saturate(1.35) contrast(1.05); }
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 { display: none; }
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)); padding: 8px 14px; border-radius: 12px; border: 2px solid #ffd24a; background: linear-gradient(#c0392b, #7a1a10); color: #fff; font-size: 14px; box-shadow: 0 4px 10px #000a; }
body.town .town-back span { font-size: 18px; }
body.town .stagebar, body.town .cmd-bar, body.town #combo { display: none !important; }
@media (max-width: 640px) { body.town .town-title { top: calc(126px + var(--safe-t)); } body.town .town-back { bottom: calc(150px + var(--safe-b)); } body.town .town-theme { bottom: calc(200px + var(--safe-b)); } }
.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; }
.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-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; }
@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-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/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% { filter: drop-shadow(0 0 10px #ffb03a); 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(122px + 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 { filter: brightness(1.5); } }
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; }
