/* GAMEFIT181 — play area uses the space ABOVE the application nav. No game logic changes. */
body.k69:has(.gscr),body.k69:has(.kvw),body.k69:has(.kmw),body.k69:has(.trfull){background:#f5f7fb!important;background-image:none!important}
body:has(.gscr) #app,body:has(.kvw) #app,body:has(.kmw) #app,body:has(.trfull) #app{background:none!important;background-image:none!important}
.gscr::after,.kvw::after,.kmw::after,.trfull::after{display:none!important;content:none!important}
.gscr{background:#f5f7fb!important;background-image:none!important;--gf-room:calc(100svh - var(--k6bar,0px) - env(safe-area-inset-top,0px));min-height:var(--gf-room)!important;padding-top:env(safe-area-inset-top,0px);padding-bottom:8px;display:flex;flex-direction:column;overflow:visible}
@supports(height:100dvh){.gscr{--gf-room:calc(100dvh - var(--k6bar,0px) - env(safe-area-inset-top,0px))}}
body.k69.k6tb:has(.gscr) #app{padding-bottom:var(--k6bar)!important}
.gscr>.gtop,.gscr>#gpl,.gscr>#gmsg,.gscr>#gextra,.gscr>#gpl2,.gscr>.grx{flex-shrink:0}
.gscr>#gpl,.gscr.kmid>#gpl{margin-top:0}
.gscr>.gboard,.gscr.f2f>.gboard{flex-shrink:0;margin-top:2px;margin-bottom:2px;max-width:100%}
.gscr>.grx,.gscr.kmid>.grx{margin:6px 8px 0;gap:3px}
.gscr>.grx:empty,.gscr>#gpl2:empty,.gscr>#gmsg:empty,.gscr>#gextra:empty{display:none}
.gscr .gplayers{margin:2px 10px 0}
.gscr .gfc{width:44px;height:44px;border-width:3px;font-size:24px}
.gscr .gfc .gmk{font-size:18px;right:-6px;bottom:-4px}
.gscr .gfn{font-size:12px;margin-top:2px}
.gscr .grec b{font-size:19px;line-height:1.05}
.gscr .grec .cg{font-size:11px}
.gscr .gturn{font-size:12px;margin-top:2px;padding:3px 8px}
.gscr>.gtop{padding-top:5px;padding-bottom:3px;min-height:48px}
.gscr .gtop .gx{min-width:42px;min-height:42px}
.gscr>#gmsg{margin:3px 10px;min-height:22px;font-size:13.5px}
.gscr.kmid[data-ffk="chess"]>#gextra{height:auto;min-height:0;overflow:visible}
.gscr.ffend>#gextra>.gover,.gscr #gextra>.gover{position:static;transform:none;margin:6px 12px 0;padding:9px 12px;border-radius:16px;box-shadow:0 2px 8px rgba(20,40,80,.12)}
.gscr #gextra>.gover>b{font-size:19px;line-height:1.2}
.gscr #gextra>.gover>.cg{font-size:12px;line-height:1.25}
.gscr #gextra>.gover>.row{margin-top:6px!important;gap:8px}
.gscr #gextra>.gover .btn{min-height:42px;padding:7px 12px;font-size:14px}
.gscr .grx button{width:40px;height:42px;flex:none;font-size:21px}
.gscr.ffs .gseat{height:68px;padding:4px 8px;margin:2px 10px;row-gap:0}
.gscr.ffs .gseat .gshint{height:18px;line-height:18px;font-size:12px}
.gscr.ffs .gsav{width:34px;height:34px}
.gscr.ffs .gstag.on{font-size:12px;padding:4px 8px}
.gscr.ffs #gpl2{margin-top:2px;padding-bottom:0}
.gscr.ffs.ffend>#gmsg{display:none}
/* Scaling is confined to fixed game boards, never page text, result cards, rules or the nav. */
.gscr[data-gf-fixed="1"]>.gboard{zoom:var(--gf-scale,1)}
/* Other full-screen games retain their own measured layouts; only the distracting background is removed. */
.kvw,.kmw,.trfull{background:#f5f7fb!important;background-image:none!important}
html.kdark body:has(.gscr),html.kdark body:has(.kvw),html.kdark body:has(.kmw),html.kdark body:has(.trfull),html.kdark .gscr,html.kdark .kvw,html.kdark .kmw,html.kdark .trfull{background:#171b24!important}

/* Small-phone refinements: keep controls full-size, reduce decorative/card whitespace first. */
@media(max-height:720px){
 .gscr.ffs.ffend .gseat{height:48px;min-height:0;padding:2px 8px}
 .gscr.ffs.ffend .gseat .gshint{display:none}
 .gscr[data-ffk="backgammon"] .bgturn{height:42px;margin:3px 0;gap:6px}
 .gscr[data-ffk="backgammon"] .bgturn b{font-size:17px}.gscr[data-ffk="backgammon"] .bgturn small{font-size:11px}
 .gscr[data-ffk="backgammon"] .bgb .pt{height:104px}
 .gscr:has(.pgin)>#gmsg{min-height:36px!important}
 .gscr .pgin .popp{flex-direction:row;justify-content:center;height:30px;gap:10px;margin-bottom:4px}
 .gscr .pgin .popp .pc.sm{height:25px;width:18px}
 .gscr .pgin .ptable{padding:6px 8px;margin-bottom:5px;gap:12px}
 .gscr .pgin .pc.big{width:60px;height:82px}.gscr .pgin .pc.lg{width:58px;height:80px}
 .gscr .pgin .pc.big b,.gscr .pgin .pc.lg b{font-size:25px}
 .gscr .pgin .pc.big i,.gscr .pgin .pc.lg i{font-size:32px}
 .gscr .pgin .ghand{height:104px}
 .gscr .pgin .pdw{margin-top:3px;gap:6px;font-size:12px}
 .gscr .pgin .pbtns{margin-top:6px;gap:6px}.gscr .pgin .pbtns .btn{min-height:42px;padding-top:7px;padding-bottom:7px;font-size:14px}
 .gscr:has(.bsw)>#gmsg{min-height:32px!important}
 .gscr .bsw:has(.bships){display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
 .gscr .bsw .bships{grid-column:1/-1;gap:4px;margin-bottom:0}
 .gscr .bsw .bships button{min-height:32px;font-size:11.5px;padding:4px 6px}
 .gscr .bsw .bships em{width:5px;height:5px}
 .gscr .bsw:has(.bships)>.bsg{grid-column:1/-1;width:min(100%,calc(100dvh - 338px))}
 .gscr .bsw:has(.bships)>.pbtns{display:contents}
 .gscr .bsw:has(.bships)>.pbtns .btn{width:auto;min-height:42px;padding:5px 3px;font-size:12px;margin:0}
}

@media(max-height:620px){.gscr.f2f:has(.gover) .gseat{height:46px;min-height:0;padding:2px 8px}.gscr.f2f:has(.gover)>#gpl2{margin-top:0;padding-bottom:0}.gscr.f2f:has(.gover) .gshint{display:none}}

/* Optional round detail is expandable, so normal controls never hide behind long reveal reports. */
.gf181-details{width:100%;color:#27344f}.gf181-details>summary{list-style:none;min-height:42px;padding:11px 12px;font-size:13px;font-weight:800;border:1px solid #d7e1ef;border-radius:12px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px}
.gf181-details>summary::before{content:"▸"}.gf181-details[open]>summary::before{content:"▾"}.gf181-details>summary::-webkit-details-marker{display:none}.gf181-details>.pgin{padding-top:8px}
.gscr .bsw>.gf181-details{margin-top:5px}
@media(max-height:720px){
 .gscr:has(.bsw):has(.gover) .bsg.big{width:min(100%,calc(100dvh - 372px))}
 .gscr:has(.bsw):not(:has(.gover)) .bsg.fire{width:min(100%,calc(100dvh - 240px))}
 .gscr .bsrow{justify-content:center}.gscr .bsrow .bsfleet{font-size:11px}
}
/* Tile Rummy uses white type: the calm, plain table backing stays dark enough to read it. */
.trfull{background:#4b596c!important}
html.kdark .trfull{background:#283341!important}
body.k69.k6tb .trfull{bottom:var(--k6bar);padding-bottom:8px}
body.k69.k6tb .kvbtns{bottom:calc(var(--k6bar) + 8px)}
.kvw.kvtablepg,.kvw.kvoverpg{padding-bottom:90px;min-height:0}

/* Reactions keep their original handlers, in a header popover instead of taking another full board row. */
.gscr.gf181-rx>.grx{display:none;position:absolute;right:8px;left:auto;top:52px;z-index:15;width:min(340px,calc(100vw - 16px));padding:8px;margin:0;border-radius:16px;background:#fff;box-shadow:0 5px 22px #24365333;gap:2px;flex-wrap:nowrap}
.gscr.gf181-rx.gf181-rx-open>.grx{display:flex}
.gscr.gf181-rx>.grx button{width:calc((100% - 14px)/8);min-height:42px;flex:1;font-size:21px}
.gscr .gf181-rxt{font-size:26px;margin-left:4px;color:#536782;box-shadow:0 0 0 1px #dce3ee}
.gscr.gf181-rx .gtt{min-width:0;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.kdark .gscr.gf181-rx>.grx,html.kdark .gf181-details>summary{background:#252e3c;color:#edf1fa;border-color:#475265}
html.kdark .gf181-details{color:#edf1fa}

@media(max-height:620px){.gscr .bsw:has(.bships)>.bsg{width:min(100%,calc(100dvh - 358px))}}

@media(max-height:720px){
 .kmw.kmsteps .kmstep{margin:2px 0 8px}.kmw.kmsteps .kmstep h2{font-size:22px}
 .kmw.kmsteps .kmbox{gap:8px}.kmw.kmsteps .kmbox button{min-height:94px;padding:8px 6px;gap:3px;border-radius:18px}
 .kmw.kmsteps .kmbox .kmbi{font-size:30px}.kmw.kmsteps .kmbox b{font-size:14px}.kmw.kmsteps .kmbox small{font-size:11.5px}
 .kmw.kmsteps .kmtools{margin-top:6px;gap:5px}.kmw.kmsteps .kmtools .kmlink{font-size:12px;padding:8px 5px;min-height:40px}
 .gf181-kv .kvtbl{transform:none;margin:0 auto}
 .gf181-kv .kvfelt{height:140px;width:220px;box-shadow:0 0 0 4px #d9b45a,0 0 0 5px #b8902f,inset 0 0 20px #0002}
 .gf181-kv .kvmid{display:none} /* decorative duplicate deck/bank picture; live bank figures stay in the status strip */
 .gf181-kv .kvini{width:30px;height:30px;font-size:14px}.gf181-kv .kvnm{margin-top:0}
 .gf181-kv .kvme{padding:6px 10px;margin:0 10px;gap:8px}
 .gf181-kv .kvhint{margin:4px 12px 0;line-height:1.3}
 .gf181-kv .kvrule{margin:3px 10px 0;font-size:11px}
 .gf181-kv>.gf181-details{width:calc(100% - 20px);margin:0 10px 7px}
 .gf181-kv .kvbet{padding:8px 10px;margin:0 10px}.gf181-kv .kvbr{margin:3px 0}
}

/* Keep the actual bank amount legible even in the narrow two-column status strip. */
@media(max-width:370px){.kvw .kvbankbar{padding:6px 8px}.kvw .kvbankbar b{font-size:16px;white-space:normal;line-height:1.2}.kvw .kvbankbar small{font-size:10.5px}}

/* Latest Kvitlech uses cream/sage type designed for a dark table. Keep it plain, not washed out. */
body.k69:has(.kvw),.kvw{background:#092d29!important;background-image:none!important}

@media(max-height:720px){.gf181-kv:has(.kvcomposer)>.kvrule{display:none}} /* Full Rules stays at the top; don't overlay betting with duplicate explanatory copy. */

@media(max-height:620px){.gf181-kv>.kvrule{display:none}} /* Detailed rules remain available in the fixed Rules header. */

/* Compact the oversized result decoration before touching card legibility or privacy actions. */
@media(max-height:720px){
 .kvoverpg .kvhero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:4px 8px;padding:10px;margin:6px 10px 0}
 .kvoverpg .kvhero>.kvini.big{display:none}
 .kvoverpg .kvhero>h2{grid-column:1/-1;font-size:20px;line-height:1.2;margin:0}
 .kvoverpg .kvhero>.kvs{grid-column:1/-1;font-size:11px;margin:0}
 .kvoverpg .kvhero>.kvhc{grid-column:1;grid-row:3/5;margin:4px 0;gap:3px;justify-content:center}
 .kvoverpg .kvhero>.kvbadge{grid-column:2;grid-row:3;font-size:11px;margin:0}
 .kvoverpg .kvhero>.kvwon{grid-column:2;grid-row:4;font-size:12px;line-height:1.3;margin:0}
 .kvoverpg .kvhero:has(.kvhc>.kvbc:nth-of-type(n+4))>.kvhc{grid-column:1/-1;grid-row:auto;flex-wrap:wrap}
 .kvoverpg .kvhero:has(.kvhc>.kvbc:nth-of-type(n+4))>.kvbadge,.kvoverpg .kvhero:has(.kvhc>.kvbc:nth-of-type(n+4))>.kvwon{grid-column:auto;grid-row:auto}
 .kvoverpg .kvmuck{margin:8px 10px;padding:10px}
 .kvoverpg .kvmuck>b{font-size:14px}.kvoverpg .kvmuck p{font-size:11px;line-height:1.35;margin:4px 0 5px}
 .kvoverpg .kvmuck>.kvhc{margin:4px 0}.kvoverpg .kvmuckbtns{margin-top:6px;gap:6px}.kvoverpg .kvmuckbtns .btn{min-height:46px;font-size:12px;padding:8px 6px}
}

/* Optional opponents table is a real closable overlay, not content underneath fixed hand/actions. */
.gf181-kv-dialog{position:fixed;inset:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;background:#092d29;color:#f2e8c9;overflow:hidden;z-index:99999}
.gf181-kv-dialog::backdrop{background:#001b18cc}.gf181-kv-dialog>header{display:flex;align-items:center;gap:12px;min-height:58px;padding:6px 10px;border-bottom:1px solid #547462;background:#0b3029}.gf181-kv-dialog>header button{min-height:44px;padding:8px 12px;border:1px solid #b2c8a7;border-radius:9px;background:#e8d99f;color:#17392d;font-weight:800}.gf181-kv-dialog-body{height:calc(100dvh - 60px);overflow:auto;padding:8px 0 20px}.gf181-kv-dialog .kvtbl{margin:10px auto!important}
body.k69:has(.kvw) #app{min-height:calc(100dvh - var(--k6bar,61px));background:#092d29!important}.kvw{min-height:calc(100dvh - 124px)!important}
#app>.bar:has(+.kvw) .kvlv{background:#f6eee0!important;color:#7b301f!important;border:1px solid #d8b6a3;border-radius:8px;min-width:44px;min-height:40px}

@media(max-height:620px){#app .kvoverpg .kvhero .kvbc,#app .kvoverpg .kvmuck .kvbc{height:58px;width:40px;font-size:28px}#app .kvoverpg .kvmuckbtns .btn{font-size:12px;line-height:1.2;min-height:46px;padding:7px 5px}}

.kvw .kvbtns{background:#092d29!important} /* Opaque action backing: no rounded result-card edge or cream page band can bleed through it. */
