/* Height-aware layouts. Rivers retain their own scroll fallback at extreme zoom. */
.river-section{display:contents}
.river-caption,.concealed-count{display:none}
.save-state{font-size:10px;color:#94aeab;white-space:nowrap;margin-left:8px}
.save-state.save-failed{color:#f4aa92}
.session-loading{height:var(--view-height,100dvh);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:18px;padding:24px;text-align:center}
.session-loading p{font-size:15px;margin:0;color:var(--muted)}

.compact-landscape{--hand-height:54px;--bar-height:34px;--river-width:18px;--river-height:24px}
.compact-landscape .shell,.compact-landscape .opening-shell{
  height:var(--view-height,100dvh);min-height:0;
  padding:max(2px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
}
.compact-landscape .shell{display:grid;grid-template-rows:var(--bar-height) minmax(0,1fr)}
.compact-landscape .topbar{height:100%;gap:10px}
.compact-landscape .brand{font-size:19px;gap:8px}
.compact-landscape .brand-stamp{width:24px;height:28px;font-size:19px}
.compact-landscape .brand small,.compact-landscape .match-label,.compact-landscape .edition{display:none}
.compact-landscape .top-actions{gap:8px}
.compact-landscape .nav-home{min-height:30px;padding:4px 10px}
.compact-landscape .icon-btn{width:30px;height:30px;padding:6px}
.compact-landscape .match{display:block;width:100%;max-width:none;height:100%;min-height:0;padding:6px 2px 2px;margin:0}
.compact-landscape .table-area{height:100%;display:grid;grid-template-rows:22px minmax(0,1fr) 18px auto;gap:5px}
.compact-landscape .opponent-panel{display:none}
.compact-landscape .round-header{margin:0;font-size:12px;min-height:0}
.compact-landscape .round-header .text-button{min-height:24px;font-size:11px;padding:0}
.compact-landscape .round-header i{padding-left:6px}
.compact-landscape .table{
  display:grid;grid-template-columns:minmax(0,1fr) 96px minmax(0,1fr);grid-template-rows:30px minmax(0,1fr);
  gap:4px 10px;min-height:0;padding:6px 8px;box-shadow:0 0 0 2px #101b23,0 0 0 3px #d9b77835,inset 0 0 40px #05181e;
}
.compact-landscape .table:before{inset:3px}
.compact-landscape .opponent-bar{grid-column:1;grid-row:1}
.compact-landscape .you-bar{grid-column:3;grid-row:1}
.compact-landscape .opponent-bar,.compact-landscape .you-bar{min-height:0;gap:5px}
.compact-landscape .mobile-avatar{display:block;width:26px;height:29px;flex-shrink:0;border:1px solid #b7986070;overflow:hidden}
.compact-landscape .player-identity{gap:5px;min-width:0}
.compact-landscape .player-label{font-size:12px;white-space:nowrap}
.compact-landscape .player-label small,.compact-landscape .player-identity>div>small{display:none}
.compact-landscape .seat{width:20px;height:25px;font-size:14px}
.compact-landscape .riichi-label{font-size:10px;line-height:1.2}
.compact-landscape .points{gap:3px}
.compact-landscape .points strong{font-size:22px;letter-spacing:0}
.compact-landscape .points>span{font-size:10px}
.compact-landscape .life-track,.compact-landscape .hidden-hand{display:none}
.compact-landscape .river-section{display:grid;grid-template-rows:13px minmax(0,1fr);min-width:0;min-height:0}
.compact-landscape .opponent-river-section{grid-column:1;grid-row:2}
.compact-landscape .own-river-section{grid-column:3;grid-row:2}
.compact-landscape .river-caption{display:block;text-align:center;font-size:10px;color:#9aafb3;line-height:12px}
.compact-landscape .river{width:100%;max-width:none;min-height:0;height:100%;margin:0;padding:3px 3px 4px;gap:4px 3px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;align-content:flex-start}
.compact-landscape .river .tile{width:var(--river-width);height:var(--river-height);padding:1px;border-radius:2px}
.compact-landscape .river .tile-number,.compact-landscape .river .tile-suit{font-size:11px}
.compact-landscape .river .honor{font-size:17px}
.compact-landscape .table-center{grid-column:2;grid-row:1/3;min-height:0;padding:2px 0;flex-direction:column;gap:7px;justify-content:center}
.compact-landscape .dora-area>span{margin-bottom:4px;font-size:10px;text-align:center}
.compact-landscape .dora-area>div{gap:2px}
.compact-landscape .dora-area .tile{width:16px;height:23px;padding:1px}
.compact-landscape .dora-area .tile:first-child{width:19px}
.compact-landscape .dora-area .tile-number,.compact-landscape .dora-area .tile-suit{font-size:10px}
.compact-landscape .dora-area .honor{font-size:16px}
.compact-landscape .dora-area .back i{font-size:10px}
.compact-landscape .round-medallion{width:76px;height:35px;flex-direction:row;gap:5px;outline-offset:2px}
.compact-landscape .round-medallion strong{font-size:23px;line-height:1.1}
.compact-landscape .round-medallion small,.compact-landscape .round-medallion span{font-size:9px}
.compact-landscape .concealed-count{display:block;font-size:9px;line-height:1;color:#94a9ae}
.compact-landscape .round-sticks{width:76px;gap:5px}
.compact-landscape .round-sticks>div{gap:7px}
.compact-landscape .round-sticks>div>span{font-size:10px}
.compact-landscape .riichi-stick,.compact-landscape .honba-stick{width:40px}
.compact-landscape .riichi-stick:after{left:18px}
.compact-landscape .honba-stick:after{left:12px}
.compact-landscape .mobile-dialogue{display:flex;align-items:center;gap:10px;margin:0;padding:0 2px;background:none;border:0;min-width:0}
.compact-landscape .mobile-dialogue>span{font-size:10px;flex-shrink:0;color:var(--accent)}
.compact-landscape .mobile-dialogue>p{font-family:var(--serif);font-size:12px;line-height:18px;margin:0}
.compact-landscape .table-area:has(.mobile-dialogue .quote-translation){grid-template-rows:22px minmax(0,1fr) 42px auto}
.compact-landscape .mobile-dialogue>p:has(.quote-translation){min-width:0;max-height:42px;overflow-y:auto;overscroll-behavior:contain}
.compact-landscape .hand-zone{padding:0;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(185px,27%);grid-template-rows:25px var(--hand-height);gap:2px 12px;align-items:end}
.compact-landscape .hand-heading{grid-column:1;grid-row:1;align-self:center;margin:0;font-size:11px;gap:5px}
.compact-landscape .hand-heading>span>small{font-size:10px;margin-left:6px}
.compact-landscape .hand-hint{font-size:10px;line-height:1.2;max-width:65%}
.compact-landscape .hand{grid-column:1;grid-row:2;display:flex;gap:3px;min-height:0;height:100%;padding:5px 0 4px;align-items:end}
.compact-landscape .hand .tile{min-width:0;max-width:42px;width:auto;height:100%;flex:1;padding:1px 2px}
.compact-landscape .hand .tile.drawn{margin-left:6px}
.compact-landscape .hand .tile.selected{transform:translateY(-5px);outline-offset:1px}
.compact-landscape .hand .tile-number,.compact-landscape .hand .tile-suit{font-size:19px}
.compact-landscape .hand .honor{font-size:27px}
.compact-landscape .turn-message{grid-column:2;grid-row:1;align-self:center;min-height:0;margin:0;font-size:11px;line-height:1.2;text-align:left}
.compact-landscape .actions{grid-column:2;grid-row:2;position:static;align-self:stretch;align-items:end;gap:4px;padding:0 0 3px;background:none}
.compact-landscape .actions button{min-width:0;min-height:44px;flex:1;padding:5px 4px;font-size:12px;letter-spacing:0;gap:3px}
.compact-landscape .actions .discard-button{min-width:0;flex:1.25}
.compact-landscape .actions button svg{width:14px;height:14px}

/* Keep the result action visible; unusually long yaku lists scroll internally. */
.compact-landscape .modal{max-height:calc(var(--view-height,100dvh) - max(16px,env(safe-area-inset-bottom)) - max(8px,env(safe-area-inset-top)));padding:16px 20px}
.compact-landscape .score-modal[open]{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr) auto;gap:10px 24px;width:min(960px,calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px));height:calc(var(--view-height,100dvh) - max(16px,env(safe-area-inset-bottom)) - max(8px,env(safe-area-inset-top)));overflow:hidden}
.compact-landscape .result-overview,.compact-landscape .result-details{min-width:0;min-height:0;overflow:auto;scrollbar-width:thin}
.compact-landscape .result-kicker{font-size:9px}
.compact-landscape .score-modal h2{font-size:19px;margin:4px 0}
.compact-landscape .result-limit{font-size:25px;line-height:1.2}
.compact-landscape .result-points{font-size:43px;line-height:1.15;margin-top:4px}
.compact-landscape .fu-han{font-size:11px;margin:5px 0}
.compact-landscape .winning-hand{margin:12px 0 5px;gap:4px 2px}
.compact-landscape .winning-hand .tile{width:21px;height:29px;padding:1px}
.compact-landscape .winning-hand .tile-number,.compact-landscape .winning-hand .tile-suit{font-size:12px}
.compact-landscape .winning-hand .honor{font-size:18px}
.compact-landscape .yaku-list{padding:0 5px}
.compact-landscape .yaku-list>div{padding:5px 0;font-size:12px}
.compact-landscape .yaku-list b{font-size:11px}
.compact-landscape .result-dora{margin:8px 0;gap:14px}
.compact-landscape .result-dora>span{font-size:10px;gap:6px}
.compact-landscape .result-details>.subtle{font-size:11px;margin:6px 0}
.compact-landscape .result-reaction{margin:8px 0 0;padding:7px;gap:8px}
.compact-landscape .result-reaction>.portrait{width:37px;height:49px}
.compact-landscape .result-reaction>blockquote{font-size:12px;line-height:1.5}
.compact-landscape .result-reaction>blockquote>span:first-child{font-size:10px;margin-bottom:3px}
.compact-landscape .result-footer{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:24px;padding-top:8px;border-top:1px solid var(--line)}
.compact-landscape .result-scores{margin:0;padding:0;border:0;gap:22px}
.compact-landscape .result-scores small{font-size:10px;margin-bottom:2px}
.compact-landscape .result-scores strong{font-size:21px}
.compact-landscape .result-footer .primary{min-height:42px;padding:8px;font-size:14px}
.compact-landscape .result-actions{gap:7px}
.compact-landscape .result-actions>button{min-height:42px;padding:8px 5px;font-size:14px;letter-spacing:0}
.compact-landscape .result-actions svg{display:none}
.compact-landscape .draw-symbol{font-size:48px;margin:8px 0}

/* Landscape cut-ins reserve the right half for the character's face. */
.compact-landscape .cutin{height:var(--view-height,100dvh)}
.compact-landscape .cutin .cutin-band{height:calc(var(--view-height,100dvh)*.73)}
.compact-landscape .cutin .cutin-art{width:52%;height:140%;right:0;top:-5%}
.compact-landscape .cutin.has-expressions .cutin-art{inset:0 0 0 auto;width:64%;height:100%;transform:skewY(5deg)}
.compact-landscape .cutin.has-expressions .cutin-art img{object-fit:contain;object-position:right center}
.compact-landscape .cutin .cutin-copy{inset:12px max(6%,env(safe-area-inset-left));justify-content:center}
.compact-landscape .cutin .cutin-copy>strong{font-size:clamp(40px,calc(var(--view-height,100dvh)*.17),85px);line-height:1.15}
.compact-landscape .cutin .cutin-copy>span{font-size:10px;letter-spacing:.12em}
.compact-landscape .cutin .cutin-copy>b{font-size:30px}
.compact-landscape .cutin .cutin-copy>p{font-size:13px;line-height:1.5;max-width:46%;margin-top:8px}
.compact-landscape .cutin .cutin-copy>p>small{font-size:10px}
.compact-landscape .cutin .cutin-gradient{background:linear-gradient(90deg,#101725 4%,#101725e6 32%,#18233318 65%,transparent)}
.compact-landscape .cutin.has-expressions.limit .cutin-gradient,.compact-landscape .cutin.has-expressions.high .cutin-gradient{background:linear-gradient(90deg,#241807 4%,#241807e6 32%,#291c1118 65%,transparent)}
.compact-landscape .cutin-skip{bottom:max(7px,env(safe-area-inset-bottom));font-size:11px}

/* Title, selection, and rewards use the same visible-height frame. */
.compact-landscape .opening-shell{display:grid;grid-template-rows:var(--bar-height) minmax(0,1fr) 20px}
.compact-landscape .opening-topbar{height:100%;width:100%;padding:0 8px}
.compact-landscape .opening-edition{font-size:11px}
.compact-landscape .opening{display:flex;height:100%;width:100%;min-height:0;max-height:none;padding:0}
.compact-landscape .opening-content{width:49%;padding:4px 20px;margin:0;max-width:none}
.compact-landscape .opening-logo-block{margin-bottom:10px}
.compact-landscape .opening-overline{font-size:12px;line-height:1.4;margin:0 0 2px;letter-spacing:.12em}
.compact-landscape .opening-logo>span{font-size:clamp(40px,calc(var(--view-height,100dvh)*.15),80px)}
.compact-landscape .opening-logo>strong{font-size:clamp(50px,calc(var(--view-height,100dvh)*.19),100px)}
.compact-landscape .opening-logo-rule{margin:4px 0 0;gap:10px}
.compact-landscape .opening-logo-rule>p{font-size:9px;letter-spacing:.3em}
.compact-landscape .opening-menu{gap:7px}
.compact-landscape .opening-mode{min-height:0;padding:7px 14px}
.compact-landscape .mode-copy{gap:2px}
.compact-landscape .mode-copy>small{display:none}
.compact-landscape .mode-copy>b{font-size:19px;line-height:1.3}
.compact-landscape .mode-upcoming .mode-copy>b{font-size:17px}
.compact-landscape .mode-copy>span{font-size:11px;line-height:1.3}
.compact-landscape .mode-arrow{width:30px;height:30px}
.compact-landscape .mode-status{font-size:10px;padding:4px}
.compact-landscape .opening-utilities{padding:4px 0 0;gap:20px}
.compact-landscape .opening-utilities .text-button{min-height:28px;font-size:11px}
.compact-landscape .opening-artwork{inset:0 -20px 0 45%;height:auto;gap:5px;transform:skewX(-7deg)}
.compact-landscape .opening-rival-name{font-size:21px;bottom:35px;right:15px}
.compact-landscape .opening-rival-name small{font-size:9px}
.compact-landscape .opening-footer{margin:0 12px;padding:2px 0;width:calc(100% - 24px)}
.compact-landscape .opening-footer>span,.compact-landscape .opening-footer>span:first-child{font-size:9px}
.compact-landscape .selection-shell{grid-template-rows:var(--bar-height) minmax(0,1fr) 18px}
.compact-landscape .selection{min-height:0;height:100%;grid-template-columns:minmax(130px,.72fr) minmax(0,1.28fr);gap:18px;padding:8px 0}
.compact-landscape .selection-art{min-height:0;height:100%;border:1px solid #e9c18c24}
.compact-landscape .selection-art>.portrait{height:100%;width:100%;top:0;aspect-ratio:auto}
.compact-landscape .selection-art .art-name{left:16px;bottom:16px;right:10px}
.compact-landscape .selection-art .art-name>strong,.compact-landscape .selection-art .art-name>strong.long-name{font-size:34px}
.compact-landscape .art-name>span{font-size:10px;letter-spacing:.06em}
.compact-landscape .art-name>em{font-size:11px;margin-top:3px}
.compact-landscape .art-corner{top:12px;left:14px;font-size:22px}
.compact-landscape .selection-art .vertical-caption{top:15px;right:12px;font-size:11px}
.compact-landscape .selection-panel{height:100%;min-height:0;padding:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto 54px minmax(0,1fr) 42px 28px;gap:5px 12px;align-self:stretch}
.compact-landscape .selection-panel>.section-kicker,.compact-landscape .selection-panel>.intro-copy,.compact-landscape .selection-panel>.reward-note{display:none}
.compact-landscape .selection-panel h1{grid-column:1/-1;font-size:24px;margin:0;line-height:1.3}
.compact-landscape .rival-options{grid-column:1/-1;grid-template-columns:repeat(var(--rival-count,4),minmax(0,1fr));gap:5px}
.compact-landscape .rival-option{min-height:0;flex-direction:column;justify-content:center}
.compact-landscape .rival-thumb{width:26px;flex:0 0 29px;height:29px}
.compact-landscape .rival-option>span{padding:0 2px}
.compact-landscape .rival-option small{display:none}
.compact-landscape .rival-option b{font-size:12px;margin-top:1px;letter-spacing:0;white-space:nowrap}
.compact-landscape .character-copy{grid-column:1/-1;padding:3px 0;overflow:auto;min-height:0;scrollbar-width:thin}
.compact-landscape .character-copy h2{font-size:13px}
.compact-landscape .character-copy p{font-size:12px;line-height:1.5;margin:4px 0 0}
.compact-landscape .character-copy blockquote{font-size:13px;line-height:1.5;margin:5px 0 0}
.compact-landscape .character-copy p.character-credit{font-size:10px;margin-top:4px}
.compact-landscape .match-options{padding:0;gap:6px;min-width:0}
.compact-landscape .match-options label{font-size:11px;white-space:nowrap}
.compact-landscape .match-options select{font-size:11px;padding:7px 4px;max-width:70%;min-width:0}
.compact-landscape .start-button{min-height:42px;font-size:13px;padding:8px 12px;gap:6px}
.compact-landscape .selection-bottom{grid-column:1/-1;padding:0}
.compact-landscape .selection-bottom .text-button{min-height:28px;font-size:11px}
.compact-landscape .selection-shell>footer{padding:1px 0;font-size:9px}
.compact-landscape .ending{height:100%;min-height:0;grid-template-columns:minmax(130px,.8fr) minmax(0,1fr);gap:24px;padding:8px 0}
.compact-landscape .ending-picture,.compact-landscape .ending-picture.has-standalone{height:100%;min-height:0;max-height:100%;align-self:stretch}
.compact-landscape .ending-asset{height:100%;aspect-ratio:auto}
.compact-landscape .ending-asset>.portrait{height:100%;aspect-ratio:auto}
.compact-landscape .ending-picture .portrait>img{object-fit:contain}
.compact-landscape .ending-picture .diptych-art>img{object-fit:fill}
.compact-landscape .ending-stamp{width:40px;height:49px;font-size:29px;right:12px;bottom:12px}
.compact-landscape .ending-copy{height:100%;min-height:0;display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto auto auto;gap:6px;padding:0}
.compact-landscape .ending-copy .section-kicker{font-size:10px;letter-spacing:.12em}
.compact-landscape .ending-copy h1{font-size:26px;margin:0;line-height:1.4}
.compact-landscape .ending-name{font-size:12px}
.compact-landscape .ending-copy blockquote{min-height:0;overflow:auto;font-size:14px;line-height:1.7;margin:4px 0}
.compact-landscape .end-scores{margin:0;padding:6px 0;gap:12px}
.compact-landscape .end-scores>span{flex-direction:row;align-items:baseline;font-size:11px;gap:8px}
.compact-landscape .end-scores b{font-size:20px}
.compact-landscape .ending-copy>.primary,.compact-landscape .ending-copy>.secondary{margin:0;min-height:36px;padding:6px 10px;font-size:12px}

.short-landscape{--hand-height:46px;--bar-height:30px;--river-width:15px;--river-height:21px}
.short-landscape .table-area{grid-template-rows:20px minmax(0,1fr) 16px auto;gap:3px}
.short-landscape .table{grid-template-rows:25px minmax(0,1fr);padding:4px 7px;gap:2px 8px}
.short-landscape .table-center{gap:4px}
.short-landscape .round-medallion{height:28px}
.short-landscape .points strong{font-size:19px}
.short-landscape .mobile-avatar{width:23px;height:25px}
.short-landscape .river .tile-number,.short-landscape .river .tile-suit{font-size:9px}
.short-landscape .river .honor{font-size:15px}
.short-landscape .river{gap:4px 2px;padding-top:2px}
.short-landscape .hand-zone{grid-template-rows:23px var(--hand-height)}
.short-landscape .hand .tile-number,.short-landscape .hand .tile-suit{font-size:16px}
.short-landscape .hand .honor{font-size:23px}
.short-landscape .opening-logo-block{margin-bottom:7px}
.short-landscape .opening-logo>span{font-size:40px}
.short-landscape .opening-logo>strong{font-size:52px}
.short-landscape .opening-logo-rule{display:none}
