/* Grinders classic deck. Outlined indices and balanced pips share one face across every scene. */
html body .pg-deck-card{position:relative;display:inline-block;box-sizing:border-box;flex:none;padding:0!important;width:var(--deck-w,40px)!important;height:calc(var(--deck-w,40px)*1.4)!important;aspect-ratio:5/7;min-width:0;max-width:none;border:0!important;border-radius:calc(var(--deck-w,40px)*.07);background:transparent!important;box-shadow:0 1px 2px #08101c29!important;color:#161a20;overflow:hidden}
html body .pg-deck-card :is(.game-card-rank,.game-card-suit){position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
html body .pg-deck-card>.deck-face{position:absolute;display:block!important;inset:0;width:100%!important;height:100%!important;max-width:none;object-fit:contain;transform:none!important;border:0;border-radius:calc(var(--deck-w,40px)*.07)}
html body .pg-deck-card.is-back{background:#172a36!important}
html body .pg-deck-card.is-back:before{content:'';position:absolute;inset:10%;border:1px solid #d9e4e638;border-radius:3%;background:repeating-linear-gradient(45deg,transparent 0 4px,#d5e0e414 4px 4.6px,transparent 4.6px 8px),repeating-linear-gradient(-45deg,transparent 0 4px,#d5e0e414 4px 4.6px,transparent 4.6px 8px)}
html body .pg-deck-card.is-back:after{content:''!important;position:absolute;inset:6%!important;border:1px solid #d9e4e67a!important;border-radius:5%;background:none!important}
html body .pg-deck-card>.deck-mark{position:absolute;display:block;left:29%;top:35%;width:42%!important;height:auto!important;filter:invert(1);transform:none!important;opacity:1;z-index:1}
/* The containing scene owns size; neither hole nor board may override it. */
html body.table-focus #tableSurface{--deck-w:48px}
html body.table-focus #tableSurface .pg-deck-card{transform:none!important;rotate:none!important;margin:0}
html body.table-focus #tableSurface :is(#heroCards,#villainCards){gap:0}
html body.table-focus #tableSurface :is(#heroCards,#villainCards)>.pg-deck-card+.pg-deck-card{margin-left:calc(-1 * min(6px,var(--deck-w) * .125));z-index:2}
html body.table-focus #tableBoard{gap:3px}
html body.ac-training.training-game .browse-unit .lobby-v3{--deck-w:40px}
html body.ac-training.training-game .browse-unit .lobby-v3.has-board{--deck-w:36px}
html body.ac-training.training-game .browse-unit .lobby-v3 .pg-deck-card{width:var(--deck-w)!important;height:calc(var(--deck-w)*1.4)!important;border:0!important;background:transparent!important;box-shadow:none!important;rotate:none!important;transform:none!important}
html body.ac-training.training-game .browse-unit .lobby-v3 .pg-deck-card.is-back{background:#172a36!important}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-cards>.pg-deck-card{rotate:-7deg!important;transform-origin:50% 85%;box-shadow:0 2px 3px #0002!important}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-cards>.pg-deck-card+.pg-deck-card{margin-left:calc(var(--deck-w) * -.22);rotate:7deg!important;box-shadow:-1px 1px 3px #0002!important}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-board>.pg-deck-card{margin:0}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-board{gap:3px}
/* Compact phones retain legibility; 390px primary-action visibility is a QA target. */
@media(max-width:600px){
 html body.table-focus #tableSurface{--deck-w:44px}
 html body.table-focus .ht-room #tableSurface{aspect-ratio:auto;height:180px;min-height:180px}
 html body.table-focus .ht-room #tableSurface .ht-center{position:absolute;left:50%;top:15px;transform:translateX(-50%);max-width:none;width:max-content;gap:5px}

}
/* Catalogue-only geometry. Every pair uses identical SVG sizes; only whole cards rotate.
   Community cards stay straight. Gameplay cards retain their separate geometry. */
html body.ac-training.training-game .browse-unit .lobby-v3{height:246px;min-height:246px}
html body.ac-training.training-game .browse-unit .lobby-v3.has-board{height:264px;min-height:264px}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-opponents{top:13px;gap:12px}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-opponent{gap:7px}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-board{top:89px}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-action-line{top:121px;left:8px;right:8px}
html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-action-line{top:149px}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-hero{bottom:12px;gap:9px}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-moving-chips{top:99px;left:65%}
html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-moving-chips{top:142px;left:80%}
html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-squeeze-pressure{top:84px}
@media(max-width:600px){
 html body.ac-training.training-game .browse-unit .lobby-v3{--deck-w:30px;height:172px;min-height:172px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board{--deck-w:23px;height:176px;min-height:176px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-opponents{top:7px;gap:12px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-board{top:60px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-action-line{top:81px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-action-line{top:98px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-hero{bottom:6px;gap:5px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-moving-chips{top:68px;left:72%;--from-y:-32px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-moving-chips.from-hero{--from-x:0px;--from-y:45px;--land-x:0px}
 html body.ac-training.training-game .browse-unit .lobby-v3.is-multiway .lobby-moving-chips.from-opener{--from-x:-52px;--land-x:-36px}
 html body.ac-training.training-game .browse-unit .lobby-v3.is-multiway .lobby-moving-chips.from-caller{--from-x:4px;--land-x:-12px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-moving-chips{top:94px;left:80%}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-squeeze-pressure{top:62px}
 html body.ac-training.training-game .practice-browse .curr-path{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 html body.ac-training.training-game .browse-unit{min-width:0}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-action-step{font-size:9px;gap:4px;padding:5px;max-width:100%;box-sizing:border-box}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-action-step>span{font-size:8px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-position{font-size:8px;padding:2px 5px}
}
@media(max-width:360px){
 html body.table-focus #tableSurface{--deck-w:41px}
 html body.table-focus .ht-room #tableSurface{height:180px;min-height:180px;aspect-ratio:auto}
 html body.ac-training.training-game .browse-unit .lobby-v3{--deck-w:28px;height:164px;min-height:164px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board{--deck-w:21px;height:166px;min-height:166px}
}

/* Empty board slots reserve the same tile geometry as the dealt cards. */
html body.table-focus #tableBoard .ht-empty{width:var(--deck-w)!important;height:calc(var(--deck-w)*1.4)!important;flex:none}

/* Contents-list thumbnails use the same generated deck, not legacy SVG illustrations. */
html body.ac-training.training-game .deck-thumbnail{--deck-w:44px;display:flex;align-items:center;justify-content:center;width:105px;height:70px;overflow:visible}
html body.ac-training.training-game .deck-thumbnail>.pg-deck-card+.pg-deck-card{margin-left:calc(-1 * min(6px,var(--deck-w) * .125))}
@media(max-width:420px){
 html body.ac-training.training-game .toc-unit .curr-unit-summary{grid-template-columns:82px minmax(0,1fr);gap:8px}
 html body.ac-training.training-game .toc-unit .toc-action{grid-column:2}
 html body.ac-training.training-game .deck-thumbnail{--deck-w:41px;width:82px;height:60px}
}
/* Beat legacy .training-game .ht-card.ht-back !important rules explicitly. */
html body.training-game .ht-card.pg-deck-card.is-back{background:#172a36!important;background-image:none!important;border:0!important;box-shadow:0 1px 2px #08101c29!important}
html body.training-game .ht-card.pg-deck-card.is-back:after{background:none!important;background-image:none!important}
/* The catalogue displays three-card flop previews; gameplay controls full boards. */
/* Both front styles share identical geometry; SVG paper supplies the suit color. */
/* Use the same ink back in settings previews, learning cards and table scenes. */
html body[data-grinders-deck=v3] .game-card.pg-deck-card.is-back{background:#172a36!important;background-image:none!important}

/* Concept lessons use the same faces while retaining their original card footprint. */
html body[data-grinders-deck=v3] .lesson-cards{--deck-w:37px}
html body[data-grinders-deck=v3] .lesson-hand .lesson-cards{--deck-w:43px}
@media(max-width:480px){
 html body[data-grinders-deck=v3] .lesson-cards{--deck-w:32px}
 html body[data-grinders-deck=v3] .lesson-hand .lesson-cards{--deck-w:40px}
}

@media(max-width:600px){
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-opponent{gap:4px}
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-felt{inset:36px 7px 24px;border-width:5px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-felt:after{display:none}
}
@media(max-width:360px){
 html body.ac-training.training-game .browse-unit .lobby-v3 .lobby-action-line{top:75px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-board{top:56px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-action-line{top:92px}
}

@media(max-width:600px){
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-opponents{top:4px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-board{top:56px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-action-line{top:93px}
}
@media(max-width:360px){
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-board{top:52px}
 html body.ac-training.training-game .browse-unit .lobby-v3.has-board .lobby-action-line{top:86px}
}

/* Shared card finish; same geometry for basic and four-color decks. */
html body .pg-deck-card{border-radius:calc(var(--deck-w,40px)*.07);box-shadow:0 1px 3px #08101c24!important}
html body .pg-deck-card>.deck-face{border-radius:calc(var(--deck-w,40px)*.07)}
