/* App owns scrolling; no minimum desktop canvas is imposed on small viewports. */
html:has(#lobby),html:has(#lobby) body{width:100%;max-width:100%;height:100%;min-height:0!important;margin:0;overflow:hidden!important}
html body #login,html body #waiting,html body #lobby.lounge-lobby,html body #game{
  width:100%!important;max-width:100%!important;min-width:0!important;
  height:100dvh!important;min-height:0!important;max-height:100dvh!important;
  overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;
  scrollbar-width:none;
}
#login::-webkit-scrollbar,#waiting::-webkit-scrollbar,#lobby::-webkit-scrollbar,#game::-webkit-scrollbar{display:none}
html body #lobby.lounge-lobby{position:relative!important;left:auto!important;transform:none!important;align-content:start;place-content:initial;justify-items:stretch}
html body #lobby.lounge-lobby .lounge-header,
html body #lobby.lounge-lobby .lounge-shortcuts,
html body #lobby.lounge-lobby .pilot-lobby-card,
html body #lobby.lounge-lobby .active-match-card{min-width:0!important;max-width:1600px!important;box-sizing:border-box;flex-shrink:0}
html body #lobby.lounge-lobby .pilot-lobby-card{position:relative!important;left:auto!important;transform:none!important;display:block!important}
html body #lobby.lounge-lobby .lounge-body{min-width:0;grid-template-columns:minmax(0,1.2fr) minmax(0,.85fr)}
html body #lobby.lounge-lobby .lounge-controls{min-width:0;max-width:100%}
html body #lobby.lounge-lobby .lounge-header>*{min-width:0}
html body #lobby.lounge-lobby #lobby-menu{max-height:calc(100dvh - 96px);overflow-y:auto;overscroll-behavior:contain}
html body .feature-modal{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;min-width:0!important;max-height:100dvh!important;overflow:hidden!important;padding:12px!important;align-items:center;justify-items:center}
html body .feature-modal>.feature-card{min-width:0!important;min-height:0!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ba9746 #052a1f}
html body #avatar-modal .avatar-card{display:block!important}
html body #lobby.lounge-lobby .choice{position:relative}
html body #lobby.lounge-lobby .choice:has(input:focus-visible)>span{outline:3px solid #fff;outline-offset:2px}
@media(min-width:1100px) and (min-height:760px){
  html body #lobby.lounge-lobby{display:flex!important;flex-direction:column;padding-top:12px!important;padding-bottom:max(14px,env(safe-area-inset-bottom))!important}
  html body #lobby.lounge-lobby .lounge-header{min-height:66px;flex-shrink:0}
  html body #lobby.lounge-lobby .lounge-header .logo{max-height:68px!important}
  html body #lobby.lounge-lobby .lounge-shortcuts{flex-shrink:0;margin:4px auto 10px!important}
  html body #lobby.lounge-lobby .pilot-lobby-card{flex:1;min-height:0;display:flex!important;flex-direction:column}
  html body #lobby.lounge-lobby .lounge-greeting{flex-shrink:0;margin-bottom:10px!important}
  html body #lobby.lounge-lobby .lounge-games{flex-shrink:0;margin-bottom:14px!important}
  html body #lobby.lounge-lobby .lounge-games>.choice>span{height:clamp(86px,11dvh,140px)!important;min-height:0!important}
  html body #lobby.lounge-lobby .lounge-body{flex:1;min-height:0}
  html body #lobby.lounge-lobby .lounge-feature{height:100%;min-height:0!important}
  html body #lobby.lounge-lobby .lounge-controls{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ba9746 #052a1f}
  html body #lobby.lounge-lobby .lounge-controls>h2{margin-bottom:10px;font-size:28px}
  html body #lobby.lounge-lobby .lounge-controls fieldset{margin-bottom:10px!important}
  html body #lobby.lounge-lobby .lounge-controls .choice span{min-height:42px!important;padding:7px 4px!important}
  html body #lobby.lounge-lobby .lounge-economy{margin-block:10px;padding:8px}
  html body #lobby.lounge-lobby #create-room{min-height:54px!important;padding:10px 8px}
}
@media(max-width:1099px){
  html body #lobby.lounge-lobby .lounge-body{grid-template-columns:minmax(0,1fr)}
  html body #lobby.lounge-lobby .lounge-feature{min-height:0!important;height:clamp(155px,26dvh,260px)}
  html body #lobby.lounge-lobby .lounge-play{position:sticky;bottom:0;z-index:5;background:#082c20;padding-block:6px}
}
@media(max-width:600px){
  html body #lobby.lounge-lobby{padding-inline:12px!important}
  html body #lobby.lounge-lobby .lounge-games{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:5px!important;overflow:visible;padding:0!important}
  html body #lobby.lounge-lobby .lounge-games>.choice{flex:none!important;min-width:0}
  html body #lobby.lounge-lobby .lounge-games>.choice>span{height:75px!important;min-height:75px!important;padding:6px 3px!important;border-radius:9px!important}
  html body #lobby.lounge-lobby .lounge-games>.choice span strong{font-size:8px!important;overflow-wrap:anywhere;line-height:1.12}
  html body #lobby.lounge-lobby .lounge-games input:checked+span:after{width:15px;height:15px;font-size:9px;top:4px;right:4px}
  html body #lobby.lounge-lobby .lounge-shortcuts{justify-content:space-between;gap:5px}
  html body #lobby.lounge-lobby .lounge-shortcuts button{font-size:10px!important;padding:6px 9px}
  html body .feature-modal .hall-card{display:block!important;grid-template-columns:none!important}
  html body .feature-modal .hall-card>.feature-brand{display:block;text-align:center}
  html body #lobby.lounge-lobby .join-row{grid-template-columns:minmax(0,1fr) 88px!important}
  html body input:not([type=radio]):not([type=checkbox]):not([type=range]),html body select{font-size:16px}
}
@media(orientation:landscape) and (max-height:650px){html body .feature-modal .hall-card{display:block!important;grid-template-columns:none!important}}
html body #game:not([data-match-type="poker"]) .table-wrap{max-width:100%!important;min-height:0!important;height:100dvh!important}
html body #game:not([data-match-type="poker"]) .plastic-table{min-width:0!important;max-width:96%!important}
/* Layout declarations must never revive an inactive screen or game-only field. */
html body #lobby.lounge-lobby.hidden,
html body #login.hidden,html body #waiting.hidden,html body #game.hidden{display:none!important}
html body #lobby.lounge-lobby .hidden.hidden{display:none!important}
html body #login,html body #waiting{align-content:safe center}

/* V94 — ajuste isolado do cabeçalho do lobby; demais telas e jogos intactos. */
html body #lobby.lounge-lobby .lounge-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 48px;
  align-items: center;
  column-gap: clamp(8px,2vw,20px);
  padding-right: 0 !important;
  position: relative;
  z-index: 40;
  overflow: visible;
}
html body #lobby.lounge-lobby .lounge-header > .lobby-menu-wrap {
  grid-column: 3;
  position: relative !important;
  inset: auto !important;
  z-index: 50;
  min-width: 48px;
  pointer-events: auto;
}
html body #lobby.lounge-lobby .lounge-header #lobby-menu-toggle {
  display: grid;
  place-items: center;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  padding: 9px !important;
  touch-action: manipulation;
  pointer-events: auto;
}
html body #lobby.lounge-lobby .lounge-header #lobby-menu-toggle .ui-icon { width: 27px; height: 27px; }
html body #lobby.lounge-lobby .lounge-header #lobby-menu {
  right: 0;
  left: auto;
  top: calc(100% + 8px);
  width: min(330px, calc(100vw - 32px));
  max-height: min(68dvh, calc(100dvh - 100px - env(safe-area-inset-bottom))) !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 51;
}
@media (max-width: 700px) {
  html body #lobby.lounge-lobby { padding-top: max(14px, calc(env(safe-area-inset-top) + 10px)) !important; }
  html body #lobby.lounge-lobby .lounge-header {
    grid-template-columns: minmax(0,1fr) 48px;
    grid-template-areas: "brand menu" "profile profile";
    gap: 9px 12px;
    padding: 0 !important;
  }
  html body #lobby.lounge-lobby .lounge-header > .lobby-hero { grid-area: brand; }
  html body #lobby.lounge-lobby .lounge-header > .lobby-profile {
    grid-area: profile;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    justify-self: stretch;
  }
  html body #lobby.lounge-lobby .lounge-header > .lobby-menu-wrap {
    grid-area: menu;
    justify-self: end;
  }
}
.rewards-modal .daily-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px solid #d4b65c;
  border-radius: 14px;
  background: linear-gradient(125deg,#104831,#082a20);
  color: #fff1c0;
}
.rewards-modal .daily-welcome.hidden { display: none !important; }
.rewards-modal .daily-welcome strong { display: block; font-size: 1rem; }
.rewards-modal .daily-welcome small { display: block; margin-top: 5px; line-height: 1.4; color: #dfdfcb; }
.rewards-modal #daily-welcome-vip {
  flex-shrink: 0;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #f1d477;
  border-radius: 10px;
  background: #176543;
  color: #fff0ba;
  font-weight: 850;
  cursor: pointer;
}
