.cardgame-wrap {
    --card-w: clamp(58px, 15vw, 102px);
    width: min(100%, 840px);
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(150px,1fr) auto auto;
    gap: clamp(5px,1vh,10px);
    align-items: center;
    padding: 3px 5px 8px;
    color: #fff;
}
.cardgame-bar { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; }
.cardgame-chip { min-width:82px; padding:7px 10px; border:1px solid rgba(255,255,255,.15); border-radius:12px; background:rgba(5,18,25,.72); text-align:center; font-size:11px; }
.cardgame-chip b { display:block; color:#ffe07b; font-size:18px; }
.cardgame-ai, .cardgame-player { display:grid; justify-items:center; gap:4px; min-height:62px; width:100%; min-width:0; }
.cardgame-ai > div, .mus-rivals { display:flex; align-items:center; justify-content:center; width:100%; min-width:0; overflow:hidden; }
.cardgame-label { color:#cbd7df; font-size:10px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; }
.cardgame-hand { display:flex; justify-content:center; align-items:center; min-height:calc(var(--card-w) * 1.54); }
.cardgame-hand .sc-card { margin:0 clamp(-11px,-1.3vw,-4px); }
.cardgame-ai .sc-card { width:calc(var(--card-w) * .46); margin:0 -7px; border-radius:6px; }
.cardgame-card-btn, .cardgame-table-btn { appearance:none; border:0; padding:0; margin:0; background:transparent; border-radius:10px; cursor:pointer; transition:transform .14s ease,filter .14s ease; }
.cardgame-card-btn:hover:not(:disabled), .cardgame-card-btn:focus-visible { transform:translateY(-9px); outline:3px solid #7cf0b0; outline-offset:2px; }
.cardgame-card-btn:disabled { cursor:default; opacity:.46; filter:saturate(.55) brightness(.82); }
.cardgame-card-btn:disabled .sc-card { box-shadow:none; }
.cardgame-table {
    width:min(100%,650px);
    height:100%;
    min-height:150px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:clamp(7px,2vw,18px);
    padding:10px;
    border:1px solid rgba(230,205,145,.2);
    border-radius:24px;
    background:radial-gradient(ellipse at center,rgba(36,141,92,.55),rgba(8,71,49,.9) 72%),#0a5138;
    box-shadow:inset 0 0 35px rgba(0,0,0,.28),0 10px 28px rgba(0,0,0,.24);
}
.cardgame-table .sc-card { width:var(--card-w); }
.cardgame-status { justify-self:center; min-height:31px; max-width:min(100%,560px); padding:7px 15px; border:1px solid rgba(255,255,255,.08); border-radius:999px; background:rgba(0,0,0,.32); color:#d6e0e4; font-size:12px; font-weight:800; line-height:1.35; text-align:center; }
.cardgame-status.turn { color:#092719; background:#79e49f; }
.cardgame-actions { display:flex; justify-content:center; gap:7px; flex-wrap:wrap; }
.cardgame-actions button { min-height:38px; padding:8px 13px; border:1px solid rgba(255,255,255,.18); border-radius:10px; color:#fff; background:rgba(255,255,255,.1); font-weight:850; cursor:pointer; }
.cardgame-actions button.primary { color:#10251a; background:#7cf0b0; }
.cardgame-actions button:disabled { opacity:.35; cursor:default; }
.cardgame-start { max-width:440px; margin:0 auto; }
.cardgame-start p { color:#d0c5e5; font-size:13px; line-height:1.45; }
.cardgame-rules { margin:10px auto; padding:10px 12px; border-radius:11px; background:rgba(255,255,255,.07); color:#fff1bf; font-size:12px; line-height:1.45; text-align:left; }
.cardgame-result { display:flex; justify-content:center; gap:18px; margin:10px 0; }
.cardgame-result span { display:grid; gap:2px; color:#cfc5e5; font-size:11px; }
.cardgame-result b { color:#ffe07b; font-size:30px; }
.escoba-table { flex-wrap:wrap; align-content:center; }
.escoba-table .cardgame-table-btn.selected { transform:translateY(-8px); outline:3px solid #ffe07b; outline-offset:2px; }
.escoba-table .sc-card { width:clamp(51px,12vw,82px); }
.escoba-piles { display:flex; align-items:center; justify-content:center; gap:14px; }
.escoba-pile { display:grid; justify-items:center; gap:3px; color:#d8e0df; font-size:10px; }
.chinchon-table { display:grid; grid-template-columns:repeat(2,auto); align-content:center; }
.chinchon-pile { display:grid; justify-items:center; gap:5px; color:#dbe3e2; font-size:10px; font-weight:850; }
.chinchon-pile button { appearance:none; border:0; padding:0; background:transparent; cursor:pointer; border-radius:10px; }
.chinchon-pile button:focus-visible { outline:3px solid #7cf0b0; outline-offset:3px; }
.chinchon-hand .sc-card { width:clamp(48px,12vw,82px); }
@media (max-height:650px) {
    .cardgame-wrap { --card-w:clamp(49px,12vh,77px); grid-template-rows:auto auto minmax(115px,1fr) auto auto; }
    .cardgame-table { min-height:115px; }
    .cardgame-ai .sc-card { width:36px; }
}
.mus-table { display:grid; grid-template-columns:1fr auto; }
.mus-partner { display:grid; justify-items:center; gap:5px; }
.mus-partner .sc-card,.mus-rivals .sc-card { width:clamp(33px,7vw,49px); margin:0 -7px; }
.mus-lance { min-width:110px; padding:12px; border-radius:15px; color:#251b0c; background:#ffe07b; font-size:16px; font-weight:950; text-align:center; }
.mus-hand .cardgame-card-btn.selected { transform:translateY(-10px); outline:3px solid #ffe07b; outline-offset:2px; }
.brisca-team-wrap { width:min(100%,740px); grid-template-rows:auto auto minmax(150px,1fr) auto auto; }
.bt-players { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; width:100%; }
.bt-player { min-width:0; padding:6px; border:1px solid rgba(255,255,255,.12); border-radius:10px; text-align:center; background:rgba(3,17,25,.48); }
.bt-player.mate { border-color:rgba(124,240,176,.5); background:rgba(34,100,69,.4); }
.bt-backs { display:flex; justify-content:center; min-height:47px; overflow:hidden; }
.bt-backs .sc-card { width:32px; margin:0 -6px; border-radius:4px; }
.bt-table .sc-card { width:clamp(50px,11vw,80px); }
.bt-table > div { display:grid; justify-items:center; gap:3px; }
.brisca-team-wrap .cardgame-hand .sc-card { width:clamp(54px,12vw,88px); }
@media (max-width:560px) {
    .bt-player { padding:4px 2px; }
    .bt-backs .sc-card { width:26px; margin:0 -7px; }
    .bt-table { gap:5px; padding:6px; }
}
@media (prefers-reduced-motion:reduce) { .cardgame-card-btn,.cardgame-table-btn { transition:none; } }
