/* Sueca/Scopone share a table structure; individual shedding/rummy games keep
   their own views. This stylesheet never targets the established game layouts. */
.classic-game .classic-layout{grid-template-columns:minmax(0,1fr) 250px;align-items:start}
.classic-game .classic-play-column{display:flex;flex-direction:column;gap:12px}
.classic-game .classic-felt{display:flex;flex-direction:column;gap:12px;min-height:300px;padding:18px}
.classic-game .classic-opponents{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:'left top right'}
.classic-game .classic-opponent-left{grid-area:left}.classic-game .classic-opponent-top{grid-area:top}.classic-game .classic-opponent-right{grid-area:right}
.classic-game .classic-trick,.classic-game .classic-capture-board{flex:1;min-height:0}
.classic-game .classic-trump{margin:0}.classic-game .classic-trump .trump-card>.card{width:38px;height:auto;aspect-ratio:5/7}
.classic-game .classic-hand-section{margin:0}.classic-game .classic-hand-grid{width:100%;max-width:600px;margin:auto;gap:9px 7px;padding:12px 5px;justify-items:center;align-content:start;height:auto;min-height:0;max-height:none}
.classic-game .classic-hand-grid>.card{width:min(100%,76px);min-width:44px;height:auto;aspect-ratio:5/7;transform:none}
.game-scopone .classic-hand-grid>.card{aspect-ratio:208/319}
.classic-game .classic-hand-grid>.card.selected{transform:none;outline:3px solid var(--gold)}
.classic-game .classic-actions{display:flex;flex-direction:column;align-items:stretch;gap:5px}
.classic-game .classic-actions>button{min-height:44px}.classic-game .classic-actions>.selection-hint{max-width:none;text-align:center;align-self:stretch}
.classic-game .classic-detail{display:block}.classic-game .classic-detail .capture-score{padding:10px 0}.classic-game .classic-rules>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:12px;color:var(--gold)}
@media(min-width:651px) and (max-width:950px){.classic-game .classic-layout{grid-template-columns:minmax(0,1fr)}.classic-game .classic-detail{display:flex;gap:16px;align-items:center}.classic-game .classic-capture-scores{display:flex;gap:16px}}

/* The active markers distinguish a game from its waiting screen. #app keeps
   these rules stronger than the later module-local style blocks. */
