/* Main menu is a viewport-sized shell. Only explicit dialogs scroll. */
#menu[data-invite-failed=true] #join-with-code,#menu[data-invite-failed=true] .button-note{display:none}
#menu{height:100dvh;min-height:0;overflow:hidden;padding:clamp(12px,3vw,36px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;box-sizing:border-box;background:linear-gradient(90deg,#0c140ee8,#111a12aa 65%,#111a1260)}
#menu[hidden]{display:none}#menu:not([data-state=home]) .home-intro{display:none}#menu .topbar{height:auto;min-height:44px;padding:0;gap:12px;border:0}#menu .brand{font-size:18px}#menu .edition{font-size:13px}#menu .fullscreen-button{margin-left:auto}
.home-content{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:clamp(12px,3vh,28px);min-height:0}.home-intro{text-align:center}.home-intro .eyebrow{font-size:10px;letter-spacing:2px;margin:0 0 10px;justify-content:center}.home-intro h1{font-size:clamp(27px,5.7vw,58px);line-height:1;margin:0;letter-spacing:-1px}.home-intro p:last-child{font-size:13px;line-height:1.4;color:#c4cdbb;margin:10px 0 0}.home-card{width:min(390px,100%);padding:20px;background:#152017d9;border:1px solid #dfd6b738;border-radius:10px;box-sizing:border-box;min-width:0}.home-actions{display:grid;gap:10px}.home-card button.primary,.home-card button.secondary{min-height:46px;height:auto;padding:12px 16px;width:100%;font-size:12px;letter-spacing:1px}.home-card button.primary{display:flex;justify-content:space-between;align-items:center}.home-card .button-note{text-align:center;margin:0;font-size:11px;line-height:1.35;color:#b6c2aa}.home-card #notice{margin:10px 0 0;font-size:12px;line-height:1.3;overflow-wrap:anywhere}.home-card #notice:empty{display:none}
.home-footer{display:grid;justify-items:center;gap:12px}.home-tools{display:flex;justify-content:center;gap:8px;width:100%}.home-tools button{background:#18231b9c;border:1px solid #d9d8bb30;padding:8px 12px;min-height:44px;font-size:10px;letter-spacing:.5px}.install-area{display:flex;align-items:center;flex-wrap:wrap;justify-content:center;gap:5px 12px;color:#bbc6b1;font-size:11px}.install-area>[data-install]{padding:9px 15px;min-height:44px;font-size:11px;background:#d7c592;color:#192119;border-radius:4px}.install-area>span{max-width:230px}#install-nudge{display:flex;gap:6px;align-items:center;font-size:10px;flex-basis:100%;justify-content:center}#install-nudge[hidden]{display:none}#install-dismiss{min-width:32px;min-height:32px;background:none;color:#bdc5b2}
.menu-dialog{width:min(480px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box;padding:24px;border:1px solid #cbbf9855;border-radius:10px;background:#172219;color:#e8e8d6;font:14px/1.5 system-ui}.menu-dialog::backdrop{background:#080e0cd9}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.dialog-heading h2{font-size:21px;margin:0}.dialog-heading button{min-width:44px;min-height:44px;background:#ffffff0a;border:1px solid #ffffff22;color:#e8e8d6}.menu-dialog label:not(.ready-choice){display:block;font-size:11px;margin:14px 0 6px}.menu-dialog input:not([type=checkbox]),.menu-dialog select{height:44px;min-height:44px;font-size:14px;max-width:100%;width:100%;box-sizing:border-box}.menu-dialog .match-options{width:100%;max-width:none;margin:18px 0}.menu-dialog .match-options label{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center}.menu-dialog p{font-size:12px;color:#bfccb4;overflow-wrap:anywhere}.menu-dialog a{color:#e0c598;display:block;padding:10px 0}.menu-dialog .join{min-height:44px}.menu-dialog .invite-actions{display:flex;gap:8px;margin:16px 0}.menu-dialog .invite-actions button{flex:1;min-height:44px}
.room-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;margin-bottom:12px}.room-heading #lobby-code{font-size:14px;letter-spacing:1px;margin:0;color:#e2c38c}.room-heading button{min-height:36px}.home-card #lobby-players{font-size:12px;gap:6px}.home-card #lobby-status{font-size:12px;margin:10px 0}.ready-choice{display:flex;align-items:center;gap:10px;min-height:44px;font-size:13px;line-height:1.3}.ready-choice input{width:20px;height:20px;flex-shrink:0}.home-card #resume-actions{width:100%;display:flex;gap:8px;margin-top:10px}.home-card #resume-actions[hidden]{display:none}.home-card #resume-actions button{width:auto;flex:1;min-height:44px;margin:0;padding:10px;font-size:11px}.home-card #ready{margin-top:8px}#bracket-open{min-height:40px;width:100%}
#entry-gate{position:fixed;left:50%;top:44%;transform:translate(-50%,-50%);z-index:9;width:min(320px,calc(100vw - 32px));box-sizing:border-box;padding:22px;background:#132016ec;border:1px solid #d9c59470;border-radius:10px;text-align:center;color:#eee9d5}#entry-gate strong{font-size:24px}#entry-gate p{font-size:12px;line-height:1.4}#entry-play{min-height:48px;width:100%;font-size:14px}#entry-menu{min-height:44px;margin-top:4px}#room-waiting{position:fixed;z-index:8;left:50%;bottom:max(20px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(350px,calc(100vw - 24px));box-sizing:border-box;background:#172419eb;border:1px solid #ccb78955;padding:10px 14px;border-radius:8px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px}#room-waiting p{font-size:11px;flex-basis:100%;margin:0}#room-waiting button{min-height:44px;padding:8px 12px}#room-waiting[hidden],#entry-gate[hidden]{display:none}
@media(min-width:700px) and (max-height:680px){.home-content{flex-direction:row;gap:36px}.home-intro{max-width:340px;text-align:left}.home-intro h1{font-size:42px}.home-intro .eyebrow{justify-content:flex-start}.home-card{width:350px;padding:16px}.home-footer{display:flex;justify-content:space-between;gap:12px}.home-tools{width:auto}.install-area{justify-content:flex-end}.install-area>span{max-width:160px}#install-nudge{display:none}}
@media(max-height:520px){#menu{padding:10px 16px;gap:8px}.home-content{flex-direction:row;gap:20px}.home-intro{max-width:38%;text-align:left}.home-intro h1{font-size:30px}.home-intro .eyebrow,.home-intro p:last-child{display:none}.home-card{padding:10px;width:min(330px,60%)}.home-actions{gap:6px}.home-card .button-note{display:none}.home-card button.primary,.home-card button.secondary{min-height:44px;padding:9px 12px}.home-footer{display:flex;justify-content:space-between;gap:8px}.home-tools{width:auto;gap:4px}.home-tools button{padding:8px;font-size:9px}.install-area>span,#install-nudge{display:none}.home-card #lobby-status{margin:5px 0}.home-card #resume-actions{margin-top:5px}.home-card #lobby-players{gap:3px}.room-heading{margin-bottom:5px}.home-card .ready-choice{min-height:32px}.home-card #lobby{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px}.home-card #lobby[hidden]{display:none}.room-heading,.home-card #lobby-players,.home-card #lobby-status{grid-column:1/-1}.home-card #lobby .primary{font-size:10px;padding:6px}.home-intro{display:none}#menu[data-state=home] .home-intro{display:block}#menu:not([data-state=home]) .home-card{width:min(600px,100%)}#entry-gate{top:39%;padding:12px}#entry-gate p{margin:6px}#room-waiting{bottom:8px;padding:6px 10px;width:min(480px,95%)}#room-waiting p{flex-basis:auto}#room-waiting .ready-choice{min-height:32px}#entry-menu{min-height:32px}}
@media(max-width:430px){#menu{padding:12px;gap:8px}.home-intro h1{font-size:30px}.home-intro p:last-child{font-size:12px}.home-card{padding:14px}.home-tools{gap:4px}.home-tools button{font-size:9px;padding:8px}.home-footer{gap:6px}.install-area>span{font-size:10px;max-width:150px}.install-area{gap:5px 8px}}
@media(max-width:560px) and (max-height:520px){#menu .home-intro{display:none!important}.home-card{width:100%;max-width:360px}.home-footer{display:grid;gap:4px}.home-tools button{min-height:36px}.install-area>[data-install]{min-height:36px;padding:6px 12px}#menu .topbar{min-height:36px}.home-content{gap:0}}
@media(max-width:560px) and (max-height:360px){.home-card .room-heading,.home-card #lobby-players{display:none}.home-card{padding:8px}.home-card #lobby-status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.home-card #notice{max-height:30px;overflow:auto;font-size:10px;margin-top:4px}.home-card #bracket-open{min-height:32px}.home-card #ready{margin:0}}
@media(max-height:520px){#menu[data-tournament=true] #lobby{grid-template-columns:1fr 1fr 1fr}#menu[data-tournament=true] #ready{margin:0}.home-card #lobby-status{max-height:36px;overflow:hidden}#menu[data-tournament=true] #bracket-open{font-size:10px;min-height:44px}}

#lobby-players,#map-lobby-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:8px 0;font-size:10px;line-height:1.35}.lobby-member{min-width:0;overflow-wrap:anywhere;padding:5px;background:#ffffff08;color:#dbe3cb}
#map-lobby-players{flex-basis:100%;margin:0}.lobby-member{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
@media(max-height:520px){.home-card #lobby-players{display:grid;max-height:54px;overflow:auto;margin:2px 0;font-size:9px}.lobby-member{padding:3px}#map-lobby-players{max-height:24px;overflow:auto;font-size:9px}}
@media(max-width:560px) and (max-height:360px){.home-card #lobby-players{max-height:36px}.home-card #lobby-status{display:none}}

/* One wordmark inside the original gold frame. */
#menu .brand-mark{width:auto;min-width:92px;height:34px;padding:0 10px;font-size:17px;letter-spacing:1px;flex-shrink:0}
#menu .brand-mark>span{display:block;transform:skew(12deg);white-space:nowrap}
