/* DTS mobile layer. Desktop unchanged. */
@media screen and (max-width:767px) {
 html,:root { width:100%;max-width:100%;overflow-x:hidden; }
 :root body,body {position:relative!important;width:100%!important;max-width:100vw!important;margin:0!important;overflow-x:hidden!important;overflow-y:auto!important;box-sizing:border-box;}
 .title {width:auto!important;margin:8px!important;font-size:24px!important;line-height:1.3!important;}
 .headerlink {display:flex!important;flex-wrap:wrap;align-items:center;justify-content:center;gap:5px;padding:6px;box-sizing:border-box;}
 .headerlink a {display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:3px 7px;font-size:12px;line-height:1.3;background:rgba(27,43,65,.9);border-radius:6px;}
 #dts-quick-timer-bar {box-sizing:border-box;max-width:calc(100vw - 18px)!important;margin:8px 9px!important;line-height:1.6;overflow-wrap:anywhere;}
 #game_interface,#game_interface>tbody,#game_interface>tbody>tr,#game_interface>tbody>tr>td {display:block!important;width:100%!important;max-width:100%!important;box-sizing:border-box;}
 #game_interface {margin:0!important;padding:0 5px!important;}
 #game_interface>tbody>tr>td {padding:5px 0!important;}
 #game_interface #main {box-sizing:border-box;width:100%!important;max-width:100%!important;overflow-x:auto;-webkit-overflow-scrolling:touch;}
 #game_interface #cmd_interface,#game_interface #cmd_container {box-sizing:border-box;max-width:100%;overflow-x:auto;}
 #chat,#chat .showlist {box-sizing:border-box;width:100%!important;max-width:100%!important;}
 #chat .showlist {margin-left:0!important;margin-right:0!important;}
 #game_interface select,#game_interface input[type=text] {max-width:96%;}
 #game_interface input[type=button],#game_interface button,#game_interface .cmd_button,#game_interface .glow_buttons {min-height:42px;touch-action:manipulation;}
 #dts-action-toast {max-width:calc(100vw - 36px);box-sizing:border-box;}
}

@media screen and (max-width:767px) {
 /* Legacy lobby tables retain their grid; make them swipeable, not clipped. */
 body > div[style*="text-align:center"] {box-sizing:border-box;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
 body > div[style*="text-align:center"] > table {max-width:none;}
 body > div[style*="text-align:center"] > img {max-width:100%;height:auto;}
}
 @media screen and (max-width:767px) {
 #game_interface input[type=button],#game_interface button {min-width:44px;}
 #game_interface #main table {max-width:none;}
}
