/* Lobby controls remain native buttons, including keyboard activation. */
.pill-toggle{display:flex;gap:4px;min-width:0}
.pill-toggle button{flex:1;min-width:0;min-height:44px;padding:5px 8px;margin:0;border:2px solid #a8c9c7;border-radius:22px;background:#fffdf4;color:#244853;box-shadow:0 2px 0 #a8c9c7;font:800 12px/1.15 sans-serif;overflow-wrap:anywhere}
.pill-toggle button[aria-pressed=true]{background:#ffe657;border-color:#6330bb;color:#44236c;box-shadow:0 2px 0 #6330bb}
.pill-toggle button:focus-visible,.result-tabs button:focus-visible{outline:3px solid #da4da0;outline-offset:2px}
#solo-round{grid-template-columns:1fr;gap:7px}
.rule-field{display:grid;grid-template-columns:60px minmax(0,1fr);gap:6px;align-items:center;font-size:12px;text-align:left}
#solo-dialog .solo-mode-cards .card-art{height:40px;min-height:40px}
#solo-dialog .solo-mode-cards button{min-height:86px}
#solo-dialog .solo-options{gap:6px;margin-bottom:6px}
#solo-dialog{padding-top:6px;padding-bottom:6px}
/* Keep timer, theme and opponents in one measured flow, in physical HUD pixels. */
#match-center-stack{position:absolute;top:calc(12px * var(--hud-scale));left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:calc(7px * var(--hud-scale));pointer-events:none;max-width:80%}
#match-ui #match-center-stack #versus-hud{position:static;transform:none;inset:auto;margin:0;padding:0}
#match-center-stack #theme-pill,#match-center-stack #opponent-chips{position:static;transform:none;inset:auto;margin:0}
#match-center-stack #theme-pill{font-size:calc(13px * var(--hud-scale));line-height:1.3;padding:calc(5px * var(--hud-scale)) calc(12px * var(--hud-scale));max-width:100%;white-space:normal;text-align:center}
#match-center-stack #opponent-chips{gap:calc(6px * var(--hud-scale))}
#match-center-stack #opponent-chips span{font-size:calc(12px * var(--hud-scale));line-height:1.3;padding:calc(4px * var(--hud-scale)) calc(7px * var(--hud-scale));white-space:nowrap}
#match-center-stack #match-stage,#match-center-stack #spectator-note{position:static;transform:none;inset:auto;max-width:100%;font-size:calc(12px * var(--hud-scale));text-align:center}
#progress-home-title{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:5px 12px;border:2px solid #e9d390;border-radius:20px;background:#fff5cc;color:#654d28;font-size:13px;line-height:1.2;white-space:normal;max-width:160px;text-align:center}
/* Result and rewards share the same body slot; actions never move on receipt. */
#result-dialog .result-panel{display:flex;flex-direction:column;height:min(640px,calc(100% - 16px));max-height:calc(100% - 16px);padding:14px 18px;overflow:hidden}
#result-banner{flex-shrink:0}
#result-title{flex-shrink:0}
.result-tabs{display:flex;justify-content:center;gap:8px;margin:8px 0;flex-shrink:0}
.result-tabs button{min-height:44px;padding:6px 18px;margin:0;border:2px solid #c9b7df;border-radius:22px;box-shadow:none;background:#f1eafa;font-size:14px}
.result-tabs button[aria-selected=true]{background:#6330bb;color:white;border-color:#6330bb}
.result-body{flex:1;min-height:0;position:relative;overflow:hidden}
#result-summary,#result-rewards{height:100%;overflow:auto;overscroll-behavior:contain}
#result-rewards{padding:6px 8px;animation:reward-rise .25s ease both}
#result-progress{margin:0 auto;font-size:14px}
#result-progress .reward-reveals{max-height:none;overflow:visible}
#result-progress .result-missions{font-size:12px}
#result-dialog #result-best-word{padding:10px 4px}
#result-best-word strong{font-size:30px;line-height:1.2}
#result-status,#result-votes{flex-shrink:0;margin:3px 0;font-size:12px;line-height:1.3}
#result-votes:empty{display:none}
#result-dialog .result-actions{flex-shrink:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
#result-dialog .result-actions #rematch,#result-dialog .result-actions #result-lobby{grid-column:auto}
#result-dialog .result-actions #rematch-start{white-space:nowrap;overflow-wrap:normal;font-size:12px;padding:5px 3px;letter-spacing:0}
@media(max-width:600px){
 #result-dialog .result-panel{height:min(620px,calc(100% - 16px));padding:12px 10px}
 #result-dialog #result-banner{font-size:36px}
 #result-dialog #result-title{font-size:16px;margin:6px 0 0}
 .result-tabs{margin:6px 0}
 #result-best-word strong{font-size:26px}
 #result-dialog .result-actions{gap:6px}
 #result-dialog .result-actions button{font-size:13px}
 #match-center-stack #theme-pill{font-size:calc(12px * var(--hud-scale));margin-top:calc(20px * var(--hud-scale))}
 #match-center-stack #theme-pill[hidden]+#opponent-chips{margin-top:calc(20px * var(--hud-scale))}
 #match-center-stack #opponent-chips span{font-size:calc(11px * var(--hud-scale))}
 #progress-home-title{font-size:12px;max-width:135px;white-space:normal}
}
@media(prefers-reduced-motion:reduce){#result-rewards{animation:none}}

/* Pre-sale guidance stays inside the existing stage and scrolling panels. */
#in-app-banner{order:-1;flex-shrink:0;width:min(780px,100%);margin:70px auto 8px;padding:10px 14px;background:#fff1a1;border:2px solid var(--ink);border-radius:14px;font-size:14px;line-height:1.5}
#in-app-banner p{margin:0 0 6px}#in-app-banner button{min-width:44px;min-height:44px;font-size:13px;margin-right:8px}
#intro:has(#in-app-banner:not([hidden])) .lobby-brand{margin-top:0;width:min(660px,calc(100% - 16px))}
#intro:has(#in-app-banner:not([hidden])) .lobby-brand h1{font-size:30px}
#intro .lobby-panel:has(#in-app-banner:not([hidden])),#intro .lobby-panel:has(#gift-receive:not([hidden])){overflow-y:auto;overflow-x:hidden}
.entry-note{background:#fffdf5ed;border-radius:8px;padding:6px 10px;margin:0 auto;max-width:600px;font-size:13px;text-align:center;line-height:1.5}
#device-check-open{justify-self:center;background:#fffdf5;max-width:600px;margin:0;font-size:13px;min-height:44px}
#purchase-device-check{min-height:44px;text-align:left}.entry-warning{background:#fff1a1;padding:12px;border-radius:12px}
.purchase-benefits p{margin:6px 0}#purchase-play button,#guest-buy,#device-check-dialog button,#daily-limit-dialog button{min-width:44px;min-height:44px}
#device-text{font-size:32px;font-weight:900;overflow-wrap:anywhere;min-height:1.5em}#device-level{width:100%;height:20px;accent-color:#007c70}
#purchase-dialog,#device-check-dialog,#daily-limit-dialog,#in-app-dialog{overflow-y:auto;overscroll-behavior:contain}
#guest-result{margin:4px 0;font-size:14px}
.guest-offer{display:flex;align-items:center;gap:8px;flex-shrink:0;margin-top:4px}
.guest-offer:has(#guest-buy[hidden]){display:none}
.guest-offer #guest-result{flex:1;min-width:0;text-align:left;font-size:12px;line-height:1.3}
.guest-offer #guest-buy{flex:0 1 auto;font-size:12px;line-height:1.25;padding:6px 10px;margin:0;max-width:52%;white-space:normal}
#result-dialog:has(#guest-buy:not([hidden])) #result-banner{font-size:44px}
#result-dialog:has(#guest-buy:not([hidden])) #result-title{font-size:16px;margin:4px 0}
#result-dialog:has(#guest-buy:not([hidden])) .result-tabs{margin:4px 0}
#result-dialog:has(#guest-buy:not([hidden])) .portrait.toy-portrait{width:56px;height:64px}
#result-dialog:has(#guest-buy:not([hidden])) .result-fighter{gap:2px;font-size:12px}
#result-dialog:has(#guest-buy:not([hidden])) #result-best-word{padding:4px}
#result-dialog:has(#guest-buy:not([hidden])) #result-best-word strong{font-size:24px}
#result-dialog #result-best-word strong{display:block;overflow-wrap:anywhere}
#result-dialog .ffa-podium .player-title{display:block}
@media(max-width:600px){
 #result-dialog:has(#guest-buy:not([hidden])) #result-banner{font-size:36px}
 #result-dialog:has(#guest-buy:not([hidden])) .portrait.toy-portrait{width:48px;height:52px}
 #result-dialog:has(#guest-buy:not([hidden])) .result-actions button{font-size:12px;line-height:1.2;padding:6px 4px}
}
@container ui (max-width:600px){#in-app-banner{margin-top:96px;font-size:12px;padding:8px}#intro:has(#in-app-banner:not([hidden])) .lobby-brand{margin-top:0}#intro:has(#in-app-banner:not([hidden])) .lobby-brand h1{font-size:24px}.entry-note{font-size:12px}#device-check-open{font-size:12px}#guest-result{font-size:12px}}
