/* Truco is a self-contained viewport, independent from the canasta surface. */
body.playing-truco{height:100dvh;overflow:hidden;background:#111915}
body.playing-truco>header,body.playing-truco>.client-sidebar,body.playing-truco footer{display:none!important}
body.playing-truco main{width:100%!important;max-width:none!important;height:100dvh!important;margin:0!important;padding:12px!important;box-sizing:border-box}
#match.truco-table{position:relative;display:grid;grid-template-rows:50px minmax(0,1fr);height:100%;min-height:0;padding:0 12px;box-sizing:border-box;isolation:isolate}
#match.truco-table:before{content:'';position:absolute;inset:-12px;z-index:-1;background:linear-gradient(#0004,#0001 60%,#0008),var(--truco-scene) center/cover no-repeat}
body[data-truco-theme=wood]{--truco-scene:url('/media/truco-wood-v2.png')}
body[data-truco-theme=ice]{--truco-scene:url('/media/truco-ice-v2.png')}
body[data-truco-theme=royal]{--truco-scene:url('/media/truco-royal-v2.png')}
body[data-truco-theme=forest]{--truco-scene:url('/media/truco-forest-v2.png')}
#match.truco-table>.felt,#match.truco-table>#actions,#match.truco-table>.match-result,#match.truco-table>.table-toolbar,#match.truco-table>.match-reference,#match.truco-table>.row:nth-child(2){display:none!important}
#match.truco-table>.row:first-child{margin:0;min-height:0;padding-right:55px;align-items:center}
#match.truco-table #turnLabel{font-size:17px;line-height:1.2;margin:4px 0;text-shadow:0 2px 5px #000}
#match.truco-table #matchName{display:block;font-size:12px;line-height:16px;margin:0;color:#f7d886;text-shadow:0 2px 5px #000}
#match.truco-table>.options-button{position:absolute;right:4px;top:0;width:40px;height:40px;min-height:40px;padding:0;font-size:0;background:#103a32 url('/icons/menu.svg') center/22px no-repeat}
#match.truco-table .truco-surface{width:min(100%,1150px);height:100%;min-height:0;margin:auto;display:grid;grid-template-rows:30px minmax(180px,1fr) 20px clamp(110px,21vh,168px) 46px;gap:6px}
#match.truco-table .truco-scoreboard{display:flex;justify-content:center;align-items:center;gap:24px;background:#08231ee8;border:1px solid #b59a5a;border-radius:10px;width:max-content;max-width:100%;padding:3px 16px;margin:auto;font-size:13px;box-sizing:border-box}
#match.truco-table .truco-scoreboard strong{font-size:17px}.truco-scoreboard span{font-size:12px}
#match.truco-table .truco-board{position:relative;min-height:0;margin:0 6%;border:0;background:transparent;outline:none;box-shadow:none}
#match.truco-table .truco-seat{position:absolute;display:flex;flex-direction:column;align-items:center;gap:2px;width:96px;min-width:0;max-width:none;padding:6px;box-sizing:border-box;border:1px solid #b79e58!important;background:#09231feF!important;border-radius:12px;z-index:3;color:#f5edd9;transform:translate(-50%,-50%);text-align:center;box-shadow:0 4px 12px #0007}
#match.truco-table .truco-seat img{width:48px;height:48px;box-sizing:border-box;object-fit:cover;border:2px solid #c9a95d;border-radius:10px;padding:0}
#match.truco-table .truco-seat strong{font-size:12px;line-height:15px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#match.truco-table .truco-seat small{font-size:10px;line-height:12px;min-height:0}
#match.truco-table .truco-seat.active-seat{border-color:#f3d178!important;box-shadow:0 0 0 2px #e4b94380}
#match.truco-table .truco-seat:after{display:none!important}
#match.truco-table .truco-north{left:50%;top:14%}#match.truco-table .truco-south{left:50%;top:86%}#match.truco-table .truco-west{left:7%;top:48%}#match.truco-table .truco-east{left:93%;top:48%}
#match.truco-table .truco-seat .turn-progress{display:none!important;position:absolute;top:calc(100% + 4px);left:0;bottom:auto;width:100%!important;height:7px;border:1px solid #bfac68;border-radius:5px;background:#061b17;overflow:hidden;box-sizing:border-box}
#match.truco-table .truco-seat.active-seat .turn-progress{display:block!important}
#match.truco-table .turn-progress i{display:block;height:100%;width:var(--remaining,100%);background:#ecc95e}
#match.truco-table .urgent .turn-progress i{background:#f29866}
#match.truco-table .truco-dealer{position:absolute;top:-10px;right:-10px;padding:2px 7px;border-radius:10px;border:1px solid #f8df9c;background:#d5b256;color:#102820;font-size:11px;font-weight:700}
#match.truco-table .truco-opponent-cards{display:flex;position:absolute;top:calc(100% + 16px);left:50%;transform:translateX(-50%);gap:4px;pointer-events:none}
#match.truco-table .truco-west .truco-opponent-cards{left:calc(100% + 10px);top:50%;transform:translateY(-50%);flex-direction:column}
#match.truco-table .truco-east .truco-opponent-cards{left:auto;right:calc(100% + 10px);top:50%;transform:translateY(-50%);flex-direction:column}
#match.truco-table .truco-surface .card{position:relative!important;display:block!important;box-sizing:border-box!important;width:77px!important;height:110px!important;min-width:0!important;min-height:0!important;max-width:none!important;flex:0 0 auto!important;padding:0!important;margin:0!important;transform:none!important;translate:none!important;border:1px solid #bcb5a1;border-radius:6px;overflow:hidden;box-shadow:0 3px 7px #0005}
#match.truco-table .truco-surface .card-index{left:5px!important;top:4px!important}
#match.truco-table .truco-surface .card-index b{font-size:20px!important;line-height:1!important}
#match.truco-table .truco-surface .card-index i{font-size:14px!important;line-height:1!important}
#match.truco-table .truco-surface .card-index.bottom{display:none!important}
#match.truco-table .truco-surface .card-pip{left:56%!important;top:60%!important;transform:translate(-50%,-50%)!important;font-size:32px!important}
#match.truco-table .truco-surface .court-art{position:absolute;width:72%;height:76%;right:0;bottom:0;object-fit:contain}
#match.truco-table .truco-surface .truco-card-back{background:url('/assets/brand-mark.svg') center/60% auto no-repeat,repeating-linear-gradient(45deg,#143e33 0 5px,#285348 5px 6px)!important;border:2px solid #dbc78f}
#match.truco-table .truco-surface .truco-opponent-cards .card{width:42px!important;height:60px!important;border-radius:3px}
#match.truco-table .truco-center{position:absolute;inset:35% 18% 22%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
#match.truco-table .truco-vazas{display:flex;gap:5px}#match.truco-table .truco-vazas span{font-size:10px;padding:3px 8px;border:1px solid #a99662;border-radius:8px;background:#08231ee8;color:#f3e5bf}
#match.truco-table .truco-vazas .won{background:#245c3b}#match.truco-table .truco-vazas .lost{background:#68383a}
#match.truco-table .truco-played{display:flex;justify-content:center;align-items:center;gap:10px;min-height:0}
#match.truco-table .truco-play{text-align:center}#match.truco-table .truco-play small{display:none}
#match.truco-table .previous-trick{opacity:.65}
#match.truco-table .truco-manilhas{display:flex;align-items:flex-end;gap:10px;padding:4px 7px;background:#041915a6;border-radius:8px}
#match.truco-table .truco-vira-display,#match.truco-table .truco-manilha-preview{display:flex;flex-direction:column;align-items:center;gap:3px}
#match.truco-table .truco-manilha-cards{display:flex;gap:3px}
#match.truco-table .truco-manilhas small{font-size:9px;white-space:nowrap;color:#f2dfad}
#match.truco-table .truco-manilhas .card{width:34px!important;height:48px!important}
#match.truco-table .truco-manilhas .card-index{top:2px!important;left:3px!important}
#match.truco-table .truco-manilhas .card-index b{font-size:12px!important}#match.truco-table .truco-manilhas .card-index i{font-size:10px!important}
#match.truco-table .truco-manilhas .card-pip,#match.truco-table .truco-manilhas .court-art{display:none!important}
#match.truco-table .truco-feedback{font-size:12px;line-height:20px;text-align:center;color:#ffdf8e;text-shadow:0 2px 4px #000;margin:0;padding:0}
#match.truco-table .truco-hand{display:flex;align-items:center;justify-content:center;gap:12px;min-height:0;padding:4px 0;margin:0}
#match.truco-table .truco-hand-card{padding:0;border:0;background:none;min-width:0;min-height:0;margin:0;flex:0 0 auto;border-radius:8px}
#match.truco-table .truco-hand-card .card{height:clamp(100px,19vh,158px)!important;width:clamp(70px,13.3vh,111px)!important}
#match.truco-table .truco-hand-card .card-index b{font-size:26px!important}#match.truco-table .truco-hand-card .card-index i{font-size:18px!important}
#match.truco-table .truco-hand-card[aria-pressed=true]{outline:2px solid #f0cb58;transform:translateY(-5px)}
#match.truco-table .truco-surface .card.truco-manilha{background:linear-gradient(145deg,#fff6cc,#ead18a);border:2px solid #c79325;box-shadow:0 0 9px #f2ca6460}
#match.truco-table .truco-controls{display:flex;justify-content:center;align-items:center;gap:8px;margin:0}
#match.truco-table .truco-controls button{width:auto;min-width:110px;min-height:38px;padding:8px 12px;font-size:12px;margin:0}
#match.truco-table .truco-partner{position:absolute;left:15%;right:15%;top:44%;z-index:5;text-align:center;background:#08231ff5;padding:8px;border:1px solid #e4c36b;border-radius:12px}
#match.truco-table .truco-partner .card{display:inline-block!important;margin:4px!important}#match.truco-table .truco-partner>small{display:block}
.truco-theme-settings{display:none}body.playing-truco .truco-theme-settings{display:block}.truco-theme-choice{margin:4px;padding:12px;border:1px solid #8c7847}.truco-theme-choice[aria-pressed=true]{outline:2px solid #f0cb58;background:#315342}
@media(max-width:650px){body.playing-truco main{padding:8px!important}#match.truco-table{padding:0;grid-template-rows:50px minmax(0,1fr)}#match.truco-table .truco-board{margin:0}#match.truco-table .truco-seat{width:68px;padding:4px}#match.truco-table .truco-seat img{width:36px;height:36px}#match.truco-table .truco-seat strong{font-size:10px}#match.truco-table .truco-seat small{font-size:9px}#match.truco-table .truco-west{left:10%}#match.truco-table .truco-east{left:90%}#match.truco-table .truco-opponent-cards{gap:2px}#match.truco-table .truco-surface .truco-opponent-cards .card{width:26px!important;height:37px!important}#match.truco-table .truco-center{inset:37% 18% 24%;gap:5px}#match.truco-table .truco-surface .truco-played .card{width:43px!important;height:61px!important}#match.truco-table .truco-controls{gap:4px}#match.truco-table .truco-controls button{min-width:0;padding:8px;font-size:11px}#match.truco-table .truco-manilhas{gap:6px}#match.truco-table .truco-manilhas .card{width:22px!important;height:32px!important}}
@media(max-height:550px) and (orientation:landscape){#match.truco-table{grid-template-rows:38px minmax(0,1fr)}#match.truco-table .truco-surface{grid-template-rows:25px minmax(120px,1fr) 16px 64px 34px;gap:2px}#match.truco-table .truco-seat{width:64px;padding:3px}#match.truco-table .truco-seat img{width:28px;height:28px}#match.truco-table .truco-seat small{font-size:8px}#match.truco-table .truco-south{left:18%;top:80%}#match.truco-table .truco-center{inset:15% 25% 0}#match.truco-table .truco-surface .truco-played .card{width:30px!important;height:43px!important}#match.truco-table .truco-opponent-cards{display:none}#match.truco-table .truco-hand-card .card{height:58px!important;width:41px!important}#match.truco-table .truco-controls button{min-height:30px;padding:5px 10px}#match.truco-table #turnLabel{font-size:13px}}

body.playing-truco .canasta-theme-options{display:none}
body.playing-truco .truco-theme-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.truco-theme-choice{display:flex;flex-direction:column;gap:7px;align-items:center;margin:0;padding:6px;font-size:13px;overflow:hidden}
.truco-theme-choice img{width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:6px}

.truco-callout{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);z-index:20;pointer-events:none;display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 30px;border:2px solid #f0cc68;border-radius:18px;background:#08251ff2;box-shadow:0 12px 50px #000a;color:#ffe39b;white-space:nowrap}
.truco-callout[hidden],body:not(.playing-truco) .truco-callout{display:none}
.truco-callout strong{font-size:clamp(36px,6vw,76px);line-height:1.1;text-shadow:0 3px 0 #70451b}
.truco-callout span{font-size:14px;color:#fff3d8}

/* Reference proportions: substantial center cards, compact personal hand. */
#match.truco-table .truco-surface{grid-template-rows:44px minmax(180px,1fr) 24px 128px 46px}
#match.truco-table .truco-scoreboard{gap:28px;min-height:42px;padding:5px 20px}
#match.truco-table .truco-scoreboard strong{font-size:24px}
#match.truco-table .truco-scoreboard span{font-size:15px}
#match.truco-table .truco-hand-card .card{width:84px!important;height:120px!important}
#match.truco-table .truco-played .card{width:86px!important;height:122px!important}
#match.truco-table .truco-center{inset:29% 16% 20%;gap:12px}
#match.truco-table .truco-vazas span{font-size:14px;font-weight:700;padding:5px 12px;border-width:2px}
#match.truco-table .truco-vazas .won{background:#277447;color:#fff6bf}
#match.truco-table .truco-manilhas{background:none;padding:4px;gap:24px}
#match.truco-table .truco-manilhas .card{width:64px!important;height:91px!important}
#match.truco-table .truco-manilhas .card-index b{font-size:22px!important}
#match.truco-table .truco-manilhas .card-index i{font-size:15px!important}
#match.truco-table .truco-manilhas .card-pip{display:block!important;font-size:32px!important}
#match.truco-table .truco-deck-display .card{box-shadow:2px 3px 0 #ded0a8,4px 6px 0 #9f8d64,6px 9px 0 #daccac,8px 12px 7px #0009}
#match.truco-table .truco-board>.truco-manilha-preview{position:absolute;left:0;bottom:6%;padding:8px;border:1px solid #b99a50;border-radius:10px;background:#06241ee8;color:#f3dfaa;gap:6px}
#match.truco-table .truco-manilha-preview small{font-size:12px}
#match.truco-table .truco-manilha-preview .card{width:37px!important;height:53px!important}
#match.truco-table .truco-manilha-preview .card-index b{font-size:15px!important}
#match.truco-table .truco-manilha-preview .card-index i{font-size:11px!important}
#match.truco-table .truco-manilha-preview .card-pip,#match.truco-table .truco-manilha-preview .court-art{display:none!important}
@media(max-width:650px){
 #match.truco-table .truco-surface{grid-template-rows:42px minmax(180px,1fr) 24px 118px 46px}
 #match.truco-table .truco-scoreboard{gap:12px;padding:4px 10px}
 #match.truco-table .truco-scoreboard strong{font-size:21px}#match.truco-table .truco-scoreboard span{font-size:12px}
 #match.truco-table .truco-hand-card .card{width:77px!important;height:110px!important}
 #match.truco-table .truco-surface .truco-played .card{width:44px!important;height:63px!important}
 #match.truco-table .truco-played{gap:4px}
 #match.truco-table .truco-center{inset:35% 15% 24%;gap:7px}
 #match.truco-table .truco-vazas span{font-size:12px;padding:4px 7px}
 #match.truco-table .truco-manilhas .card{width:48px!important;height:68px!important}
 #match.truco-table .truco-board>.truco-manilha-preview{left:0;bottom:2%;padding:4px}
 #match.truco-table .truco-manilha-preview small{font-size:8px}
 #match.truco-table .truco-manilha-preview .card{width:26px!important;height:37px!important}
}
@media(max-height:550px) and (orientation:landscape){
 #match.truco-table .truco-surface{grid-template-rows:32px minmax(120px,1fr) 16px 64px 34px;gap:2px}
 #match.truco-table .truco-scoreboard{min-height:28px}#match.truco-table .truco-scoreboard strong{font-size:18px}
 #match.truco-table .truco-hand-card .card{height:58px!important;width:41px!important}
 #match.truco-table .truco-center{inset:10% 25% 0;gap:3px;flex-direction:row;flex-wrap:wrap}
 #match.truco-table .truco-played .card,#match.truco-table .truco-manilhas .card{width:35px!important;height:50px!important}
}

#match.truco-table .truco-board>.truco-vazas{position:absolute;right:0;top:8px}
@media(max-width:650px){
 #match.truco-table .truco-board>.truco-vazas{top:33%;right:auto;left:50%;transform:translateX(-50%);white-space:nowrap}
 #match.truco-table .truco-west .truco-opponent-cards,#match.truco-table .truco-east .truco-opponent-cards{left:50%;right:auto;top:calc(100% + 12px);transform:translateX(-50%);flex-direction:row}
}
@media(min-width:651px) and (min-height:551px){#match.truco-table .truco-north{top:9%}#match.truco-table .truco-south{top:89%}}

/* Match reference stays outside the interactive cards and controls. */
#match.truco-table .truco-match-reference{position:absolute;right:8px;bottom:4px;max-width:34%;padding:4px 6px;border-radius:5px;background:#06241ed9;color:#e2d5ad;font-size:10px;line-height:1.35;text-align:right;overflow-wrap:anywhere;pointer-events:none;z-index:2}
@media(max-width:650px){#match.truco-table .truco-match-reference{right:2px;bottom:0;max-width:29%;font-size:8px;padding:3px 4px}}
@media(max-height:550px) and (orientation:landscape){#match.truco-table .truco-match-reference{right:4px;bottom:0;max-width:30%;font-size:8px}}
