.coop-shell{position:absolute;inset:0;z-index:65;overflow:auto;padding:clamp(18px,3cqh,36px) 5%;background:radial-gradient(ellipse at 75% 25%,#284546,#102329 70%);color:#e4e8d8;display:flex;flex-direction:column;gap:16px}
.coop-shell[hidden],.coop-shell [hidden],.coop-hud[hidden],.coop-hud [hidden],.coop-connection[hidden]{display:none!important}
.coop-heading{flex:0 0 auto;border-bottom:1px solid #90b8ae44;padding-bottom:12px}.coop-heading h2{font-size:clamp(22px,4cqh,40px);margin:0 0 10px;color:#edb3bf}.coop-heading .eyebrow{margin-bottom:8px}.coop-heading p{min-height:1.5em;max-width:80ch;font-size:13px;margin:0;line-height:1.6;color:#bdd5cb}
.coop-menu{width:min(420px,100%);margin:auto;display:grid;gap:12px}.coop-menu>p{line-height:1.8}.coop-menu .primary-button,.coop-menu .subtle-button{width:100%;justify-content:center;min-height:46px}
.coop-shell button{cursor:pointer}.coop-shell button:disabled{cursor:default;opacity:.45}.coop-shell button:focus-visible,.coop-shell input:focus-visible,.coop-hud button:focus-visible{outline:3px solid #f6cf8e;outline-offset:3px}.coop-shell input{border:1px solid #a6c1b766;background:#0b1c22;color:#f3ecdc;padding:10px 12px;border-radius:4px;font:inherit;min-width:0;max-width:100%}.coop-menu form{display:grid;gap:14px}#coop-code{text-transform:uppercase;letter-spacing:.2em;font-size:24px}
/* v19.2: dark co-op surfaces need light labels in every interactive state. */
.coop-shell .subtle-button{color:#e9e3d7}
.coop-shell .subtle-button:hover{background:#35564e;border-color:#aebe9d}
.coop-shell .subtle-button:active:not(:disabled){background:#102329}
.coop-shell .subtle-button:disabled{background:transparent;border-color:#a5ada0}
#coop-lobby{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0}.coop-lobby-bar{display:flex;align-items:center;flex-wrap:wrap;gap:16px;font-size:12px}.coop-lobby-bar label{display:grid;gap:5px}.coop-lobby-bar input{width:220px}#coop-invite{margin-left:auto}#coop-room{font:700 23px var(--mono);color:#f3d897;letter-spacing:.08em}#coop-copy{min-height:36px;padding:8px 10px;font-size:12px}#coop-count{font:18px var(--mono)}
.coop-seats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;flex:1;min-height:190px}.coop-seat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;padding:14px 8px;background:#0e2027;border:1px solid #607c754d;color:#a8bdb4;border-radius:8px;font:inherit}.coop-seat:disabled{opacity:1!important}.coop-seat.own{border-color:var(--seat-accent,#abd9bc);box-shadow:inset 0 0 30px #a7d6b50a;background:#1b3438}.coop-seat strong{max-width:100%;overflow-wrap:anywhere;font-size:clamp(12px,1.7cqw,18px);color:#e2e8d9}.coop-seat-number{font:12px var(--mono);color:var(--seat-accent,#98b1a6);align-self:flex-start}.coop-seat canvas{max-width:100%;width:auto;height:clamp(76px,20cqh,180px);image-rendering:pixelated}.coop-seat small{font-size:10px;color:#a2b7ab}.coop-ready-state{color:#e8c48d;font-size:12px}
.coop-lobby-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:14px}.coop-lobby-actions button{min-height:44px;padding:12px 22px}#coop-picker{text-align:center}#coop-picker h3{margin:0}.coop-heroes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:16px auto;max-width:720px}.coop-hero{background:#172f34;border:1px solid #73968c;border-radius:7px;padding:12px;color:#d9e7da;display:flex;flex-direction:column;gap:8px;align-items:center}.coop-hero[aria-pressed=true]{border-color:#f3c98d;background:#31433e}.coop-hero canvas{max-width:100%;height:clamp(80px,22cqh,160px);width:auto;image-rendering:pixelated}.coop-hero small{font-size:11px}.coop-hero span{color:#adc6bb;font-size:12px}#coop-picker-done{min-width:180px;justify-content:center}#coop-result{margin:auto;max-width:750px;width:100%;text-align:center}#coop-results{padding:0;list-style:none;display:grid;gap:14px;margin:24px 0;font-size:14px;line-height:1.6}
.coop-hud{position:absolute;z-index:12;right:14px;top:132px;width:200px;pointer-events:none;font-size:11px;color:#e1e9dc}.coop-teammate{display:grid;grid-template-columns:30px minmax(0,1fr);gap:3px 7px;padding:5px 8px;background:#102329e8;border-left:2px solid #afd7c5;margin-bottom:4px}.coop-teammate canvas{grid-row:1/4;width:30px;height:35px;image-rendering:pixelated}.coop-teammate span{overflow-wrap:anywhere;font-size:11px}.coop-teammate progress{width:100%;height:5px;accent-color:#b6dfad}.coop-teammate small{font-size:9px;color:#c7d3bc}.coop-hud>p{background:#102329ed;padding:8px;font-size:12px;color:#f1d295}.coop-hud button{pointer-events:auto;float:right;background:#102329dc;color:#d2d9c6;border:1px solid #7a9c8c;padding:5px 12px;border-radius:3px;cursor:pointer}
.coop-connection{position:absolute;z-index:58;top:38px;left:50%;transform:translateX(-50%);max-width:80%;background:#3c3022ee;border:1px solid #e0bd84;color:#f3deaf;border-radius:5px;padding:10px 15px;font-size:12px;line-height:1.6}.coop-connection button{margin-left:10px;color:#f3deaf;background:#183039;border:1px solid #839688;padding:6px;cursor:pointer}
.coop-live-note{color:#efd29a!important;font-size:12px!important;line-height:1.7!important;margin:8px 0!important}.coop-menu-open #console-actions,.coop-menu-open #arena-message,.coop-menu-open .run-meta{visibility:hidden}body.coop-playing #death-content,body.coop-playing #win-content,body.coop-playing #restart-pause{display:none!important}body.coop-playing #pause-title{font-size:32px}body.coop-playing #pause-content h2 span{font-size:16px}
@media(max-width:720px){.coop-shell{padding:15px 4%;gap:10px}.coop-heading h2{font-size:22px}.coop-heading p{font-size:11px}.coop-seats{gap:6px}.coop-seat{padding:8px 4px;gap:6px}.coop-seat strong{font-size:11px}.coop-seat small{font-size:8px}.coop-lobby-bar{gap:7px}.coop-lobby-bar input{width:160px}.coop-lobby-actions{gap:7px}.coop-lobby-actions button{padding:9px 12px;font-size:12px}.coop-hud{width:160px;right:8px;top:118px}.coop-hero{padding:8px 3px}.coop-heroes{gap:7px}.coop-hero small{font-size:9px}}
.title-subactions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.title-subactions>.subtle-button{width:100%;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;margin:0;padding:4px 6px;height:37px;min-height:37px;font-size:12px;line-height:1.1}.title-subactions>.subtle-button span{font-size:8px}

/* v19.1 integration: source-derived fit rules; browser layout QA is pending. */
.title-actions>#multiplayer{min-height:44px;font-size:15px;line-height:1.4;white-space:normal}
.title-actions>#multiplayer span{font-size:11px}
.coop-shell{overscroll-behavior:contain;font-size:15px}
.coop-heading p,.coop-live-note{font-size:14px!important}
.coop-seat small,.coop-ready-state{font-size:12px}
.coop-connection{max-width:min(80%,680px);top:64px;font-size:14px}
.coop-hud{top:150px;max-height:calc(100% - 260px);overflow:auto}
.coop-hud[data-scrollable="true"]{pointer-events:auto;overscroll-behavior:contain}
.coop-hud:focus-visible{outline:3px solid #f6cf8e;outline-offset:-3px}
.help-content .coop-roster-entry{margin:12px 0 0;white-space:normal}
@media(max-height:620px){.coop-shell{padding:12px 4%;gap:8px}.coop-heading{padding-bottom:6px}.coop-seats{flex:none;min-height:150px}.coop-seat canvas{height:70px}.coop-hud{top:110px;max-height:calc(100% - 210px)}}
@media(max-width:720px){.coop-seats{grid-template-columns:repeat(2,minmax(0,1fr))}.coop-hud{width:150px}.coop-connection{max-width:90%}}

/* Accessible screen candidate: shared edge motion, readable labels, optional detail.
   Keep outgoing pages stacked and inert, without changing gameplay/session clocks. */
.coop-shell{font-size:16px;overflow-x:hidden}
.coop-pages{display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-width:0;min-height:0}
.coop-pages>div{grid-area:1/1;min-width:0;max-width:100%;align-self:start}
.coop-pages>.coop-menu,.coop-pages>#coop-result{align-self:center}
.coop-pages>#coop-lobby{align-self:stretch}
.coop-shell[aria-hidden="true"],.coop-pages>[aria-hidden="true"]{pointer-events:none}
.coop-shell :is(.primary-button,.subtle-button){font-size:18px;line-height:1.5;min-height:48px;white-space:normal;overflow-wrap:anywhere}
.coop-heading p,.coop-live-note{font-size:16px!important;line-height:1.65!important}
.coop-lobby-bar{font-size:16px}
.coop-seat strong{font-size:18px;line-height:1.45}
.coop-seat-number,.coop-seat small,.coop-ready-state,.coop-hero span,.coop-hero small{font-size:16px;line-height:1.5}
.coop-seat,.coop-hero{overflow-wrap:anywhere}
.coop-hero strong{font-size:18px;line-height:1.5}
#coop-count{font-size:20px}
#coop-copy{font-size:16px}
#coop-picker h3,#coop-result-title{font-size:24px;line-height:1.5;overflow-wrap:anywhere}
#coop-result-score{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:8px 18px;margin:20px 0}
#coop-score-value{font-size:40px;line-height:1.2;overflow-wrap:anywhere;min-width:0}
#coop-result-floor{font-size:24px}
#coop-result-details{margin:16px 0 24px;text-align:left}
#coop-result-details summary{font-size:18px;line-height:1.5;min-height:48px;padding:10px 12px;cursor:pointer}
#coop-result-details summary:focus-visible{outline:3px solid #f6cf8e;outline-offset:3px}
#coop-results{font-size:16px;line-height:1.7;overflow-wrap:anywhere;margin:12px 0}
/* The inventory is dark; pause/help are paper. Never reuse pale warning ink there. */
#pause-content .coop-live-note,#help-panel .coop-live-note{color:#334d43!important}
#run-amulets{max-height:180px;max-height:min(180px,28cqh);overscroll-behavior:contain}
#run-amulets p{font-size:16px;line-height:1.55;overflow-wrap:anywhere}
#run-amulets strong{font-size:18px;color:#242824;line-height:1.5}
#run-amulets span{color:#4e5d50;font-size:16px}
@media(max-width:440px){.coop-heroes{grid-template-columns:1fr}.coop-hero{display:grid;grid-template-columns:80px minmax(0,1fr);text-align:left;justify-items:start}.coop-hero canvas{grid-row:1/4;height:90px}.coop-lobby-bar input{width:100%}.coop-lobby-bar label{width:100%}.coop-lobby-actions button{flex:1 1 150px}}

/* Result body scrolls above its actions, so four long records never cover replay. */
.coop-shell[data-page="result"] { overflow:hidden; background:#1d332f; }
.coop-shell[data-page="result"] .coop-pages { grid-template-rows:minmax(0,1fr); overflow:hidden; }
.coop-shell[data-page="result"] .coop-pages > #coop-result { align-self:stretch; display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.coop-result-body { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:8px 8px 12px; }
#coop-result .result-actions { position:static; flex:0 0 auto; padding:12px 0 4px; }
