html.hand-playing,html.hand-playing body{overflow:hidden!important;height:100%}
#handRoot{position:fixed;inset:0;z-index:2200;display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100dvh;color:#f5ecd9;background:radial-gradient(ellipse at top,#173659,#080f22 65%);font-family:inherit;--hn-gold:#e5c482;--hn-cyan:#58dbe4;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#handRoot *{box-sizing:border-box}#handRoot button,#handRoot select{font:inherit}#handRoot button{cursor:pointer;touch-action:manipulation}#handRoot button:disabled{opacity:.45;cursor:default}#handRoot button:focus-visible{outline:3px solid #6fe5eb;outline-offset:2px}
#handRoot .hn-top{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px;border-bottom:1px solid #c8a66455;background:#0a172c;min-height:56px;font-size:13px}
#handRoot .hn-brand{display:flex;gap:10px;align-items:center}#handRoot .hn-brand img{width:38px;height:38px;border-radius:10px}#handRoot .hn-brand b{display:block;color:#efd390;font-size:19px}#handRoot small{display:block;font-size:11px;color:#b8c9df}#handRoot .hn-top button{background:#1a2a43;border:1px solid #be9d6555;border-radius:12px;width:40px;height:40px;color:#e8d9b8}
#handRoot .hn-lobby-wrap{display:grid;place-items:center;padding:16px;overflow:auto}#handRoot .hn-lobby{width:min(680px,94vw);padding:24px;border:1px solid #d9b77866;border-radius:24px;background:linear-gradient(145deg,#181e2b,#0b0f19);box-shadow:0 24px 70px #0009;text-align:center}
#handRoot .hn-lobby-title img{width:66px;height:66px;border-radius:18px}#handRoot h1{font-size:25px;color:#efd390;margin:10px}#handRoot p{margin:10px}#handRoot .hn-seats{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin:18px 0}#handRoot .hn-seats>div{background:#1a2c43;border:1px solid #7088a633;border-radius:14px;padding:10px 18px}#handRoot .hn-lobby-options{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}#handRoot select{display:block;background:#15253d;color:#f0e8d7;border:1px solid #a4885355;border-radius:10px;padding:8px;min-height:44px;margin-top:6px}#handRoot .hn-muted{color:#afbed2;font-size:13px}#handRoot .hn-gold{background:linear-gradient(120deg,#f3dda0,#c69a49)!important;color:#17243d!important;border:1px solid #efd69a!important;min-height:44px;padding:10px 24px;border-radius:12px;font-weight:700;box-shadow:inset 0 1px #fff7cd,0 4px 12px #0003}#handRoot #hnStart{width:100%;margin:10px 0}#handRoot .hn-rules{margin:14px 0;font-size:12px;text-align:right;color:#becbe0}#handRoot .hn-rules div{line-height:1.9;padding:10px}#handRoot .hn-results{display:grid;gap:9px;margin:20px 0}#handRoot .hn-results>div{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#1a2b44;border-radius:12px;padding:14px}
#handRoot .hn-table{min-height:0;margin:9px 12px 0;border:4px solid #172741;border-radius:65px 65px 24px 24px;box-shadow:0 0 0 1px #c7a86b88,inset 0 0 0 1px #efd49a66,inset 0 0 44px #02091f;background:radial-gradient(ellipse at 50% 35%,#23617855,transparent 63%),repeating-linear-gradient(35deg,#ffffff03 0 1px,transparent 1px 4px),linear-gradient(145deg,#142e4b,#0a1932 70%);padding:12px 18px 6px;display:grid;grid-template-rows:auto minmax(40px,1fr) auto auto auto auto auto;gap:6px}
#handRoot .hn-opponents{display:flex;justify-content:space-around;gap:8px}#handRoot .hn-player{display:flex;gap:7px;align-items:center;font-size:12px;padding:5px 12px;border:1px solid transparent;border-radius:16px}#handRoot .hn-avatar{display:grid;place-items:center;width:35px;height:35px;background:#162d4a;border:1px solid #ba9a5d;border-radius:50%;font-size:21px}#handRoot .hn-player.active{border-color:#5bdddf;background:#2ad6de13}#handRoot .hn-board{min-height:0;overflow:auto;display:flex;flex-wrap:wrap;gap:15px 22px;justify-content:center;align-content:center;padding:8px;scrollbar-width:thin}#handRoot .hn-table-mark{color:#d4b97955;letter-spacing:2px;text-align:center;font-size:24px;margin:auto}#handRoot .hn-table-mark small{font-size:13px;color:#72b7c477}
#handRoot .hn-card{display:inline-block;position:relative;flex-shrink:0;width:58px;height:82px;border:1px solid #d1c9b8;border-radius:7px;background:linear-gradient(115deg,#fffefa,#f0eee5);color:#182027;box-shadow:1px 4px 7px #0007;font-family:Georgia,'Times New Roman',serif;vertical-align:middle;padding:0}#handRoot .hn-card.red{color:#b02632}#handRoot .hn-corner{position:absolute;left:4px;top:4px;font-size:18px;text-align:center;line-height:1.02}#handRoot .hn-bottom{top:auto;left:auto;right:4px;bottom:4px;transform:rotate(180deg)}#handRoot .hn-pip{position:absolute;inset:22px 15px;display:grid;place-items:center;font-size:30px}#handRoot .hn-meld{direction:ltr;border:0;background:none;position:relative;padding:0 0 14px;color:#cdd9ea}#handRoot .hn-meld .hn-card+.hn-card{margin-left:-31px}#handRoot .hn-meld small{position:absolute;bottom:0;left:0;right:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:10px}#handRoot .hn-board.target .hn-meld{outline:2px solid #50dfe5;outline-offset:3px;border-radius:8px}
#handRoot .hn-piles{display:flex;align-items:center;justify-content:center;gap:24px}#handRoot .hn-pile{background:none;border:0;color:#b9c9df;padding:0;text-align:center}#handRoot .hn-pile small{margin-top:4px}#handRoot .hn-back{display:grid;place-items:center;width:58px;height:82px;border:3px solid #e8d4a8;outline:1px solid #91876a;border-radius:7px;background:#091b3b;box-shadow:2px 2px #c4baa2,4px 4px #3b465b,6px 6px #c4baa2;overflow:hidden}#handRoot .hn-back img{width:100%;height:auto}#handRoot .hn-empty{display:grid;place-items:center;width:58px;height:82px;border:1px dashed #a9b6c466;border-radius:7px}#handRoot .hn-turn{font-size:15px;color:#e8d5a8;text-align:center}#handRoot .hn-turn small{margin-top:5px}
#handRoot .hn-handline{display:flex;justify-content:space-between;font-size:12px;color:#64dfe4;border-top:1px solid #a8b9ce22;padding-top:4px}#handRoot .hn-hand{direction:ltr;display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));padding:17px 37px 0 0;margin:0 auto;width:min(100%,900px);min-height:100px}#handRoot .hn-hand .hn-card{width:70px;height:94px;transition:transform .15s ease}#handRoot .hn-hand .hn-card.chosen{transform:translateY(-14px);outline:3px solid #50dbe1;z-index:10;box-shadow:0 0 15px #27d7e03b,1px 5px 10px #0008}#handRoot .hn-draft{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;font-size:11px;color:#f0d398}#handRoot .hn-draft span{padding:2px 8px;background:#b4984933;border-radius:6px}#handRoot .hn-notice{font-size:12px;min-height:16px;text-align:center;color:#f1d393}#handRoot .hn-tools{display:flex;gap:8px;justify-content:center;align-items:center;padding:9px 12px;background:#08162d}#handRoot .hn-tools button{min-height:42px;border:1px solid #667892;border-radius:11px;background:linear-gradient(#213751,#162740);color:#e5edf8;padding:8px 13px;font-size:12px;white-space:nowrap}
@media(orientation:landscape) and (max-height:550px){#handRoot .hn-top{min-height:42px;padding:3px 12px}#handRoot .hn-brand img{width:30px;height:30px}#handRoot .hn-brand b{font-size:15px}#handRoot .hn-top button{width:34px;height:34px}#handRoot .hn-table{margin-top:5px;padding:5px 15px 3px;gap:3px;border-radius:45px 45px 20px 20px}#handRoot .hn-avatar{width:27px;height:27px;font-size:17px}#handRoot .hn-player{padding:2px 7px}#handRoot .hn-piles{gap:18px}#handRoot .hn-piles .hn-card,#handRoot .hn-back,#handRoot .hn-empty{width:42px;height:56px}#handRoot .hn-piles .hn-corner{font-size:13px}#handRoot .hn-piles .hn-pip{inset:14px 10px;font-size:22px}#handRoot .hn-meld .hn-card{width:40px;height:54px}#handRoot .hn-meld .hn-card+.hn-card{margin-left:-19px}#handRoot .hn-meld .hn-corner{font-size:13px;left:2px;top:2px}#handRoot .hn-meld .hn-bottom{display:none}#handRoot .hn-meld .hn-pip{font-size:19px;inset:15px 10px}#handRoot .hn-board{padding:3px;gap:6px 16px}#handRoot .hn-hand{min-height:80px;padding-top:14px}#handRoot .hn-hand .hn-card{height:68px;width:58px}#handRoot .hn-tools{padding:5px 10px}#handRoot .hn-tools button{min-height:36px;padding:6px 11px}#handRoot .hn-notice{font-size:11px;min-height:13px}#handRoot .hn-lobby{padding:12px 22px}#handRoot .hn-lobby-title img{display:none}#handRoot .hn-seats{margin:10px 0}}
@media(orientation:portrait){#handRoot .hn-table{margin:7px;padding:12px 8px 6px;border-radius:32px 32px 20px 20px}#handRoot .hn-player{flex-direction:column;padding:3px;font-size:11px;text-align:center}#handRoot .hn-opponents{gap:3px}#handRoot .hn-hand{grid-template-columns:repeat(7,minmax(0,1fr));gap:12px 0;padding-right:20px}#handRoot .hn-hand .hn-card{width:52px;height:76px}#handRoot .hn-tools{flex-wrap:wrap;gap:6px}#handRoot .hn-tools button{padding:7px 9px;font-size:11px}#handRoot .hn-turn{font-size:12px}#handRoot .hn-piles{gap:12px}#handRoot .hn-top{font-size:11px;padding:6px 10px}#handRoot .hn-lobby{padding:18px}#handRoot .hn-results>div{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){#handRoot .hn-card{transition:none!important}}

/* Private arrangement: independent of turn and server melds. */
#handRoot .hn-private-hand{display:flex;flex-wrap:wrap;align-content:center;gap:10px;overflow:auto;min-height:80px;touch-action:none;direction:ltr;padding:14px 8px!important;}
#handRoot .hn-private-group{display:flex;flex-wrap:nowrap;align-items:center;padding:5px 9px;border:1px solid #d3b76b55;border-radius:12px;background:#06172c55;gap:0;}
#handRoot .hn-private-group .hn-card{margin:0 0 0 -18px!important;flex-shrink:0;transform:none;}
#handRoot .hn-private-group .hn-card:first-child{margin-left:0!important;}
#handRoot .hn-private-group .hn-card.chosen{transform:translateY(-9px);}
#handRoot .hn-private-hand.dragging{outline:2px dashed #67d9db;}
#handRoot .hn-tools{flex-wrap:wrap;gap:5px;padding:6px;}
#handRoot .hn-tools button{padding:8px 10px;min-height:36px;}
#handRoot .hn-lobby-options{flex-wrap:wrap;}
.hn-ledger{overflow:auto;max-height:35vh;margin:12px 0;}
.hn-ledger table{border-collapse:collapse;width:100%;font-size:14px;text-align:center;}
.hn-ledger td,.hn-ledger th{padding:9px;border-bottom:1px solid #d3b76b55;white-space:nowrap;}
.hn-dialog{color:#eee;background:#10263c;border:1px solid #d3b76b;border-radius:16px;max-width:90vw;max-height:85vh;width:650px;}
.hn-dialog::backdrop{background:#0009;}
@media(max-height:500px){#handRoot .hn-private-group .hn-card{width:45px;height:63px;}#handRoot .hn-tools button{font-size:11px;padding:5px 8px;min-height:29px;}#handRoot .hn-private-hand{gap:4px;}}
#handRoot .hn-private-group{max-width:100%;flex-wrap:wrap;row-gap:10px;box-sizing:border-box;}

#handRoot .hn-round-tools{display:flex;direction:rtl;align-items:center;gap:8px;flex-shrink:0;}
#handRoot .hn-round-tools #hnScore{width:auto;padding:0 10px;font:inherit;white-space:nowrap;}
#handRoot .hn-round-label{white-space:nowrap;}
@media(max-width:400px){#handRoot .hn-top{gap:5px;padding-inline:7px;}#handRoot .hn-brand{gap:4px;}#handRoot .hn-brand small{display:none;}#handRoot .hn-round-tools{gap:5px;}#handRoot .hn-round-tools #hnScore{padding:0 7px;}}

/* Keep the start of every hand reachable in short Safari viewports. */
#handRoot{box-sizing:border-box;overflow:hidden;}
#handRoot .hn-table{overflow:auto;overscroll-behavior:contain;grid-template-rows:auto minmax(40px,.4fr) auto auto minmax(110px,1fr) auto auto;}
#handRoot .hn-private-hand{align-content:flex-start;align-items:flex-start;min-width:0;min-height:110px;height:100%;margin:0 auto;touch-action:pan-y;overscroll-behavior:contain;}
#handRoot .hn-private-group{align-items:flex-start;gap:5px;padding:10px 6px 6px;}
#handRoot .hn-private-group .hn-card{margin:0!important;}
#handRoot .hn-round-tools #hnCancel{width:auto;min-width:48px;height:auto;min-height:36px;white-space:normal;}
@media(orientation:landscape) and (max-height:550px){
 #handRoot .hn-table{grid-template-rows:auto minmax(24px,.2fr) auto auto minmax(90px,1fr) auto auto;}
 #handRoot .hn-private-hand{min-height:90px;}
 #handRoot .hn-table-mark{font-size:16px;}
}

/* Reserve a full meld row including its owner label. */
#handRoot .hn-table:has(.hn-meld){grid-template-rows:auto minmax(120px,.4fr) auto auto minmax(110px,1fr) auto auto;}
#handRoot .hn-board:has(.hn-meld){align-content:flex-start;}
#handRoot .hn-meld{flex-shrink:0;white-space:nowrap;}
@media(orientation:landscape) and (max-height:550px){#handRoot .hn-table:has(.hn-meld){grid-template-rows:auto minmax(80px,.2fr) auto auto minmax(90px,1fr) auto auto;}}

/* v100: keep card typography independent of mobile text autosizing. */
@media(max-width:600px),(max-height:550px) and (pointer:coarse){
 #handRoot .hn-card{direction:ltr;-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow:hidden;isolation:isolate}
 #handRoot .hn-card .hn-corner{font-family:Georgia,'Times New Roman',serif;font-size:14px!important;font-weight:400;line-height:1!important;letter-spacing:0;left:3px;top:3px}
 #handRoot .hn-card .hn-bottom{left:auto;top:auto;right:3px;bottom:3px}
 #handRoot .hn-card .hn-pip{font-family:Georgia,'Times New Roman',serif;font-size:22px!important;line-height:1;inset:0;display:grid;place-items:center;pointer-events:none}
 #handRoot .hn-private-group .hn-card{box-shadow:0 2px 3px #0005;background:#fffdf7}
}

/* Shared vector suits stay sharp and consistent across WebView and browsers. */
#handRoot .hn-suit{display:block;width:1em;height:1em;flex:none;overflow:visible}
#handRoot .hn-corner .hn-suit{width:.72em;height:.72em;margin:1px auto 0}
#handRoot .hn-pip .hn-suit{width:1em;height:1em}
#handRoot .hn-brand>div{position:relative;padding-inline-end:35px}
#handRoot .hn-top #hnHelp{position:absolute;inset-inline-end:0;top:0;width:30px;height:30px;min-height:30px;font-size:18px;color:#72e3e3;border-color:#72e3e366;border-radius:50%}
.hn-help-dialog{width:min(560px,94vw);max-height:85dvh;box-sizing:border-box;padding:18px;color:#edf2fa;background:#10253d;border:1px solid #c8ab71;border-radius:20px;font-family:inherit;overflow:auto}
.hn-help-dialog::backdrop{background:#020817c9}
.hn-help-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hn-help-dialog h2{margin:0;font-size:22px;color:#f0d391}
.hn-help-dialog header button{width:44px;height:44px;font-size:27px;color:#fff;background:#203851;border:1px solid #6f8199;border-radius:12px;flex-shrink:0}
.hn-help-dialog p{font-size:15px;line-height:1.9;margin:12px 0;color:#d3deeb}
.hn-help-dialog details{border:1px solid #526b8255;border-radius:12px;padding:10px 12px;margin:8px 0}
.hn-help-dialog summary{cursor:pointer;font-size:16px;min-height:30px;color:#f4dba2}
.hn-help-picture{display:grid;justify-items:center;gap:6px;background:#07192c;padding:14px;border-radius:10px;margin-top:10px;color:#78e2df}
.hn-help-picture>div{display:flex;gap:7px;direction:ltr}
.hn-help-card{display:flex;flex-direction:column;align-items:center;justify-content:center;width:44px;height:60px;border-radius:5px;background:#fffdf5;color:#152330;font:18px Georgia,serif;box-shadow:0 2px 4px #0005}
.hn-help-card.red{color:#b02632}.hn-help-card svg{width:21px;height:21px}.hn-help-arrow{font-size:22px}

/* v111: tablet card sizing and isolated suit placement. */
@media(min-width:601px) and (min-height:600px) and (pointer:coarse){
 #handRoot .hn-card{direction:ltr;-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow:hidden;isolation:isolate}
 #handRoot .hn-private-group .hn-card{width:82px;height:116px;background:#fffdf7;box-shadow:0 2px 4px #0005}
 #handRoot .hn-card .hn-corner{font-family:Georgia,'Times New Roman',serif;font-size:18px!important;font-weight:400;line-height:1!important;letter-spacing:0;left:4px;top:4px}
 #handRoot .hn-card .hn-bottom{left:auto;top:auto;right:4px;bottom:4px}
 #handRoot .hn-card .hn-pip{font-size:28px!important;line-height:1;inset:0;display:grid;place-items:center;pointer-events:none}
 #handRoot .hn-card .hn-pip .hn-suit{width:28px;height:28px}
 #handRoot .hn-card .hn-corner .hn-suit{width:12px;height:12px}
 #handRoot .hn-tools button{font-size:16px;min-height:46px;padding:10px 14px}
}

/* v112: intrinsic wrapped rows in Safari and visible card selection. */
#handRoot .hn-private-group{flex:0 0 auto;max-width:100%;height:auto;align-self:flex-start}
#handRoot .hn-private-hand{height:auto;align-content:flex-start;scroll-padding-top:14px}
#handRoot .hn-private-group .hn-card.chosen{transform:none;outline:3px solid #50dbe1;outline-offset:-3px}
#handRoot #hnPrepareAll{border-color:#58dbe499;color:#8aefeb}

/* v113: clear turn owner and primary actions on phones and tablets. */
#handRoot .hn-turn{flex:1;min-width:0;max-width:240px;padding:6px 7px;border:1px solid #e5c48288;border-radius:14px;background:#09182c}
#handRoot .hn-turn strong{display:block;font-size:clamp(16px,2.2vw,20px);line-height:1.25;color:#ffe8a8;overflow-wrap:anywhere}
#handRoot .hn-turn small{font-size:clamp(11px,1.5vw,13px);line-height:1.35;color:#dfebf7}
#handRoot .hn-turn.hn-your-turn{border:1px solid #65efe0;background:#103638;box-shadow:0 0 16px #3addca22}
#handRoot .hn-your-turn strong{color:#83ffdf}
#handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{font-size:clamp(20px,2.8vw,26px);font-weight:800;min-height:56px;min-width:170px;padding:12px 24px}
#handRoot .hn-tools #hnFinish{background:linear-gradient(120deg,#8cffe0,#24cdbb)!important;border-color:#afffea!important;color:#062c2d!important}
#handRoot #hnFinish[hidden]{display:none!important}
@media(orientation:landscape) and (max-height:550px){#handRoot .hn-turn{padding:5px 8px}#handRoot .hn-turn strong{font-size:16px}#handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{font-size:20px;min-height:46px;padding:8px 18px}}

/* v115: vector court portraits stay crisp at every screen density. */
#handRoot .hn-card .hn-pip.hn-face{inset:3% 21%;overflow:hidden}#handRoot .hn-court{display:block;width:100%;height:100%;pointer-events:none}#handRoot .hn-card .hn-corner{z-index:1}

/* v117 larger readable cards and clear court suits. */
#handRoot .hn-private-group .hn-card{width:80px;height:110px}#handRoot .hn-card .hn-corner .hn-suit{width:16px;height:16px}#handRoot .hn-court-suit{position:absolute;bottom:4px;left:50%;transform:translateX(-50%);display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#fffdf7;border:1px solid #d1c9b8;z-index:2;pointer-events:none}#handRoot .hn-court-suit .hn-suit{width:19px;height:19px}#handRoot .hn-ready-badge{color:#8cffe0;font-weight:700}#handRoot .hn-ready-badge[hidden]{display:none}#handRoot .hn-handline{flex-wrap:wrap;gap:5px}
@media(max-width:600px){#handRoot .hn-private-group .hn-card{width:60px;height:86px}#handRoot .hn-card .hn-corner{font-size:17px!important}#handRoot .hn-card .hn-corner .hn-suit{width:14px;height:14px}#handRoot .hn-court-suit{width:22px;height:22px;bottom:3px}#handRoot .hn-court-suit .hn-suit{width:17px;height:17px}}
@media(orientation:landscape) and (max-height:550px){#handRoot .hn-private-group .hn-card{width:54px;height:76px}}

/* v122: room for piles, larger distinct portraits and explicit finish choice. */
#handRoot .hn-piles{display:grid;grid-template-columns:max-content minmax(0,180px) max-content;justify-content:center;gap:clamp(8px,2vw,16px);width:100%;max-width:360px;margin-inline:auto;padding-inline:10px}
#handRoot .hn-turn{width:100%;max-width:180px;padding:5px 6px;border-radius:12px}
#handRoot .hn-turn strong{font-size:16px;line-height:1.2}
#handRoot .hn-turn small{font-size:11px;line-height:1.3;margin-top:3px}
#handRoot .hn-pile{min-width:44px;min-height:44px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#handRoot .hn-pile>*{pointer-events:none}
#handRoot .hn-card .hn-pip.hn-face{inset:2% 17%}
#handRoot .hn-court-suit{bottom:21px;width:20px;height:20px}
#handRoot .hn-court-suit .hn-suit{width:16px;height:16px}
#handRoot #hnContinue[hidden]{display:none!important}
#handRoot #hnContinue{color:#9bf4df;border-color:#57cbb9;min-height:44px}
@media(max-width:600px){#handRoot .hn-turn{max-width:165px}#handRoot .hn-turn strong{font-size:15px}#handRoot .hn-turn small{font-size:10px}#handRoot .hn-court-suit{bottom:17px;width:18px;height:18px}#handRoot .hn-court-suit .hn-suit{width:14px;height:14px}}
@media(orientation:landscape) and (max-height:550px){#handRoot .hn-piles{max-width:310px;padding-inline:10px;gap:12px}#handRoot .hn-turn strong{font-size:14px}#handRoot .hn-court-suit{bottom:15px;width:17px;height:17px}}

/* v123: approved heritage cartoons; dynamic vector suits remain separate. */
#handRoot .hn-card .hn-pip.hn-face{inset:2px 15%;border-radius:4px;overflow:hidden}
#handRoot .hn-card .hn-court{width:100%;height:100%}
#handRoot .hn-card .hn-corner{background:#fffdf7;border-radius:2px;padding:1px;z-index:3}
#handRoot .hn-court-suit{bottom:3px;width:23px;height:23px;background:#fffdf7;box-shadow:0 1px 3px #0004}
#handRoot .hn-court-suit .hn-suit{width:18px;height:18px}
#handRoot .hn-joker .hn-corner{font-size:11px!important;font-weight:bold}
@media(max-width:600px){#handRoot .hn-court-suit{width:21px;height:21px}#handRoot .hn-court-suit .hn-suit{width:17px;height:17px}}

/* v127: shared opening total and next required minimum. */
#handRoot .hn-handline>span:last-child{font-size:13px;line-height:1.6;text-align:right;max-width:100%;overflow-wrap:anywhere}#handRoot .hn-handline strong{color:#ffe29e;font-weight:800}#handRoot .hn-handline b{color:#e7edf6;font-weight:700}#handRoot .hn-opened-label{color:#64dfe4}
@media(min-width:601px){#handRoot .hn-handline>span:last-child{font-size:15px}}

/* v129: balanced felt table, full visible tools and readable private groups. */
#handRoot{background:radial-gradient(ellipse at 50% 15%,#163b52,#071223 70%)}
#handRoot .hn-top{display:grid;grid-template-columns:max-content max-content minmax(90px,1fr) max-content;gap:8px;padding:8px 12px;min-height:70px;direction:rtl}
#handRoot .hn-top #hnExit{grid-column:1;grid-row:1;width:78px!important;min-height:46px;height:auto;font-size:12px!important;padding:6px!important;white-space:normal!important}
#handRoot .hn-top .nl-host-end{grid-column:2;grid-row:1;width:58px!important;min-height:46px;height:auto;font-size:12px!important;padding:6px!important;white-space:normal!important}
#handRoot .hn-brand{grid-column:3;grid-row:1;justify-content:center;min-width:0;gap:5px}
#handRoot .hn-brand img{width:30px;height:30px;border-radius:8px;flex:none}
#handRoot .hn-brand>div{min-width:0;padding-inline-end:26px}
#handRoot .hn-brand b{font-size:20px;line-height:1.2}
#handRoot .hn-brand small{display:block;font-size:10px;line-height:1.35;overflow-wrap:anywhere}
#handRoot .hn-top #hnHelp{width:24px;height:24px;min-height:24px;font-size:16px}
#handRoot .hn-round-tools{grid-column:4;grid-row:1;display:flex;flex-direction:column;gap:4px;font-size:11px}
#handRoot .hn-round-tools #hnScore{min-height:32px;height:auto;padding:6px 9px;font-size:12px}
#handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){margin:8px 10px 0;border:2px solid #19374c;border-radius:24px;padding:10px 10px 6px;gap:8px;grid-template-rows:auto minmax(70px,.5fr) auto auto minmax(140px,1.1fr) auto auto;background:radial-gradient(ellipse at 50% 30%,#1d53624d,transparent 70%),repeating-linear-gradient(35deg,#ffffff02 0 1px,transparent 1px 4px),linear-gradient(145deg,#102c40,#091a2b)}
#handRoot .hn-opponents{justify-content:center;flex-wrap:wrap;gap:8px}
#handRoot .hn-player{flex-direction:row;gap:8px;min-height:46px;padding:5px 12px;border-radius:13px;background:#07172866;border-color:#bfa06833;text-align:right}
#handRoot .hn-player small{font-size:11px}
#handRoot .hn-avatar{width:30px;height:30px;font-size:19px}
#handRoot .hn-board,#handRoot .hn-board:has(.hn-meld){justify-content:center;align-content:center;gap:14px 18px;padding:6px;min-height:70px}
#handRoot .hn-meld{padding-bottom:20px;max-width:100%}
#handRoot .hn-meld small{background:#0c2138;border:1px solid #b7986055;border-radius:7px;padding:2px 6px;font-size:10px;line-height:1.2;max-width:100%;width:max-content;margin:auto}
#handRoot .hn-table-mark{font-size:18px;letter-spacing:0;color:#bca47438}
#handRoot .hn-piles{max-width:380px;grid-template-columns:70px minmax(0,170px) 70px;gap:12px;padding-inline:8px;justify-content:center;align-items:center}
#handRoot .hn-piles .hn-card,#handRoot .hn-back,#handRoot .hn-empty{width:64px;height:90px}
#handRoot .hn-pile small{font-size:11px;margin-top:6px}
#handRoot .hn-turn{max-width:170px;width:100%;padding:7px;border-radius:12px}
#handRoot .hn-turn strong{font-size:16px}
#handRoot .hn-turn small{font-size:11px}
#handRoot .hn-handline{align-items:center;gap:4px 10px;background:#061627aa;border:1px solid #bfa26555;border-radius:10px;padding:7px 9px;font-size:12px}
#handRoot .hn-handline>span:last-child{font-size:12px;line-height:1.5}
#handRoot .hn-private-hand{width:100%;margin:0;padding:6px 3px!important;gap:8px;justify-content:center;align-content:flex-start;min-height:140px;scroll-padding-top:8px}
#handRoot .hn-private-group{display:grid;grid-template-columns:repeat(var(--hn-cols),var(--hn-card-width,80px));gap:6px 5px;flex:0 0 auto;max-width:100%;padding:7px 6px;border-radius:12px;background:#0d353144;border:1px solid #c7ae6a88;align-items:start}
#handRoot .hn-private-group .hn-card{width:var(--hn-card-width,80px);height:110px}
#handRoot .hn-draft:empty{display:none}
#handRoot .hn-notice:empty{display:none}
#handRoot .hn-notice{font-size:12px;line-height:1.4;min-height:0}
#handRoot .hn-tools{padding:8px 10px;gap:6px;background:#07182c;border-top:1px solid #bfa26555}
#handRoot .hn-tools button{font-size:12px;min-height:38px;padding:8px 10px;border-radius:10px}
#handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{order:2;font-size:22px;min-height:50px;padding:10px 18px;min-width:170px}
#handRoot .hn-tools #hnUndo{order:3}
@media(max-width:600px){
 #handRoot{--hn-card-width:60px}
 #handRoot .hn-top{gap:5px;padding:7px;grid-template-columns:67px 48px minmax(80px,1fr) 65px}
 #handRoot .hn-top #hnExit{width:67px!important;font-size:11px!important}
 #handRoot .hn-top .nl-host-end{width:48px!important;font-size:11px!important}
 #handRoot .hn-brand img{width:25px;height:25px}
 #handRoot .hn-brand b{font-size:18px}
 #handRoot .hn-brand small{font-size:9px}
 #handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){margin:7px 7px 0;padding:8px 7px 4px;gap:7px}
 #handRoot .hn-piles{grid-template-columns:64px minmax(0,160px) 64px;gap:10px}
 #handRoot .hn-turn strong{font-size:15px}
 #handRoot .hn-turn small{font-size:10px}
 #handRoot .hn-private-group .hn-card{height:86px}
 #handRoot .hn-tools button{font-size:11px;padding:7px 9px;min-height:36px}
}
@media(orientation:landscape) and (max-height:550px){
 #handRoot{--hn-card-width:54px}
 #handRoot .hn-top{min-height:45px;padding:4px 10px}
 #handRoot .hn-top #hnExit,#handRoot .hn-top .nl-host-end{min-height:35px}
 #handRoot .hn-brand small{font-size:9px}
 #handRoot .hn-round-tools{flex-direction:row;align-items:center}
 #handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){grid-template-rows:auto minmax(55px,.4fr) auto auto minmax(80px,1fr) auto auto;gap:4px;padding:5px 9px 3px}
 #handRoot .hn-player{min-height:30px;padding:3px 8px}
 #handRoot .hn-avatar{width:24px;height:24px;font-size:16px}
 #handRoot .hn-board{min-height:55px;gap:8px}
 #handRoot .hn-piles{grid-template-columns:48px minmax(0,160px) 48px;gap:12px}
 #handRoot .hn-piles .hn-card,#handRoot .hn-back,#handRoot .hn-empty{width:44px;height:60px}
 #handRoot .hn-turn{padding:4px 6px}
 #handRoot .hn-turn strong{font-size:14px}
 #handRoot .hn-handline{padding:4px 8px}
 #handRoot .hn-private-hand{min-height:80px}
 #handRoot .hn-private-group .hn-card{height:76px}
 #handRoot .hn-tools{padding:5px;gap:5px}
 #handRoot .hn-tools button{min-height:32px;font-size:11px;padding:5px 8px}
 #handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{min-height:40px;font-size:19px;padding:6px 15px}
}

/* v130: reserve readable meld space and keep overflowing rows reachable. */
#handRoot .hn-table:has(.hn-meld){grid-template-rows:auto minmax(clamp(180px,30dvh,280px),.9fr) auto auto minmax(140px,1.1fr) auto auto}
#handRoot .hn-board:has(.hn-meld){align-content:flex-start;align-items:flex-start;min-height:180px;scroll-padding:8px;padding:8px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
#handRoot .hn-meld{flex:0 0 auto}
@media(orientation:landscape) and (max-height:550px){
 #handRoot .hn-table:has(.hn-meld){grid-template-rows:auto minmax(110px,.8fr) auto auto minmax(80px,1fr) auto auto}
 #handRoot .hn-board:has(.hn-meld){min-height:110px;padding:7px;gap:10px 16px}
}

/* v131: one reachable landscape table, with touch chaining from melds. */
@media(orientation:landscape) and (max-height:550px){
 #handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;touch-action:pan-y;-webkit-overflow-scrolling:touch;scroll-padding-block:8px}
 #handRoot .hn-table> *{flex:0 0 auto}
 #handRoot .hn-board,#handRoot .hn-board:has(.hn-meld){height:110px;min-height:110px;overflow-y:auto;overscroll-behavior-y:auto;touch-action:pan-y}
 #handRoot .hn-private-hand{height:auto;min-height:80px;overflow:visible;overscroll-behavior-y:auto;touch-action:pan-y}
 #handRoot .hn-meld{touch-action:pan-y}
}

/* Hand v158: one private row, contextual actions, fixed reachable table. */
#handRoot{--card-w:84px;--card-h:118px;--hand-h:145px;grid-template-rows:auto minmax(0,1fr) auto;background:radial-gradient(ellipse at 50% 25%,#16465e,#07172c 76%)}
#handRoot [hidden]{display:none!important}
#handRoot .hn-top{min-height:52px;padding:4px 12px;grid-template-columns:max-content max-content minmax(80px,1fr) max-content}
#handRoot .hn-top #hnExit,#handRoot .hn-top .nl-host-end{min-height:40px;width:70px!important;height:40px;font-size:11px!important}
#handRoot .hn-brand img{width:30px;height:30px}
#handRoot .hn-round-tools{flex-direction:row;align-items:center}
#handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){display:grid;grid-template-columns:minmax(0,1fr) 300px;grid-template-rows:42px minmax(65px,1fr) 30px var(--hand-h) auto auto;gap:5px 12px;margin:6px 10px 0;padding:6px 12px;border-radius:32px 32px 16px 16px;overflow:hidden;touch-action:auto;background:radial-gradient(ellipse at 50% 30%,#24647766,transparent 70%),repeating-linear-gradient(35deg,#ffffff03 0 1px,transparent 1px 4px),#0d293c}
#handRoot .hn-opponents{grid-area:1/1/2/3;flex-wrap:nowrap;min-width:0;justify-content:space-evenly}
#handRoot .hn-player{min-width:0;min-height:30px;padding:3px 10px;font-size:12px;max-width:32%;border-radius:20px}
#handRoot .hn-player>span:last-child{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#handRoot .hn-player.active{background:#1a686366;border-color:#76f5df;box-shadow:0 0 16px #51decb33}
#handRoot .hn-board,#handRoot .hn-board:has(.hn-meld){grid-area:2/1/3/2;min-height:0;height:auto;overflow:auto;align-content:flex-start;align-items:flex-start;padding:8px;gap:12px 18px;touch-action:pan-y;overscroll-behavior:contain}
#handRoot .hn-table-mark{margin:auto;align-self:center;color:#a4cbd14d;font-size:24px}
#handRoot .hn-meld .hn-card{width:48px;height:68px}
#handRoot .hn-meld .hn-card+.hn-card{margin-left:-24px}
#handRoot .hn-meld .hn-corner{font-size:14px!important}
#handRoot .hn-meld .hn-corner .hn-suit{width:11px;height:11px}
#handRoot .hn-piles{grid-area:2/2/3/3;align-self:center;grid-template-columns:64px minmax(0,1fr) 64px;max-width:100%;gap:8px;padding:0}
#handRoot .hn-piles .hn-card,#handRoot .hn-back,#handRoot .hn-empty{width:60px;height:84px}
#handRoot .hn-turn{background:transparent;border:0;box-shadow:none;padding:3px;max-width:100%}
#handRoot .hn-turn strong{font-size:15px;line-height:1.4}
#handRoot .hn-turn small{font-size:12px}
#handRoot .hn-pile{position:relative;opacity:1}
#handRoot .hn-pile:disabled{opacity:.65}
#handRoot .hn-pile[data-locked="0"]{filter:drop-shadow(0 0 7px #70eadf55)}
#handRoot .hn-handline{grid-area:3/1/4/3;min-height:0;padding:3px 8px;font-size:12px;background:transparent;border:0;border-top:1px solid #95c8cd33;flex-wrap:nowrap}
#handRoot .hn-handline>span:last-child{font-size:12px;line-height:1.2}
#handRoot .hn-handline>span{white-space:nowrap}
#handRoot .hn-private-hand{grid-area:4/1/5/3;display:block;height:var(--hand-h);min-height:0;width:100%;padding:20px 5px 4px!important;overflow-x:auto;overflow-y:hidden;touch-action:none;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#729baf #0b2133;scroll-padding:10px}
#handRoot .hn-private-group{display:flex;flex-wrap:nowrap;direction:ltr;width:max-content;max-width:none;height:var(--card-h);padding:0;border:0;background:none;border-radius:0;gap:0;margin-inline:auto}
#handRoot .hn-private-group .hn-card{width:var(--card-w);height:var(--card-h);margin:0!important;margin-left:calc(var(--step) - var(--card-w))!important;transform:none;border-radius:8px;touch-action:none;user-select:none;-webkit-user-select:none;transition:transform .14s,box-shadow .14s;overflow:hidden;box-shadow:1px 4px 7px #0008}
#handRoot .hn-private-group .hn-card:first-child{margin-left:0!important}
#handRoot .hn-private-group .hn-card .hn-corner{font-size:20px!important;left:3px;top:3px;padding:0;background:#fffdf7}
#handRoot .hn-private-group .hn-card .hn-bottom{left:auto;top:auto;right:3px;bottom:3px}
#handRoot .hn-private-group .hn-card .hn-corner .hn-suit{width:14px;height:14px}
#handRoot .hn-private-group .hn-card.chosen{transform:translateY(-16px);outline:3px solid #58e0e4;outline-offset:-3px;box-shadow:0 0 12px #58e0e466,1px 5px 10px #0008;z-index:1}
#handRoot .hn-private-group .hn-card.hn-valid{outline-color:#a7f5a9;box-shadow:0 0 12px #69db7c66}
#handRoot .hn-private-hand.dragging{outline:0}
#handRoot .hn-drag-card{opacity:.3}
#handRoot .hn-drag-ghost{position:fixed!important;pointer-events:none!important;z-index:100;width:var(--card-w)!important;height:var(--card-h)!important;transform:rotate(-5deg);box-shadow:0 15px 30px #0008}
#handRoot #hnFire.hn-drop-ready{outline:3px dashed #9af3d7;outline-offset:8px;border-radius:10px;background:#6de7c833}
#handRoot .hn-draft{grid-area:5/1/6/3;display:flex;flex-wrap:nowrap;overflow-x:auto;max-height:78px;justify-content:flex-start;gap:8px;min-width:0}
#handRoot .hn-draft:empty{display:none}
#handRoot .hn-draft .hn-pending{border:1px dashed #eacb7c;white-space:nowrap;opacity:.8;background:#e8bd5622}
#handRoot .hn-pending .hn-card{width:30px;height:42px;margin-inline-end:-10px;box-shadow:none}
#handRoot .hn-pending .hn-card:last-child{margin-inline-end:0}
#handRoot .hn-pending .hn-corner{font-size:10px!important;left:1px;top:1px}
#handRoot .hn-pending .hn-corner .hn-suit{width:8px;height:8px}
#handRoot .hn-pending .hn-bottom,#handRoot .hn-pending .hn-court-suit{display:none}
#handRoot .hn-notice{grid-area:6/1/7/3;font-size:12px;line-height:1.3;min-height:0;max-height:32px;overflow:auto}
#handRoot .hn-tools{flex-wrap:nowrap;min-height:58px;padding:5px 12px;gap:7px;background:#07182c;border-top:1px solid #6eaaac44}
#handRoot .hn-tools button{min-height:44px;font-size:13px;padding:6px 14px;order:0!important;min-width:0!important}
#handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{min-height:44px;font-size:18px;padding:6px 18px;min-width:0;order:0}
#handRoot #hnSelection{font-size:12px;color:#b1d8e2;flex:1;max-width:300px;line-height:1.4}
#handRoot .hn-arrived{animation:hnDrawIn .3s ease-out}
@keyframes hnDrawIn{from{transform:translateY(-50px) scale(.85);opacity:.2}to{transform:none;opacity:1}}
#handRoot .hn-dialog button{margin:5px;padding:10px 16px;min-height:44px;border-radius:10px;border:1px solid #70a2b0;background:#183c51;color:#fff}
@media(max-width:600px){
 #handRoot{--card-w:66px;--card-h:94px;--hand-h:120px}
 #handRoot .hn-top{padding:4px 6px;gap:4px}
 #handRoot .hn-top #hnExit,#handRoot .hn-top .nl-host-end{width:56px!important;min-height:40px}
 #handRoot .hn-round-tools{flex-direction:column;gap:2px}
 #handRoot .hn-brand img,#handRoot .hn-brand small{display:none}
 #handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){grid-template-columns:minmax(0,1fr);grid-template-rows:46px minmax(65px,1fr) 116px 30px var(--hand-h) auto auto;margin:4px 5px 0;padding:6px;gap:4px;border-radius:24px 24px 12px 12px}
 #handRoot .hn-opponents{grid-area:1/1;gap:3px}
 #handRoot .hn-player{padding:3px 5px;font-size:11px}
 #handRoot .hn-player small{font-size:9px}
 #handRoot .hn-avatar{width:24px;height:24px;font-size:16px}
 #handRoot .hn-board,#handRoot .hn-board:has(.hn-meld){grid-area:2/1}
 #handRoot .hn-piles{grid-area:3/1;max-width:320px;grid-template-columns:64px 1fr 64px}
 #handRoot .hn-handline{grid-area:4/1;font-size:10px;gap:4px}
 #handRoot .hn-handline>span:last-child{font-size:10px;white-space:normal;text-align:end}
 #handRoot .hn-private-hand{grid-area:5/1}
 #handRoot .hn-draft{grid-area:6/1;max-height:55px}
 #handRoot .hn-notice{grid-area:7/1}
 #handRoot .hn-tools{flex-wrap:wrap;padding:5px;gap:4px;min-height:52px}
 #handRoot .hn-tools button{font-size:12px;padding:5px 9px}
 #handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{font-size:16px;padding:5px 12px}
 #handRoot #hnSelection{font-size:10px;min-width:80px;max-width:150px}
 #handRoot .hn-private-group .hn-card .hn-corner{font-size:18px!important}
}
@media(orientation:landscape) and (max-height:550px){
 #handRoot{--card-w:66px;--card-h:92px;--hand-h:114px}
 #handRoot .hn-top{min-height:40px;padding:2px 8px}
 #handRoot .hn-top #hnExit,#handRoot .hn-top .nl-host-end{min-height:34px;height:34px}
 #handRoot .hn-brand b{font-size:17px}
 #handRoot .hn-brand small{display:none}
 #handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){grid-template-columns:minmax(0,1fr) 285px;grid-template-rows:30px minmax(58px,1fr) 22px var(--hand-h) auto auto;gap:2px 8px;padding:3px 10px;margin-top:3px}
 #handRoot .hn-player{min-height:28px;padding:1px 8px;font-size:11px;flex-direction:row}
 #handRoot .hn-avatar{width:23px;height:23px;font-size:16px}
 #handRoot .hn-player small{font-size:10px}
 #handRoot .hn-piles .hn-card,#handRoot .hn-back,#handRoot .hn-empty{width:46px;height:64px}
 #handRoot .hn-piles{grid-template-columns:46px 1fr 46px;gap:8px}
 #handRoot .hn-pile small{margin-top:2px;font-size:10px}
 #handRoot .hn-turn strong{font-size:13px}
 #handRoot .hn-turn small{font-size:11px}
 #handRoot .hn-handline{padding:2px;font-size:11px}
 #handRoot .hn-handline>span:last-child{font-size:11px}
 #handRoot .hn-tools{min-height:48px;padding:3px 8px;gap:5px}
 #handRoot .hn-tools button,#handRoot .hn-tools #hnDiscard,#handRoot .hn-tools #hnFinish{min-height:40px;font-size:13px;padding:4px 10px}
 #handRoot #hnSelection{max-width:220px;font-size:11px}
 #handRoot .hn-draft{max-height:38px}
 #handRoot .hn-pending .hn-card{width:23px;height:30px}
 #handRoot .hn-board .hn-card{width:40px;height:56px}
 #handRoot .hn-meld{padding-bottom:14px}
 #handRoot .hn-board .hn-meld small{font-size:9px;padding:1px 4px}
}
@media(orientation:landscape) and (max-height:330px){
 #handRoot{--card-w:54px;--card-h:76px;--hand-h:96px}
 #handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){grid-template-rows:24px minmax(40px,1fr) 18px var(--hand-h) auto auto}
 #handRoot .hn-player small,#handRoot .hn-brand img{display:none}
 #handRoot .hn-piles .hn-card,#handRoot .hn-back,#handRoot .hn-empty{width:36px;height:50px}
 #handRoot .hn-pile small{display:none}
 #handRoot .hn-draft{max-height:22px}
 #handRoot .hn-pending .hn-card{display:none}
 #handRoot .hn-notice{max-height:16px;font-size:10px}
}
@media(prefers-reduced-motion:reduce){#handRoot .hn-card{transition:none!important;animation:none!important}}

@media(max-width:360px){#handRoot{--card-w:54px;--card-h:76px;--hand-h:102px}#handRoot .hn-private-group .hn-card .hn-corner{font-size:14px!important}#handRoot .hn-private-group .hn-card .hn-corner:not(.hn-bottom){left:1px;top:2px}#handRoot .hn-private-group .hn-card .hn-corner .hn-suit{width:11px;height:11px}}
@media(orientation:landscape) and (max-height:330px){#handRoot .hn-top{min-height:36px}#handRoot .hn-tools{min-height:44px}#handRoot{--card-w:50px;--card-h:70px;--hand-h:88px}#handRoot .hn-table,#handRoot .hn-table:has(.hn-meld){grid-template-rows:24px minmax(46px,1fr) 18px var(--hand-h) auto auto}}
@media(orientation:landscape) and (max-height:330px){#handRoot{--card-w:46px;--card-h:64px;--hand-h:88px}#handRoot .hn-private-group .hn-card .hn-corner{font-size:16px!important}}
/* Original diwaniya art with live HTML cards, seats and controls. */
#handRoot.hn-scene{background:#081c37 url('/game/hand/art/lounge-v159.png') center/cover no-repeat;--card-w:100px;--card-h:140px;--hand-h:166px}
#handRoot.hn-scene:before{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(#020e2766,transparent 28%,transparent 85%,#03132b66)}
#handRoot.hn-scene .hn-top{position:absolute;inset:0 0 auto;z-index:5;background:linear-gradient(#04142bea,#071b4140);border:0;min-height:52px;grid-template-columns:max-content max-content minmax(80px,1fr) max-content}
#handRoot.hn-scene .hn-top button{background:#07182ddd;backdrop-filter:blur(8px);border-color:#d6bc7a66;box-shadow:0 3px 10px #0004}
#handRoot.hn-scene .hn-brand b{color:#ffdfa0;text-shadow:0 2px 4px #0008}
#handRoot.hn-scene .hn-table,#handRoot.hn-scene .hn-table:has(.hn-meld){position:absolute;inset:52px 0 0;display:block;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:hidden}
#handRoot.hn-scene .hn-opponents{position:absolute;inset:0 10% auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));height:34%;gap:4%;z-index:1}
#handRoot.hn-scene .hn-player{position:relative;display:block;max-width:none;width:100%;height:100%;padding:0;border:0;background:none;box-shadow:none;overflow:visible}
#handRoot.hn-scene .hn-player:only-child{grid-column:2}
#handRoot.hn-scene .hn-character{position:absolute;left:50%;bottom:0;transform:translateX(-50%);height:calc(100% - 27px);aspect-ratio:1;background-image:url('/game/hand/art/players-v159.png');background-size:300% 100%;background-position:calc(var(--portrait)*50%) center;background-repeat:no-repeat;filter:drop-shadow(0 8px 6px #00172c88);pointer-events:none;z-index:0}
#handRoot.hn-scene .hn-seat-label{position:absolute;z-index:2;top:0;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:7px;min-width:135px;max-width:100%;padding:4px 12px 4px 5px;border:1px solid #d5bb7a88;border-radius:24px;background:linear-gradient(135deg,#102e51f2,#07162aef);box-shadow:0 4px 14px #0005;text-align:center}
#handRoot.hn-scene .hn-player .hn-seat-label>span:last-child{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;font-size:14px;color:#fff1ce}
#handRoot.hn-scene .hn-player.active .hn-seat-label{border:2px solid #65f2df;box-shadow:0 0 18px #42eddc66}
#handRoot.hn-scene .hn-player small{font-size:11px;color:#c5dce9;font-weight:400;display:block}
#handRoot.hn-scene .hn-avatar{width:32px;height:32px;border:2px solid #42dfe4;background:#174666;font-size:21px;flex:none}
#handRoot.hn-scene .hn-piles{position:absolute;top:39%;left:50%;transform:translateX(-50%);width:220px;max-width:none;display:grid;grid-template-columns:80px 0px 80px;gap:25px;align-items:center;padding:0;z-index:3}
#handRoot.hn-scene .hn-piles .hn-card,#handRoot.hn-scene .hn-back,#handRoot.hn-scene .hn-empty{width:76px;height:106px;border-radius:9px;box-shadow:1px 4px 8px #0008}
#handRoot.hn-scene .hn-back{background:repeating-linear-gradient(45deg,#1c428166 0 2px,transparent 2px 7px),linear-gradient(150deg,#132e64,#071a40);border:3px solid #e9d39c;box-shadow:1px 3px #c7c1b5,2px 6px #192b4c,3px 9px #c7c1b5}
#handRoot.hn-scene .hn-back img{width:80%;height:auto}
#handRoot.hn-scene .hn-pile small{color:#f4dfae;font-size:12px;font-weight:700;white-space:nowrap;text-shadow:0 2px 4px #00101c}
#handRoot.hn-scene .hn-turn{position:absolute;top:-46px;left:50%;transform:translateX(-50%);width:320px;max-width:76vw;background:#061a30d9;border:1px solid #6ba7b066;border-radius:20px;padding:4px 14px;box-shadow:0 3px 12px #0003}
#handRoot.hn-scene .hn-turn strong{font-size:15px;line-height:1.3}
#handRoot.hn-scene .hn-turn small{margin-top:1px;color:#b8dbe7;font-size:11px}
#handRoot.hn-scene .hn-turn.hn-your-turn{border-color:#66e9db;background:#053937ed}
#handRoot.hn-scene .hn-board,#handRoot.hn-scene .hn-board:has(.hn-meld){position:absolute;inset:38% 68% 39% 12%;padding:6px;min-height:0;height:auto;overflow:auto;display:flex;align-content:flex-start;gap:8px}
#handRoot.hn-scene .hn-table-mark{display:none}
#handRoot.hn-scene .hn-meld{padding-bottom:17px}
#handRoot.hn-scene .hn-meld .hn-card{width:45px;height:63px}
#handRoot.hn-scene .hn-meld .hn-card+.hn-card{margin-left:-24px}
#handRoot.hn-scene .hn-private-hand{position:absolute;left:13%;right:13%;bottom:10px;width:auto;height:var(--hand-h);max-width:none;margin:0;padding:22px 6px 4px!important;z-index:4}
#handRoot.hn-scene .hn-private-group{filter:drop-shadow(0 10px 7px #00152a66)}
#handRoot.hn-scene .hn-private-group .hn-card{border-radius:9px;background:linear-gradient(110deg,#fffefa,#e9f3f5);border-color:#b8c9cf}
#handRoot.hn-scene .hn-private-group .hn-card.chosen{outline:3px solid #47e7f2;box-shadow:0 0 20px #14dbea99;transform:translateY(-18px)}
#handRoot.hn-scene .hn-private-group .hn-card.hn-valid{outline-color:#ffd974;box-shadow:0 0 18px #f4b93999}
#handRoot.hn-scene .hn-handline{position:absolute;left:14%;right:14%;bottom:calc(var(--hand-h) + 8px);padding:3px 10px;background:#061a30bd;border:1px solid #7eb6bf44;border-radius:12px;z-index:3;color:#e0efef;min-height:24px;gap:6px}
#handRoot.hn-scene .hn-handline>span:last-child{font-size:12px;color:#f5dfae}
#handRoot.hn-scene .hn-draft{position:absolute;left:64%;right:11%;top:40%;max-height:23%;max-width:25%;display:flex;flex-wrap:wrap;justify-content:flex-start;z-index:3}
#handRoot.hn-scene .hn-draft .hn-pending{background:#041e35c9;border:1px dashed #f1d391;border-radius:9px;max-width:100%}
#handRoot.hn-scene .hn-notice{position:absolute;bottom:calc(var(--hand-h) + 36px);left:20%;right:20%;z-index:4;background:#061b30cc;border-radius:10px;color:#ffe9a9;padding:3px 8px;font-size:12px;max-height:32px}
#handRoot.hn-scene .hn-notice:empty{display:none}
#handRoot.hn-scene .hn-tools{position:absolute;left:10px;top:46%;width:112px;padding:0;z-index:5;display:flex;flex-direction:column;align-items:stretch;gap:7px;min-height:0;background:none;border:0}
#handRoot.hn-scene .hn-tools button{min-height:42px;padding:7px 10px;font-size:13px;border-radius:13px;background:linear-gradient(145deg,#183a59ee,#071a30ee);border:1px solid #b59b6477;box-shadow:0 4px 9px #0004;backdrop-filter:blur(8px)}
#handRoot.hn-scene .hn-tools #hnMore{font-weight:700;color:#d6fcff}
#handRoot.hn-scene .hn-tools #hnSelection{display:none}
#handRoot.hn-scene .hn-tools #hnDiscard{position:fixed;right:10px;bottom:18px;max-width:12%;min-height:48px;font-size:16px;padding:7px}
#handRoot.hn-scene .hn-tools #hnGroup,#handRoot.hn-scene .hn-tools #hnAttach,#handRoot.hn-scene .hn-tools #hnJoker{background:linear-gradient(145deg,#285d67ee,#0c343dee);border-color:#55ccc8;color:#e7ffff}
#handRoot.hn-scene .hn-tools #hnFinish{position:fixed;right:10px;top:45%;max-width:12%;font-size:15px;padding:7px}
#handRoot.hn-scene .hn-tools #hnContinue{position:fixed;right:10px;top:calc(45% + 52px);max-width:12%;font-size:12px;padding:7px}
@media(orientation:landscape) and (max-height:550px){
 #handRoot.hn-scene{--card-w:70px;--card-h:98px;--hand-h:124px}
 #handRoot.hn-scene .hn-top{min-height:40px;padding:2px 8px}
 #handRoot.hn-scene .hn-table,#handRoot.hn-scene .hn-table:has(.hn-meld){top:40px}
 #handRoot.hn-scene .hn-opponents{height:34%;inset-inline:13%;gap:4%}
 #handRoot.hn-scene .hn-character{height:calc(100% - 21px)}
 #handRoot.hn-scene .hn-seat-label{min-width:112px;padding:2px 7px 2px 3px;gap:3px}
 #handRoot.hn-scene .hn-avatar{width:24px;height:24px;font-size:16px}
 #handRoot.hn-scene .hn-player .hn-seat-label>span:last-child{font-size:12px}
 #handRoot.hn-scene .hn-player small{font-size:9px}
 #handRoot.hn-scene .hn-piles{top:40%;width:160px;grid-template-columns:54px 0 54px;gap:20px}
 #handRoot.hn-scene .hn-piles .hn-card,#handRoot.hn-scene .hn-back,#handRoot.hn-scene .hn-empty{width:52px;height:73px}
 #handRoot.hn-scene .hn-turn{top:-37px;width:250px;padding:2px 10px}
 #handRoot.hn-scene .hn-turn strong{font-size:13px}
 #handRoot.hn-scene .hn-turn small{font-size:10px}
 #handRoot.hn-scene .hn-pile small{font-size:10px;margin-top:4px}
 #handRoot.hn-scene .hn-private-hand{left:14%;right:13%;bottom:4px}
 #handRoot.hn-scene .hn-handline{left:14%;right:13%;min-height:20px;bottom:calc(var(--hand-h) + 2px);padding:2px 8px;font-size:10px}
 #handRoot.hn-scene .hn-handline>span:last-child{font-size:10px}
 #handRoot.hn-scene .hn-tools{left:7px;width:12%;top:43%;gap:5px}
 #handRoot.hn-scene .hn-tools button{font-size:11px;padding:5px 7px;min-height:34px}
 #handRoot.hn-scene .hn-tools #hnDiscard{right:6px;bottom:12px;min-height:42px;font-size:12px}
 #handRoot.hn-scene .hn-notice{font-size:10px;bottom:calc(var(--hand-h) + 28px);max-height:26px}
 #handRoot.hn-scene .hn-meld .hn-card{width:34px;height:48px}
}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-scene{--card-w:48px;--card-h:68px;--hand-h:94px}
 #handRoot.hn-scene .hn-top{min-height:34px}
 #handRoot.hn-scene .hn-table,#handRoot.hn-scene .hn-table:has(.hn-meld){top:34px}
 #handRoot.hn-scene .hn-piles{top:39%}
 #handRoot.hn-scene .hn-piles .hn-card,#handRoot.hn-scene .hn-back,#handRoot.hn-scene .hn-empty{width:38px;height:53px}
 #handRoot.hn-scene .hn-turn{top:-28px}
 #handRoot.hn-scene .hn-turn small{display:none}
 #handRoot.hn-scene .hn-tools{top:41%;gap:3px}
 #handRoot.hn-scene .hn-tools button{min-height:30px;font-size:10px}
 #handRoot.hn-scene .hn-player small{display:none}
}
@media(orientation:portrait){
 #handRoot.hn-scene{--card-w:60px;--card-h:84px;--hand-h:110px;background-position:center}
 #handRoot.hn-scene .hn-table,#handRoot.hn-scene .hn-table:has(.hn-meld){top:58px}
 #handRoot.hn-scene .hn-opponents{inset-inline:3%;height:30%;gap:2%}
 #handRoot.hn-scene .hn-seat-label{min-width:82px;padding:2px 4px}
 #handRoot.hn-scene .hn-avatar{width:18px;height:18px;font-size:11px}
 #handRoot.hn-scene .hn-player .hn-seat-label>span:last-child{font-size:10px}
 #handRoot.hn-scene .hn-player small{font-size:8px}
 #handRoot.hn-scene .hn-character{width:108%;height:auto;aspect-ratio:1;bottom:15%;background-size:300% 100%}
 #handRoot.hn-scene .hn-piles{top:37%;width:180px;grid-template-columns:60px 0 60px;gap:20px}
 #handRoot.hn-scene .hn-piles .hn-card,#handRoot.hn-scene .hn-back,#handRoot.hn-scene .hn-empty{width:56px;height:79px}
 #handRoot.hn-scene .hn-turn{width:245px;font-size:12px}
 #handRoot.hn-scene .hn-private-hand{left:4%;right:4%;bottom:56px}
 #handRoot.hn-scene .hn-handline{left:4%;right:4%;bottom:calc(var(--hand-h) + 60px)}
 #handRoot.hn-scene .hn-handline>span:last-child{font-size:10px}
 #handRoot.hn-scene .hn-tools{left:4%;right:4%;top:auto;bottom:7px;width:auto;flex-direction:row;justify-content:center;flex-wrap:wrap;gap:4px}
 #handRoot.hn-scene .hn-tools button{font-size:10px;min-height:38px;padding:5px 8px}
 #handRoot.hn-scene .hn-tools #hnDiscard,#handRoot.hn-scene .hn-tools #hnFinish,#handRoot.hn-scene .hn-tools #hnContinue{position:static;max-width:none;min-height:38px;font-size:12px}
 #handRoot.hn-scene .hn-board,#handRoot.hn-scene .hn-board:has(.hn-meld){inset:57% 52% 35% 4%}
 #handRoot.hn-scene .hn-draft{left:52%;right:4%;top:57%;max-width:44%;max-height:8%}
 #handRoot.hn-scene .hn-notice{left:4%;right:4%;bottom:calc(var(--hand-h) + 88px);font-size:10px}
}
/* Keep pile labels and turn guidance clear of the hand. */
@media(orientation:landscape){
 #handRoot.hn-scene .hn-opponents{height:46%}
 #handRoot.hn-scene .hn-character{height:calc(100% - 34px)}
 #handRoot.hn-scene .hn-handline{top:45%;bottom:auto;left:auto;right:8px;width:11.5%;display:flex;flex-direction:column;align-items:center;gap:7px;padding:8px 5px;border:1px solid #d4bb7a77;background:#071b36e6;border-radius:14px;min-height:70px;font-size:11px;text-align:center}
 #handRoot.hn-scene .hn-handline>span:last-child{white-space:normal;text-align:center;line-height:1.6;font-size:11px}
 #handRoot.hn-scene .hn-piles{top:44%}
 #handRoot.hn-scene .hn-turn{position:fixed;left:8px;top:calc(45% + 40px);transform:none;width:11%;max-width:none;border-radius:12px;padding:6px 4px}
 #handRoot.hn-scene .hn-turn strong{font-size:12px;line-height:1.5}
 #handRoot.hn-scene .hn-turn small{font-size:10px;white-space:normal;line-height:1.5}
 #handRoot.hn-scene .hn-pile small{position:absolute;top:35%;width:max-content;max-width:120px;margin:0;font-size:11px;white-space:normal}
 #handRoot.hn-scene #hnStock small{left:calc(100% + 12px)}
 #handRoot.hn-scene #hnFire small{right:calc(100% + 12px)}
 #handRoot.hn-scene .hn-notice{bottom:calc(var(--hand-h) + 5px);left:26%;right:26%}
}
@media(orientation:landscape) and (max-height:330px){#handRoot.hn-scene .hn-opponents{height:42%}#handRoot.hn-scene .hn-piles{top:43%}#handRoot.hn-scene .hn-turn strong{font-size:10px}#handRoot.hn-scene .hn-pile small{font-size:9px;max-width:90px}#handRoot.hn-scene .hn-handline{font-size:9px;gap:3px;min-height:55px}#handRoot.hn-scene .hn-handline>span:last-child{font-size:9px}}

@media(orientation:portrait){#handRoot.hn-scene>.hn-turn{position:absolute;top:34%;left:50%;transform:translateX(-50%);width:245px;max-width:90%;padding:4px 10px}}

@media(orientation:landscape){#handRoot.hn-scene .hn-turn{top:22%;left:8px;width:11%}}
#handRoot.hn-scene .hn-private-group .hn-card.hn-hint-0:not(.chosen){box-shadow:inset 0 0 0 2px #25cde4,0 0 9px #25cde455}
#handRoot.hn-scene .hn-private-group .hn-card.hn-hint-1:not(.chosen){box-shadow:inset 0 0 0 2px #c568ee,0 0 9px #c568ee55}
#handRoot.hn-scene .hn-private-group .hn-card.hn-hint-2:not(.chosen){box-shadow:inset 0 0 0 2px #e7bf6a,0 0 9px #e7bf6a55}

/* Preserve the physical fan order when lifting a selected card.
   A selected card must never cover the rank or touch target of its right neighbor. */
#handRoot .hn-private-group .hn-card,
#handRoot .hn-private-group .hn-card.chosen,
#handRoot.hn-scene .hn-private-group .hn-card,
#handRoot.hn-scene .hn-private-group .hn-card.chosen {
 z-index:0;
 isolation:isolate;
}

/* Short independent pile labels, with the stock count kept on its own badge. */
#handRoot.hn-scene #hnStock small,#handRoot.hn-scene #hnFire small {
 position:static!important;inset:auto!important;display:block;width:100%;max-width:none;
 margin:2px 0 0;padding:0;line-height:14px;font-size:10px;white-space:nowrap;text-align:center;
}
#handRoot .hn-stock-count{position:absolute;top:3px;right:3px;display:grid;place-items:center;min-width:20px;height:18px;padding:0 3px;border:1px solid #d2b874;border-radius:6px;background:#071a40;color:#ffedb4;font:700 10px/1 Arial,sans-serif;box-shadow:0 1px 4px #0006;pointer-events:none}
#handRoot .hn-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px}
#handRoot .hn-dialog-head h2{margin:0;font-size:22px}
#handRoot .hn-dialog .hn-dialog-close{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;padding:0;font-size:28px;line-height:1;border:1px solid #86c6cf;border-radius:12px;color:#fff;background:#143b55}
@media(orientation:portrait){#handRoot.hn-scene #hnStock small,#handRoot.hn-scene #hnFire small{font-size:12px;line-height:18px}}

/* Give the pile label room below the stacked card edges. */
#handRoot.hn-scene #hnStock small,#handRoot.hn-scene #hnFire small{margin-top:14px}
#handRoot.hn-scene .hn-piles{margin-top:-12px}
#handRoot.hn-up-discard-ready .hn-drag-ghost{outline:3px solid #7bffdb;box-shadow:0 0 24px #42f5ca99,0 15px 30px #0008}
#handRoot.hn-up-discard-ready .hn-drag-ghost:after{content:'اترك للرمي';position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:7px;padding:5px 9px;white-space:nowrap;border-radius:9px;background:#073b38;color:#adffdf;font:700 12px/1.3 Arial,sans-serif;pointer-events:none}
@media(orientation:landscape) and (max-height:330px){#handRoot.hn-scene #hnStock small,#handRoot.hn-scene #hnFire small{margin-top:12px}}

/* Full illustration on the back; aligned opaque cards in each pending/confirmed meld. */
#handRoot.hn-scene .hn-back{position:relative;padding:0;background:#06172e}
#handRoot.hn-scene .hn-back img{display:block;width:100%;height:100%;max-width:none;object-fit:contain;background:#06172e}
#handRoot .hn-card{color-scheme:only light}
#handRoot.hn-scene .hn-board,#handRoot.hn-scene .hn-board:has(.hn-meld){display:flex;flex-direction:column;align-items:stretch;align-content:flex-start;gap:8px;overflow:auto;overscroll-behavior:contain}
#handRoot.hn-scene .hn-meld{display:flex;flex-wrap:wrap;direction:ltr;align-items:flex-start;justify-content:flex-start;gap:3px;width:100%;max-width:100%;padding:5px;border:1px solid #9cc7c955;border-radius:8px;background:#061c33b8;white-space:normal}
#handRoot.hn-scene .hn-meld .hn-card,#handRoot.hn-scene .hn-meld .hn-card+.hn-card{width:36px;height:51px;margin:0;transform:none;opacity:1;background:#fffdf7;box-shadow:0 2px 3px #0005;flex:0 0 auto}
#handRoot.hn-scene .hn-meld small{position:static;flex-basis:100%;order:1;max-width:100%;width:100%;margin:0;padding:2px;font-size:9px;text-align:center}
#handRoot.hn-scene .hn-draft{display:flex;flex-direction:column;align-items:stretch;flex-wrap:nowrap;overflow:auto;overscroll-behavior:contain;padding:2px;gap:7px}
#handRoot.hn-scene .hn-draft .hn-pending{display:block;flex:0 0 auto;width:100%;max-width:100%;padding:5px;border:1px dashed #efcc76;border-radius:8px;background:#061c33ed;opacity:1;white-space:normal}
#handRoot .hn-pending-label{display:block;padding:0 0 4px;text-align:right;font:700 10px/1.3 Arial,sans-serif;color:#f7dfa4}
#handRoot .hn-pending-cards{display:flex;flex-wrap:wrap;direction:ltr;gap:3px;align-items:flex-start;justify-content:flex-start}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card{display:inline-block;width:36px;height:51px;padding:0;margin:0!important;transform:none;opacity:1;flex:0 0 auto;background:#fffdf7;border:1px solid #d1c9b8;border-radius:5px;box-shadow:0 2px 3px #0005}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card>span{padding:0;background:transparent;border-radius:0}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card .hn-corner{font-size:12px!important;top:2px;left:2px;line-height:1}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card .hn-corner .hn-suit{width:9px;height:9px}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card .hn-pip{inset:15px 8px 5px;font-size:18px}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card .hn-pip.hn-face{inset:2px 13%;overflow:hidden}
#handRoot.hn-scene .hn-draft .hn-pending .hn-card .hn-bottom{display:none}
@media(orientation:portrait){
 #handRoot.hn-scene .hn-draft{top:55%;bottom:calc(var(--hand-h) + 94px);max-height:none;height:auto;max-width:44%}
 #handRoot.hn-scene .hn-board,#handRoot.hn-scene .hn-board:has(.hn-meld){top:55%;bottom:calc(var(--hand-h) + 94px);max-height:none;height:auto}
}
@media(orientation:portrait) and (max-height:650px){#handRoot.hn-scene .hn-draft,#handRoot.hn-scene .hn-board,#handRoot.hn-scene .hn-board:has(.hn-meld){top:48%}}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-scene .hn-draft{top:34%;bottom:38%;max-height:none;height:auto}
 #handRoot.hn-scene .hn-board,#handRoot.hn-scene .hn-board:has(.hn-meld){top:34%;bottom:38%;max-height:none;height:auto}
 #handRoot.hn-scene .hn-draft .hn-pending .hn-card,#handRoot.hn-scene .hn-meld .hn-card{display:inline-block;width:30px;height:43px}
}

/* One measured layout: seats, piles + a permanent meld area, hand, action bar. */
#handRoot.hn-scene.hn-layout-v164{display:grid;grid-template-rows:40px minmax(0,1fr) auto;--seat-h:58px;--meta-h:22px;--card-w:70px;--card-h:98px;--hand-h:122px;--pile-w:42px}
#handRoot.hn-layout-v164 .hn-top{position:relative;inset:auto;min-height:0;height:100%;padding:2px 8px;grid-template-columns:max-content max-content minmax(0,1fr) max-content}
#handRoot.hn-layout-v164 .hn-top #hnExit,#handRoot.hn-layout-v164 .hn-top .nl-host-end{width:auto!important;max-width:120px;min-width:38px;min-height:34px;height:34px;white-space:nowrap!important;padding:4px 8px!important;font-size:11px!important;overflow:hidden;text-overflow:ellipsis}
#handRoot.hn-layout-v164 .hn-brand{justify-content:center;min-width:0}
#handRoot.hn-layout-v164 .hn-brand img{width:25px;height:25px}
#handRoot.hn-layout-v164 .hn-brand b{font-size:17px}
#handRoot.hn-layout-v164 .hn-brand small{display:none}
#handRoot.hn-layout-v164 .hn-round-tools{flex-direction:row;gap:6px;font-size:10px}
#handRoot.hn-layout-v164 .hn-round-tools #hnScore{min-height:32px;height:32px;font-size:11px;padding:3px 8px}
#handRoot.hn-layout-v164 .hn-table,#handRoot.hn-layout-v164 .hn-table:has(.hn-meld){position:relative;inset:auto;display:grid;direction:ltr;grid-template-columns:minmax(110px,20%) minmax(0,1fr);grid-template-rows:var(--seat-h) minmax(0,1fr) auto var(--meta-h) var(--hand-h);grid-template-areas:'players players' 'piles melds' 'notice notice' 'meta meta' 'hand hand';min-width:0;min-height:0;margin:0;padding:3px 12px 0;gap:3px 12px;overflow:hidden}
#handRoot.hn-layout-v164 .hn-opponents{grid-area:players;position:relative;inset:auto;height:100%;width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5%;padding:0 8%;direction:rtl;z-index:1}
#handRoot.hn-layout-v164 .hn-player{min-width:0;width:100%;height:100%}
#handRoot.hn-layout-v164 .hn-character{width:auto;height:calc(100% - 22px);max-width:100%;aspect-ratio:1;bottom:0;top:auto}
#handRoot.hn-layout-v164 .hn-seat-label{min-width:100px;max-width:95%;min-height:24px;padding:2px 7px;gap:5px}
#handRoot.hn-layout-v164 .hn-player .hn-seat-label>span:last-child{font-size:11px;line-height:1.2}
#handRoot.hn-layout-v164 .hn-player small{font-size:9px;display:block}
#handRoot.hn-layout-v164 .hn-avatar{width:23px;height:23px;font-size:15px}
#handRoot.hn-layout-v164 .hn-piles{grid-area:piles;position:relative;inset:auto;transform:none;width:100%;height:100%;max-width:none;margin:0;padding:0;display:flex;gap:18px;align-items:center;justify-content:center;direction:rtl;z-index:3}
#handRoot.hn-layout-v164 .hn-pile{position:relative;flex:0 0 auto;width:var(--pile-w);padding:0;min-width:0;min-height:0}
#handRoot.hn-layout-v164 .hn-piles .hn-card,#handRoot.hn-layout-v164 .hn-back,#handRoot.hn-layout-v164 .hn-empty{width:var(--pile-w);height:calc(var(--pile-w)*1.4);border-radius:6px}
#handRoot.hn-layout-v164 .hn-back{border-width:2px}
#handRoot.hn-layout-v164 #hnStock small,#handRoot.hn-layout-v164 #hnFire small{margin:9px 0 0;font-size:10px;line-height:13px;white-space:nowrap}
#handRoot.hn-layout-v164 .hn-stock-count{min-width:18px;height:16px;font-size:9px;top:2px;right:2px}
#handRoot.hn-layout-v164 .hn-meld-area{grid-area:melds;display:grid;grid-template-rows:16px minmax(0,1fr);min-width:0;min-height:0;z-index:3;border:1px solid #8bbbc777;border-radius:10px;background:#061c35c7;overflow:hidden;direction:rtl}
#handRoot.hn-layout-v164 .hn-meld-area-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:1px 8px;border-bottom:1px solid #8bbbc744;font-size:10px;line-height:13px;color:#e8d398;overflow:hidden}
#handRoot.hn-layout-v164 .hn-meld-area-head small{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#handRoot.hn-layout-v164 .hn-meld-scroll{display:flex;flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:5px;padding:4px;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;direction:rtl}
#handRoot.hn-layout-v164 #hnBoard,#handRoot.hn-layout-v164 #hnDraft{display:contents!important;position:static!important;inset:auto!important;height:auto!important;max-height:none!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important}
#handRoot.hn-layout-v164 .hn-table-mark{display:none}
#handRoot.hn-layout-v164 .hn-meld-empty{margin:auto;text-align:center;color:#c4d9e1;font-size:11px;line-height:1.5}
#handRoot.hn-layout-v164 .hn-meld,#handRoot.hn-layout-v164 .hn-draft .hn-pending{display:block;flex:0 0 auto;width:auto;max-width:100%;padding:3px;margin:0;opacity:1;border-radius:6px;background:#102d43;border:1px solid #8bbbc755}
#handRoot.hn-layout-v164 .hn-draft .hn-pending{border-style:dashed;border-color:#e9c77f}
#handRoot.hn-layout-v164 .hn-meld{display:flex;flex-wrap:wrap;gap:2px;direction:ltr;align-items:flex-start}
#handRoot.hn-layout-v164 .hn-pending-cards{gap:2px}
#handRoot.hn-layout-v164 .hn-meld .hn-card,#handRoot.hn-layout-v164 .hn-draft .hn-pending .hn-card{width:32px!important;height:45px!important;margin:0!important;display:inline-block}
#handRoot.hn-layout-v164 .hn-pending-label{font-size:9px;line-height:11px;padding:0 0 2px}
#handRoot.hn-layout-v164 .hn-meld small{position:static;order:1;flex-basis:100%;padding:0;margin:0;font-size:9px;line-height:11px;border:0;background:none}
#handRoot.hn-layout-v164 .hn-meld .hn-card .hn-corner{font-size:11px!important;left:2px;top:2px}
#handRoot.hn-layout-v164 .hn-meld .hn-card .hn-corner .hn-suit{width:8px;height:8px}
#handRoot.hn-layout-v164 .hn-private-hand{grid-area:hand;position:relative;inset:auto;width:100%;height:var(--hand-h);min-height:0;max-width:100%;margin:0;padding:20px 4px 3px!important;z-index:4;overflow-x:auto;overflow-y:hidden}
#handRoot.hn-layout-v164 .hn-handline{grid-area:meta;position:relative;inset:auto;width:100%;min-width:0;min-height:0;height:100%;padding:2px 8px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;border:1px solid #a1c5cb33;border-radius:9px;background:#081d36c7;overflow:hidden;direction:rtl;z-index:3}
#handRoot.hn-layout-v164 .hn-handline>span{flex:0 0 auto;white-space:nowrap;font-size:10px}
#handRoot.hn-layout-v164 .hn-handline>span:last-of-type{order:2;font-size:10px;text-align:start;line-height:1.2}
#handRoot.hn-layout-v164 #hnReadyBadge{display:none}
#handRoot.hn-layout-v164 .hn-turn{position:static!important;inset:auto!important;transform:none!important;display:flex;flex:1;order:1;align-items:center;justify-content:center;gap:8px;width:auto!important;max-width:none;min-width:0;padding:0;background:none!important;border:0!important;box-shadow:none;overflow:hidden;white-space:nowrap;text-align:center;direction:rtl}
#handRoot.hn-layout-v164 .hn-turn strong{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis}
#handRoot.hn-layout-v164 .hn-turn small{display:block;font-size:10px;margin:0;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#handRoot.hn-layout-v164 .hn-notice{grid-area:notice;position:relative;inset:auto;bottom:auto;max-height:26px;min-height:0;margin:0;padding:1px 5px;font-size:11px;line-height:13px;overflow:auto;border-radius:7px;direction:rtl;z-index:3}
#handRoot.hn-layout-v164 .hn-notice:empty{display:none}
#handRoot.hn-layout-v164 .hn-tools{position:relative;inset:auto;width:100%;min-height:42px;max-height:90px;padding:3px 8px;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:center;gap:5px;border-top:1px solid #adc5bf44;background:#081b36eb;overflow:auto;direction:rtl;z-index:5}
#handRoot.hn-layout-v164 .hn-tools button,#handRoot.hn-layout-v164 .hn-tools #hnDiscard,#handRoot.hn-layout-v164 .hn-tools #hnFinish,#handRoot.hn-layout-v164 .hn-tools #hnContinue{position:static!important;inset:auto!important;max-width:none;min-width:0!important;min-height:36px;height:auto;padding:6px 12px;font-size:12px;line-height:1.2;white-space:nowrap;border-radius:9px}
#handRoot.hn-layout-v164 #hnGuide{display:none!important}
#handRoot.hn-layout-v164 #hnGroup{order:-1!important;min-width:80px!important;border-color:#80eed5;background:linear-gradient(130deg,#27676c,#113d4b);color:#d9fff7;font-weight:700}
#handRoot.hn-layout-v164 #hnDiscard{order:-2!important}
@media(orientation:portrait){
 #handRoot.hn-scene.hn-layout-v164{grid-template-rows:52px minmax(0,1fr) auto;--seat-h:160px;--meta-h:26px;--hand-h:110px;--card-w:60px;--card-h:84px;--pile-w:58px}
 #handRoot.hn-layout-v164 .hn-table,#handRoot.hn-layout-v164 .hn-table:has(.hn-meld){grid-template-columns:minmax(0,1fr);grid-template-rows:var(--seat-h) 118px minmax(0,1fr) auto var(--meta-h) var(--hand-h);grid-template-areas:'players' 'piles' 'melds' 'notice' 'meta' 'hand';padding:3px 8px 0;gap:4px}
 #handRoot.hn-layout-v164 .hn-opponents{padding:0;gap:3%}
 #handRoot.hn-layout-v164 .hn-character{width:100%;height:auto;max-width:150px;aspect-ratio:1}
 #handRoot.hn-layout-v164 .hn-seat-label{min-width:80px;gap:3px;padding:2px 4px}
 #handRoot.hn-layout-v164 .hn-player .hn-seat-label>span:last-child{font-size:10px}
 #handRoot.hn-layout-v164 .hn-player small{font-size:8px}
 #handRoot.hn-layout-v164 .hn-avatar{width:18px;height:18px;font-size:12px}
 #handRoot.hn-layout-v164 .hn-piles{gap:36px}
 #handRoot.hn-layout-v164 #hnStock small,#handRoot.hn-layout-v164 #hnFire small{font-size:12px;line-height:16px;margin-top:13px}
 #handRoot.hn-layout-v164 .hn-meld-area{grid-template-rows:20px minmax(0,1fr)}
 #handRoot.hn-layout-v164 .hn-meld-area-head{font-size:12px;line-height:17px}
 #handRoot.hn-layout-v164 .hn-meld-area-head small{font-size:10px}
 #handRoot.hn-layout-v164 .hn-meld .hn-card,#handRoot.hn-layout-v164 .hn-draft .hn-pending .hn-card{width:34px!important;height:48px!important}
 #handRoot.hn-layout-v164 .hn-turn{flex-direction:column;gap:0}
 #handRoot.hn-layout-v164 .hn-turn strong{font-size:10px}
 #handRoot.hn-layout-v164 .hn-turn small{font-size:9px}
 #handRoot.hn-layout-v164 .hn-handline>span,#handRoot.hn-layout-v164 .hn-handline>span:last-of-type{font-size:9px}
 #handRoot.hn-layout-v164 .hn-tools button,#handRoot.hn-layout-v164 .hn-tools #hnDiscard,#handRoot.hn-layout-v164 .hn-tools #hnFinish,#handRoot.hn-layout-v164 .hn-tools #hnContinue{font-size:11px;padding:6px 9px;min-height:36px}
}
@media(orientation:portrait) and (max-height:650px){
 #handRoot.hn-layout-v164 .hn-table,#handRoot.hn-layout-v164 .hn-table:has(.hn-meld){--seat-h:105px;grid-template-rows:var(--seat-h) 102px minmax(0,1fr) auto var(--meta-h) var(--hand-h)}
 #handRoot.hn-layout-v164 .hn-character{height:calc(100% - 28px);width:auto}
}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-scene.hn-layout-v164{grid-template-rows:34px minmax(0,1fr) auto;--seat-h:24px;--meta-h:18px;--hand-h:82px;--card-w:42px;--card-h:59px;--pile-w:30px}
 #handRoot.hn-layout-v164 .hn-table,#handRoot.hn-layout-v164 .hn-table:has(.hn-meld){grid-template-columns:100px minmax(0,1fr);padding:1px 8px 0;gap:2px 8px}
 #handRoot.hn-layout-v164 .hn-character{display:none}
 #handRoot.hn-layout-v164 .hn-seat-label{min-height:22px;max-height:22px}
 #handRoot.hn-layout-v164 .hn-avatar{width:18px;height:18px;font-size:12px}
 #handRoot.hn-layout-v164 .hn-player small{display:none}
 #handRoot.hn-layout-v164 .hn-meld-area{grid-template-rows:13px minmax(0,1fr)}
 #handRoot.hn-layout-v164 .hn-meld-area-head{font-size:9px;line-height:11px;padding:0 5px}
 #handRoot.hn-layout-v164 .hn-meld-scroll{gap:4px;padding:2px}
 #handRoot.hn-layout-v164 .hn-meld,#handRoot.hn-layout-v164 .hn-draft .hn-pending{padding:2px}
 #handRoot.hn-layout-v164 .hn-meld .hn-card,#handRoot.hn-layout-v164 .hn-draft .hn-pending .hn-card{width:28px!important;height:40px!important}
 #handRoot.hn-layout-v164 .hn-pending-label,#handRoot.hn-layout-v164 .hn-meld small{font-size:8px;line-height:9px}
 #handRoot.hn-layout-v164 #hnStock small,#handRoot.hn-layout-v164 #hnFire small{margin-top:7px;font-size:9px;line-height:11px}
 #handRoot.hn-layout-v164 .hn-tools{min-height:38px;padding:2px 6px;gap:4px}
 #handRoot.hn-layout-v164 .hn-tools button,#handRoot.hn-layout-v164 .hn-tools #hnDiscard,#handRoot.hn-layout-v164 .hn-tools #hnFinish,#handRoot.hn-layout-v164 .hn-tools #hnContinue{min-height:32px;font-size:11px;padding:4px 10px}
 #handRoot.hn-layout-v164 .hn-notice{font-size:10px;line-height:11px;max-height:12px;padding:0 4px}
 #handRoot.hn-layout-v164 .hn-turn small{display:none}
}
@media(orientation:landscape) and (min-height:550px){
 #handRoot.hn-scene.hn-layout-v164{grid-template-rows:52px minmax(0,1fr) auto;--seat-h:135px;--meta-h:30px;--hand-h:166px;--card-w:100px;--card-h:140px;--pile-w:70px}
 #handRoot.hn-layout-v164 .hn-meld .hn-card,#handRoot.hn-layout-v164 .hn-draft .hn-pending .hn-card{width:48px!important;height:68px!important}
 #handRoot.hn-layout-v164 .hn-tools button,#handRoot.hn-layout-v164 .hn-tools #hnDiscard{min-height:44px;font-size:15px}
}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-layout-v164 .hn-draft .hn-pending{display:flex;align-items:flex-start;gap:4px}
 #handRoot.hn-layout-v164 .hn-pending-label{align-self:center;max-width:62px;flex:0 0 auto;padding:0;font-size:8px;line-height:10px}
 #handRoot.hn-layout-v164 .hn-pending-cards{flex:1;min-width:0}
 #handRoot.hn-layout-v164 .hn-meld small{flex-basis:auto;width:auto;max-width:62px;align-self:center;order:0;font-size:8px;line-height:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 3px}
}
@media(orientation:landscape){
 #handRoot.hn-layout-v164 .hn-draft .hn-pending{display:flex;align-items:flex-start;gap:4px}
 #handRoot.hn-layout-v164 .hn-pending-label{align-self:center;max-width:62px;flex:0 0 auto;padding:0;font-size:9px;line-height:11px}
 #handRoot.hn-layout-v164 .hn-pending-cards{flex:1;min-width:0}
 #handRoot.hn-layout-v164 .hn-meld small{flex-basis:auto;width:auto;max-width:62px;align-self:center;order:0;font-size:9px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 3px}
}
@media(orientation:landscape) and (max-height:330px){#handRoot.hn-layout-v164 .hn-character{display:block;width:24px;height:24px;left:calc(50% - 78px);top:0;bottom:auto;transform:none}}
/* Keep feedback in the meld header and reserve the short screen for readable cards. */
#handRoot.hn-layout-v164 .hn-notice{position:absolute!important;width:1px;height:1px;max-height:1px;overflow:hidden;clip-path:inset(50%);padding:0;pointer-events:none}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-scene.hn-layout-v164{--seat-h:22px;--meta-h:16px;--hand-h:98px;--card-w:60px;--card-h:84px;--pile-w:32px}
 #handRoot.hn-layout-v164 .hn-private-hand{padding-top:12px!important}
 #handRoot.hn-layout-v164 .hn-private-group .hn-card.chosen{transform:translateY(-10px)}
}

/* Normalize all four card layers; the old meld corner rule stretched the bottom corner over the art. */
#handRoot.hn-scene .hn-meld-area .hn-card{position:relative!important;display:inline-block!important;overflow:hidden!important;isolation:isolate;background:linear-gradient(110deg,#fffefa,#e9f3f5)!important;transform:none!important;padding:0!important;flex:0 0 auto;opacity:1;--meld-w:36px;width:var(--meld-w)!important;height:calc(var(--meld-w)*1.4)!important}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-corner{position:absolute!important;inset:2px auto auto 2px!important;width:auto!important;height:auto!important;display:block;font-size:12px!important;line-height:1!important;padding:0;background:#fffdf7;border-radius:2px;color:inherit;z-index:3;transform:none!important}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-bottom{display:none!important}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-corner .hn-suit{width:9px!important;height:9px!important}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-pip{position:absolute!important;inset:0!important;display:grid!important;place-items:center;padding:0!important;background:none!important;border-radius:0}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-pip>.hn-suit{width:18px!important;height:18px!important}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-pip.hn-face{inset:2px 12% 2px 20%!important;overflow:hidden}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-court{display:block;width:100%!important;height:100%!important}
#handRoot.hn-scene .hn-meld-area .hn-card .hn-court-suit{display:none!important}
#handRoot.hn-layout-v164 #hnGroup{display:none!important}
#handRoot .hn-arrange-dialog [data-tool="hnGroup"]{border-color:#72e4cd;color:#c4fff0;background:#145353;font-weight:700}
#handRoot .hn-practice-entry{display:block;width:100%;min-height:46px;margin:12px 0;padding:10px;border:1px solid #67decd;border-radius:12px;background:#114850;color:#e7fffa;font-weight:700}
#handRoot.hn-layout-v164 .hn-private-hand{align-content:flex-end;align-items:flex-end;justify-content:center;padding-top:14px!important;padding-bottom:3px!important}
#handRoot.hn-layout-v164 .hn-private-group{align-self:flex-end}
#handRoot.hn-layout-v164 .hn-meld-area-head{min-height:20px;line-height:16px;font-size:11px}
#handRoot.hn-layout-v164 .hn-meld-area{grid-template-rows:20px minmax(0,1fr)}
#handRoot.hn-layout-v164 .hn-meld-area-head small{font-size:10px}
#handRoot.hn-layout-v164 .hn-meld-scroll{align-content:flex-start;justify-content:flex-start;padding:5px;gap:7px}
@media(orientation:portrait){#handRoot.hn-scene .hn-meld-area .hn-card{--meld-w:39px}#handRoot.hn-layout-v164 .hn-meld-area{background:#061c3577}}
@media(orientation:landscape){
 #handRoot.hn-scene.hn-layout-v164{grid-template-rows:36px minmax(0,1fr) auto;--seat-h:78px;--hand-h:100px;--meta-h:24px;--card-w:62px;--card-h:87px;--pile-w:44px}
 #handRoot.hn-layout-v164 .hn-table,#handRoot.hn-layout-v164 .hn-table:has(.hn-meld){grid-template-columns:138px minmax(0,1fr);grid-template-rows:var(--seat-h) minmax(58px,1fr) var(--meta-h) var(--hand-h);grid-template-areas:'players players' 'piles melds' 'meta meta' 'hand hand';gap:3px 10px;padding:2px 10px 0}
 #handRoot.hn-layout-v164 .hn-character{display:block;left:50%;top:auto;bottom:0;transform:translateX(-50%);height:calc(100% - 20px);width:auto;max-width:none}
 #handRoot.hn-layout-v164 .hn-opponents{padding:0 8%;gap:5%}
 #handRoot.hn-layout-v164 .hn-seat-label{min-width:110px;min-height:22px}
 #handRoot.hn-layout-v164 .hn-meld-area{background:#061c3577}
 #handRoot.hn-layout-v164 .hn-tools{min-height:36px;padding:2px 6px}
 #handRoot.hn-layout-v164 .hn-tools button{min-height:32px;padding:4px 12px}
 #handRoot.hn-layout-v164 .hn-turn{gap:8px}
 #handRoot.hn-layout-v164 .hn-turn strong,#handRoot.hn-layout-v164 .hn-handline>span,#handRoot.hn-layout-v164 .hn-handline>span:last-of-type{font-size:11px}
 #handRoot.hn-layout-v164 .hn-piles{gap:24px}
 #handRoot.hn-scene .hn-meld-area .hn-card{--meld-w:34px}
}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-scene.hn-layout-v164{grid-template-rows:30px minmax(0,1fr) auto;--seat-h:44px;--hand-h:80px;--meta-h:20px;--card-w:48px;--card-h:67px;--pile-w:31px}
 #handRoot.hn-layout-v164 .hn-table,#handRoot.hn-layout-v164 .hn-table:has(.hn-meld){grid-template-columns:100px minmax(0,1fr);grid-template-rows:44px minmax(58px,1fr) 20px 80px;gap:2px 8px;padding:0 8px}
 #handRoot.hn-layout-v164 .hn-player{display:flex;align-items:center;justify-content:center;gap:6px}
 #handRoot.hn-layout-v164 .hn-character{position:static;transform:none;height:44px;width:44px;max-width:44px;flex:0 0 44px}
 #handRoot.hn-layout-v164 .hn-seat-label{position:static;transform:none;min-width:95px;width:auto;max-width:130px}
 #handRoot.hn-layout-v164 .hn-top,#handRoot.hn-layout-v164 .hn-top #hnExit{min-height:28px;height:28px}
 #handRoot.hn-layout-v164 .hn-round-tools #hnScore{min-height:28px;height:28px}
 #handRoot.hn-layout-v164 .hn-tools{min-height:34px;padding:1px 6px}
 #handRoot.hn-layout-v164 .hn-tools button{min-height:30px!important;font-size:11px!important}
 #handRoot.hn-layout-v164 .hn-meld-area{grid-template-rows:16px minmax(0,1fr)}
 #handRoot.hn-layout-v164 .hn-meld-area-head{min-height:16px;font-size:10px;line-height:12px}
 #handRoot.hn-layout-v164 .hn-meld-area-head small{font-size:9px}
 #handRoot.hn-layout-v164 .hn-meld-scroll{padding:2px;gap:5px}
 #handRoot.hn-layout-v164 .hn-meld,#handRoot.hn-layout-v164 .hn-draft .hn-pending{padding:2px}
 #handRoot.hn-scene .hn-meld-area .hn-card{--meld-w:26px}
 #handRoot.hn-scene .hn-meld-area .hn-card .hn-corner{font-size:10px!important}
 #handRoot.hn-scene .hn-meld-area .hn-card .hn-corner .hn-suit{width:7px!important;height:7px!important}
 #handRoot.hn-scene .hn-meld-area .hn-card .hn-pip>.hn-suit{width:15px!important;height:15px!important}
 #handRoot.hn-layout-v164 .hn-turn strong,#handRoot.hn-layout-v164 .hn-handline>span,#handRoot.hn-layout-v164 .hn-handline>span:last-of-type{font-size:10px}
}
@media(orientation:landscape) and (min-height:550px){
 #handRoot.hn-scene.hn-layout-v164{grid-template-rows:48px minmax(0,1fr) auto;--seat-h:160px;--hand-h:156px;--meta-h:30px;--card-w:96px;--card-h:134px;--pile-w:68px}
 #handRoot.hn-layout-v164 .hn-character{height:calc(100% - 27px)}
 #handRoot.hn-layout-v164 .hn-meld-area{grid-template-rows:24px minmax(0,1fr)}
 #handRoot.hn-scene .hn-meld-area .hn-card{--meld-w:48px}
}
#handRoot.hn-scene .hn-meld-area .hn-card.hn-joker .hn-corner{font-size:8px!important;font-weight:700}
@media(orientation:landscape) and (max-height:330px){#handRoot.hn-scene .hn-meld-area .hn-card.hn-joker .hn-corner{font-size:7px!important}}

/* Landscape cards use the available row width and a single readable rank/suit corner. */
@media(orientation:landscape){
 #handRoot.hn-scene .hn-private-group{height:calc(var(--display-cw)*1.4)}
 #handRoot.hn-scene .hn-private-group .hn-card{width:var(--display-cw);height:calc(var(--display-cw)*1.4);margin-left:calc(var(--step) - var(--display-cw))!important}
 #handRoot.hn-scene .hn-private-group .hn-card:first-child{margin-left:0!important}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-corner:not(.hn-bottom){inset:3px auto auto 3px;font-size:18px!important;line-height:1!important;padding:0}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-corner .hn-suit{width:12px;height:12px}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-bottom{display:none!important}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-pip:not(.hn-face){inset:0;display:grid;place-items:center}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-pip>.hn-suit{width:24px;height:24px}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-pip.hn-face{inset:3px 4% 3px 30%;overflow:hidden}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-court-suit{display:none}
 #handRoot.hn-scene .hn-private-group .hn-card.hn-joker .hn-corner:not(.hn-bottom){font-size:11px!important}
 #handRoot.hn-scene .hn-pile:disabled{opacity:1}
 #handRoot.hn-scene .hn-piles .hn-card .hn-corner:not(.hn-bottom){inset:2px auto auto 2px;font-size:12px!important;line-height:1!important;padding:0}
 #handRoot.hn-scene .hn-piles .hn-card .hn-corner .hn-suit{width:8px;height:8px}
 #handRoot.hn-scene .hn-piles .hn-card .hn-bottom{display:none!important}
 #handRoot.hn-scene .hn-piles .hn-card .hn-pip>.hn-suit{width:18px;height:18px}
 #handRoot.hn-scene .hn-piles .hn-card .hn-pip.hn-face{inset:2px 4% 2px 30%;overflow:hidden}
 #handRoot.hn-scene .hn-piles .hn-card .hn-court-suit{display:none}
 #handRoot.hn-scene .hn-piles .hn-card.hn-joker .hn-corner:not(.hn-bottom){font-size:8px!important}
}
@media(orientation:landscape) and (max-height:330px){
 #handRoot.hn-scene .hn-private-group .hn-card .hn-corner:not(.hn-bottom){font-size:16px!important}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-corner .hn-suit{width:10px;height:10px}
 #handRoot.hn-scene .hn-private-group .hn-card .hn-pip>.hn-suit{width:21px;height:21px}
 #handRoot.hn-scene .hn-piles .hn-card .hn-corner:not(.hn-bottom){font-size:10px!important}
 #handRoot.hn-scene .hn-piles .hn-card .hn-corner .hn-suit{width:7px;height:7px}
 #handRoot.hn-scene .hn-piles .hn-card .hn-pip>.hn-suit{width:13px;height:13px}
}

/* Lobby only: one viewport, with optional information in closable dialogs. */
#handRoot.hn-lobby-fixed{grid-template-rows:52px minmax(0,1fr);overflow:hidden;overscroll-behavior:none}
#handRoot.hn-lobby-fixed .hn-top{min-height:0;height:52px;padding:3px 8px;gap:6px;overflow:hidden}
#handRoot.hn-lobby-fixed .hn-top button{width:auto;min-width:36px;height:40px;padding:3px 8px;font-size:12px}
#handRoot.hn-lobby-fixed .hn-brand{gap:5px}
#handRoot.hn-lobby-fixed .hn-brand img,#handRoot.hn-lobby-fixed .hn-brand small{display:none}
#handRoot.hn-lobby-fixed .hn-brand b{font-size:18px}
#handRoot.hn-lobby-fixed .hn-round-tools{font-size:11px}
#handRoot.hn-lobby-fixed .hn-lobby-wrap{display:grid;place-items:stretch center;min-height:0;height:100%;padding:8px;overflow:hidden!important;overscroll-behavior:none}
#handRoot.hn-lobby-fixed .hn-lobby{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr) auto auto auto;grid-template-areas:'title' 'room' 'seats' 'options' 'status' 'actions' 'footer';align-content:stretch;gap:7px!important;width:min(680px,100%)!important;max-width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;padding:12px!important;margin:0!important;overflow:hidden!important;border-radius:20px}
#handRoot.hn-lobby-fixed .hn-lobby-title{grid-area:title;display:flex;align-items:center;justify-content:center;gap:10px;min-height:0;margin:0!important;padding:0!important}
#handRoot.hn-lobby-fixed .hn-lobby-title img{display:block;width:38px;height:38px;border-radius:10px;margin:0}
#handRoot.hn-lobby-fixed .hn-lobby-title h1{font-size:22px!important;line-height:1.2!important;margin:0!important}
#handRoot.hn-lobby-fixed .hn-lobby-title p,#handRoot.hn-lobby-fixed .hn-lobby>small{display:none!important}
#handRoot.hn-lobby-fixed .hn-room-code{grid-area:room;display:flex;align-items:center;justify-content:center;gap:10px;min-height:38px;padding:3px 10px;border:1px solid #68c9c577;border-radius:12px;background:#123346;color:#dfedef;font-size:13px}
#handRoot.hn-lobby-fixed .hn-room-code bdi{font-size:23px;font-weight:700;letter-spacing:3px;color:#ffdfa0;line-height:1.2}
#handRoot.hn-lobby-fixed .hn-room-code button{height:32px;min-height:32px;padding:2px 12px;border:1px solid #75b3b7;border-radius:8px;background:#184657;color:#e2ffff;font-size:13px}
#handRoot.hn-lobby-fixed .hn-seats{grid-area:seats;display:flex;flex-wrap:nowrap;gap:5px!important;justify-content:center;min-height:0;margin:0!important;padding:0!important}
#handRoot.hn-lobby-fixed .hn-seats>div{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;max-width:45%;padding:5px 8px!important;border-radius:9px;font-size:12px;overflow:hidden;white-space:nowrap}
#handRoot.hn-lobby-fixed .hn-seats b{overflow:hidden;text-overflow:ellipsis}
#handRoot.hn-lobby-fixed .hn-seats small{font-size:10px;white-space:nowrap}
#handRoot.hn-lobby-fixed .hn-lobby-options{grid-area:options;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(0,1fr);align-content:center;align-items:center;gap:8px!important;min-height:0;width:100%;margin:0!important;padding:0!important}
#handRoot.hn-lobby-fixed .hn-lobby-options label{display:flex!important;flex-direction:column!important;gap:4px!important;align-items:stretch!important;justify-content:center;min-width:0;margin:0!important;padding:0!important;font-size:13px!important;line-height:1.2!important;text-align:right}
#handRoot.hn-lobby-fixed .hn-lobby-options select{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:38px!important;height:38px!important;margin:0!important;padding:4px 8px!important;border-radius:10px;font-size:14px!important;line-height:1.2!important}
#handRoot.hn-lobby-fixed .hn-muted{grid-area:status;margin:0!important;padding:0!important;font-size:11px;line-height:1.3}
#handRoot.hn-lobby-fixed .hn-lobby-actions{grid-area:actions;display:flex;flex-wrap:wrap;gap:6px;min-height:0}
#handRoot.hn-lobby-fixed .hn-lobby-actions button{flex:1 1 45%;width:auto!important;min-width:0;min-height:40px!important;margin:0!important;padding:6px 9px!important;border-radius:10px;font-size:14px!important;line-height:1.2!important}
#handRoot.hn-lobby-fixed .hn-lobby-actions #hnResumePractice{flex-basis:100%}
#handRoot.hn-lobby-fixed .hn-lobby-footer{grid-area:footer;display:flex;justify-content:center;align-items:center;gap:7px;min-height:34px}
#handRoot.hn-lobby-fixed .hn-lobby-footer button{min-height:34px;padding:4px 14px;background:#132d43;color:#d1e8e9;border:1px solid #8db3b777;border-radius:9px;font-size:12px}
#handRoot.hn-lobby-fixed #hnNotice{grid-area:status;font-size:11px;line-height:1.3;color:#ffdda4;background:#102f42;z-index:1;max-height:30px;overflow:hidden}
#handRoot.hn-lobby-fixed #hnNotice:empty{display:none}
#handRoot.hn-lobby-fixed .hn-lobby>.hn-rules,#handRoot.hn-lobby-fixed #hnShare{display:none!important}
#handRoot .hn-lobby-info .hn-rules{display:block!important;font-size:14px}
#handRoot .hn-lobby-info{overflow:auto;overscroll-behavior:contain;padding:18px}
@media(orientation:portrait) and (max-height:560px){
 #handRoot.hn-lobby-fixed{grid-template-rows:44px minmax(0,1fr)}
 #handRoot.hn-lobby-fixed .hn-top{height:44px}
 #handRoot.hn-lobby-fixed .hn-top button{height:34px}
 #handRoot.hn-lobby-fixed .hn-lobby{gap:5px!important;padding:8px!important}
 #handRoot.hn-lobby-fixed .hn-lobby-title img{display:none}
 #handRoot.hn-lobby-fixed .hn-lobby-title h1{font-size:19px!important}
 #handRoot.hn-lobby-fixed .hn-room-code{min-height:32px}
 #handRoot.hn-lobby-fixed .hn-room-code bdi{font-size:21px}
 #handRoot.hn-lobby-fixed .hn-lobby-options{gap:6px!important}
 #handRoot.hn-lobby-fixed .hn-lobby-options select{min-height:34px!important;height:34px!important;font-size:13px!important}
 #handRoot.hn-lobby-fixed .hn-lobby-actions button{min-height:34px!important;font-size:12px!important}
}
@media(orientation:landscape){
 #handRoot.hn-lobby-fixed{grid-template-rows:36px minmax(0,1fr)}
 #handRoot.hn-lobby-fixed .hn-top{height:36px}
 #handRoot.hn-lobby-fixed .hn-top button{height:30px;font-size:11px}
 #handRoot.hn-lobby-fixed .hn-lobby-wrap{padding:4px 10px}
 #handRoot.hn-lobby-fixed .hn-lobby{width:min(1000px,100%)!important;padding:8px 12px!important;gap:5px 16px!important;grid-template-columns:minmax(200px,1fr) minmax(0,1.4fr);grid-template-rows:auto auto minmax(0,1fr) auto auto;grid-template-areas:'title options' 'room options' 'seats options' 'status footer' 'actions actions'}
 #handRoot.hn-lobby-fixed .hn-lobby-title img{display:none}
 #handRoot.hn-lobby-fixed .hn-lobby-title h1{font-size:19px!important}
 #handRoot.hn-lobby-fixed .hn-seats>div{padding:3px 6px!important}
 #handRoot.hn-lobby-fixed .hn-seats small{display:none}
 #handRoot.hn-lobby-fixed .hn-room-code{min-height:32px}
 #handRoot.hn-lobby-fixed .hn-room-code bdi{font-size:21px}
 #handRoot.hn-lobby-fixed .hn-lobby-options{gap:7px 10px!important}
 #handRoot.hn-lobby-fixed .hn-lobby-options select{height:34px!important;min-height:34px!important;font-size:13px!important}
 #handRoot.hn-lobby-fixed .hn-lobby-actions{flex-wrap:nowrap}
 #handRoot.hn-lobby-fixed .hn-lobby-actions button,#handRoot.hn-lobby-fixed .hn-lobby-actions #hnResumePractice{flex:1;min-height:34px!important;font-size:13px!important}
 #handRoot.hn-lobby-fixed .hn-lobby-footer{min-height:30px}
 #handRoot.hn-lobby-fixed .hn-lobby-footer button{min-height:30px;padding:2px 12px}
}
#handRoot.hn-lobby-fixed .hn-lobby .hn-seats{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;height:32px!important;min-height:32px!important;max-height:32px!important}
#handRoot.hn-lobby-fixed .hn-lobby .hn-seats>div{display:flex!important;flex-direction:row!important;align-items:center!important;min-height:28px!important;height:30px!important;max-height:30px!important;min-width:0!important;flex:0 1 auto!important;margin:0!important;line-height:1.2!important}
#handRoot.hn-lobby-fixed .hn-lobby .hn-seats small{display:none!important}
#handRoot.hn-lobby-fixed .hn-lobby .hn-lobby-options{grid-auto-rows:minmax(58px,1fr)!important}
@media(max-height:560px){#handRoot.hn-lobby-fixed .hn-lobby .hn-lobby-options{grid-auto-rows:minmax(54px,1fr)!important}}
#handRoot.hn-lobby-fixed .hn-lobby .hn-seats>div{flex:1 1 0!important;max-width:none!important}
#handRoot.hn-lobby-fixed .hn-lobby .hn-seats>div:only-child{flex:0 1 auto!important;min-width:110px!important;max-width:80%!important}
#handRoot.hn-lobby-fixed .hn-lobby .hn-seats b{display:block!important;min-width:0;flex:0 1 auto;font-size:12px!important;line-height:1.2!important}
