*{box-sizing:border-box}html{color-scheme:dark}body{margin:0;background:#0d141d;color:#f3eee0;font:16px/1.5 system-ui,"Microsoft YaHei",sans-serif}button,input,select,summary,a{touch-action:manipulation}button,select{font:inherit;color:inherit;background:#1e2a37;border:1px solid #465262;border-radius:6px;padding:9px 12px;cursor:pointer;min-height:42px}button:disabled{opacity:.4;cursor:default}button:hover:not(:disabled),button.active{border-color:#f1cc83;background:#333331}button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible{outline:3px solid #f2ca82;outline-offset:3px}button,.arena{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}a{color:inherit;text-decoration:none}h1,h2,h3,p{margin:0}h2{font-size:18px}h3{font-size:16px}small{font-size:12px}.eyebrow{font-size:12px;letter-spacing:.14em;color:#a7b9bb}.topbar,footer{max-width:1600px;margin:auto;padding:18px 28px;display:flex;align-items:center;justify-content:space-between;gap:15px}.topbar{border-bottom:1px solid #34414d}.brand{display:flex;align-items:center;gap:12px;font-size:21px;font-weight:800}.brand>b{background:#a4e7cf;color:#112b25;display:grid;place-items:center;width:40px;height:40px}.brand small{display:block;font-size:10px;letter-spacing:.14em;color:#afbfbd}nav{display:flex;align-items:center;gap:16px;font-size:14px}nav details{position:relative}summary{cursor:pointer}.music-menu{position:absolute;z-index:15;right:0;top:34px;width:250px;display:grid;gap:12px;padding:18px;background:#1c2735;border:1px solid #4b6370;box-shadow:0 10px 30px #0008}.music-menu label{display:grid;gap:8px}.music-menu span{font-size:13px;color:#abbdba}main{max-width:1600px;margin:auto;padding:24px 28px}.headline{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:20px}.headline h1{font-size:clamp(26px,3vw,38px);margin-top:6px}.round-badge{display:flex;flex-direction:column;text-align:right}.round-badge b{font-size:24px;color:#eacb8f}.round-badge span{color:#b8c4c5;font-size:14px}.game-layout{display:grid;grid-template-columns:210px minmax(0,1fr) 245px;gap:20px;align-items:start}.left-panel,.right-panel{display:grid;gap:16px}.panel{background:#131f2a;border:1px solid #344652;padding:16px;border-radius:8px}.panel h2{margin-bottom:12px}.resources{display:flex;justify-content:space-between;gap:10px;margin:10px 0}.resources span{font-size:12px;color:#acbbc0}.resources b{display:block;font-size:25px;color:#f0ca78;font-variant-numeric:tabular-nums}.resources span:first-child b{color:#a1e0c5}.xp-bar{height:4px;background:#303e4b;margin:12px 0 5px}.xp-bar i{display:block;height:100%;background:#90d4e4}.commander p{font-size:13px;color:#b9c9ca}.commander button{width:100%;margin:12px 0 8px}.commander small{display:block;color:#a5b7bb}#bonds{display:grid;gap:8px}.bond{border-bottom:1px solid #30424e;padding-bottom:7px;font-size:14px;color:#bac4c8}.bond b{color:#f1d49c}.bond small{display:block;font-size:12px;color:#9dacb6;line-height:1.5}.bond.off{opacity:.62}.standings-panel summary{font-weight:700;margin-bottom:10px}.standing{padding:8px 0;display:flex;justify-content:space-between;border-bottom:1px solid #293e4b;font-size:13px;gap:10px}.standing.me{color:#f3d69c}.standing.out{opacity:.45}.standing i{font-style:normal;color:#90d0b6}.arena-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;font-size:13px}.arena-toolbar label{display:flex;align-items:center;gap:8px}.arena-toolbar select{max-width:145px;font-size:13px;padding:7px}.arena-toolbar>span{color:#9dabb7}.arena-toolbar>div{display:flex;gap:7px}.arena{position:relative;aspect-ratio:1100/740;overflow:hidden;border:1px solid #597076;border-radius:9px;background:radial-gradient(ellipse at center,#254f50,#141d2e);isolation:isolate}.arena canvas{width:100%;height:100%;display:block;image-rendering:pixelated}.deploy-grid{position:absolute;left:17.2727%;top:50.4054%;width:65.4545%;height:40%;display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(4,1fr)}.deploy-grid button{background:transparent;border:1px solid transparent;border-radius:0;min-height:0;padding:0}.deploy-grid button:hover:not(:disabled),.deploy-grid button.selected{background:#ecca7319;border:2px solid #f5d797}.deploy-grid button:focus-visible{outline-offset:-3px}.battle-banner{position:absolute;left:50%;top:5%;transform:translate(-50%,-50%);color:#ffebb8;text-shadow:0 2px 5px #000;font-size:clamp(13px,1.7vw,22px);text-align:center;pointer-events:none;width:90%;font-weight:700}.pause-cover{position:absolute;inset:0;background:#081018c4;display:grid;align-content:center;text-align:center;color:#ffe3a4;font-size:26px}.pause-cover small{font-size:14px;color:#bdc7ca}.bench-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:16px 0 8px;font-size:13px}.bench-heading>span{color:#a9b9bf;font-size:12px}.bench-heading b{margin-right:8px}.bench-heading button{font-size:13px;min-height:35px;padding:6px 9px}.bench{display:grid;grid-template-columns:repeat(9,1fr);gap:5px}.bench button{padding:0;overflow:hidden;position:relative;min-height:78px;background:#15242e}.bench canvas{display:block;width:100%;height:65px;image-rendering:pixelated}.bench b{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 2px}.bench .stars{position:absolute;top:2px;left:0;right:0;z-index:1;text-shadow:0 1px 2px #000;font-size:12px}.bench button.empty{color:#56717c}.shop-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:24px 0 8px}.shop-heading h2 span{font-size:12px;color:#9db4b8;font-weight:400;margin-left:8px}.shop-heading>div{display:flex;gap:8px}.shop-heading button{font-size:13px}.odds{display:flex;gap:14px;font-size:12px;margin-bottom:8px}.shop{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.shop-card{--tier:#abb8be;border:1px solid var(--tier);border-bottom-width:3px;border-radius:7px;overflow:hidden;position:relative;background:#16242f}.shop-card .buy{width:100%;border:0;border-radius:0;padding:0 8px 8px;background:linear-gradient(0deg,#19232f,transparent);text-align:left;display:block;min-height:169px}.shop-card .buy:disabled{opacity:.65}.shop-card canvas{height:97px;display:block;width:100%;image-rendering:pixelated}.shop-card strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shop-card .cost{position:absolute;top:6px;right:7px;color:var(--tier);font-size:15px;font-weight:800}.shop-card .tag{display:block;color:#acbbc3;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shop-card .copies{display:block;font-size:11px;color:#e4c88e}.shop-card .info{font-size:12px;min-height:28px;padding:3px;background:#10202c;border:0;border-top:1px solid #344551;width:100%;border-radius:0}.shop-empty{display:grid;place-items:center;text-align:center;min-height:200px;color:#637e88;border:1px dashed #354b58;font-size:13px}.stars{color:#f5cc75}.launch-line{display:flex;gap:18px;align-items:center;justify-content:space-between;margin-top:16px}.launch-line p{font-size:13px;color:#c1d2cb;line-height:1.6}.primary{background:#edcd88;color:#172b2c;border-color:#f9e1b0;font-weight:800;padding:13px 18px;white-space:nowrap}.primary:hover:not(:disabled){background:#f9dda1;color:#152a29}.inspector-art{position:relative;height:170px;background:radial-gradient(ellipse at bottom,#40575760,transparent 65%);margin:-5px -12px 12px}.inspector-art canvas{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}.inspector-art>span{position:absolute;top:5px;right:10px;color:#e5c779;font-size:13px}#inspect-traits{font-size:13px;color:#a2d1c3;margin:5px 0 12px}#inspect-stats{display:grid;grid-template-columns:repeat(3,1fr);font-size:12px;gap:8px;color:#abc0c1;margin-bottom:15px}#inspect-stats b{display:block;color:#ece8d7;font-size:17px}.inspector h3{color:#efcf99;margin-bottom:8px}.inspector>p{font-size:13px;line-height:1.7;color:#b6c3c9}#inspect-pool{border-top:1px solid #374a54;margin-top:14px;padding-top:12px;color:#bbd8b4}.selection-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.selection-actions button{font-size:13px}.settings label{display:grid;gap:8px;font-size:14px}.settings select{width:100%}.settings p{font-size:12px;color:#a1b5bb;margin:13px 0}.settings>button{font-size:13px;margin:4px 0}.round-result{background:#1b3038;border:1px solid #a38d5b;border-radius:8px;margin-top:20px;padding:20px;display:grid;gap:15px}.round-result h2{font-size:27px;color:#f0d69b;margin:4px 0}.round-result p{font-size:14px;color:#c5d2c8}#damage-summary{font-size:13px;color:#b8ccca;line-height:1.8}footer{font-size:13px;color:#a0afb9;flex-wrap:wrap;margin-top:16px}footer a{color:#dfdbc9}dialog{max-width:760px;width:calc(100% - 32px);max-height:90dvh;overflow:auto;color:#eee9df;background:#172530;border:1px solid #69838a;border-radius:10px;padding:26px;line-height:1.8}dialog::backdrop{background:#060d16ca}.dialog-title{display:flex;justify-content:space-between;gap:16px;margin-bottom:18px;align-items:center}.dialog-title h2{font-size:24px}dialog li{margin-bottom:12px}dialog p{color:#bdcbd0;font-size:14px;margin:14px 0}.dialog-actions{display:flex;gap:12px;flex-wrap:wrap}.codex{display:grid;gap:12px;margin-top:24px}.codex h3{color:#edd8b0}.codex p{margin:5px 0}.codex button{font-size:13px;margin:3px;padding:5px 8px}.codex section{border-top:1px solid #3e555c;padding-top:14px}[hidden]{display:none!important}
@media(min-width:1600px){.shop-card canvas{height:115px}.shop-card .buy{min-height:190px}}
@media(max-width:1200px){.game-layout{grid-template-columns:180px minmax(0,1fr);gap:16px}.right-panel{grid-column:1/-1;grid-template-columns:1fr 1fr}.inspector{display:grid;grid-template-columns:140px 1fr;column-gap:16px}.inspector-art{grid-row:1/7;height:170px;grid-column:1}.inspector>*{grid-column:2}.inspector h2{margin:0}.inspector #inspect-pool{margin-top:7px}.right-panel .settings{align-self:start}.shop-card .buy{min-height:170px}}
@media(max-width:760px){.topbar,footer{padding:14px 16px}.brand{font-size:18px;gap:8px}.brand>b{width:32px;height:32px}.brand small{font-size:8px}nav{gap:9px;font-size:12px}nav>a{font-size:0}nav>a:before{content:'← 大厅';font-size:12px}nav button{padding:6px 9px;font-size:12px}main{padding:18px 12px}.headline{margin-bottom:15px}.headline h1{font-size:27px}.eyebrow{font-size:10px}.round-badge b{font-size:20px}.round-badge span{font-size:12px}.game-layout{display:flex;flex-direction:column;gap:14px}.left-panel{width:100%;grid-template-columns:1fr 1fr;gap:10px}.commander{grid-column:1/-1;display:grid;grid-template-columns:1fr 135px;gap:3px 16px;padding:12px}.commander>.eyebrow{display:none}.resources{grid-row:1/4;margin:0;align-items:center}.resources b{font-size:26px}.commander button{grid-column:2;grid-row:2;margin:3px 0;font-size:12px;min-height:35px;padding:5px}.commander .xp-bar{grid-column:2;margin:3px 0}.commander p{grid-column:2;font-size:11px}.commander small{grid-column:1/-1;font-size:11px}.left-panel>.panel:not(.commander){padding:12px}.left-panel h2,.standings-panel summary{font-size:14px;margin-bottom:6px}#bonds{display:flex;gap:6px;flex-wrap:wrap}.bond{font-size:12px;padding:0;border:0}.bond small{display:none}.standings-panel{max-height:180px;overflow:auto}.standing{padding:4px 0;font-size:12px}.arena-column{width:100%}.arena-toolbar>span{font-size:11px}.arena-toolbar select{max-width:125px}.arena-toolbar button{font-size:12px;padding:6px 10px;min-height:36px}.bench{grid-template-columns:repeat(9,minmax(0,1fr));gap:3px}.bench button{min-height:67px}.bench canvas{height:48px}.bench b{font-size:9px}.bench-heading>span{display:none}.shop{gap:6px;overflow-x:auto;grid-template-columns:repeat(5,minmax(93px,1fr));padding-bottom:5px;scrollbar-width:thin}.shop-card canvas{height:95px}.shop-card .buy{min-height:170px}.shop-card strong{font-size:13px}.shop-heading h2{font-size:16px}.shop-heading h2 span{display:none}.odds{gap:12px;flex-wrap:wrap}.launch-line{align-items:stretch;flex-direction:column;gap:10px}.launch-line p{font-size:12px}.launch-line .primary{width:100%;min-height:50px}.right-panel{width:100%;grid-template-columns:1fr}.inspector{grid-template-columns:110px 1fr;padding:14px}.inspector-art{height:150px}.settings p{margin:8px 0}.settings{display:grid;grid-template-columns:1fr 1fr;gap:8px}.settings label,.settings p{grid-column:1/-1}.settings>button{margin:0}dialog{padding:20px}.dialog-title h2{font-size:21px}dialog ol{padding-left:20px}}
@media(max-width:950px) and (orientation:landscape){.game-layout{display:grid;grid-template-columns:150px minmax(0,1fr);gap:12px}.left-panel{display:grid;grid-template-columns:1fr}.commander{display:block;padding:12px}.commander button{width:100%}.left-panel>.panel{grid-column:auto}.right-panel{display:grid;grid-column:1/-1;grid-template-columns:1fr 1fr}.arena-toolbar>span{display:none}.shop{grid-template-columns:repeat(5,minmax(78px,1fr))}.shop-card canvas{height:83px}.shop-card .buy{min-height:155px}.headline{margin-bottom:10px}.headline h1{font-size:26px}.bench button{min-height:65px}.bench canvas{height:46px}.launch-line{flex-direction:row}.launch-line .primary{width:auto}.inspector{grid-template-columns:95px 1fr}.settings{display:block}.settings>button{margin-right:7px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

@media(max-width:760px) and (orientation:portrait){.bench{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.bench button{min-height:83px}.bench canvas{height:60px}.bench b{font-size:12px}.shop-card .tag,.shop-card .copies{font-size:12px}.shop{grid-template-columns:repeat(5,minmax(105px,1fr))}}

.headline{margin-bottom:16px}.headline #new-run{font-weight:700;border-color:#7a9688;min-height:46px;padding:10px 18px}.deploy-grid,.bench button{touch-action:none}.deploy-grid button,.bench button{cursor:grab}.deploy-grid button:active,.bench button:active{cursor:grabbing}.deploy-grid button.drop-target,.bench button.drop-target{background:#c5f6ad35;border:2px solid #e5ef9c;box-shadow:inset 0 0 0 2px #0a292f}.drag-piece{position:fixed;z-index:100;pointer-events:none;transform:translate(-50%,-90%);width:110px;text-align:center;filter:drop-shadow(0 5px 5px #0008);user-select:none}.drag-piece canvas{display:block;width:110px;height:125px;image-rendering:pixelated}.drag-piece b{display:block;font-size:13px;color:#fff1bf;background:#16332ed9;border:1px solid #a7c6a7;padding:2px;border-radius:4px}.bench canvas{pointer-events:none}.bench-heading>span{line-height:1.5}

/* Compact match controls and contextual unit information. */
.headline{gap:10px;margin-bottom:10px}.headline #new-run{font-size:13px;font-weight:600;min-height:33px;padding:6px 11px}.round-badge b{font-size:17px}.round-badge span{font-size:12px}.round-badge{white-space:nowrap}.match-settings{display:flex;align-items:center;gap:8px;margin-left:auto}.match-settings label{display:flex;gap:7px;align-items:center;font-size:12px}.match-settings select,.match-settings button{min-height:32px;padding:5px 7px;font-size:12px;max-width:150px}.game-layout{grid-template-columns:185px minmax(0,1fr)}.commander{padding:11px}.commander>.eyebrow{display:none}.resources{margin:0 0 7px;gap:8px}.resources span{font-size:12px}.resources b{font-size:22px;line-height:1.2}.commander .xp-bar{margin:8px 0 4px}.commander button{min-height:32px;padding:5px 8px;font-size:12px;margin:7px 0 5px}.commander p,.commander small{font-size:11px}.selection-actions{margin:0;gap:5px}.selection-actions button{font-size:12px;min-height:30px;padding:5px 8px}.bench-heading{flex-wrap:wrap}.shop-zone{position:relative}.sell-hint{position:absolute;inset:0;pointer-events:none;display:grid;place-items:center;text-align:center;background:#11342ecc;border:2px dashed #e8ce88;border-radius:7px;color:#ffe2a1;font-weight:700;font-size:17px;padding:12px;z-index:4}.shop.sell-target+.sell-hint{background:#5e3319e0;border:3px solid #ffda85}.shop-card canvas{width:100%;height:110px;max-height:none;object-fit:contain;aspect-ratio:1;image-rendering:pixelated;pointer-events:none}.shop-card .buy{min-height:188px}.shop-card .info{min-height:26px;font-size:12px}.shop-card .buy{-webkit-touch-callout:none;user-select:none;touch-action:pan-x pan-y}
.unit-popover{position:fixed;z-index:90;width:min(310px,calc(100vw - 16px));max-height:min(380px,calc(100dvh - 16px));overflow:auto;box-shadow:0 12px 40px #000b;border:1px solid #a5b5a0;border-radius:9px;padding:13px;display:grid;grid-template-columns:75px 1fr;gap:5px 10px}.unit-popover .peek-close{position:absolute;top:4px;right:4px;min-height:27px;width:27px;padding:0;z-index:1;font-size:19px}.unit-popover .inspector-art{grid-column:1;grid-row:1/4;margin:0;height:93px}.unit-popover .inspector-art canvas{width:100%;height:80px;object-fit:contain}.unit-popover .inspector-art>span{font-size:11px;top:auto;bottom:0;left:0;right:auto;white-space:nowrap}.unit-popover h2{grid-column:2;font-size:17px;padding-right:16px;margin:0}.unit-popover #inspect-traits{grid-column:2;font-size:12px;line-height:1.5;margin:0;max-height:72px;overflow:auto}.unit-popover #inspect-stats{grid-column:1/-1;grid-template-columns:repeat(3,1fr);font-size:12px;margin:5px 0;gap:8px}.unit-popover #inspect-stats b{font-size:15px}.unit-popover #inspect-skill,.unit-popover #inspect-desc,.unit-popover #inspect-pool{grid-column:1/-1}.unit-popover #inspect-skill{font-size:14px;margin:4px 0 0}.unit-popover #inspect-desc{font-size:13px;line-height:1.6;margin:0}.unit-popover #inspect-pool{font-size:11px;line-height:1.5;margin:4px 0 0;padding-top:7px}
@media(max-width:760px){main{padding-top:10px}.headline{gap:7px;margin-bottom:10px}.headline #new-run{font-size:12px;padding:5px 8px;min-height:31px}.round-badge b{font-size:15px}.round-badge span{font-size:11px}.match-settings label{font-size:0;gap:0}.match-settings select{width:100px;font-size:12px;min-height:31px}.match-settings #resume{font-size:11px;padding:4px;max-width:70px}.game-layout{display:flex;gap:10px}.commander{padding:8px 10px;grid-template-columns:minmax(0,1fr) 115px;gap:1px 12px}.resources{margin:0;gap:10px}.resources b{font-size:21px}.resources span{font-size:11px}.commander button{margin:1px 0;min-height:29px;padding:4px;font-size:11px}.commander .xp-bar{margin:2px 0}.commander #interest{font-size:10px;line-height:1.4}.left-panel{gap:8px}.left-panel>.panel:not(.commander){padding:9px}.shop-card canvas{height:100px;object-fit:contain}.shop-card .buy{min-height:180px}.bench-heading{margin-top:11px}.bench-heading b{font-size:13px}.bench-heading .selection-actions{margin-left:auto}.unit-popover .inspector-art{grid-column:1;grid-row:1/4}.unit-popover>*{grid-column:auto}.unit-popover h2,.unit-popover #inspect-traits{grid-column:2}.unit-popover #inspect-stats,.unit-popover #inspect-skill,.unit-popover #inspect-desc,.unit-popover #inspect-pool{grid-column:1/-1}}
@media(max-width:950px) and (orientation:landscape){.game-layout{display:grid;grid-template-columns:155px minmax(0,1fr)}.commander{display:block}.shop-card canvas{height:89px;object-fit:contain}.shop-card .buy{min-height:165px}}

/* Keep expanded bond collections within the game dashboard. */
#bonds{max-height:360px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
@media(max-width:760px) and (orientation:portrait){#bonds{max-height:120px}}
