/* Explorer menus use the tower's existing panel, terminal, keypad and gold-action palette. */
.explorer-ui{--ink:#ddd8b5;--muted:#a7b6ae;--green:#d4b97b;--gold:#d4b97b;color:var(--ink);font:12px/1.8 'Times Pixel',monospace;font-weight:400}
.explorer-ui :is(h1,h2,h3,p,button,a,input,label,legend,small,summary){font-family:inherit;font-weight:400;letter-spacing:0;overflow-wrap:anywhere}
.explorer-ui h1,.explorer-ui h2{font-size:clamp(16px,2.4vw,24px);line-height:1.6;color:#e0d2a2;margin:8px 0 16px}
.explorer-ui h3{font-size:13px;line-height:1.8;color:#e0d2a2}
.explorer-ui p{font-size:11px;line-height:2;color:var(--muted);margin:12px 0 20px}
.explorer-ui .eyebrow,.explorer-ui .caption,.explorer-ui small{font-size:10px;line-height:1.9}
.explorer-ui .eyebrow{color:#a4b29c;letter-spacing:2px;margin:0 0 12px}
.explorer-ui button,.explorer-ui .button{min-height:46px;padding:12px;border-radius:0;font-size:11px;line-height:1.8;border:2px solid #e3d39c;border-bottom:4px solid #8c7c4e;background:#cbbb82;color:#1c2928;box-shadow:0 3px 0 #101b20;touch-action:manipulation}
.explorer-ui button:hover,.explorer-ui .button:hover{background:#dfd39e;filter:none}
.explorer-ui button:active{transform:translateY(1px)}
.explorer-ui .secondary{border-color:#748677;border-bottom-color:#354942;background:#263b37;color:#ddd8b5}
.explorer-ui .secondary:hover{background:#3b5145}
.explorer-ui .danger{border-color:#a8715e;background:#392d2b;color:#ffd0b4}
.explorer-ui .quiet{border:0;background:transparent;color:#b5c3af;box-shadow:none;text-decoration:none}
.explorer-ui .quiet:hover{color:#e0d2a2;background:#263b37}
.explorer-ui input{border:2px solid #748677;border-radius:0;background:#101e24;font-size:16px;color:#ddd8b5;min-width:0;min-height:46px}
.explorer-ui label,.explorer-ui legend{font-size:11px;line-height:1.9}
.explorer-ui input[type=checkbox]{min-height:22px;width:22px;height:22px}
.explorer-ui .check{font-size:10px;line-height:2;align-items:center;min-height:44px}
.explorer-ui :focus-visible{outline:3px solid #efcf83;outline-offset:3px}
.explorer-ui .actions{gap:12px}
.explorer-ui .avatar{width:100px;height:112px;image-rendering:pixelated}
.explorer-ui .avatar-empty{border-radius:0;background:#263b37;font-size:30px;width:100px;height:112px}
.explorer-ui .avatar-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 0}
.explorer-ui .avatar-choice{position:relative;display:block;cursor:pointer}
.explorer-ui .avatar-choice input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.explorer-ui .avatar-choice>span:first-of-type{display:grid;place-items:center;border:2px solid #516960;background:#101e24;padding:4px;position:relative;pointer-events:none}
.explorer-ui .avatar-choice .avatar{width:52px;height:60px}
.explorer-ui .avatar-choice input:checked+span{border-color:#e3d39c;background:#34483b;box-shadow:inset 0 0 0 2px #0e171f}
.explorer-ui .avatar-choice input:focus-visible+span{outline:3px solid #efcf83;outline-offset:3px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.explorer-choices{min-width:0;padding:0;border:0;margin:0}
.explorer-setup{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
.explorer-setup .setup-copy{display:grid;gap:16px}
.explorer-setup>.actions,.explorer-setup>.check{grid-column:1/-1}
.explorer-ui .explorer-preview{display:grid;place-items:center;background:repeating-linear-gradient(0deg,#132228 0 3px,#182a2d 3px 4px);border:2px solid #52665c;min-height:150px}
.explorer-ui .explorer-preview .avatar{width:110px;height:135px}
.explorer-ui .explorer-error{background:#392d2b;color:#ffd0b4;border:1px solid #a8715e;padding:12px;font-size:11px;line-height:1.8;margin:12px 0}
dialog.explorer-ui{padding:24px;border:3px solid #889184;border-radius:0;background:#19272e;box-shadow:0 0 0 5px #0e171f,8px 8px 0 5px #070e16;max-width:700px;max-height:calc(var(--explorer-height,100dvh) - 32px);position:fixed;inset:auto;top:calc(var(--explorer-top,0px) + 16px);left:50%;transform:translateX(-50%);margin:0;width:calc(100% - 32px);overflow:auto}
dialog.explorer-ui .close{float:none;position:relative;margin:0 0 8px auto;display:flex;width:44px;height:44px;min-height:44px;padding:0;background:#263a3c;border:1px solid #61716b;color:#ddd8b5;box-shadow:none;font-size:20px}
dialog.explorer-ui::backdrop{background:#08121bdd;backdrop-filter:blur(2px)}
.player-mode{background:#0e171c;color:#ddd8b5}
.player-mode>.site-header,.player-mode>.site-footer{display:none}
.player-mode main{max-width:none;padding:0;min-height:0}
.player-mode #overlay{position:fixed;top:var(--explorer-top,0px);left:0;right:0;height:var(--explorer-height,100dvh);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:linear-gradient(#08121bad,#08121bee),url('/brand-tower.svg') center/auto 90% no-repeat,#101e24;overflow:auto}
.player-mode #overlay>.panel{position:relative;min-width:0;width:850px;max-width:100%;max-height:100%;overflow:auto;background:#19272ef5;border:3px solid #889184;box-shadow:0 0 0 5px #0e171f,8px 8px 0 5px #070e16;padding:28px;text-align:center}
.player-mode #overlay>.panel.narrow-panel{width:580px}
.player-mode #notice{position:fixed;top:0;left:0;right:0;z-index:30;font:11px/1.9 'Times Pixel',monospace}
.player-mode .player-links{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:18px}
.player-mode .player-links a{font-size:10px;min-height:44px;display:flex;align-items:center;padding:8px}
.player-mode .player-tiles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:24px 0}
.player-mode .family-player{width:100%;min-width:0;display:flex;flex-direction:column;gap:8px;margin:0;background:#22362f;color:#ddd8b5;border-color:#748677;border-bottom-color:#354942;padding:12px 8px}
.player-mode .family-player:hover{background:#3b5145;border-color:#e3d39c}
.player-mode .family-player span{max-width:100%;overflow-wrap:anywhere}
.player-mode .family-player .avatar{width:90px;height:110px}
.player-mode .player-greeting{justify-content:center;flex-direction:column;gap:8px}
.player-mode .player-greeting h1{margin:0}
.player-mode .player-greeting p{margin-bottom:12px}
.player-mode .player-actions{display:grid;gap:12px;width:100%;max-width:440px;margin:auto}
.player-mode .welcome-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:center}
.player-mode .welcome-layout>.banner{grid-column:1/-1}
.player-mode .pin-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:24px;align-items:center}
.player-mode .pin-layout form{gap:12px}
.explorer-ui .keypad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;touch-action:none}
.explorer-ui .keypad button{height:44px;min-height:44px;padding:4px;background:#344b43;border-color:#748677;border-bottom-color:#354942;color:#d0d5b9;font-size:14px;touch-action:none}
.explorer-ui .keypad button[data-pin-key=clear],.explorer-ui .keypad button[data-pin-key=back]{font-size:10px}
.explorer-ui .terminal-screen{text-align:center;letter-spacing:8px;background:#0b1d1d;color:#b2d6a1;border:3px inset #4b675b}
.family-lobby{padding:28px;margin:24px 0 36px;background:#19272e;border:3px solid #889184;box-shadow:5px 5px 0 #0e171f}
.family-lobby .family-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.family-lobby .family-heading>div{min-width:0}
.family-lobby .family-heading h1{margin-bottom:8px}
.family-lobby .explorer-count{white-space:nowrap;color:#d4b97b;font-size:10px}
.explorer-roster{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:24px 0}
.explorer-card{min-width:0;border:2px solid #52665c;background:#132228;padding:12px 8px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
.explorer-card h2{font-size:12px;margin:0;line-height:1.8;width:100%}
.explorer-card small{margin-top:auto}
.explorer-card>button{width:100%;font-size:10px}
.explorer-card .quiet{padding:6px;font-size:10px}
.explorer-slot{justify-content:center;min-height:225px;border-style:dashed;color:#a4b29c;font-size:10px}
.explorer-slot .slot-mark{font-size:30px;color:#899b86}
.explorer-slot.placeholder{opacity:.55}
.family-reports{margin:32px 0}
.family-reports>summary{font-size:1.1rem;cursor:pointer;padding:16px 0;min-height:44px}
.family-account-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.family-account-actions p{margin:0;overflow-wrap:anywhere}
.family-account-actions .actions{margin-left:auto}
.family-share{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.2fr);gap:24px;align-items:start;text-align:left}
.family-qr{display:block;width:100%;max-width:240px;aspect-ratio:1;background:white;margin:auto}
.family-share .actions{display:grid}
.family-share input{font:14px/1.6 ui-monospace,monospace}
.family-share details{margin-top:20px;font-size:10px}
.family-share summary{min-height:44px;cursor:pointer}
.family-share .family-code{font-size:16px;letter-spacing:2px;color:#e0d2a2}
.explorer-settings{margin:20px 0 0;border-top:1px solid #52665c;padding-top:12px}
.explorer-settings summary{min-height:44px;cursor:pointer}
@media(max-width:760px){.explorer-roster{grid-template-columns:repeat(3,minmax(0,1fr))}.player-mode .player-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}.family-lobby{padding:20px}.explorer-slot{min-height:160px}}
@media(max-width:560px){.family-lobby{padding:16px;margin-top:16px}.explorer-roster{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.explorer-ui .avatar{width:80px;height:100px}.explorer-card{padding:10px 6px}.explorer-card>button{font-size:10px}.explorer-card h2{font-size:11px}.player-mode .player-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.player-mode #overlay>.panel{padding:20px 14px}.player-mode .family-player .avatar{width:72px;height:90px}.player-mode .welcome-layout,.player-mode .pin-layout,.family-share{grid-template-columns:1fr;gap:16px}.player-mode .pin-layout .avatar{display:none}.player-mode .pin-layout p{margin:8px 0}.player-mode .pin-layout h1{margin:4px 0}.explorer-setup{grid-template-columns:1fr;gap:16px}.explorer-setup .explorer-preview{display:none}.explorer-ui .avatar-choice .avatar{height:48px;width:45px}.explorer-ui .avatar-choice>span:first-of-type{padding:4px}.family-qr{max-width:200px}.explorer-ui .actions>button{flex:1 1 130px}dialog.explorer-ui{padding:16px}.explorer-ui .explorer-count{white-space:normal}}
@media(min-width:561px) and (max-height:540px){.player-mode #overlay>.panel{padding:16px}.player-mode .pin-layout{gap:18px}.player-mode .pin-layout form{grid-template-columns:minmax(0,1fr);gap:8px}.player-mode .pin-layout .keypad{grid-template-columns:repeat(6,minmax(0,1fr))}.player-mode .pin-layout h1{font-size:16px}.player-mode .pin-layout p{font-size:10px;margin:8px 0}.player-mode .pin-layout .avatar{width:64px;height:72px;margin:auto}.player-mode .pin-layout .check{font-size:10px}.player-mode .pin-layout .pin-label{gap:2px}.player-mode .pin-layout .terminal-screen{min-height:40px;padding:5px}.player-mode .pin-layout .eyebrow{display:none}.player-mode .pin-layout #pin-hint{display:none}.player-mode .pin-layout .quiet{font-size:10px;padding:8px}.player-mode .pin-layout .keypad button{min-width:0;font-size:11px;padding:2px}.player-mode .pin-layout .keypad button[data-pin-key=clear],.player-mode .pin-layout .keypad button[data-pin-key=back]{font-size:9px}.player-mode .player-tiles{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:16px 0}.player-mode .family-player{font-size:10px;padding:8px 4px}.player-mode .family-player .avatar{width:55px;height:66px}.player-mode .player-links{margin-top:8px}.player-mode .player-greeting .avatar{width:76px;height:90px}.explorer-setup{gap:16px}.explorer-ui .avatar-choice .avatar{width:44px;height:48px}.explorer-ui .explorer-preview{min-height:110px}.explorer-ui .explorer-preview .avatar{height:100px}.family-qr{max-width:180px}}
@media print{.family-lobby,.family-account-actions{display:none}.explorer-ui{font-family:system-ui,sans-serif;color:#182f35}dialog.explorer-ui{position:static;transform:none;max-height:none;width:100%;border:0}.family-share{display:block}.family-share .actions,.family-share details{display:none}}
.add-explorer-preview{display:flex;justify-content:center;margin:8px 0}
.add-explorer-dialog{max-width:580px!important}
.add-explorer-dialog .add-explorer-preview .avatar{width:66px;height:76px}
@media(min-width:561px) and (max-height:540px){.add-explorer-dialog .add-explorer-preview{float:right;margin:0 0 8px 16px}.add-explorer-dialog h2{font-size:16px}.add-explorer-dialog p{font-size:10px}}
.player-mode #player-feedback:not([hidden]){background:#392d2b;color:#ffd0b4;border:1px solid #a8715e;padding:12px;font-size:11px;line-height:1.8;margin-bottom:16px}
.class-join-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;text-align:left}
.class-join-layout .setup-copy{display:grid;gap:12px}
.player-mode #choose-character{text-align:left}
.player-mode #choose-character .avatar-choice .avatar{width:62px;height:70px}
.player-mode #choose-character .setup-copy>a{text-align:center;min-height:44px;font-size:10px}
@media(max-width:560px){.class-join-layout{grid-template-columns:1fr}.player-mode #choose-character .setup-copy{order:2}.player-mode #choose-character .explorer-choices{order:1}.player-mode #choose-character .avatar-choice .avatar{width:50px;height:58px}.player-mode #choose-character .setup-copy{gap:8px}}
@media(min-width:561px) and (max-height:540px){.player-mode #choose-character .avatar-choice .avatar{width:45px;height:45px}.player-mode #choose-character .avatar-choices{gap:6px}.player-mode #choose-character .explorer-preview{min-height:70px}.player-mode #choose-character .explorer-preview .avatar{height:75px}.player-mode #choose-character .setup-copy{gap:8px}.player-mode #choose-character button{font-size:10px;padding:8px}.player-mode #choose-character .setup-copy>a{font-size:10px}}
.family-account-actions button,#verification-banner button{min-height:44px}
/* Short phones put the six-column keypad across the whole panel, keeping every key thumb-sized. */
@media(min-width:561px) and (max-height:540px){
 .player-mode .pin-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 16px;align-items:center}
 .player-mode .pin-layout>div:first-child{grid-column:1;grid-row:1}
 .player-mode .pin-layout>div:first-child :is(.add-explorer-preview,p,.eyebrow){display:none}
 .player-mode .pin-layout h1{margin:0;font-size:14px}
 .player-mode .pin-layout #change-player{padding:6px 0;font-size:10px;min-height:44px}
 .player-mode .pin-layout #family-pin{display:contents}
 .player-mode #family-pin>.pin-label{grid-column:2;grid-row:1;text-align:left}
 .player-mode #family-pin>.keypad{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(6,minmax(0,1fr))}
 .player-mode #family-pin>.check{grid-column:1;grid-row:3;margin:0}
 .player-mode #family-pin>button{grid-column:2;grid-row:3;font-size:10px;padding:8px}
}
.explorer-card-tools{display:flex;flex-direction:column;width:100%;gap:4px}
.explorer-card-tools .quiet{flex:1;min-width:0;font-size:9px;padding:6px 2px}
.family-lobby .roster-portrait .avatar{height:86px;width:76px}
@media(min-width:561px) and (max-height:540px){
 .player-mode .character-panel>.eyebrow{display:none}
 .player-mode .character-panel>h1{font-size:16px;margin:0 0 6px}
 .player-mode .character-panel>p{font-size:10px;line-height:1.6;margin:4px 0 10px}
 .player-mode .character-panel #choose-character .avatar-choice .avatar{height:40px;width:40px}
 .player-mode .character-panel #choose-character .avatar-choice>span:first-of-type{padding:0;min-height:44px}
 .player-mode .character-panel #choose-character .avatar-choices{margin-top:4px;gap:6px}
 .player-mode .character-panel #choose-character legend{font-size:10px}
 .player-mode .character-panel #choose-character{gap:16px}
}
.explorer-ui .login-card{padding:16px}
.explorer-ui .login-card strong{font-size:16px;line-height:1.8;overflow-wrap:anywhere}
.explorer-ui .login-card dl{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);font-size:12px}
.explorer-ui .login-card dt{font-size:10px;line-height:1.8}
.explorer-ui .login-card dd{overflow-wrap:anywhere;letter-spacing:0}
.explorer-ui .check a{display:inline-block;min-height:44px;line-height:44px}
/* Keep setup dialogs clear of notches and home indicators, including with the nickname keyboard open. */
:root{--explorer-safe-top:env(safe-area-inset-top,0px);--explorer-safe-bottom:env(safe-area-inset-bottom,0px);--explorer-safe-left:env(safe-area-inset-left,0px);--explorer-safe-right:env(safe-area-inset-right,0px)}
dialog.explorer-ui{top:calc(var(--explorer-top,0px) + max(16px,var(--explorer-safe-top)));max-height:calc(var(--explorer-height,100dvh) - max(16px,var(--explorer-safe-top)) - max(16px,var(--explorer-safe-bottom)));width:calc(100% - max(16px,var(--explorer-safe-left),var(--explorer-safe-right)) - max(16px,var(--explorer-safe-left),var(--explorer-safe-right)))}
/* Character selection: portraits beside a living corner of the tower. */
.player-mode #overlay>.character-panel{width:960px;padding:26px;background:linear-gradient(135deg,#253b3c,#15272e 58%,#112028);border-color:#7d8d79;box-shadow:0 0 0 5px #0e171f,10px 10px 0 5px #070e16,inset 0 2px #bdba8d}
.player-mode .character-panel>.eyebrow{color:#c4b782;margin-bottom:8px}
.player-mode .character-panel>h1{margin:4px 0 8px;color:#f1dda2;text-shadow:3px 3px #091b20}
.player-mode .character-panel>p{margin:0 0 22px;font-size:10px}
.player-mode .character-panel #choose-character{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:20px;align-items:stretch}
.player-mode .character-panel #choose-character .explorer-preview{display:grid;position:relative;min-height:0;grid-column:1;grid-row:1;overflow:hidden;background:#101e24;border:2px solid #65796b;box-shadow:inset 0 0 0 4px #0c1b22,0 4px #09181e}
.player-mode .character-panel #choose-character .explorer-preview canvas{display:block;width:100%;height:264px;min-height:180px;image-rendering:pixelated;object-fit:contain}
.player-mode .character-panel #choose-character .explorer-choices{grid-column:2;grid-row:1}
.player-mode .character-panel #choose-character .avatar-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0}
.player-mode .character-panel #choose-character .avatar-choice>span:first-of-type{padding:4px;min-height:76px;background:#172b30;border:2px solid #506960;box-shadow:inset 0 2px #6b8070,0 3px #081a20;transition:border-color .12s,background .12s}
.player-mode .character-panel #choose-character .avatar-choice .avatar{width:100%;height:68px;max-width:88px}
.player-mode .character-panel #choose-character .avatar-choice:hover>span:first-of-type{border-color:#b6b789;background-color:#354b43}
.player-mode .character-panel #choose-character .avatar-choice input:checked+span{border-color:#f1d88d;background:#40533d;box-shadow:inset 0 0 0 2px #192a29,0 0 0 2px #ad9860,0 4px #09181e}
.player-mode .character-panel #choose-character .avatar-choice input:checked+span:after{content:'';position:absolute;right:5px;top:5px;width:5px;height:5px;background:#f1d88d;box-shadow:-5px 0 #f1d88d,0 5px #f1d88d}
.player-mode .character-panel #choose-character .setup-copy{grid-column:1/-1;grid-row:2;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:20px;align-items:center;padding-top:4px}
.player-mode .character-panel #choose-character .setup-copy>a{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px;font-size:10px;line-height:1.8}
.player-mode .character-panel #save-character{background:#dfc98b;border-color:#f0dda6;border-bottom-color:#8d7647;color:#172827}
.player-mode .character-panel #save-character:disabled{background:#68705b;border-color:#899075;opacity:.65}
.explorer-preview [hidden]{display:none!important}
.explorer-ui .preview-motion{position:absolute;right:6px;top:6px;width:44px;height:44px;min-height:44px;padding:0;font-family:monospace;font-size:18px;background:#102027d9;color:#eee0ae;border:1px solid #6b806c;box-shadow:0 2px #0c1b22}
@media(max-width:760px) and (min-height:541px), (max-width:560px){
 .player-mode #overlay>.character-panel{padding:18px 14px}
 .player-mode .character-panel #choose-character{grid-template-columns:minmax(0,1fr);gap:14px}
 .player-mode .character-panel #choose-character .explorer-preview{grid-column:1;grid-row:1;height:168px}
 .player-mode .character-panel #choose-character .explorer-preview canvas{height:164px;min-height:0}
 .player-mode .character-panel #choose-character .explorer-choices{grid-column:1;grid-row:2}
 .player-mode .character-panel #choose-character .avatar-choices{gap:8px}
 .player-mode .character-panel #choose-character .avatar-choice>span:first-of-type{min-height:60px;padding:0}
 .player-mode .character-panel #choose-character .avatar-choice .avatar{height:56px;max-width:72px}
 .player-mode .character-panel #choose-character .setup-copy{grid-row:3;grid-template-columns:minmax(0,1fr);gap:4px}
 .player-mode .character-panel>p{margin:6px 0 14px}
}
@media(min-width:561px) and (max-height:540px){
 .player-mode #overlay>.character-panel{padding:12px 16px}
 .player-mode .character-panel>h1{font-size:16px;margin:0 0 8px}
 .player-mode .character-panel>p,.player-mode .character-panel>.eyebrow{display:none}
 .player-mode .character-panel #choose-character{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:8px 16px}
 .player-mode .character-panel #choose-character .avatar-choices{gap:4px}
 .player-mode .character-panel #choose-character .avatar-choice>span:first-of-type{min-height:44px;padding:0}
 .player-mode .character-panel #choose-character .avatar-choice .avatar{height:40px;max-width:48px}
 .player-mode .character-panel #choose-character .explorer-preview canvas{min-height:0;height:140px}
 .player-mode .character-panel #choose-character .setup-copy{gap:12px;padding-top:0}
 .player-mode .character-panel #choose-character .setup-copy>a,.player-mode .character-panel #choose-character .setup-copy>button{font-size:10px;padding:6px}
}
@media(prefers-reduced-motion:reduce){.player-mode .character-panel #choose-character .avatar-choice>span:first-of-type{transition:none}}

/* Square portrait tiles fill a taller character-selection stage. */
.player-mode .character-panel #choose-character .avatar-choice{aspect-ratio:1;min-width:0}
.player-mode .character-panel #choose-character .avatar-choice>span:first-of-type{position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0}
.player-mode .character-panel #choose-character .avatar-choice .avatar{position:absolute;inset:7%;width:86%;height:86%;max-width:none}
.player-mode .character-panel #choose-character .explorer-preview canvas{position:absolute;inset:0;width:100%;height:100%;min-height:0}
@media(max-width:760px) and (min-height:541px), (max-width:560px){
 .player-mode .character-panel #choose-character .explorer-preview{height:clamp(200px,32dvh,300px)}
}
@media(min-width:561px) and (max-height:540px){
 .player-mode .character-panel #choose-character{grid-template-columns:minmax(0,1fr) clamp(146px,calc(var(--explorer-height,100dvh) - 150px),330px)}
}

/* Back belongs with navigation; the only footer action confirms the character. */
.character-nav{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:-8px 0 8px;text-align:left}
.explorer-ui .character-nav>.quiet{display:flex;align-items:center;min-height:44px;padding:6px 0;font-size:10px;text-decoration:none;line-height:1.7}
.explorer-ui .character-nav>.eyebrow{margin:0;font-size:9px;letter-spacing:1px;text-align:right}
.player-mode .character-panel #choose-character .setup-copy{grid-template-columns:minmax(0,1fr);justify-items:center}
.player-mode .character-panel #save-character{width:100%;max-width:440px}
@media(max-width:760px){.character-nav>.eyebrow{display:none}}
@media(min-width:561px) and (max-height:540px){
 .player-mode .character-panel .character-nav{position:absolute;top:12px;left:16px;width:160px;margin:0}
 .player-mode .character-panel .character-nav>.eyebrow{display:none}
 .player-mode .character-panel>h1{min-height:44px;display:flex;align-items:center;justify-content:center;padding-left:170px;font-size:14px;line-height:1.5}
 .player-mode .character-panel #choose-character{grid-template-columns:minmax(0,1fr) clamp(146px,calc(var(--explorer-height,100dvh) - 170px),330px)}
 .player-mode .character-panel #save-character{max-width:none}
}

/* The in-game picker reveals the paused room behind its panel. */
.embedded-player-root,.player-mode.embedded-player{background:transparent}
.player-mode.embedded-player #overlay{background:transparent}

/* Keep the player backdrop mounted while each new step fades into place. */
.player-mode .player-screen-enter{animation:player-screen-enter 220ms ease-out}
.player-mode .player-screen-enter h1:focus{outline:none}
@keyframes player-screen-enter{from{opacity:0}to{opacity:1}}
/* Same-origin page changes (including the title's code link) crossfade too. */
@view-transition{navigation:auto}
::view-transition-group(root){animation-duration:220ms}
@media(prefers-reduced-motion:reduce){
 .player-mode .player-screen-enter{animation:none}
 @view-transition{navigation:none}
 ::view-transition-group(root),::view-transition-old(root),::view-transition-new(root){animation:none}
}

/* Centre however many explorers belong to this family; selection precedes play. */
.player-mode .player-tiles{display:flex;flex-wrap:wrap;justify-content:center}
.player-mode .family-player{flex:0 1 calc((100% - 48px)/5);max-width:150px;align-items:center;text-align:center}
.player-mode .family-player[aria-pressed=true]{border-color:#efdda5;background:#3b5145;box-shadow:inset 0 0 0 2px #efdda5,0 3px 0 #101b20}
@media(max-width:760px){.player-mode .family-player{flex-basis:calc((100% - 24px)/3)}}
@media(max-width:560px){.player-mode .family-player{flex-basis:calc((100% - 10px)/2)}}
@media(min-width:561px) and (max-height:540px){.player-mode .family-player{flex-basis:calc((100% - 32px)/5)}}

@media print{.family-share .family-code{color:#182f35}.family-share{grid-template-columns:240px minmax(0,1fr);display:grid}}
