/* 官網「英雄圖鑑」頁：沿用 official.css 的島嶼主題（羊皮紙、木頭、Cubic 11 像素字），手機優先 */
.codex { background: var(--parchment); }
.nav a[aria-current] { color: var(--gold); opacity: 1; }
.nav-back { display: none; margin-left: auto; padding: 6px 12px; border: 2px solid #d9c79d66; font: 14px/1 var(--pixel); color: #d9c79d; text-decoration: none; }

/* ---------- 頁首：夜空＋像素星星 ---------- */
.cx-hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 84px) 0 clamp(36px, 6vw, 72px); color: #fff7d6;
  background: radial-gradient(ellipse at 70% 120%, #7a2e1e 0%, transparent 55%), radial-gradient(ellipse at 15% -10%, #3b4f8f 0%, transparent 55%), linear-gradient(180deg, #16162e, #2a1b12); }
.cx-hero::before { content: ''; position: absolute; inset: 0; opacity: .7; pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(#ffd24a 1px, transparent 1.5px);
  background-size: 90px 70px, 140px 110px; background-position: 10px 12px, 60px 40px; animation: twinkle 6s ease-in-out infinite alternate; }
.cx-hero::after { content: ''; position: absolute; inset: auto 0 0; height: 8px; background: repeating-linear-gradient(90deg, #0004 0 16px, transparent 16px 32px); }
@keyframes twinkle { to { opacity: .35; } }
.cx-hero-in { position: relative; display: grid; align-items: center; gap: 12px; width: var(--wrap); margin: 0 auto; }
/* 頁首右側：五位神話英雄站成一排（待機動畫） */
.cx-parade { width: min(100%, 520px); height: auto; aspect-ratio: 400 / 140; image-rendering: pixelated; justify-self: center; filter: drop-shadow(0 10px 18px #0008); }
.cx-kicker { display: inline-block; margin: 0 0 14px; padding: 6px 14px; border: 2px solid #ffd24acc; background: #2a1b12cc; color: var(--gold); font: 15px/1 var(--pixel); letter-spacing: .2em; }
.cx-hero h1 { margin: 0; font: clamp(38px, 7vw, 76px)/1.15 var(--pixel); letter-spacing: .05em; text-wrap: balance; text-shadow: 4px 4px 0 var(--wood), 8px 8px 0 var(--wood-dark); }
.cx-lead { max-width: 34em; margin: 18px 0 0; font-size: clamp(16px, 2vw, 18px); color: #f6ead0; }
.cx-lead b { color: var(--gold); font-weight: 700; }
.cx-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.cx-stats li { display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border: 2px solid #fff3; background: #0005; font: 14px/1 var(--pixel); color: #e8dcc0; }
.cx-stats b { font: 24px/1 var(--pixel); color: var(--sc, #fff7d6); }

/* ---------- 分頁列（黏在頂部列下方） ---------- */
.cx-tabs { position: sticky; top: var(--topbar-h); z-index: 15; display: flex; justify-content: center; gap: 4px; padding: 8px 12px; background: #3a2618f2; box-shadow: 0 3px 0 #0003; backdrop-filter: blur(6px); }
.cx-tabs a { flex: 0 1 140px; padding: 9px 10px 8px; text-align: center; text-decoration: none; font: 16px/1 var(--pixel); color: #d9c79d; border: 2px solid transparent; }
.cx-tabs a.on { color: #3a2000; background: var(--gold); border-color: #fff4; box-shadow: 0 3px 0 #a36d00; }
.cx-sec { scroll-margin-top: calc(var(--topbar-h) + 56px); }

/* ---------- 篩選 ---------- */
.cx-heroes { width: var(--wrap); margin: 0 auto; padding: 28px 0 64px; }
.cx-filters { display: grid; gap: 10px; }
.cx-search input { width: 100%; min-height: 46px; padding: 0 14px 0 42px; border: 3px solid var(--wood); border-radius: 12px; background: #fff8e4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='8' cy='8' r='6' fill='none' stroke='%236b4226' stroke-width='2.5'/%3E%3Cpath d='M12.5 12.5l5 5' stroke='%236b4226' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") 14px 50% no-repeat; font: 16px var(--text); color: var(--ink); box-shadow: 0 4px 0 #6b422644; }
.cx-search input:focus { outline: none; border-color: #c98a1c; box-shadow: 0 0 0 3px #ffd24a88; }
.cx-chiprow { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.cx-chiprow::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 2px solid #6b422666; border-radius: 999px; background: #fff8e4; color: var(--wood); font: 14px/1 var(--pixel); cursor: pointer; transition: transform .15s, background .15s; }
.fchip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #999); box-shadow: 0 0 0 2px #0002; }
.fchip:hover { transform: translateY(-1px); }
.fchip.on { background: var(--wood); border-color: var(--wood); color: #fff7d6; }
.fchip.on i { box-shadow: 0 0 0 2px #fff8; }
.cx-count { margin: 16px 2px 12px; font: 15px/1 var(--pixel); color: #7a5a3e; }
.cx-empty { padding: 40px 0; text-align: center; font: 18px/1.5 var(--pixel); color: #7a5a3e; }

/* ---------- 英雄卡 ---------- */
.cx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hcard { --rc: #ff8f1f; --el: #f2c94c; position: relative; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 14px; background: var(--wood-dark); color: var(--ink); text-align: left; cursor: pointer; font: inherit;
  box-shadow: 0 0 0 3px var(--rc), 0 6px 0 #3a261855, 0 10px 22px #3a261833; transition: transform .18s cubic-bezier(.2, 1.4, .4, 1), box-shadow .18s; animation: cardIn .45s both; }
.hcard:hover { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--rc), 0 10px 0 #3a261855, 0 18px 30px #3a261844; }
.hcard:active { transform: translateY(-1px) scale(.985); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
.hc-art { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12px 12px 0 0;
  background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--el) 55%, transparent) 0%, transparent 58%), linear-gradient(180deg, #1c2340, #2e2340 70%, #3a2a1c); }
.hc-art::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 9%; height: 9%; border-radius: 50%; background: #0006; filter: blur(2px); }
.hc-art canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; image-rendering: pixelated; }
.hc-rar { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 4px 8px 3px; background: var(--rc); color: #fff; font: 13px/1 var(--pixel); letter-spacing: .1em; box-shadow: 0 2px 0 #0005; text-shadow: 0 1px 0 #0006; }
.hc-el { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--el); color: #1a0c05; font: 15px/1 var(--pixel); box-shadow: 0 0 0 2px #0006, 0 0 14px var(--el); }
/* 英文版屬性是整個字（Wind、Light…），圓形放不下：改膠囊形 */
html[lang="en"] .hc-el { width: auto; min-width: 28px; padding: 0 8px; border-radius: 999px; font-size: 12px; }
.hc-star { position: absolute; z-index: 2; left: 8px; bottom: 8px; padding: 3px 7px; background: #000a; color: var(--gold); font: 12px/1 var(--pixel); border-radius: 6px; }
.hc-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 10px 11px 12px; border-radius: 0 0 12px 12px; background: linear-gradient(180deg, #fff8e4, #f3e2b8); }
.hc-title { font: 12px/1.3 var(--text); color: #8a6a4a; min-height: 1.3em; }
.hc-name { font: 19px/1.15 var(--pixel); color: var(--wood-dark); }
.hc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.hc-meta em { padding: 2px 6px; border-radius: 5px; background: #6b42261a; font: 12px/1.3 var(--text); font-style: normal; color: #5a3a22; }
.hc-meta em.fac { background: color-mix(in srgb, var(--fc) 22%, #fff8e4); }
.hc-skill { margin-top: auto; padding-top: 6px; border-top: 2px dashed #6b422633; font: 13px/1.35 var(--pixel); color: #a0520e; }
/* 神話：流動的紅金外框 */
.hcard.r5 { box-shadow: 0 0 0 3px transparent, 0 6px 0 #3a261855, 0 10px 22px #ff3b6b33; }
.hcard.r5::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 16px; background: conic-gradient(from var(--ang, 0deg), #ff3b6b, #ffd24a, #ff8f1f, #ff3b6b, #b07aff, #ff3b6b); animation: spinBorder 4s linear infinite; }
.hcard.r5 .hc-rar { background: linear-gradient(90deg, #ff3b6b, #ff8f1f); }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spinBorder { to { --ang: 360deg; } }

/* ---------- 共用：按鈕、切換、分段 ---------- */
.cx-btn { min-height: 42px; padding: 0 16px; border: 2px solid #6b4226; border-radius: 10px; background: #fff8e4; color: var(--wood-dark); font: 16px/1 var(--pixel); cursor: pointer; box-shadow: 0 3px 0 #6b422677; transition: transform .1s; }
.cx-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #6b422677; }
.cx-btn.gold { border-color: #a36d00; background: linear-gradient(#ffe27a, #f0b429); color: #3a2000; box-shadow: 0 3px 0 #a36d00, 0 0 18px #ffd24a55; }
.cx-btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.cx-toggle { display: inline-flex; align-items: center; gap: 8px; font: 15px/1 var(--pixel); cursor: pointer; user-select: none; }
.cx-toggle input { appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: #0006; box-shadow: inset 0 0 0 2px #fff3; cursor: pointer; transition: background .2s; }
.cx-toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff7d6; transition: transform .2s; }
.cx-toggle input:checked { background: var(--grass); }
.cx-toggle input:checked::after { transform: translateX(18px); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #0003; gap: 2px; }
.seg button { min-height: 34px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 14px/1 var(--pixel); cursor: pointer; }
.seg button.on { background: var(--gold); color: #3a2000; box-shadow: 0 2px 0 #a36d00; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg-wide { display: flex; flex-wrap: wrap; }
.seg-wide button { flex: 1 0 auto; }

/* ---------- 陣容技 ---------- */
.cx-wrap { width: var(--wrap); margin: 0 auto; }
.cx-combos { padding: clamp(48px, 7vw, 88px) 0; color: #f3e6c8; background: radial-gradient(circle at 80% 0%, #4a2a18, transparent 50%), linear-gradient(180deg, #2a1b12, #1c130d); border-top: 6px solid var(--wood); }
.cx-h2 { margin: 0 0 12px; font: clamp(32px, 5vw, 52px)/1.15 var(--pixel); letter-spacing: .06em; color: var(--gold); text-shadow: 3px 3px 0 #6b1e0e; }
.cx-bonds .cx-h2 { color: var(--wood); text-shadow: 3px 3px 0 #0001; }
.cx-desc { max-width: 44em; margin: 0 0 26px; font-size: 16px; }
.cx-desc b { color: var(--gold); }
.cx-bonds .cx-desc b { color: #a0520e; }
.cx-h3 { margin: 40px 0 16px; font: 24px/1.3 var(--pixel); color: #fff7d6; }
.cx-h3 small, .sim-h3 small, .hd-block h3 small { margin-left: 8px; font: 13px/1 var(--text); color: #bfa982; }
.sim { scroll-margin-top: calc(var(--topbar-h) + 64px); display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; padding: 14px; border-radius: 18px; background: #0004; box-shadow: inset 0 0 0 2px #ffffff14; }
.sim-stage canvas, .hd-stage canvas { display: block; width: 100%; height: auto; border-radius: 12px; background: #3f6e33; box-shadow: 0 0 0 3px #6b4226, 0 12px 30px #0008; }
.sim-ctrl, .hd-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.sim-h3 { margin: 4px 0 10px; font: 17px/1.2 var(--pixel); color: #fff7d6; }
.sim-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 6px 2px 6px; border: 2px dashed #ffffff33; border-radius: 12px; background: #ffffff0a; color: #e8dcc0; font: 11px/1.2 var(--text); cursor: pointer; }
.slot.full { border-style: solid; border-color: var(--rc); background: #0004; }
.slot .av { width: 100%; max-width: 56px; aspect-ratio: 1; border-radius: 8px; background: #ffffff10; }
.slot .plus { display: grid; place-items: center; font: 24px/1 var(--pixel); color: #ffffff55; }
.slot span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.av { image-rendering: pixelated; background-repeat: no-repeat; }
.sim-active { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.sim-active li { padding: 9px 12px; border-left: 5px solid var(--cc); border-radius: 8px; background: #ffffff0d; font-size: 14px; line-height: 1.5; }
.sim-active li b { font: 16px/1.3 var(--pixel); color: var(--cc); }
.sim-active li.none { border-color: #fff3; color: #bfa982; }
.sim-hint { margin: 0 0 8px; font-size: 14px; color: #ffd24a; }
.sim-bond { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #ff8f1f22; font-size: 14px; }
.sim-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { padding: 7px 10px; border: 2px solid #ffffff26; border-radius: 8px; background: #ffffff0d; color: #f3e6c8; font: 13px/1 var(--pixel); cursor: pointer; }
.preset em { margin-left: 4px; font-style: normal; font-size: 11px; color: var(--tc); }
.preset:hover, .preset.on { border-color: var(--gold); color: var(--gold); }
.combo-groups { display: grid; gap: 22px; }
.cgroup h4 { margin: 0 0 10px; font: 16px/1 var(--pixel); color: #bfa982; letter-spacing: .1em; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ccard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 12px 18px; border-radius: 12px; background: linear-gradient(135deg, #ffffff12, #ffffff05); box-shadow: inset 0 0 0 2px #ffffff12; overflow: hidden; }
.ccard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cc); box-shadow: 0 0 16px var(--cc); }
.ccard b { font: 19px/1.2 var(--pixel); color: var(--cc); text-shadow: 0 2px 0 #0008; }
.ccard .need { font-size: 13px; color: #d8c8a8; }
.ccard .pas { font-size: 14px; line-height: 1.5; color: #fff7d6; }
.ccard .ult { font: 13px/1.3 var(--pixel); color: #ffb38a; }
.ccard .cx-btn { align-self: flex-start; margin-top: 4px; }

/* ---------- 羈絆 ---------- */
.cx-bonds { padding: clamp(48px, 7vw, 88px) 0; background: radial-gradient(circle at 30% 10%, #fbf0d2, var(--parchment) 45%, #e8d29c); }
.bond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 3px solid var(--wood); border-radius: 14px; background: #fff8e4; box-shadow: 0 5px 0 #6b422655; }
.bcard header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bcard b { font: 21px/1.2 var(--pixel); color: var(--wood-dark); }
.bcard .en { font-size: 12px; color: #8a6a4a; }
.bmembers { display: flex; flex-wrap: wrap; gap: 8px; }
.bm { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 62px; padding: 0; border: 0; background: none; font: 11px/1.2 var(--text); color: #5a3a22; cursor: pointer; }
.bm .av { width: 54px; height: 54px; border-radius: 10px; background-color: #2e2340; box-shadow: 0 0 0 2px var(--rc); }
.bm span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bbonus { display: flex; flex-wrap: wrap; gap: 6px; }
.bbonus em { padding: 4px 8px; border-radius: 6px; background: #3f7a2c1f; color: #2e5a1f; font: 13px/1.2 var(--pixel); font-style: normal; }
.bcard .cx-btn { align-self: flex-start; }

/* ---------- 英雄詳情 ---------- */
.hdlg, .pdlg { width: min(1180px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 18px; background: #241710; color: #f3e6c8; box-shadow: 0 0 0 4px var(--wood), 0 30px 80px #000c; overflow: hidden; }
.hdlg::backdrop, .pdlg::backdrop { background: #0a0604d0; backdrop-filter: blur(3px); }
.hdlg[open] { animation: dlgIn .25s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.hd-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); max-height: 94vh; }
.hd-left { max-height: 94vh; overflow-y: auto; padding: 18px; background: radial-gradient(circle at 50% 0%, #3b2a1c, #1c130d); }
.hd-intro { margin-top: 18px; }
.hd-right { max-height: 94vh; overflow-y: auto; padding: 62px 22px 18px; overscroll-behavior: contain; }
.hd-right > .hd-block:first-child { margin-top: 0; }
.hd-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #000a; color: #fff7d6; font: 26px/1 var(--pixel); cursor: pointer; }
.hd-rar { display: inline-block; padding: 5px 10px 4px; background: var(--rc); color: #fff; font: 13px/1 var(--pixel); letter-spacing: .15em; text-shadow: 0 1px 0 #0006; }
.hd-head h2 { margin: 10px 0 2px; font: clamp(26px, 3vw, 34px)/1.2 var(--pixel); color: #fff7d6; text-shadow: 3px 3px 0 #000a; }
.hd-head h2 small { display: block; font: 15px/1.4 var(--text); color: #d8c8a8; text-shadow: none; }
.hd-en { margin: 0; font-size: 13px; color: #a8957a; font-style: italic; }
.hd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.hd-tags em { padding: 4px 9px; border-radius: 6px; background: #ffffff14; font: 13px/1.2 var(--pixel); font-style: normal; }
.hd-tags em.el { background: var(--el); color: #1a0c05; }
.hd-skill { margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: linear-gradient(135deg, #ffd24a1f, #ffd24a08); box-shadow: inset 0 0 0 2px #ffd24a33; }
.hd-sk-name { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.hd-sk-name span { font: 12px/1 var(--pixel); color: #bfa982; }
.hd-sk-name b { font: 22px/1.2 var(--pixel); color: var(--gold); }
.hd-sk-desc { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: #fff7d6; }
.hd-note { margin: 6px 0 0; font-size: 12px; color: #a8957a; }
.hd-block { margin-top: 20px; }
.hd-block h3 { margin: 0 0 10px; font: 17px/1 var(--pixel); color: #fff7d6; }
.hd-block .seg { background: #0005; }
.hd-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.hd-list li { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; background: #ffffff08; font-size: 14px; line-height: 1.45; color: #8f7f68; transition: background .2s, color .2s; }
.hd-list li i { flex: none; min-width: 38px; font: 13px/1.45 var(--pixel); font-style: normal; }
.hd-list li.on { background: #ffd24a1a; color: #fff7d6; }
.hd-list li.on i { color: var(--gold); }
.hd-list li.lock i::after { content: '（需 ' attr(data-need) '★）'; margin-left: 2px; font-size: 11px; color: #c46; }
.hd-bond { padding: 10px 12px; border-radius: 10px; background: #ffffff0a; }
.hd-bond + .hd-bond { margin-top: 8px; }
.hd-bond b { font: 16px/1.3 var(--pixel); color: #ffb38a; }
.hd-bond .bmembers { margin: 8px 0 6px; }
.hd-bond .bm { color: #d8c8a8; }
.hd-bond .bbonus em { background: #7dff9a1c; color: #9ae8a8; }
.hd-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.hd-block:empty, #hd-bonds:empty { display: none; }

/* ---------- 選主將 ---------- */
.pdlg { width: min(760px, 96vw); }
.pd-in { display: flex; flex-direction: column; max-height: 90vh; }
.pd-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; }
.pd-head h2 { margin: 0; font: 22px/1 var(--pixel); color: var(--gold); }
.pd-head .hd-close { position: static; }
.pd-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 12px; }
.pd-tools input { flex: 1 1 180px; min-height: 40px; padding: 0 12px; border: 2px solid #ffffff26; border-radius: 10px; background: #0004; color: #fff7d6; font: 15px var(--text); }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; padding: 4px 16px 16px; overflow-y: auto; }
.pk { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 2px solid transparent; border-radius: 10px; background: #ffffff0a; color: #e8dcc0; font: 11px/1.2 var(--text); cursor: pointer; }
.pk .av { width: 60px; height: 60px; border-radius: 8px; background-color: #2e2340; box-shadow: 0 0 0 2px var(--rc); }
.pk span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pk:hover { border-color: var(--gold); }
.pk.in { opacity: .4; }
.pd-foot { display: flex; justify-content: flex-end; padding: 10px 16px 16px; border-top: 2px solid #ffffff14; }

.cx-finale { padding-top: clamp(56px, 8vw, 96px); }

/* ---------- 桌機 ---------- */
@media (min-width: 640px) { .cx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) {
  .cx-hero-in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .cx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* 電腦版：搜尋獨立一列，篩選列用滿寬度；「全部…」固定寬度放左邊，選項換行時對齊選項、不跑到「全部」底下（使用者：換行很醜） */
  .cx-filters .cx-search { max-width: 380px; }
  .cx-chiprow { position: relative; flex-wrap: wrap; overflow: visible; padding-left: 112px; }
  .cx-chiprow > .fchip:first-child { position: absolute; left: 0; top: 2px; width: 100px; justify-content: center; padding: 0; }
}
@media (min-width: 1180px) { .cx-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- 手機 ---------- */
@media (max-width: 860px) {
  .nav-back { display: inline-block; }
  .topbar .play-only + .nav-back { margin-left: 8px; }
  .sim { grid-template-columns: 1fr; padding: 10px; }
  .hdlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; box-shadow: none; }
  /* 手機：戰場黏在上方，其餘一起往下捲 */
  .hd-in { display: flex; flex-direction: column; height: 100dvh; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
  .hd-left { display: contents; }
  .hd-top { position: sticky; top: 0; z-index: 2; padding: 10px; background: radial-gradient(circle at 50% 0%, #3b2a1c, #1c130d); box-shadow: 0 6px 16px #0008; }
  .hd-intro { margin: 0; padding: 16px 16px 0; }
  .hd-ctrl { margin-top: 10px; gap: 8px 12px; }
  .hd-right { flex: none; max-height: none; overflow: visible; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .hd-close { top: 14px; right: 14px; }
  .pdlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .pd-in { max-height: 100dvh; height: 100%; }
}
@media (max-width: 560px) {
  .cx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cx-stats li { flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; font-size: 13px; }
  .cx-parade { margin-top: 8px; }
}
@media (max-width: 420px) {
  .cx-grid { gap: 10px; }
  .hc-name { font-size: 17px; }
  .hc-body { padding: 8px 9px 10px; }
  .cx-btn { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-hero::before, .hcard.r5::before { animation: none; }
  .hcard { animation: none; }
}

/* 電腦版捲軸：細、木頭色，不用瀏覽器預設的白色粗捲軸（使用者：醜陋的捲軸） */
.hd-left, .hd-right, .hd-in, .pd-grid { scrollbar-width: thin; scrollbar-color: #8a6a44 transparent; }
.hd-left::-webkit-scrollbar, .hd-right::-webkit-scrollbar, .hd-in::-webkit-scrollbar, .pd-grid::-webkit-scrollbar { width: 6px; }
.hd-left::-webkit-scrollbar-track, .hd-right::-webkit-scrollbar-track, .hd-in::-webkit-scrollbar-track, .pd-grid::-webkit-scrollbar-track { background: transparent; }
.hd-left::-webkit-scrollbar-thumb, .hd-right::-webkit-scrollbar-thumb, .hd-in::-webkit-scrollbar-thumb, .pd-grid::-webkit-scrollbar-thumb { background: #8a6a44; border-radius: 3px; }