@media(max-width:650px){
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)){height:100dvh;min-height:0;overflow:hidden;display:grid;grid-template-rows:44px minmax(0,1fr)}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>.masthead{display:flex;height:44px;min-height:44px;padding:0 58px 0 8px;gap:8px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) .brand{font-size:23px;gap:5px;letter-spacing:-1px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) .brand-seal{width:26px;height:26px;line-height:24px;font-size:19px;flex-shrink:0}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) :is(.brand small,.connection),body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>footer{display:none}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) .profile-chip{margin-left:auto;max-width:112px;min-height:44px;font-size:10px;padding:4px 6px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>#app{height:100%;min-height:0;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife:has(.pife-play-area),.game-maumau:has(.maumau-play)){height:100%;min-height:0;display:flex;flex-direction:column;gap:3px;position:relative;padding:0 8px 4px}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau)>.table-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;flex:0 0 44px;min-height:44px;align-items:center;gap:6px;margin:0;flex-wrap:nowrap}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau) .table-toolbar>div:first-child{min-width:0}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau) .table-toolbar .eyebrow{font-size:8px;line-height:10px;letter-spacing:1px;max-width:none}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau) .table-toolbar h1{font-size:12px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau) .toolbar-buttons{flex-wrap:nowrap;gap:3px}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau) .toolbar-buttons button{height:44px;min-height:44px;min-width:44px;padding:4px 6px;font-size:10px}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau)>.turn-note{flex:0 0 20px;height:20px;min-height:20px;line-height:16px;margin:0;padding:1px 5px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

 #app .classic-game>.classic-score{flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px 10px;font-size:10px;line-height:14px;padding:3px 5px;text-align:center}
 #app .classic-game>.classic-score strong{font-size:19px;line-height:19px;margin-left:4px}
 #app .classic-game>.classic-score small{grid-column:1/-1;font-size:8px;line-height:10px}
 #app .classic-game>.classic-layout{align-items:stretch;display:flex;flex-direction:column;flex:1 1 0;min-height:0;gap:3px}
 #app .classic-game .classic-play-column{width:100%;display:flex;flex-direction:column;flex:1 1 0;min-height:0;gap:3px}
 #app .classic-game .classic-felt{flex:1 1 140px;min-height:140px;border-width:3px;border-radius:18px;padding:4px 6px;gap:3px}
 #app .classic-game .classic-opponents{flex:0 0 auto;gap:4px}
 #app :is(.classic-game,.game-pife) .opponents .avatar{display:none}
 #app :is(.classic-game,.game-pife) .opponents .seat{font-size:9px;line-height:10px;gap:0}
 #app :is(.classic-game,.game-pife) .opponents .seat>span:last-child{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #app :is(.classic-game,.game-pife) .opponents .seat small{font-size:7px;line-height:8px;margin-top:1px}
 #app .classic-game .team-tag{font-size:6px;line-height:8px;letter-spacing:.4px;margin-top:1px}
 #app .classic-game .self-seat{display:none}
 #app .classic-game :is(.classic-trick,.classic-capture-board){display:flex;flex-direction:column;flex:1 1 0;min-height:0}
 #app .classic-game .board-heading{font-size:7px;line-height:10px;letter-spacing:.4px;margin:2px 0}
 #app .classic-game .trick-cards{flex:1 1 0;min-height:0;flex-wrap:nowrap;gap:7px;align-items:center}
 #app .classic-game .trick-play{min-width:0;gap:2px}
 #app .classic-game .trick-play>.card{width:clamp(28px,5dvh,40px);height:auto;aspect-ratio:5/7}
 #app .classic-game .trick-play>small{font-size:7px;line-height:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:65px}
 #app .classic-game .last-move{display:none}
 #app .classic-game .classic-trump{display:flex;flex:0 0 auto;justify-content:center;align-items:center;gap:6px;margin:0;font-size:8px;line-height:10px;letter-spacing:.4px}
 #app .classic-game .classic-trump .trump-card>.card{width:26px;height:auto;aspect-ratio:5/7}
 #app .classic-game .classic-trump>small{font-size:7px;line-height:9px}
 #app .classic-game .classic-hand-section{flex:0 0 auto;min-height:0;margin:0}
 #app .classic-game .hand-heading{height:14px;min-height:14px;line-height:14px;font-size:8px;margin:0}
 #app .classic-game .classic-hand-grid{grid-template-columns:repeat(5,minmax(0,1fr));justify-items:center;align-content:start;width:100%;max-width:none;gap:4px;padding:3px;height:auto;min-height:0;max-height:none;overflow:visible}
 #app .classic-game .classic-hand-grid>.card{width:clamp(44px,9dvh,64px);max-width:100%;min-width:44px;height:auto;aspect-ratio:5/7;transform:none}
 #app .game-scopone .classic-hand-grid>.card{aspect-ratio:208/319}
 #app .classic-game .classic-hand-grid>.card.selected{transform:none;outline-width:3px;outline-offset:0}
 #app .classic-game .classic-actions{flex-direction:column;align-items:stretch;gap:2px;padding:2px 0 0}
 #app .classic-game .classic-actions>.selected-play-card{height:13px;min-height:13px;font-size:9px;line-height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #app .classic-game .classic-actions>button{height:44px;min-height:44px;min-width:44px;padding:4px;font-size:12px;flex:none}
 #app .classic-game .classic-actions>.selection-hint{font-size:8px;line-height:10px;height:10px;min-height:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #app .game-sueca .classic-detail{display:block;flex:0 0 auto;border:0;background:transparent;padding:0 4px;margin:0}
 #app .game-sueca .classic-live-points{display:flex;flex-direction:row;justify-content:center;gap:6px;padding:0;border:0;font-size:9px;line-height:12px}
 #app .game-sueca .classic-live-points>span{line-height:12px}
 #app .classic-game .classic-detail :is(h2,small,.classic-rules),#app .game-scopone .classic-detail{display:none}
 #app .game-scopone .classic-capture-board .table-cards{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,auto);grid-auto-columns:40px;justify-content:start;align-content:center;gap:4px;flex:1 1 0;min-height:0;max-height:138px;overflow-x:auto;overflow-y:hidden;padding:3px;scroll-snap-type:x proximity;overscroll-behavior-x:contain}
 #app .game-scopone .classic-capture-board .table-cards>div{scroll-snap-align:start}
 #app .game-scopone .classic-capture-board .table-cards .card{width:40px;height:auto;aspect-ratio:208/319}
 #app .game-scopone .classic-capture-board .table-cards>.empty-meld{grid-row:1/-1;grid-column:1/span 5;align-self:center;font-size:11px}

 /* Pife's local stylesheet declares these geometry properties !important. */
 #app .game-pife>.pife-score{flex:0 0 auto;gap:4px;margin:0}
 #app .game-pife>.pife-score>div{padding:3px;min-height:32px;border-radius:5px}
 #app .game-pife>.pife-score span{font-size:9px;line-height:10px}
 #app .game-pife>.pife-score strong{font-size:17px;line-height:19px}
 #app .game-pife>.pife-score small{font-size:8px}
 #app .game-pife>.pife-round-meta{flex:0 0 10px;height:10px;line-height:10px;font-size:8px;margin:0}
 #app .game-pife>.pife-play-area{display:flex;flex-direction:column;flex:1 1 0;min-height:0;gap:3px}
 #app .game-pife .pife-felt{display:flex;flex-direction:column;flex:1 1 100px;min-height:100px;max-width:100%;border-width:3px;border-radius:18px;padding:4px 6px;gap:3px}
 #app .game-pife .pife-piles{flex:1 1 0;align-items:center;gap:24px;margin:0}
 #app .game-pife .pife-pile{font-size:8px;line-height:10px;gap:2px}
 #app .game-pife .pife-pile .card{width:clamp(32px,6dvh,42px)!important;height:auto!important;aspect-ratio:5/7}
 #app .game-pife .pife-empty{width:36px;height:50px;font-size:8px}
 #app .game-pife .pife-hand-section{flex:0 0 auto;min-height:0;width:100%;max-width:none;margin:0}
 #app .game-pife .pife-hand-heading{font-size:8px;line-height:11px;min-height:44px;gap:6px}
 #app .game-pife .pife-hand-heading>button{min-height:44px;height:44px;min-width:44px;font-size:10px;padding:4px 7px}
 #app .game-pife .pife-hand{gap:4px!important;padding:3px!important;align-content:start;grid-template-columns:repeat(5,minmax(0,1fr))}
 #app .game-pife .pife-hand>.card{width:clamp(44px,9dvh,64px)!important;min-width:44px;max-width:100%;height:auto!important;aspect-ratio:5/7;transform:none}
 #app .game-pife .pife-hand>.card.selected{transform:none;outline-width:3px;outline-offset:0}
 #app .game-pife .pife-note{height:12px;min-height:12px;font-size:9px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:1px 0}
 #app .game-pife .pife-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:2px 0}
 #app .game-pife .pife-actions>button{height:44px;min-height:44px;min-width:44px;flex:none;padding:4px;font-size:11px;line-height:13px}
 #app .game-pife .pife-rules{display:none}

 #app :is(.classic-game,.game-pife)>.round-banner{position:absolute;z-index:4;inset:85px 8px 5px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:8px;overflow:auto;padding:14px}
 #app :is(.classic-game,.game-pife)>.round-banner h2{font-size:25px;margin:0}
 #app :is(.classic-game,.game-pife)>.round-banner p{font-size:12px;line-height:1.4;margin:0}
 #app :is(.classic-game,.game-pife)>.round-banner button{min-height:44px;font-size:13px}
 #app .classic-game:has(>.round-banner)>.classic-layout,#app .game-pife:has(>.round-banner)>.pife-play-area{visibility:hidden}
 #app .game-pife .pife-winning{margin:3px;gap:5px}

 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>#social-root{position:fixed;z-index:9;right:6px;top:0;width:44px;height:44px;margin:0;padding:0}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) #social-root>details{border:0;background:#252d22}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) #social-root>details>summary{height:44px;min-height:44px;padding:0;display:grid;place-items:center;font-size:0;list-style:none}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) #social-root>details>summary:after{content:'Conversa';font-size:8px;color:var(--gold)}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>#social-root:has(>details[open]){inset:0 6px 6px;width:auto;height:auto;max-height:100dvh;overflow:auto;background:#20261e;border:1px solid var(--gold);border-radius:8px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) #social-root>details[open]>summary{font-size:13px;display:flex;justify-content:space-between;padding:0 12px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) #social-root>details[open]>summary:after{content:'Fechar';font-size:12px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) #social-root>details:not([open]) #social-unread{position:absolute;top:1px;right:0;max-width:44px;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)) dialog{max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>.update-notice{position:fixed;top:44px;z-index:11}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>#toast{top:48px;bottom:auto;font-size:11px;padding:8px 12px}
}
@media(max-width:650px) and (max-height:620px) and (orientation:portrait){
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play)){grid-template-rows:minmax(0,1fr)}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>.masthead{display:none}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau) .table-toolbar>div:first-child{padding-left:48px}
 #app :is(.game-sueca-active,.game-scopone-active,.game-pife,.game-maumau){gap:2px;padding-bottom:2px}
 body.in-game:has(#app :is(.game-sueca-active,.game-scopone-active,.pife-play-area,.maumau-play))>#social-root{left:8px;right:auto}
}

#pife-selection-count.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

@media(max-width:650px){
 #app .game-scopone .classic-detail{display:block;flex:0 0 auto;margin:0;padding:0 3px;border:0;background:transparent}
 #app .game-scopone .classic-capture-scores{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #app .game-scopone .classic-capture-scores .capture-score{display:flex;flex-direction:column;gap:0;border:0;padding:0;font-size:8px;line-height:11px}
 #app .game-scopone .classic-capture-scores .capture-score>*{font-size:8px;line-height:11px}
}
