.bv-tile{min-width:0;container-type:inline-size}.bv-card{display:block;position:relative;isolation:isolate;width:100%;aspect-ratio:2/3;border:0;border-radius:0;padding:0;background:#080f15;color:#fff;text-align:center;overflow:hidden;box-shadow:0 12px 25px #0009;transition:transform .18s;cursor:pointer}.bv-card:hover{transform:translateY(-4px);background:#080f15}.bv-card img{pointer-events:none}.bv-portrait{position:absolute;left:5%;top:3%;width:90%;height:49%;object-fit:cover;object-position:center top;z-index:0}.bv-frame{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none}.bv-emblem{position:absolute;right:7%;top:5%;width:13.5%;height:10%;object-fit:contain;z-index:4}.bv-family-emblem{position:absolute;left:44%;bottom:5.7%;width:12%;height:8%;z-index:4;object-fit:contain}.bv-motif{position:absolute;left:3.5%;top:18%;width:3%;height:62%;background-size:100% auto;background-repeat:repeat-y;z-index:3;opacity:.85;pointer-events:none}.bv-finish{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none}.bv-tier{position:absolute;top:6.4%;left:8%;width:13%;z-index:5;font:bold 9cqw/1 Georgia;text-shadow:0 2px 3px #001627}.bv-stars{position:absolute;top:4.4%;left:29%;width:42%;font:7.7cqw/1 Georgia;color:#ffda7b;letter-spacing:.03em;text-shadow:0 2px 3px #3c2105;z-index:5}.bv-name{position:absolute;top:52.2%;height:6%;left:9%;width:82%;font:bold 5.5cqw/1.04 Georgia;display:flex;align-items:center;justify-content:center;text-shadow:0 2px 3px #000;z-index:5}.bv-family-label{position:absolute;top:59.6%;left:12%;width:76%;font:4cqw/1.15 Georgia;z-index:5;white-space:nowrap}.bv-type{position:absolute;top:63.1%;left:15%;width:70%;font:3.1cqw/1.1 Georgia;color:#ead59c;z-index:5}.bv-effect{position:absolute;top:67%;left:12%;width:76%;height:16.4%;font:4.15cqw/1.2 Georgia;display:flex;align-items:center;justify-content:center;text-align:center;z-index:5;text-shadow:0 1px 2px #000;overflow:hidden}.bv-effect.is-long{font-size:3.6cqw;line-height:1.16}.bv-atk,.bv-hp{position:absolute;bottom:8.6%;font:bold 9.5cqw/1 Georgia;z-index:5;text-shadow:0 2px 3px #000}.bv-atk{left:23%}.bv-hp{right:10%}.bv-status{position:absolute;top:43%;left:14%;width:72%;background:#0b2227ef;border:1px solid #d9d0a1;border-radius:4px;z-index:6;padding:4px;font-size:3.5cqw}.bv-card.state-selected{outline:3px solid #fff;outline-offset:3px}.bv-card.state-owned{box-shadow:0 0 20px #a2ddc94d}.bv-card.state-fusion{outline:2px solid #f1d182;outline-offset:2px}.bv-card.state-disabled .bv-portrait{filter:saturate(.25);opacity:.7}.bv-caption{color:#a7b8bd;font-size:11px;text-align:center;padding:8px 3px;min-height:36px}.bv-actions{display:flex;gap:5px;padding:4px 8px;flex-wrap:wrap}.bv-actions button{flex:1;padding:7px 5px;font-size:12px;min-height:44px}.bv-art-missing{position:absolute;inset:15% 10% auto;font:5cqw Georgia;color:#bfc7c8}
.bv-card:after{content:"";position:absolute;inset:2.7% 3.2%;border:1px solid var(--accent);box-shadow:inset 0 0 12px color-mix(in srgb,var(--accent) 25%,transparent),0 0 9px color-mix(in srgb,var(--accent) 30%,transparent);opacity:.65;z-index:3;pointer-events:none}

.bv-effect.is-long{font-size:max(11.5px,3.6cqw)}@media(max-width:650px){.bv-gallery:not(.context-hand):not(.context-army){grid-template-columns:1fr;max-width:390px;margin-inline:auto}}

/* V2.2: large illustration, remove intrusive upper frame sockets; keep exterior rim. */
.bv-frame{mask-image:linear-gradient(to bottom,#000 0 3%,transparent 3% 51%,#000 51% 100%),linear-gradient(to right,#000 0 4%,transparent 4% 96%,#000 96% 100%);mask-composite:add;-webkit-mask-image:linear-gradient(to bottom,#000 0 3%,transparent 3% 51%,#000 51% 100%),linear-gradient(to right,#000 0 4%,transparent 4% 96%,#000 96% 100%);-webkit-mask-composite:source-over}
.bv-tier-gem{position:absolute;left:5%;top:3%;width:13%;height:9%;z-index:4;object-fit:contain;pointer-events:none}.bv-tier{left:5%;width:13%;top:5%;font-size:7cqw}.bv-emblem{right:4%;top:4%;width:11%;height:8%}.bv-stars{top:3.5%;font-size:6.5cqw}

/* CARDS-04 R3: explicit face widths avoid percentage/containment collapse. */
.collectionPortrait{width:100%;height:100%;object-fit:contain;object-position:center top}
.collectionFace{min-width:0;width:100%;container-type:inline-size}
.collectionFace .bv-caption{display:none}
.collectionFace .bv-card{min-height:0;max-height:none;padding:0}
.collectionFace .bv-portrait{max-width:none;max-height:none}
.collectionCard{display:flex!important;flex-direction:column!important;align-items:center;gap:4px!important;min-width:0;height:auto!important;padding:4px!important}
.collectionCard>.art,.collectionCard>small,.collectionCard>strong,.collectionCard>.stats,.collectionCard>.ability{display:none!important}
#preparation .collectionCard>small,#preparation .collectionCard>strong,#preparation .collectionCard>.ability,#preparation .collectionCard>.art,#preparation .collectionCard>.stats{display:none!important}
.collectionCard>.infoButton{position:absolute;right:4px;top:4px;z-index:9}
.collectionCard>.actions,.collectionCard>.actionDeploy,.collectionCard>.actionBuy{width:100%;margin-top:auto;min-height:34px}
#catalogCards{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));align-items:start}
#cardDetailBody>.bv-tile{width:min(100%,340px);margin-inline:auto}
@media(min-width:1000px) and (min-height:700px){
 body:has(#game.shopMode:not([hidden])){display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden}
 body:has(#game.shopMode:not([hidden]))>header{flex:0 0 64px;min-height:64px;height:64px;box-sizing:border-box}
 body:has(#game.shopMode:not([hidden]))>footer{display:none}
 body:has(#game.shopMode:not([hidden]))>.wrap{flex:1;width:100%;height:auto;min-height:0;overflow:hidden;box-sizing:border-box;padding:8px 18px}
 #game.shopMode:not([hidden]){height:100%;min-height:0;align-items:stretch;grid-template-rows:28px auto 22px auto minmax(0,1fr)}
 #game.shopMode #gameSidebar,#game.shopMode #gameSynergies{height:100%;min-height:0;overflow-y:auto}
 #game.shopMode #players{height:100%;min-height:0}
 #game.shopMode #preparation:not([hidden]){height:100%;min-height:0;grid-template-rows:minmax(0,.34fr) minmax(0,.44fr) minmax(0,.22fr);gap:7px;align-content:stretch}
 #game.shopMode .shopPanel,#game.shopMode .armyPanel,#game.shopMode .handZone{min-height:0;padding:6px 10px}
 #game.shopMode .shop,#game.shopMode .army,#game.shopMode .handRow{flex:1;min-height:0;height:100%}
 #game.shopMode .formationLine{flex:1;min-height:0;height:100%}
 #preparation .shop{grid-template-columns:repeat(var(--offers,3),minmax(0,1fr))!important;align-items:center}
 #preparation .formationLine{grid-template-columns:repeat(var(--slots,2),minmax(0,1fr))!important;align-items:center}
 #preparation .handCards{grid-template-columns:repeat(var(--hand-cards,4),minmax(0,1fr))!important;align-items:center}
 #preparation .collectionCard{display:flex!important;flex-direction:column!important;align-items:center;justify-content:center;height:auto!important;min-height:0!important;padding:3px!important;gap:2px!important}
 #preparation .collectionFace{flex:none;width:var(--card-face-width);max-width:100%;height:auto;aspect-ratio:auto;align-self:center}
 #preparation .collectionFace .bv-tile{width:100%;height:auto;min-height:0}
 #preparation .collectionFace .bv-card{width:100%;height:auto;min-height:0;aspect-ratio:2/3}
 #preparation .shop{--card-face-width:clamp(60px,calc((32dvh - 120px)*.666667),134px)}
 #preparation .army,#preparation .handCards{--card-face-width:clamp(40px,calc((22dvh - 100px)*.666667),74px)}
 #preparation .collectionCard>.actions,#preparation .collectionCard>.actionBuy,#preparation .collectionCard>.actionDeploy{flex:none;min-height:25px;max-width:210px;margin:0!important;display:flex;justify-content:center;flex-wrap:nowrap;gap:3px;grid-column:auto}
 #preparation .collectionCard>.actions button{min-height:24px;flex:1;font-size:10px;padding:3px}
 #preparation .collectionCard>.infoButton{width:22px;height:22px!important;min-height:22px!important}
 #preparation .collectionCard>.offerBadge{max-width:100%;font-size:9px}
 #preparation .collectionFace .bv-card:hover{transform:none}
}
@media(max-width:999px),(max-height:699px){
 #preparation .collectionCard{min-height:0!important}
 #preparation .collectionFace{width:min(100%,180px);height:auto;aspect-ratio:auto}
 #preparation .collectionFace .bv-tile{height:auto}
 #preparation .collectionFace .bv-card{height:auto;aspect-ratio:2/3}
 .shop,.handCards,.formationLine{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start!important}
 .collectionFace .bv-effect{display:flex;font-size:3.6cqw}
 .collectionFace .bv-card{touch-action:pan-y}
}

/* Combined test: keep tavern commands separate from card faces. */
#preparation .tavernHeader{position:relative;z-index:20;flex-shrink:0;isolation:isolate;background:#142c43;border-radius:6px}
#preparation .collectionCard:hover{transform:none}
.collectionFace .bv-effect.is-long{font-size:3.6cqw;line-height:1.16}
@media(min-width:1000px) and (min-height:700px){
 #game.shopMode #shop{container-type:size;flex:1 1 0;height:auto!important;min-height:0}
 #preparation #shop .collectionFace{width:min(134px,max(24px,calc((100cqh - 54px)*.666667)))}
}
