/* Compact room layout shared by web and Android. */
#private-room-root .room-heading{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
#private-room-root .room-count{white-space:nowrap;color:#c6d4db;font-size:14px}
#private-room-root .room-top-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
#private-room-root .room-top-actions .button{font-size:14px;min-height:34px;height:34px;padding:4px 9px}
#private-room-root .room-top-actions .button[data-room-action=start],#private-room-root .room-top-actions .button[data-room-action=rematch]{background:#559f35;color:#fff;box-shadow:inset 2px 2px #91cd6c,inset -2px -2px #255b14}
#private-room-root .room-top-actions .button[data-room-action=close],#private-room-root .room-top-actions .button[data-room-action=leave]{background:#9b9b9b}
#private-room-root{font-size:18px;text-shadow:1px 1px #111;height:100%}
#private-room-root *{box-sizing:border-box}
#private-room-root .room-shell{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;height:min(640px,calc(100dvh - 240px));max-width:1000px;margin:auto;background:#171d20f2;border:3px solid #090c0d;box-shadow:inset 1px 1px #596064;padding:0;overflow:hidden}
#private-room-root .room-top{position:static;min-height:0;padding:14px 20px;display:flex;gap:20px;align-items:center;background:#0e1316;border:0;font-size:16px}
#private-room-root .room-code{font-size:23px;letter-spacing:2px;margin:0;white-space:nowrap}
#private-room-root .room-state{flex:1;color:#c6d4db}
#private-room-root .room-tabs,#private-room-root .room-subtabs{display:flex;gap:0;margin:0;padding:0;background:#222a2e;border-bottom:2px solid #090c0d}
#private-room-root .room-tabs>button,#private-room-root .room-subtabs>button{height:42px;min-height:0;flex:1;width:auto;border:0;border-right:1px solid #0e1316;background:transparent;box-shadow:none;color:#d2d8db;font:inherit;font-size:18px;padding:6px 12px;cursor:pointer;text-shadow:none}
#private-room-root .room-tabs>button[aria-selected=true],#private-room-root .room-subtabs>button[aria-selected=true]{background:#3d484e;color:#fff;box-shadow:inset 0 -3px #91c767}
#private-room-root .room-content{overflow:auto;min-height:0;padding:18px 20px;scrollbar-width:thin}
#private-room-root h2,#private-room-root h3{font-weight:normal;margin:0 0 12px;line-height:1.2;font-size:20px}
#private-room-root p{margin:0;line-height:1.45}
#private-room-root .room-lobby{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px;min-height:0}
#private-room-root .room-player-panel,#private-room-root .room-summary{min-width:0}
#private-room-root .room-summary{background:#232c31;padding:14px;border:1px solid #414b51}
#private-room-root .room-roster{display:grid;align-content:start;gap:6px;max-height:270px;overflow:auto}
#private-room-root .room-member{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;padding:9px 10px;background:#232c31;min-height:46px;font-size:17px}
#private-room-root .room-member>span:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
#private-room-root .room-member small{display:block;color:#b6c1c8;font-size:12px;line-height:1.25}
#private-room-root .room-player-status{color:#c0d3b2;font-size:14px}
#private-room-root .button{display:flex;justify-content:center;align-items:center;width:auto;height:42px;min-height:42px;margin:0;padding:7px 14px;border:3px solid #080a0b;background:#c6c6c6;color:#363636;box-shadow:inset 2px 2px #fff,inset -2px -2px #606060;font:inherit;font-size:17px;line-height:1.1;text-align:center;text-shadow:none;text-decoration:none;white-space:nowrap;cursor:pointer}
#private-room-root .button:hover:not(:disabled){background:#559f35;color:white;box-shadow:inset 2px 2px #91cd6c,inset -2px -2px #255b14}
#private-room-root .room-member .button{height:32px;min-height:32px;font-size:13px;padding:3px 7px}
#private-room-root input,#private-room-root select{display:block;width:100%;height:41px;min-height:41px;margin:5px 0 0;padding:7px 10px;background:#111619;border:2px solid #606a70;box-shadow:inset 1px 1px #000;color:#fff;font:inherit;font-size:17px;text-shadow:none}
#private-room-root .room-member select{width:108px;min-height:32px;height:32px;margin:0;font-size:14px;padding:4px}
#private-room-root label{display:block;margin:0;font-size:17px;line-height:1.3}
#private-room-root small{display:block;font-size:12px;color:#b7c3ca;line-height:1.35;letter-spacing:0;margin-top:5px}
#private-room-root dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 14px;font-size:16px;margin:0}
#private-room-root dt{color:#bdc8cd}#private-room-root dd{margin:0;text-align:right;overflow-wrap:anywhere}
#private-room-root .room-rule-note{font-size:14px;line-height:1.45;color:#c6d1d7;border-top:1px solid #4b565d;margin-top:14px;padding-top:12px}
#private-room-root .room-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px}
#private-room-root .room-fields>.room-rule-note{grid-column:1/-1;margin:0;padding-top:10px}
#private-room-root fieldset{padding:0;border:0;margin:16px 0 0;min-width:0}#private-room-root fieldset:disabled{opacity:.8}
#private-room-root form{display:block;margin:0}
#private-room-root .room-subtabs{border:1px solid #48535a;background:#222a2e}
#private-room-root .room-subtabs>button{font-size:16px;height:36px}
#private-room-root .room-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;position:static;transform:none;width:100%;min-height:0;max-width:none;margin:0;padding:12px 20px;background:#0e1316;border-top:2px solid #090c0d;font-size:16px}
#private-room-root .room-bottom>span{font-size:14px}
#private-room-root .room-bottom>.button{flex:0 0 auto;min-width:140px}
#private-room-root .room-bottom>.button:last-child:not(:first-child){background:#559f35;color:white;box-shadow:inset 2px 2px #91cd6c,inset -2px -2px #255b14}
#private-room-root .room-invite-code{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:#232c31;border:1px solid #414b51;margin-bottom:18px}
#private-room-root .room-invite-code strong{font-size:26px;font-weight:normal;letter-spacing:2px}
#private-room-root .room-search{display:flex;align-items:end;gap:12px}#private-room-root .room-search>label{flex:1}#private-room-root .room-search>.button{flex:0 0 auto}
#private-room-root .room-search-results{margin-top:14px;display:grid;gap:6px}
#private-room-root .room-muted{color:#b7c3ca;font-size:15px}
#private-room-root .room-results{display:grid;gap:10px;max-height:240px;overflow:auto}#private-room-root .room-results>div{display:flex;justify-content:space-between;gap:12px}#private-room-root .room-results strong{font-weight:normal;color:#d4e8bd}
#private-room-root .room-race-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:14px}#private-room-root .room-race-actions form{display:flex;gap:8px;flex:1}#private-room-root .room-race-actions input{margin:0;min-width:100px}
#private-room-root .room-vote{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:10px 12px;background:#27352b;font-size:15px}#private-room-root .room-vote .button{font-size:15px}
#private-room-root .room-open-match{margin-top:14px;width:100%}
#private-room-root .room-entry{height:auto;max-width:620px;padding:24px;gap:24px;display:grid}
#private-room-root .room-entry{grid-template-rows:none;grid-auto-rows:max-content;align-content:start}
#private-room-root .room-entry form>.button{width:100%;margin-top:14px}
body.rooms-page header:has(.logo){min-height:0;height:140px;padding:18px 20px}
body.rooms-page .logo{width:min(560px,70vw)}
body.rooms-page main{max-width:1050px;padding:6px 20px 90px;min-height:0}
body.rooms-page{display:grid;grid-template-rows:140px minmax(0,1fr) 80px;height:100dvh;max-height:100dvh;overflow:hidden}
body.rooms-page #app{width:100%;height:100%;padding:6px 20px 12px;min-height:0;flex:none}
body.rooms-page #private-room-root .room-shell{height:100%;max-height:640px}
body.rooms-page #site-footer{position:static;width:100%;height:80px;max-width:none;margin:0;padding:10px 0;align-self:end}
body[data-page=privateRoom] main{top:18%;width:94vw;max-width:1000px;height:68%;max-height:none;display:block;overflow:visible;padding:0}
body[data-page=privateRoom] #logo{height:14%;top:2%;max-width:75%}
body[data-page=privateRoom] #private-room-root{font-size:16px}
body[data-page=privateRoom] #private-room-root .room-shell{height:100%}
body[data-page=privateRoom] #private-room-root .room-top{padding:7px 12px;font-size:13px}
body[data-page=privateRoom] #private-room-root .room-code{font-size:20px}
body[data-page=privateRoom] #private-room-root .room-tabs>button{height:30px;font-size:15px}
body[data-page=privateRoom] #private-room-root .room-content{padding:9px 12px}
body[data-page=privateRoom] #private-room-root .room-bottom{padding:7px 12px}
body[data-page=privateRoom] #private-room-root .room-roster{max-height:215px}
body[data-page=privateRoom] #private-room-root .room-fields{gap:9px 16px}
body[data-page=privateRoom] #private-room-root h3{font-size:18px}
body[data-page=privateRoom] #private-room-root label{font-size:14px}
body[data-page=privateRoom] #private-room-root input,body[data-page=privateRoom] #private-room-root select{height:32px;min-height:32px;font-size:14px;padding:5px 7px;margin-top:3px}
body[data-page=privateRoom] #private-room-root small{font-size:10px;margin-top:3px}
body[data-page=privateRoom] #private-room-root fieldset{margin-top:10px}
body[data-page=privateRoom] #private-room-root .room-subtabs>button{height:28px;font-size:14px}
body[data-page=privateRoom] #private-room-root .room-member{font-size:15px}
body[data-page=privateRoom] #private-room-root .room-rule-note{font-size:13px}
body[data-page=privateRoom] #private-room-root .room-fields>.room-rule-note{display:none}
body[data-page=privateRoom] #private-room-root .button{height:32px;min-height:32px;font-size:14px}
@media(min-width:650px){body[data-page=privateRoom] #private-room-root .room-fields{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){
 #private-room-root .room-shell{height:calc(100dvh - 200px)}
 #private-room-root .room-top{padding:10px 12px;gap:8px;flex-wrap:wrap;font-size:13px}
 #private-room-root .room-code{font-size:20px}#private-room-root .room-state{flex:1;text-align:right}#private-room-root .room-top>span:last-child{width:100%;font-size:12px}
 #private-room-root .room-content{padding:12px}#private-room-root .room-lobby{grid-template-columns:1fr;gap:14px}
 #private-room-root .room-roster{max-height:160px}#private-room-root .room-fields{grid-template-columns:1fr;gap:12px}
 #private-room-root .room-bottom{padding:10px 12px}#private-room-root .room-bottom>.button{min-width:0;flex:1}
 #private-room-root .room-vote{flex-wrap:wrap}#private-room-root .room-search{gap:8px}
 body.rooms-page header:has(.logo){height:110px;padding-top:20px}body.rooms-page main{padding:0 12px 80px}
 body.rooms-page{grid-template-rows:110px minmax(0,1fr) 72px}body.rooms-page #app{padding:0 12px 8px}body.rooms-page #site-footer{height:72px}
}
/* Keep room actions and forms readable at phone WebView density. */
body[data-page=privateRoom] #private-room-root .room-top{gap:10px;align-items:center}
body[data-page=privateRoom] #private-room-root .room-state{font-size:12px;line-height:1.25}
body[data-page=privateRoom] #private-room-root .room-count{font-size:12px}
body[data-page=privateRoom] #private-room-root .room-top-actions .button{font-size:12px;height:30px;min-height:30px;padding:4px 8px}
#private-room-root .room-bottom:empty{display:none}
@media(max-width:600px){#private-room-root .room-top{flex-wrap:wrap}#private-room-root .room-heading{flex:1}#private-room-root .room-top-actions{width:100%;justify-content:flex-start}#private-room-root .room-count{width:auto!important}#private-room-root .room-top-actions .button{flex:1}#private-room-root .room-state{text-align:left}}
@media(max-height:550px) and (min-width:601px){body[data-page=privateRoom] #private-room-root .room-top{padding:5px 9px;gap:8px}body[data-page=privateRoom] #private-room-root .room-code{font-size:17px}body[data-page=privateRoom] #private-room-root .room-top-actions .button{height:28px;min-height:28px;font-size:11px;padding:3px 6px}body[data-page=privateRoom] #private-room-root .room-state{font-size:11px}body[data-page=privateRoom] #private-room-root .room-count{font-size:11px}}

.room-chat{margin-top:16px;padding-top:12px;border-top:1px solid #748078}.room-chat-messages{max-height:150px;overflow:auto;overflow-wrap:anywhere}.room-chat-messages p{margin:6px 0}.room-chat form{display:flex;gap:10px}.room-chat input{flex:1;min-width:0}.room-chat form button{width:auto}
