/* One continuous table; no document scrolling in an active game. */
body.viewport-game{height:100dvh;min-height:0;display:grid;grid-template-rows:40px minmax(0,1fr);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box;overflow:hidden}
body.viewport-game .topbar{width:100%;max-width:none;padding:2px 10px;margin:0;min-height:0;border:0}.viewport-game .brand h1{font-size:17px;letter-spacing:1px}.viewport-game .brand p,.viewport-game .brand-mark,.viewport-game .brand h1 span{display:none}.viewport-game .top-actions .button,.viewport-game .pause-button{min-height:34px;padding:5px 10px;font-size:11px}
.viewport-game>.layout{display:block!important;min-height:0;max-width:none;width:100%;margin:0;padding:0 5px 5px}.viewport-game .game-column{height:100%;min-height:0}.viewport-game #game-table-view:not([hidden]){height:100%;min-height:0}
.viewport-stage{height:100%;min-height:0;display:grid;grid-template-rows:24px minmax(0,1fr) min(45dvh,390px);position:relative;border-radius:14px;background-image:linear-gradient(#fff3d500,#fff3d535),var(--shonan-scene);background-size:cover;background-position:center;isolation:isolate}
html[data-environment="kanazawa"] .viewport-stage{background-image:var(--kanazawa-scene);background-color:#12253f}
.viewport-hud{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:0 8px;min-width:0;overflow:hidden;font-size:10px;text-shadow:0 1px 2px #fff}.viewport-hud .session-bar{margin:0;display:contents}.viewport-hud .session-title{display:none}.viewport-hud .level-chip{padding:0;border:0;background:none;box-shadow:none}.viewport-hud .match-score{display:contents!important;background:none;border:0;padding:0;margin:0;font-size:10px}.viewport-hud .match-score[hidden]{display:none!important}.viewport-hud .small-tag,.viewport-hud #match-level-owner{display:none}
.viewport-stage .table.seat-layout{height:100%;min-height:0!important;background:none!important;border:0;box-shadow:none;border-radius:0;overflow:visible;--seat-avatar-size:32px}
.viewport-stage .table:before,.viewport-stage .table:after{display:none}.viewport-stage .table .seat{min-width:0;width:130px;max-height:none;min-height:0;padding:3px;gap:5px;flex-direction:row;align-items:center;border-radius:9px}.viewport-stage .seat-top{top:0;left:50%;transform:translateX(-50%)}.viewport-stage .seat-left{left:4px;top:115px}.viewport-stage .seat-right{right:4px;top:115px}.viewport-stage .seat h3{font-size:10px;margin:0}.viewport-stage .seat .seat-label{font-size:8px;padding:0;margin-left:3px}.viewport-stage .seat p{font-size:9px;margin:0}.viewport-stage .seat-count{display:inline}.viewport-stage .seat .ask-count{min-height:26px;padding:2px 5px;font-size:9px;display:inline;margin:0}.viewport-stage .seat-last{display:none}
.viewport-stage .seat-play{width:calc(50% - 16px);container-type:inline-size}.viewport-stage .seat-play-2{top:47px;max-width:260px;width:calc(100% - 32px)}.viewport-stage .seat-play-3{top:164px;left:7px}.viewport-stage .seat-play-1{top:164px;right:7px}.viewport-stage .seat-play-0{bottom:23px;width:calc(100% - 32px);max-width:260px}.viewport-stage .seat-play-caption{font-size:10px;line-height:14px;gap:4px}.viewport-stage .seat-play-badge{font-size:9px}.viewport-stage .seat-play.pass .seat-play-badge{font-size:11px}.viewport-stage .seat-play-detail{font-size:9px;line-height:12px;max-height:24px}
.viewport-stage .seat-play-cards{grid-template-columns:repeat(calc(var(--pile-columns) - 1),minmax(0,33px)) 30px;width:calc(var(--pile-columns)*33px - 3px);row-gap:4px;padding:2px 0;margin-top:1px}.viewport-stage .seat-play-cards[data-count="1"]{width:30px}.viewport-stage .seat-play-cards.many{--pile-columns:var(--pile-total)!important}.viewport-stage .seat-play-cards .card{width:30px;min-width:30px;height:40px;min-height:40px;--face-rank:12px;--face-suit:9px;--face-inset:2px}.viewport-stage .seat-play-cards .card .card-suit{left:2px;top:15px}.viewport-stage .seat-play-cards .card .wild-tag{left:2px;top:28px;font-size:5px}.viewport-stage .seat-play-cards .card .card-copy{display:none}
@container(max-width:180px){.viewport-stage .seat-play-cards.many{--pile-columns:5!important}}
.viewport-stage .table-bottom{bottom:2px;left:7px;right:7px}.viewport-stage .turn-status{font-size:10px!important;line-height:16px!important;max-height:32px;overflow:hidden}
.viewport-stage .trick-area,.viewport-stage .trick-area.has-comparison{top:70px!important;bottom:30px!important;left:8px!important;right:8px!important}.viewport-stage .trick-owner{font-size:11px;margin:0}.viewport-stage .trick-type{font-size:10px;margin:2px}.viewport-stage .empty-trick{padding:5px;font-size:11px;background:transparent;box-shadow:none}
.viewport-stage .hand-panel{position:relative;min-height:0;display:grid;grid-template-rows:32px minmax(0,1fr) 20px auto 40px 16px;gap:2px;background:transparent!important;border:0!important;box-shadow:none!important;margin:0;padding:0 7px 3px;border-radius:0}.viewport-stage .hand-header{margin:0;height:32px;padding:0}.viewport-stage .my-seat{gap:4px}.viewport-stage .my-seat .avatar{--seat-avatar-size:27px}.viewport-stage .my-seat h2{font-size:0}.viewport-stage .my-seat h2 span{font-size:10px;margin:0}.viewport-stage .my-seat p{display:none}.viewport-stage .organize-entry{display:flex;gap:5px}.viewport-stage .organize-entry button{min-height:30px;padding:4px 8px;font-size:10px}
.viewport-stage .hand{height:100%;min-height:0;margin:0;padding:2px 0;overflow-y:hidden;overflow-x:auto;align-self:stretch;scrollbar-width:thin;position:relative;touch-action:none}.viewport-stage .hand-pan-tip{display:none}.viewport-stage .selection-row{grid-row:3;min-height:0;margin:0;gap:5px}.viewport-stage .selection-row p{font-size:10px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.viewport-stage .selection-row .text-button{min-height:20px;font-size:10px;padding:0 4px}.viewport-stage .interpretations{grid-row:4;margin:0;display:flex;gap:3px;align-items:center}.viewport-stage .interpretations label{font-size:10px}.viewport-stage .interpretations select{min-height:28px;height:28px;padding:2px;font-size:10px}.viewport-stage .controls{grid-row:5;min-height:0;margin:0;padding:0;border:0;gap:5px}.viewport-stage .controls .button{height:38px;min-height:38px;padding:4px 10px;font-size:12px;min-width:60px}.viewport-stage .controls .primary{min-width:95px}.viewport-stage .controls kbd{display:none}.viewport-stage .feedback{grid-row:6;margin:0;min-height:0;font-size:9px;line-height:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.viewport-stage .online-exchange{grid-row:5;margin:0;gap:4px;flex-wrap:nowrap}.viewport-stage .online-exchange button{font-size:11px;padding:3px 8px;min-height:36px}.viewport-stage .hand-panel:has(.online-exchange:not([hidden])) .controls{display:none}
.viewport-game>.footer,.viewport-game>.online-message{display:none}.viewport-game .online-room-bar,.viewport-game .online-room-note{display:none}.viewport-game .table-menu .online-room-bar,.viewport-game .table-menu .online-room-note{display:flex}.viewport-game .table-menu .online-room-bar{flex-wrap:wrap;font-size:11px;gap:6px}
.viewport-stage>#opening-info,.viewport-stage>#count-alert{position:absolute;z-index:4;top:24px;left:5px;right:5px;font-size:10px;line-height:14px;pointer-events:none;margin:0;padding:2px 4px;background:transparent;border:0;text-shadow:0 1px 3px #fff}.viewport-stage>#opening-info{display:none}.viewport-stage>#count-alert{top:50%;text-align:center}.viewport-stage>#critical-status{position:absolute;z-index:8;top:30px;left:10%;right:10%;margin:0;font-size:11px}
.viewport-stage>#allocation-panel,.viewport-stage>#exchange-review,.viewport-stage>#round-result{position:absolute;z-index:12;left:5%;right:5%;top:34px;max-height:calc(55% - 45px);overflow:auto;margin:0;padding:9px;border-radius:12px;box-shadow:0 4px 20px #0003}.viewport-stage>#allocation-panel h3,.viewport-stage>#exchange-review h2,.viewport-stage>#round-result h2{font-size:13px;margin:0 0 5px}.viewport-stage .allocation-choices{gap:6px}.viewport-stage .allocation-choice{padding:3px;gap:3px}.viewport-stage .allocation-panel p,.viewport-stage .exchange-review p,.viewport-stage .round-result p{font-size:10px;line-height:1.4;margin:4px 0}.viewport-stage #review-cards{display:none}.viewport-stage #exchange-review{top:auto;bottom:calc(min(45dvh,390px) + 4px);max-height:100px}.viewport-stage #round-result{max-height:calc(100% - 45px)}.viewport-stage .round-result .button,.viewport-stage .allocation-panel .button,.viewport-stage .exchange-review .button{min-height:36px;padding:5px 10px}
.viewport-game .dialog{max-height:calc(100dvh - 24px);overflow:auto}.viewport-organize{width:min(90vw,460px)}.viewport-organize .organize-panel{display:flex;flex-wrap:wrap}.viewport-organize .organize-controls{flex-basis:100%}.viewport-organize .hand-scroll-hint{display:none}
html[data-environment="kanazawa"] .viewport-hud,html[data-environment="kanazawa"] .viewport-stage .selection-row p,html[data-environment="kanazawa"] .viewport-stage .feedback{color:#edf3fb;text-shadow:0 1px 3px #020916}
@media(min-width:901px) and (min-height:521px){.viewport-stage .seat-left{top:40%;left:8px}.viewport-stage .seat-right{top:40%;right:8px}.viewport-stage .seat-play-3{top:42%;left:145px;width:calc(50% - 290px)}.viewport-stage .seat-play-1{top:42%;right:145px;width:calc(50% - 290px)}.viewport-stage .seat-play-0{bottom:24px}.viewport-stage .seat-play-2{top:48px}}
@media(max-height:520px) and (orientation:landscape){body.viewport-game{grid-template-rows:32px minmax(0,1fr)}.viewport-game .topbar{padding:0 8px}.viewport-stage{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:20px minmax(0,1fr);column-gap:6px}.viewport-hud{grid-column:1/-1}.viewport-stage .table{grid-column:1;grid-row:2}.viewport-stage .hand-panel{grid-column:2;grid-row:2;grid-template-rows:30px minmax(0,1fr) 18px auto 38px 14px}.viewport-stage .seat-left,.viewport-stage .seat-right{top:98px;width:calc(50% - 10px)}.viewport-stage .seat-play-1,.viewport-stage .seat-play-3{top:144px}.viewport-stage .seat-play-0{bottom:21px;max-width:230px}.viewport-stage .seat-play-2{top:44px;max-width:230px}.viewport-stage .seat-play-detail{display:none}.viewport-stage .seat-play-cards .card{height:36px;min-height:36px}.viewport-stage>#allocation-panel,.viewport-stage>#exchange-review{left:2%;right:52%;max-height:calc(100% - 48px)}.viewport-stage>#exchange-review{bottom:24px;max-height:100px}.viewport-stage>#round-result{left:10%;right:10%;top:24px;max-height:calc(100% - 30px)}.viewport-stage .trick-area{top:55px!important;bottom:26px!important}.viewport-stage .table-cards.exchange-on-table{max-width:100%;gap:5px;padding:2px}.viewport-stage .online-exchange-tile>span:first-child{font-size:8px;max-width:70px}}
/* Short landscape keeps the user's hand at the bottom, not a separate side panel. */
@media(max-height:520px) and (orientation:landscape){
 .viewport-stage{display:grid;grid-template-columns:1fr;grid-template-rows:140px minmax(0,1fr);gap:0}
 .viewport-hud{position:absolute;right:165px;left:165px;top:-29px;height:26px;justify-content:center;gap:10px;pointer-events:none}
 .viewport-stage .table{grid-row:1;grid-column:1}.viewport-stage .hand-panel{grid-row:2;grid-column:1;grid-template-rows:26px minmax(0,1fr) 0 auto 38px 14px;gap:1px;padding:0 5px 2px}
 .viewport-stage .hand-header{height:26px}.viewport-stage .my-seat .avatar{--seat-avatar-size:24px}.viewport-stage .organize-entry button{min-height:25px;height:25px;padding:2px 8px}.viewport-stage .selection-row{position:absolute;top:2px;left:90px;right:80px;height:20px;grid-row:auto}.viewport-stage .selection-row p{font-size:9px}
 .viewport-stage .table .seat{width:130px;height:35px;--seat-avatar-size:27px;padding:1px 3px;top:0}.viewport-stage .seat-left{left:5px}.viewport-stage .seat-right{right:5px}.viewport-stage .seat-top{left:50%}.viewport-stage .seat .ask-count{min-height:24px;height:24px;padding:1px 4px}.viewport-stage .seat-play-3{left:8px;top:39px;width:calc(33% - 15px)}.viewport-stage .seat-play-1{right:8px;top:39px;width:calc(33% - 15px)}.viewport-stage .seat-play-2{top:35px;width:calc(34% - 12px);max-width:270px}.viewport-stage .seat-play-0{bottom:4px;width:calc(34% - 12px);max-width:270px}.viewport-stage .seat-play-cards .card{height:32px;min-height:32px}.viewport-stage .seat-play-cards .card .wild-tag{top:25px}.viewport-stage .seat-play-caption{line-height:12px;font-size:9px}.viewport-stage .table-bottom{bottom:1px;left:7px;max-width:30%}.viewport-stage .turn-status{font-size:9px!important;line-height:12px!important}
 .viewport-stage .trick-area,.viewport-stage .trick-area.has-comparison{top:36px!important;bottom:3px!important;left:140px!important;right:140px!important}.viewport-stage .table-cards .card{width:32px;height:42px;min-height:42px;flex-basis:32px}.viewport-stage .online-exchange-tile>span:first-child{font-size:8px;max-width:90px}.viewport-stage>#allocation-panel{top:0;left:20%;right:20%;max-height:140px}.viewport-stage>#exchange-review{top:100px;bottom:auto;left:33%;right:33%;max-height:40px;padding:2px}.viewport-stage #exchange-review h2,.viewport-stage #exchange-review p{display:none}.viewport-stage #exchange-review button{margin:0;min-height:34px;padding:3px 8px;font-size:10px}.viewport-stage>#round-result{top:5px;left:10%;right:10%;max-height:calc(100% - 10px)}
}
.viewport-stage .table .seat{height:44px;--seat-card-height:44px;--seat-card-width:130px}
.viewport-stage .table .seat .seat-info{display:grid;grid-template-columns:minmax(0,1fr) 34px;grid-template-rows:13px 25px;gap:0 2px}
.viewport-stage .table .seat .seat-heading{grid-column:1/-1;line-height:13px;font-size:10px;gap:2px}
.viewport-stage .table .seat .seat-label{font-size:7px;line-height:12px;padding:0}
.viewport-stage .table .seat .seat-count{grid-row:2;grid-column:1;height:auto;line-height:13px;font-size:9px;white-space:normal}
.viewport-stage .table .seat .seat-query{grid-row:2;grid-column:2;height:25px}.viewport-stage .table .seat .ask-count{width:34px;min-width:34px;height:25px;min-height:25px;padding:0;line-height:23px;font-size:9px}
@media(max-height:520px) and (orientation:landscape){.viewport-stage .table .seat{height:35px;--seat-card-height:35px}.viewport-stage .table .seat .seat-info{grid-template-rows:12px 20px}.viewport-stage .table .seat .seat-query{height:20px}.viewport-stage .table .seat .ask-count{height:22px;min-height:22px;line-height:20px}}
/* The cards carry wildcard declarations; the full pattern remains in the group's accessible label. */
.viewport-stage .seat-play-detail{display:none}
.viewport-stage>#allocation-panel{background:#fff9ed;color:#294b60}
html[data-environment="kanazawa"] .viewport-stage>#allocation-panel{background:#18283e;color:#edf3fb}
@media(max-height:520px) and (orientation:landscape){
 .viewport-stage>#allocation-panel{display:grid;grid-template-columns:minmax(0,1fr) 150px;grid-template-rows:18px 1fr;gap:3px;height:138px;overflow:visible;padding:5px 8px}
 .viewport-stage #allocation-title{grid-column:1/-1;margin:0;font-size:12px;line-height:16px}.viewport-stage #allocation-choices{grid-column:1;grid-row:2;align-items:center}.viewport-stage .allocation-choice{height:90px;min-width:48px;padding:2px;gap:2px}.viewport-stage .allocation-choice .card{width:38px!important;height:58px!important;min-height:58px!important}.viewport-stage .allocation-choice>span{font-size:10px}.viewport-stage #allocation-advice{grid-column:2;grid-row:2;align-self:start;font-size:10px;margin:0;line-height:14px}.viewport-stage #allocation-confirm{grid-column:2;grid-row:2;align-self:end;min-width:0;width:100%;height:36px;margin:0}
}
/* v23.1: direct in-table organizing; no modal or mode switch. */
.viewport-stage{grid-template-rows:24px minmax(0,1fr) calc(min(45dvh,390px) + 32px)}
.viewport-stage .hand-panel{grid-template-rows:30px 32px minmax(0,1fr) 20px auto 40px 16px}
.viewport-stage .hand-header{grid-row:1;height:30px}.viewport-stage .inline-hand-tools{grid-row:2;display:flex;align-items:center;flex-wrap:nowrap;gap:3px;min-height:0;margin:0;padding:0;border:0;overflow:visible}
.viewport-stage .inline-hand-tools .sort-group{display:flex;flex:none;padding:0;background:transparent;border:0;gap:2px}
.viewport-stage .inline-hand-tools .organize-controls,.viewport-stage .inline-hand-tools .organize-controls>div{display:contents}
.viewport-stage .inline-hand-tools :is(.sort-button,.organize-button,.text-button){height:30px;min-height:30px;min-width:29px;flex:none;margin:0;padding:3px 7px;font-size:10px;line-height:20px;white-space:nowrap}
.viewport-stage .inline-hand-tools #move-left,.viewport-stage .inline-hand-tools #move-right{min-width:29px;padding:3px 8px;font-size:15px}
.viewport-stage .inline-hand-tools .hand-scroll-hint{display:none}.viewport-stage .hand{grid-row:3}.viewport-stage .selection-row{grid-row:4}.viewport-stage .interpretations{grid-row:5}.viewport-stage .controls,.viewport-stage .online-exchange{grid-row:6}.viewport-stage .feedback{grid-row:7}
.viewport-stage #exchange-review{bottom:calc(min(45dvh,390px) + 36px)}
@media(max-height:520px) and (orientation:landscape){
 body.viewport-game{grid-template-rows:28px minmax(0,1fr)}
 .viewport-stage{grid-template-rows:104px minmax(0,1fr)}.viewport-hud{top:-27px;height:25px}
 .viewport-stage .hand-panel{grid-template-rows:26px minmax(0,1fr) 0 auto 38px 0;gap:1px;padding:0 5px 2px}
 .viewport-stage .hand-header{position:absolute;top:0;left:5px;height:26px;width:66px;grid-row:auto}.viewport-stage .my-seat .avatar{--seat-avatar-size:23px}.viewport-stage .hand-header .organize-entry{position:absolute;right:0;bottom:28px}
 .viewport-stage .inline-hand-tools{grid-row:1;margin-left:70px;gap:4px}.viewport-stage .inline-hand-tools :is(.sort-button,.organize-button,.text-button){height:25px;min-height:25px;line-height:19px;padding:2px 8px;min-width:34px}
 .viewport-stage .hand{grid-row:2}.viewport-stage .selection-row{position:absolute;top:auto;bottom:20px;left:180px;right:112px;height:16px;grid-row:auto}.viewport-stage .selection-row p{font-size:9px;line-height:15px}.viewport-stage .selection-row .text-button{min-height:16px;padding:0;font-size:9px}
 .viewport-stage .interpretations{grid-row:4}.viewport-stage .controls,.viewport-stage .online-exchange{grid-row:5}.viewport-stage .feedback{position:absolute;bottom:5px;left:180px;right:112px;grid-row:auto;line-height:13px;font-size:9px;min-height:0}
 .viewport-stage .table .seat{height:26px;--seat-card-height:26px;--seat-avatar-size:23px;gap:3px;padding:0 2px}.viewport-stage .table .seat .seat-info{grid-template-rows:11px 12px;grid-template-columns:minmax(0,1fr) 34px}.viewport-stage .table .seat .seat-heading{grid-column:1;grid-row:1;font-size:9px;line-height:11px}.viewport-stage .table .seat .seat-label{display:none}.viewport-stage .table .seat .seat-count{font-size:8px;line-height:11px;white-space:nowrap}.viewport-stage .table .seat .seat-query{grid-column:2;grid-row:1/3;height:24px}.viewport-stage .table .seat .ask-count{height:24px;min-height:24px;line-height:22px}
 .viewport-stage .seat-play-1,.viewport-stage .seat-play-2,.viewport-stage .seat-play-3{top:26px}.viewport-stage .seat-play-0{bottom:0}.viewport-stage .seat-play-caption{line-height:10px;font-size:9px}.viewport-stage .seat-play-badge{font-size:8px}.viewport-stage .seat-play-cards{margin-top:0;padding:1px 0}.viewport-stage .seat-play-cards .card{height:26px;min-height:26px}.viewport-stage .seat-play-cards .card .wild-tag{left:14px;top:16px;font-size:5px;line-height:6px}.viewport-stage .seat-play-cards .card .card-suit{top:13px;font-size:9px}
 .viewport-stage .table-bottom{bottom:0;max-width:30%}.viewport-stage .turn-status{font-size:9px!important;line-height:12px!important}
 .viewport-stage>#allocation-panel{height:102px;max-height:102px;grid-template-rows:14px 1fr;padding:3px 8px}.viewport-stage .allocation-choice{height:72px;min-height:0;padding:1px}.viewport-stage .allocation-choice .card{height:44px!important;min-height:44px!important}.viewport-stage #allocation-advice{font-size:9px;line-height:12px}.viewport-stage #allocation-confirm{height:34px;min-height:34px}
 .viewport-stage>#exchange-review{top:auto;bottom:4px;left:auto;right:7px;width:265px;height:36px;max-height:36px;padding:0}.viewport-stage #review-confirm{height:34px;width:100%;min-height:34px}
 .viewport-stage .trick-area,.viewport-stage .trick-area.has-comparison{top:26px!important;bottom:2px!important}
}
.viewport-stage .hand[data-hand-compact="true"] .card .wild-tag{top:17px!important;font-size:5px!important;line-height:1!important}
/* v23.3: cardinal seats use the recovered header space, hand stays below. */
@media(max-height:520px) and (orientation:landscape){
 body.viewport-game{grid-template-rows:0 minmax(0,1fr)}
 .viewport-game .topbar{position:absolute;top:env(safe-area-inset-top);right:env(safe-area-inset-right);left:env(safe-area-inset-left);height:28px;width:auto;z-index:5;pointer-events:none;background:transparent}
 .viewport-game .topbar .brand{display:none}.viewport-game .topbar .top-actions{margin-left:auto;pointer-events:auto}.viewport-game .top-actions .button,.viewport-game .pause-button{min-height:26px;height:26px;padding:2px 8px}
 .viewport-game>.layout{grid-row:2;padding-bottom:1px}
 .viewport-stage{grid-template-rows:136px minmax(0,1fr)}
 .viewport-hud{top:1px;left:8px;right:auto;max-width:calc(50% - 90px);height:24px;justify-content:flex-start;gap:5px;font-size:9px}
 .viewport-stage .table .seat-top{top:0}
 .viewport-stage .table .seat-left,.viewport-stage .table .seat-right{top:36px}
 .viewport-stage .seat-play{width:calc(33.333% - 16px);max-width:none}
 .viewport-stage .seat-play-3{left:8px;right:auto;top:66px;transform:none}
 .viewport-stage .seat-play-2{left:50%;right:auto;top:26px;transform:translateX(-50%)}
 .viewport-stage .seat-play-1{left:auto;right:8px;top:66px;transform:none}
 .viewport-stage .seat-play-0{left:50%;right:auto;bottom:0;transform:translateX(-50%)}
 .viewport-stage .seat-play-cards.many{--pile-columns:var(--pile-total)!important}
 .viewport-stage .seat-play-cards .card{width:30px;min-width:30px;height:42px;min-height:42px}
 .viewport-stage .seat-play-cards .card .card-suit{top:15px;font-size:9px}
 .viewport-stage .seat-play-cards .card .wild-tag{left:2px;top:29px;font-size:5px;line-height:6px}
 .viewport-stage .table-bottom{bottom:0;max-width:30%}
}
@media(min-width:1100px) and (min-height:740px){
 .viewport-stage .seat-play-cards{grid-template-columns:repeat(calc(var(--pile-columns) - 1),minmax(0,45px)) 42px;width:calc(var(--pile-columns)*45px - 3px)}
 .viewport-stage .seat-play-cards[data-count="1"]{width:42px}
 .viewport-stage .seat-play-cards .card{width:42px;min-width:42px;height:60px;min-height:60px;--face-rank:14px;--face-suit:11px}
 .viewport-stage .seat-play-cards .card .card-suit{top:18px;font-size:11px}
 .viewport-stage .seat-play-cards .card .wild-tag{top:33px;font-size:6px}
 .viewport-stage .seat-play-1,.viewport-stage .seat-play-3{top:calc(50% - 24px)}
 .viewport-stage .seat-play-0{bottom:14px}
}
/* The scene fills the web viewport, including safe-area gutters; controls retain safe padding. */
body.viewport-game{background-image:linear-gradient(#fff3d500,#fff3d535),var(--shonan-scene);background-size:cover;background-position:center}
html[data-environment="kanazawa"] body.viewport-game{background-image:var(--kanazawa-scene);background-color:#12253f;background-size:cover;background-position:center bottom}
.viewport-game .viewport-stage,html[data-environment="kanazawa"] .viewport-game .viewport-stage{background:transparent}

/* v23.4: one name line, one count line, independent question target. */
.viewport-stage .table .seat .seat-info{min-width:0;flex:1;grid-template-columns:minmax(0,1fr) 34px;grid-template-rows:16px 20px;column-gap:5px}
.viewport-stage .table .seat .seat-heading{grid-column:1;grid-row:1;display:block;min-width:0;line-height:16px;margin:0}
.viewport-stage .table .seat .seat-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:inherit}
.viewport-stage .table .seat .seat-label{display:none}
.viewport-stage .table .seat .seat-count,.viewport-stage .table .seat .seat-count b{white-space:nowrap;line-height:18px;font-size:10px;height:auto;overflow:visible}
.viewport-stage .table .seat .seat-query{grid-column:2;grid-row:1/3;align-self:center;height:28px}
.viewport-stage .table .seat .ask-count{height:28px;min-height:28px;line-height:26px}
.viewport-stage .seat-play-name{display:none}
.viewport-stage .seat-play-caption{justify-content:center;gap:0}
@media(max-height:520px) and (orientation:landscape){
 .viewport-stage .table .seat .seat-info{grid-template-rows:12px 13px;column-gap:5px}
 .viewport-stage .table .seat .seat-heading{font-size:10px;line-height:12px}
 .viewport-stage .table .seat .seat-count,.viewport-stage .table .seat .seat-count b{font-size:10px;line-height:13px}
 .viewport-stage .table .seat .seat-query{height:24px}.viewport-stage .table .seat .ask-count{height:24px;min-height:24px;line-height:22px}
}
@media(min-width:1100px) and (min-height:740px){
 .viewport-stage .table .seat{width:170px;--seat-card-width:170px;--seat-avatar-size:34px;gap:8px}
 .viewport-stage .table .seat .seat-info{grid-template-columns:minmax(0,1fr) 42px;grid-template-rows:18px 20px;column-gap:8px}
 .viewport-stage .table .seat .seat-heading{font-size:14px;line-height:18px}.viewport-stage .table .seat .seat-count,.viewport-stage .table .seat .seat-count b{font-size:12px;line-height:20px}
 .viewport-stage .table .seat .ask-count{width:42px;min-width:42px;height:32px;min-height:32px;line-height:30px;font-size:11px}.viewport-stage .table .seat .seat-query{height:32px}
 .viewport-stage .seat-play-3{left:185px;width:calc(50% - 330px)}.viewport-stage .seat-play-1{right:185px;width:calc(50% - 330px)}
 .viewport-stage .seat-play-cards{grid-template-columns:repeat(calc(var(--pile-columns) - 1),minmax(0,55px)) 52px;width:calc(var(--pile-columns)*55px - 3px)}
 .viewport-stage .seat-play-cards[data-count="1"]{width:52px}.viewport-stage .seat-play-cards .card{width:52px;min-width:52px;height:74px;min-height:74px;--face-rank:17px;--face-suit:13px}
 .viewport-stage .seat-play-cards .card .card-suit{top:23px;font-size:13px}.viewport-stage .seat-play-cards .card .wild-tag{top:43px;font-size:7px}
 .viewport-stage .seat-play-caption{font-size:12px;line-height:16px}.viewport-stage .seat-play-badge{font-size:11px}
}
/* Settlement is a focused scorecard, not a long notification strip. */
.viewport-stage>#round-result{left:50%;right:auto;top:24px;bottom:auto;transform:translateX(-50%);width:min(720px,calc(100% - 24px));max-height:calc(100% - 40px);padding:22px;display:grid;grid-template-columns:1fr 1.15fr;gap:18px 24px;border:1px solid #c9b98d;border-radius:22px;background:linear-gradient(135deg,#fffaf0f5,#ede9ddf5);color:#304c59;box-shadow:0 12px 38px #10243438;overflow:auto}
.viewport-stage #round-result #result{display:contents}.viewport-stage #round-result h2{font-size:24px;line-height:1.3;margin:10px 0;color:#304f61;letter-spacing:1px}.viewport-stage #round-result .eyebrow{font-size:10px;letter-spacing:1px;color:#90723a}.viewport-stage #round-result .settlement-detail{font-size:12px;line-height:1.6;margin:8px 0;color:#5f716f}
.settlement-players{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}.settlement-player{min-width:0;padding:12px 10px;border:1px solid #d3c9af;border-radius:12px;display:grid;gap:5px;background:#ffffff54}.settlement-player.first{border-color:#bd9855;background:#f3deb352}.settlement-place{font-size:11px;color:#8e744b}.settlement-player strong{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px}.settlement-player small{font-size:10px;color:#6c7b7b}.settlement-levels{display:flex;flex-wrap:wrap;gap:8px 20px;margin-top:12px;font-size:12px}.settlement-levels b{font-size:16px;color:#8a682e;white-space:nowrap}
.viewport-stage #round-result .result-actions,.viewport-stage #round-result>#next,.viewport-stage #round-result>details,.viewport-stage #round-result .settlement-wait{grid-column:1/-1}.viewport-stage #round-result .result-actions{justify-content:center;border-top:1px solid #bba77a44;padding-top:14px;gap:10px}.viewport-stage #round-result .button{min-height:42px;padding:9px 20px;font-size:13px}.viewport-stage #round-result>#next{justify-self:center;min-width:180px}.viewport-stage #round-result>details{font-size:11px;max-height:110px;overflow:auto}.viewport-stage #round-result .settlement-wait{text-align:center;font-size:12px;margin:0}
html[data-environment="kanazawa"] .viewport-stage>#round-result{background:linear-gradient(135deg,#182f47f5,#152237f5);border-color:#6a7893;color:#edf3fa;box-shadow:0 12px 38px #0005}html[data-environment="kanazawa"] .viewport-stage #round-result h2{color:#f2dcaa}html[data-environment="kanazawa"] .viewport-stage #round-result .eyebrow,html[data-environment="kanazawa"] .settlement-place,html[data-environment="kanazawa"] .settlement-levels b{color:#e5c98f}html[data-environment="kanazawa"] .settlement-player{background:#ffffff06;border-color:#66768a}html[data-environment="kanazawa"] .settlement-player.first{background:#c8a85c12;border-color:#c7aa69}html[data-environment="kanazawa"] .viewport-stage #round-result .settlement-detail,html[data-environment="kanazawa"] .settlement-player small{color:#bdcbdb}
@media(max-width:600px){.viewport-stage>#round-result{grid-template-columns:1fr;gap:14px;padding:18px;top:18px}.viewport-stage #round-result h2{font-size:23px}.settlement-player{padding:10px}.viewport-stage #round-result .result-actions{padding-top:10px}}
@media(max-height:520px) and (orientation:landscape){.viewport-stage>#round-result{top:10px;max-height:calc(100% - 20px);padding:15px 20px;gap:10px 20px}.viewport-stage #round-result h2{font-size:22px;margin:7px 0}.settlement-player{padding:8px 10px;gap:3px}.viewport-stage #round-result .result-actions{padding-top:9px}.viewport-stage #round-result>details{max-height:75px}}
@media(min-width:1100px) and (min-height:740px){.viewport-stage .hand .card .wild-tag{line-height:1}}
/* Public transfer ledger stays on the table, separate from allocation choices. */
.viewport-stage .table.exchange-active .seat,.viewport-stage .table.exchange-active .table-bottom{visibility:hidden}
.viewport-stage .table.exchange-active .trick-area,.viewport-stage .table.exchange-active .trick-area.has-comparison{top:28px!important;bottom:8px!important;left:12px!important;right:12px!important;display:block!important;transform:none!important}
.viewport-stage .table.exchange-active .trick-owner{text-align:center;font-size:12px;line-height:16px;margin:0 0 6px}.viewport-stage .table.exchange-active .trick-type{display:none}
.viewport-stage .exchange-on-table{display:grid!important;grid-template-columns:repeat(var(--exchange-count,4),minmax(0,1fr));gap:10px!important;max-width:none!important;min-width:0;width:100%;padding:0!important;justify-content:stretch;align-items:start}
.viewport-stage .online-exchange-tile{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;margin:0;padding:0;background:none;border:0}
.viewport-stage .online-exchange-tile>span:first-child{max-width:100%;font-size:11px;line-height:15px;text-align:center;white-space:normal;overflow-wrap:anywhere;color:inherit;text-shadow:0 1px 2px #fff}
.viewport-stage .exchange-on-table .card,.viewport-stage .exchange-on-table .exchange-card-back{position:relative!important;flex:none;width:42px!important;min-width:42px!important;height:58px!important;min-height:58px!important;margin:0!important;transform:none!important;--face-rank:16px;--face-suit:12px}
.viewport-stage .exchange-on-table .card .card-suit{top:20px;font-size:12px}.viewport-stage .exchange-on-table .card .wild-tag{top:35px;font-size:6px}.viewport-stage .exchange-on-table .card-copy{display:none}
html[data-environment="kanazawa"] .viewport-stage .online-exchange-tile>span:first-child{color:#edf4ff;text-shadow:0 1px 3px #031020,1px 0 3px #031020}
.viewport-stage:has(>#allocation-panel:not([hidden])) .table.exchange-active .trick-area{left:50%!important}
.viewport-stage:has(>#allocation-panel:not([hidden])) .exchange-on-table{grid-template-columns:repeat(2,minmax(0,1fr))}
.viewport-stage:has(>#allocation-panel:not([hidden]))>#allocation-panel{left:8px;right:52%;top:28px;max-height:calc(100% - 45px)}
@media(max-width:600px) and (orientation:portrait){
 .viewport-stage .exchange-on-table{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px!important}
 .viewport-stage:has(>#allocation-panel:not([hidden])) .table.exchange-active .trick-area{left:12px!important;top:190px!important}
 .viewport-stage:has(>#allocation-panel:not([hidden]))>#allocation-panel{top:5px;left:12px;right:12px;height:175px;max-height:175px}
 .viewport-stage:has(>#allocation-panel:not([hidden])) .online-exchange-tile{flex-direction:row;justify-content:center}.viewport-stage:has(>#allocation-panel:not([hidden])) .online-exchange-tile>span:first-child{max-width:100px;font-size:10px}
}
@media(max-height:520px) and (orientation:landscape){
 .viewport-stage .table.exchange-active .trick-area{top:28px!important;left:8px!important;right:8px!important;bottom:3px!important}
 .viewport-stage .table.exchange-active .trick-owner{font-size:11px;line-height:14px;margin:0 0 3px}
 .viewport-stage .exchange-on-table{gap:5px!important}
 .viewport-stage .online-exchange-tile{flex-direction:row;justify-content:center;gap:6px;min-height:44px}
 .viewport-stage .online-exchange-tile>span:first-child{max-width:115px;font-size:10px;line-height:13px;text-align:left}
 .viewport-stage .exchange-on-table .card,.viewport-stage .exchange-on-table .exchange-card-back{width:32px!important;min-width:32px!important;height:44px!important;min-height:44px!important;--face-rank:12px;--face-suit:9px}
 .viewport-stage .exchange-on-table .card .card-suit{top:15px;font-size:9px}.viewport-stage .exchange-on-table .card .wild-tag{top:29px;font-size:5px}
 .viewport-stage:has(>#allocation-panel:not([hidden])) .table.exchange-active .trick-area{left:50%!important}
 .viewport-stage:has(>#allocation-panel:not([hidden]))>#allocation-panel{left:8px;right:52%;top:28px;max-height:102px;height:102px;grid-template-columns:minmax(0,1fr) 105px}
 .viewport-stage:has(>#allocation-panel:not([hidden])) .allocation-choice{min-width:0}.viewport-stage:has(>#allocation-panel:not([hidden])) #allocation-advice{font-size:8px;line-height:11px}.viewport-stage:has(>#allocation-panel:not([hidden])) #allocation-confirm{font-size:10px;padding:3px}
 .viewport-stage>#exchange-review{background:transparent!important;box-shadow:none;border:0}
}
@media(max-height:520px) and (orientation:landscape){.viewport-stage:has(>#allocation-panel:not([hidden])) .online-exchange-tile{min-height:40px}.viewport-stage:has(>#allocation-panel:not([hidden])) .exchange-on-table .card,.viewport-stage:has(>#allocation-panel:not([hidden])) .exchange-on-table .exchange-card-back{width:29px!important;min-width:29px!important;height:40px!important;min-height:40px!important}}
@media(max-width:600px) and (orientation:portrait){
 .viewport-stage:has(>#allocation-panel:not([hidden]))>#allocation-panel{display:grid;grid-template-columns:minmax(0,1fr) 112px;grid-template-rows:22px minmax(0,1fr);gap:5px;padding:8px;overflow:visible}
 .viewport-stage:has(>#allocation-panel:not([hidden])) #allocation-title{grid-column:1/-1;grid-row:1;margin:0;font-size:12px}
 .viewport-stage:has(>#allocation-panel:not([hidden])) #allocation-choices{grid-column:1;grid-row:2;align-items:center;gap:5px}
 .viewport-stage:has(>#allocation-panel:not([hidden])) .allocation-choice{padding:2px;min-width:0;max-width:80px}.viewport-stage:has(>#allocation-panel:not([hidden])) .allocation-choice .card{width:38px!important;height:58px!important;min-height:58px!important}
 .viewport-stage:has(>#allocation-panel:not([hidden])) .allocation-choice>span{font-size:9px;line-height:12px}
 .viewport-stage:has(>#allocation-panel:not([hidden])) #allocation-advice{grid-column:2;grid-row:2;align-self:start;font-size:10px;line-height:14px;margin:0}
 .viewport-stage:has(>#allocation-panel:not([hidden])) #allocation-confirm{grid-column:2;grid-row:2;align-self:end;width:100%;min-width:0;height:36px;min-height:36px;font-size:11px;padding:3px}
}

/* Empty-trick text is presentation, not an invisible input shield over side seats. */
.viewport-stage .table:not(.exchange-active) .trick-area{pointer-events:none}
/* Readable table status; transparent text, never a solid caption bar. */
.viewport-stage .seat-play-caption{line-height:16px}
.viewport-stage .seat-play-badge{font-size:12px;font-weight:700}
.viewport-stage .seat-play.pass .seat-play-badge{font-size:15px;font-weight:750;line-height:18px}
.viewport-stage .trick-owner,.viewport-stage .trick-type,.viewport-stage .empty-trick{font-size:13px}
.viewport-stage .seat-play-badge,.viewport-stage .trick-owner,.viewport-stage .trick-type{color:#233f4b;text-shadow:0 1px 2px #fffdf5,0 0 5px #fffaf0}
html[data-environment="kanazawa"] .viewport-stage :is(.seat-play-badge,.trick-owner,.trick-type,.empty-trick){color:#f2f5f8;text-shadow:0 1px 2px #07111d,0 0 4px #07111d}
@media(max-height:520px) and (orientation:landscape){.viewport-stage .seat-play-caption{line-height:13px}.viewport-stage .seat-play-badge{font-size:11px}.viewport-stage .seat-play.pass .seat-play-badge{font-size:14px;line-height:16px}.viewport-stage .trick-owner,.viewport-stage .trick-type,.viewport-stage .empty-trick{font-size:12px}}
