:root{color-scheme:dark;font-family:'Microsoft YaHei','Segoe UI',sans-serif;color:#f5f3eb;background:#080e14;--orange:#ff940c}*{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;background:radial-gradient(ellipse at top,#203447,#070b10 75%)}button,select,input{font:inherit;color:inherit}button{cursor:pointer;border:1px solid #ffffff36;background:linear-gradient(135deg,#252c34,#12181e);border-radius:3px;transition:border-color .15s,background .15s}button:hover{border-color:var(--orange);background:#343331}button:focus-visible{outline:2px solid #ffb32d;outline-offset:2px}button:disabled{opacity:.4;cursor:default}button.primary{background:linear-gradient(110deg,#ffb422,#f17900);border-color:#ffbc56;color:#171b20;font-weight:700}button.primary:hover{background:#ffc13f}[hidden]{display:none!important}.game{width:min(1640px,98vw,163.33vh);aspect-ratio:5/3;position:relative;overflow:hidden;container-type:inline-size;box-shadow:0 10px 80px #0009;border:1px solid #5965744d}.canvas-holder{position:absolute;inset:0}canvas#battlefield{width:100%;height:100%;display:block;outline:none}kbd{font-family:inherit;display:inline-grid;place-items:center;background:linear-gradient(#eeeadc,#c3bbab);color:#171b20;border-radius:2px;min-width:1.6cqw;padding:0 .3cqw;font-size:1.2cqw;box-shadow:0 2px 0 #0009}button kbd{box-shadow:none}.supports{position:absolute;left:1.5%;top:1.7%;display:flex;gap:.6cqw;z-index:6}.supports button{width:4.6cqw;height:5.2cqw;position:relative;padding:0;background:linear-gradient(135deg,#242b33eb,#10161ced);box-shadow:0 2px 4px #000a}.supports kbd{position:absolute;top:.25cqw;left:.4cqw;background:none;color:white;font-size:1.1cqw;min-width:0}.supports b{font-size:2.4cqw;line-height:4.6cqw;color:#fff0b0}.supports strong{position:absolute;bottom:.35cqw;right:.4cqw;font-size:1cqw;color:#e7cf8b}.supports .recharge{height:.3cqw;background:#ff9f14;position:absolute;bottom:0;left:0}.supports .locked{opacity:.45}.command-bar{position:absolute;z-index:5;left:26%;right:25%;top:1.6%;height:5.4%;display:flex;gap:1.3cqw;align-items:center;justify-content:center;transform:skewX(-17deg);background:linear-gradient(90deg,#141920df,#121820bb);border:1px solid #ffffff40;border-left:3px solid var(--orange);font-size:1.55cqw;white-space:nowrap}.command-bar>*{transform:skewX(17deg)}.command-bar>span+span{border-left:2px solid var(--orange);padding-left:1.3cqw}.command-bar b{font-weight:500}.command-bar #wave{font-weight:700}.level{position:relative;min-width:7.4cqw}.xp-track{height:.4cqw;background:#8b8f9250;display:block;position:absolute;bottom:-.6cqw;width:100%;overflow:hidden}.xp-track i{display:block;height:100%;background:linear-gradient(90deg,#ff7800,#ffc45b)}.pause{position:absolute;top:1.6%;left:77%;width:5.6%;height:5.2%;background:#f98b05;transform:skewX(-15deg);font-weight:900;font-size:2.1cqw;border-color:#ffb546}.damage-toggle{position:absolute;right:.8%;top:1.6%;height:5.2%;width:15%;font-size:1.3cqw}.damage-toggle b{display:inline-block;background:#ff9a0b;border-radius:2cqw;padding:.15cqw .65cqw;margin-left:.4cqw;color:#171d22}.damage-toggle[aria-pressed=false] b{background:#56616a;color:#ddd}.field-meta{position:absolute;left:26%;right:25%;top:8%;display:flex;justify-content:space-between;gap:1cqw;font-size:.8cqw;color:#d4e1e6b0;pointer-events:none}.menu-open{position:absolute;left:1.6%;bottom:1%;font-size:1cqw;z-index:7;background:#0a101ab8;padding:.4cqw .7cqw}.damage-ranking{position:absolute;right:.8%;top:11%;width:19%;z-index:7;font-size:1.1cqw;background:#11192496;border:1px solid #b6c8d52b;border-radius:4px;backdrop-filter:blur(3px)}#ranking-toggle{width:100%;text-align:left;border:0;background:#141b2480;padding:.7cqw .9cqw;font-size:1.4cqw}#ranking-toggle:first-letter{color:var(--orange)}#ranking-toggle span{float:right}#damage-list{max-height:23cqw;overflow-y:auto;scrollbar-width:thin}.damage-row{display:grid;grid-template-columns:3.2cqw 1fr;gap:.55cqw;padding:.45cqw .7cqw;border-top:1px solid #ffffff13}.damage-row img{width:3.2cqw;height:3.2cqw;object-fit:contain;background:#ffffff0b}.damage-row .stat{display:flex;justify-content:space-between;gap:.5cqw;margin-bottom:.45cqw}.damage-row .bar{height:.6cqw;background:#ffffff20}.damage-row .bar i{height:100%;display:block;background:linear-gradient(90deg,#ff7500,#ffba35)}.damage-row small{display:block;font-size:.7cqw;opacity:.7;margin-top:.2cqw}.damage-ranking>div>small{display:block;padding:.5cqw .8cqw;opacity:.6;font-size:.75cqw}.choices{position:absolute;left:14.5%;right:14.5%;bottom:10%;z-index:6}.choice-status{display:flex;justify-content:space-between;margin-bottom:.45cqw;color:#f7c479;font-size:.85cqw;text-shadow:0 1px 3px black}.choice-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:1cqw}.choice-card{height:11.3cqw;text-align:left;padding:1cqw .8cqw .7cqw 8.1cqw;position:relative;overflow:hidden;border:1px solid #f89e35;border-radius:0;clip-path:polygon(6% 0,95% 0,100% 10%,100% 88%,94% 100%,0 100%,0 12%);background:linear-gradient(100deg,#121923f7,#151c24ef);box-shadow:none}.choice-card.selected{border:3px solid #ffb52f;background:linear-gradient(110deg,#31332cf7,#181e23f7);filter:drop-shadow(0 0 5px #ff9000)}.choice-card .portrait{position:absolute;left:0;bottom:0;width:8cqw;height:10.5cqw;object-fit:cover;object-position:center;opacity:.9;mask-image:linear-gradient(90deg,#000 75%,transparent)}.choice-card .choice-art{position:absolute;height:130%;width:100%;object-fit:cover;top:-10%;left:0;opacity:.24;pointer-events:none}.choice-card.hoc-choice{padding-left:1cqw}.choice-card .skill-icon{width:2.2cqw;height:2.2cqw;object-fit:contain;float:left;margin-right:.4cqw}.choice-card h3{font-size:1.45cqw;font-weight:500;margin:0 0 .5cqw;position:relative;line-height:2.2cqw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.choice-card .tag{display:none}.choice-card .skill-title{font-size:1.2cqw;line-height:1.4;margin:.4cqw 0;color:#fff5dd;max-height:3.4cqw;overflow:hidden}.choice-card .choice-index{font-size:1.05cqw;color:#ffce78;position:absolute;bottom:1cqw;left:8.1cqw}.choice-card.hoc-choice .choice-index{left:1cqw}.choice-card .detail{display:none}.choice-card:hover .detail{display:block;position:absolute;inset:0;padding:1cqw;background:#0b1114f2;font-size:.85cqw;line-height:1.5;overflow:auto;margin:0;z-index:2}#choice-guide{position:absolute;bottom:3%;left:20%;right:20%;display:flex;align-items:center;justify-content:center;gap:1.3cqw;font-size:1.35cqw;background:linear-gradient(90deg,transparent,#10161ce0 20%,#10161ce0 80%,transparent);padding:.4cqw;z-index:6}#guide-countdown{color:#ffac19}.field-guide{position:absolute;bottom:1%;left:15%;right:2%;display:flex;gap:1cqw;justify-content:space-between;font-size:.75cqw;color:#c0cbd2a0;pointer-events:none}.field-guide kbd{font-size:.75cqw;min-width:1cqw;background:#24303ccc;color:#dce2de}.choices:not([hidden])~.field-guide{opacity:.25}#toast{position:absolute;left:30%;right:30%;top:15%;text-align:center;background:#101a21c9;border-left:3px solid #ff9900;padding:.65cqw;font-size:1cqw;opacity:0;transform:translateY(-5px);transition:.25s;pointer-events:none}#toast.visible{opacity:1;transform:none}.overlay{position:absolute;inset:0;z-index:20;display:grid;place-items:center;background:#080e16bb;backdrop-filter:blur(3px);font-size:1.1cqw}.dialog{width:65%;max-height:90%;overflow:auto;padding:2.6cqw;background:linear-gradient(135deg,#28333eef,#111923f7);border:1px solid #929ca344;border-top:3px solid var(--orange);box-shadow:0 15px 60px #0007}.dialog h2{font-size:2.4cqw;margin:.8cqw 0 1.4cqw;font-weight:500}.dialog p,.dialog dd{line-height:1.7;color:#c4cdd2}.dialog button{padding:.7cqw 1.5cqw}.eyebrow{color:#ffac41;letter-spacing:.18em;font-size:.8cqw}.dialog-heading{display:flex;align-items:center;justify-content:space-between}.briefing{width:83%;height:80%;display:grid;grid-template-columns:46% 54%;background:linear-gradient(130deg,#293642,#111923);border:1px solid #ffffff30;box-shadow:0 20px 80px #0009}.poster{position:relative;overflow:hidden;padding:2.4cqw;background:linear-gradient(115deg,#ffb52c,#d87005);color:#101c25}.poster>span{font-size:28cqw;font-weight:900;position:absolute;right:-3cqw;top:-1cqw;opacity:.13;line-height:1}.poster small{font-size:.8cqw;letter-spacing:.15em}.poster h1{font-size:3.5cqw;margin-top:13cqw;position:relative;line-height:1.6}.poster h1 b{display:block;font-size:3cqw}.poster p{font-size:1.2cqw}.brief-body{padding:2.8cqw 3.6cqw;display:flex;flex-direction:column;align-items:stretch;gap:.7cqw}.brief-body h2{font-size:2.7cqw;line-height:1.4;margin:.5cqw 0}.brief-body p{font-size:1.1cqw;line-height:1.7;color:#b9c6cc;margin:.4cqw 0}.brief-body label{font-size:.85cqw;color:#b4c3cb}.brief-body select{padding:.65cqw;background:#101923;border:1px solid #5d6b7780;font-size:1.05cqw}.brief-body button{margin-top:.8cqw;padding:.9cqw;font-size:1.4cqw}.brief-body small{font-size:.8cqw;opacity:.65}.menu-actions{display:flex;gap:1cqw}.menu-stats{display:flex;gap:2cqw;margin:1.5cqw 0}.menu-stats b{color:#ffbc52}#roster{display:grid;grid-template-columns:repeat(3,1fr);gap:.5cqw}.roster-unit{background:#0003;display:flex;align-items:center;gap:.6cqw;padding:.45cqw;font-size:.85cqw}.role-badge{font-size:.7cqw;color:var(--unit)}.roster-name{flex:1}.skill-level{color:#ffce78}.unit-hp{height:2px;background:#ffffff1a;margin-top:3px}.unit-hp i{display:block;height:100%;background:#96c2ac}.hoc-panel{margin-top:1.3cqw;font-size:.9cqw}.hoc-panel h3{margin:.5cqw 0}.hoc-skill{display:inline-block;padding:.2cqw .7cqw;border:1px solid #c18e40;margin:.4cqw .5cqw 0 0}.guide-dialog{width:72%;font-size:1cqw}.guide-dialog dl{display:grid;grid-template-columns:20% 1fr;gap:.7cqw}.guide-dialog dt{color:#ffb94a}.guide-dialog dd{margin:0}#result-stats{display:flex;justify-content:space-around;margin:2cqw 0}#result-stats b{display:block;font-size:2.5cqw;color:#ffb548}.gallery-dialog{width:94%;height:92%;padding:1.5cqw;background:#17212ef2;border-top:3px solid var(--orange);display:flex;flex-direction:column}.gallery-heading,.preview-heading{display:flex;gap:1cqw;align-items:center;justify-content:space-between}.gallery-heading h2{margin:.3cqw 0 .8cqw;font-size:2cqw}.gallery-heading button{padding:.6cqw 1cqw}.gallery-body{display:flex;gap:1.3cqw;flex:1;min-height:0}.gallery-sidebar{width:22%;display:flex;flex-direction:column}.gallery-sidebar input{width:100%;padding:.7cqw;background:#080f19;border:1px solid #7c8b9850;margin-bottom:.7cqw}#gallery-list{overflow:auto;flex:1}#gallery-list button{width:100%;display:flex;align-items:center;gap:.6cqw;padding:.4cqw;margin-bottom:.3cqw;text-align:left}#gallery-list img{width:3cqw;height:3cqw;object-fit:contain}#gallery-list button.selected{border-color:var(--orange)}#gallery-list small{display:block;font-size:.7cqw;opacity:.6}.gallery-preview{width:78%;display:flex;flex-direction:column;min-height:0}.gallery-preview canvas{max-height:70%;width:100%;object-fit:contain;background:#223240}.preview-controls{display:flex;gap:.7cqw;align-items:center;flex-wrap:wrap;font-size:.85cqw}.preview-controls select{background:#17212c;padding:.4cqw}.preview-controls button{padding:.5cqw}.gallery-preview p{font-size:.85cqw;color:#a9b9c3}.preview-heading h3{font-size:1.6cqw;margin:.5cqw}.preview-heading a{color:#ffc169;font-size:.9cqw}.gallery-sidebar::-webkit-scrollbar{width:4px}

/* BUILD09: illustrated cards, stable-frame content crossfade, bounded gallery. */
.choice-card{padding:0;border:0;clip-path:none;background:transparent url('./assets/ui/build09/upgrade-frame.png') center/100% 100% no-repeat;overflow:hidden;isolation:isolate;height:11.8cqw}.choice-card.selected{border:0;background:transparent url('./assets/ui/build09/upgrade-frame.png') center/100% 100% no-repeat;filter:drop-shadow(0 0 .4cqw #ff9900)}.choice-card .illustration{position:absolute;left:2%;top:8%;height:84%;width:43%;object-fit:cover;object-position:center 20%;opacity:.85;mask-image:linear-gradient(90deg,#000 70%,transparent);transition:opacity .2s;z-index:-1}.choice-card .hoc-illustration{width:94%;left:3%;opacity:.32;object-fit:cover;object-position:50% 45%;mask-image:linear-gradient(90deg,#000,transparent 98%)}.card-face,.card-back{position:absolute;inset:9% 6% 9% 40%;transition:opacity .2s ease;display:flex;flex-direction:column;justify-content:center;gap:.4cqw;overflow:hidden}.card-back{inset:10% 7%;opacity:0;pointer-events:none;background:linear-gradient(90deg,#101820e6,#1018208a)}.choice-card:hover .card-face,.choice-card.inspecting .card-face{opacity:0}.choice-card:hover .card-back,.choice-card.inspecting .card-back{opacity:1}.choice-card:hover .illustration,.choice-card.inspecting .illustration{opacity:.13}.choice-card .card-heading{display:flex;align-items:center;gap:.4cqw;flex:none;min-width:0}.choice-card .card-heading img{height:1.9cqw;width:1.9cqw;object-fit:contain}.choice-card .card-heading h3{position:static;margin:0;font-size:1.35cqw;font-weight:500;line-height:1.9cqw;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.choice-card .skill-title{font-size:1.08cqw;margin:0;color:#f4e8cf;line-height:1.5;max-height:4.6cqw;overflow:hidden}.choice-card .choice-index{position:static;font-size:.85cqw;color:#ffc168;line-height:1.4}.choice-card .skill-description{white-space:pre-line;font-size:.83cqw;line-height:1.5;color:#dde6ea;margin:0;overflow:auto;scrollbar-width:thin}.stat-mark{color:#ffc064;font-size:2.2cqw;line-height:1}.choice-card.global-card .card-face{inset:10% 8% 10% 13%}.choice-card.hoc-card .card-face{inset:10% 7% 10% 25%}.choice-card .card-back h3{font-size:1.05cqw}.choice-card .card-back .card-heading img{width:1.6cqw;height:1.6cqw}.debug-speed{position:absolute;left:8.6%;bottom:1%;height:2.3cqw;display:flex;align-items:center;gap:.4cqw;font-size:.8cqw;background:#0e1824bb;padding:.2cqw .5cqw;z-index:8}.debug-speed select{font-size:1cqw;background:#1c2936;border:1px solid #f59e3f55}.field-guide{left:22%}.gallery-dialog{height:90%;width:94%;max-height:90%;min-height:0;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);align-self:center}.gallery-body{display:grid;grid-template-columns:22% minmax(0,1fr);height:100%;min-height:0;overflow:hidden}.gallery-sidebar{width:auto;min-height:0;max-height:100%;overflow:hidden}.gallery-sidebar input{flex:none}#gallery-list{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;flex:1}.gallery-preview{width:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto minmax(0,30%) auto;min-height:0;overflow:hidden}.gallery-preview canvas{width:100%;height:100%;max-height:100%;min-height:0;object-fit:contain}.gallery-note{margin:0;font-size:.7cqw!important}.unit-skill-guide{min-height:0;overflow:auto;overscroll-behavior:contain;background:#0a111a88;border:1px solid #77879833;padding:.7cqw;scrollbar-width:thin}.unit-skill-guide h4{display:flex;align-items:center;gap:.6cqw;margin:0 0 .5cqw;font-size:1cqw;color:#ffd293}.unit-skill-guide h4 img{width:2cqw;height:2cqw;object-fit:contain}.unit-skill-guide p{font-size:.85cqw!important;line-height:1.6;margin:.3cqw 0!important;white-space:pre-line}.unit-skill-guide b{color:#ffc368}.unit-skill-guide article+article{border-top:1px solid #d0dbe733;padding-top:.8cqw;margin-top:1cqw}.command-bar em{font-style:normal}body{overflow:hidden}

.audio-controls{display:flex;gap:20px;align-items:center;margin:14px 0;color:#bfcbd2}.audio-controls label{display:flex;align-items:center;gap:12px}.audio-controls input{accent-color:#ff9d00;width:150px;max-width:32vw}.audio-controls button[aria-pressed="true"]{border-color:#dc8b18;color:#ffd09a}

/* D45: preserve the exact same skin across all button states; native alpha clips content. */
.choice-card,.choice-card:hover,.choice-card:focus-visible,.choice-card.selected{border:0;background-color:transparent;background-image:url('./assets/ui/build09/upgrade-frame.png');background-repeat:no-repeat;background-size:103.243% 114.266%;background-position:50.82% 50.5%;clip-path:none;overflow:hidden}
.card-media-ready .choice-card{mask-image:url('./assets/ui/build09/upgrade-frame.png');mask-repeat:no-repeat;mask-size:103.243% 114.266%;mask-position:50.82% 50.5%;mask-mode:alpha}
.choice-card .illustration{z-index:0;pointer-events:none}.choice-card .card-face,.choice-card .card-back{z-index:1}
.hoc-loadout{position:absolute;left:1.5%;bottom:8.7%;display:flex;gap:.7cqw;z-index:5}.hoc-slot,.hoc-slot:hover,.hoc-slot:focus-visible{position:relative;width:4.8cqw;height:4.8cqw;min-width:38px;min-height:38px;max-width:76px;max-height:76px;padding:0;border:0;background:transparent url('./assets/ui/build10/hoc-slot-v1.png') center/100% 100% no-repeat;overflow:hidden;clip-path:polygon(7% 0,93% 0,100% 7%,100% 93%,93% 100%,7% 100%,0 93%,0 7%)}.hoc-slot-portrait{position:absolute;inset:5% 7% 16%;width:86%;height:79%;object-fit:cover}.slot-number{position:absolute;left:8%;top:4%;font-size:.75cqw;color:#ffd28a;z-index:1;text-shadow:0 1px #000}.empty-hoc{font-size:.68cqw;color:#808d99}.hoc-slot-skills{position:absolute;bottom:3%;left:5%;width:90%;height:12%;display:flex;justify-content:space-around}.hoc-slot-skills i{font-size:.45cqw;line-height:1;font-style:normal;color:#62707a}.hoc-slot-skills .learned{color:#ffbc44}
.field-tooltip{position:absolute;width:27cqw;max-width:370px;min-width:220px;z-index:12;padding:1cqw 1.15cqw;background:transparent url('./assets/ui/build10/tooltip-panel-v1.png') center/100% 100% no-repeat;color:#e6edf1;pointer-events:none;opacity:0;transition:opacity .15s;font-size:.88cqw;line-height:1.5;overflow:hidden}.field-tooltip.visible{opacity:1}.field-tooltip h3{font-size:1.05cqw;color:#ffd28a;margin:0 0 .5cqw}.field-tooltip p{margin:.4cqw 0}.field-tooltip small{color:#d2ad6e}.hoc-tooltip-skill{display:flex;gap:.6cqw;align-items:flex-start;margin:.5cqw 0;color:#87929b;white-space:pre-line;font-size:.75cqw}.hoc-tooltip-skill.learned{color:#e3e8ec}.hoc-tooltip-skill img{width:1.7cqw;height:1.7cqw;object-fit:contain;flex:none}@media(max-width:800px){.field-tooltip{font-size:11px}.field-tooltip h3{font-size:13px}.hoc-tooltip-skill{font-size:10px}.empty-hoc{font-size:8px}}
/* D47: fixed angular surface, independent selection stroke and outside glow. */
.choice-card,.choice-card:hover,.choice-card:focus-visible,.choice-card.selected,.card-media-ready .choice-card{background:none!important;border:0;mask-image:none;clip-path:none;overflow:visible;filter:none;height:9.7cqw;isolation:isolate}
.card-surface{position:absolute;inset:0;overflow:hidden;clip-path:polygon(5% 0,100% 0,100% 86.3%,95% 100%,0 100%,0 13.7%);background:#111923d9;isolation:isolate}
.card-texture{position:absolute;inset:0;background:transparent url('./assets/ui/build09/upgrade-frame.png') 50.82% 50.5%/103.243% 114.266% no-repeat;opacity:.57;pointer-events:none;z-index:0}
.card-outline{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:4}.card-outline path{fill:none;stroke:#c99735;stroke-width:1;stroke-opacity:.8;transition:stroke .15s,stroke-width .15s}
.choice-card.selected{filter:drop-shadow(0 0 .35cqw #ff9f19)}.choice-card.selected .card-outline path{stroke:#ffe098;stroke-width:2.8;stroke-opacity:1}.choice-card:hover .card-outline path{stroke:#ffcf71}
.choice-card .illustration{left:0;top:0;width:45%;height:100%;object-position:50% 18%;opacity:.9;z-index:1;mask-image:linear-gradient(90deg,#000 73%,transparent)}
.choice-card .hoc-illustration{left:0;width:100%;height:100%;opacity:.32;object-position:50% 40%;mask-image:linear-gradient(90deg,#000 30%,transparent 98%)}
.choice-card .card-face,.choice-card .card-back{z-index:2}.choice-card .card-face{inset:10% 5% 10% 41%}.choice-card .card-back{inset:10% 7%;background:linear-gradient(90deg,#101820dd,#10182065)}
.choice-card.global-card .card-face{inset:12% 8% 12% 10%}.choice-card.hoc-card .card-face{inset:10% 6% 10% 26%}.choice-card .card-heading h3{font-size:1.2cqw}.choice-card .skill-title{font-size:1cqw}.choice-card .card-back .skill-description{font-size:.8cqw}
.choice-card:hover .illustration,.choice-card.inspecting .illustration{opacity:.13}

/* D52 native haste loop + duration HUD, inside existing support slot. */
.supports .support-duration{position:absolute;left:.35cqw;bottom:.35cqw;font-size:.75cqw;line-height:1;color:#ffcf77;text-shadow:0 1px 2px #000;pointer-events:none}
.supports button[data-haste-active="true"]{box-shadow:0 0 0 1px #ffbc50,0 0 10px #ff9f1430}
.supports button[data-haste-active="true"] b{color:#ffc258}
.supports button[data-haste-active="true"]:disabled{opacity:.92}

/* D61 candidate: keep original card size when fewer legal skills exist. */
.choice-cards[data-count="1"]{grid-template-columns:repeat(3,minmax(0,1fr))}.choice-cards[data-count="1"]>.choice-card:first-child{grid-column:2}.choice-cards[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr));width:66.197%;margin-inline:auto}

.battle-music-controls{flex-wrap:wrap}.music-track{font-size:12px;color:#c5bdab;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}

/* D68 original-independent generated support symbols */
.supports button b img{width:34px;height:34px;object-fit:contain;display:block}.supports button[data-support="tank"]:disabled{opacity:.65}

/* BUILD26: independent XP anchor and a categorized, bounded archive. */
.field-xp{position:absolute;right:2%;bottom:1%;z-index:3;min-width:13cqw;text-align:right;font-size:.75cqw;line-height:1.5;color:#c0cbd2a0;white-space:nowrap;pointer-events:none;font-variant-numeric:tabular-nums}
.field-guide{right:18%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.7fr) auto;align-items:center}
.field-guide>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#movement-status{text-align:center}
.defense-label{display:inline-flex;align-items:center;gap:.35cqw}
.defense-line-icon{width:1.5cqw;height:1.8cqw;object-fit:contain;vertical-align:middle}
.gallery-dialog{grid-template-rows:auto auto minmax(0,1fr);gap:.55cqw}.gallery-navigation{display:flex;flex-direction:column;gap:.5cqw;min-width:0}
.gallery-tabs,.gallery-factions{display:flex;gap:.6cqw;flex-wrap:wrap;flex:none}
.gallery-tabs button,.gallery-factions button{padding:.55cqw 1.2cqw;font-size:1cqw;color:#c2cdd4;min-width:7cqw}
.gallery-tabs button[aria-selected=true],.gallery-factions button[aria-selected=true]{color:#ffe3ac;background:#b5761629;border-color:#ffa51f;box-shadow:inset 0 -2px #ff9d16}
.gallery-factions{padding-bottom:.4cqw;border-bottom:1px solid #63758842}
.gallery-body{grid-template-columns:27% minmax(0,1fr);gap:1.2cqw}
.gallery-heading h2{margin:.3cqw 0}
#preview-status{font-size:.9cqw;color:#a8b9c5}
#gallery-list{padding-right:.4cqw}
#gallery-list button{min-height:3.5cqw;padding:.5cqw;gap:.7cqw}
#gallery-list button img{flex:none;width:3cqw;height:3cqw}
#gallery-list .gallery-item-name{min-width:0;flex:1;line-height:1.3;font-size:1cqw}
#gallery-list small{font-size:.75cqw;opacity:.75;margin-top:.2cqw}
.gallery-section-label{position:sticky;top:0;z-index:1;margin:0 0 .4cqw;padding:.5cqw;background:#111b28;color:#e6b36c;font-size:.8cqw;border-bottom:1px solid #71818a40}
.gallery-empty{font-size:.9cqw;color:#abbac4;padding:1cqw}
.gallery-preview{grid-template-rows:auto minmax(0,1fr) auto minmax(0,32%) auto}
.gallery-note{margin:0;line-height:1.4;font-size:.72cqw!important}
.unit-skill-guide h4{line-height:1.5}.unit-skill-guide p{line-height:1.65}
.runtime-fault pre{max-width:55vw;max-height:20vh;white-space:pre-wrap;overflow:auto;font-size:12px;color:#e4b986}
@media(max-width:800px){.gallery-dialog{width:97%;height:96%;max-height:96%;padding:1cqw}.gallery-body{grid-template-columns:31% minmax(0,1fr)}.gallery-tabs button,.gallery-factions button{font-size:max(10px,1.1cqw);padding:.6cqw 1cqw}#gallery-list .gallery-item-name{font-size:max(10px,1cqw)}#gallery-list small{font-size:max(9px,.8cqw)}.unit-skill-guide p{font-size:max(10px,.9cqw)!important}.gallery-preview{grid-template-rows:auto minmax(80px,1fr) auto minmax(0,35%) auto}.preview-controls{gap:.4cqw;font-size:max(10px,.85cqw)}}

/* Aligned terminal controls: toggle / label+slider / next-track. */
.menu-dialog .audio-controls{display:grid;grid-template-columns:9em minmax(0,230px) 7em;gap:20px;justify-content:start}
.menu-dialog .audio-controls label{display:grid;grid-template-columns:4.5em minmax(0,150px);gap:12px;align-items:center;white-space:nowrap}
.menu-dialog .audio-controls input{width:100%;max-width:100%;margin:0}
.defense-line-icon{filter:brightness(0) invert(1)}
@media(max-width:700px){.menu-dialog .audio-controls{grid-template-columns:7.5em minmax(0,1fr) 6em;gap:10px}.menu-dialog .audio-controls label{grid-template-columns:4.5em minmax(0,1fr);gap:8px}}

.menu-dialog .audio-controls button{white-space:nowrap}

/* Header segments share a single centerline; icon boxes do not set a baseline. */
.command-bar{line-height:1.1}
#stage-label,.command-bar>.defense{display:inline-flex;align-items:center;gap:.45cqw;line-height:1.1}
#stage-icon{display:inline-grid;place-items:center;width:1.45cqw;height:1.65cqw;line-height:1;font-size:1.4cqw}
#stage-name,.defense-label,#defense{line-height:1.1}
.defense-label{display:inline-flex;align-items:center;gap:.35cqw}
.defense-line-icon{display:block;width:1.15cqw;height:1.35cqw;flex:none}

/* BUILD31: scale the symbol with its real button in narrow battle containers. */
@container (max-width:999px){
  .supports button b{position:absolute;inset:0;display:grid;place-items:center;line-height:1;pointer-events:none}
  .supports button b img{width:min(34px,3.4cqw);height:min(34px,3.4cqw)}
  .supports button kbd{z-index:1}
  .game .fairy-hud{left:max(1.5%,7px)}
}

/* BUILD31 compact HUD: preserve the percentage scale on narrow battlefields. */
@container (max-width:999px){
  .game .hoc-slot{width:4.8cqw;height:4.8cqw;min-width:0;min-height:0}
  .game .hoc-slot .empty-hoc{font-size:.68cqw;line-height:1}
  .game .fairy-hud{width:6.5cqw}
  .game .fairy-hud-charges{font-size:.85cqw}
  .game .fairy-hud-timer{font-size:1.25cqw}
  .game .fairy-hud-name{font-size:.8cqw}
  .game .fairy-hud-key{font-size:.8cqw;min-width:0;padding:0;line-height:1}
  .game .fairy-hud-active{font-size:.75cqw;top:calc(100% + .2cqw)}
}

/* Keep the readable hover explanation inside the shortest compact frames. */
@container (max-width:480px){
  .game .fairy-hud-tooltip{width:min(280px,calc(100cqw - 60px));top:-4cqw}
}

/* Paused battle settings remain reachable; the rest of the battlefield stays blocked. */
.game.battle-is-paused .menu-open,.game.battle-is-paused .debug-speed{z-index:21}


/* BUILD42 feedback: archive controls stay aligned on one row. */
.gallery-preview{grid-template-rows:auto minmax(0,1fr) auto minmax(0,32%)}
.preview-controls{display:flex;flex-wrap:nowrap;align-items:center;gap:max(4px,.5cqw);min-width:0;overflow-x:auto;overflow-y:hidden;padding:.25cqw 0;font-size:max(10px,.85cqw)}
.gallery-preview .preview-controls label{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex:none;gap:max(3px,.4cqw);width:auto;min-height:0;margin:0;line-height:1;white-space:nowrap}
.preview-controls label:first-child{flex:0 1 34%;min-width:110px}
.preview-controls select,.preview-controls button{box-sizing:border-box;align-self:center;height:max(28px,2.6cqw);min-height:28px;margin:0;padding:0 max(5px,.5cqw);line-height:normal;white-space:nowrap;font-size:inherit}
.preview-controls button{flex:none}
#preview-animation{flex:1;min-width:74px;width:12cqw;max-width:100%;text-overflow:ellipsis}
#preview-speed{width:4.2cqw;min-width:45px}
@media(max-width:800px){.gallery-preview{grid-template-rows:auto minmax(80px,1fr) auto minmax(0,35%)}}
