/* Party shell. Gameplay geometry and HUD placement remain in style.css. */
:root{--ink:#242044;--orange:#fe754b;--mint:#007c70;--party-purple:#7333e7;--party-pink:#ff62b0;--party-yellow:#ffe657;--party-blue:#55d9f4;--paper:#fffdf5;font-family:"M PLUS Rounded 1c","Arial Rounded MT Bold","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;font-weight:500;color:var(--ink);background:#7333e7}
button,input,select{font-family:inherit}
button{border:3px solid var(--ink);border-radius:16px;background:linear-gradient(#fff 0 45%,#eee9fb 46%);box-shadow:0 5px 0 var(--ink);font-weight:900;transition:transform .16s ease;overflow-wrap:anywhere;hyphens:auto}
button:hover:not(:disabled){background:linear-gradient(#fff7ae,#ffe657);transform:translateY(-2px)}
button:active:not(:disabled){transform:translateY(3px)}
button:disabled{opacity:.58}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #0768ae;outline-offset:4px;box-shadow:0 0 0 7px #fff}
.primary{border:3px solid var(--ink);color:var(--ink);background:linear-gradient(#fff6a4 0 12%,#ffe657 13% 65%,#ffc845 66%);box-shadow:0 6px 0 var(--ink);font-size:17px}
.primary:hover:not(:disabled){background:linear-gradient(#fff8c9,#ffe657)}
.secondary{background:linear-gradient(#fff,#e5e1ff);border:3px solid var(--ink)}
input:not([type=range]):not([type=checkbox]),select{border:3px solid var(--ink);border-radius:12px;background:#fff;color:var(--ink)}
input[type=range]{accent-color:#7333e7;min-height:44px}
/* Full-bleed key art above a CSS-only fallback. No image is needed for contrast. */
#intro{isolation:isolate;align-items:stretch;padding:18px max(24px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));background:linear-gradient(0deg,#33236dd9,transparent 55%),url("/img/ui/keyart.webp") center 44% / cover no-repeat,radial-gradient(ellipse at 50% 42%,#91f1fb 0 20%,transparent 55%),linear-gradient(155deg,#80e4ef 0 43%,#ac70f4 43% 69%,#ff68b0 69% 84%,#ffe657 84%);color:var(--ink)}
#intro::before{content:"";position:absolute;inset:55% 0 0;z-index:-1;pointer-events:none;background:linear-gradient(168deg,transparent 0 43%,#7333e7d9 43% 66%,#ff62b0de 66% 86%,#ffe657ed 86%)}
#intro .lobby-panel{position:relative;display:flex;flex-direction:column;align-items:center;width:100%;height:100%;max-width:1200px;max-height:none;overflow:visible;margin:auto;padding:0;border:0;border-radius:0;background:none;box-shadow:none}
.lobby-nav{position:absolute;top:0;right:0;z-index:2;margin:0;gap:10px}
.lobby-nav button{width:46px;height:46px;min-width:44px;background:#fffdf5;border:3px solid var(--ink);box-shadow:0 4px 0 var(--ink);border-radius:14px}
.lobby-identity{position:absolute;top:0;left:0;max-width:calc(100% - 245px);gap:8px;margin:0;justify-content:start;min-height:56px}
#avatar-mini{width:56px;height:62px;flex-basis:56px;background:#ffe657;border:3px solid var(--ink);border-radius:18px;box-shadow:0 4px 0 var(--ink);overflow:hidden}
.lobby-identity .status-chip{padding:7px 12px;border:2px solid var(--ink);box-shadow:0 3px 0 var(--ink);font-size:12px;line-height:1.4;background:#fffdf5;color:var(--ink);max-width:260px}
.status-chip[data-state=purchased]{background:#b0ffb9!important;color:#183d30}
.status-chip[data-state=guest]{background:#ffe657!important}
.lobby-brand{position:relative;isolation:isolate;width:min(660px,100%);margin:58px auto 0;text-align:center;flex-shrink:0;pointer-events:none}
#intro .lobby-panel h1{font-family:"Dela Gothic One","M PLUS Rounded 1c",sans-serif;font-size:clamp(34px,4.8cqw,62px);font-weight:900;letter-spacing:-.045em;line-height:1.18;margin:0 auto 12px;transform:rotate(-4deg);animation:logo-pop .65s cubic-bezier(.2,1.6,.4,1) both;overflow-wrap:anywhere}
#intro h1 span{color:#fff564;-webkit-text-stroke:7px #242044;paint-order:stroke fill;text-shadow:3px 7px 0 #242044,5px 10px 0 #ff62b0}
.letter-burst{position:absolute;inset:-26px -10px -10px;z-index:-1;display:flex;align-items:center;justify-content:space-around;font-family:"Dela Gothic One",sans-serif;font-size:80px;letter-spacing:.12em;color:#fff9;transform:rotate(-8deg);text-shadow:0 0 18px #fff;mask-image:linear-gradient(#000,transparent);pointer-events:none}
#intro .lead{display:table;margin:0 auto;padding:5px 14px;font-size:14px;background:#fffdf5f2;border:2px solid var(--ink);border-radius:30px;box-shadow:0 3px 0 var(--ink);line-height:1.4}
#intro #brand-subtitle{color:#fff;margin:0 0 6px;font-weight:900;text-shadow:1px 2px 0 #242044}
.lobby-actions{width:min(940px,100%);margin-top:auto;gap:9px;flex-shrink:0}
#lobby-controls{min-width:0}



.main-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.main-actions:has(button:not([hidden])){margin-top:0}
#intro .main-actions button{margin:0;min-height:142px;text-align:start;font-size:clamp(15px,1.45cqw,19px);line-height:1.25;padding:10px 12px;gap:10px}
.main-actions [data-i18n]{flex:1;word-break:keep-all;line-break:strict;overflow-wrap:normal;hyphens:none;text-wrap:balance}
.main-actions .card-arrow{position:absolute!important;right:10px;bottom:6px;pointer-events:none}
.illustrated{position:relative;isolation:isolate;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}
.illustrated>span:not(.card-art){position:relative;z-index:1;min-width:0}
.card-art{display:block;position:relative;flex:0 0 42%;align-self:stretch;min-height:70px;overflow:hidden;background:radial-gradient(circle at 40% 35%,#ffffffb8 0 15%,transparent 16%),repeating-linear-gradient(125deg,transparent 0 18px,#ffffff45 18px 30px),linear-gradient(135deg,#55d9f4,#b488ff);border-radius:10px}
.card-art::before{content:"✦";position:absolute;inset:0;display:grid;place-content:center;color:#fff;font-size:54px;text-shadow:2px 3px 0 var(--ink);z-index:-1}
.card-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;font-size:0;color:transparent}
.card-arrow{margin-left:auto;font-size:20px}
#practice-mode{background:linear-gradient(125deg,#fff196 0 35%,#ffe657 36%)}
#online-open{background:linear-gradient(125deg,#b1f4ff 0 35%,#55d9f4 36%)}
#avatar-open{background:linear-gradient(125deg,#ffd6ef 0 35%,#ff87c5 36%)}
#login,#buy{width:min(560px,100%);justify-self:center;font-size:20px;min-height:68px}
#buy .card-art{height:76px;flex-basis:110px}
#open-room{max-width:560px;display:block;margin:10px auto 0;background:#c5f6ff}
.lobby-secondary-actions{display:flex;justify-content:center}
#how-open{width:min(280px,100%);margin:0;background:#fffdf5;font-size:14px}
#gift-buy{justify-self:center;background:#fffdf5;border:2px solid var(--ink);box-shadow:0 3px 0 var(--ink);border-radius:99px;max-width:100%;padding:5px 18px;font-size:12px;text-decoration:none}
#intro:has(.status-chip[data-state=purchased]) #open-room,#intro:has(.status-chip[data-state=purchased]) .lobby-secondary-actions{display:none}
#intro:has(.status-chip:not([data-state=purchased])) .main-actions{display:none}
#intro #load-status,#intro #purchase-status{margin:8px auto 0;padding:3px 8px;font-size:11px;color:#fff;font-weight:800;text-shadow:0 1px 3px #242044;max-width:620px;flex-shrink:0}
.gift-receive{width:min(560px,100%);margin:auto auto 10px;background:#fff1a1;border:3px solid var(--ink);border-radius:20px;padding:16px;box-shadow:0 6px 0 var(--ink)}
#intro:has(#gift-receive:not([hidden])) .lobby-actions{margin-top:0}
#intro:has(#gift-receive:not([hidden])) .lobby-brand{margin-bottom:16px}
/* Native dialogs retain top-layer focus, Escape and closed-state semantics. */
.account-modal{width:min(780px,calc(100cqw - 40px));max-height:calc(100cqh - 40px);padding:24px 28px 28px;border:4px solid var(--ink);border-radius:28px;color:var(--ink);background:linear-gradient(155deg,#fffdf5 0 75%,#eee5ff 75%);box-shadow:0 9px 0 var(--ink),0 20px 0 #24204433;line-height:1.5;scrollbar-color:#7333e7 #eee5ff}
.account-modal::backdrop{background:linear-gradient(135deg,#392377e8,#31215bbd)}
.dialog-head{gap:12px}
.account-modal .dialog-head{border-bottom:3px solid var(--ink);padding-bottom:14px;margin-bottom:18px}
.account-modal .dialog-head h2{font-size:clamp(20px,3cqw,28px);line-height:1.25;font-weight:900;min-width:0}
.account-modal .dialog-head>button{order:-1;flex:0 0 auto;min-width:44px;white-space:nowrap;overflow-wrap:normal;hyphens:none}
.account-modal .dialog-head>button[data-i18n]{font-size:14px}
.account-modal button{min-height:44px;padding:8px 12px}
.account-modal .primary{min-height:52px}
.account-modal section{border-top:2px dashed #b8a5db}
.account-modal .note{color:#514268}
.account-modal h3{font-weight:900}
.account-modal summary{min-height:44px;cursor:pointer;padding:12px 4px;font-size:13px;font-weight:800}
.shop-modal{width:min(820px,calc(100cqw - 40px))}
.shop-hero{display:flex;align-items:center;gap:20px;border-radius:18px;background:linear-gradient(125deg,#ffdc63,#ff9cdb);padding:10px}
.shop-hero .card-art{flex:0 0 110px;height:96px}
.shop-hero h3{font-size:24px;margin:0;padding:6px;overflow-wrap:anywhere}
#purchase-copy{font-size:14px;margin:14px 0 6px}
#billing-note{font-size:11px;margin:6px 0 12px}
.price-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.price-options button{display:flex;flex-direction:column;justify-content:center;position:relative;min-height:155px;padding:30px 10px 14px;gap:5px;background:linear-gradient(150deg,#fff,#e9e0ff);text-align:center}
.price-options button[data-quantity="3"],.price-options button[data-quantity="4"]{background:linear-gradient(150deg,#fff4a9,#ffda63)}
.price-options button>span:not(.deal-ribbon){width:100%}
.pack-icon{font-size:24px;color:#7333e7;letter-spacing:-5px;padding-right:5px;text-shadow:1px 2px 0 #242044}
.price-options small{font-size:11px;line-height:1.4;margin:0;width:100%;font-weight:800}
.deal-ribbon{position:absolute;top:0;right:0;left:0;background:var(--ink);color:#fff;font-size:11px;line-height:1.3;padding:3px 6px;border-radius:9px 9px 0 0}
.shop-notices{margin-top:18px;border-top:2px dashed #b8a5db}
.shop-notices p{font-size:12px}
.shop-notices a{color:#5630a3}
.solo-options{gap:12px;margin-bottom:20px}
.solo-mode-cards,.online-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.solo-mode-cards button{min-height:128px;padding:8px;font-size:18px;background:#fff}
.solo-mode-cards .card-art{flex:0 0 44%;height:106px}
.solo-mode-cards button[aria-pressed=true]{background:#fff196;border-color:var(--ink);box-shadow:0 5px 0 var(--ink),0 0 0 3px #ff8a43}
.difficulty-pills{display:flex;gap:8px;justify-content:center}
.difficulty-pills button{flex:1;max-width:220px;font-size:13px;border-radius:99px;background:#fff}
.difficulty-pills button[aria-pressed=true]{background:#55d9f4;border-color:var(--ink)}
.stage-picker{margin:0 0 14px}
.stage-picker legend{font-size:16px;font-weight:900;margin-bottom:10px}
.stage-picker>div{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.stage-picker button{display:flex;flex-direction:column;align-items:center;gap:6px;min-height:96px;border:3px solid var(--ink);border-radius:14px;background:#fff;padding:6px;font-size:12px;line-height:1.25}
.stage-picker button::before{display:none}
.stage-picker .card-art{width:100%;height:auto;aspect-ratio:16/9;min-height:0;flex:none}
.stage-picker button[data-stage=shrine] .card-art{background:linear-gradient(135deg,#ffbe68,#d65767)}
.stage-picker button[data-stage=neon] .card-art{background:linear-gradient(135deg,#6c38d7,#fa6dcc)}
.stage-picker button[data-stage=ice] .card-art{background:linear-gradient(135deg,#a6f2ff,#7795ea)}
.stage-picker button[aria-pressed=true]{background:#fff196;border-color:var(--ink);box-shadow:0 5px 0 var(--ink),0 0 0 3px #ff8a43}
.stage-picker button:last-child{min-height:44px;flex-direction:row;justify-content:center;gap:10px;background:linear-gradient(120deg,#d0f9ff,#eed5ff)}
.stage-picker button:last-child::before{content:"✦";display:inline;background:none;font-size:22px;width:auto;height:auto;margin:0}
.online-choices button{min-height:200px;font-size:22px}
.online-choices #online-join{flex-direction:column;justify-content:center;background:linear-gradient(135deg,#c4f6ff,#77dbf8)}
.room-symbol{font-family:"Dela Gothic One",sans-serif;font-size:66px;line-height:1.1;color:#7333e7}
/* Keep the creator's stages, invite code and start action in one viewport. */
.waiting-dots{display:flex;gap:5px}
.waiting-dots i{width:8px;height:8px;background:#7333e7;border-radius:50%;animation:waiting-hop .8s ease-in-out infinite alternate}
.waiting-dots i:nth-child(2){animation-delay:.15s}.waiting-dots i:nth-child(3){animation-delay:.3s}
#avatar-stage{background:radial-gradient(ellipse,#fff7a1 0 35%,#d8c0ff 36% 65%,transparent 66%);border:3px solid var(--ink)}
.avatar-tiles{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))!important;gap:7px}
.avatar-tiles button{min-width:44px;border-color:var(--ink);box-shadow:0 3px 0 var(--ink)}
.avatar-tiles button[aria-pressed=true]{outline:3px solid #7333e7;outline-offset:1px}
.avatar-name-label input{font-size:16px}
#account-license{color:#096348}
#gift-list li{background:#eee5ff;border:2px solid var(--ink)}
.how-content{border-radius:20px;background:linear-gradient(135deg,#fff1a1,#ffd4e9);padding:14px 20px}
.how-content #how-icon{font-size:56px}
.how-controls{background:#e2f7ff;color:var(--ink);border:2px solid var(--ink)}
.how-dots{gap:4px;margin:12px 0}
.how-dots button{box-shadow:none;color:#736687}
.how-dots button[aria-current=true]{background:#ffe657;color:var(--ink);border:2px solid var(--ink)}
.link-button{box-shadow:none}
#language-dialog{max-width:620px}
#first-language-dialog{max-width:640px;text-align:center}#first-language-dialog h2{margin:0 0 4px}.first-language-local{margin:0 0 16px;font-weight:700;min-height:1.4em}.first-language-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.first-language-list button{min-height:52px;font-size:18px}.first-language-list button[aria-current="true"]{outline:4px solid var(--ink);outline-offset:2px}.first-language-hint{margin:14px 0 0;font-size:14px;opacity:.8}
#language-dialog select{width:100%}
.audio-settings label,.max-settings label{font-size:15px}
.audio-settings output,.max-settings output{background:#ffe657;padding:1px 8px;border-radius:8px;color:var(--ink)}
.celebration{animation:logo-pop .6s ease both}
/* Result avatars share the lobby renderer and the game's existing frame loop. */
#result-dialog{background:linear-gradient(135deg,#5436b6e8,#bb4196dc);backdrop-filter:none}
#result-dialog .result-panel{position:relative;isolation:isolate;width:min(610px,100%);max-width:610px;border:4px solid var(--ink);border-radius:28px;background:linear-gradient(150deg,#fffdf5 70%,#ffe184 70%);box-shadow:0 8px 0 var(--ink);text-align:center;padding:22px 28px;overflow:auto}
#result-banner{font-family:"Dela Gothic One",sans-serif;font-size:clamp(48px,10cqw,82px);color:#ffe657;-webkit-text-stroke:5px var(--ink);paint-order:stroke fill;line-height:1.1;text-shadow:3px 6px 0 #ff62b0;transform:rotate(-5deg)}
#result-dialog[data-outcome=win] #result-banner{animation:logo-pop .7s cubic-bezier(.2,1.6,.4,1) both}
#result-dialog[data-outcome=lose] #result-banner{color:#b5b1ff;animation:sad-bounce .75s ease both}
#result-title{margin:12px 0;font-size:22px}
#result-score{font-size:20px;font-weight:900;margin:12px 0}
#result-status{font-size:13px;overflow-wrap:anywhere}
.result-avatars{display:flex;gap:28px;justify-content:center}
.result-fighter{min-width:0;flex:0 1 180px;display:grid;justify-items:center;gap:6px;font-size:13px;font-weight:800}
.result-fighter>span{max-width:100%;overflow-wrap:anywhere}
.portrait{position:relative;width:94px;height:110px;margin-top:12px;border:3px solid var(--ink);border-radius:32px 32px 18px 18px;background:var(--avatar-color,#55d9f4);box-shadow:0 5px 0 var(--ink);transform:rotate(-4deg)}
.result-fighter:nth-child(2) .portrait{transform:rotate(4deg)}
.portrait canvas{position:absolute;left:13%;top:22%;width:74%;height:64%;border-radius:45%;background:#ffe1b6}
.portrait-hat{position:absolute;top:-20px;left:0;width:100%;font-size:35px;line-height:1;z-index:1}
.portrait.toy-portrait{width:min(130px,100%);height:154px;margin-top:0;border:0;border-radius:0;background:none;box-shadow:none;transform:none}
.portrait.toy-portrait canvas{inset:0;width:100%;height:100%;border-radius:0;background:none}
@container ui (max-width:480px){.portrait.toy-portrait{width:min(110px,100%);height:130px}}
.result-confetti{display:none;position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:-1}
#result-dialog[data-outcome=win] .result-confetti{display:block}
.result-confetti i{position:absolute;left:8%;top:0;width:12px;height:22px;background:#ff62b0;animation:confetti-drop 2.6s linear 2 both}
.result-confetti i:nth-child(2n){background:#55d9f4;width:18px;height:10px}
.result-confetti i:nth-child(2){left:20%;animation-delay:.4s}.result-confetti i:nth-child(3){left:31%;animation-delay:.8s}.result-confetti i:nth-child(4){left:43%;animation-delay:1.2s}.result-confetti i:nth-child(5){left:57%;animation-delay:.2s}.result-confetti i:nth-child(6){left:69%;animation-delay:.6s}.result-confetti i:nth-child(7){left:80%;animation-delay:1s}.result-confetti i:nth-child(8){left:92%;animation-delay:1.4s}
/* HUD skin only: no changed bounds, padding, positions or type sizes. */
.hud{font-family:"M PLUS Rounded 1c",sans-serif}
.hud .brand,.hud .score,.hud .shot-card,#versus-hud{border-color:#242044;box-shadow:inset 0 0 0 2px #242044,0 3px 0 #242044;background-color:#fffdf5}
.hud .brand b span{color:#7333e7}
.hud button{box-shadow:0 3px 0 var(--ink)}
.hud .meter-row,.hud .status-row{background:#fff6c9}
.hud #mic-fill{background:linear-gradient(90deg,#55d9f4,#b6f060,#ffe657,#ff62b0)}
#self-status{background:#342564ed}
.buff-badges>span{border-color:var(--buff-color)}
@keyframes logo-pop{from{opacity:0;transform:translateY(-20px) rotate(-10deg) scale(.78)}to{opacity:1;transform:rotate(-4deg) scale(1)}}
@keyframes waiting-hop{to{transform:translateY(-6px);opacity:.45}}
@keyframes sad-bounce{0%{transform:translateY(-14px) rotate(-7deg)}45%{transform:translateY(5px) rotate(4deg)}75%{transform:translateY(-4px) rotate(-3deg)}100%{transform:rotate(-5deg)}}
@keyframes confetti-drop{0%{opacity:0;transform:translateY(-30px) rotate(0)}10%{opacity:1}100%{opacity:0;transform:translateY(550px) rotate(360deg)}}
@container ui (max-width:600px){
  #intro{padding:10px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background-position:center,center 34%,center,center}
  #intro .lobby-panel{padding:0}
  .lobby-nav{gap:5px}.lobby-nav button{width:44px;height:44px;border-radius:12px;font-size:19px}
  .lobby-identity{max-width:145px;align-items:start;gap:6px}.lobby-identity .status-chip{position:absolute;left:0;top:60px;max-width:calc(100cqw - 24px);width:max-content;font-size:10px;padding:4px 10px}
  #avatar-mini{width:48px;height:52px;flex-basis:48px}
  .lobby-brand{margin-top:103px;width:100%}
  #intro .lobby-panel h1{font-size:clamp(28px,7.8cqw,44px);margin:0 0 10px;line-height:1.2;letter-spacing:-.045em}
  #intro h1 span{-webkit-text-stroke-width:5px;text-shadow:2px 5px 0 #242044,3px 7px 0 #ff62b0}
  .letter-burst{inset:-15px 0 0;font-size:48px}
  #intro .lead{font-size:11px;padding:4px 9px;max-width:100%}
  #intro #brand-subtitle{font-size:12px}
  .lobby-actions{gap:8px}
  
  
  .main-actions{grid-template-columns:minmax(0,1fr);gap:9px}
  #intro .main-actions button{min-height:62px;padding:4px 12px 4px 4px;font-size:17px;gap:12px}
  .main-actions .card-art{flex:0 0 72px;min-height:50px}
  .main-actions .card-arrow{position:relative!important;right:auto;bottom:auto;flex:none}
  .card-art::before{font-size:32px}
  #login,#buy{font-size:17px;min-height:60px}
  #buy .card-art{height:60px;flex-basis:72px}
  #gift-buy{font-size:11px;min-height:44px}
  .account-modal,.shop-modal{width:calc(100cqw - 20px);max-height:calc(100cqh - 24px);padding:14px 14px 20px;border-radius:22px}
  .account-modal .dialog-head{margin-bottom:14px;padding-bottom:10px;gap:10px}
  .account-modal .dialog-head h2{font-size:20px}
  .account-modal p{font-size:13px}
  .shop-hero{gap:10px}.shop-hero .card-art{height:72px;flex-basis:80px}.shop-hero h3{font-size:19px}
  .price-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
  .price-options button{min-height:122px;padding:25px 8px 10px;font-size:14px}
  .pack-icon{font-size:19px}.price-options small{font-size:10px}
  .solo-mode-cards{gap:10px}.solo-mode-cards button{flex-direction:column;min-height:116px;font-size:14px;padding:6px;gap:5px}
  .solo-mode-cards .card-art{flex:none;width:100%;height:62px;min-height:62px}
  .solo-options{margin-bottom:15px;gap:10px}
  .difficulty-pills{gap:6px}.difficulty-pills button{font-size:11px;padding:6px 5px}
  .stage-picker>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stage-picker button{min-height:76px;padding:4px;font-size:11px;gap:3px}
  .stage-picker .card-art{height:43px;aspect-ratio:auto}
  .stage-picker legend{font-size:14px;margin-bottom:6px}
  .account-modal .item-hint{font-size:10px;margin:0 0 9px}
  .online-choices{grid-template-columns:1fr;gap:14px}
  .online-choices button{min-height:130px;font-size:21px}
  .online-choices #online-join{flex-direction:row;gap:22px}.room-symbol{font-size:54px}
  .avatar-layout{grid-template-columns:90px minmax(0,1fr);gap:0 12px}
  .avatar-tiles{gap:6px}.avatar-tiles button{padding:2px}
  .avatar-tiles canvas{width:32px;height:32px}
  #avatar-stage{height:104px}
  .how-content{padding:10px 12px;min-height:0}.how-content #how-icon{font-size:40px;margin:0}
  .how-content h3{font-size:18px}.how-content p{font-size:13px}
  #result-dialog .result-panel{padding:18px 16px}
  #result-banner{font-size:54px}.portrait{width:76px;height:90px}
  #result-score{font-size:16px}.result-avatars{gap:16px}
}
@container ui (max-height:580px) and (min-width:601px){
  .lobby-brand{margin-top:45px}#intro .lobby-panel h1{font-size:36px;margin-bottom:5px}
  #intro .lead{font-size:11px}#intro .main-actions button{min-height:84px;font-size:16px}
  .main-actions .card-art{min-height:65px}.lobby-actions{gap:7px}
  .lobby-identity .status-chip{font-size:11px}
  .account-modal{padding:14px 22px 22px}
}
@container ui (max-height:620px) and (max-width:600px){
  .lobby-brand{margin-top:96px}#intro .lobby-panel h1{font-size:28px}
  #intro .lead{font-size:10px}.lobby-actions{gap:6px}
  #intro .main-actions button{min-height:56px;font-size:15px}.main-actions .card-art{min-height:44px}
  #intro #load-status,#intro #purchase-status{font-size:10px;margin-top:4px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
  button:hover:not(:disabled),button:active:not(:disabled){transform:none}
}

/* One design space for every menu and HUD; canvas remains viewport-sized. */
:root{--ui-width:1280px;--ui-height:720px;--ui-scale:1;--ui-left:0px;--ui-top:0px}
#ui-stage{position:absolute;left:var(--ui-left);top:var(--ui-top);width:var(--ui-width);height:var(--ui-height);transform:scale(var(--ui-scale));transform-origin:0 0;container:ui / size;pointer-events:none}
#match-ui{display:contents}
#ui-stage .overlay,#ui-stage dialog,#ui-stage #jump{pointer-events:auto}
#ui-stage #intro{position:absolute}
/* Extend every screen background to the viewport; padding keeps UI in the
   centred design area. Portrait design height already fills the viewport. */
#ui-stage .overlay{inset:var(--hud-inset-y) var(--hud-inset-x);padding:calc(var(--screen-top,16px) - var(--hud-inset-y)) calc(var(--screen-right,16px) - var(--hud-inset-x)) calc(var(--screen-bottom,16px) - var(--hud-inset-y)) calc(var(--screen-left,16px) - var(--hud-inset-x))}
#intro{--screen-top:18px;--screen-right:max(24px,env(safe-area-inset-right));--screen-bottom:max(14px,env(safe-area-inset-bottom));--screen-left:max(24px,env(safe-area-inset-left))}
@container ui (max-width:600px){
 #intro{--screen-top:10px;--screen-right:max(12px,env(safe-area-inset-right));--screen-bottom:max(12px,env(safe-area-inset-bottom));--screen-left:max(12px,env(safe-area-inset-left))}
}
html,body{width:100%;height:100%;overflow:hidden}
#game:has(#intro:not([hidden])) #canvas{visibility:hidden}
/* Native modal top-layer positioning escapes ancestor transforms: apply the
   same scale explicitly, retaining native focus trapping and Escape behavior. */
#ui-stage dialog{position:fixed;inset:auto;left:calc(var(--app-width,100vw) / 2);top:calc(var(--app-height,100svh) / 2);margin:0;max-width:none;transform:translate(-50%,-50%) scale(var(--ui-scale));transform-origin:center}
#ui-stage #language-dialog{max-width:620px}
.gift-receive{font-size:17px;font-weight:800;line-height:1.6}
.gift-receive[data-state=success]{background:#c7ffd6}
.gift-receive[data-state=success] #gift-status{font-size:28px}
.gift-receive[data-state=success] #gift-status::before{content:"🎉";display:block;font-size:44px}
#gift-share{display:flex;flex-wrap:wrap;gap:10px}
#gift-share-url{width:100%;min-width:0;font-size:12px}
#intro:has(#gift-receive:not([hidden])) .lobby-actions{display:none}
#intro:has(#gift-receive:not([hidden])) .gift-receive{margin:auto}
@container ui (max-width:600px){
 .gift-receive{font-size:16px;padding:16px}
 #intro:has(#gift-receive:not([hidden])) .lobby-brand{margin-bottom:14px}
}
