/* V0.6.3: independent phone portrait and landscape compositions, original desktop kept. */
.display-toggle,.mobile-more,.current-play{display:none}
.mobile-tools[hidden]{display:none!important}
.mobile-tools{display:none}
html[data-mobile="true"],html[data-mobile="true"] body{height:100%;overflow:hidden;overscroll-behavior:none}
html[data-mobile="true"] .game-viewport{
 position:fixed;inset:0 auto auto 0;width:var(--stage-width);height:var(--stage-height);
 overflow:hidden;isolation:isolate;background:#071910;
 --safe-edge:max(env(safe-area-inset-left,0px),env(safe-area-inset-right,0px),env(safe-area-inset-bottom,0px));
 padding:env(safe-area-inset-top,0px) var(--safe-edge) env(safe-area-inset-bottom,0px);
}
/* Fallback rotates this newly composed game surface only; never the document or lobby. */
html[data-mobile="true"][data-simulated="true"] .game-viewport{transform-origin:0 0;transform:translateX(var(--viewport-width)) rotate(90deg)}
html[data-mobile="true"] #app{height:100%;display:flex;flex-direction:column;min-height:0}
html[data-mobile="true"] .header{height:42px;min-height:42px;padding:3px 8px;gap:5px;flex-wrap:nowrap}
html[data-mobile="true"] .brand{gap:6px;min-width:0}
html[data-mobile="true"] .brand-icon{width:27px;height:27px;font-size:21px;border-radius:8px}
html[data-mobile="true"] .brand-title{font-size:14px;white-space:nowrap;letter-spacing:0}
html[data-mobile="true"] .brand-desc{font-size:8px;max-width:160px;white-space:nowrap;overflow:hidden;letter-spacing:0}
html[data-mobile="true"] .head-controls{gap:5px;flex-wrap:nowrap;flex-shrink:0}
html[data-mobile="true"] .display-toggle,html[data-mobile="true"] .mobile-more{display:block;min-height:34px;font-size:11px;padding:5px 8px;white-space:nowrap}
html[data-mobile="true"] .main{width:100%;max-width:none;min-height:0;flex:1;display:block;margin:0;padding:3px 4px 4px}
html[data-mobile="true"] .board-panel{height:100%;min-height:0;display:grid;grid-template-rows:23px minmax(0,1fr) 198px;gap:3px;border-radius:12px;padding:4px}
html[data-mobile="true"] .board-meta{height:auto;min-height:0;padding:0 3px;font-size:10px;gap:4px}
html[data-mobile="true"] .board-meta .minor{display:none}
html[data-mobile="true"] .board-meta #prompt{font-size:9px;max-width:38%}
html[data-mobile="true"] .felt{
 height:auto;min-height:0;padding:6px;gap:4px;border-width:4px;border-radius:75px;
 grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) minmax(0,1fr);
 grid-template-rows:94px minmax(90px,1fr) 82px;
 --mini-width:18px;--mini-height:27px;
}
html[data-mobile="true"] .felt-line{inset:30px 11%;border-radius:50%;box-shadow:0 0 0 10px #ffffff06}
html[data-mobile="true"] .player{gap:3px;min-width:0}
html[data-mobile="true"] .player-header{width:100%;gap:3px;flex-direction:column;text-align:center}
html[data-mobile="true"] .player-header .avatar{width:23px;height:23px;font-size:12px;flex-shrink:0}
html[data-mobile="true"] .player-header b{font-size:10px;line-height:13px;max-width:100%}
html[data-mobile="true"] .player-header small{font-size:9px;line-height:11px;margin-top:1px;white-space:nowrap}
html[data-mobile="true"] .backs{height:18px;min-height:18px;width:100%}
html[data-mobile="true"] .backs .back{width:15px;height:18px;margin-left:-10px;border-radius:2px;flex-shrink:0}
html[data-mobile="true"] .backs .back:first-child{margin-left:0}
html[data-mobile="true"] .played{height:49px;min-height:49px;padding:1px 0 3px;gap:3px;scrollbar-width:none}
html[data-mobile="true"] .play-group{padding:3px;gap:2px;max-width:none;border-radius:5px}
html[data-mobile="true"] .play-name{font-size:8px;line-height:10px}
html[data-mobile="true"] .mini-card{margin-left:-6px;font-size:15px;box-shadow:0 2px 3px #0005}
html[data-mobile="true"] .mini-card:first-child{margin-left:0}
html[data-mobile="true"] .mini-card .corner{font-size:8px;left:2px;top:1px}
html[data-mobile="true"] .pass-chip{font-size:10px;padding:5px 6px}
html[data-mobile="true"] .pos-top .player-header{flex-direction:row;justify-content:center}
html[data-mobile="true"] .pos-top .player-header>div:last-child{width:auto;min-width:0}
html[data-mobile="true"] .self-seat{grid-column:2;grid-row:3;width:100%;min-width:0;align-self:end}
html[data-mobile="true"] .self-played{margin:0 auto 2px;height:48px;min-height:48px}
html[data-mobile="true"] .self-head{gap:4px}
html[data-mobile="true"] .self-head .avatar{width:22px;height:22px;font-size:12px;flex-shrink:0}
html[data-mobile="true"] .self-head b{font-size:10px;max-width:80px}
html[data-mobile="true"] .self-head .identity{font-size:8px;padding:2px 4px;margin:0 2px}
html[data-mobile="true"] .self-head small{font-size:8px;margin-top:1px}
html[data-mobile="true"] .self-head>div:last-child{min-width:0;flex:1;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:14px 11px;gap:0 2px;align-items:center}
html[data-mobile="true"] .self-head b{grid-column:1;grid-row:1;max-width:100%;font-size:10px;line-height:13px}
html[data-mobile="true"] .self-head small{grid-column:1;grid-row:2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:11px}
html[data-mobile="true"] .self-head .identity{grid-column:2;grid-row:1/3;max-width:52px;max-height:24px;white-space:normal;overflow:hidden;font-size:8px;line-height:10px}
html[data-mobile="true"] .middle{gap:3px;padding:0 2px;height:100%;max-height:100%;overflow-y:auto;scrollbar-width:none}
html[data-mobile="true"] .turn-pill{font-size:10px;padding:4px 6px;line-height:13px;flex-shrink:0}
html[data-mobile="true"] .table-type{font-size:12px;line-height:15px;flex-shrink:0}
html[data-mobile="true"] .table-explain{font-size:9px;line-height:12px;flex-shrink:0}
html[data-mobile="true"] .short-history{max-height:26px;min-height:0;gap:2px;flex-shrink:0}
html[data-mobile="true"] .short-history span{font-size:8px;line-height:11px;padding:1px 3px}
html[data-mobile="true"] .current-play{display:flex;justify-content:center;gap:2px;flex-shrink:0;min-height:0}
html[data-mobile="true"] .current-play:empty{display:none}
html[data-mobile="true"] .table-cards{display:none}
.current-card{display:grid;place-items:center;width:22px;height:29px;color:#17271d;background:#fff8e7;border-radius:3px;font-size:10px;font-weight:800;box-shadow:0 2px 4px #0019;white-space:nowrap}
.current-card.red{color:#bb3035}
html[data-mobile="true"] .hand-panel{margin:0;border-radius:10px;min-height:0;display:grid;grid-template-rows:38px minmax(0,1fr) 45px;gap:2px;padding:4px 6px}
html[data-mobile="true"] .hand-toolbar{font-size:11px;gap:2px;flex-wrap:wrap;align-content:center}
html[data-mobile="true"] .hand-toolbar span{font-size:10px;margin-left:4px}
html[data-mobile="true"] .inline-buttons{gap:4px;flex-wrap:nowrap}
html[data-mobile="true"] .inline-buttons .thin{padding:3px 6px;min-height:26px;font-size:10px}
html[data-mobile="true"] .my-hand{--preferred-hand-overlap:18;min-height:0;height:100%;padding:19px 3px 4px;overflow:hidden;align-items:end;--hand-overlap:-18px}
html[data-mobile="true"] .hand-card{flex-basis:47px;width:47px;height:78px;border-radius:6px}
html[data-mobile="true"] .hand-card .corner{font-size:12px;left:3px;top:5px}
html[data-mobile="true"] .hand-card .symbol{font-size:25px}
html[data-mobile="true"] .hand-card.selected{transform:translateY(-15px)}
html[data-mobile="true"] .actions{margin:0;padding:0;border:0;gap:4px;min-width:0;min-height:0}
html[data-mobile="true"] .hint{font-size:9px;line-height:12px;max-width:155px;display:block;max-height:36px;overflow:auto}
html[data-mobile="true"] .right-actions{gap:5px;flex-shrink:0}
html[data-mobile="true"] .action{min-width:62px;min-height:42px;font-size:13px;padding:7px 13px}
html[data-mobile="true"] footer{display:none}
html[data-mobile="true"] .mobile-tools{
 display:block;position:absolute;inset:3px;z-index:80;padding:12px;overflow:auto;border:1px solid #b79453;border-radius:12px;background:#0c241bf5;
}
.mobile-tools-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;color:#f0d697}
.mobile-tools-links{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px;align-items:center}
.display-settings{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;padding-block:10px;border-block:1px solid #31523f}
html[data-mobile="true"] .mobile-tools .sidebar{display:flex;gap:8px;margin-top:10px}
html[data-mobile="true"] .mobile-tools .side-card{padding:12px}
html[data-mobile="true"] .mobile-tools .events{max-height:180px}
html[data-mobile="true"] .overlay{position:absolute;inset:0;padding:6px}
html[data-mobile="true"] .dialog,html[data-mobile="true"] .dialog:has(.own-hand-pool){width:min(760px,100%);max-width:100%;max-height:100%;padding:10px}
html[data-mobile="true"] .dialog-top{position:relative;padding:0 98px 7px 0;min-height:46px}
html[data-mobile="true"] .dialog-display-toggle{position:absolute;top:0;right:0}
html[data-mobile="true"] .dialog h2{font-size:16px;line-height:20px;margin-top:3px}
html[data-mobile="true"] .dialog-body{padding:8px 0;font-size:12px;scrollbar-width:thin}
html[data-mobile="true"] .dialog-actions{padding-top:6px;background:#102a1e;position:relative;z-index:1;min-height:46px}
html[data-mobile="true"] .dialog-actions button{min-height:42px;padding:8px 13px}
html[data-mobile="true"] .pool.own-hand-pool{grid-template-columns:repeat(auto-fit,minmax(43px,1fr));gap:8px 5px;justify-content:start;padding-top:8px}
html[data-mobile="true"] .pool .pick-card{width:100%;min-width:0;max-width:58px;height:74px;flex-basis:43px;padding:4px!important}
html[data-mobile="true"] .pool .pick-card .pick-rank{font-size:13px}
html[data-mobile="true"] .pool .pick-card .pick-suit{font-size:23px}
html[data-mobile="true"] .reference-hand-panel{padding:7px;margin:4px 0 10px}
html[data-mobile="true"] .reference-hand-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(32px,1fr));gap:5px}
html[data-mobile="true"] .reference-hand-card{width:100%;max-width:45px;height:55px;flex-basis:32px;padding:3px}
html[data-mobile="true"] .reference-hand-card .pick-rank{font-size:11px}
html[data-mobile="true"] .reference-hand-card .pick-suit{font-size:18px}
html[data-mobile="true"] .reference-hand-title,html[data-mobile="true"] .reference-pool-title{font-size:11px;line-height:15px;margin-bottom:5px}
/* Landscape is a fresh horizontal arrangement: side seats span the felt; actions have a rail. */
html[data-mobile="true"][data-layout="landscape"] .header{height:32px;min-height:32px;padding-block:1px}
html[data-mobile="true"][data-layout="landscape"] .brand-icon{width:23px;height:23px;font-size:18px}
html[data-mobile="true"][data-layout="landscape"] .brand-desc{display:none}
html[data-mobile="true"][data-layout="landscape"] .display-toggle,html[data-mobile="true"][data-layout="landscape"] .mobile-more{min-height:28px}
html[data-mobile="true"][data-layout="landscape"] .board-panel{grid-template-rows:20px minmax(0,1fr) 122px;padding:2px 4px;gap:2px}
html[data-mobile="true"][data-layout="landscape"] .felt{
 border-radius:110px;grid-template-columns:minmax(0,1fr) minmax(0,2.2fr) minmax(0,1fr);
 grid-template-rows:48px minmax(58px,1fr) 44px;padding:4px;gap:3px;--mini-width:17px;--mini-height:25px;
}
html[data-mobile="true"][data-layout="landscape"] .pos-left,html[data-mobile="true"][data-layout="landscape"] .pos-right{grid-row:1/4;align-self:center}
html[data-mobile="true"][data-layout="landscape"] .pos-top{width:100%;display:grid;grid-template-columns:minmax(74px,.8fr) minmax(0,1.2fr);grid-template-rows:26px 17px;gap:1px 4px}
html[data-mobile="true"][data-layout="landscape"] .pos-top .player-header{grid-column:1;grid-row:1}
html[data-mobile="true"][data-layout="landscape"] .pos-top .backs{grid-column:1;grid-row:2;height:15px;min-height:15px}
html[data-mobile="true"][data-layout="landscape"] .pos-top .played{grid-column:2;grid-row:1/3}
html[data-mobile="true"][data-layout="landscape"] .played{height:44px;min-height:44px;padding-bottom:1px}
html[data-mobile="true"][data-layout="landscape"] .play-group{padding:2px 3px;gap:1px}
html[data-mobile="true"][data-layout="landscape"] .play-name{line-height:9px}
html[data-mobile="true"][data-layout="landscape"] .self-seat{display:grid;grid-template-columns:minmax(0,1fr) minmax(85px,1fr);gap:5px;align-items:center}
html[data-mobile="true"][data-layout="landscape"] .self-head{grid-column:2;grid-row:1}
html[data-mobile="true"][data-layout="landscape"] .self-played{grid-column:1;grid-row:1;margin:0;height:44px;min-height:44px}
html[data-mobile="true"][data-layout="landscape"] .self-head .identity{font-size:8px}
html[data-mobile="true"][data-layout="landscape"] .middle{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto auto;gap:1px 4px;align-content:center;justify-items:center}
html[data-mobile="true"][data-layout="landscape"] .turn-pill{grid-column:1;grid-row:1;font-size:10px;padding:2px 6px;line-height:13px}
html[data-mobile="true"][data-layout="landscape"] .table-type{grid-column:1;grid-row:2;font-size:11px;line-height:12px}
html[data-mobile="true"][data-layout="landscape"] .current-play{grid-column:2;grid-row:1/3;align-self:center}
html[data-mobile="true"][data-layout="landscape"] .current-card{width:19px;height:26px;font-size:9px}
html[data-mobile="true"][data-layout="landscape"] .table-explain{grid-column:1/-1;grid-row:3;line-height:11px}
html[data-mobile="true"][data-layout="landscape"] .short-history{grid-column:1/-1;grid-row:4;max-height:12px;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;width:100%}
html[data-mobile="true"][data-layout="landscape"] .short-history span{white-space:nowrap;flex-shrink:0}
html[data-mobile="true"][data-layout="landscape"] .hand-panel{grid-template-columns:minmax(0,1fr) 137px;grid-template-rows:25px minmax(0,1fr);gap:1px 8px;padding:3px 6px}
html[data-mobile="true"][data-layout="landscape"] .hand-toolbar{grid-column:1;grid-row:1;flex-wrap:nowrap}
html[data-mobile="true"][data-layout="landscape"] .my-hand{grid-column:1;grid-row:2;padding-top:16px;--preferred-hand-overlap:14}
html[data-mobile="true"][data-layout="landscape"] .hand-card{flex-basis:48px;width:48px;height:68px}
html[data-mobile="true"][data-layout="landscape"] .hand-card .symbol{font-size:25px}
html[data-mobile="true"][data-layout="landscape"] .actions{grid-column:2;grid-row:1/3;display:flex;flex-direction:column-reverse;justify-content:center;gap:3px}
html[data-mobile="true"][data-layout="landscape"] .right-actions{width:100%;gap:5px}
html[data-mobile="true"][data-layout="landscape"] .action{min-width:0;flex:1;padding:8px 10px;min-height:44px}
html[data-mobile="true"][data-layout="landscape"] .hint{max-width:100%;font-size:9px;line-height:11px;max-height:24px}
html[data-mobile="true"][data-layout="landscape"] .reference-hand-cards{grid-template-columns:repeat(13,minmax(0,1fr))}
html[data-mobile="true"][data-layout="landscape"] .reference-hand-card{max-width:48px;height:48px}
html[data-mobile="true"][data-layout="landscape"] .pool.own-hand-pool{grid-template-columns:repeat(auto-fit,minmax(40px,1fr))}
html[data-mobile="true"][data-layout="landscape"] .pool .pick-card{height:60px;max-width:50px}
html[data-mobile="true"][data-layout="landscape"] .dialog-body{font-size:11px;line-height:1.5}
html[data-mobile="true"][data-layout="landscape"] .dialog-body p{margin:3px 0 6px}
@media(prefers-reduced-motion:reduce){.hand-card,.pool .pick-card{transition:none}}
html[data-mobile="true"][data-layout="portrait"][data-compact-height="true"] .header{height:36px;min-height:36px}
html[data-mobile="true"][data-layout="portrait"][data-compact-height="true"] .brand-desc{display:none}
html[data-mobile="true"][data-layout="portrait"][data-compact-height="true"] .board-panel{grid-template-rows:21px minmax(0,1fr) 184px}
html[data-mobile="true"][data-layout="portrait"][data-compact-height="true"] .hand-panel{grid-template-rows:34px minmax(0,1fr) 42px}
html[data-mobile="true"][data-layout="portrait"][data-compact-height="true"] .hand-card{height:66px}
/* Receive keeps the complete reference row and selectable pool visible together. */
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;align-content:start;padding-block:4px}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.picker-intro{grid-column:1;grid-row:1;font-size:11px!important;line-height:15px;margin:0}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.picker-note{grid-column:2;grid-row:1;font-size:9px!important;line-height:15px!important;margin:0;align-self:center}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.reference-hand-panel{grid-column:1/-1;grid-row:2;padding:5px;margin:0}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel) .reference-hand-card{height:42px}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.picker-tip{grid-column:1/-1;grid-row:3;font-size:9px!important;line-height:12px!important;padding:3px 6px;margin:0}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.reference-pool-title{grid-column:1;grid-row:4;margin:0;font-size:10px;line-height:15px}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.pool{grid-column:1/-1;grid-row:5;margin:6px 0 2px}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.pick-footer{grid-column:2;grid-row:4;font-size:10px;line-height:15px;align-self:center}
html[data-mobile="true"][data-layout="landscape"] .dialog-body:has(.reference-hand-panel)>.banner-error{grid-column:1/-1;grid-row:6}
