/* The next instruction, its action, and Exit have reserved rows. Only room
   details scroll; no setup step depends on finding a button below the fold. */
.team-dialog #team-mount{height:100%;width:100%;min-width:0;min-height:0}
.team-lobby{display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;gap:10px;color:#304b37;font-family:'DM Sans',sans-serif}
.team-title-row,.team-lobby-scroll,.team-lobby-footer{width:100%;max-width:720px;margin-inline:auto;min-width:0}
.team-title-row{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.team-sr-heading{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.team-summary{flex:1;min-width:0}
.team-next{display:flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #c5d7b5;border-radius:12px;background:#edf3e2;min-height:52px}
.team-next>span{display:grid;place-items:center;flex:none;min-width:35px;height:26px;border-radius:7px;background:#35583d;color:#fffced;font-size:10px;font-weight:800;text-transform:uppercase}
.team-next strong{font-size:15px;line-height:1.35;color:#36553a;overflow-wrap:anywhere}
.team-hear{display:flex;align-items:center;justify-content:center;gap:6px;flex:0 0 auto;min-width:48px;min-height:48px;padding:10px;border:1px solid #b9ccaa;border-radius:12px;background:#eaf0dd;color:#46613d;font:700 13px/1.2 'DM Sans',sans-serif;touch-action:manipulation}
.team-hear svg{width:23px;height:23px;flex:none}
.team-lobby-scroll{flex:1;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a8bd95 #f0f3e7;scroll-padding:8px;padding:0 4px 8px}
.team-dialog .team-lobby p{font-size:13px;line-height:1.4;margin:0;color:#52694b}
.team-dialog .team-lobby .team-prompt{margin-bottom:8px;font-size:13px}
.team-scene-art{display:block;width:100%;height:clamp(96px,17vh,140px);margin:0 0 12px;border-radius:14px;background:#e9f0db;stroke:none}
.team-scene-art text{fill:#fff;stroke:none}
.team-scene-art circle:nth-of-type(1){fill:#54869c}
.team-scene-art circle:nth-of-type(2){fill:#bd8e38}
.team-empty-actions{display:grid;gap:10px}
.team-create-panel{display:grid;gap:6px}
.team-create-panel.is-primary{display:none}
.team-label{display:block;color:#506649;font-size:12px;line-height:1.3;font-weight:800;margin-bottom:5px}
.team-primary,.team-secondary,.team-ready,.team-resume,.team-link-danger,.team-exit{box-sizing:border-box;min-width:44px;min-height:48px;border-radius:10px;font:700 14px/1.3 'DM Sans',sans-serif;padding:10px 12px;touch-action:manipulation}
.team-primary{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;background:#35583d;color:#fffced;border:1px solid #35583d}
.team-primary svg{width:22px;height:22px;flex:none}
.team-primary:hover{background:#446b46}
.team-primary:disabled,.team-secondary:disabled,.team-resume:disabled{opacity:.5;cursor:default}
.team-secondary,.team-resume{background:#f5f7ed;color:#405e38;border:1px solid #a7bd98}
.team-secondary:hover,.team-resume:hover{background:#e5edd8}
.team-resume{width:100%}
.team-divider{display:flex;align-items:center;gap:8px;color:#536c48;font-size:12px;line-height:1.3}
.team-divider:before,.team-divider:after{content:'';height:1px;flex:1;background:#d5dfc9}
.team-join-panel{padding:12px;border:1px solid #c4d4b5;border-radius:12px;background:#f5f7ed}
.team-join-row{display:flex;gap:8px;min-width:0}
.team-join-row input{flex:1;min-width:0;width:100%;height:50px;border:1px solid #aabc9a;border-radius:9px;padding:10px;font:700 18px/1.2 'DM Sans',sans-serif;letter-spacing:2px;text-transform:uppercase;color:#304b37;background:#fffef6}
.team-join-row input::placeholder{font-size:13px;letter-spacing:.3px;text-transform:none;color:#65785b}
.team-join-row .team-secondary{flex:none;min-width:70px}
.team-dialog .team-lobby .team-help{font-size:12px;margin-top:6px}
.team-room-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px;margin-bottom:10px;border:1px solid #c7d7b7;border-radius:12px;background:#edf2e0}
.team-code{display:block;color:#35513a;font:700 30px/1.2 'DM Sans',sans-serif;letter-spacing:4px;overflow-wrap:anywhere}
.team-copy-actions{display:flex;gap:8px;min-width:0}
.team-copy-actions:empty{display:none}
.team-copy,.team-invite{white-space:normal}
.team-room-facts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}
.team-room-facts>span{display:grid;gap:3px;border:1px solid #d4dec8;border-radius:10px;padding:9px 10px;color:#4c6546;font-size:13px;line-height:1.4}
.team-room-facts b{font-size:11px;color:#566e4b}
.team-dialog .team-lobby .team-room-note{font-size:12px;margin-bottom:10px}
.team-members{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.team-member{position:relative;display:grid;grid-template-columns:44px minmax(0,1fr);align-content:start;align-items:center;gap:8px;padding:10px;border:1px solid #c9d8bb;border-radius:12px;background:#f6f7ee;min-width:0}
.team-member-own{border:2px solid #8ea87c;background:#edf3e2;padding:9px}
.team-member-pending,.team-member-empty{border-style:dashed}
.team-member-badge{position:relative;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#4f819c;color:#fff;border:2px solid #e3edf1}
.team-member-badge>span{position:absolute;left:-5px;top:-5px;display:grid;place-items:center;width:21px;height:21px;border:2px solid #fffbed;border-radius:50%;background:#304b37;color:#fff;font:800 11px/1 'DM Sans',sans-serif}
.team-member-badge svg{width:25px;height:25px;fill:currentColor}
.team-member-gold .team-member-badge{background:#b98730;border-color:#efe2b9}
.team-member-copy{display:grid;gap:4px;min-width:0}
.team-member-copy strong{font-size:14px;line-height:1.25;color:#34523b}
.team-member-copy span{font-size:12px;line-height:1.3;color:#526b47}
.team-member-actions{display:flex;flex-wrap:wrap;gap:8px;grid-column:1/-1}
.team-ready{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:6px;width:100%;background:#e4edd5;color:#3e6235;border:1px solid #9db68b}
.team-ready svg{width:19px;height:19px;fill:currentColor}
.team-ready.is-ready{background:#456e3e;color:#fffced;border-color:#456e3e}
.team-link-danger{background:#fff6ed;color:#775641;border:1px solid #cfb39f;font-size:12px}
.team-member>.team-link-danger{grid-column:1/-1;justify-self:start}
.team-start{margin-top:10px}
.team-start:disabled{display:none}
.team-room-details{margin-top:10px}
.team-room-details summary{min-height:48px;display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid #c3d4b2;border-radius:10px;font-size:13px;line-height:1.3;font-weight:700;color:#46643e;cursor:pointer}
.team-room-details summary:after{content:'+';margin-left:auto;font-size:20px}
.team-room-details[open] summary{margin-bottom:10px}
.team-room-details[open] summary:after{content:'−'}
.team-lobby-footer{flex:0 0 auto;display:grid;gap:8px;padding:8px 0 0;border-top:1px solid #d8e2ce;background:#fffdf3}
.team-dialog .team-lobby .team-feedback{margin:0;padding:8px 10px;border:1px solid #d6c08d;border-radius:9px;background:#fff3d9;color:#684d2d;font-size:13px;line-height:1.35;max-height:5.4em;overflow:auto}
.team-feedback:empty{display:none}
.team-lobby-actions{display:flex;gap:10px;justify-content:flex-end;align-items:stretch;min-width:0}
.team-lobby-actions.has-primary{display:grid;grid-template-columns:minmax(0,1fr) auto}
.team-lobby-actions [data-team-primary]:empty{display:none}
.team-lobby-actions [data-team-primary]>button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:52px;margin:0;background:#35583d;color:#fffced;border:1px solid #35583d;font-size:16px;line-height:1.25}
.team-exit{min-height:52px;min-width:76px;background:#fff1e8;color:#77513e;border:1px solid #bb9279}
.team-lobby button:focus-visible,.team-lobby input:focus-visible,.team-room-details summary:focus-visible{outline:3px solid #a66b25;outline-offset:2px}
@media(max-width:600px){
 .team-lobby{gap:8px}
 .team-next{padding:8px;gap:7px}
 .team-next strong{font-size:14px}
 .team-hear span{display:none}
 .team-hear{min-width:48px;width:48px}
 .team-scene-art{height:76px;margin-bottom:8px}
 .team-room-head{grid-template-columns:1fr;padding:10px;gap:8px}
 .team-code{font-size:27px;letter-spacing:3px}
 .team-copy-actions{justify-content:flex-start}
 .team-copy-actions button{padding:8px 12px}
 .team-members{gap:8px}
 .team-member{grid-template-columns:36px minmax(0,1fr);gap:7px;padding:8px}
 .team-member-own{padding:7px}
 .team-member-badge{width:36px;height:36px}
 .team-member-badge svg{width:22px;height:22px}
 .team-member-copy strong{font-size:13px}
 .team-member-copy span{font-size:12px}
 .team-dialog .team-lobby .team-room-note{display:none}
 .team-lobby-scroll{padding-inline:0}
 .team-join-panel{padding:10px}
}
@media(max-height:600px) and (orientation:landscape){
 .team-lobby{gap:6px}
 .team-next{min-height:44px;padding:6px 9px}
 .team-next strong{font-size:14px}
 .team-title-row{gap:8px}
 .team-scene-art,.team-prompt,.team-room-note{display:none!important}
 .team-empty-actions{gap:6px}
 .team-divider{display:none}
 .team-join-panel{padding:6px 10px}
 .team-join-panel .team-label{display:inline-block;margin-right:10px}
 .team-join-panel .team-help{display:none}
 .team-join-row input{height:48px}
 .team-room-head{grid-template-columns:minmax(0,1fr) auto;margin-bottom:8px;padding:6px 10px}
 .team-code{font-size:25px}
 .team-members{gap:8px}
 .team-member{padding:6px 8px;gap:6px;grid-template-columns:36px minmax(0,1fr)}
 .team-member-badge{width:36px;height:36px}
 .team-member-copy strong{font-size:13px}
 .team-member-copy span{font-size:12px}
 .team-lobby-footer{padding-top:6px;gap:6px}
 .team-lobby-actions [data-team-primary]>button,.team-exit{min-height:48px}
 .team-dialog .team-lobby .team-feedback{max-height:2.7em;padding:5px 8px;font-size:12px}
}
@media(max-width:360px){
 .team-next>span{display:none}
 .team-code{font-size:25px;letter-spacing:2px}
 .team-member-copy strong{font-size:12px}
 .team-lobby-actions{gap:8px}
 .team-lobby-actions [data-team-primary]>button{font-size:15px}
}
@media(max-height:500px){
 .team-scene-art,.team-prompt{display:none!important}
 .team-lobby{gap:6px}
 .team-next{min-height:44px;padding:6px 9px}
 .team-next strong{font-size:13px}
 .team-dialog .team-lobby .team-help,.team-dialog .team-lobby .team-room-note{display:none}
 .team-join-panel{padding:6px 8px}
 .team-lobby-footer{padding-top:6px;gap:6px}
 .team-dialog .team-lobby .team-feedback{max-height:2.7em;padding:5px 8px;font-size:12px}
}
.team-member-badge img{width:44px;height:55px;object-fit:contain;object-position:center bottom}
