/* Scoped home composition, after the retained game and dialog styles. */
html body #lobby#lobby{position:fixed!important;inset:0!important;width:100%!important;max-width:none!important;height:var(--app-height,100dvh)!important;min-height:0!important;display:flex!important;flex-direction:column!important;gap:0!important;padding:0!important;overflow:auto!important;background:radial-gradient(ellipse at 50% 35%,#6c481c66,transparent 65%),linear-gradient(100deg,#120d08,#392315 48%,#130e08)!important;color:#fff0bd!important}
html body #lobby#lobby[hidden]{display:none!important}
#lobby#lobby> :not(.ref-header):not(.ref-body):not(.ref-footer):not(.community-shortcuts):not(.community-fallback):not(#homeMatchReward):not(#searchStatus):not(.account-access):not(.menu-audio-controls){display:none!important}
#lobby#lobby .ref-header{display:flex;align-items:center;gap:12px;padding:10px max(16px,env(safe-area-inset-right));background:linear-gradient(#062619,#00160e);border-bottom:2px solid #94733a;box-shadow:0 3px 20px #000;flex-shrink:0}
.ref-brand{display:flex;align-items:center;gap:5px;font:bold clamp(20px,3vw,42px)/.9 Georgia,serif;color:#ffe0a0;text-shadow:0 2px 2px #884600}.ref-brand>span{font-size:1.5em}.ref-brand small{display:block;color:#70d85a;font-size:.57em;letter-spacing:2px;margin-top:5px}
.ref-header nav{display:flex;flex:1;justify-content:center;gap:4px}#lobby .ref-header button,#lobby .ref-footer button{background:transparent!important;color:#fff1c7!important;border:1px solid #516846!important;border-radius:10px!important;padding:10px 14px!important;min-height:40px!important;font-size:15px!important;box-shadow:none!important;margin:0!important}
#lobby .ref-header .ref-wallet{border-color:#b99a4e!important;font-size:24px!important;font-weight:800;background:#0009!important;white-space:nowrap}
.ref-body{display:grid!important;grid-template-columns:28% minmax(0,1fr);gap:24px;padding:20px 24px;flex:1;min-height:0}.ref-tournament{align-self:center;overflow:hidden;border:3px solid #dbad53;border-radius:20px;background:#021d13;box-shadow:inset 0 0 0 2px #664012,0 8px 24px #000}.ref-tournament img{display:block;width:100%;aspect-ratio:1/1.02;object-fit:cover}.ref-mesa-area{min-width:0;display:flex;flex-direction:column;justify-content:center}.ref-mesa-area h1{text-align:center;font:bold clamp(26px,4vw,58px)/1 Georgia,serif;color:#ffe3a0;text-shadow:0 3px 2px #673300;margin:0 0 8px}.ref-subtitle{text-align:center;letter-spacing:4px;font-size:12px;margin:0 0 22px}
.ref-tables{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 36px)/4);gap:12px;overflow-x:auto;padding:4px 2px 12px;scroll-snap-type:x mandatory}.ref-table{min-width:0;scroll-snap-align:start;text-align:center;padding:16px 10px 10px;border:3px solid #d2a655;border-radius:22px;background:radial-gradient(ellipse at center,#16442b,#001e15 80%);box-shadow:inset 0 0 0 2px #715326,0 4px 12px #000}.ref-table>small{font-size:14px;color:#ead797}.ref-table h2{font-size:clamp(22px,2.8vw,40px);color:#ffdc79;margin:4px 0;text-shadow:0 3px 2px #55370c}.ref-table img{width:100%;aspect-ratio:1.35;object-fit:cover;border-radius:8px;margin:8px 0}.ref-table p{font-size:14px;color:#fff;margin:10px 0;padding-bottom:12px;border-bottom:1px solid #8c723c}
#lobby .ref-green{display:block!important;width:100%!important;background:linear-gradient(#5edb3b,#008c22 50%,#00431b)!important;border:2px solid #ffe38a!important;border-radius:14px!important;color:#fff!important;text-shadow:0 2px 2px #003b14;font-size:clamp(16px,2vw,26px)!important;font-weight:900!important;padding:9px 4px!important;box-shadow:0 3px 5px #000!important;margin:12px 0 0!important;min-height:40px!important}.ref-tournament .ref-green{width:90%!important;margin:12px auto 18px!important}
.ref-footer{display:flex;justify-content:space-around;gap:10px;padding:12px 20px;background:linear-gradient(#382112,#120b06);border-top:2px solid #9d793e;flex-shrink:0}.ref-footer button{flex:1}#lobby#lobby .account-access{width:auto!important;max-width:none!important;margin:0 24px 8px!important;padding:8px!important;grid-column:auto!important}#lobby#lobby .account-access h3,#lobby#lobby .account-access p{display:none}#lobby#lobby .account-access-buttons{display:flex;justify-content:center;gap:12px}#lobby#lobby .menu-audio-controls{margin:0!important;padding:4px!important}
@media(max-height:520px) and (orientation:landscape){.ref-header{padding:5px 12px!important}.ref-brand{font-size:23px}.ref-header nav button{padding:6px!important;font-size:12px!important}.ref-body{padding:10px 16px;gap:16px}.ref-mesa-area h1{font-size:30px}.ref-subtitle{margin-bottom:8px;font-size:9px}.ref-tournament{max-width:230px}.ref-tournament img{max-height:200px}.ref-table{padding:8px 7px;border-radius:16px}.ref-table img{height:85px;margin:2px 0}.ref-table h2{font-size:25px}.ref-table p{margin:4px 0;padding-bottom:5px;font-size:11px}.ref-table>small{font-size:10px}#lobby .ref-green{margin-top:6px!important;min-height:32px!important;padding:4px!important}.ref-footer{padding:5px 12px}.ref-footer button{min-height:30px!important;padding:4px!important;font-size:12px!important}.ref-header .ref-wallet{font-size:18px!important}}
@media(orientation:portrait) and (max-width:650px){.ref-header{flex-wrap:wrap;gap:6px!important}.ref-header nav{order:3;flex-basis:100%}.ref-header nav button{font-size:12px!important;padding:8px!important}.ref-brand{flex:1;font-size:28px}.ref-header .ref-wallet{font-size:18px!important}.ref-body{display:flex!important;flex-direction:column;padding:16px;flex:none;gap:18px}.ref-tournament{display:flex;align-items:center;width:100%;border-radius:14px}.ref-tournament img{width:38%;aspect-ratio:1.3;object-position:center 35%}.ref-tournament .ref-green{width:55%!important;margin:10px!important}.ref-tables{grid-auto-columns:70%;gap:12px}.ref-table img{max-height:160px}.ref-footer{flex-wrap:wrap;padding:8px;gap:6px}.ref-footer button{flex-basis:30%;font-size:11px!important;padding:6px!important}.ref-subtitle{letter-spacing:2px;font-size:10px}}
/* Compact portrait home: all stakes in two columns, without sideways scrolling. */
@media (orientation:portrait){
 html body #lobby#lobby{overflow-x:hidden!important;overflow-y:auto!important;padding-top:env(safe-area-inset-top)!important;padding-bottom:env(safe-area-inset-bottom)!important}
 #lobby .ref-header{flex-wrap:wrap;gap:6px!important;padding:8px 10px!important}
 #lobby .ref-brand{flex:1;font-size:25px}
 #lobby .ref-brand>span{font-size:1.25em}
 #lobby .ref-brand small{font-size:.53em;letter-spacing:1.5px;margin-top:4px}
 #lobby .ref-header>button{padding:6px 8px!important;min-height:36px!important;font-size:12px!important}
 #lobby .ref-header .ref-wallet{font-size:17px!important}
 #lobby .ref-header nav{order:3;flex-basis:100%;gap:5px}
 #lobby .ref-header nav button{flex:1;font-size:12px!important;padding:6px 3px!important;min-height:34px!important}
 #lobby .ref-body{display:flex!important;flex-direction:column;flex:1 0 auto;padding:10px!important;gap:12px!important;min-width:0}
 #lobby .ref-tournament{display:flex;align-items:center;width:100%;max-width:600px;border-width:2px;border-radius:12px;min-height:68px;max-height:80px;margin:auto}
 #lobby .ref-tournament img{width:38%;height:76px;max-height:76px;aspect-ratio:auto;object-fit:cover;object-position:center 40%}
 #lobby .ref-tournament .ref-green{width:56%!important;margin:8px 3%!important;font-size:17px!important;min-height:38px!important;padding:7px!important;border-radius:10px!important}
 #lobby .ref-mesa-area{width:100%;max-width:600px;margin:0 auto}
 #lobby .ref-mesa-area h1{font-size:28px;margin:0 0 5px}
 #lobby .ref-subtitle{font-size:9px;letter-spacing:2px;margin:0 0 9px}
 #lobby .ref-tables{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:row;grid-auto-columns:auto;overflow:visible;gap:9px;padding:0}
 #lobby .ref-table{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:2px 4px;padding:8px;border:2px solid #d2a655;border-radius:13px;min-width:0}
 #lobby .ref-table>small:first-child{grid-column:1/-1;font-size:10px;line-height:1.1}
 #lobby .ref-table h2{grid-column:1/-1;font-size:25px;line-height:1.1;margin:0}
 #lobby .ref-table img{grid-column:1;grid-row:3/5;width:100%;height:55px;max-height:55px;aspect-ratio:auto;object-fit:cover;margin:2px 0;border-radius:5px}
 #lobby .ref-table p{grid-column:2;grid-row:3;font-size:10px;line-height:1.2;margin:0;padding:0;border:0}
 #lobby .ref-table>small:last-of-type{grid-column:2;grid-row:4;font-size:9px;line-height:1.15}
 #lobby .ref-table .ref-green{grid-column:1/-1;width:100%!important;font-size:17px!important;margin:3px 0 0!important;padding:5px!important;min-height:36px!important;border-radius:9px!important}
 #lobby .ref-footer{position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-wrap:nowrap;gap:5px;padding:7px 8px!important;margin-top:10px}
 #lobby .ref-footer button{font-size:10px!important;padding:6px 2px!important;min-height:34px!important;border-radius:7px!important;white-space:nowrap}
 #lobby#lobby .account-access{margin:5px 10px!important;padding:5px!important}
 #lobby#lobby .menu-audio-controls{gap:8px!important;padding:5px!important}
}
@media (orientation:portrait) and (min-width:651px){
 #lobby .ref-header{padding:12px 24px!important}
 #lobby .ref-body{padding:18px!important}
 #lobby .ref-table{padding:14px}
 #lobby .ref-table img{height:90px;max-height:90px}
 #lobby .ref-table h2{font-size:32px}
 #lobby .ref-table p{font-size:13px}
}
/* Header identity and controls; scoped to avoid changing game or payment dialogs. */
#lobby .ref-brand{min-width:0;gap:10px;flex-shrink:0;font-family:Georgia,serif;font-weight:900;letter-spacing:-1px;text-shadow:0 2px 1px #8c541b,0 0 12px #ffcb6733}
#lobby .ref-brand small{font-family:'Truco Outfit',Arial,sans-serif;letter-spacing:3px;line-height:1.05;text-shadow:0 1px 2px #31551f}
#lobby .ref-logo-cards{position:relative;display:block;flex:0 0 48px;width:48px;height:58px}
#lobby .ref-logo-cards img{position:absolute;top:4px;width:35px;height:50px;object-fit:contain;filter:drop-shadow(0 2px 2px #0008)}
#lobby .ref-logo-cards img:first-child{left:0;transform:rotate(-17deg)}
#lobby .ref-logo-cards img:last-child{left:15px;transform:rotate(12deg)}
html body #lobby .ref-header button,html body #lobby .ref-footer button{background:linear-gradient(#238d3c,#096b2a 52%,#03451d)!important;border:1.5px solid #d9b86a!important;color:#fff4d1!important;box-shadow:inset 0 1px #bdf18555,0 2px 4px #0006!important;text-shadow:0 1px 2px #002f11}
html body #lobby .ref-header .ref-wallet{background:linear-gradient(#002919,#00150c)!important;border:2px solid #cba45b!important}
#lobby .ref-header button:disabled,#lobby .ref-footer button:disabled{opacity:.55;cursor:wait}
#lobby .ref-table [hidden]{display:none!important}
#lobby .ref-table-status{grid-column:1/-1;min-width:0;margin-top:5px;padding:7px 4px;border:1px solid #d8b968;border-radius:10px;background:#00170de8;text-align:center}
#lobby .ref-table .ref-table-status p{font:700 13px/1.35 'Truco Outfit',Arial,sans-serif;color:#ffe8a1;border:0;padding:0;margin:0 0 6px;overflow-wrap:anywhere}
#lobby .ref-table-status[data-state=searching]>p::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:#72f261;box-shadow:0 0 7px #87fa68;margin-right:5px;animation:ref-search-pulse 1.2s ease-in-out infinite}
#lobby .ref-table-searching{border-color:#ffe9a3;box-shadow:0 0 12px #81e85b55,inset 0 0 0 2px #6e5827}
#lobby .ref-table-status button{display:block;width:100%;min-height:36px;padding:6px 3px;margin:4px 0 0;border:1px solid #cfae60;border-radius:7px;background:linear-gradient(#187a34,#03441e);color:#fff3cf;font-size:11px;line-height:1.2;white-space:normal}
#lobby .ref-table-status button:disabled{opacity:.55}
@keyframes ref-search-pulse{50%{opacity:.35}}
@media(prefers-reduced-motion:reduce){#lobby .ref-table-status[data-state=searching]>p::before{animation:none}}
#lobby .ref-tables{align-items:start}
#lobby .ref-table-status .community-fallback{max-width:none;margin:8px 0 0;padding:8px 0 0;border:0;border-top:1px solid #cfae6066;border-radius:0;background:transparent}
#lobby .ref-table-status .community-fallback p{font-size:10px;font-weight:400;line-height:1.4;color:#e9d7a5;margin:0 0 7px}
#lobby .ref-table-status .community-fallback button{width:100%;min-height:44px;margin:5px 0 0;padding:8px 5px;font-size:10px;line-height:1.35;overflow-wrap:anywhere}
@media(orientation:portrait){
 #lobby .ref-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;gap:7px!important;align-items:center}
 #lobby .ref-brand{grid-column:1/3;grid-row:1;font-size:30px;gap:9px;padding:2px 0 5px}
 #lobby .ref-brand small{font-size:15px;letter-spacing:3px;margin-top:5px}
 #lobby .ref-header>button:not(.ref-wallet){grid-column:3;grid-row:1;min-height:36px!important}
 #lobby .ref-header>button:last-child{grid-column:3;grid-row:2;font-size:12px!important}
 #lobby .ref-header .ref-wallet{grid-column:1/3;grid-row:2;justify-self:stretch;font-size:19px!important;padding:7px 10px!important;min-height:38px!important;text-align:left}
 #lobby .ref-header nav{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:0;width:100%}
 #lobby .ref-header nav button{font-size:12px!important;min-height:39px!important;padding:6px 2px!important;white-space:normal;line-height:1.15}
}
/* Put withdrawal next to the balance, using the existing withdrawal request form. */
html body #lobby .ref-header .ref-withdraw{font-weight:800!important;white-space:nowrap}
@media(orientation:portrait){
 #lobby .ref-header{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 #lobby .ref-header .ref-brand{grid-column:1/3!important;grid-row:1!important;font-size:26px}
 #lobby .ref-header .ref-settings{grid-column:3!important;grid-row:1!important}
 #lobby .ref-header .ref-notices{grid-column:4!important;grid-row:1!important;font-size:11px!important}
 #lobby .ref-header .ref-wallet{grid-column:1/3!important;grid-row:2!important;font-size:19px!important}
 #lobby .ref-header .ref-withdraw{grid-column:3/5!important;grid-row:2!important;font-size:13px!important;min-height:40px!important}
 #lobby .ref-header nav{grid-column:1/-1!important;grid-row:3!important}
}
