:root {
  --bg: #0d0a16; --bg2: #171126; --panel: rgba(28, 21, 44, .88); --line: #3b2f57;
  --text: #ece4d4; --muted: #9d92b3; --gold: #e6b955; --gold2: #b8862d;
  --red: #e2475b; --green: #5fd38d; --blue: #55b3ff; --purple: #b46cff;
  --light: #d9c7a3; --dark: #7b5d45;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at top, #2a1a45 0%, var(--bg) 60%) fixed, var(--bg);
  background-size: cover; background-position: center; background-attachment: fixed;
  color: var(--text); font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: 15px; line-height: 1.5;
}
#app { max-width: 1320px; margin: 0 auto; padding: 14px 16px 40px; }
#save-warning { padding: 8px 16px; background: #392530; color: #fff0aa; text-align: center; }
h1, h2, h3 { margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 16px; color: var(--gold); letter-spacing: 1px; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; }
.warn { color: var(--red); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid #5a4880; background: linear-gradient(#352a52, #241c3a); color: var(--text);
  padding: 9px 16px; border-radius: 9px; cursor: pointer; font: inherit; margin: 4px; transition: .15s;
}
.btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 14px 26px; font-size: 18px; width: 100%; margin: 6px 0; }
.btn.gold { background: linear-gradient(#f0c869, #b8862d); color: #2a1a06; border-color: #ffe39a; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.btn.opt { display: block; width: 100%; text-align: left; margin: 8px 0; }

.emo { font-style: normal; }
.ico { width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: middle; }

/* ---------- hub ---------- */
.logo { text-align: center; margin: 10px 0 18px; }
.logo h1 { font-size: 64px; letter-spacing: 16px; background: linear-gradient(#fff3c9, #e6b955 50%, #8a5a1c); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 40px rgba(230,185,85,.25); margin: 0; }
.logo-img { max-width: 420px; width: 80%; }
.logo .sub { color: var(--muted); letter-spacing: 4px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.mine-panel { text-align: center; }
.crys { font-size: 34px; font-weight: 800; color: #a9e4ff; text-shadow: 0 0 18px rgba(85,179,255,.5); margin: 6px 0; }
.crystal-btn { background: radial-gradient(circle, rgba(85,179,255,.25), transparent 70%); border: none; cursor: pointer; font-size: 70px; padding: 8px 26px; transition: transform .08s; }
.crystal-btn:active { transform: scale(.9); }
.crystal-btn .crystal-ico { width: 110px; height: 110px; }
.mine-info { margin: 10px 0 4px; }
.click-float { position: fixed; pointer-events: none; color: #a9e4ff; font-weight: 800; font-size: 20px; animation: floatUp .8s ease-out forwards; transform: translate(-50%, -50%); z-index: 99; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.up-row:last-child { border-bottom: none; }
.up-ico { width: 44px; font-size: 26px; text-align: center; flex-shrink: 0; }
.up-ico .pc { width: 40px; height: 40px; }
.up-info { flex: 1; font-size: 13.5px; }
.lv { color: var(--gold); font-size: 12px; }
.asc-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.asc { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: #241c3a; color: var(--text); cursor: pointer; font: inherit; }
.asc.on { background: var(--purple); border-color: #e2c4ff; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.stats b { color: var(--text); float: right; }

/* ---------- run bar / map ---------- */
.runbar { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.rb-l { flex-shrink: 0; } .rb-m { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; } .rb-r { font-size: 18px; font-weight: 700; color: var(--gold); }
.relic-chip { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; font-size: 19px; background: #2a2142; border: 1px solid #574578; border-radius: 8px; cursor: pointer; }
.relic-chip .ico { width: 26px; height: 26px; }
.path { display: flex; align-items: center; justify-content: center; margin: 10px 0 20px; }
.pnode { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #241c3a; border: 2px solid var(--line); font-weight: 700; }
.pnode.done { background: var(--gold2); border-color: var(--gold); color: #2a1a06; }
.pnode.cur { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); animation: pulse 1.4s infinite; }
.pnode.bossn { width: 50px; height: 50px; font-size: 22px; border-color: var(--red); }
.pline { width: 46px; height: 3px; background: var(--line); }
.choices, .cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 12px 0 20px; }
.node-card, .card {
  width: 210px; background: linear-gradient(#2b2145, #1b1530); border: 1px solid #4b3b6d; border-radius: 14px; padding: 16px;
  text-align: center; cursor: pointer; transition: .18s; position: relative;
}
.node-card:hover, .card:hover:not(.sold) { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 10px 30px rgba(230,185,85,.18); }
.node-card .node-ico { font-size: 44px; } .node-card .node-ico .ico { width: 72px; height: 72px; }
.node-card.elite { border-color: #8a3550; } .node-card.boss { width: 300px; border-color: var(--red); background: linear-gradient(#3e1626, #1b1530); }
.node-card p, .card p { color: var(--muted); font-size: 13px; }
.boss-prev { margin-top: 8px; }
.boss-portrait { font-size: 64px; display: block; margin: 4px auto; }
img.boss-portrait { width: 140px; height: 140px; border-radius: 12px; object-fit: cover; }
.card .pc { width: 72px; height: 72px; margin: 0 auto 6px; }
.big-ico { font-size: 52px; height: 76px; display: flex; align-items: center; justify-content: center; }
.big-ico .ico { width: 70px; height: 70px; }
.card.relic { border-color: #6a4fa0; }
.card.sold { opacity: .35; cursor: not-allowed; }
.price { margin-top: 8px; font-weight: 700; color: var(--gold); } .price.poor { color: var(--red); }
.army { display: flex; flex-wrap: wrap; gap: 4px; }
.army .pc { width: 42px; height: 42px; }
.title-big { font-size: 34px; color: var(--gold); text-shadow: 0 0 20px rgba(230,185,85,.3); }
.gold-gain { font-size: 22px; color: var(--gold); font-weight: 700; margin: 6px 0; }

/* ---------- board ---------- */
.battle-grid { display: grid; grid-template-columns: 230px 1fr 290px; gap: 12px; align-items: start; }
.board-wrap { display: flex; justify-content: center; }
.board {
  --s: min(calc((100vh - 140px) / 8), calc((100vw - 600px) / 8), 82px);
  display: grid; grid-template-columns: repeat(8, var(--s)); grid-template-rows: repeat(8, var(--s));
  border: 6px solid #3a2a1c; border-radius: 6px; box-shadow: 0 0 0 2px var(--gold2), 0 20px 60px rgba(0,0,0,.6);
}
.board.busy { cursor: wait; }
.board, .board * { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; }
.board { touch-action: none; }
.sq .pc.drag-src { opacity: .25; }
.sq.drop-hover { box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 0 999px rgba(230,185,85,.35); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 10px 12px rgba(0,0,0,.55)); }
.drag-ghost .pc { transform: scale(1.12); }
.victim-ghost { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 15; }
.arrow-proj { position: fixed; z-index: 150; pointer-events: none; width: 34px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff3c9 30%, var(--gold)); box-shadow: 0 0 8px var(--gold); }
.arrow-proj::after { content: ''; position: absolute; right: -6px; top: -4px; border-left: 8px solid var(--gold); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.arrow-proj.foe { background: linear-gradient(90deg, transparent, #e2c4ff 30%, var(--purple)); box-shadow: 0 0 8px var(--purple); }
.arrow-proj.foe::after { border-left-color: var(--purple); }
.sq { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sq:focus-visible { outline: 3px solid #fff0aa; outline-offset: -4px; z-index: 4; }
.card:focus-visible, .pick:focus-visible { outline: 3px solid #fff0aa; outline-offset: 2px; }
.sq.light { background: var(--light); } .sq.dark { background: var(--dark); }
.sq.wall { background: repeating-linear-gradient(45deg, #1a1225 0 6px, #2a1d3d 6px 12px) !important; box-shadow: inset 0 0 16px #000; cursor: not-allowed; }
.sq.wall::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(#6b2ccf, transparent 70%); opacity: .5; }
.sq.last { box-shadow: inset 0 0 0 999px rgba(230,185,85,.28); }
.sq.sel { box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 0 999px rgba(230,185,85,.3); }
.sq.can-move::before { content: ''; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(40,160,80,.7); z-index: 2; pointer-events: none; }
.sq.can-cap::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 4px solid rgba(226,71,91,.9); z-index: 2; pointer-events: none; }
.sq.can-shoot::before { content: '◎'; position: absolute; inset: 3px; border-radius: 6px; border: 3px dashed var(--blue); z-index: 2; pointer-events: none; color: var(--blue); font-size: 14px; display: flex; align-items: flex-start; justify-content: flex-end; padding: 0 3px; }
.sq.check { box-shadow: inset 0 0 0 999px rgba(226,71,91,.45); animation: checkPulse 1s infinite; }
@keyframes checkPulse { 50% { box-shadow: inset 0 0 0 999px rgba(226,71,91,.2), inset 0 0 18px 6px var(--red); } }
.sq.threat .pc { filter: drop-shadow(0 0 6px var(--purple)) drop-shadow(0 0 3px var(--purple)); }
.sq .rk, .sq .fl { position: absolute; font-size: 10px; color: rgba(0,0,0,.45); font-weight: 700; pointer-events: none; }
.sq .rk { top: 2px; left: 3px; } .sq .fl { bottom: 1px; right: 4px; }
.sq.land .pc { animation: land .3s ease-out; }
.sq.hit { animation: shake .35s; }
.float { position: absolute; top: 0; color: #fff; font-weight: 900; font-size: 22px; text-shadow: 0 0 6px var(--red), 0 2px 0 #000; animation: floatUp .9s ease-out forwards; z-index: 5; pointer-events: none; }

/* ---------- pieces ---------- */
.pc { position: relative; width: 88%; height: 88%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.army .pc, .card .pc, .pick .pc, .up-ico .pc { pointer-events: auto; }
.pc img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); transform: scale(1.22) translateY(-5%); }
.pc.b img { filter: drop-shadow(0 0 2px rgba(214,170,255,.9)) drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.pc.boss img { transform: scale(1.38) translateY(-6%); animation: bossImgGlow 2s infinite; }
@keyframes bossImgGlow { 0%,100% { filter: drop-shadow(0 0 5px var(--red)) drop-shadow(0 0 2px #ffb3be); } 50% { filter: drop-shadow(0 0 14px var(--red)) drop-shadow(0 0 4px #ffc2cb); } }
.pc .glyph { font-size: calc(var(--s, 60px) * .78); line-height: 1; font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", serif; }
.army .pc .glyph, .pick .pc .glyph, .up-ico .pc .glyph { font-size: 34px; }
.card .pc .glyph { font-size: 60px; }
.pc.w .glyph { color: #fbf3df; text-shadow: 0 0 1px #000, 1px 1px 0 #3a2a1c, -1px -1px 0 #3a2a1c, 1px -1px 0 #3a2a1c, -1px 1px 0 #3a2a1c, 0 3px 4px rgba(0,0,0,.5); }
.pc.b .glyph { color: #2a1f3a; text-shadow: 0 0 1px #c9a0ff, 1px 1px 0 #b98aff, -1px -1px 0 #7e4fc9, 0 3px 4px rgba(0,0,0,.6); }
.pc.boss .glyph { color: #4a0f1f; font-size: calc(var(--s, 60px) * .9); text-shadow: 0 0 10px var(--red), 0 0 3px #ff9aa8; animation: bossGlow 2s infinite; }
.pc.boss::before { content: '♛'; position: absolute; top: -9px; font-size: 14px; color: var(--gold); text-shadow: 0 0 4px #000; }
.pc .badge { position: absolute; right: 0; bottom: 6px; font-size: 11px; background: var(--gold); color: #2a1a06; border-radius: 5px; padding: 0 3px; font-weight: 800; line-height: 15px; }
.pc.b .badge { background: var(--purple); color: #fff; }
.pc .hp { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.pc .hp i { width: 7px; height: 7px; border-radius: 50%; background: #333; border: 1px solid #000; }
.pc .hp i.on { background: var(--green); }
.pc.b .hp i.on { background: var(--red); }
.pc .hp.num { background: #000a; color: #fff; font-size: 10px; padding: 0 4px; border-radius: 4px; }
.pc.frozen { filter: saturate(.3) brightness(1.2) drop-shadow(0 0 6px #9fe3ff); }
.pc .ice { position: absolute; top: -4px; right: -2px; font-size: 16px; color: #bdf0ff; text-shadow: 0 0 4px #00aaff; }

/* ---------- battle side panels ---------- */
.btns { margin: 8px 0; }
.thinking { color: var(--purple); animation: pulse 1s infinite; } .yourturn { color: var(--green); font-weight: 700; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lg.move { background: rgba(40,160,80,.8); } .lg.cap { border: 3px solid var(--red); } .lg.shoot { border: 2px dashed var(--blue); border-radius: 3px; } .lg.threat { background: var(--purple); box-shadow: 0 0 6px var(--purple); }
.log div { font-size: 12.5px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.log div:first-of-type { color: var(--gold); }
.boss-panel { text-align: center; border-color: #7a2436; background: linear-gradient(rgba(70,18,35,.9), var(--panel)); }
.boss-panel.flash { animation: flash .8s; }
.boss-panel.enraged { box-shadow: 0 0 30px rgba(226,71,91,.6); }
.hpbar { position: relative; height: 18px; background: #2a0c14; border: 1px solid #000; border-radius: 9px; overflow: hidden; margin: 8px 0; }
.hpbar div { height: 100%; background: linear-gradient(#ff6b7d, #b0192d); transition: width .4s; }
.hpbar span { position: absolute; inset: 0; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.ability { background: #1a0f22; border-radius: 8px; padding: 6px; font-size: 13px; }

/* ---------- event / modal / end ---------- */
.event-panel, .end-panel { max-width: 620px; margin: 30px auto; text-align: center; padding: 26px; }
.event-ico { font-size: 70px; }
.result { color: var(--gold); font-size: 16px; margin: 14px 0; }
.modal { position: fixed; inset: 0; background: rgba(5,3,10,.75); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--bg2); border: 1px solid var(--gold2); border-radius: 14px; padding: 20px; max-width: 640px; width: 100%; max-height: 85vh; overflow: auto; text-align: center; }
.modal-box.help { text-align: left; }
.pick-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.pick { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #241c3a; text-align: left; }
.pick:hover { border-color: var(--gold); }
.pick .pc { width: 40px; height: 40px; }
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(30px); background: #2b2145; border: 1px solid var(--gold); padding: 10px 20px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); }

@keyframes pulse { 50% { opacity: .55; } }
@keyframes land { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes shake { 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }
@keyframes floatUp { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -40px); } }
.float { left: 50%; }
@keyframes bossGlow { 50% { text-shadow: 0 0 18px var(--red), 0 0 6px #ffc2cb; } }
@keyframes flash { 0%,100% { filter: none; } 30% { filter: brightness(2); } }

@media (max-width: 1000px) {
  .battle-grid { grid-template-columns: 1fr; }
  .board { --s: min(calc((100vw - 48px) / 8), 72px); }
  .side-l { order: 2; } .side-r { order: 3; }
  .side-l:has(.deploy-panel) { order: 0; }
  .deploy-panel .btn.big { margin: 4px 0; }
  .logo h1 { font-size: 46px; }
}

/* ---------- v6：詞綴 / 大字演出 / 分支地圖 / 布陣 / 成就 ---------- */
.pc .traits { position: absolute; top: -3px; left: -3px; font-size: 11px; line-height: 1; background: rgba(20,12,32,.85); border: 1px solid var(--gold2); border-radius: 6px; padding: 1px 2px; letter-spacing: -1px; z-index: 3; }
.army .pc .traits, .pick .pc .traits { font-size: 10px; }

.banner { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 300; }
.banner-in { text-align: center; padding: 18px 60px; background: linear-gradient(90deg, transparent, rgba(12,8,22,.92) 20%, rgba(12,8,22,.92) 80%, transparent); width: 100%; animation: bannerIn 1.8s ease forwards; }
.banner .bt { font-size: clamp(30px, 7vw, 64px); font-weight: 900; letter-spacing: 6px; color: var(--gold); text-shadow: 0 0 24px rgba(230,185,85,.6), 0 4px 0 #000; }
.banner .bs { color: var(--text); margin-top: 4px; font-size: 16px; }
.banner.boss .bt, .banner.check-b .bt, .banner.lose .bt { color: #ff6b7d; text-shadow: 0 0 24px rgba(226,71,91,.7), 0 4px 0 #000; }
.banner.mate .bt { color: #fff3c9; font-size: clamp(40px, 9vw, 84px); }
.banner.check-w .bt { font-size: clamp(26px, 5vw, 46px); }
.banner.elite .bt { color: #e58aa0; }
.banner.ach .banner-in { animation-duration: 1.8s; }
.banner.ach .bt { font-size: clamp(20px, 4vw, 32px); color: #a9e4ff; text-shadow: 0 0 18px rgba(85,179,255,.6); letter-spacing: 2px; }
.banner.ach { align-items: flex-start; padding-top: 70px; }
.banner.draw .bt { color: #cfc6e4; }
@keyframes bannerIn { 0% { opacity: 0; transform: scaleY(.2); } 12% { opacity: 1; transform: scaleY(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

.mute-btn { background: none; border: none; font-size: 18px; cursor: pointer; margin-right: 8px; vertical-align: middle; }

.map-wrap { display: flex; gap: 14px; align-items: flex-start; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.mapview { position: relative; width: min(100%, 460px); height: 520px; background: radial-gradient(ellipse at center, rgba(60,40,90,.35), transparent 70%); border: 1px solid var(--line); border-radius: 14px; }
.mapview svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapview line { stroke: #4b3b6d; stroke-width: 3; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.mapview line.done { stroke: var(--gold2); stroke-dasharray: none; }
.mapview line.live { stroke: var(--gold); stroke-dasharray: none; stroke-width: 4; filter: drop-shadow(0 0 4px var(--gold)); }
.node { position: absolute; transform: translate(-50%, -50%); width: 78px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--text); font: inherit; padding: 0; }
.node .node-ico { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #241c3a; border: 2px solid var(--line); transition: .15s; }
.node .node-ico .ico { width: 40px; height: 40px; }
.node .node-name { font-size: 12px; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.node.boss .node-ico { width: 70px; height: 70px; font-size: 34px; border-color: var(--red); }
.node.elite .node-ico { border-color: #8a3550; }
.node.avail { cursor: pointer; }
.node.avail .node-ico { border-color: var(--gold); box-shadow: 0 0 16px rgba(230,185,85,.6); animation: pulse 1.4s infinite; }
.node.avail:hover .node-ico { transform: scale(1.12); animation: none; }
.node.done .node-ico { background: var(--gold2); border-color: var(--gold); }
.node.locked { opacity: .55; }
.node.past { opacity: .25; }
.boss-prev-panel { width: 260px; text-align: center; }
.boss-prev-panel p { color: var(--muted); }
.map-legend { text-align: left; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; }

.sq.deploy-zone::after { content: ''; position: absolute; inset: 0; background: rgba(95,211,141,.12); box-shadow: inset 0 0 0 1px rgba(95,211,141,.35); pointer-events: none; }
.deploy-panel { border-color: var(--green); }

.ach-panel { grid-column: 1 / -1; }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ach { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; opacity: .55; font-size: 13.5px; }
.ach.got { opacity: 1; border-color: var(--gold2); background: rgba(230,185,85,.08); }
.ach-ico { font-size: 24px; width: 32px; text-align: center; }
.card.trait { border-color: #3f7a6a; }
.crown-panel { border-color: #8a6a24; background: linear-gradient(rgba(60,44,14,.55), var(--panel)); }
.crown-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.crown-top .right { text-align: right; }
.crowns { font-size: 30px; font-weight: 800; color: var(--gold); text-shadow: 0 0 14px rgba(230,185,85,.5); }

/* ---------- v10：大廳分頁 / 每日 / 圖鑑 / 戰術卡 / 危險格 ---------- */
.hub-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 14px; }
.htab { border: 1px solid var(--line); background: #1e1732; color: var(--text); font: inherit; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.htab.on { background: linear-gradient(#f0c869, #b8862d); color: #2a1a06; border-color: #ffe39a; font-weight: 700; }
.hub-grid.tab-crown, .hub-grid.tab-ach { grid-template-columns: 1fr; }
.daily-box { margin: 12px 0; padding: 10px 12px; border: 1px dashed #5f7fd3; border-radius: 10px; background: rgba(85,120,255,.07); }
.daily-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.dmod { font-size: 13px; margin: 3px 0; }
.daily-tag { margin-left: 8px; font-size: 12px; background: #24305a; border: 1px solid #5f7fd3; padding: 1px 8px; border-radius: 999px; cursor: pointer; }
.hist-list { display: flex; flex-direction: column; gap: 4px; }
.hist { display: grid; grid-template-columns: 24px 70px 1fr 52px 80px; gap: 6px; font-size: 13px; padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,.03); }
.hist.win { background: rgba(230,185,85,.1); }
.cx-panel { grid-column: 1 / -1; }
.cx-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.cx { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.cx .emo { font-size: 26px; width: 34px; text-align: center; flex-shrink: 0; }
.cx .ico { width: 34px; height: 34px; }
.cx.locked { opacity: .45; }
.cx-pc .pc { width: 40px; height: 40px; }
.cx-pc .pc .glyph { font-size: 32px; }
.cx-boss { font-size: 34px; }
img.cx-boss { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.cost-pill { font-size: 11px; background: #2b2145; border: 1px solid #5a4880; border-radius: 999px; padding: 0 6px; color: var(--gold); white-space: nowrap; }

.board-wrap { flex-direction: column; align-items: center; gap: 10px; }
.hand-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: calc(var(--s, 70px) * 8 + 40px); }
.energy { font-size: 18px; text-align: center; min-width: 54px; color: #ffe066; text-shadow: 0 0 8px rgba(255,224,102,.6); line-height: 1.1; }
.energy small { display: block; font-size: 11px; color: var(--muted); text-shadow: none; }
.hand { flex: 1; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.piles { text-align: right; min-width: 48px; }
.tac { position: relative; width: 96px; min-height: 120px; padding: 8px 6px 6px; border-radius: 10px; border: 1px solid #6a4fa0; background: linear-gradient(#33275a, #1b1530); color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: .15s; }
.tac:hover:not(:disabled) { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 8px 20px rgba(230,185,85,.2); }
.tac.on { transform: translateY(-10px); border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 10px 24px rgba(230,185,85,.35); }
.tac.poor { opacity: .5; }
.tac:disabled { cursor: wait; opacity: .6; }
.tc-cost { position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%; background: #ffe066; color: #2a1a06; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px #000; }
.tc-ico { font-size: 28px; }
.tc-name { font-weight: 700; font-size: 13px; }
.tc-desc { font-size: 10.5px; color: var(--muted); line-height: 1.3; text-align: center; }
.card-hint { font-size: 13px; color: var(--gold); text-align: center; }
.board.carding { box-shadow: 0 0 0 2px #ffe066, 0 0 30px rgba(255,224,102,.35), 0 20px 60px rgba(0,0,0,.6); }
.sq.card-target::before { content: ''; position: absolute; inset: 3px; border-radius: 8px; border: 3px solid #ffe066; box-shadow: 0 0 10px rgba(255,224,102,.7); z-index: 2; pointer-events: none; animation: pulse 1.2s infinite; }
.sq.danger::after { content: ''; position: absolute; right: 3px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: rgba(226,71,91,.85); box-shadow: 0 0 6px rgba(226,71,91,.9); pointer-events: none; z-index: 3; }
.lg.danger { background: rgba(226,71,91,.85); width: 9px; height: 9px; }
.toggle { display: flex; gap: 6px; align-items: center; margin-top: 8px; color: var(--muted); cursor: pointer; }
.deck { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-card { font-size: 13px; background: #241c3a; border: 1px solid #5a4880; border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.big-emo { font-size: 26px; }
.card.tcard { border-color: #a08a3a; }
@media (max-width: 1000px) {
  .tac { width: 78px; min-height: 104px; }
  .tc-desc { display: none; }
  .hist { grid-template-columns: 20px 52px 1fr 44px 70px; font-size: 12px; }
}
.pc .traits img { width: 12px; height: 12px; vertical-align: middle; }
.tc-ico .ico { width: 40px; height: 40px; }
.cx > .ico, .cx > .emo { width: 34px; height: 34px; font-size: 26px; flex-shrink: 0; text-align: center; }
.ask-box { max-width: 420px; } .ask-box p { font-size: 16px; margin: 6px 0 14px; }

/* ---------- 首領技能預告格 ---------- */
.sq.bmark { box-shadow: inset 0 0 0 3px var(--bm, #ff6b7d); }
.sq.bm-summon { --bm: #b46cff; background-image: radial-gradient(circle, rgba(180,108,255,.55), transparent 65%); }
.sq.bm-hit { --bm: #e2475b; background-image: repeating-linear-gradient(45deg, rgba(226,71,91,.38) 0 6px, transparent 6px 12px); }
.sq.bm-void { --bm: #6b2ccf; background-image: radial-gradient(circle, rgba(20,10,40,.7), transparent 70%); }
.sq.bm-freeze { --bm: #7fd6ff; background-image: radial-gradient(circle, rgba(127,214,255,.45), transparent 70%); }
.sq.bm-tele { --bm: #ffd36b; background-image: radial-gradient(circle, rgba(255,211,107,.4), transparent 70%); }
.sq.bmark { animation: bmPulse 1.2s ease-in-out infinite; }
@keyframes bmPulse { 50% { box-shadow: inset 0 0 0 5px var(--bm, #ff6b7d), inset 0 0 18px var(--bm, #ff6b7d); } }
.bm-ico { position: absolute; left: 3px; bottom: 2px; font-size: 13px; z-index: 4; pointer-events: none; filter: drop-shadow(0 1px 1px #000); }
.ability.planned { border: 1px solid var(--red); background: rgba(80,10,25,.6); }
.banner.warn .bt { color: #ffb347; font-size: clamp(24px, 5vw, 42px); text-shadow: 0 0 20px rgba(255,140,40,.6), 0 3px 0 #000; }
.banner.warn .bs { max-width: 680px; margin: 4px auto 0; }
.legend-ico { width: 20px !important; height: 20px !important; vertical-align: -5px; }

/* ---------- 查看棋子（右鍵 / 長按）---------- */
.board { position: relative; }
.inspect-card { position: absolute; z-index: 40; width: min(260px, 70%); margin: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(18,12,30,.97); border: 1px solid var(--gold2); box-shadow: 0 12px 30px rgba(0,0,0,.6); font-size: 13px; cursor: default; animation: insIn .15s ease-out; }
.inspect-card.b { border-color: #ff9a4d; }
@keyframes insIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.ins-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ins-head b { font-size: 16px; color: var(--gold); }
.inspect-card.b .ins-head b { color: #ffb070; }
.ins-pc { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ins-pc .pc { width: 44px; height: 44px; }
.ins-pc .pc .glyph { font-size: 36px; }
.ins-side { font-size: 11px; color: var(--muted); }
.ins-x { margin-left: auto; align-self: flex-start; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.ins-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-bottom: 4px; }
.ins-desc { margin: 4px 0; color: var(--text); }
.ins-tr { font-size: 12px; margin: 3px 0; color: #d9cfee; }
.ins-tr img { width: 14px; height: 14px; vertical-align: -2px; }
.ins-warn { font-size: 12px; color: #9fe3ff; }
.ins-boss { font-size: 12px; margin-top: 6px; padding: 6px; border-radius: 8px; background: rgba(120,20,40,.45); border: 1px solid #7a2436; }
.ins-legend { margin-top: 6px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ins-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.ins-legend .lgm { background: rgba(255,154,77,.55); }
.ins-legend .lgc { background: transparent; border: 2px solid #ff6a3d; margin-left: 6px; }
.inspect-card.w .ins-legend .lgm { background: rgba(95,211,141,.55); }
.inspect-card.w .ins-legend .lgc { border-color: #5fd38d; }
.sq.ins-self { box-shadow: inset 0 0 0 4px #ffd36b, inset 0 0 0 999px rgba(255,211,107,.25); }
.sq.ins-move.foe::before { content: ''; position: absolute; inset: 0; background: rgba(255,154,77,.32); pointer-events: none; z-index: 1; }
.sq.ins-cap.foe::before { content: ''; position: absolute; inset: 3px; border: 3px solid #ff6a3d; border-radius: 6px; background: rgba(255,106,61,.18); pointer-events: none; z-index: 2; }
.sq.ins-move.own::before { content: ''; position: absolute; inset: 0; background: rgba(95,211,141,.28); pointer-events: none; z-index: 1; }
.sq.ins-cap.own::before { content: ''; position: absolute; inset: 3px; border: 3px solid #5fd38d; border-radius: 6px; pointer-events: none; z-index: 2; }
.tip-inspect { margin-top: 6px; }

/* ---------- 說明框（data-tip）---------- */
#tip { position: fixed; z-index: 400; max-width: min(300px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 10px; background: rgba(18,12,30,.97); border: 1px solid var(--gold2); color: var(--text); font-size: 13px; line-height: 1.5; box-shadow: 0 10px 26px rgba(0,0,0,.6); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
#tip.show { opacity: 1; transform: none; }
#tip b { color: var(--gold); }
[data-tip] { cursor: pointer; }
[data-tip]:hover, [data-tip]:focus-visible { border-color: var(--gold); outline: none; }
