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

/* ---------- 共用圖示（資源） ---------- */
.ci { display: inline-block; width: 18px; height: 18px; background: center/contain no-repeat; vertical-align: -4px; flex: none; }
.ci-stone { background-image: url('../assets/ui/px/icon_stone.png'); }
.ci-iron { background-image: url('../assets/ui/px/icon_iron.png'); }
.ci-herb { background-image: url('../assets/ui/px/icon_herb.png'); }
.ci-insight { background-image: url('../assets/ui/px/icon_insight.png'); }
.ci-ticket { background-image: url('../assets/ui/px/icon_ticket.png'); }
.ci-jade { background-image: url('../assets/ui/px/icon_jade.png'); }
.ci-power { background-image: url('../assets/ui/px/nav_arena.png'); }
.cost { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.cost + .cost { margin-left: 6px; }
.cost.lack { color: #ff8a7a; }

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

.stagebar { position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 5px 14px; border-radius: 10px; background: linear-gradient(#2a221ce8, #1d1813e8); border: 2px solid #5d5040; box-shadow: 0 3px 10px #0007; white-space: nowrap; transition: transform .25s; }
#stageName { font-size: 15px; color: var(--title); text-shadow: 0 2px 0 #000a; }
#killbar { position: relative; width: 120px; height: 16px; border-radius: 8px; background: #120e0b; overflow: hidden; border: 2px solid #5d5040; box-shadow: inset 0 2px 3px #000; }
#killbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffcf5a, #f08a1c 60%, #d0660e); transition: width .3s; box-shadow: inset 0 -3px 0 #0003; }
#killbar span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 12px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }

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

/* ---------- 任務 & 聊天 ---------- */
.quest { position: absolute; left: 8px; bottom: calc(100px + var(--safe-b)); max-width: min(300px, 62vw); display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; padding: 7px 12px 7px 8px; border-radius: 10px; background: linear-gradient(#3b322ae8, #2a231ce8); border: 2px solid #6b5c49; color: var(--text); box-shadow: 0 4px 10px #0007; }
.quest .qtag { grid-row: span 2; font-size: 12px; color: #fff; padding: 7px 6px; border-radius: 6px; writing-mode: vertical-rl; background: linear-gradient(#ff9a3a, #d9611a); box-shadow: inset 0 -2px 0 #0003, 0 2px 0 #7a3000; text-shadow: 0 1px 0 #0006; }
.quest #questText { font-size: 13px; }
.quest small { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.quest.done { border-color: var(--gold); animation: glow 1.2s infinite; }
.quest.done small { color: var(--gold); }
@keyframes glow { 50% { 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/ts/square_wood.png') center/100% 100% no-repeat; filter: drop-shadow(0 3px 2px #0009); transition: transform .12s; }
.bottom-nav span img { width: 100%; height: 100%; object-fit: contain; }
.bottom-nav .center-btn span { width: 66px; height: 70px; margin-top: -16px; padding: 14px; background-image: url('../assets/ui/ts/smallblueroundbutton_regular.png'); }
.bottom-nav em { font-style: normal; font-size: 12px; color: #fff; margin-top: 1px; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.bottom-nav button.active span, .medal.active span { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 0 6px #ffd24a) drop-shadow(0 3px 2px #0009); }
.bottom-nav button.active em { color: var(--gold); }
.bottom-nav .dot::after { right: 10px; }

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

/* ---------- 按鈕（石材 9-slice） ---------- */
.btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 44px; padding: 0 8px 2px; border-style: solid; border-width: 10px 14px 13px; border-image: url('../assets/ui/ts/btn_brown.png') 24 30 30 30 fill / 10px 14px 13px stretch; background: none; color: #fff; font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-shadow: 0 2px 0 #0008, 1px 0 0 #0006, -1px 0 0 #0006; transition: transform .08s, filter .15s; }
.btn small { font-size: 11px; opacity: .95; display: inline-flex; align-items: center; gap: 3px; margin-top: 1px; }
.btn small .ci { width: 14px; height: 14px; vertical-align: -2px; }
.btn:active:not(:disabled) { transform: translateY(2px) scale(.98); }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn.gold { border-image-source: url('../assets/ui/ts/btn_gold.png'); }
.btn.green { border-image-source: url('../assets/ui/ts/btn_green.png'); }
.btn.blue { border-image-source: url('../assets/ui/ts/btn_blue.png'); }
.btn.red, .btn.danger { border-image-source: url('../assets/ui/ts/btn_red.png'); }
.btn.purple { border-image-source: url('../assets/ui/ts/btn_purple.png'); }
.btn.confirm { border-image-source: url('../assets/ui/ts/btn_red.png'); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.btn.sm { min-height: 36px; font-size: 13px; border-width: 8px 11px 10px; border-image-width: 8px 11px 10px; padding: 0 4px 1px; }
.btn.big { min-height: 54px; font-size: 16px; min-width: 120px; }
.btn.block { width: 100%; }
.btn:disabled { filter: grayscale(.9) brightness(.8); opacity: .7; cursor: not-allowed; }
.btn.gold:not(:disabled)::after { content: ''; position: absolute; top: -6px; bottom: -8px; width: 30%; left: -40%; background: linear-gradient(100deg, transparent, #ffffff55, transparent); animation: sheen 3.4s ease-in-out infinite; pointer-events: none; }
@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: url('../assets/ui/px/eq/chest_2.png') center bottom/contain no-repeat; image-rendering: pixelated; animation: chestShake .9s ease-in-out infinite; }
.summon .chest.rare { background-image: url('../assets/ui/px/eq/chest_3.png'); }
.summon .chest.light { animation: chestPop .5s cubic-bezier(.2,1.6,.4,1) forwards; filter: drop-shadow(0 0 14px var(--gc)) drop-shadow(0 0 30px var(--gc)) brightness(1.15); }
.summon .beam { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -300px 0 0 -260px; background: repeating-conic-gradient(from 0deg, transparent 0 10deg, var(--gc) 10deg 16deg); opacity: .35; border-radius: 50%; animation: spin 5s linear infinite; -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%); mask-image: radial-gradient(circle, #000 20%, transparent 65%); }
.summon-text { position: relative; margin-top: 10px; font-size: 22px; letter-spacing: .3em; color: var(--gc); text-shadow: 0 0 12px var(--gc), 0 2px 0 #000; }
@keyframes chestShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg) scale(1.02); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-2deg) scale(1.04); } }
@keyframes chestPop { from { transform: scale(.8); } to { transform: scale(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 12px 0; }
.reveal.single { grid-template-columns: 160px; justify-content: center; }
.rv { perspective: 600px; min-height: 150px; }
.rv-in { position: relative; width: 100%; height: 100%; min-height: 150px; transform-style: preserve-3d; animation: flip .6s cubic-bezier(.3,1.4,.5,1) both; animation-delay: calc(var(--d) + .2s); }
.rv-back, .rv-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rv-back { background: #3a2618; border: 9px solid transparent; border-image: url('../assets/ui/ts/btn_brown.png') 47 45 47 45 fill / 9px stretch; image-rendering: pixelated; font: 400 34px var(--pixel); color: #ffe08a; text-shadow: 0 2px 0 #000; }
.rv-front { transform: rotateY(180deg); background: linear-gradient(#4a4037, #2d2621); border: 2px solid var(--edge-lo); overflow: hidden; padding: 6px 4px; color: var(--text); }
.rv-front > * { position: relative; }
.rv-front b { font-size: 13px; font-weight: 400; }
.rv-front small { font-size: 10px; color: var(--muted); }
.rv-front em { font-style: normal; font-size: 11px; color: var(--gold); }
.rv-front .rar { position: absolute; left: 4px; top: 4px; z-index: 1; }
.rv-front .px-av { border-radius: 10px; background-color: #00000030; }
.rv.r2 .rv-front { border-color: #3f8ee0; }
.rv.r3 .rv-front { border-color: #a653ea; box-shadow: 0 0 16px #a653ea; }
.rv.r4 .rv-front { border-color: #ff8f1f; box-shadow: 0 0 24px #ff9f2f; }
.rays { position: absolute !important; left: 50%; top: 40%; width: 260px; height: 260px; margin: -130px 0 0 -130px; background: repeating-conic-gradient(from 0deg, #ffffff00 0 10deg, #ffe08a55 10deg 16deg); border-radius: 50%; animation: spin 6s linear infinite; }
.rv.r3 .rays { background: repeating-conic-gradient(from 0deg, #ffffff00 0 10deg, #c9a2ff44 10deg 16deg); }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }

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

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

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

/* ---------- 世界 ---------- */
.boss-card { text-align: center; padding: 14px; border-radius: 12px; background: radial-gradient(ellipse at top, #6a2a2a, #1a0a0a); border: 2px solid #3a0e0e; box-shadow: inset 0 0 30px #000a; margin-bottom: 10px; }
.boss-name { font-size: 22px; letter-spacing: 3px; color: #ffcf7a; margin-bottom: 8px; text-shadow: 0 2px 0 #000, 0 0 14px #ff3b3b; }
.bossbar { position: relative; height: 22px; border-radius: 11px; background: #120e0b; overflow: hidden; border: 2px solid #5d2020; margin-bottom: 6px; }
.bossbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ff7a5a, #c8201a); transition: width .5s; }
.bossbar span { position: relative; font: 400 13px var(--num); line-height: 18px; text-shadow: 0 1px 0 #000; }
.chatbox { height: calc(100% - 110px); min-height: 240px; max-height: 50vh; overflow-y: auto; background: #1d1813; border-radius: 10px; padding: 8px 10px; border: 2px solid var(--edge-lo); box-shadow: inset 0 3px 8px #000a; }
.msg { padding: 5px 0; font-size: 14px; border-bottom: 1px dashed #3a322b; }
.msg b { color: #8fd3ff; margin-right: 6px; font-weight: 400; }
.msg b small { color: var(--muted); }
.msg.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/px/eq/chest_2.png') center/contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 0 16px #ffd24a99); animation: floaty 2.4s ease-in-out infinite; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
#toasts { position: fixed; top: calc(126px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 420px); }
.toast { background: linear-gradient(#3b322af2, #2a231cf2); color: var(--text); padding: 9px 16px; border-radius: 10px; font-size: 14px; border: 2px solid #6b5c49; transition: opacity .4s, transform .4s; text-align: center; box-shadow: 0 4px 14px #0008; }
.toast.err { border-color: #c8201a; color: #ffc4b8; }
.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 .banner-label { display: inline-block; padding: 4px 26px 13px; border-style: solid; border-width: 0 30px; border-image: url('../assets/ui/ts/ribbon1.png') 0 97 0 98 fill / 0 30px stretch; image-rendering: pixelated; font: 400 30px var(--pixel); letter-spacing: 6px; text-indent: 6px; white-space: nowrap; color: #fff; text-shadow: 0 3px 0 #4a1010; filter: drop-shadow(0 4px 0 #0008); }
.banner .banner-label.gold { border-image-source: url('../assets/ui/ts/ribbon2.png'); color: #fff6c8; text-shadow: 0 3px 0 #5a3a00; }

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

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

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

/* ================= 進階系統 ================= */
.gold-t { color: var(--gold); }
.tabdot { position: relative; }
.tabdot::after { content: ''; position: absolute; top: 3px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #ff4a3a; }
.skill-icon img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.skill-icon:has(img) { padding: 0; overflow: hidden; }
/* 裝備 */
.eq-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.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-label { display: block; width: fit-content; margin: 0 auto -2px; padding: 2px 14px 9px; border-style: solid; border-width: 0 20px; border-image: url('../assets/ui/ts/ribbon1.png') 0 97 0 98 fill / 0 20px stretch; image-rendering: pixelated; font: 400 18px var(--pixel); letter-spacing: 4px; color: #fff; text-shadow: 0 2px 0 #4a1010; }
.combo b { font: 400 44px var(--num); color: #fff; -webkit-text-stroke: 2px #5a2a00; text-shadow: 0 4px 0 #3a1a00, 0 0 18px #ffb03a; }
.combo.warm b { color: #ffd24a; font-size: 54px; }
.combo.hot b { color: #ff6a3a; font-size: 64px; animation: rainbow 1s linear infinite; }
@keyframes comboPop { from { transform: translate(-50%, -50%) scale(1.5); } to { transform: translate(-50%, -50%) scale(1); } }
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, .town-tools { display: none; }
body.town .town-tools { display: flex; flex-direction: column; gap: 6px; position: absolute; right: 10px; bottom: calc(148px + var(--safe-b)); }
body.town .town-tools button { padding: 7px 12px; border-radius: 10px; border: 2px solid #8a7a5a; background: linear-gradient(#3a2f25, #221a14); color: #ffe9b0; font-size: 13px; box-shadow: 0 3px 8px #0009; }
body.town .town-tools button.on { border-color: #6dff7a; color: #b8ffb8; }
body.town .town-theme { display: flex; flex-direction: column; align-items: center; position: absolute; right: 10px; bottom: calc(146px + var(--safe-b)); padding: 4px 12px; border-radius: 10px; border: 2px solid #8a7a5a; background: linear-gradient(#3a2f25, #221a14); color: #ffe9b0; font-size: 13px; box-shadow: 0 3px 8px #0009; }
body.town .town-theme small { font-size: 10px; color: var(--muted); }
body.town .town-title { display: block; position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 4px 22px 6px; border-radius: 10px; background: linear-gradient(#2a221ce8, #1d1813e8); border: 2px solid #5d5040; text-align: center; font-size: 18px; color: var(--title); letter-spacing: 4px; pointer-events: none; }
body.town .town-title small { display: block; font-size: 10px; letter-spacing: 0; color: var(--muted); }
body.town .town-back { display: flex; align-items: center; gap: 6px; position: absolute; right: 10px; bottom: calc(96px + var(--safe-b)); 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-tools { bottom: calc(206px + 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/px/eq/weapon_4.png') center/80% no-repeat, radial-gradient(circle, #ff8a2a88, transparent 70%); animation: anvilGlow 1.6s ease-in-out infinite; }
@keyframes anvilGlow { 50% { 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; }

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

/* =========================================================
   手機直式介面重新編排：頂部壓縮成三排、左側按鈕縮小、底部依序為「導覽列 → 世界聊天 → 任務／技能」不互相遮擋
   ========================================================= */
@media (max-width: 640px) {
  /* 頂部：頭像列 → 資源一排 6 格 → 關卡列 */
  .topbar { top: calc(4px + var(--safe-t)); left: 6px; right: 6px; row-gap: 4px; }
  .avatar { width: 40px; height: 40px; }
  #seal { inset: 7px; font-size: 13px; }
  #vip { min-width: 18px; height: 16px; font-size: 9px; padding: 0 3px; border-width: 1px; right: -4px; bottom: -3px; }
  .who { margin-left: -10px; padding: 2px 10px 3px 14px; }
  .nameline b { font-size: 12px; max-width: 110px; }
  #netstate { font-size: 9px; }
  .powerline b { font-size: 14px; }
  .powerline .ci { width: 13px; height: 13px; }
  .res { flex-wrap: nowrap; gap: 3px; padding-left: 0; }
  .res > div { flex: 1 1 0; min-width: 0; height: 24px; padding: 0 3px 0 17px; border-width: 5px 6px; border-image-width: 5px 6px; }
  .res > div.jade { padding-right: 3px; }
  .res > div .plus { display: none; }
  .res b { font-size: 11px; }
  .ic { width: 20px; height: 20px; left: -7px; }
  .stagebar { top: calc(78px + var(--safe-t)); padding: 1px 6px; gap: 6px; border-width: 6px 8px !important; border-image-width: 6px 8px !important; }
  #stageName { font-size: 12px; }
  #killbar { width: 70px; }
  #bossBtn { padding: 0 6px; min-height: 26px; font-size: 12px; }
  #bossbar { top: calc(116px + var(--safe-t)); width: calc(100vw - 110px); padding: 3px 8px 5px; }
  #toasts { top: calc(118px + var(--safe-t)); }
  body.town .town-title { top: calc(78px + var(--safe-t)) !important; }
  /* 左側按鈕：縮小、緊湊 */
  .side-left { top: calc(118px + var(--safe-t)); left: 4px; gap: 1px; }
  .medal { width: 44px; }
  .medal span { width: 34px; height: 35px; padding: 7px; }
  .medal em { font-size: 9px; margin-top: -3px; }
  .medal.dot::after, .medal .dot::after { transform: scale(.75); }
  /* 底部：導覽列變矮 */
  .bottom-nav { padding: 2px 2px calc(2px + var(--safe-b)); border-width: 10px 8px 0; border-image-width: 10px 8px 0; }
  .bottom-nav span { width: 40px; height: 40px; padding: 7px; }
  .bottom-nav em { font-size: 10px; }
  .bottom-nav .center-btn span { width: 52px; height: 54px; margin-top: -14px; padding: 12px; }
  /* 世界聊天：緊貼導覽列上方整排 */
  .ticker { left: 6px; right: 6px; max-width: none; bottom: calc(72px + var(--safe-b)); font-size: 11px; padding: 2px 8px; }
  /* 任務卡（左）與技能（右）在聊天上方同一列 */
  .quest { bottom: calc(96px + var(--safe-b)); left: 6px; max-width: 54vw; padding: 4px 8px 4px 5px; column-gap: 6px; }
  .quest .qtag { font-size: 10px; padding: 4px 3px; }
  .quest #questText { font-size: 12px; }
  .quest small { font-size: 10px; }
  .cmd-bar { bottom: calc(98px + var(--safe-b)); right: 6px; gap: 6px; }
  .cmd-bar button { width: 40px; height: 40px; }
  .cmd-bar button.big { width: 50px; height: 50px; }
  #heroFocus { bottom: calc(160px + var(--safe-b)); }
  /* 主城：工具列改成導覽列上方橫排 */
  body.town .town-tools { flex-direction: row; left: 6px; right: 112px; bottom: calc(76px + var(--safe-b)) !important; gap: 4px; }
  body.town .town-tools button { flex: 1; padding: 6px 2px; font-size: 11px; white-space: nowrap; }
  body.town .town-back { right: 6px; bottom: calc(76px + var(--safe-b)) !important; padding: 5px 8px; font-size: 12px; }
  body.town .town-back span { font-size: 14px; }
}
/* 首領戰場：隱藏一般戰場介面，只留首領血條、跳過鈕與結算卡 */
body.arena .side-left, body.arena .quest, body.arena .ticker, body.arena .cmd-bar, body.arena .stagebar, body.arena #combo, body.arena .town-tools, body.arena .town-back, body.arena .town-title, body.arena #heroFocus { display: none !important; }
body.arena #bossbar { display: block !important; top: calc(84px + var(--safe-t)); }
#arenaHud .ar-skip { position: absolute; right: 10px; top: calc(128px + var(--safe-t)); z-index: 30; }
#arenaHud .ar-res { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 30; min-width: 240px; padding: 16px 22px; text-align: center; border-style: solid; border-width: 22px 20px 26px; border-image: url('../assets/ui/ts/wood.png') 85 84 103 84 / 22px 20px 26px 20px stretch; background: linear-gradient(#3a2618, #2a1b12) padding-box; image-rendering: pixelated; animation: arIn .35s cubic-bezier(.2, 1.4, .4, 1); }
#arenaHud .ar-res b { display: block; font: 26px var(--pixel); color: #ffd24a; text-shadow: 0 3px 0 #4a1a00; margin-bottom: 6px; }
#arenaHud .ar-res div { margin-bottom: 12px; font-size: 14px; }
@keyframes arIn { from { opacity: 0; transform: translate(-50%, -40%) scale(.8); } }
/* 傳承 */
.legacy-card { display: flex; align-items: center; justify-content: space-around; gap: 8px; text-align: center; }
.legacy-card > div { display: flex; flex-direction: column; gap: 2px; }
.legacy-card b { font-size: 26px; }
.legacy-arrow { font-size: 22px; color: var(--title); }
.legacy-rules .card { margin: 0; }
#legacyBtn.hot { animation: glow 1.2s infinite; }
@media (max-width: 640px) { #legacyBtn { padding: 0 6px; min-height: 26px; font-size: 12px; } }
/* 招募：卡池選擇、新手自選、限時大保底、印記 */
.banner-sel { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin-bottom: 8px; }
.banner-sel .bs-newbie b { color: #7dff9a; } .banner-sel .bs-limited b { color: #ff8ac0; }
.gb-h.picked { outline: 3px solid #7dff9a; border-radius: 10px; }
.gb-h[data-act] { cursor: pointer; }
.gb-guar { position: absolute; left: 10px; top: 10px; padding: 2px 8px; border-radius: 8px; background: #ff4a8a; color: #fff; font-size: 12px; box-shadow: 0 0 10px #ff4a8a; }
.gacha-btns em.off { font-style: normal; color: #7dff9a; margin-left: 4px; }
.gacha-well .row { margin-bottom: 6px; }
.gacha-log div { padding: 4px 0; border-bottom: 1px solid #ffffff14; font-size: 13px; }
.dcard.on { outline: 3px solid var(--gold); }
/* 分批解鎖與新手引導 */
.bottom-nav button.locked span { filter: grayscale(1) brightness(.55); }
.bottom-nav button.locked::after { content: '🔒 ' attr(data-lock); position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: 9px; color: #fff; background: #000b; padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.tabs button.locked { opacity: .45; }
.tut-ring { position: fixed; z-index: 60; pointer-events: none; border: 3px solid #ffe27a; border-radius: 14px; box-shadow: 0 0 0 4000px #0005, 0 0 18px #ffd24a; animation: tutPulse 1.2s ease-in-out infinite; }
.tut-tip { position: fixed; z-index: 61; width: 220px; padding: 8px 10px; border-radius: 10px; background: #2a1b12; border: 2px solid #ffe27a; color: #fff; font-size: 13px; pointer-events: none; box-shadow: 0 4px 12px #000a; }
@keyframes tutPulse { 50% { transform: scale(1.06); } }
/* 戰團 */
.band-sum { display: flex; justify-content: space-around; text-align: center; gap: 6px; }
.band-sum > div { display: flex; flex-direction: column; }
.band-sum b { font-size: 20px; }
.band .band-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.band-heroes { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px 0; }
.band-heroes span { cursor: pointer; }
.band.locked { opacity: .6; }

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

/* 手機：金幣、鑽石和玩家名片同一排，其餘 4 種資源第二排（一排 6 格太擠，數字會換行） */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; align-items: center; column-gap: 4px; }
  .topbar::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
  .res { display: contents; }
  .profile { order: 0; flex: none; }
  .res > div[data-res="stone"], .res > div.jade { order: 1; flex: 1 1 0; height: 28px; }
  .res > div[data-res="stone"] { margin-left: 8px; }
  .res > div:not([data-res="stone"]):not(.jade) { order: 3; flex: 1 1 0; }
  .res > div { margin-left: 7px; }
  .res > div:not([data-res="stone"]):not(.jade):first-of-type { margin-left: 7px; }
  .res b { white-space: nowrap; overflow: hidden; text-overflow: clip; font-size: 12px; }
  .res > div.jade { padding-right: 22px; }
  .res > div.jade .plus { display: block; width: 22px; height: 24px; }
  .nameline b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

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

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

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

/* 主將 */
.lead-bar { margin: 4px 0 8px; padding: 8px; border-radius: 10px; background: linear-gradient(#3a2a12cc, #1d160dcc); border: 1px solid #a8802a88; }
.lead-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 13px; }
.lead-head > b { color: #ffe08a; font-size: 15px; font-weight: 400; }
.lead-head small { color: var(--muted); font-size: 11px; }
.lead-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 8px 0 4px; }
.lead-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 80px; padding: 14px 2px 3px; overflow: hidden; border-radius: 8px; background: #0005; border: 1px solid #0008; min-width: 0; }
.lead-slot.r5 { border-color: #ff3b6b; box-shadow: 0 0 8px #ff3b6b66; } .lead-slot.r4 { border-color: #ff8f1f; } .lead-slot.r3 { border-color: #a653ea; }
.lead-slot i { position: absolute; top: 2px; right: 2px; font-style: normal; font-size: 10px; color: #9fe07a; text-shadow: 0 1px 0 #000; }
.lead-slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #f4e2c4; }
.lead-slot.empty { color: #ffe08a; font-size: 20px; border-style: dashed; justify-content: center; padding-top: 3px; }
.lead-slot > .px-av, .lead-slot > img { flex: none; margin-bottom: 2px; }
.lead-bar p { margin: 2px 0 0; font-size: 11px; }
.tag.lead { background: linear-gradient(#ffd24a, #d9901c); color: #3a2000; }
.rv-tag { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #2f7a3a; color: #fff; z-index: 2; }
.rv-tag.lead { background: linear-gradient(#ffd24a, #d9901c); color: #3a2000; }
.rv-army .rv-front { justify-content: center; }

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

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

/* 今日 */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.today-head b { font-weight: 400; color: #ffe08a; }
.today-list { display: flex; flex-direction: column; gap: 6px; }
.today-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: #0003; border: 1px solid #0006; }
.today-row.ready { border-color: #ffd24a88; background: #ffd24a14; }
.today-row > div { display: flex; flex-direction: column; min-width: 0; }
.today-row b { font-weight: 400; }
.today-row small { font-size: 11px; color: var(--muted); }
.today-events { display: flex; flex-direction: column; gap: 6px; background: linear-gradient(90deg, #5a2a8a88, #2a1a3a88) !important; border-color: #c07aff88 !important; }
.today-events div { display: flex; flex-direction: column; }
.today-events b { font-weight: 400; color: #ffd6ff; }
.today-events small { font-size: 12px; color: #e8d0ff; }
.guild-goal .goal-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0 4px; }
.guild-goal .goal-tiers .btn { padding: 4px 2px; font-size: 12px; }
.guild-goal .goal-tiers small { display: block; font-size: 10px; line-height: 1.2; }
.cx-miles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
.cx-miles .btn { padding: 4px 2px; font-size: 12px; }
.cx-miles small { display: block; font-size: 10px; }
.hero-story { font-size: 13px; line-height: 1.7; color: #f4e2c4; margin: 6px 0 0; }
s.was { opacity: .6; font-size: .9em; margin-left: 2px; }
.pity .done .pbar i { background: linear-gradient(90deg, #ffd24a, #ff9f2f); }
.tut-ring.passive { box-shadow: 0 0 18px #ffd24a; animation: none; }
.cost .eta { font-style: normal; font-size: .85em; opacity: .8; margin-left: 3px; }
.tag.new { background: #e8453c; color: #fff; left: auto; right: 4px; top: auto; bottom: 34%; }
.gacha-btns .btn small { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.gacha-btns .off-line { flex-basis: 100%; text-align: center; font-size: 11px; margin: 1px 0 0 !important; white-space: nowrap; }
.gacha-btns .btn.gold em.off { color: #1d6a2a; text-shadow: none; }
.btn.train-all { width: 100%; }
.btn.train-all small { display: block; font-size: 10px; opacity: .85; }
.formation-head > .row { flex: 1 1 100%; }
.bad-t { color: #ff8a7a; }
.tower-bar i { background: linear-gradient(90deg, #7a2a9a, #c07aff) !important; }
.view-btn { flex: none; border: 1px solid #c07aff; background: #2a1a3acc; color: #e8d0ff; border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.view-btn.on { background: #c07aff; color: #1a0a2a; }
.bb-time { font-style: normal; margin-left: auto; margin-right: 8px; color: #ffe08a; font-size: 14px; }
.bb-time.urgent { color: #ff5a4a; animation: pulse .5s infinite; }
#stageName { cursor: pointer; }
#stageName .mode { font-style: normal; font-size: .82em; padding: 0 6px; margin-right: 6px; border-radius: 6px; }
#stageName .mode.push { background: #c0392b; color: #fff; }
#stageName .mode.farm { background: #2f7a3a; color: #fff; }
#stageName small { margin-left: 6px; font-size: .8em; color: #ffe08a; }

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


/* Approved branding: icon v13 / landscape and portrait v15. */
#splash { background: #082d43 url('../brand/approved-v15/landing-wide.webp') center/cover no-repeat; }
#splash .splash-logo { position:absolute; left:5%; top:25%; font-size:clamp(36px,6vw,84px); letter-spacing:.08em; animation:none; color:#fff0c7; text-shadow:0 3px #422c1a; }
.splash-tagline { position:absolute; left:6%; top:calc(25% + clamp(36px,6vw,84px) + 18px); color:#f6ce70; letter-spacing:.4em; font-size:18px; }
#splash .splash-sub { position:absolute; bottom:7%; left:5%; width:30%; text-align:center; color:#f4e9ce; font-size:12px; letter-spacing:.1em; text-shadow:0 1px 3px #000; }
#splash .splash-bar { position:absolute; bottom:11%; left:5%; width:30%; margin:0; }
@media (orientation:portrait) {
 #splash { background-image:linear-gradient(#07233e55,transparent 35%),url('../brand/approved-v15/landing-tall.webp'); }
 #splash .splash-logo { top:8%; left:0; width:100%; text-align:center; font-size:clamp(40px,11vw,76px); }
 .splash-tagline { top:calc(8% + clamp(40px,11vw,76px) + 18px); left:0; width:100%; text-align:center; }
 #splash .splash-sub { left:15%; width:70%; bottom:6%; }
 #splash .splash-bar { left:15%; width:70%; bottom:10%; }
}
