
/* Backgammon: compact, board-first mobile layout without changing game logic */
.bg{background:radial-gradient(ellipse at 50% 0,#1b4937 0,#123529 55%,#0b251d 100%)!important}
.bg main{max-width:790px!important;padding:8px 12px 20px!important}
.bg .coffeeNav.ahwaHeader{margin:7px auto 5px!important;min-height:54px!important;box-shadow:0 3px 12px #0002!important}
.bg .ahwaSectionReturn{margin:5px auto 8px!important;min-height:34px!important;padding:7px 12px!important;font-size:12px!important;border-radius:9px!important}
.bg .mast{padding:0 0 5px!important;gap:8px!important;align-items:center!important}
.bg .mast h1{font-size:clamp(24px,5vw,30px)!important;line-height:1.15!important}
.bg #modeLabel{font-size:12px!important;margin:2px 0 0!important;line-height:1.3!important}
.bg #rulesSlot #rulesButton{min-height:36px!important;font-size:12px!important;padding:7px 10px!important}
.bg .tableSettings{margin:4px 0 8px!important}
.bg .tableSettings>summary{padding:9px 12px!important;min-height:22px!important}
.bg .settingsBody{padding:7px 10px 10px!important;gap:7px!important}
.bg .settingsBody .names{gap:8px!important}
.bg .settingsBody .names input{box-sizing:border-box!important;width:50%!important;margin:0!important;min-height:40px!important;padding:7px 9px!important;font-size:15px!important}
.bg .playState{padding:3px 1px 5px!important;min-height:38px!important;gap:5px!important}
.bg #status{font-size:clamp(17px,4.2vw,21px)!important;line-height:1.25!important}
.bg #clockNotice{margin:0!important;font-size:12px!important}
.bg .actions{margin:3px 0 7px!important;gap:7px!important}
.bg .actions button{min-height:44px!important;font-size:clamp(12px,3.3vw,15px)!important;border-radius:11px!important}
.bg .actions #roll{background:#efcc8b!important;color:#183528!important;box-shadow:0 2px 0 #98743d!important}
.bg .tablewrap .board{border-width:6px!important;border-radius:12px!important;box-shadow:0 5px 18px #0006,inset 0 0 0 2px #b98345!important}
.bg .tablewrap{margin:0!important}
.bg .roundResults{margin:6px 0!important}
.bg .roundButtons{display:flex!important;justify-content:center!important;gap:8px!important}
.bg .roundButtons button{min-height:39px!important;padding:8px 12px!important;font-size:13px!important}
.bg main>p{font-size:12px!important;line-height:1.5!important;color:#d5c9ac!important;margin:9px 0!important}
@media(max-width:600px){
.bg main{padding:5px 9px 16px!important}
.bg .ahwaSectionReturn{display:flex!important;width:max-content!important;max-width:100%!important;margin:3px auto 7px!important}
.bg .mast{display:flex!important;align-items:center!important;justify-content:space-between!important;margin:0!important}
.bg .mast>div:first-child{flex:1!important;min-width:0!important}
.bg .tableSettings{margin:3px 0 6px!important}
.bg .playState{flex-wrap:nowrap!important;align-items:center!important}
.bg #status{text-align:start!important}
.bg #clock{font-size:13px!important;white-space:nowrap!important}
.bg .tablewrap .board{grid-template-rows:repeat(2,clamp(125px,39vw,195px))!important}
.bg .tablewrap .piece{max-width:34px!important}
.bg .tablewrap .point>span:first-child{font-size:9px!important}
.bg .roundResults p{font-size:12px!important}
}
@media(max-width:370px){.bg .actions{gap:4px!important}.bg .actions button{font-size:11px!important;padding:5px 2px!important}.bg .tablewrap .board{border-width:4px!important}}
/* AHWA MOBILE HEADER COMPACT V2 2026-11-23 */
@media(max-width:600px){
.bg main{padding:4px 9px 14px!important}
.bg .ahwaSectionReturn{margin:2px auto 5px!important;min-height:30px!important;padding:5px 11px!important;font-size:12px!important}
.bg .mast{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;padding:2px 0!important;align-items:center!important}
.bg .mast h1{font-size:23px!important;line-height:1.1!important;margin:0!important}
.bg #modeLabel{font-size:11px!important;line-height:1.25!important;margin:2px 0 0!important}
.bg #rulesSlot #rulesButton{font-size:12px!important;min-height:35px!important;padding:6px 9px!important}
.bg .tableSettings{margin:4px 0 5px!important}
.bg .tableSettings>summary{min-height:35px!important;padding:7px 11px!important;font-size:13px!important}
.bg .settingsBody{padding:7px 9px 9px!important;gap:5px!important}
.bg .settingsBody .names{gap:7px!important}
.bg .settingsBody .names label{flex:1 1 0!important;min-width:0!important;display:flex!important;flex-direction:column!important;gap:3px!important;font-size:11px!important}
.bg .settingsBody .names input{width:100%!important;min-width:0!important;min-height:37px!important;padding:6px 8px!important;font-size:14px!important;box-sizing:border-box!important}
.bg .playState{min-height:30px!important;padding:2px 1px 4px!important;gap:4px!important}
.bg #status{font-size:clamp(15px,4vw,19px)!important;overflow-wrap:anywhere!important}
.bg #clock{font-size:12px!important}
.bg #clockNotice{font-size:11px!important}
.bg .actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin:3px 0 5px!important}
.bg .actions:has(#undoMove:not([hidden])){grid-template-columns:repeat(4,minmax(0,1fr))!important}
.bg .actions button{min-width:0!important;min-height:42px!important;padding:7px 3px!important;font-size:clamp(11px,3.1vw,14px)!important;line-height:1.2!important;white-space:normal!important}
.bg .tablewrap{margin:0!important}
}
@media(max-width:380px){.bg .actions{gap:4px!important}.bg .actions button{font-size:10px!important;padding:6px 2px!important}.bg .mast h1{font-size:21px!important}}

/* AHWA THREE CONTROLS ONE ROW V3 */
@media(max-width:600px){
.bg main{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;column-gap:6px!important;align-items:start!important}
.bg main>.ahwaSectionReturn{grid-column:1!important;grid-row:1!important;width:100%!important;min-width:0!important;max-width:none!important;min-height:44px!important;margin:2px 0 6px!important;padding:7px 4px!important;box-sizing:border-box!important;white-space:normal!important;font-size:clamp(10px,2.7vw,12px)!important;line-height:1.25!important;text-align:center!important}
.bg main>.mast{display:contents!important}
.bg main>.mast>div:first-child{grid-column:1/-1!important;grid-row:2!important;display:flex!important;align-items:baseline!important;justify-content:space-between!important;gap:8px!important;margin:0 0 5px!important;min-width:0!important}
.bg main>.mast>div:first-child h1{font-size:22px!important;flex:none!important}
.bg main>.mast #modeLabel{font-size:11px!important;text-align:end!important;min-width:0!important}
.bg main>.mast>#rulesSlot{grid-column:2!important;grid-row:1!important;min-width:0!important;width:100%!important;margin:2px 0 6px!important;display:flex!important}
.bg main>.mast>#rulesSlot #rulesButton{width:100%!important;min-width:0!important;min-height:44px!important;margin:0!important;padding:7px 3px!important;box-sizing:border-box!important;font-size:clamp(10px,2.8vw,12px)!important;white-space:normal!important;line-height:1.25!important}
.bg main>.tableSettings{grid-column:3!important;grid-row:1!important;min-width:0!important;width:100%!important;margin:2px 0 6px!important;align-self:start!important}
.bg main>.tableSettings>summary{display:flex!important;align-items:center!important;justify-content:center!important;min-height:44px!important;padding:7px 3px!important;box-sizing:border-box!important;font-size:clamp(10px,2.8vw,12px)!important;white-space:normal!important;text-align:center!important;line-height:1.25!important}
.bg main>.tableSettings[open]{position:relative!important;z-index:30!important}
.bg main>.tableSettings[open]>.settingsBody{position:absolute!important;top:calc(100% + 5px)!important;inset-inline-end:0!important;width:min(310px,calc(100vw - 18px))!important;max-width:none!important;box-sizing:border-box!important;background:#173b30!important;border:1px solid #bfa16a!important;border-radius:12px!important;box-shadow:0 8px 22px #0008!important}
.bg main>*:not(.ahwaSectionReturn):not(.mast):not(.tableSettings){grid-column:1/-1!important;min-width:0!important}
}

/* HIDE REDUNDANT PLAYER COLOR LABEL V4 */
.bg .mast #modeLabel{display:none!important}
@media(max-width:600px){.bg main>.mast>div:first-child{justify-content:flex-start!important;margin-bottom:5px!important}}

/* EQUAL THREE BUTTONS OPTIONS RIGHT V5 */
@media(max-width:600px){
.bg main{grid-template-columns:repeat(3,minmax(0,1fr))!important;column-gap:6px!important}
.bg main>.tableSettings{grid-column:3!important;grid-row:1!important;box-sizing:border-box!important;min-width:0!important;width:100%!important;margin:2px 0 6px!important}
.bg main>.mast>#rulesSlot{grid-column:2!important;grid-row:1!important;min-width:0!important;width:100%!important;box-sizing:border-box!important}
.bg main>.ahwaSectionReturn{grid-column:1!important;grid-row:1!important;min-width:0!important;width:100%!important;box-sizing:border-box!important}
.bg main>.ahwaSectionReturn,.bg main>.mast>#rulesSlot #rulesButton,.bg main>.tableSettings>summary{height:50px!important;min-height:50px!important;max-height:50px!important;border-radius:11px!important;padding:5px 4px!important;display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;font-size:clamp(10px,2.65vw,13px)!important;line-height:1.3!important;font-weight:700!important;text-align:center!important;white-space:normal!important;overflow-wrap:normal!important}
.bg main>.mast>#rulesSlot{margin:2px 0 6px!important}
.bg main>.tableSettings>summary{width:100%!important}
.bg main>.tableSettings{direction:rtl!important}
.bg main>.tableSettings[open]>.settingsBody{inset-inline-end:0!important}
}

/* RTL PHYSICAL RIGHT CORRECTION V6 */
@media(max-width:600px){.bg main>.tableSettings{grid-column:1!important}.bg main>.ahwaSectionReturn{grid-column:3!important}.bg main>.mast>#rulesSlot{grid-column:2!important}}

/* CENTER TITLE ABOVE APPROVED BUTTONS V7 */
@media(max-width:600px){
.bg main>.mast>div:first-child{grid-column:1/-1!important;grid-row:1!important;display:flex!important;justify-content:center!important;align-items:center!important;text-align:center!important;margin:0 0 7px!important;min-height:36px!important}
.bg main>.mast>div:first-child h1{width:100%!important;text-align:center!important;font-size:clamp(25px,6.5vw,31px)!important;line-height:1.15!important;margin:0!important}
.bg main>.tableSettings,.bg main>.mast>#rulesSlot,.bg main>.ahwaSectionReturn{grid-row:2!important}
.bg main>.tableSettings[open]>.settingsBody{z-index:40!important}
}
