#n16-pve[hidden]{display:none!important}
#n16-pve{position:fixed;inset:0;z-index:3000;background:rgba(5,10,17,.94);color:#f1e6ce;font-family:system-ui,sans-serif;display:flex;flex-direction:column;gap:8px;padding:12px;box-sizing:border-box;overflow:auto}
#n16-pve *{box-sizing:border-box}#n16-pve h2{margin:0;font-size:20px;color:#e9c980}#n16-pve .n16-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
#n16-pve .n16-stage{display:flex;align-items:flex-start;justify-content:center;gap:14px;flex:1;min-height:0;flex-wrap:wrap}
#n16-pve .n16-board{width:min(85vw,960px);max-height:calc(100vh - 170px);aspect-ratio:1448/1086;background:#141a13;border:2px solid #988157;border-radius:8px;overflow:hidden;display:flex;align-items:center;justify-content:center}
#n16-pve svg{width:100%;height:100%;display:block;touch-action:manipulation;user-select:none}#n16-pve .n16-side{width:min(340px,92vw);max-height:calc(100vh - 166px);overflow:auto;background:#161d28;border:1px solid #6b5c46;border-radius:9px;padding:12px;display:flex;flex-direction:column;gap:9px}
#n16-pve button{border-radius:6px;border:1px solid #a68b4f;background:#292d31;color:#f8e4b3;padding:8px 10px;cursor:pointer;font-weight:700}#n16-pve button:disabled{opacity:.4;cursor:not-allowed}#n16-pve button:focus-visible{outline:2px solid #e9c980}#n16-pve button[aria-pressed=true]{background:#6a5421}
#n16-pve .n16-spells{display:grid;grid-template-columns:1fr 1fr;gap:5px}#n16-pve .n16-unit{font-size:13px;padding:5px;border-bottom:1px solid #50483c}
#n16-pve .n16-active{background:#23424c}#n16-pve .n16-log{font-size:12px;max-height:160px;overflow:auto;line-height:1.5;background:#0c1219;padding:8px;border-radius:5px}#n16-pve .n16-chip{font-size:12px;color:#bcbab3}
#n16-pve .n16-foot{font-size:12px;color:#e2b77d}#n16-pve polygon{cursor:pointer}#n16-pve .n16-controlrow{display:flex;gap:6px;flex-wrap:wrap}#n16-pve .n16-position-label{text-anchor:middle;font-size:14px;font-weight:800;paint-order:stroke;stroke:rgba(5,8,9,.8);stroke-width:3px;pointer-events:none}
@media (max-width:1150px){#n16-pve .n16-board{width:min(95vw,780px);max-height:none}#n16-pve .n16-side{max-height:none;width:min(780px,95vw)}#n16-pve{overflow:auto}}

/* N2.7: nonblocking, accessible cooperative PvE invitation; no overlay over movement. */
#n27-pve-coop-invite:not([hidden]){position:fixed;z-index:10012;top:18px;right:18px;width:min(350px,calc(100vw - 36px));box-sizing:border-box;padding:14px 16px;background:#101419;color:#f1e8d0;border:1px solid #b99a56;border-radius:10px;box-shadow:0 8px 28px #000b;font-family:inherit;}
#n27-pve-coop-invite .n27-coop-title{display:block;color:#ecd08d;font-size:1rem;}
#n27-pve-coop-invite .n27-coop-description{line-height:1.4;font-size:.88rem;}
#n27-pve-coop-invite .n27-coop-actions{display:flex;gap:8px;flex-wrap:wrap;}
#n27-pve-coop-invite button{background:#26211b;border:1px solid #af9157;color:#f3e3b6;border-radius:6px;padding:7px 11px;cursor:pointer;}
#n27-pve-coop-invite button:focus-visible{outline:3px solid #f1cd78;outline-offset:2px;}

/* N3.7 isolated arena: presentation only; canonical map and hitboxes are untouched. */
body.n37-combat-active #game-shell,body.n37-combat-active #hud-root,body.n37-combat-active .caelytte-monster-groups-layer,body.n37-combat-active .caelytte-monster-groups-tooltip,body.n37-combat-active #n28-trade-panel,body.n37-combat-active #n28-battle-markers{visibility:hidden!important;pointer-events:none!important}
#n16-pve{z-index:20020;background:#080c14!important;padding:12px 16px;gap:10px;overscroll-behavior:contain}
#n16-pve .n37-heading{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:8px 15px;background:#131c2a;border:1px solid #84734c;border-radius:8px}
#n16-pve .n37-main{display:grid;grid-template-columns:minmax(190px,245px) minmax(0,1fr);gap:12px;min-height:0;flex:1}
#n16-pve .n37-roster{min-width:0;display:flex;flex-direction:column;gap:7px;overflow-y:auto;background:#101823;border:1px solid #897450;border-radius:9px;padding:10px}
#n16-pve h3{margin:3px 0;color:#f1d693;font:700 15px Georgia,serif;letter-spacing:.07em}
#n16-pve .n37-arena{min-width:0;display:flex;align-items:center;flex-direction:column;gap:8px;overflow-y:auto;background:#0f1721;border:1px solid #756545;border-radius:9px;padding:8px}
#n16-pve .n37-board-zone{display:flex;justify-content:center;align-items:center;min-height:0;width:100%}
#n16-pve .n16-board{width:min(100%,930px);height:auto;max-height:min(63vh,720px);flex-shrink:0}
#n16-pve .n37-fighter{width:100%;display:flex;align-items:center;gap:8px;text-align:left;padding:6px;background:#1c2933;border:1px solid #43525b;color:#e8e4d4}
#n16-pve .n37-fighter.is-active,#n16-pve .n37-order-item.is-active{border-color:#ffd67d;box-shadow:inset 0 0 0 1px #e7c47d,0 0 10px #d8a84955}
#n16-pve .n37-fighter.is-selected{background:#283d54}
#n16-pve .is-dead{filter:grayscale(1);opacity:.48}
#n16-pve .n37-portrait{flex:0 0 auto;display:grid;place-items:center;width:42px;height:42px;background:#151b21;border:1px solid #b6a26d;border-radius:8px;overflow:hidden;color:#e7c77d;font-size:24px}
#n16-pve .n37-portrait img{width:100%;height:100%;object-fit:contain}
#n16-pve .n37-fighter-text{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0;font-size:11px}
#n16-pve .n37-fighter-text strong{font-size:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#n16-pve .n37-hp-meter{display:block;height:7px;border:1px solid #4b3840;background:#351f27;border-radius:6px;overflow:hidden}
#n16-pve .n37-hp-fill{display:block;height:100%;background:linear-gradient(90deg,#a43f47,#e17d73)}
#n16-pve .n37-initiative{width:100%;max-width:1040px;display:flex;align-items:center;justify-content:center;gap:5px;overflow-x:auto;min-height:74px;background:#0a101a;padding:5px;border-radius:8px;border:1px solid #4d4b43}
#n16-pve .n37-order-item{position:relative;display:flex;flex:0 0 68px;align-items:center;flex-direction:column;min-width:65px;padding:4px 2px;gap:3px;font-size:10px}
#n16-pve .n37-order-item .n37-portrait{width:34px;height:34px}
#n16-pve .n37-order-item small{font-size:9px;overflow:hidden;max-width:63px;text-overflow:ellipsis;white-space:nowrap}
#n16-pve .n37-order-number{position:absolute;left:3px;top:1px;font-size:10px;color:#efd58d}
#n16-pve .n37-turn-toolbar{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px;padding:4px 6px}
#n16-pve .n37-art-bar{display:grid;width:min(100%,850px);grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}
#n16-pve .n37-art-slot{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;height:91px;overflow:hidden;padding:5px 3px;border:1px solid #6e624a;background:#171c27}
#n16-pve .n37-art-slot img{height:51px;width:100%;max-width:64px;object-fit:contain}
#n16-pve .n37-art-slot.is-selected{outline:2px solid #f9d57e;outline-offset:-3px;background:#34414f}
#n16-pve .n37-art-number{position:absolute;top:1px;left:5px;font-size:10px;color:#fce4a2;text-shadow:0 1px 2px black}
#n16-pve .n37-art-title{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:9px}
#n16-pve .n37-art-cost{font-size:9px;color:#ffe4a4}
#n16-pve .n37-empty-art{font-size:28px;color:#675e54;padding-top:17px}
#n16-pve .n37-history{margin-top:auto;background:#0b121b;border:1px solid #574a38;border-radius:8px;min-height:85px;max-height:200px;display:flex;flex-direction:column}
#n16-pve .n37-history.is-large{max-height:min(45vh,460px)}#n16-pve .n37-history.is-collapsed{min-height:0;max-height:39px}
#n16-pve .n37-history-top{display:flex;justify-content:space-between;align-items:center;gap:3px;padding:4px 6px;font-size:10px}
#n16-pve .n37-history-top button{padding:3px 5px;font-size:10px}
#n16-pve .n37-history-messages{overflow-y:auto;padding:6px;font-size:11px;line-height:1.5;min-height:0}
#n16-pve .n37-history-messages>div{border-top:1px solid #ffffff14;padding:3px 0}
#n16-pve .n37-history.is-collapsed .n37-history-messages{display:none}
#n16-pve .n37-sheet{position:fixed;right:22px;top:75px;z-index:12;width:min(370px,calc(100vw - 30px));max-height:80vh;overflow-y:auto;background:#171f29;border:2px solid #c3a86b;border-radius:10px;padding:14px;box-shadow:0 15px 48px #000b}
#n16-pve .n37-sheet-top{display:flex;align-items:center;gap:10px}#n16-pve .n37-sheet-top h3{flex:1}#n16-pve .n37-sheet-top button{font-size:21px}
#n16-pve .n37-sheet-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:10px 0}
#n16-pve .n37-sheet-metrics>div{display:flex;flex-direction:column;gap:2px;padding:6px;background:#222e36;border-radius:5px}
#n16-pve .n37-sheet-metrics small{color:#d1c39c}#n16-pve .n37-sheet-effects{padding:4px 6px;border-top:1px solid #665740}
#n16-pve .n37-sheet-effects>div{padding:4px 0;font-size:12px}
#n16-pve .n37-error{font-size:12px;color:#f8ad88}
#n16-pve .n37-result{width:min(1120px,100%);margin:auto;display:flex;flex-direction:column;align-items:center;gap:15px;min-height:0;padding:22px;background:linear-gradient(150deg,#111c29,#191a20);border:2px solid #b89c61;border-radius:12px;overflow-y:auto}
#n16-pve .n37-result>h2{font:700 clamp(32px,6vw,64px) Georgia,serif;color:#f6d890;text-shadow:0 3px 12px #000}
#n16-pve .n37-result-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;width:100%}
#n16-pve .n37-result-team{min-width:0;padding:12px;background:#141d28;border:1px solid #63563e;border-radius:8px}
#n16-pve .n37-result-fighter{display:flex;gap:10px;align-items:flex-start;border-top:1px solid #ffffff29;padding:10px 0}
#n16-pve .n37-result-fighter>div{display:flex;gap:6px;flex-direction:column;min-width:0;word-break:break-word;font-size:12px}
#n16-pve .n37-exp-track{height:12px;width:min(300px,100%);border:1px solid #a88d62;background:#1b2639;border-radius:7px;overflow:hidden}
#n16-pve .n37-exp-animated{height:100%;width:0;background:linear-gradient(90deg,#6391ff,#b5c8ff);animation:n37-exp-awarded 1.35s ease-out forwards}
@keyframes n37-exp-awarded{to{width:100%}}
#n16-pve .n37-loot{display:flex;flex-wrap:wrap;gap:6px}#n16-pve .n37-loot-item{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:4px 6px;background:#202c32;border:1px solid #736348;border-radius:5px}
#n16-pve .n37-loot-item img{width:31px;height:31px;object-fit:contain}
@media (max-width:1100px){#n16-pve .n37-main{grid-template-columns:1fr}#n16-pve .n37-roster{max-height:24vh;flex-direction:row;flex-wrap:wrap;align-content:start}#n16-pve .n37-roster>h3{width:100%}#n16-pve .n37-roster>.n37-fighter{width:min(47%,210px)}#n16-pve .n37-roster .n37-history{flex:1;min-width:220px}#n16-pve .n16-board{max-height:unset;width:min(100%,900px)}}
@media (max-width:650px){#n16-pve{padding:5px}#n16-pve .n37-roster{max-height:140px}#n16-pve .n37-order-item{min-width:46px;flex-basis:49px}#n16-pve .n37-art-slot{height:71px}#n16-pve .n37-art-slot img{height:36px}#n16-pve .n37-result-columns{grid-template-columns:1fr}#n16-pve .n37-sheet{right:8px;top:50px}}
@media (prefers-reduced-motion:reduce){#n16-pve .n37-exp-animated{animation:none;width:100%}}

/* N3.7 damage/healing/shield text: snapshot-derived only. */
#n16-pve .n37-feedback-float{font-size:21px;font-weight:800;stroke:#070e16;stroke-width:4px;paint-order:stroke;pointer-events:none;animation:n37-confirmed-float 1.5s ease-out both}@keyframes n37-confirmed-float{from{opacity:0;transform:translateY(4px)}25%{opacity:1}to{opacity:0;transform:translateY(-19px)}}

/* N3.7.1 | Board-first responsive composition, official 21x21 projection untouched. */
#n16-pve:not([hidden]){display:grid;grid-template-rows:minmax(0,1fr) auto;gap:8px;padding:10px;background:#080e14!important;overflow:hidden;height:100dvh;min-height:0}
#n16-pve .n371-layout{display:grid;grid-template-columns:clamp(204px,18vw,288px) minmax(0,1fr);gap:8px;min-height:0;max-height:100%;height:100%;overflow:hidden}
#n16-pve .n371-sidebar{display:flex;flex-direction:column;min-width:0;min-height:0;gap:8px;overflow:hidden}
#n16-pve .n37-heading{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:3px;flex-wrap:nowrap;flex:0 0 auto;padding:10px 12px;border:1px solid #86693b;background:#0d141b;box-shadow:inset 0 0 15px #bc8c2420;border-radius:8px;min-height:57px}
#n16-pve .n37-heading strong{color:#f0d48a;font:700 clamp(15px,1.35vw,22px) Georgia,serif}
#n16-pve .n37-heading span{color:#e6d6ae;font-size:clamp(10px,1vw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#n16-pve .n37-roster{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;width:100%;max-height:min(69%,calc(100% - 145px));overflow-x:hidden;overflow-y:auto;padding:7px;gap:5px;border:1px solid #8c7244;background:#111924;border-radius:8px;align-content:initial}
#n16-pve .n37-roster h3{margin:2px 6px 5px;font-size:13px}
#n16-pve .n37-fighter{position:relative;min-width:0;min-height:78px;width:100%;margin:0;display:flex;gap:7px;padding:6px 6px 6px 18px;border-color:#665335;background:#151e28}
#n16-pve .n37-fighter-text{gap:3px;font-size:11px}
#n16-pve .n37-fighter-text strong{font-size:clamp(10px,.83vw,13px)}
#n16-pve .n37-portrait{width:clamp(38px,3.3vw,55px);height:clamp(44px,4vw,60px);border:1px solid #ab8d54;border-radius:5px}
#n16-pve .n371-roster-number{position:absolute;left:4px;top:5px;color:#f3d594;font-size:11px}
#n16-pve .n371-ko{font-weight:800;color:#ff9c98;font-size:10px}
#n16-pve .n371-resource{position:relative;display:flex;align-items:center;gap:4px;width:100%;min-width:0;height:14px;color:#f8edda;line-height:1}
#n16-pve .n371-resource-symbol{width:20px;flex:0 0 20px;font-size:9px;font-weight:900;text-align:center}
#n16-pve .n371-resource-track{position:relative;flex:1;min-width:0;height:11px;background:#171b20;border:1px solid #807258;border-radius:7px;overflow:hidden}
#n16-pve .n371-resource-fill{display:block;height:100%;width:0;transition:width 180ms ease-out;background:linear-gradient(90deg,#b73c4b,#ec6d79)}
#n16-pve .n371-resource-en .n371-resource-fill{background:linear-gradient(90deg,#1b62b7,#39a8ff)}
#n16-pve .n371-resource-mv .n371-resource-fill{background:linear-gradient(90deg,#bb812e,#f3cb65)}
#n16-pve .n371-resource-value{flex:0 0 40px;width:40px;font-size:10px;text-align:right;font-variant-numeric:tabular-nums;color:#eee2ce}
#n16-pve .n37-history{margin-top:auto;min-height:90px;max-height:clamp(96px,26vh,220px);flex:0 1 205px;overflow:hidden;resize:vertical;background:#10161d;border:1px solid #907044;border-radius:7px}
#n16-pve .n37-history.is-large{max-height:62vh;flex:1 1 300px}
#n16-pve .n37-history.is-collapsed{flex:0 0 35px;min-height:35px;max-height:35px;resize:none}
#n16-pve .n37-arena{min-height:0;min-width:0;max-height:100%;width:100%;overflow:hidden;display:flex;align-items:center;justify-content:center;flex-direction:column;background:transparent;border:none;padding:0;gap:0}
#n16-pve .n37-board-zone{position:relative;display:flex;flex:1 1 auto;align-items:center;justify-content:center;min-height:0;max-height:100%;height:100%;width:100%;overflow:hidden}
#n16-pve .n16-board{position:relative;flex:0 1 auto;width:auto;height:100%;max-width:100%;max-height:100%;min-height:0;aspect-ratio:1448/1086;border:none;border-radius:0;background:transparent;overflow:hidden;display:block;filter:drop-shadow(0 2px 12px #000c)}
#n16-pve .n16-board svg{display:block;aspect-ratio:1448/1086;width:100%;height:100%;user-select:none;touch-action:manipulation}
#n16-pve .n371-board-tip[hidden]{display:none!important}
#n16-pve .n371-board-tip{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);pointer-events:none;z-index:2;border:1px solid #94794d;background:#0d1625e8;color:#f4e0a8;border-radius:5px;padding:4px 8px;font-size:11px;white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis}
#n16-pve polygon[data-legal-move="true"]{cursor:crosshair}
#n16-pve .n371-footer{display:grid;grid-template-columns:clamp(180px,21vw,320px) minmax(0,1fr) auto;align-items:center;gap:9px;flex:0 0 auto;width:100%;min-width:0;min-height:103px;padding:5px 8px;background:linear-gradient(180deg,#111821,#070c12);border:1px solid #90703d;border-radius:9px;box-shadow:0 -8px 24px #0007}
#n16-pve .n371-self{display:flex;align-items:center;min-width:0;gap:8px}
#n16-pve .n371-self .n371-self-portrait{width:clamp(55px,6vw,88px);height:clamp(68px,7vw,94px);flex-shrink:0}
#n16-pve .n371-self-resources{display:flex;flex:1;flex-direction:column;min-width:0;gap:4px}
#n16-pve .n371-self-resources>strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:clamp(11px,1.08vw,15px)}
#n16-pve .n371-self-resources .n371-resource{height:17px}
#n16-pve .n371-self-resources .n371-resource-track{height:14px}
#n16-pve .n371-footer-center{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}
#n16-pve .n37-art-bar{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:clamp(2px,.4vw,7px);width:100%;max-width:none}
#n16-pve .n37-art-slot{min-width:0;height:clamp(74px,8.8vh,100px);padding:5px 2px 3px;gap:1px;border:1px solid #9e8047;background:#101824;border-radius:6px}
#n16-pve .n37-art-slot img{display:block;max-width:min(100%,65px);width:100%;height:clamp(38px,5.6vh,61px);object-fit:contain}
#n16-pve .n37-art-title{font-size:9px}
#n16-pve .n37-art-cost{font-size:10px}
#n16-pve .n371-footer-actions{display:flex;flex-direction:column;gap:7px;align-items:stretch;min-width:clamp(118px,14vw,238px)}
#n16-pve .n371-footer-actions button:first-child{min-height:46px;border:1px solid #c09a52;background:linear-gradient(180deg,#402b13,#20160f);color:#f7e1ab;font-size:clamp(11px,1vw,15px)}
#n16-pve .n371-footer-actions button:last-child{font-size:10px;padding:4px 7px;min-height:24px;opacity:.78}
#n16-pve .n371-prepare-help{text-align:center;margin:0;font-size:12px;color:#e9d5a3}
#n16-pve .n371-prep-actions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap}
#n16-pve .n371-prep-actions button{font-size:14px;padding:8px 13px}
#n16-pve .n371-prep-actions select{min-height:35px;min-width:140px;background:#121c28;color:#f4e2b9;border:1px solid #947747;border-radius:5px}
#n16-pve .n37-sheet{z-index:20021}
@media(max-width:1000px){#n16-pve:not([hidden]){gap:5px;padding:5px}#n16-pve .n371-layout{grid-template-columns:clamp(154px,21vw,215px) minmax(0,1fr);gap:5px}#n16-pve .n37-roster{max-height:59%}#n16-pve .n37-roster>.n37-fighter{width:100%}#n16-pve .n371-footer{grid-template-columns:clamp(140px,21vw,200px) minmax(0,1fr) auto;padding:4px;gap:5px}#n16-pve .n371-self .n371-self-portrait{width:46px;height:54px}#n16-pve .n371-resource-value{width:33px;flex-basis:33px;font-size:9px}#n16-pve .n371-footer-actions{min-width:94px}#n16-pve .n37-art-slot{height:74px}}
@media(max-width:680px){#n16-pve:not([hidden]){grid-template-rows:minmax(0,1fr) auto}#n16-pve .n371-layout{grid-template-columns:128px minmax(0,1fr)}#n16-pve .n37-heading{padding:5px;min-height:44px}#n16-pve .n37-heading strong{font-size:12px}#n16-pve .n37-heading span{font-size:9px}#n16-pve .n37-roster{padding:3px;max-height:60%}#n16-pve .n37-fighter{min-height:50px;padding:4px 3px 4px 10px;gap:2px}#n16-pve .n37-portrait{height:34px;width:28px}#n16-pve .n37-fighter-text strong{font-size:9px}#n16-pve .n37-fighter-text .n371-resource{height:10px}#n16-pve .n371-resource-symbol{display:none}#n16-pve .n371-resource-value{font-size:8px;flex-basis:29px;width:29px}#n16-pve .n37-history{flex-basis:125px}#n16-pve .n371-footer{grid-template-columns:minmax(0,1fr) auto;gap:3px}#n16-pve .n371-self{grid-column:1/-1;gap:5px}#n16-pve .n371-self .n371-self-portrait{width:35px;height:36px}#n16-pve .n371-self-resources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}#n16-pve .n371-self-resources>strong{grid-column:1/-1;font-size:10px}#n16-pve .n37-art-slot{height:56px;padding:2px 1px}#n16-pve .n37-art-slot img{height:32px}#n16-pve .n37-art-title{display:none}#n16-pve .n37-art-cost{font-size:8px}#n16-pve .n371-footer-actions{min-width:75px}#n16-pve .n371-footer-actions button:first-child{min-height:33px;font-size:9px;padding:2px}}
@media(prefers-reduced-motion:reduce){#n16-pve .n371-resource-fill{transition:none}}

/* Roster rows are now the sole initiative surface; keep n37-order-item as a backward-compatible test/accessibility hook. */
#n16-pve .n37-roster .n37-fighter.n37-order-item{position:relative;display:flex;flex:0 0 auto;flex-direction:row;align-items:center;min-width:0;min-height:78px;width:100%;gap:7px;padding:6px 6px 6px 18px;text-align:left}
@media(max-width:680px){#n16-pve .n37-roster .n37-fighter.n37-order-item{min-height:50px;padding:4px 3px 4px 10px;gap:2px}}

/* N3.7.1 correction: preserve canonical 1448:1086 projection at every viewport;
   never clamp width and height independently (that deforms hitboxes). */
#n16-pve .n16-board{width:min(100%,calc(133.333dvh - 181px));height:auto;max-width:100%;max-height:100%;min-height:0;aspect-ratio:1448 / 1086;flex:0 1 auto}
#n16-pve .n16-board svg{width:100%;height:auto;aspect-ratio:1448 / 1086}


/* N3.7.4.2: luminous equipped Art selection, shield meters and active fighter. */
#n16-pve .n37-art-slot.is-selected{border:2px solid #ffdf68!important;outline:2px solid #ffea9a!important;outline-offset:1px;box-shadow:0 0 9px #ffcc42,0 0 17px #dba62e7f,inset 0 0 9px #ffd77850!important}
#n16-pve .n3742-active-indicator{fill:#ffe39a;font:bold 24px Georgia,serif;paint-order:stroke;stroke:#39240b;stroke-width:2;filter:drop-shadow(0 0 4px #f9c954)}
#n16-pve .n371-resource-shield .n371-resource-fill{background:linear-gradient(90deg,#7641bc,#d7a7ff)!important}
#n16-pve .n37-feedback-float{font-weight:900;paint-order:stroke;stroke:#121523;stroke-width:2.5px;pointer-events:none}

/* N3.7.4.3 — Combat inspection only; no board geometry/style layout changes. */
#n16-pve .n3743-defenses{border-top:1px solid #665740;padding:8px 6px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
#n16-pve .n3743-defenses h4{grid-column:1/-1;margin:0 0 5px;color:#e8d1a3}
#n16-pve .n3743-defense{font-size:12px;color:#d6e7dc;background:#1a2730;padding:6px;border-radius:4px}
#n16-pve .n3743-defense.is-weak{color:#ff9999;background:#361d23}
#n16-pve .n3743-effect.buff{color:#87dda5}
#n16-pve .n3743-effect.debuff{color:#ff9696}
#n16-pve .n3743-effect.shield{color:#d9adff}

/* N3.7.4.7 battle-local chat; messages are textContent, never HTML. */
.n3747-chat-entry{font-size:12px;color:#e4d5ab;border-left:2px solid #6696c3;padding-left:5px;margin:3px 0}
.n3747-chat-entry strong{color:#9dccf0}
.n3747-battle-chat{display:flex;margin-top:5px;gap:4px;min-height:27px}
.n3747-battle-chat input{flex:1;min-width:0;font-size:12px;background:#101b24;border:1px solid #806637;color:#fff3dc;border-radius:4px;padding:5px}

/* N3.7.4.8: retained, accessible roster header and user-controlled chat sizing. */
#n16-pve .n3748-roster-header{display:flex;align-items:center;justify-content:space-between;gap:5px}
#n16-pve .n3748-roster-header h3{margin:0}
#n16-pve .n3748-roster-header button{border:1px solid #907044;color:#fce4ae;background:#131b24;border-radius:4px;font-size:10px;padding:3px}
#n16-pve .n3748-roster-collapsed{min-height:35px;flex:0 0 auto;overflow:visible}
#n16-pve .n3748-resize-handle{font-size:16px;touch-action:none;cursor:nwse-resize;min-width:24px}
#n16-pve .n37-history{resize:none;max-width:min(55vw,850px);overflow:hidden}
#n16-pve .n37-history-messages{flex:1 1 auto;overscroll-behavior:contain}
#n16-pve .n3747-battle-chat{flex-shrink:0}

/* N3.7.4.8 LAB: CD is read from each SERVER snapshot; never counted locally. */
#n16-pve .n37-art-slot.is-cooling img{filter:grayscale(1) brightness(.35)}
#n16-pve .n37-art-slot.is-cooling{background:#080b11;border-color:#525962;opacity:1}
#n16-pve .n3748-cooldown{position:absolute;inset:4px 4px 17px;display:flex;align-items:center;justify-content:center;pointer-events:none;color:#fff;font-size:clamp(19px,2.5vw,29px);font-weight:900;text-shadow:0 1px 4px #000,0 0 10px #000;background:#090b10a9;border-radius:4px;z-index:2}
#n16-pve .n3748-charge{position:absolute;right:1px;bottom:1px;font-size:9px;color:#e7dbaa;background:#1b1b2ad9;padding:1px 3px;border-radius:3px;z-index:3;pointer-events:none}
#n16-pve .n3748-charge.ready{background:#735812;color:#fff0a5}
#n16-pve .n3748-combat-receipt{white-space:normal;overflow-wrap:anywhere}

/* N3.7.4.8 polish: history content scrolls, composer stays pinned; JS owns anchoring. */
#n16-pve .n37-history-messages{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-anchor:none;}
#n16-pve .n3747-battle-chat{flex:0 0 auto;}

/* LAB01 — Alternancia visual durante preparación, turno y multijugador; no cambia SVG/CTM. */
#n16-pve .n37-arena{position:relative}
#n16-pve .lab01-board-toggle{position:absolute;right:clamp(8px,1.4vw,18px);top:clamp(8px,1.2vw,14px);z-index:30;display:inline-flex;align-items:center;justify-content:center;min-height:38px;min-width:114px;padding:8px 12px;background:#151e29ee;color:#ffe3aa;border:1px solid #d5a94e;border-radius:7px;font-weight:700;font-size:12px;box-shadow:0 3px 12px #0009;cursor:pointer;touch-action:manipulation}
#n16-pve .lab01-board-toggle:hover{background:#28394a;color:#fff4cc}
#n16-pve .lab01-board-toggle:focus-visible{outline:3px solid #87d0f2;outline-offset:3px}
#n16-pve .lab01-board-toggle[aria-pressed='true']{border-color:#8cd4fa;color:#dcf4ff}
@media(max-width:680px){#n16-pve .lab01-board-toggle{right:5px;top:5px;min-height:31px;min-width:98px;padding:4px 6px;font-size:10px}}

/* LAB02: botón independiente, visible BAJO RONDA, visual del HUD plateado/dorado.
   Nunca interceptar los gestos de cámara fuera de su rectángulo. */
#n16-pve .lab01-board-toggle{
 position:fixed!important;top:clamp(108px,15vh,126px)!important;right:clamp(12px,1.5vw,24px)!important;
 left:auto!important;bottom:auto!important;z-index:1000!important;
 display:flex!important;align-items:center;justify-content:center;
 width:clamp(145px,12vw,190px)!important;min-height:50px!important;
 padding:10px 14px!important;
 color:#f7e9c8!important;font:700 clamp(13px,1vw,15px) Georgia,serif!important;
 letter-spacing:.025em;text-shadow:0 1px 2px #000d;
 background:linear-gradient(145deg,#17222ddd,#090e15bd)!important;
 border:1px solid #98835c!important;border-radius:13px!important;
 box-shadow:inset 0 1px 0 #c2a97550,0 7px 19px #0009!important;
 backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
 opacity:1!important;visibility:visible!important;cursor:pointer!important;
}
#n16-pve .lab01-board-toggle:hover{background:linear-gradient(145deg,#273a47ee,#151e2ee8)!important;border-color:#e7c579!important}
#n16-pve .lab01-board-toggle[aria-pressed='true']{border-color:#8abfd6!important;color:#e3f5ff!important}
#n16-pve .lab01-board-toggle:focus-visible{outline:3px solid #8bd6ff!important;outline-offset:3px!important}
@media(max-width:680px){#n16-pve .lab01-board-toggle{top:69px!important;right:7px!important;width:126px!important;min-height:37px!important;padding:5px!important;font-size:11px!important}}

/* LAB03 F1 — Fixed sibling of arena, not under arena's board/scroll/stacking context. */
#n16-pve>.lab01-board-toggle{
 position:fixed!important;top:114px!important;right:16px!important;z-index:20024!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 padding:12px 18px!important;width:clamp(152px,12vw,190px)!important;
 min-height:50px!important;cursor:pointer!important;pointer-events:auto!important;
 background:linear-gradient(145deg,rgba(21,30,41,.90),rgba(10,14,21,.86))!important;
 border:1px solid #bba069!important;border-radius:12px!important;color:#ffe9bd!important;
 box-shadow:0 8px 22px #0009!important;backdrop-filter:blur(6px);
 font:700 15px Georgia,serif!important;
}
#n16-pve>.lab01-board-toggle:hover{background:#304251ee!important;border-color:#e9c57f!important}
#n16-pve>.lab01-board-toggle:focus-visible{outline:3px solid #8ad4f6!important}
@media(max-width:680px){#n16-pve>.lab01-board-toggle{top:67px!important;right:7px!important;width:125px!important;min-height:38px!important;padding:6px 8px!important;font-size:12px!important}}

/* P09: elemental resistance boxes with white readable lettering. */
#n16-pve .n3743-defense{font-size:15px!important;font-weight:700!important;color:#fff!important;text-shadow:0 1px 2px #000a!important;padding:8px 9px!important}
#n16-pve .n3743-defense.p09-res-earth{background:#775238!important}
#n16-pve .n3743-defense.p09-res-fire{background:#aa4333!important}
#n16-pve .n3743-defense.p09-res-water{background:#286c9d!important}
#n16-pve .n3743-defense.p09-res-air{background:#317b55!important}
#n16-pve .p09-damage-preview text{paint-order:stroke;stroke:#091017;stroke-width:2px;pointer-events:none}
#n16-pve .n37-feedback-float{font-size:24px!important;stroke-width:4px!important;font-weight:900!important}

/* P09 FIX3: smaller, readable damage feedback (enemy and player). */
#n16-pve .n37-feedback-float{font-size:20px}
