/* Visual game selection, shared by the home screen and the waiting room. */
.mini-picker{border:0;padding:0;margin:20px 0;min-width:0}
.mini-picker legend{font-size:.88rem;font-weight:800;padding:0;margin-bottom:12px}
.mini-game-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.mini-game-choice{position:relative;min-width:0;cursor:pointer;--game-ink:#6840b4;--game-wash:#f0e8ff}
.mini-game-choice input[type=radio]{position:absolute;inset:0;margin:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:1}
.mini-choice-content{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:103px;padding:10px 5px;border:2px solid transparent;border-radius:16px;background:var(--game-wash);color:var(--game-ink);text-align:center}
.mini-choice-content strong{font-size:.72rem;line-height:1.2;font-weight:750;max-width:100%}
.mini-choice-icon{display:block;width:40px;height:40px;flex-shrink:0}
.mini-choice-icon svg{display:block;width:100%;height:100%}
.icon-accent{fill:currentColor;fill-opacity:.3}
.mini-choice-check{display:none;position:absolute;right:5px;top:5px;width:17px;height:17px;line-height:17px;background:var(--purple);color:white;border-radius:50%;font-size:11px;font-weight:900}
.mini-game-choice input:checked+.mini-choice-content{border-color:var(--purple);box-shadow:0 0 0 2px #fff inset}
.mini-game-choice input:checked+.mini-choice-content .mini-choice-check{display:block}
.mini-game-choice input:focus-visible+.mini-choice-content{outline:3px solid #6840d8;outline-offset:3px}
.mini-game-choice:hover .mini-choice-content{border-color:#bda8e4}
.mini-picker:disabled .mini-choice-content{opacity:.55}
.mini-picker:disabled input{cursor:default}
.mini-choice-hint{font-size:.74rem;color:var(--muted);line-height:1.4;margin-top:10px;min-height:2.8em}
.game-chrono{--game-ink:#255c9b;--game-wash:#e5efff}.game-reflex{--game-ink:#21684e;--game-wash:#dff5e9}.game-memory{--game-ink:#94466f;--game-wash:#fbe5f0}.game-intruder{--game-ink:#a25a24;--game-wash:#fff0dc}.game-aim{--game-ink:#a04051;--game-wash:#ffe7e9}.game-count{--game-ink:#246e75;--game-wash:#def3f3}.game-gonogo{--game-ink:#886015;--game-wash:#fff3cb}.game-cups{--game-ink:#5a55a4;--game-wash:#eceaff}

/* The launch button and the two shortcuts stay reachable without scrolling. */
.host-lobby .topbar{height:64px;padding:10px 24px}.host-lobby .top-actions>a,.host-lobby>.footer{display:none}
.host-lobby #app{margin:10px auto 0;padding:0 24px calc(110px + env(safe-area-inset-bottom))}
.lobby-heading{margin-bottom:18px}.lobby-heading h1{font-size:1.9rem;margin-top:8px}.lobby-heading p{margin-top:6px;font-size:.8rem}.lobby-heading .pill{font-size:.68rem}
.lobby-panels{display:grid;gap:18px}.lobby-panels.with-mini-picker{grid-template-columns:1.1fr 1fr;align-items:start}.lobby-panels>.card{min-width:0;padding:20px}
.lobby-games .mini-picker{margin:0}.lobby-roster h2{font-size:1rem;margin-bottom:14px}.lobby-rules{border-top:1px solid var(--line);margin-top:16px;padding-top:12px;font-size:.8rem}.lobby-rules summary{cursor:pointer;color:var(--purple);font-weight:650}.lobby-rules .party-summary{margin-top:12px}
.host-lobby .player-card{padding:12px 5px 8px;gap:4px}.host-lobby .player-card .avatar.portrait{width:46px;height:46px}.host-lobby .player-name{font-size:.8rem}.host-lobby .player-status{font-size:.62rem}.host-lobby .avatar-edit{min-height:32px;padding:4px 7px}.host-lobby .empty{padding:25px 10px;font-size:.85rem}
.lobby-dock{position:fixed;z-index:10;bottom:0;left:50%;transform:translateX(-50%);width:min(1084px,100%);display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:12px 24px max(14px,env(safe-area-inset-bottom));background:#fbf9ff;border:1px solid #dfd3f0;border-bottom:0;border-radius:22px 22px 0 0;box-shadow:0 -8px 32px #4b287c0c}
.lobby-launch{display:flex;align-items:center;gap:16px;min-width:0;flex:1}.lobby-launch small{color:#685378;font-size:.75rem}.lobby-launch>.primary{min-height:48px;min-width:190px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.lobby-shortcuts{display:flex;gap:9px;flex-shrink:0}.lobby-shortcut{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:60px;min-height:58px;padding:6px;border:1px solid #d9caf4;background:#eee5ff;color:#5b369d;border-radius:16px}.lobby-shortcut svg{width:25px;height:25px}.lobby-shortcut span{font-size:.6rem;font-weight:750}.lobby-shortcut.add-shortcut{background:#6840d8;color:white;border-color:#6840d8}
.host-lobby .toast{bottom:105px}
.add-player-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:5px;border-radius:14px;background:#f1ebfa;margin-bottom:18px}.add-player-tabs button{background:transparent;font-size:.8rem;font-weight:700;padding:8px}.add-player-tabs button[aria-pressed=true]{background:white;color:var(--purple);box-shadow:0 2px 6px #49266c12}
.add-player-form,.add-computer-form{display:flex;flex-direction:column;gap:15px}.add-player-form .hint,.add-computer-form .hint{margin:0}.add-player-form .primary,.add-computer-form .primary{margin-top:4px}
.game-dialog .qr-card img{width:min(220px,100%);height:auto;margin:10px auto}.game-dialog .room-code{font-size:1.8rem}.game-dialog .qr-card p{font-size:.8rem;margin:10px 0}.game-dialog .share-link{font-size:.72rem}
@media(max-width:760px){
  .host-lobby .topbar{height:52px;padding:8px 14px}.host-lobby .brand{font-size:.8rem;gap:7px}.host-lobby .brand-mark{width:28px;height:28px;font-size:16px}.host-lobby .top-actions{gap:5px}.host-lobby #connection{font-size:0;gap:0}.host-lobby #sound{font-size:.68rem;min-height:34px;padding:4px}
  .host-lobby #app{padding:0 12px calc(100px + env(safe-area-inset-bottom));margin-top:6px}.lobby-heading{margin-bottom:12px}.lobby-heading h1{font-size:1.4rem;margin-top:6px}.lobby-heading p{font-size:.72rem;margin-top:4px}.lobby-heading .pill{font-size:.59rem;padding:4px 7px}
  .lobby-panels.with-mini-picker{grid-template-columns:1fr}.lobby-panels{gap:12px}.lobby-panels>.card{padding:13px;border-radius:20px}.lobby-games .mini-picker legend{font-size:.8rem;margin-bottom:9px}.lobby-games .mini-game-grid{gap:6px}.lobby-games .mini-choice-content{min-height:69px;padding:6px 3px;gap:4px;border-radius:12px}.lobby-games .mini-choice-icon{width:29px;height:29px}.lobby-games .mini-choice-content strong{font-size:.62rem}.lobby-games .mini-choice-hint{min-height:0;margin-top:8px;font-size:.68rem}
  .lobby-roster h2{font-size:.85rem;margin-bottom:10px}.host-lobby .players{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.host-lobby .player-card .avatar.portrait{width:38px;height:38px}.host-lobby .player-name{font-size:.7rem}.host-lobby .player-status{font-size:.56rem}.host-lobby .avatar-edit{font-size:.58rem;padding:4px}.host-lobby .team-member{gap:6px}.host-lobby .team-member .avatar-edit{font-size:.6rem}
  .lobby-dock{gap:10px;padding:9px 12px max(10px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}.lobby-launch{flex-direction:column;align-items:stretch;gap:5px}.lobby-launch small{font-size:.6rem;line-height:1.2}.lobby-launch>.primary{font-size:.76rem;min-width:0;min-height:44px;padding:9px 12px;gap:4px}.lobby-shortcuts{gap:6px}.lobby-shortcut{width:48px;min-height:55px;border-radius:14px}.lobby-shortcut svg{width:23px;height:23px}.lobby-shortcut span{font-size:.54rem}
}
@media(max-width:360px){.mini-game-grid{gap:6px}.mini-choice-content{min-height:92px}.mini-choice-content strong{font-size:.65rem}}
@media(max-width:760px) and (max-height:700px){
  .host-lobby .topbar{height:48px}.host-lobby #app{margin-top:2px}.lobby-heading{margin-bottom:9px}.lobby-heading h1{font-size:1.2rem;margin-top:4px}.lobby-heading p{font-size:.65rem;margin-top:3px}.lobby-heading .pill{font-size:.55rem;padding:3px 6px}
  .lobby-panels{gap:8px}.lobby-panels>.card{padding:10px}.lobby-games .mini-picker legend{font-size:.74rem;margin-bottom:7px}.lobby-games .mini-game-grid{gap:5px}.lobby-games .mini-choice-content{min-height:55px;padding:4px 2px;gap:2px;border-radius:10px}.lobby-games .mini-choice-icon{width:23px;height:23px}.lobby-games .mini-choice-content strong{font-size:.57rem}.lobby-games .mini-choice-hint{font-size:.6rem;margin-top:6px}.mini-choice-check{width:14px;height:14px;line-height:14px;font-size:9px;right:3px;top:3px}
  .lobby-roster h2{font-size:.75rem;margin-bottom:6px}.host-lobby .player-card{padding:6px 3px 4px;gap:2px}.host-lobby .player-card .avatar.portrait{width:30px;height:30px}.host-lobby .player-name{font-size:.66rem}.host-lobby .player-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.host-lobby .player-card .avatar-edit{position:absolute;left:50%;top:2px;transform:translateX(-50%);width:40px;min-height:40px;margin:0;padding:0;font-size:0;background:transparent}.host-lobby .player-card .avatar-edit:after{content:"✎";position:absolute;right:0;bottom:3px;width:16px;height:16px;border-radius:6px;background:#eee5ff;color:#5b369d;font-size:12px;line-height:16px}
}

.game-tower{--game-ink:#98612b;--game-wash:#ffebd1}.game-snake{--game-ink:#26704f;--game-wash:#ddf3e5}.game-pairs{--game-ink:#8752a0;--game-wash:#f1e4fb}.game-math{--game-ink:#33639a;--game-wash:#e3edff}
/* More games remain selectable without displacing the fixed launch controls. */
.lobby-games .mini-game-grid{max-height:360px;overflow-y:auto;padding:3px;scrollbar-width:thin;overscroll-behavior:contain}
@media(max-width:760px){.lobby-games .mini-game-grid{max-height:285px}}
@media(max-width:760px) and (max-height:700px){.lobby-games .mini-game-grid{max-height:185px}}

/* Native invitation actions stay at the top of the existing invitation dialog. */
.invite-sms{text-align:left;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:16px;min-width:0}.invite-sms h3{font-size:1.1rem;margin-bottom:8px}.invite-actions{display:grid;gap:8px}.invite-sms .button{text-align:center;overflow-wrap:anywhere;display:block}.invite-recipient-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;font-size:.85rem}.invite-recipients{list-style:none;padding:0;margin:0 0 12px;max-height:210px;overflow:auto}.invite-recipients li{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line);padding:8px 0}.invite-recipients li>div{min-width:0;flex:1}.invite-recipients strong,.invite-recipients span{display:block;overflow-wrap:anywhere;font-size:.8rem}.invite-recipients span{color:var(--muted);margin-top:4px}.invite-recipients label{font-size:.7rem;margin-top:6px}.invite-recipients select{margin-top:4px;font-size:.8rem}.invite-recipients button{flex-shrink:0;min-width:44px;min-height:44px}.invite-preview-label{display:block;margin:14px 0 8px;font-size:.75rem}.invite-preview-label textarea{display:block;width:100%;resize:vertical;font-size:.8rem;line-height:1.5;min-height:90px}.invite-sms .invite-privacy{font-size:.7rem;color:var(--muted);margin:10px 0 0}.invite-sms #invite-status:empty{display:none}.invite-individual{margin:10px 0;font-size:.8rem}.invite-individual summary{cursor:pointer;color:var(--purple)}.invite-individual a{margin:6px 0}.player-voice-panel{border:1px solid #d9caf4;background:#f3edff;border-radius:16px;padding:14px;margin:12px 0;text-align:left}.player-voice-panel strong{font-size:.9rem}.player-voice-panel p{font-size:.8rem;margin:7px 0 10px}.player-voice-panel button{width:100%}

/* Portraits are twice their former width and height at every lobby breakpoint. */
.host-lobby .players{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.host-lobby .player-card{padding:16px 8px 12px;background:linear-gradient(160deg,#f4edff,#fff 70%);border-radius:20px;gap:7px}
.host-lobby .player-card .avatar.portrait{width:144px;height:144px;filter:drop-shadow(0 5px 6px #55348b20)}
.host-lobby .player-name{font-size:1rem;font-weight:800}
.host-lobby .team-member .avatar.portrait{width:96px;height:96px}
.host-lobby .team-member{display:grid;grid-template-columns:96px minmax(0,1fr) 30px;gap:8px;padding:10px 0}
.host-lobby .team-member .avatar{grid-row:span 2}.host-lobby .team-member .avatar-edit{grid-column:2;grid-row:2;justify-self:start}.host-lobby .team-member .remove{grid-column:3;grid-row:1}
@media(max-width:760px){
 .lobby-roster{order:-1}.host-lobby .players{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .host-lobby .player-card{padding:12px 3px 8px}.host-lobby .player-card .avatar.portrait{width:120px;height:120px}
 .host-lobby .teams-grid{grid-template-columns:1fr}.host-lobby .team-member{grid-template-columns:88px minmax(0,1fr) 30px}
 .host-lobby .team-member .avatar.portrait{width:88px;height:88px}
 .host-lobby .player-name{font-size:.85rem}.host-lobby .avatar-edit{font-size:.68rem}
 .lobby-roster>.players,.lobby-roster>.teams-grid{max-height:42dvh;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px}
}
@media(max-width:760px) and (max-height:700px){
 .host-lobby .player-card .avatar.portrait{width:100px;height:100px}
 .host-lobby .player-card .avatar-edit{position:static;transform:none;width:auto;min-height:30px;padding:4px 8px;font-size:.65rem;background:#f0e9ff;margin:0}
 .host-lobby .player-card .avatar-edit:after{content:none}
 .lobby-games .mini-game-grid{max-height:148px}
}
