
/* RIMBA Chess mobile compact layout — visual only, gameplay grid unchanged */
@media(max-width:980px){
 html:has(.rc-main),body:has(.rc-main){overflow-x:hidden}
 .rc-main{padding:3px 5px!important;margin:0!important}
 .rc-main .rc-top-hud{display:none!important}
 .rc-main .rc-mobile-hud{display:none!important}
 .rc-main .rc-board-wrap{padding:5px!important;margin:2px 0!important;border-radius:15px!important}
 .rc-main .rc-board{min-height:0!important;max-height:none!important;height:var(--rimba-board-height, min(48dvh, 420px))!important;aspect-ratio:auto!important}
 .rc-main .rc-bench{margin:4px 0!important;padding:4px!important;min-height:0!important}
 .rc-main .rc-prep-actions{margin:4px 0!important;gap:5px!important}
 .rc-main .rc-prep-actions button{min-height:39px!important;padding:5px!important;font-size:clamp(11px,3vw,15px)!important}
 .rc-main .rc-shop-pop{position:static!important;transform:none!important;width:100%!important;margin:3px 0!important}
 .rc-main .rc-shop{margin:0!important}
 .rc-main .rc-unit-name{display:none!important}
 .rc-main .rc-unit .rc-unit-art{z-index:1}
 .rc-main .rc-unit-stars{z-index:5}
 .rc-main .rc-role-icon{position:absolute;right:1px;top:0;z-index:7;font-size:clamp(9px,2.6vw,14px);line-height:1;text-shadow:0 1px 3px #000;pointer-events:none}
 .rc-main .rc-compact-center{position:absolute;top:5px;left:50%;transform:translateX(-50%);z-index:12;display:flex;flex-direction:column;align-items:center;gap:1px;pointer-events:none;max-width:43%;min-width:95px;text-align:center;padding:3px 6px;border-radius:10px;background:rgba(4,21,31,.76);border:1px solid rgba(151,205,219,.22)}
 .rc-main .rc-compact-center .rc-phase{display:flex!important;flex-direction:column;gap:0}
 .rc-main .rc-compact-center .rc-phase b{font-size:clamp(10px,3vw,14px)!important;letter-spacing:.04em}
 .rc-main .rc-compact-center .rc-phase span{font-size:10px!important}
 .rc-main .rc-compact-center .rc-round{display:flex!important;align-items:center;gap:5px;justify-content:center}
 .rc-main .rc-compact-center .rc-round small,.rc-main .rc-compact-center .rc-round b{font-size:10px!important}
 .rc-main .rc-board-wrap{position:relative!important}
 .rc-main .rc-focus-profile{max-width:37%!important}
 .rc-main .rc-unit .rc-unit-hp{z-index:5}
}


/* RIMBA Chess mobile V2: hide role text and compact synergy overlay */
@media(max-width:980px){
.rc-unit-name,.rc-unit .rc-unit-name,.rc-bench .rc-unit-name,.rc-shop .rc-unit-name{display:none!important;visibility:hidden!important}
.rc-unit .rc-role-label,.rc-unit .rc-role-name,.rc-unit .rc-class-name,
.rc-bench .rc-role-label,.rc-shop .rc-role-label{display:none!important}
.rc-focus-synergy,.rc-arena-overlays .rc-focus-synergy,.rc-mobile-syn{
 max-width:min(43vw,170px)!important;width:max-content!important;
 padding:4px 5px!important;border-radius:9px!important;
 font-size:10px!important;line-height:1.1!important;
}
.rc-focus-synergy-head{font-size:11px!important;margin:0 0 2px!important;gap:3px!important}
.rc-focus-synergy .rc-syn-dock,.rc-mobile-syn .rc-syn-dock{display:flex!important;gap:2px!important;flex-wrap:nowrap!important}
.rc-focus-synergy .rc-syn-chip,.rc-mobile-syn .rc-syn-chip{
 min-width:0!important;width:27px!important;height:27px!important;padding:2px!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 gap:0!important;overflow:hidden!important
}
.rc-focus-synergy .rc-syn-chip .rc-syn-icon,.rc-mobile-syn .rc-syn-chip .rc-syn-icon{font-size:14px!important}
.rc-focus-synergy .rc-syn-chip .rc-syn-count,.rc-mobile-syn .rc-syn-chip .rc-syn-count{
 position:absolute!important;right:0!important;bottom:0!important;font-size:8px!important;
 background:#071b27!important;border-radius:4px!important;padding:0 2px!important
}
.rc-focus-synergy .rc-syn-chip :not(.rc-syn-icon):not(.rc-syn-count),
.rc-mobile-syn .rc-syn-chip :not(.rc-syn-icon):not(.rc-syn-count){display:none!important}
.rc-focus-synergy{top:88px!important;left:6px!important;right:auto!important;z-index:9!important}
.rc-unit{position:absolute}
.rc-role-corner{right:1px!important;top:1px!important;left:auto!important;font-size:clamp(9px,2.5vw,13px)!important}
}

@media(max-width:980px){
.rc-focus-mode .rc-top-hud{display:none!important}
.rc-focus-mode .rc-mobile-hud{display:none!important}
.rc-focus-mode .rc-arena-stage{position:relative!important}
.rc-focus-mode .rc-board-wrap{margin-top:0!important}
.rc-compact-center{position:absolute!important;top:7px!important;left:50%!important;transform:translateX(-50%)!important;z-index:20!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;padding:4px 8px!important;width:clamp(104px,29vw,156px)!important;min-width:0!important;max-width:32%!important;background:rgba(5,21,34,.91)!important;border:1px solid #31536a!important;border-radius:12px!important;pointer-events:auto!important}
.rc-compact-center .rc-phase{display:block!important;margin:0!important;padding:0!important;text-align:center!important}
.rc-compact-center .rc-phase b{font-size:clamp(10px,3vw,14px)!important;line-height:1.1!important}
.rc-compact-center .rc-phase span{font-size:10px!important}
.rc-compact-center .rc-round{display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important}
.rc-compact-center .rc-round small,.rc-compact-center .rc-round b{font-size:10px!important;display:inline!important}
.rc-compact-center .rc-full-btn{font-size:12px!important;padding:0 3px!important;min-width:0!important;min-height:0!important}
.rc-focus-synergy{top:54px!important;left:5px!important;right:auto!important;max-width:112px!important;padding:3px 5px!important}
.rc-focus-synergy.mini{width:34px!important;height:30px!important;top:51px!important}
.rc-focus-synergy.open{max-width:112px!important}
.rc-focus-synergy-head{display:flex!important;gap:1px!important}
.rc-focus-synergy-head b{font-size:10px!important}
.rc-focus-synergy-head button{font-size:9px!important}
.rc-syn-dock{gap:2px!important}
.rc-syn-chip{min-width:26px!important;width:28px!important;padding:2px!important;grid-template-columns:1fr!important;display:grid!important}
.rc-syn-chip small{display:none!important}
.rc-syn-chip>span{font-size:13px!important}
.rc-syn-chip>b{font-size:9px!important}
.rc-unit-name{display:none!important}
.rc-unit .rc-role-corner,.rc-bench-slot .rc-role-corner,.rc-shop-card .rc-role-corner{position:absolute!important;right:2px!important;top:2px!important;z-index:10!important}
}
/* V4: role badge text is in rc-trait-badge, not rc-unit-name. Keep synergy intact. */
@media(max-width:980px){
.rc-focus-mode .rc-unit .rc-trait-badge.role b,
.rc-focus-mode .rc-bench-slot .rc-trait-badge.role b,
.rc-focus-mode .rc-shop-card .rc-trait-badge.role b{display:none!important}
.rc-focus-mode .rc-unit .rc-trait-badge.role,
.rc-focus-mode .rc-bench-slot .rc-trait-badge.role,
.rc-focus-mode .rc-shop-card .rc-trait-badge.role{position:absolute!important;right:0!important;left:auto!important;top:0!important;width:16px!important;height:16px!important;max-width:16px!important;min-width:0!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;overflow:hidden!important;border-radius:50%!important}
.rc-focus-mode .rc-unit .rc-trait-badge.role i,
.rc-focus-mode .rc-bench-slot .rc-trait-badge.role i,
.rc-focus-mode .rc-shop-card .rc-trait-badge.role i{font-size:11px!important}
.rc-focus-mode .rc-unit .rc-trait-badges,
.rc-focus-mode .rc-bench-slot .rc-trait-badges,
.rc-focus-mode .rc-shop-card .rc-trait-badges{position:absolute!important;inset:0!important;transform:none!important;pointer-events:none!important;width:100%!important;height:100%!important}
.rc-focus-mode .rc-unit .rc-trait-badge.faction,
.rc-focus-mode .rc-bench-slot .rc-trait-badge.faction,
.rc-focus-mode .rc-shop-card .rc-trait-badge.faction{display:none!important}
.rc-focus-mode .rc-role-corner{display:none!important}
}

/* V5 final override: role icons only; restore synergy icon/count visibility */
@media(max-width:980px){
/* Badges live directly under unit/bench/shop; no focus-mode assumption. */
.rc-unit>.rc-trait-badges,.rc-bench-slot>.rc-trait-badges,.rc-shop-card>.rc-trait-badges{
 position:absolute!important;top:2px!important;right:2px!important;left:auto!important;
 bottom:auto!important;inset:auto 2px auto auto!important;transform:none!important;
 display:flex!important;flex-direction:column!important;align-items:flex-end!important;
 width:auto!important;height:auto!important;max-width:22px!important;gap:0!important;
 z-index:18!important;pointer-events:none!important;
}
.rc-unit .rc-trait-badge.role,.rc-bench-slot .rc-trait-badge.role,.rc-shop-card .rc-trait-badge.role{
 position:relative!important;inset:auto!important;transform:none!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 width:19px!important;height:19px!important;min-width:19px!important;max-width:19px!important;
 padding:0!important;margin:0!important;gap:0!important;overflow:hidden!important;
 border-radius:50%!important;background:rgba(3,19,29,.88)!important;
 box-sizing:border-box!important;
}
.rc-unit .rc-trait-badge.role b,.rc-bench-slot .rc-trait-badge.role b,.rc-shop-card .rc-trait-badge.role b{display:none!important;font-size:0!important}
.rc-unit .rc-trait-badge.role i,.rc-bench-slot .rc-trait-badge.role i,.rc-shop-card .rc-trait-badge.role i{
 display:inline-block!important;visibility:visible!important;font-size:12px!important;line-height:1!important;
 width:auto!important;height:auto!important;position:static!important;
}
.rc-unit .rc-trait-badge.faction,.rc-bench-slot .rc-trait-badge.faction,.rc-shop-card .rc-trait-badge.faction{display:none!important}
.rc-unit .rc-role-corner,.rc-bench-slot .rc-role-corner,.rc-shop-card .rc-role-corner{display:none!important}
/* Restore synergy icons: V2/V3 blanket :not() rule hid real icons */
.rc-focus-synergy .rc-syn-chip,.rc-mobile-syn .rc-syn-chip{
 display:grid!important;grid-template-columns:22px auto!important;grid-template-rows:auto auto!important;
 gap:0 3px!important;min-width:46px!important;width:auto!important;height:auto!important;
 padding:3px!important;overflow:visible!important;align-items:center!important;
}
.rc-focus-synergy .rc-syn-chip>span,.rc-mobile-syn .rc-syn-chip>span{
 display:block!important;visibility:visible!important;grid-row:1/3!important;
 font-size:17px!important;line-height:1.2!important;
}
.rc-focus-synergy .rc-syn-chip>b,.rc-mobile-syn .rc-syn-chip>b{
 display:block!important;visibility:visible!important;position:static!important;
 font-size:11px!important;background:none!important;padding:0!important;
}
.rc-focus-synergy .rc-syn-chip>small,.rc-mobile-syn .rc-syn-chip>small{display:none!important}
.rc-focus-synergy{max-width:190px!important;width:max-content!important;min-width:0!important}
.rc-focus-synergy .rc-syn-dock{display:flex!important;flex-wrap:wrap!important;gap:3px!important}
}
