/* SSG GAMES - Mobile Table V5: presentation only; game JS and rules stay intact. */
@media (max-width: 650px) {
  html,body {max-width:100%; overflow-x:clip;}
  .shell {width:100%; max-width:100%; padding:8px 9px 24px;}
  .header {gap:7px; padding:8px;}
  .brand {font-size:clamp(21px,6vw,30px);}
  .brand small {font-size:9px;}
  .back {padding:7px 9px; font-size:12px;}
  .title {margin:9px 0 6px;}
  .title h1 {font-size:clamp(23px,6.6vw,32px); letter-spacing:0; line-height:1.12;}
  .title p {margin:4px 0; font-size:11px;}
  .banner {gap:5px; margin:8px 0 10px;}
  .banner .tag {font-size:11px; padding:5px 9px; line-height:1.25;}
  .frame {width:100%; border-radius:20px; padding:0!important;}
  /* Switch to a responsive flow on narrow screens: nothing overlaps the hand. */
  .table {
    display:flex; flex-direction:column;
    position:relative; width:100%; aspect-ratio:auto!important;
    height:auto!important; min-height:525px!important;
    padding:10px 6px 18px!important;
    border-radius:18px!important;
    background-position:center 48%!important;
    background-size:auto 100%!important;
  }
  .table::before {pointer-events:none;}
  /* Four empty positions + active computer + active player = exactly six seats. */
  .room-seats {
    position:relative!important; inset:auto!important; z-index:2;
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
    gap:5px 7px; width:100%; padding:2px 1px 7px;
    height:auto; pointer-events:none;
  }
  .room-seat,.room-seat--tr,.room-seat--l,.room-seat--r,.room-seat--bl {
    position:static!important; top:auto!important; right:auto!important;
    bottom:auto!important; left:auto!important;
    width:100%; min-width:0; min-height:23px;
    justify-content:center; padding:3px 4px;
    font-size:11px; line-height:1.1;
    background:#07130eed; border-color:#d4a650;
  }
  .opponent {
    position:relative!important; top:auto!important; left:auto!important;
    right:auto!important; width:100%!important; flex:0 0 auto;
    padding:2px 0 0!important; margin:0;
  }
  .opponent .who,.bottom .who {font-size:12px; min-height:25px; padding:4px 10px;}
  .opponent .cards {padding:3px 0; min-height:45px; justify-content:center;}
  .opponent .card.backcard {width:25px; height:38px; margin-left:-3px; border-width:1px;}
  .opponent .card.backcard:first-child {margin-left:0;}
  .opponent .card.backcard:after {font-size:7px; padding:4px 2px;}
  .board-middle {
    position:relative!important; top:auto!important; left:auto!important;
    right:auto!important; bottom:auto!important;
    display:grid; width:100%; flex:1 0 auto;
    grid-template-columns:minmax(63px,73px) minmax(0,1fr) minmax(63px,73px);
    gap:3px; padding:7px 2px!important;
    min-height:200px!important; align-items:center;
  }
  .pile {padding:5px 2px; font-size:11px; min-width:0; border-radius:10px;}
  .pile .card {width:clamp(40px,12vw,52px); height:clamp(59px,17vw,73px); margin:5px auto; transform:none;}
  .pile-label {font-size:10px; line-height:1.2;}
  .pile-count {margin:6px auto; min-height:30px; min-width:32px; font-size:16px;}
  .tablecards {min-width:0; min-height:145px; gap:2px; align-content:center;}
  .pair {width:clamp(49px,15vw,64px); height:108px;}
  .pair>.card {width:44px; height:68px; top:10px;}
  .pair>.card.defense {left:13px; top:31px;}
  .centerhint {font-size:12px; letter-spacing:0; padding:7px 1px;}
  .turn {
    position:relative!important; top:auto!important; left:auto!important;
    right:auto!important; bottom:auto!important;
    order:3; min-height:24px; width:100%; padding:2px 4px;
    font-size:12px; line-height:1.25; background:#00160b88;
    border-radius:12px; margin:2px 0 6px;
  }
  .bottom {
    position:relative!important; top:auto!important; left:auto!important;
    right:auto!important; bottom:auto!important;
    order:4; display:flex; flex-direction:column-reverse;
    align-items:center; gap:4px; width:100%; padding:0!important;
    margin:0;
  }
  .bottom .cards {
    width:100%; max-width:100%; min-height:77px;
    display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:visible;
    justify-content:safe center; align-items:center;
    gap:3px; padding:5px 2px 7px; margin:0;
    scrollbar-width:thin; -webkit-overflow-scrolling:touch;
  }
  .bottom .cards .card {
    box-sizing:border-box; flex:0 0 auto;
    width:clamp(42px,12vw,55px); height:clamp(63px,18vw,78px);
    margin:0!important; border-width:2px; border-radius:7px;
    touch-action:manipulation;
  }
  .bottom .cards .card .corner {font-size:13px; top:3px; left:4px;}
  .bottom .cards .card .symbol {font-size:clamp(26px,7.6vw,35px);}
  .bottom .cards .card .bottomcorner {font-size:12px; bottom:2px; right:3px;}
  .bottom .who {margin:0; padding:5px 12px;}
  .announcement {position:absolute; inset:0; padding:10px;}
  .announce-box {max-width:min(96%,360px); padding:18px 12px;}
  .announce-box h2 {font-size:25px;}
  .msg {margin:9px 0 6px; font-size:13px; line-height:1.3;}
  .controls {display:grid; grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:9px 0;}
  .controls .action {min-width:0; width:100%; min-height:46px; padding:10px 5px; font-size:12px; line-height:1.2;}
  .controls .action:last-child {grid-column:1 / -1;}
  .help {padding:12px; margin-top:10px; font-size:12px; line-height:1.4;}
  .help h2 {font-size:17px;}
}
/* Landscape phones/tablets retain the spacious desktop layout. */
@media (min-width:651px) and (max-width:950px) {
  .table {min-height:575px;}
  .bottom .cards {overflow-x:auto; justify-content:safe center;}
  .controls .action {min-width:115px;}
}
