:root {
  --bg: #141416;
  --panel: #1c1c20;
  --line: #4a4234;
  --gold: #c9b27c;
  --gold-hi: #e6d3a0;
  --text: #e9dfc6;
  --muted: #8f8a7e;
  --red: #c0584a;
  --teal: #5fb3b0;
  --violet: #a98be0;
  --up: #d9b86a;
  --rev: #b56a8a;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --card-w: 112px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 30%, #1e1c22 0%, var(--bg) 70%);
  color: var(--text); font-family: var(--sans); font-size: 14px;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.screen { display: none; height: 100vh; flex-direction: column; }
.screen.active { display: flex; }
.screen.center { align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }

.top { display: flex; align-items: baseline; gap: 18px; padding: 14px 24px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.top h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; letter-spacing: 2px; color: var(--gold-hi); }
.top .sub { color: var(--gold); font-family: var(--serif); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#teamBar, #weapons { display: flex; gap: 4px; }
#teamBar img, #weapons img { height: 40px; border-radius: 3px; border: 1px solid var(--line); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.panel-h { font-family: var(--serif); color: var(--gold); font-size: 15px; margin-bottom: 8px; letter-spacing: 1px; }

.primary { background: linear-gradient(#3a3122, #2a2419); border: 1px solid var(--gold); color: var(--gold-hi);
  padding: 10px 18px; border-radius: 4px; font-family: var(--serif); font-size: 16px; letter-spacing: 1px; }
.primary:hover:not(:disabled) { background: linear-gradient(#4a3e2a, #342c1e); }
.primary:disabled { opacity: .4; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; border-radius: 4px; }
.ghost:hover { color: var(--text); border-color: var(--gold); }
.ghost.sm { padding: 4px 10px; font-size: 12px; }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; font-size: 12px; color: var(--gold); margin: 2px 4px 2px 0; }

/* ---------- 选队 ---------- */
.select-wrap { flex: 1; display: flex; gap: 20px; padding: 16px 24px; min-height: 0; }
#charGrid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; overflow-y: auto; min-width: 0; }
.el-col { display: flex; flex-direction: column; gap: 10px; }
.el-head { font-family: var(--serif); font-size: 20px; color: var(--c); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.pick { position: relative; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; transition: transform .15s, border-color .15s; }
.pick img { width: 100%; border-radius: 4px; }
.pick:hover { transform: translateY(-3px); }
.pick.on { border-color: var(--gold-hi); box-shadow: 0 0 18px rgba(230, 211, 160, .35); }
.pick-mark { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold-hi); color: #1a1610; font-weight: 700; display: none; align-items: center; justify-content: center; }
.pick.on .pick-mark { display: flex; }
.select-side { width: 320px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; flex-shrink: 0; }
.cd-name { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.cd-name b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.cd-name span { color: var(--muted); font-size: 12px; }
.cd-meta { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.face { border-left: 3px solid var(--up); padding: 6px 10px; margin-bottom: 8px; background: rgba(255, 255, 255, .02); text-align: left; }
.face.rev { border-color: var(--rev); }
.face p { margin: 4px 0 0; line-height: 1.5; }
.face-h { display: flex; justify-content: space-between; font-family: var(--serif); color: var(--gold-hi); }
.cost { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--gold); align-items: center; justify-content: center; font-size: 12px; font-family: var(--sans); color: var(--gold-hi); }
#teamSlots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.slot { aspect-ratio: 2/3; border: 1px dashed var(--line); border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.fx { list-style: none; padding: 0; margin: 0 0 12px; font-size: 12px; line-height: 1.55; }
.fx li { padding: 3px 0 3px 10px; border-left: 2px solid var(--line); margin-bottom: 4px; }
.fx .fx-res { border-color: var(--teal); }
.fx .fx-triad { border-color: var(--gold); }
.fx .fx-bond { border-color: var(--rev); }
#startBtn { width: 100%; }

/* ---------- 战斗 ---------- */
.arena { flex: 1; display: flex; gap: 16px; padding: 14px 24px 0; min-height: 0; }
.field { flex: 1; display: flex; flex-direction: column; justify-content: space-between; position: relative; min-width: 0; }
.log { width: 270px; display: flex; flex-direction: column; min-height: 0; flex-shrink: 0; margin-bottom: 10px; }
#logList { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; font-size: 12px; line-height: 1.6; color: var(--muted); }
#logList .turn { color: var(--gold); margin-top: 6px; }
#logList .up { color: var(--up); }
#logList .rev { color: var(--rev); }
#logList .dmg { color: #d5c6a8; }
#logList .bad { color: var(--red); }
#logList .good, #logList .heal { color: var(--teal); }
#logList .enemy { color: #d88a7a; }

.enemy { display: flex; gap: 22px; align-items: center; justify-content: center; position: relative; }
.enemy-art { position: relative; width: clamp(130px, 24vh, 200px); flex-shrink: 0; }
.enemy-art img { width: 100%; border-radius: 6px; transform: rotate(180deg);
  filter: grayscale(.55) sepia(.3) hue-rotate(-25deg) saturate(1.4) brightness(.8) contrast(1.1);
  box-shadow: 0 0 30px rgba(192, 88, 74, .25); }
.enemy.true-art .enemy-art img { transform: none; filter: none; box-shadow: 0 0 34px rgba(192, 88, 74, .35); }
.enemy.true-art .rev-mark { display: none; }
.enemy.act .enemy-art { animation: lunge .25s ease; }
.intent small { display: block; margin-top: 3px; font-size: 11px; color: #d9a89a; }
.rest-opts { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.rest-opt { width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 8px; text-align: left; transition: transform .15s, border-color .15s; }
.rest-opt:hover { transform: translateY(-4px); border-color: var(--gold); }
.rest-opt b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--gold-hi); }
.rest-opt span { color: var(--muted); line-height: 1.5; }
#rest h2 { font-family: var(--serif); font-weight: 400; color: var(--gold-hi); font-size: 28px; margin: 0; }
@keyframes lunge { 50% { transform: translateY(18px) scale(1.04); } }
.rev-mark { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); background: #3a1c1c; color: #e3a093; border: 1px solid #7a3a32; font-family: var(--serif); font-size: 12px; padding: 1px 10px; border-radius: 3px; }
.enemy-info { width: 300px; }
.ename { font-family: var(--serif); font-size: 24px; color: #e8b6a8; }
.esub { color: var(--muted); font-size: 11px; margin-bottom: 8px; min-height: 14px; }
.intent { display: inline-block; border: 1px solid #7a3a32; background: rgba(120, 40, 30, .25); color: #f0c4b6; border-radius: 4px; padding: 6px 12px; margin-bottom: 10px; font-size: 13px; }
.intent b { font-family: var(--serif); font-weight: 400; margin-right: 6px; }
.bar { position: relative; height: 18px; background: #2a2226; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, #7d2f2a, #b8493c); transition: width .3s; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; text-shadow: 0 1px 2px #000; }
.player .bar > div { background: linear-gradient(90deg, #3d6e5e, #5fb3b0); }
.status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 22px; }
.st { font-size: 12px; padding: 2px 8px; border-radius: 3px; border: 1px solid; }
.st.blk { color: #9fc3d6; border-color: #3a5866; }
.st.shk { color: var(--violet); border-color: #5a4a80; }
.st.str { color: #e39a7a; border-color: #7a4a3a; }
.st.weak { color: #b0a0d0; border-color: #4a4266; }

.player { align-self: center; width: min(620px, 100%); padding: 12px 16px; background: rgba(28, 28, 32, .8); border: 1px solid var(--line); border-radius: 6px; position: relative; margin-bottom: 10px; }
.stat-row { display: flex; gap: 18px; margin-bottom: 8px; align-items: center; }
.stat { display: flex; align-items: center; gap: 8px; }
.stat label { font-family: var(--serif); color: var(--gold); font-size: 13px; width: 30px; }
.hpbox { flex: 1; }
.hpbox .bar { flex: 1; }
.shield b { font-size: 18px; color: #9fc3d6; min-width: 24px; }
.shield.zero b { color: var(--muted); }
.pips { display: flex; gap: 5px; align-items: center; }
.pips i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); background: #232025; }
.pips.fate i.on { background: radial-gradient(circle at 35% 35%, #fff2c4, #c9a24c); border-color: var(--gold-hi); box-shadow: 0 0 8px rgba(230, 200, 120, .5); }
.pips.fate span { margin-left: 4px; color: var(--gold-hi); }
.pips.flow i { border-radius: 2px; transform: rotate(45deg); width: 11px; height: 11px; margin: 0 2px; }
.pips.flow i.on { background: var(--rev); border-color: #e0a0bc; }
.pips.flow i.last { border-color: var(--red); }
.pip-t { color: var(--muted); font-size: 12px; }
#flowBox.flash { animation: flash .6s; }
@keyframes flash { 0%, 100% { background: transparent; } 30% { background: rgba(192, 88, 74, .5); } }

.float { position: absolute; top: 20%; left: 50%; font-size: 26px; font-weight: 700; pointer-events: none; animation: floatUp .9s ease-out forwards; text-shadow: 0 2px 6px #000; z-index: 5; }
.float.dmg { color: #ff8a70; }
.float.heal { color: #7fe0c6; }
.float.wp { color: var(--gold-hi, #f0d58a); font-size: 16px; white-space: nowrap; }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -50px); } }

.played { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); width: 130px; opacity: 0; pointer-events: none; z-index: 4; }
.played img, .played .card { width: 100%; border-radius: 6px; }
.played.show { animation: playIn .9s ease forwards; }
.played.rev.show > * { transform: rotate(180deg); }
.played.rev.show { filter: drop-shadow(0 0 16px rgba(181, 106, 138, .8)); }
.played.up.show { filter: drop-shadow(0 0 16px rgba(217, 184, 106, .7)); }
@keyframes playIn { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(.9); } }

/* 手牌 */
.hand-area { display: flex; align-items: flex-end; gap: 16px; padding: 8px 24px 16px; border-top: 1px solid var(--line); flex-shrink: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .3)); }
#hand { flex: 1; display: flex; justify-content: center; gap: 6px; min-height: calc(var(--card-w) * 1.5 + 10px); align-items: flex-end; }
.hand-r { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.pile { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pile b { color: var(--text); font-size: 16px; }
.pile:hover { border-color: var(--gold); }
#endBtn small { opacity: .5; font-size: 11px; margin-left: 4px; }

.card { position: relative; width: var(--card-w); aspect-ratio: 2/3; padding: 0; border: none; background: none; border-radius: 6px; flex-shrink: 0;
  transition: transform .15s; transform: translateY(calc(var(--i, 0) * var(--i, 0) * 2px)) rotate(calc(var(--i, 0) * 2deg)); }
.card img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
#hand .card:hover { transform: translateY(-16px) scale(1.06); z-index: 3; }
.card.dim { filter: brightness(.45) grayscale(.5); }
.c-cost { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; background: radial-gradient(circle at 35% 35%, #fff2c4, #b8913c); color: #241c0c; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.card.basic { background: linear-gradient(160deg, #2a2620, #1a1816); border: 1px solid var(--gold); box-shadow: inset 0 0 0 4px #1a1816, inset 0 0 0 5px var(--line), 0 4px 12px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.b-glyph { font-size: 34px; color: var(--gold-hi); }
.b-name { font-family: var(--serif); font-size: 16px; color: var(--gold-hi); letter-spacing: 2px; }
.b-sub { font-size: 10px; color: var(--muted); }

/* 弹窗 */
#overlay { position: fixed; inset: 0; background: rgba(8, 8, 10, .78); display: none; align-items: center; justify-content: center; z-index: 10; backdrop-filter: blur(3px); }
#overlay.open { display: flex; }
#detail { display: flex; gap: 24px; align-items: center; max-width: 92vw; max-height: 92vh; }
.dt-art { width: 280px; flex-shrink: 0; }
.big-art { width: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.card.basic.big { width: 100%; transform: none; }
.card.basic.big .b-glyph { font-size: 70px; }
.dt-side { width: 340px; display: flex; flex-direction: column; gap: 10px; }
.dt-side h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0 0 4px; color: var(--gold-hi); }
.dt-side h3 span { font-size: 12px; color: var(--muted); font-family: var(--sans); }
.play { text-align: left; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--up); border-radius: 4px; padding: 10px 12px; transition: background .15s, transform .15s; }
.play.rev { border-left-color: var(--rev); }
.play:hover:not(:disabled) { background: #26242a; transform: translateX(4px); }
.play.up:hover:not(:disabled) { border-color: var(--up); }
.play.rev:hover:not(:disabled) { border-color: var(--rev); }
.play:disabled { opacity: .45; }
.play p { margin: 6px 0 2px; line-height: 1.5; }
.play small { color: var(--rev); font-size: 11px; display: block; }
.play.up small { color: var(--muted); }
.play small.warn { color: var(--red); }
.choose { text-align: center; }
.choose h3 { font-family: var(--serif); font-weight: 400; color: var(--gold-hi); }
.choose-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; max-height: 70vh; overflow-y: auto; padding: 10px; }
.choose-row .card { transform: none; }
.choose-row .card:hover { transform: translateY(-6px); }
.choose-row:not(.small) .card { --card-w: 150px; }

/* 奖励 */
#rewardOpts { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.reward { width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: left; transition: transform .15s, border-color .15s; }
.reward:hover { transform: translateY(-4px); border-color: var(--gold); }
.reward img { width: 100%; border-radius: 4px; margin-bottom: 8px; }
.rw-t { font-family: var(--serif); color: var(--gold-hi); font-size: 16px; margin-bottom: 6px; }
.rw-d { margin: 0; color: var(--text); line-height: 1.5; font-size: 13px; }
.reward .face { font-size: 12px; }
#reward h2, #end h2 { font-family: var(--serif); font-weight: 400; color: var(--gold-hi); font-size: 28px; margin: 0; }
#reward { overflow-y: auto; justify-content: flex-start; padding-top: 32px; }



/* ---------- 顶栏信息 ---------- */
.hud { display: flex; align-items: center; gap: 14px; }
.hud-item { color: var(--muted); font-size: 13px; white-space: nowrap; }
.hud-item b { color: var(--text); font-weight: 600; margin-left: 2px; }
.hud-item.gold b { color: var(--gold-hi); }
.hud-team, .hud-wp { display: flex; gap: 3px; }
.hud-team img, .hud-wp img { height: 36px; border-radius: 3px; border: 1px solid var(--line); }

/* ---------- 地图 ---------- */
#mapScroll { flex: 1; overflow-y: auto; display: flex; justify-content: center; padding: 10px 16px 30px; }
#mapBox { position: relative; width: min(640px, 100%); flex-shrink: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 178, 124, .05), transparent 70%); }
#mapBox svg { position: absolute; inset: 0; }
#mapBox line { stroke: #4a4234; stroke-width: 2; stroke-dasharray: 4 6; }
#mapBox line.walked { stroke: var(--gold); stroke-dasharray: none; }
.node { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%;
  background: #1c1a1f; border: 1px solid var(--line); padding: 8px; display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.node img { width: 100%; height: 100%; object-fit: contain; opacity: .55; }
.node .glyph { font-family: var(--serif); font-size: 24px; color: var(--gold); opacity: .6; }
.node-name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.node:hover .node-name, .node.reach .node-name, .node.t-boss .node-name { opacity: 1; }
.node.reach { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 178, 124, .12), 0 0 18px rgba(230, 211, 160, .25); animation: pulse 1.6s ease-in-out infinite; }
.node.reach img, .node.reach .glyph, .node.visited img, .node.visited .glyph { opacity: 1; }
.node.reach:hover { transform: translate(-50%, -50%) scale(1.12); }
.node.visited { background: #2a2419; border-color: var(--gold); }
.node.here { box-shadow: 0 0 0 3px var(--gold-hi); }
.node:disabled { cursor: default; }
.node.t-elite { border-color: #7a3a32; }
.node.t-boss { width: 84px; height: 84px; border-color: #7a3a32; background: #241618; }
.node.t-boss.reach { border-color: #e3a093; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(201, 178, 124, .05), 0 0 26px rgba(230, 211, 160, .35); } }

/* ---------- 通用面板 ---------- */
#panel .panel-wrap { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px 32px; text-align: center; }
#panel h2 { font-family: var(--serif); font-weight: 400; color: var(--gold-hi); font-size: 28px; margin: 0; }
.panel-text { max-width: 560px; color: var(--text); line-height: 1.8; font-family: var(--serif); font-size: 16px; }
.panel-text p { margin: 4px 0; }
.panel-opts { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 1100px; }
.panel-foot { display: flex; gap: 12px; margin-top: 6px; }
.opt { width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: left; transition: transform .15s, border-color .15s; display: flex; flex-direction: column; gap: 6px; }
.opt:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--gold); }
.opt:disabled { opacity: .45; cursor: default; }
.opt.sold { opacity: .3; }
.panel-opts.services .opt, .opt.service { width: 220px; }
.panel-opts.services .opt { padding: 16px; }
.opt-art { position: relative; }
.opt-art img { width: 100%; border-radius: 4px; display: block; }
.opt-up { position: absolute; top: 6px; right: 6px; background: var(--gold-hi); color: #1a1610; font-weight: 700; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.opt-t { font-family: var(--serif); color: var(--gold-hi); font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.opt-d { margin: 0; color: var(--text); line-height: 1.55; font-size: 13px; }
.opt-note { margin: 0; color: var(--gold); font-size: 12px; }
.price { font-family: var(--sans); font-size: 12px; color: var(--gold); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.opt .face { font-size: 12px; margin-bottom: 0; }
.opt .face .upn { display: block; color: var(--teal); font-size: 11px; margin-top: 2px; }
.panel-opts.shop .opt { width: 200px; }

/* ---------- 卡牌标记 ---------- */
.c-up { position: absolute; bottom: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #0d1f1e; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.c-flip { position: absolute; bottom: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--rev); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); font-family: var(--serif); }
.card.flipped img { transform: rotate(180deg); }
.pile.back { background: url(assets/cardback.png) center / cover; border-color: var(--gold); width: 64px; height: 96px; justify-content: flex-end; padding-bottom: 6px; text-shadow: 0 1px 3px #000; color: var(--gold-hi); }
.pile.back b { background: rgba(0, 0, 0, .55); border-radius: 10px; padding: 0 8px; }


.panel-art { display: block; width: 150px; margin: 0 auto 14px; border-radius: 6px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: cardIn .6s ease; }
@keyframes cardIn { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.gold-ic { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; display: inline-block; }
.price .gold-ic { width: 14px; height: 14px; vertical-align: -3px; }
.panel-art.icon-art { width: 120px; box-shadow: none; }
.played.both.show { filter: drop-shadow(0 0 10px rgba(217, 184, 106, .8)) drop-shadow(0 0 18px rgba(181, 106, 138, .8)); }
.big-art.flipped { transform: rotate(180deg); }
.play.both { border-left: 4px solid; border-image: linear-gradient(var(--up), var(--rev)) 1; }
.both-h { display: flex; justify-content: space-between; font-family: var(--serif); color: var(--gold-hi); margin-bottom: 6px; }
.both-faces { display: flex; flex-direction: column; gap: 6px; }
.bf { padding-left: 8px; border-left: 2px solid var(--up); }
.bf.rev { border-left-color: var(--rev); }
.bf p { margin: 3px 0 0; }
.play .upn, .play small.upn { color: var(--teal); }
/* 提示 */
#tip { position: fixed; z-index: 50; background: #26222a; border: 1px solid var(--gold); color: var(--text); font-size: 12px; line-height: 1.6;
  padding: 8px 10px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .6); pointer-events: none; opacity: 0; transition: opacity .12s; }
#tip.on { opacity: 1; }
[data-tip] { cursor: help; }
.st[data-tip], .tag[data-tip], #intent { text-decoration: underline dotted rgba(201, 178, 124, .4); text-underline-offset: 3px; }
.hints { background: rgba(255, 255, 255, .03); border: 1px dashed var(--line); border-radius: 4px; padding: 8px 10px; font-size: 12px; line-height: 1.6; color: var(--muted); max-height: 160px; overflow-y: auto; }
.hints p { margin: 2px 0; }
.hints b { color: var(--gold); font-weight: 400; margin-right: 6px; font-family: var(--serif); }
.epassive { color: #c98c80; font-size: 11px; margin: -4px 0 8px; min-height: 0; }
#logList .tip { color: var(--gold); }

/* 限张标记 */
.lim { display: inline-block; margin-left: 8px; font-family: var(--sans); font-size: 11px; color: #e6a3c9; border: 1px solid rgba(230,163,201,.45); border-radius: 9px; padding: 0 7px; vertical-align: 3px; cursor: help; white-space: nowrap; }
.dt-side h3 .lim { font-size: 12px; }

/* 专属牌牌面：裁角色原图局部 + 稀有度边框 */
.ex-art { --rc: #b8875a; position: relative; width: 100%; aspect-ratio: 2/3; overflow: hidden; border-radius: 6px; background: #120f0c;
  box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 0 4px #120f0c, inset 0 0 0 5px color-mix(in srgb, var(--rc) 50%, transparent), 0 4px 12px rgba(0, 0, 0, .5); }
.ex-art.r-uncommon { --rc: #c3ccd6; }
.ex-art.r-rare { --rc: #e8c25a; box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 0 4px #120f0c, inset 0 0 0 5px var(--el), 0 0 14px color-mix(in srgb, var(--el) 60%, transparent), 0 4px 12px rgba(0, 0, 0, .5); }
.ex-art img, .card .ex-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; transform: scale(1.9); transform-origin: var(--pos); z-index: -0; box-shadow: none; }
.ex-art::after { content: ''; position: absolute; inset: 0; border-radius: 6px; box-shadow: inherit; pointer-events: none; }
.ex-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 22% 4px 7%; text-align: center; font-family: var(--serif); color: var(--gold-hi); font-size: clamp(11px, 1.05em, 22px); letter-spacing: .12em;
  background: linear-gradient(transparent, rgba(10, 8, 6, .92) 45%); text-shadow: 0 1px 2px #000; }
.ex-rar { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); font-size: 10px; padding: 0 6px; border-radius: 8px; color: #1a1612; background: var(--rc); letter-spacing: .1em; white-space: nowrap; }
.card .ex-art .ex-name { font-size: calc(var(--card-w, 110px) * .13); }
.big-art.ex-art .ex-name { font-size: 26px; }
.big-art.ex-art .ex-rar { font-size: 13px; padding: 1px 10px; }
.card.flipped .ex-art { transform: rotate(180deg); }
.card.flipped .ex-art img { transform: scale(1.9); }
.ex-art.own img, .card .ex-art.own img, .card.flipped .ex-art.own img { transform: none; }
.played .ex-art .ex-name { font-size: 15px; }
.kw { font-style: normal; font-size: 11px; margin-left: 6px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); color: var(--gold); vertical-align: 1px; }
.rar { display: inline-block; margin-left: 8px; font-family: var(--sans); font-size: 11px; padding: 0 7px; border-radius: 9px; vertical-align: 3px; white-space: nowrap; color: #1a1612; background: #b8875a; }
.rar.r-uncommon { background: #c3ccd6; }
.rar.r-rare { background: #e8c25a; }

/* ---------- 武器：战斗面板 / 放大提示 / 获得展示 ---------- */
.wp-list { list-style: none; padding: 0; margin: 0 0 12px; font-size: 12px; line-height: 1.5; }
.wp-list li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; border-bottom: 1px solid rgba(74, 66, 52, .45); }
.wp-list li:last-child { border-bottom: 0; }
.wp-list img { width: 34px; border-radius: 3px; border: 1px solid var(--line); flex-shrink: 0; }
.wp-list b { color: var(--gold-hi); font-family: var(--serif); font-weight: 400; }
.wp-list small { color: var(--muted); margin-left: 6px; }
.wp-list p { margin: 1px 0 0; color: var(--text); }
.wp-hint { display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(201, 178, 124, .07); font-size: 12px; text-align: left; }
.wp-hint img { width: 30px; border-radius: 3px; }
.wp-hint p { margin: 0; line-height: 1.5; }
.wp-hint b { color: var(--gold-hi); margin-right: 6px; font-weight: 400; font-family: var(--serif); }
.wp-gain { display: flex; gap: 16px; align-items: center; max-width: 460px; margin: 0 auto 10px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 8px; background: rgba(201, 178, 124, .08); text-align: left; }
.wp-gain img { width: 96px; border-radius: 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.wp-gain small { display: block; color: var(--gold); letter-spacing: .15em; font-size: 11px; }
.wp-gain b { display: block; font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--gold-hi); margin: 2px 0 4px; }
.wp-gain p { margin: 0; line-height: 1.55; font-size: 13px; }
.pick-h { margin: 6px 0 0; text-align: center; }

/* ---------- 图鉴 ---------- */
.gallery { position: relative; width: min(1180px, 94vw); height: 88vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gl-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.gl-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; color: var(--gold-hi); font-size: 20px; letter-spacing: .2em; }
.gl-head #glClose { margin-left: auto; }
.gl-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.gl-tab, .gl-el { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 14px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
.gl-tab.on { color: #1a1612; background: var(--gold); border-color: var(--gold); }
.gl-el { --c: var(--gold); }
.gl-el.on { color: var(--c); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.gl-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-content: start; }
.gl-group { grid-column: 1 / -1; margin: 10px 0 -2px; font-family: var(--serif); font-weight: 400; color: var(--gold); font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.gl-item { display: flex; gap: 12px; padding: 10px; border: 1px solid rgba(74, 66, 52, .7); border-radius: 8px; background: rgba(255, 255, 255, .02); text-align: left; }
.gl-item.owned { border-color: var(--gold); }
.gl-art { width: 118px; flex-shrink: 0; cursor: zoom-in; }
.gl-art .gl-img, .gl-art img.gl-img { width: 100%; display: block; border-radius: 5px; }
.gl-art .card.basic.big { width: 118px; aspect-ratio: 2/3; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: default; }
.gl-art .card.basic.big .b-glyph { font-size: 44px; }
.gl-info { flex: 1; min-width: 0; font-size: 12.5px; }
.gl-name { font-family: var(--serif); font-size: 17px; color: var(--gold-hi); margin-bottom: 2px; }
.gl-meta { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; line-height: 1.6; }
.gl-meta .rar, .gl-meta .lim { margin-left: 0; vertical-align: 0; }
.gl-own { display: inline-block; margin-left: 8px; font-size: 11px; padding: 0 7px; border-radius: 9px; color: #1a1612; background: var(--teal); font-family: var(--sans); vertical-align: 2px; }
.gl-meta .gl-own { margin-left: 0; vertical-align: 0; }
.gl-info .face { margin-bottom: 6px; padding: 4px 8px; }
.gl-wp { font-size: 14px; line-height: 1.6; color: var(--text); margin: 6px 0 8px; padding: 6px 10px; border-left: 3px solid var(--gold); background: rgba(201, 178, 124, .06); }
.gl-zoom { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(8, 8, 10, .86); cursor: zoom-out; }
.gl-zoom.on { display: flex; }
.gl-zoom .big-art { width: auto; height: min(80vh, 760px); aspect-ratio: 2/3; }

.gl-tmp { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 9px; border: 1px dashed var(--muted); color: var(--muted); }
.gl-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.gl-count + #glClose { margin-left: 0; }
