/* More space for the table, with persistent live tile nodes at every responsive size. */
.match-layout{max-width:1920px;margin-inline:auto;grid-template-columns:218px minmax(0,1fr);padding:12px;gap:12px}
.dashboard{gap:12px;padding:14px 12px}.dash-title{font-size:22px}.dash-footer{flex-wrap:wrap;row-gap:10px}
.play-stage{padding:10px 13px 9px;gap:7px;min-height:0}
.table-status{min-height:35px;padding:0 3px;flex:none}.table-status>div:first-child{flex:1;min-width:0;flex-wrap:wrap;gap:2px 12px}
.table-controls{display:flex;align-items:center;gap:10px;flex:none}.table-controls .turn-clock{min-width:38px}
.display-controls{display:flex;align-items:center;gap:10px}.lobby-tools>.display-controls{margin-left:auto}
.fullscreen-btn{display:inline-grid;place-items:center;flex:none;width:34px;height:31px;padding:6px;color:#f2e5bf}
.fullscreen-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:square;pointer-events:none;transition:transform .18s ease}
.fullscreen-btn:hover svg{transform:scale(1.08)}.fullscreen-btn.is-expanded svg{transform:rotate(180deg)}
.waiting-header{display:flex;justify-content:space-between;align-items:center;gap:16px;text-align:left}
.table-core{grid-template-columns:clamp(94px,9vw,132px) minmax(0,1fr) clamp(94px,9vw,132px);gap:8px 10px}
.table-core .top-player{gap:5px}.top-player .opponent-rack{min-height:76px;max-height:138px;padding:7px 5px 11px;gap:12px}
.table-core .top-player .back{width:clamp(28px,2.7vw,40px);height:auto;aspect-ratio:42/58;border-width:2px}
.opponent>.player-label{display:flex;align-items:center;justify-content:center;gap:5px;padding:5px 7px;font-size:15px;min-height:28px}
.player-label .wind{flex:none;margin:0}.player-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-label .player-ai{margin:0;flex:none}
.table-core .left-player,.table-core .right-player{gap:7px}
.left-player .opponent-rack,.right-player .opponent-rack{padding:9px 5px 12px;gap:12px}
.table-core :is(.left-player,.right-player) .backs>.back:first-child{margin-top:0}
.player-ready{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:21px;min-height:21px;padding:2px 4px;border:2px solid #ead29b;border-radius:3px;background:#566e48;color:#fff2be;font-size:12px;line-height:1;box-shadow:0 2px #173b35}
.hand-zone{padding-top:7px}.hand-heading{min-height:25px;margin-bottom:2px;gap:10px}.hand-heading #handHint{margin-left:4px;color:#b2c9b7}
.my-hand{padding:17px 0 10px;min-height:108px}.my-melds{padding:6px 0 3px}.action-bar{min-height:48px;padding:4px 0 1px;gap:9px}
.discard-zone{border-radius:24px;background:radial-gradient(ellipse at 50% 45%,#a7be7310,transparent 75%)}
.discard-piles{align-self:center;grid-template-columns:repeat(auto-fit,40px);width:min(100%,505px);gap:7px;padding:9px 3px 15px;align-content:center}
.discard-piles .tile{width:40px;height:55px}
@keyframes readyBadge{from{opacity:0;transform:translateY(4px) scale(.75)}to{opacity:1;transform:none}}
@media(min-width:1500px) and (min-height:850px){.match-layout{grid-template-columns:236px minmax(0,1fr);padding:18px;gap:15px}.dashboard{gap:16px}.play-stage{padding:14px 18px}.my-hand .tile{width:min(70px,calc((100cqw - 84px)/14))}.my-hand{min-height:119px}.discard-piles{grid-template-columns:repeat(auto-fit,44px);width:min(100%,558px);gap:8px}.discard-piles .tile{width:44px;height:61px}}
@media(max-width:1000px) and (min-width:701px){.match-layout{grid-template-columns:182px minmax(0,1fr);padding:8px;gap:9px}.dashboard{padding:11px 9px;gap:10px}.dash-title{font-size:18px}.table-core{grid-template-columns:89px minmax(0,1fr) 89px;gap:7px}.opponent>.player-label{font-size:12px;padding:4px}.table-core .top-player .back{width:29px}.play-stage{padding-inline:9px}.discard-piles{grid-template-columns:repeat(auto-fit,32px);gap:5px}.discard-piles .tile{width:32px;height:44px}.action-bar .btn{padding:9px 17px}}
@media(max-width:700px) and (orientation:portrait){
 .match-layout{padding:max(6px,env(safe-area-inset-top)) 6px max(6px,env(safe-area-inset-bottom));gap:8px}
 .dashboard{grid-template-columns:.85fr .9fr 1.3fr;padding:9px 10px 8px;gap:6px 9px}.dash-title{font-size:20px}.round-stamp strong{font-size:30px}.round-stamp small{margin-bottom:3px}.round-stamp strong span{font-size:16px}.total-block{padding:5px 3px}.total-block strong{font-size:26px}.total-block span{margin-bottom:3px}.formula-label{margin-bottom:4px;font-size:9px}.chips,.mult{padding:4px 2px}.chips strong,.mult strong{font-size:22px}.combo-block{padding:2px 0}.standings{gap:5px}.standing{padding:4px 3px;font-size:10px;gap:3px}.standing .points{font-size:16px}.dash-footer{padding-top:1px}.dash-footer button{font-size:10px}
 .play-stage{padding:7px 6px 6px;gap:4px;border-radius:9px}.table-status{min-height:29px;padding:0 1px}.table-status #turnStatus{font-size:12px;white-space:normal;line-height:1.3}.table-controls{gap:7px}.table-controls .turn-clock{font-size:13px;min-width:29px}.fullscreen-btn{width:28px;height:27px;padding:5px}.fullscreen-btn svg{width:16px;height:16px}
 .table-core{grid-template-columns:47px minmax(0,1fr) 47px;grid-template-rows:auto minmax(0,1fr);gap:5px}.table-core .opponent{padding-inline:0;gap:5px}.opponent>.player-label{font-size:10px;gap:3px;padding:3px;min-height:21px}.player-label .wind,.player-label .player-ai{display:none}.table-core .top-player .player-label{font-size:11px;padding:3px 7px}.top-player .opponent-rack{min-height:40px;max-height:94px;padding:4px 0 7px;gap:7px}.table-core .top-player .backs{gap:2px;flex-wrap:nowrap}.table-core .top-player .back{width:clamp(14px,4.2vw,25px);height:auto;aspect-ratio:25/35;border-width:1px}
 .table-core .opponent .backs> :nth-child(n+4){display:block}.table-core .opponent .backs::after{content:none}.table-core .opponent .backs[data-count="0"]{display:none}
 .table-core :is(.left-player,.right-player) .backs>.back{width:32px;height:21px;margin-top:-15px;border-width:1px}.left-player .opponent-rack,.right-player .opponent-rack{padding:5px 2px 8px;gap:8px}.table-core .op-melds{gap:7px}.table-core .opponent .tile.mini,.table-core .op-melds .meld>.back{width:20px;height:28px}
 .player-ready{min-width:16px;min-height:17px;padding:1px 2px;font-size:9px;border-width:1px}.hand-heading{min-height:21px;font-size:12px;gap:7px;margin-bottom:0}.hand-heading #handHint{font-size:10px;margin:0}.my-hand{padding:12px 0 7px;min-height:0;gap:7px 3px;max-width:min(100%,361px);margin-inline:auto;width:100%}.my-hand .tile{width:min(49px,calc((100cqw - 18px)/7));aspect-ratio:64/89}.my-melds{gap:8px;padding:5px 0 1px}.my-melds .tile{width:27px;height:38px}.action-bar{min-height:39px;gap:7px;padding:3px 0 1px}.action-bar .btn{font-size:16px;padding:7px 15px;min-height:31px}.discard-zone{border-radius:15px}.discard-piles{grid-template-columns:repeat(auto-fit,24px);width:100%;gap:4px;padding:6px 0 10px}.discard-piles .tile{width:24px;height:33px}
 .immersive-mode .dashboard{display:none}.immersive-mode .match-layout{gap:0}:is(.immersive-mode,.native-fullscreen) .my-hand{max-width:min(100%,403px)}:is(.immersive-mode,.native-fullscreen) .my-hand .tile{width:min(55px,calc((100cqw - 18px)/7))}
}
@media(max-height:540px) and (orientation:landscape){
 .match-layout{grid-template-columns:156px minmax(0,1fr);padding:5px;gap:7px}.dashboard{padding:8px;gap:7px}.dash-title{font-size:16px}.round-stamp strong{font-size:28px}.total-block{padding:4px}.total-block strong{font-size:26px}.total-block span{font-size:9px;margin-bottom:3px}.chips strong,.mult strong{font-size:22px}.ranking-title{font-size:10px}.standing{padding:3px;font-size:10px}.standing .points{font-size:13px}.combo-block{padding-top:5px}.play-stage{padding:5px 7px;gap:3px}.table-status{min-height:26px}#turnStatus{font-size:11px}.fullscreen-btn{width:27px;height:25px;padding:5px}.fullscreen-btn svg{width:15px;height:15px}.table-core{grid-template-columns:67px minmax(0,1fr) 67px;gap:4px}.opponent>.player-label{font-size:10px;padding:3px;min-height:19px}.table-core .top-player{gap:3px}.top-player .opponent-rack{min-height:35px;max-height:65px;padding:2px 2px 5px}.table-core .top-player .back{width:20px;height:28px;border-width:1px}.table-core .opponent .backs> :nth-child(n+4){display:block}.table-core .opponent .backs::after{content:none}.table-core :is(.left-player,.right-player) .backs>.back{width:29px;height:17px;margin-top:-12px;border-width:1px}.left-player .opponent-rack,.right-player .opponent-rack{padding:4px 2px 7px;gap:6px}.player-label .wind,.player-label .player-ai{display:none}.player-ready{min-width:15px;min-height:16px;padding:1px;font-size:9px;border-width:1px}.hand-zone{padding-top:3px}.hand-heading{font-size:10px;min-height:17px;gap:6px}.my-hand{padding:10px 0 6px;gap:3px;min-height:0}.my-hand .tile{width:min(43px,calc((100cqw - 42px)/14))}.my-melds{padding:4px 0 1px}.my-melds .tile{width:24px;height:33px}.action-bar{min-height:30px;padding:2px 0;gap:6px}.action-bar .btn{font-size:12px;padding:5px 13px;min-height:25px}.discard-piles{grid-template-columns:repeat(auto-fit,26px);width:min(100%,400px);gap:4px}.discard-piles .tile{width:26px;height:36px}
 .immersive-mode .match-layout{grid-template-columns:128px minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){.player-ready{animation:none}.fullscreen-btn svg{transition:none}}

#winSoundTest{grid-column:auto;width:100%;font-size:16px}.sound-previews .btn{min-height:47px;font-size:15px}

.player-ready.ready-enter{animation:readyBadge .36s cubic-bezier(.2,1.4,.4,1) backwards}@media(prefers-reduced-motion:reduce){.player-ready.ready-enter{animation:none}}

/* Personal settlement numbers and authoritative per-seat changes. */
.round-score-summary{max-width:430px;margin:16px auto 0;padding-top:14px;border-top:2px solid #71857755;text-align:left}
.round-score-heading{display:flex;justify-content:space-between;font-size:12px;color:#b9cdb9;padding:0 10px 8px}
.round-scores{list-style:none;display:grid;gap:6px;padding:0;margin:0}
.round-score-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:9px 10px;border:2px solid #637d7055;border-radius:5px;background:#273f43;font-size:15px}
.round-score-row.you{border-color:#c5b375;background:#455447}.round-score-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.round-score-gain{font-weight:400;color:#f1d28c;font-size:20px}.round-score-total{color:#b8cbb7;font-size:13px;white-space:nowrap}
.score-panel-backdrop,.mobile-score-control,.mobile-round{display:none}
@keyframes scorePanelEnter{from{opacity:0;transform:translateY(-9px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px),(max-width:1100px) and (pointer:coarse),(max-height:540px) and (orientation:landscape){
 .match-layout,.immersive-mode .match-layout{display:flex;flex-direction:column;grid-template-columns:1fr;gap:0}
 .match-layout .play-stage{flex:1;min-height:0}
 .match-layout .dashboard{display:none}
 .mobile-score-control{display:inline-grid;place-items:center;flex:none;min-width:29px;height:29px;padding:4px;font-size:16px}
 .score-panel-toggle{min-width:47px;font-size:12px;padding-inline:7px;white-space:nowrap}
 .mobile-round{display:block;width:100%;font-size:10px;color:#b9ccb4;line-height:1.2}
 .table-status>div:first-child{gap:2px 7px}.table-status .table-controls{gap:6px}
 .match-layout.scores-open .dashboard{display:flex;flex-direction:column;position:fixed;z-index:80;top:max(12px,env(safe-area-inset-top));right:max(9px,env(safe-area-inset-right));left:auto;width:min(390px,calc(100vw - 18px));max-height:calc(100dvh - 28px);overflow:auto;overscroll-behavior:contain;padding:15px;gap:14px;box-shadow:0 7px #17333c,0 24px 70px #071c2ac9;animation:scorePanelEnter .18s ease-out}
 .match-layout.scores-open .dashboard>*{flex:none}.match-layout.scores-open .dash-title{font-size:22px}.match-layout.scores-open .round-stamp{display:flex}.match-layout.scores-open .wall-chip{display:block}.match-layout.scores-open .ranking-title,.match-layout.scores-open .standings,.match-layout.scores-open .combo-block,.match-layout.scores-open .dash-footer{display:flex}
 .match-layout.scores-open .standings{flex-direction:column}.match-layout.scores-open .combo-block{flex-direction:column}.match-layout.scores-open .dash-footer{margin-top:0}.match-layout.scores-open .dash-footer button{font-size:12px}
 .match-layout.scores-open .score-panel-backdrop{display:block;position:fixed;z-index:79;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:#0a202a88;cursor:default}
 .round-score-row{gap:7px;padding:8px;font-size:13px}.round-score-gain{font-size:18px}.round-score-total{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.match-layout.scores-open .dashboard{animation:none}}
