/* Two-row rearrangeable rack, four-way seat arrangement, mobile and desktop */
.rack-area{max-width:1240px!important;}
.rack-frame{height:176px!important;overflow:visible!important;}
.rack-slot{top:16px!important;height:145px!important;left:2%!important;right:2%!important;align-items:stretch!important;}
.rack-slot #hand{width:100%;height:145px!important;display:block!important;padding:0!important;overflow:visible!important;min-height:0!important;}
.two-row-rack{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:2px;width:100%;height:100%;align-items:center;}
.two-row-rack .rack-cell{width:100%;min-width:0;max-width:none;height:100%;min-height:0;display:flex;align-items:center;justify-content:center;cursor:grab;background:transparent;border:1px solid #e3c77b13;border-radius:4px;padding:0;margin:0;touch-action:none;user-select:none;-webkit-user-select:none;}
.two-row-rack .rack-cell.occupied{background:transparent;border-color:transparent;}
.two-row-rack .rack-cell:focus-visible{outline:2px solid #f0dc8d;}
.two-row-rack .rack-cell.selected{transform:translateY(-5px);outline:2px solid #f4ce69;border-color:transparent;filter:drop-shadow(0 4px 6px #0009);}
.two-row-rack .rack-cell img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;}
.rack-tools{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:10px 0 8px;position:relative;z-index:5;}
.rack-tools button{border:1px solid #d4b05b85;background:#183427;color:#f4dc9e;border-radius:10px;min-height:36px;padding:7px 14px;font-weight:700;}
.rack-tools button:active{background:#276344;}
.rack-tools span{font-size:11px;color:#e4d8ba;}
/* Opponents appear relative to the player's own seat, not all across the top. */
.table{position:relative;}
.opponents{position:absolute!important;top:4px;left:0;right:0;bottom:182px;display:block!important;z-index:3;pointer-events:none;padding:0!important;}
.opponents .opp{position:absolute!important;min-width:0!important;max-width:none;box-sizing:border-box;pointer-events:auto;margin:0;display:flex;flex-direction:column;align-items:center;gap:4px;}
.opponents .opp.seat-top{width:min(260px,34%);top:4px;left:50%;transform:translateX(-50%);}
.opponents .opp.seat-left{width:clamp(100px,16%,180px);left:12px;top:32%;}
.opponents .opp.seat-right{width:clamp(100px,16%,180px);right:12px;top:32%;}
.opponents .opp-tiles{display:flex;justify-content:center;overflow:hidden;max-width:100%;}
.opponents .opp-tiles .tile-back{flex:0 0 9px;width:18px;height:28px;}
.opponents .seat-left .opp-tiles,.opponents .seat-right .opp-tiles{flex-wrap:wrap;max-width:110px;max-height:76px;}
.opponents .seat-top .opp-tiles{transform:rotate(180deg);}
.opponents .seat-left .opp-tiles{transform:rotate(-90deg);margin:18px 0;}
.opponents .seat-right .opp-tiles{transform:rotate(90deg);margin:18px 0;}
.table .center{min-height:clamp(390px,53vh,530px);padding:100px clamp(102px,15%,210px) 22px;box-sizing:border-box;}
@media(max-width:700px){
 .rack-frame{height:150px!important;}
 .rack-slot{top:14px!important;height:123px!important;}
 .rack-slot #hand{height:123px!important;}
 .two-row-rack{gap:1px;}
 .rack-tools{gap:5px;}
 .rack-tools span{width:100%;text-align:center;font-size:10px;}
 .rack-tools button{font-size:12px;min-height:32px;padding:6px 9px;}
 .opponents{bottom:194px;}
 .opponents .opp.seat-top{width:34%;top:3px;padding:5px 2px;}
 .opponents .opp.seat-left{width:25%;left:5px;top:29%;padding:5px 2px;}
 .opponents .opp.seat-right{width:25%;right:5px;top:29%;padding:5px 2px;}
 .opponents .opp-name{font-size:11px;text-align:center;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
 .opponents .opp small{font-size:9px;}
 .opponents .opp-tiles .tile-back{flex-basis:5px;width:11px;height:19px;}
 .opponents .seat-left .opp-tiles,.opponents .seat-right .opp-tiles{max-width:64px;max-height:70px;}
 .table .center{min-height:510px;padding:120px 26% 20px;}
}
@media(max-width:390px){
 .rack-frame{height:133px!important;}
 .rack-slot{top:10px!important;height:112px!important;}
 .rack-slot #hand{height:112px!important;}
 .table .center{min-height:470px;padding:120px 23% 20px;}
}
