:root{font-family:Arial,"Segoe UI",sans-serif;color:#f5efda;background:#061d1c;color-scheme:dark;--gold:#e4bd72;--muted:#a9c3b5;--line:#ffffff22;--panel:#153f35;--tile:#f7f2df}*{box-sizing:border-box}body{margin:0;min-height:100dvh;display:flex;justify-content:center}button,input{font:inherit}button{cursor:pointer;border:1px solid #ffffff35;border-radius:8px;color:inherit;background:#ffffff09;min-height:36px;padding:6px 10px;font-weight:600;font-size:12px}button:hover:not(:disabled){background:#ffffff1e}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--gold);border-color:var(--gold);color:#24382e}button:focus-visible,input:focus-visible{outline:2px solid var(--gold);outline-offset:2px}input{min-width:0;width:100%;border:1px solid #ffffff32;border-radius:8px;padding:9px;background:#0a2e28;color:#fff8e5;font-size:16px}input::placeholder{color:#a4baac}h1,h2,h3,p{margin:0}h1{font:24px Georgia,serif;letter-spacing:-.03em}h2{font-size:15px}p{line-height:1.45}.shell{width:100%;max-width:460px;height:100dvh;display:grid;grid-template-rows:40px minmax(0,1fr);background:radial-gradient(ellipse at 40% 20%,#194c3e,#0a302a 80%);position:relative}header{display:flex;align-items:center;gap:8px;padding:3px 10px;border-bottom:1px solid var(--line);font-size:12px;letter-spacing:.08em}header em{color:var(--gold);font-style:normal}#connection{margin-left:auto;font-size:9px;letter-spacing:0;max-width:100px;text-align:right}header .icon{width:32px;min-height:30px;padding:0}main{min-height:0;padding:8px}.welcome{height:100%;display:grid;grid-template-rows:30px auto 42px 24px minmax(0,1fr) 36px 28px;gap:7px}
.welcome:has(#network-note[hidden]){height:100%;display:grid;grid-template-rows:30px auto 42px 24px minmax(0,1fr) 36px;gap:7px}.welcome-heading{display:flex;align-items:center;justify-content:space-between;gap:5px}.welcome-heading h1{font-size:21px}.welcome-heading>span{font-size:10px;color:var(--muted);text-align:right;max-width:85px}.create-row{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:6px;height:42px}.visibility{display:flex;gap:6px;border:0;padding:0;margin:6px 0 0}.visibility label{display:flex;align-items:center;justify-content:center;gap:5px;flex:1;border:1px solid var(--line);border-radius:8px;height:38px;font-size:13px;cursor:pointer}.visibility label:has(input:checked){border-color:var(--gold);background:#e4bd7212}.visibility input{width:15px;height:15px;margin:0;accent-color:var(--gold)}.visibility small{font-size:10px;color:var(--muted)}.join-row{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:6px}.directory-heading{display:flex;align-items:center;justify-content:space-between}.text-button{padding:0 6px;border:0;background:transparent;min-height:24px;color:var(--gold);font-size:11px}.directory{display:grid;grid-template-rows:repeat(var(--rows,3),minmax(0,1fr));gap:6px;min-height:0}.room-card{display:grid;grid-template-columns:minmax(0,1fr) 72px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:7px 9px;background:#ffffff05;min-height:0}.room-card h3{font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:4px}.room-card p{color:var(--muted);font-size:11px}.room-card button{min-height:38px;padding:4px;font-size:12px}.directory-empty{grid-row:1/-1;display:grid;place-content:center;gap:8px;text-align:center;border:1px dashed var(--line);border-radius:9px;color:var(--muted);font-size:12px}.pagination{display:flex;align-items:center;justify-content:center;gap:18px;font-size:12px}.pagination button{width:44px;padding:0;font-size:22px}.local-note{font-size:11px;color:var(--muted);line-height:1.3;align-self:center}.room{height:100%;display:grid;grid-template-rows:36px minmax(0,1fr);gap:5px}.room-bar{display:flex;align-items:center;justify-content:space-between;gap:3px;border-bottom:1px solid var(--line)}.room-bar>span{font-size:11px;white-space:nowrap}.room-bar b{letter-spacing:.08em}.room-bar small{color:var(--gold);font-size:9px;display:block}.room-bar>div{display:flex;gap:3px}.room-bar button{padding:3px 7px;min-height:31px;font-size:11px}.lobby{display:grid;grid-template-rows:52px minmax(0,1fr) 44px 42px;gap:10px;padding:8px 0}.lobby-heading{text-align:center}.lobby-heading p{color:var(--muted);font-size:12px;margin-top:5px}.seat-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:8px;min-height:0}.seat-card{border:1px solid var(--line);border-radius:12px;padding:14px 10px;display:flex;flex-direction:column;justify-content:center;gap:9px;min-width:0;background:#ffffff05}.seat-card.mine{border-color:#e4bd7370}.seat-number{font:26px Georgia,serif;color:var(--gold)}.seat-card h3{font-size:16px;overflow-wrap:anywhere}.seat-card p{font-size:12px;color:var(--muted)}.lobby-actions{display:flex;gap:8px}.lobby-actions button{flex:1;min-height:44px}.lobby-note{font-size:12px;color:var(--muted);text-align:center;align-self:center}.game{min-height:0;display:grid;grid-template-rows:24px minmax(96px,1fr) 28px auto 108px 44px 20px;gap:4px}.game-stats{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:var(--muted)}#timer{color:var(--gold);font-size:12px}.table{min-height:0;border:1px solid #56867570;border-radius:12px;padding:7px;background:radial-gradient(ellipse,#24634c,#124635);display:grid;grid-template-rows:auto minmax(30px,1fr) auto 20px;gap:4px}.opponents{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.opponent{border:1px solid #ffffff19;background:#07362d70;border-radius:7px;padding:5px 4px;min-width:0}.opponent.active{border-color:var(--gold)}.opponent h3{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.opponent p{font-size:10px;color:#c9d9c8;white-space:nowrap}.opponent .seat-role{font-size:9px;color:var(--gold)}.table-center{display:flex;align-items:center;justify-content:center;gap:10px;min-height:0;text-align:center}.table-center h2{font:20px Georgia,serif;line-height:1.05}.table-center p{font-size:10px;color:#c1d6c7;margin-top:4px;max-width:205px}#last-discard:empty{display:none}#last-discard .tile{width:35px;height:45px}.discards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.river-preview{display:flex;align-items:center;justify-content:center;gap:3px;min-width:0;font-size:10px;color:#d8e0cc}.river-preview .tile{width:17px;height:23px;border-radius:3px;border-bottom-width:2px}.river-preview .tile svg{width:100%;height:100%}.table-details{border:0;background:transparent;min-height:20px;padding:0;font-size:10px;color:#d2e0ce}.hand-heading{display:flex;align-items:center;gap:6px;font-size:12px}.hand-heading strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hand-heading>span{color:var(--gold);margin-left:auto;white-space:nowrap;font-size:11px}.hand-heading button{min-height:27px;padding:3px 8px;font-size:11px}.my-melds{display:flex;gap:5px;min-height:0}.my-melds:empty{display:none}.meld-group{display:flex;gap:1px}.meld-group .tile{width:16px;height:24px;border-radius:3px;border-bottom-width:2px}.hand{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(2,52px);gap:4px;align-content:start;touch-action:none}.tile{display:inline-flex;align-items:center;justify-content:center;border:1px solid #e7dbb9;border-bottom:4px solid #afbd84;border-radius:6px;background:linear-gradient(#fffdf1,#eee6c9);color:#135545;padding:1px;min-width:0;min-height:0;box-shadow:0 1px 2px #001b2440;vertical-align:middle;flex-shrink:0}.tile svg{width:100%;height:100%;pointer-events:none}.hand .tile{width:100%;height:52px;min-height:52px;touch-action:none;user-select:none;-webkit-user-select:none}.hand .tile.selected{outline:2px solid #f5c567;outline-offset:0;background:#fff5cc;transform:translateY(-1px)}.hand .tile.drawn{border-top:3px solid var(--gold)}.tile.concealed{background:#799b7b;border-color:#bfd0aa}.tile.drag-origin{opacity:.35}.tile.drop-target{outline:3px dashed var(--gold);outline-offset:-3px}.drag-ghost{position:fixed;z-index:30;pointer-events:none;opacity:.95;transform:rotate(-5deg);box-shadow:0 5px 12px #0007}.actions{display:flex;gap:4px;align-items:stretch;min-height:0}.actions>button{flex:1;min-width:0;min-height:44px;padding:4px;font-size:12px;line-height:1.15}.hand-help{font-size:10px;color:var(--muted);line-height:1.3;align-self:center;text-align:center}.actions .waiting{font-size:12px;align-self:center;color:var(--muted);width:100%;text-align:center}.notice{position:absolute;z-index:8;left:10px;right:10px;top:45px;display:flex;align-items:center;gap:8px;padding:10px;background:#f2e7c9;color:#183d31;border-radius:9px;box-shadow:0 5px 20px #0004;font-size:12px;line-height:1.35}.notice>span{flex:1}.notice button{color:#183d31;border:0;font-size:22px;padding:0 7px}dialog{width:calc(100% - 24px);max-width:430px;max-height:85dvh;overflow:auto;border:1px solid #648878;border-radius:14px;background:#123d33;color:#f5efda;padding:16px}dialog::backdrop{background:#001d23b0}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.dialog-head h2{font:24px Georgia,serif}.dialog-head button{font-size:24px;width:38px;padding:0}dialog p,dialog li{font-size:14px;line-height:1.6;margin-bottom:12px}dialog h3{font-size:15px;margin:12px 0 8px}dialog label{display:block;font-size:13px;margin:10px 0}dialog input{margin-bottom:10px}dialog .tile{width:25px;height:35px;margin:2px}.full-seat{border-top:1px solid var(--line);padding:9px 0}.full-seat .tiles{display:flex;flex-wrap:wrap}.choices,.voice-controls,.arrange-controls{display:flex;flex-wrap:wrap;gap:8px}.choices button,.voice-controls button,.arrange-controls button{min-height:44px;flex:1}.score-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:12px}.score-grid p{font-size:12px;margin:0}#voice-members span{display:inline-block;padding:5px 8px;border:1px solid var(--line);border-radius:15px;font-size:11px;margin:4px}#result button{min-height:44px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;white-space:nowrap;border:0}[hidden]{display:none!important}
@media(min-width:600px){.shell{border-left:1px solid #ffffff15;border-right:1px solid #ffffff15;box-shadow:0 0 80px #0007}}
@media(max-height:650px){.welcome{grid-template-rows:26px auto 40px 22px minmax(0,1fr) 32px 24px;gap:6px}
.welcome:has(#network-note[hidden]){grid-template-rows:26px auto 40px 22px minmax(0,1fr) 32px;gap:6px}.welcome-heading h1{font-size:20px}.visibility label{height:36px}.room-card{padding:5px 8px}.room-card p{font-size:10px}.pagination button{min-height:32px}.game{grid-template-rows:22px minmax(96px,1fr) 26px auto 104px 42px 18px;gap:3px}.hand{grid-template-rows:repeat(2,50px)}.hand .tile{height:50px;min-height:50px}.actions>button{min-height:42px;font-size:11px}.table{padding:5px;gap:3px}.opponent{padding:4px}.table-center h2{font-size:18px}.table-center p{font-size:10px}.lobby{gap:7px}.seat-card{padding:10px}.hand-help{font-size:10px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.table{position:relative;grid-template-rows:auto minmax(30px,1fr) auto}.discards{padding-right:22px}.table-details{position:absolute;bottom:3px;right:3px;width:22px;height:22px;font-size:0}.table-details::after{content:'•••';font-size:10px}#last-discard .tile{width:28px;height:36px}.opponent p{overflow:hidden;text-overflow:ellipsis}
.table-center>div:first-child{min-width:0;max-width:calc(100% - 38px)}.table-center h2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}dialog h3,dialog p{overflow-wrap:anywhere}
.game-stats{grid-row:1}.game>.table{grid-row:2}.hand-heading{grid-row:3}.my-melds{grid-row:4}.hand{grid-row:5}.actions{grid-row:6}.hand-help{grid-row:7}
.hand .tile:hover:not(:disabled){background:linear-gradient(#fffdf1,#eee6c9)}.hand .tile.selected:hover:not(:disabled){background:#fff5cc}
.tile{background:linear-gradient(112deg,#fffef6 0%,#f8f4e7 57%,#e8e2d2 100%);border-color:#e7dfcb;border-bottom-color:#c6bda4;box-shadow:inset 1px 1px 0 #fff,inset -1px 0 0 #d9d0ba,0 2px 2px #001b2445;border-radius:5px}
.hand .tile:hover:not(:disabled),.hand .tile.selected:hover:not(:disabled),.hand .tile.selected{background:linear-gradient(112deg,#fffef6 0%,#f8f4e7 57%,#e8e2d2 100%)}
.hand .tile.selected{outline:1px solid #e8c67e;box-shadow:inset 1px 1px 0 #fff,0 0 0 2px #e8c67e50,0 3px 4px #001b2460;transform:translateY(-2px)}
.river-table{grid-template-rows:36px minmax(0,1fr) 24px;gap:4px}.river-table .opponents{display:none}.river-table .table-center{grid-row:1;justify-content:space-between;text-align:left;padding:0 3px}.river-table .table-center h2{font-size:17px}.river-table .table-center p{margin-top:1px}.river-table .discards{grid-row:2;display:grid;grid-template-rows:repeat(4,minmax(0,1fr));grid-template-columns:1fr;gap:0;padding:0;min-height:0}.river-row{display:grid;grid-template-columns:64px minmax(0,1fr);gap:6px;align-items:center;min-height:0;border-top:1px solid #ffffff20;padding:2px 0}.river-owner{min-width:0}.river-owner h3{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.river-owner span,.river-owner small{display:block;font-size:9px;line-height:1.35;color:#c9d9c8}.river-row.active .river-owner h3{color:var(--gold)}.river-tiles{display:grid;gap:2px;align-content:center;min-width:0;min-height:0}.discard-entry{display:flex;flex-direction:column;align-items:center;width:100%;min-width:0;height:38px}.discard-entry>.tile{width:24px;height:30px;border-bottom-width:2px;border-radius:3px;max-width:100%}.discard-entry>small{font-size:8px;line-height:8px;color:#dae4d7}.discard-entry.latest>.tile{outline:2px solid var(--gold);outline-offset:0}.discard-entry.claimed>.tile{opacity:.48;position:relative}.discard-entry.claimed>.tile:after{content:'';position:absolute;width:110%;height:1px;background:#d95d43;transform:rotate(-45deg)}.discard-entry.claimed>small{color:#ffc9b3}.river-empty{grid-column:1/-1;font-size:10px;color:#9fbbab}.river-navigation{grid-row:3;display:flex;align-items:center;justify-content:flex-end;gap:4px;font-size:9px;min-width:0;padding-right:23px}.river-navigation button{min-height:24px;height:24px;padding:0 5px;font-size:12px;min-width:23px}.river-navigation #river-note{margin-right:auto;font-size:8px}.river-navigation #river-page{white-space:nowrap}.river-table .table-details{bottom:5px}.river-table #last-discard .tile{height:31px;width:24px}
@media(max-height:650px){.river-table{grid-template-rows:32px minmax(0,1fr) 24px;gap:3px}.river-row{grid-template-columns:64px minmax(0,1fr);padding:1px 0}.discard-entry{height:31px}.discard-entry>.tile{width:20px;height:24px}.discard-entry>small{font-size:7px;line-height:7px}.river-owner h3{font-size:10px}.river-owner span,.river-owner small{font-size:8px}.river-navigation{gap:2px}.river-navigation #river-note{font-size:7px}.river-table .table-center h2{font-size:15px}}
#last-discard.claimed-preview{opacity:.48;position:relative}#last-discard.claimed-preview:after{content:'↗';position:absolute;right:-2px;bottom:-2px;color:#ffc9b3;font-size:12px}.full-seat .discard-entry{width:30px;height:44px;margin:2px}.full-seat .discard-entry .tile{margin:0;height:34px;width:25px}
.shell{--hand-tile-height:clamp(56px,calc((100vw - 40px)/7/.73),82px)}
/* Suppress the browser's touch flash without changing keyboard focus or tile selection. */
html{-webkit-tap-highlight-color:transparent}
button{touch-action:manipulation}
.game{grid-template-rows:24px minmax(96px,1fr) 36px auto calc(var(--hand-tile-height)*2 + 4px) 44px 20px}
.hand{grid-template-rows:repeat(2,var(--hand-tile-height))}.hand .tile{height:var(--hand-tile-height);min-height:var(--hand-tile-height)}
.hand-heading button{min-height:32px;height:32px;white-space:nowrap}.hand-heading #sort-hand-direct{font-size:11px;padding:3px 7px}
.meld-group .tile{width:17px;height:24px}.river-table #last-discard .tile{width:23px;height:32px}
.discard-entry>.tile{width:23px;height:32px}.discard-entry{height:40px}.full-seat .discard-entry .tile{width:25px;height:35px}
@media(max-height:650px){.game{grid-template-rows:22px minmax(96px,1fr) 32px auto calc(var(--hand-tile-height)*2 + 4px) 42px 16px;gap:3px}.river-table{grid-template-rows:30px minmax(0,1fr) 24px}.river-table .table-center p{line-height:1.2}.discard-entry{height:33px}.discard-entry>.tile{width:19px;height:26px}.hand-heading{gap:5px}.hand-heading button{font-size:10px}.hand-heading #sort-hand-direct{font-size:10px}.hand-help{font-size:9px}}
#claim-panel{width:calc(100% - 16px);max-width:430px;height:min(580px,calc(100dvh - 16px));max-height:calc(100dvh - 16px);padding:12px;background:#123c32;border:2px solid #b39b65;overflow:hidden}
#claim-panel[open]{display:grid;grid-template-rows:34px 90px 44px minmax(0,1fr) 30px 48px;gap:8px}#claim-panel::backdrop{background:#001913db}
.claim-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.claim-panel-head h2{font-size:18px}.claim-panel-head strong{font-size:16px;color:#ffe2a2;white-space:nowrap;padding:5px 7px;background:#ffffff10;border-radius:7px}
.claim-discard{display:flex;align-items:center;gap:14px;min-width:0}.claim-discard>div:last-child{min-width:0}.claim-discard p{margin:0!important;font-size:12px!important;line-height:1.35!important}.claim-discard strong{display:block;font-size:17px;margin:5px 0;overflow-wrap:anywhere}#claim-source{max-height:34px;overflow:auto;overflow-wrap:anywhere}#claim-incoming .tile{width:60px;height:84px;margin:0;border-bottom-width:5px}
#claim-types{display:flex;gap:5px}#claim-types button{flex:1;min-width:0;min-height:44px;padding:4px 3px;font-size:12px;line-height:1.2}#claim-types button[aria-pressed=true]{background:#e4bd72;color:#183b2e;border-color:#e4bd72}
#claim-combinations{min-height:0;overflow:auto;display:flex;flex-direction:column;gap:7px;padding:3px}.claim-empty{font-size:15px!important;line-height:1.6!important;margin:auto 5px!important;text-align:center;color:#c8dbca}
.claim-combination{flex:none;display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;min-height:78px;padding:6px;background:#082b24;border:1px solid #728c76}.claim-combination[aria-pressed=true]{outline:2px solid #e4bd72;outline-offset:-2px;background:#214d3d}.combination-label{font-size:12px;max-width:65px;text-align:left}.combination-tiles{display:flex;gap:3px;flex-wrap:wrap;justify-content:center;min-width:0}.combination-tiles .tile{width:43px;height:60px;margin:0;border-bottom-width:3px;flex-shrink:0}.combination-tiles .incoming-tile{outline:2px solid #d7ad58;outline-offset:-1px}
.claim-combination.winning{display:block;text-align:left}.winning .combination-label{display:block;margin-bottom:7px}.winning .combination-tiles{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.winning .tile{width:100%;height:auto;aspect-ratio:.72;min-height:0}
#claim-hint{font-size:11px!important;line-height:1.3!important;margin:0!important;color:#cfddcb;align-self:center}.claim-panel-actions{display:grid;grid-template-columns:78px minmax(0,1fr);gap:8px}.claim-panel-actions button{min-height:48px;font-size:13px;padding:5px}#claim-panel button:focus-visible{outline:3px solid #ffdd8d;outline-offset:1px}
@media(max-width:350px){#claim-panel{padding:10px}.combination-tiles .tile{width:39px;height:55px}.combination-label{font-size:11px;max-width:57px}#claim-types button{font-size:11px}.claim-panel-head h2{font-size:17px}.claim-panel-actions button{font-size:12px}}
#claim-panel[open]{gap:6px}#claim-combinations{gap:6px}.combination-tiles .tile{width:48px;height:67px}@media(max-width:350px){.combination-tiles .tile{width:44px;height:62px}}.winning .tile{width:100%;height:auto}
.tile,.hand .tile:hover:not(:disabled),.hand .tile.selected:hover:not(:disabled),.hand .tile.selected{background:linear-gradient(115deg,#fff 0%,#fcfcfc 60%,#eceff0 100%);border-color:#dfe3e4;border-bottom-color:#b9c2c5;box-shadow:inset 1px 1px 0 #fff,inset -1px 0 0 #dce1e3,0 2px 2px #001b2445}
.tile.concealed{background:#799b7b;border-color:#bfd0aa}.hand .tile.selected{outline:1px solid #e8c67e;box-shadow:inset 1px 1px 0 #fff,0 0 0 2px #e8c67e50,0 3px 4px #001b2460}

/* Keep touch feedback on the card border, preserving white tile previews. */
#claim-panel button{-webkit-tap-highlight-color:transparent}

@media(max-height:650px){.discard-entry{height:28px}.discard-entry>.tile{width:15px;height:21px}}
/* Compact, non-modal claim sheet is bounded by the central table. */
#claim-panel{position:absolute;inset:0;margin:0;width:100%;max-width:none;height:100%;max-height:100%;padding:5px;border:1px solid #b39b65;border-radius:8px;z-index:3;box-shadow:none}
#claim-panel[open]{display:grid;grid-template-columns: minmax(0,1fr) auto;grid-template-rows:40px 36px minmax(48px,1fr) 36px;gap:3px}
.claim-panel-head{grid-column:1;grid-row:1;gap:4px;justify-content:flex-start}.claim-panel-head h2{font-size:14px}.claim-panel-head strong{font-size:18px;padding:0 4px;background:none}
.claim-discard{grid-column:2;grid-row:1;gap:5px}.claim-discard strong{font-size:12px;margin:0}.claim-discard p{display:none}#claim-incoming .tile{width:25px;height:35px;border-bottom-width:2px}
#claim-types{grid-column:1/-1;grid-row:2;gap:3px}#claim-types button{min-height:36px;font-size:12px;padding:2px}
#claim-combinations{grid-column:1/-1;grid-row:3;display:flex;flex-direction:row;overflow:hidden;gap:3px;padding:2px}
.claim-combination{flex:1;min-width:0;width:auto;min-height:0;padding:2px;display:flex;flex-direction:column;justify-content:center;gap:2px}.combination-label{font-size:12px;max-width:none;text-align:center;line-height:14px}.combination-tiles{gap:2px;flex-wrap:nowrap}.combination-tiles .tile{width:25px;height:35px;border-bottom-width:2px}
.claim-combination:only-child{flex-direction:row;gap:8px}.claim-combination:only-child .tile{width:29px;height:40px}.claim-combination.winning{display:flex;flex-direction:row}.winning .combination-label{display:none}.winning .combination-tiles{display:flex;flex-wrap:wrap;max-width:250px;gap:2px}.claim-combination.winning .tile{width:20px;height:28px}
#claim-hint{display:none}.claim-panel-actions{grid-column:1/-1;grid-row:4;grid-template-columns:70px minmax(0,1fr);gap:4px}.claim-panel-actions button{min-height:36px;padding:2px;font-size:12px}
.table:has(#claim-panel[open])>.table-center,.table:has(#claim-panel[open])>.discards,.table:has(#claim-panel[open])>.river-navigation,.table:has(#claim-panel[open])>.table-details{visibility:hidden}
.game-stats{position:relative}#timer{display:flex;align-items:center;gap:4px;white-space:nowrap}#timer small{font-size:10px}#timer b{font-size:19px;line-height:1;font-variant-numeric:tabular-nums}#timer.own-turn{background:#ffe2a2;color:#142e27;border-radius:5px;padding:2px 5px;z-index:1}#timer.own-turn b{font-size:32px}#timer.own-turn small{font-size:11px}
@media(min-height:651px){#claim-panel{height:230px;top:50%;transform:translateY(-50%)}.combination-tiles .tile{width:32px;height:45px}.claim-combination:only-child .tile{width:36px;height:50px}}
.my-melds{flex-wrap:wrap;gap:2px}.bonus-board{flex-basis:100%;display:flex;align-items:center;gap:3px;min-width:0;height:36px}.bonus-caption{font-size:10px;color:#e4bd72;margin-right:1px}.bonus-owner{display:flex;align-items:center;gap:1px;min-width:0}.bonus-owner>b{font-size:10px;padding:0 1px}.bonus-board .tile{width:23px;height:32px;min-width:0;border-bottom-width:2px;border-radius:3px;flex-shrink:0}.bonus-detail .tile{width:39px;height:54px;margin:3px}
@media(max-height:650px){#claim-panel[open]{grid-template-rows:34px 32px minmax(42px,1fr) 34px;gap:2px}.claim-panel-actions button{min-height:34px}#claim-types button{min-height:32px}.combination-tiles .tile{width:22px;height:31px}.claim-combination:only-child .tile{width:25px;height:35px}.claim-combination.winning .tile{width:17px;height:24px}.winning .combination-tiles{max-width:200px}.bonus-board{height:34px}}
/* Rivers share the remaining table height with the public bonus shelf. */
.river-tiles{height:100%;grid-auto-rows:minmax(0,1fr);align-content:center}.river-row{align-items:stretch}.river-owner{align-self:center}.river-tiles .discard-entry{height:100%;max-height:40px;min-height:0;align-self:center}.river-tiles .discard-entry>.tile{height:calc(100% - 8px);max-height:32px;min-height:0;width:auto;aspect-ratio:.72;flex-shrink:1}.river-tiles .discard-entry>small{flex-shrink:0}
@media(max-height:650px){.river-owner span{display:none}.river-owner h3{line-height:1.1}.river-owner small{line-height:1.2}.river-tiles .discard-entry{max-height:28px}.river-tiles .discard-entry>.tile{height:calc(100% - 7px);max-height:21px}}
/* Portrait prototype; no rotation requirement. */



/* Shared visual language: dark teal canvas, warm primary actions, clear sections. */
:root{font-family:Arial,"Segoe UI",sans-serif;--gold:#efd08a;--muted:#b4cec5;--line:#bfd9ca26}button{border-radius:6px}header em{font-weight:800;letter-spacing:.1em}.welcome-heading h1{font-family:Georgia,serif;font-weight:normal}.welcome #entry,.welcome #join-form{border-radius:8px}.visibility label{background:#ffffff06}.room-card{background:#153e34;border-color:#507768}.seat-card{background:#143e33}.seat-card.mine{background:#24513f;border-color:#e4c483}.lobby-actions .primary{box-shadow:0 2px 0 #0003}dialog{border:1px solid #809985;background:#123b30;border-radius:10px}dialog h2{font-size:18px}.dialog-head{gap:8px}.dialog-head button{min-width:40px}#result{padding:8px 0}.voice-explainer{font-size:12px;color:#bad1c6;line-height:1.5}
#chat-dialog{width:min(460px,calc(100vw - 16px));height:min(420px,calc(min(var(--visual-height,100dvh),100dvh) - 12px));max-height:calc(min(var(--visual-height,100dvh),100dvh) - 12px);padding:10px;top:var(--visual-top,0px);bottom:auto;margin-top:6px;overflow:hidden}#chat-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr) 40px auto;gap:7px}#chat-dialog .dialog-head{margin:0;align-items:center}#chat-dialog small{font-size:10px;color:#c9dcd1}#chat-messages{overflow:auto;overscroll-behavior:contain;min-height:0;padding:2px 4px}.chat-message{padding:7px 8px;margin-bottom:6px;border-radius:7px;background:#ffffff0a}.chat-message b{font-size:11px;color:#efd08a}.chat-message p{font-size:14px;line-height:1.4;margin:3px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.chat-empty{font-size:13px;color:#b4cec5}#chat-form{display:grid;grid-template-columns:minmax(0,1fr) 62px;gap:5px}#chat-input{font-size:16px}#chat-feedback{font-size:10px;line-height:1.2;margin:0;color:#c9dcd1}

#chat-dialog .dialog-head button{width:auto;min-width:56px;flex-shrink:0;font-size:12px;line-height:1.2;padding:4px 8px}#chat-form{min-height:0}#chat-input{margin:0;height:100%;min-height:0;padding:6px 8px}#chat-form button{height:100%;min-height:0;padding:4px;font-size:12px}

:root{--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}


/* Portrait-first v0.4 preview, safe-area aware across entry, lobby and game. */
body{padding:var(--safe-top,0px) var(--safe-right,0px) var(--safe-bottom,0px) var(--safe-left,0px)}
.shell{width:100%;max-width:460px;height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px));--hand-tile-height:clamp(56px,calc((min(100vw,460px) - 40px - var(--safe-left,0px) - var(--safe-right,0px))/7/.73),82px)}
.welcome-heading h1{font-size:20px;line-height:1.05}.welcome-heading>span{font-size:10px;min-width:68px}.welcome{grid-template-rows:minmax(34px,auto) auto 42px 24px minmax(70px,1fr) 36px 28px}
.welcome:has(#network-note[hidden]){grid-template-rows:minmax(34px,auto) auto 42px 24px minmax(70px,1fr) 36px}.welcome #entry{padding:8px;border:1px solid #ffffff22;background:#ffffff05}.visibility label{min-width:0;font-size:12px}.visibility small{font-size:9px}.welcome .create-row{grid-template-columns:minmax(0,1fr) 92px}.welcome #join-form{grid-template-columns:minmax(0,1fr) 92px}.local-note{line-height:1.25}
.room-bar button{padding:3px 6px;font-size:11px}.room-bar>div{gap:3px}.room-bar>span{font-size:10px}.hand-heading{font-size:12px}.actions>button{font-size:13px;border-radius:8px}.hand .tile{border-radius:6px}.hand{grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(2,var(--hand-tile-height))}
.game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(96px,1fr) 36px auto var(--hand-tile-height) 44px 20px}.hand:not(:has(.tile:nth-child(8))){grid-template-rows:var(--hand-tile-height)}
#chat-dialog{width:min(440px,calc(100vw - var(--safe-left,0px) - var(--safe-right,0px) - 16px));left:var(--safe-left,0px);right:var(--safe-right,0px)}
.dialog-head{position:sticky;top:-10px;background:#123b30;z-index:1;padding:3px 0}.dialog-head button{flex-shrink:0}dialog:not(#claim-panel):not(#chat-dialog){max-height:calc(min(var(--visual-height,100dvh),100dvh) - 16px);max-width:calc(100vw - 16px)}
@media(max-height:650px){.shell{grid-template-rows:34px minmax(0,1fr)}header{font-size:11px;padding:2px 8px}.welcome{gap:5px;grid-template-rows:32px auto 40px 22px minmax(56px,1fr) 30px 24px}
.welcome:has(#network-note[hidden]){gap:5px;grid-template-rows:32px auto 40px 22px minmax(56px,1fr) 30px}.welcome #entry{padding:6px}.welcome-heading h1{font-size:18px}.visibility label{height:34px}.welcome .pagination button{height:30px;min-height:30px}.room{grid-template-rows:34px minmax(0,1fr);gap:4px}.game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:22px minmax(96px,1fr) 32px auto var(--hand-tile-height) 42px 16px}.actions>button{font-size:12px}}
@media(max-height:600px){#claim-panel{padding:3px}#claim-panel[open]{grid-template-rows:28px 30px minmax(42px,1fr) 32px;gap:2px}.claim-panel-head h2{font-size:13px}.claim-panel-head strong{font-size:17px}.claim-discard strong{font-size:11px}#claim-incoming .tile{width:19px;height:27px}#claim-types button{min-height:30px}.claim-panel-actions button{min-height:32px}.claim-combination{padding:1px}.combination-label{font-size:11px;line-height:12px}.combination-tiles .tile{width:20px;height:28px}.claim-combination:only-child .tile{width:25px;height:35px}.claim-combination.winning .tile{width:17px;height:24px}}
@media(max-height:450px){.shell:has(#welcome:not([hidden])),.shell:has(#lobby:not([hidden])){height:auto;min-height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px))}.welcome{height:auto;min-height:450px}.lobby{min-height:420px}}
/* Light Mahjong palette: jade felt, cream surfaces, white tile bodies. */
:root{color-scheme:light;background:#e8eee5;color:#173e30;--gold:#755a1c;--muted:#4d6858;--line:#b9c8b5;--panel:#faf8ed;--tile:#fff;font-family:system-ui,-apple-system,'Segoe UI',Arial,sans-serif}
body{background:radial-gradient(ellipse at 50% 0,#f9f8ed,#e1eadd)}.shell{background:linear-gradient(180deg,#fffdf4,#eaf2e5);box-shadow:0 0 28px #3c604c12}header{background:#faf8ec;border-bottom:1px solid #cbbd8f;color:#234b38}header em{color:#27694e}#connection{color:#4d6858}button{background:#f8f8ef;color:#244b38;border-color:#b5c5ad;font-weight:650}button:hover:not(:disabled){background:#e2ecd9}button.primary{background:#28674f;border-color:#215841;color:#fffdf5}button:disabled{opacity:.58}button:focus-visible,input:focus-visible{outline-color:#927020}input{background:#fffef9;border-color:#a5bca9;color:#173e30}input::placeholder{color:#607567}
.welcome-heading h1,.lobby-heading h1{color:#234f3a;font-family:Georgia,serif}.welcome-heading>span,.local-note,.lobby-note{color:#526b59}.welcome #entry{background:#faf8ed;border-color:#c8cfb7}.visibility label{background:#fffdf4;border-color:#b8c8b1}.visibility label:has(input:checked){background:#dcead5;border-color:#78976c}.visibility small{color:#516952}.directory-empty{color:#526b59;border-color:#b5c6ae;background:#f3f6eb}.room-card{background:#fffdf3;border-color:#c7ceaf}.room-card p{color:#526b59}.text-button{color:#476c41}.pagination{color:#365641}
.room-bar{border-color:#c2ceb8}.room-bar small{color:#635221}.seat-card{background:#faf9ee;border-color:#bdcdb4}.seat-card.mine{background:#e1ecd7;border-color:#a49353}.seat-number{color:#7b6024}.seat-card p{color:#536c59}.game-stats{color:#4d6858}#timer{color:#745818}#timer.own-turn{background:#fae9ad;border:1px solid #c6aa57;color:#284532}.hand-heading>span{color:#755a1c}.hand-help{color:#476951}
.table{background:radial-gradient(ellipse at 50% 40%,#d4e6d9,#b9d4c1);border-color:#85aa8c;box-shadow:inset 0 1px 3px #67836a12}.table-center h2{color:#1d4b35}.table-center p{color:#3f624c}.river-row{border-top-color:#789d803d}.river-owner span,.river-owner small{color:#3f624c}.river-owner h3{color:#204b36}.river-row.active .river-owner h3{color:#6b5113}.river-empty{color:#496c52}.discard-entry>small{color:#31513a}.discard-entry.claimed>.tile{opacity:.65}.discard-entry.claimed>small{color:#874032}.river-navigation,.river-navigation #river-note,.table-details{color:#385e45}.river-navigation button{background:#e0eddc;border-color:#9ab594;color:#2e593c}.bonus-caption{color:#745818}.bonus-owner>b{color:#37573e}
#claim-panel{background:#faf8ec;border-color:#a89c62;box-shadow:0 1px 5px #36523920}.claim-panel-head h2{color:#244c37}.claim-panel-head strong{color:#775416}.claim-discard strong,.claim-discard p{color:#365b40}#claim-types button{background:#edf3e3;border-color:#b5c7a8;color:#294d35}#claim-types button[aria-pressed=true]{background:#2c6b50;border-color:#245940;color:#fffdf6}.claim-combination{background:#f1f4e7;border-color:#b4c6a7;color:#26472f}.claim-combination[aria-pressed=true]{background:#e3ebd2;outline-color:#9d8033}.claim-empty,#claim-hint{color:#4d6850}#claim-panel button:focus-visible{outline-color:#876716}
dialog{background:#fffdf3;color:#1e4432;border-color:#a8b79a;box-shadow:0 10px 30px #2a44362b}dialog::backdrop{background:#234c3555}.dialog-head{background:#fffdf3}.voice-explainer{color:#4d6858}#chat-dialog small,#chat-feedback,.chat-empty{color:#4c6754}.chat-message{background:#e8f0df;border:1px solid #cfddc2}.chat-message b{color:#426a3e}.chat-message p{color:#193f2c}.notice{background:#fff5cf;color:#55451e;border-color:#c7ad6b}
/* Preserve the existing white Rouge tile surface through every button state. */
.tile,.hand .tile:hover:not(:disabled),.hand .tile.selected:hover:not(:disabled),.hand .tile.selected{background:linear-gradient(115deg,#fff 0%,#fcfcfc 60%,#eceff0 100%);border-color:#c7d2c7;border-bottom-color:#a7b5aa;box-shadow:inset 1px 1px 0 #fff,inset -1px 0 0 #dce1e3,0 2px 2px #294c302c}.tile.concealed{background:#80a68a;border-color:#b4ceb8}
.table-center p,.river-owner span,.river-owner small,.river-empty{color:#31553d}

/* One accessible communication/sort row beside the hand. */
#lobby-comms{display:inline-flex;gap:3px}.hand-heading{display:grid;grid-template-columns:1fr auto auto;grid-template-rows:36px 40px 32px;gap:3px 6px;height:79px}.hand-heading #hand-label{grid-column:1;grid-row:1}.hand-heading #my-score{grid-column:2;grid-row:1}.hand-heading #arrange-open{grid-column:3;grid-row:1;height:24px;min-height:24px;padding:1px 8px}.hand-toolbar{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr 1fr 1.35fr;gap:5px;min-width:0}.hand-heading .hand-toolbar button{height:40px;min-height:40px;padding:3px;font-size:12px;white-space:nowrap}.hand-toolbar #sort-hand-direct{font-size:12px;padding:3px}.hand-toolbar #chat-open:before{content:'▤ ';}.hand-toolbar #voice-open:before{content:'♩ ';}.hand-toolbar #sort-hand-direct:before{content:'↕ ';}.game,.game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(96px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 44px 20px}.game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(96px,1fr) 79px auto var(--hand-tile-height) 44px 20px}@media(max-height:650px){.game{grid-template-rows:22px minmax(96px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 42px 16px}.game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:22px minmax(96px,1fr) 79px auto var(--hand-tile-height) 42px 16px}}

#game{grid-template-rows:24px minmax(96px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 44px 20px}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(96px,1fr) 79px auto var(--hand-tile-height) 44px 20px}@media(max-height:650px){#game{grid-template-rows:22px minmax(96px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 42px 16px}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:22px minmax(96px,1fr) 79px auto var(--hand-tile-height) 42px 16px}}
.hand .tile.drawn{border:3px solid #007f85;border-bottom-width:4px;box-shadow:inset 0 0 0 1px white}.hand .tile.drawn.selected{outline:3px solid #b77900;outline-offset:1px}.result-hand{border-top:1px solid #bccbb6;padding:8px 0}.result-hand .tiles{display:flex;flex-wrap:wrap;gap:2px}.result-hand .tile{width:32px;height:45px;margin:0}.result-hand .winning-tile{outline:3px solid #007f85;outline-offset:-2px}.result-hand h3{margin:4px 0}.result-hand .result-label{font-size:11px;margin:5px 0}.result-hand.winner{background:#e9f3e2}.result-hand .meld-group{margin:3px 4px 3px 0}#result-dialog{scrollbar-gutter:stable}

.river-tiles{contain:size;overflow:hidden;grid-template-rows:repeat(var(--river-rows,1),minmax(0,1fr))}.river-tiles .discard-entry{min-height:0;overflow:hidden}.river-tiles .discard-entry>.tile{flex:1 1 0;min-height:0;max-height:calc(100% - 7px);height:0}.river-tiles .discard-entry>.tile svg{min-height:0}

.river-row{grid-template-rows:minmax(0,1fr)}.river-tiles{height:auto;align-self:stretch}.river-owner{min-height:0;overflow:hidden}

.claim-panel-actions{grid-template-columns:1fr}.claim-panel-actions #claim-skip{width:100%}.claim-empty{font-size:12px;line-height:1.35;padding:5px}

/* Single-row, labelled claim actions; colour is supplementary. */
#claim-panel[open]{grid-template-rows:34px 40px minmax(42px,1fr)}#claim-types{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:3px;min-width:0}#claim-types button{min-width:0;min-height:40px;height:40px;font-size:11px;white-space:nowrap;padding:2px 1px;line-height:1.2}#claim-types #claim-skip{background:#edf0ec;color:#354239;border-color:#8c9a8c}#claim-types [data-kind=chow]{background:#dceedd;color:#174e2a;border-color:#6a9b76}#claim-types [data-kind=pung]{background:#dceafa;color:#164677;border-color:#7399bc}#claim-types [data-kind=kong]{background:#eee2f5;color:#573172;border-color:#a286b6}#claim-types [data-kind=win]{background:#fff0bf;color:#694800;border-color:#b3943e}#claim-types button[aria-pressed=true]{box-shadow:inset 0 0 0 2px currentColor}#claim-panel button:focus-visible{outline:3px solid #153f3e;outline-offset:1px}@media(max-height:600px){#claim-panel[open]{grid-template-rows:28px 40px minmax(42px,1fr)}}

.hand-heading{grid-template-columns:1fr auto}.hand-heading #my-score{margin-left:0}

.hand-heading #timer{grid-column:1/-1;grid-row:3;justify-content:flex-end;min-height:28px;margin:0;width:100%;font-size:14px}.hand-heading #timer b{font-size:32px}.hand-heading #timer.own-turn b{font-size:32px}.hand-heading #timer small{font-size:12px}

#turn-status{grid-column:1/-1;grid-row:1;display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}#turn-status h2{font-size:14px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#turn-status p{font-size:10px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;color:#31553d}.game-stats #hand-label,.game-stats #my-score{font-size:10px}.table-center{justify-content:flex-end}
.river-owner{align-self:stretch;max-height:100%;overflow:hidden}.river-owner h3{margin:0;line-height:1.1}

.river-table{grid-template-rows:minmax(0,1fr) 24px}.river-table .discards{grid-row:1}.river-table .river-navigation{grid-row:2}#turn-status .turn-copy{min-width:0;flex:1}#turn-status h2{line-height:18px}#turn-status p{line-height:12px}.turn-preview{display:flex;align-items:center;gap:5px;flex-shrink:0}.turn-preview:has(#last-discard:empty){display:none}.turn-preview small{font-size:9px;max-width:43px;line-height:11px;color:#31553d}#turn-status #last-discard .tile{width:25px;height:35px;margin:0}

/* Large river faces: choose a seat; history remains paginated. */
.hand-heading #timer{grid-row:2}.hand-toolbar{grid-row:3}.hand-heading{grid-template-rows:36px 32px 40px}.hand-help{display:none}#game{grid-template-rows:24px minmax(126px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 44px 0}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(126px,1fr) 79px auto var(--hand-tile-height) 44px 0}@media(max-height:650px){#game{grid-template-rows:22px minmax(126px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 42px 0}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:22px minmax(126px,1fr) 79px auto var(--hand-tile-height) 42px 0}}
.river-table .discards{grid-template-rows:24px minmax(0,1fr);gap:3px}.river-seat-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}.river-seat-tabs button{height:24px;min-height:24px;font-size:10px;padding:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.river-seat-tabs button[aria-pressed=true]{background:#245940;color:white}.river-row{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr);padding:0;border:0}.river-row .river-owner{display:none}.river-tiles{align-self:center;contain:none;height:calc(var(--hand-tile-height) + 9px);grid-template-rows:1fr}.river-tiles .discard-entry{height:calc(var(--hand-tile-height) + 9px);max-height:none;overflow:visible}.river-tiles .discard-entry>.tile{flex:none;height:var(--hand-tile-height);max-height:none;width:calc(var(--hand-tile-height)*.72);aspect-ratio:.72}.river-tiles .discard-entry>small{line-height:9px;font-size:8px}.river-table .river-navigation{font-size:9px}

.hand-heading{grid-template-rows:36px 40px;height:79px}.hand-toolbar{grid-row:2;grid-template-columns:1.2fr 1fr 1.2fr 1fr;gap:3px}.hand-heading #timer{grid-column:auto;grid-row:auto;display:flex;justify-content:center;gap:2px;min-width:0;height:40px;font-size:10px;padding:1px}.hand-heading #timer b,.hand-heading #timer.own-turn b{font-size:27px}.hand-heading #timer small{font-size:9px}.hand-heading #timer small:last-child{display:none}.hand-toolbar #sort-hand-direct{font-size:12px}

.hand-heading #timer b,.hand-heading #timer.own-turn b{font-size:32px}#full-table .tile{width:40px;height:56px}#full-table .discard-entry{width:44px;height:68px}#full-table .discard-entry .tile{width:40px;height:56px}

/* Four seats together, fixed readable faces and paginated history. */
.river-table .discards{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4px}.river-row{display:grid;grid-template-columns:1fr;grid-template-rows:14px minmax(0,1fr);gap:2px;border:1px solid #adc4ac;border-radius:4px;padding:2px;min-width:0}.river-row .river-owner{display:block;min-width:0;overflow:hidden}.river-owner h3{font-size:10px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.river-owner span,.river-owner small{display:none}.river-tiles{--river-face:clamp(40px,calc(var(--hand-tile-height) - 16px),56px);height:calc(var(--river-face) + 9px);align-self:center;gap:2px}.river-tiles .discard-entry{height:calc(var(--river-face) + 9px)}.river-tiles .discard-entry>.tile{height:var(--river-face);width:calc(var(--river-face)*.72)}
.river-row{grid-template-rows:12px minmax(0,1fr);gap:1px;padding:1px}

/* Instructions precede larger action buttons; no empty choice row. */
#claim-panel[open]{height:132px;max-height:100%;top:0;transform:none;grid-template-rows:28px 40px 44px;gap:3px}#claim-hint{display:block;grid-column:1/-1;grid-row:2;font-size:11px!important;line-height:13px!important;margin:0!important;padding:1px 3px;color:#31553d;align-self:center}#claim-types{grid-row:3}#claim-types button{height:44px;min-height:44px;font-size:12px}.claim-empty{display:none}#claim-combinations{display:none}#claim-panel[open]:has(.claim-combination){height:205px;grid-template-rows:28px 30px 44px minmax(0,1fr)}#claim-panel:has(.claim-combination) #claim-combinations{display:flex;grid-row:4;min-height:0}
#game{grid-template-rows:24px minmax(164px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 44px 0}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(164px,1fr) 79px auto var(--hand-tile-height) 44px 0}@media(max-height:650px){#game{grid-template-rows:22px minmax(164px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 42px 0}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:22px minmax(164px,1fr) 79px auto var(--hand-tile-height) 42px 0}}
#game{gap:2px;grid-template-rows:24px minmax(176px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 44px 0}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:24px minmax(176px,1fr) 79px auto var(--hand-tile-height) 44px 0}@media(max-height:650px){#game{grid-template-rows:20px minmax(176px,1fr) 79px auto calc(var(--hand-tile-height)*2 + 4px) 42px 0}#game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:20px minmax(176px,1fr) 79px auto var(--hand-tile-height) 42px 0}}

/* Four full-width player rows; maximize faces within each row. */
.river-table .discards{grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(0,1fr));gap:2px}.river-row{grid-template-columns:48px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:3px;padding:0;border:0;border-top:1px solid #adc4ac;border-radius:0}.river-row .river-owner{align-self:center;max-height:100%}.river-owner h3{white-space:normal;overflow-wrap:anywhere;font-size:9px;line-height:11px}.river-tiles{height:100%;align-self:stretch;min-height:0;contain:size}.river-tiles .discard-entry{height:100%;max-height:none;min-height:0;align-self:stretch}.river-tiles .discard-entry>.tile{height:calc(100% - 9px);max-height:56px;width:auto;aspect-ratio:.72;flex:none}.river-tiles .discard-entry>small{height:9px;line-height:9px}

.river-tiles .discard-entry{flex-direction:row;justify-content:center;gap:1px;align-items:center}.river-tiles .discard-entry>.tile{height:100%;max-height:56px}.river-tiles .discard-entry>small{width:19px;flex-shrink:0;height:auto;font-size:7px;line-height:9px;overflow-wrap:anywhere}

/* Sequence labels occupy a corner inside each face, never an extra column. */
.river-tiles{gap:2px;justify-items:start}.river-tiles .discard-entry{position:relative;width:max-content;max-width:100%;gap:0;justify-content:flex-start}.river-tiles .discard-entry>.tile{padding-bottom:6px}.river-tiles .discard-entry>small{position:absolute;right:1px;bottom:1px;width:auto;max-width:100%;height:8px;line-height:8px;font-size:6px;font-weight:700;padding:0 1px;border-radius:2px;background:#fffef2;color:#254333;pointer-events:none;white-space:nowrap;overflow-wrap:normal}.river-tiles .discard-entry.claimed>small{color:#7b301c;background:#fff1df}
.river-tiles .discard-entry{max-height:56px;align-self:center}

/* Centre claims within the board, with larger touch targets. */
#claim-panel[open]{top:50%;transform:translateY(-50%);height:144px;max-height:100%;grid-template-rows:28px 40px 52px}#claim-types button{height:52px;min-height:52px;font-size:13px}#claim-panel[open]:has(.claim-combination){height:215px;grid-template-rows:28px 30px 52px minmax(0,1fr)}

#match-mode{font:inherit;max-width:240px;height:30px;background:#fffdf3;color:#234b38}.fan-breakdown{padding:6px;border:1px solid #b9c8b5}.fan-breakdown p{font-size:12px;margin:3px 0}

#rule-preset{font:inherit;max-width:240px;height:30px;background:#fffdf3;color:#234b38}.lobby-note>label{display:block}.lobby-note select{max-width:calc(100% - 45px)}

.lobby{grid-template-rows:52px minmax(0,1fr) 44px 114px}.lobby-note{line-height:1.35}

/* Lobby refresh 0.6.1: scoped so the game table stays unchanged. */
.room:has(#lobby:not([hidden])) .room-bar{height:38px;border-bottom:1px solid #d3dcc9}.room:has(#lobby:not([hidden])) #room-label{font-size:13px;letter-spacing:.12em}.room:has(#lobby:not([hidden])) #visibility-label{background:#e1ebd8;border-radius:4px;padding:3px;font-size:8px}
#lobby{grid-template-rows:48px 108px 52px minmax(110px,1fr) 42px 16px;gap:7px;padding:6px 0;min-height:0}.lobby-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;text-align:left;align-items:center}.lobby-heading small{font-size:8px;letter-spacing:.16em;color:#6a816d}.lobby-heading h1{font:22px Georgia,serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lobby-heading a{font-size:10px;color:#315e47}.lobby-heading #lobby-status{grid-column:1/-1;text-align:left;font-size:10px;color:#617863;margin-top:2px}
#lobby .seat-grid{gap:6px}#lobby .seat-card{display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:1fr 1fr;column-gap:7px;padding:7px 8px;border-radius:9px;background:#fdfcf3;border:1px solid #c8d6bf;min-height:0;text-align:left}#lobby .seat-card.mine{background:#e3eddb;border-color:#75936e}#lobby .seat-number{grid-row:1/3;display:grid;place-items:center;background:white;border:1px solid #b8c7b1;border-bottom-width:3px;border-radius:4px;font:22px Georgia,serif;color:#33543d;width:29px;height:38px}#lobby .seat-card h3{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:end;margin:0}#lobby .seat-card p{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:start;margin:2px 0 0;color:#54735b}
.lobby-settings{display:grid;grid-template-columns:1fr 1fr;gap:7px;background:#eaf0e1;border-radius:8px;padding:5px 7px}.lobby-settings label{font-size:9px;color:#54705c;min-width:0}.lobby-settings select{display:block;width:100%;max-width:100%!important;height:29px!important;border:0;border-radius:4px;padding:2px;background:#fffef7!important;font-size:11px!important;color:#234b38}
.lobby-chat{display:grid;grid-template-rows:25px minmax(25px,1fr) 38px 12px;gap:3px;min-height:0;border:1px solid #c3d1b9;border-radius:10px;background:#fffef7;padding:7px}.lobby-chat-heading{display:flex;align-items:center;gap:6px}.lobby-chat-heading h2{font-size:12px}.lobby-chat-heading>span{font-size:8px;color:#6d826b;margin-left:auto}#lobby-chat-new{font-size:9px;min-height:22px;padding:2px 5px;background:#deead3;color:#315f42}#lobby-chat-messages{overflow-y:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin;padding:2px 3px;overflow-wrap:anywhere}#lobby-chat-messages .chat-message{padding:5px 7px;margin:0 0 5px;border-radius:7px;background:#eff3e9;border:0}#lobby-chat-messages .chat-message.own{background:#e2eedc}#lobby-chat-messages .chat-message b{font-size:9px;color:#52705a}#lobby-chat-messages .chat-message p{font-size:12px;line-height:1.35;margin:2px 0;white-space:pre-wrap;overflow-wrap:anywhere}.lobby-chat .chat-empty{display:grid;align-content:center;justify-items:center;gap:5px;height:100%;font-size:11px;color:#82927b;text-align:center}.lobby-chat .chat-empty strong{font-weight:500;color:#61785c}.lobby-chat .chat-empty span{font-size:9px}#lobby-chat-form{display:flex;gap:5px;min-width:0}#lobby-chat-input{min-width:0;font-size:16px;background:#fff;border:1px solid #c3ceb9;color:#234b38;padding:5px 8px}#lobby-chat-send{background:#2c644e;color:white;min-height:38px;padding:4px 11px}#lobby-chat-feedback{font-size:9px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#587252;margin:0}.lobby-actions{gap:7px}#lobby .lobby-actions button{min-height:42px;font-size:12px}#lobby .lobby-note{font-size:9px;line-height:14px;margin:0}
@media(max-height:650px){#lobby{grid-template-rows:42px 98px 49px minmax(100px,1fr) 40px 14px;gap:5px}#lobby .lobby-actions button{min-height:40px}.lobby-heading h1{font-size:20px}}
@media(max-height:450px){.shell:has(#lobby:not([hidden])){height:var(--visual-height,100dvh);min-height:0}#lobby{grid-template-rows:1fr;gap:0;padding:0}#lobby>.lobby-heading,#lobby>#seats,#lobby>.lobby-settings,#lobby>.lobby-actions,#lobby>.lobby-note{display:none}.room:has(#lobby:not([hidden])){grid-template-rows:35px minmax(0,1fr)}.lobby-chat{min-height:0} }

.shell:has(#lobby:not([hidden])){height:var(--visual-height,100dvh)}.shell.lobby-keyboard:has(#lobby:not([hidden])){min-height:0}.shell.lobby-keyboard #lobby{grid-template-rows:1fr;gap:0;padding:0}.shell.lobby-keyboard #lobby>.lobby-heading,.shell.lobby-keyboard #lobby>#seats,.shell.lobby-keyboard #lobby>.lobby-settings,.shell.lobby-keyboard #lobby>.lobby-actions,.shell.lobby-keyboard #lobby>.lobby-note{display:none}.shell.lobby-keyboard .room:has(#lobby:not([hidden])){grid-template-rows:35px minmax(0,1fr)}

#lobby{grid-template-rows:54px 108px 52px minmax(110px,1fr) 42px 16px}.lobby-heading{grid-template-rows:36px 14px}.lobby-heading #lobby-status{line-height:14px;margin:0}#lobby .seat-card p{font-size:9px}@media(max-height:650px){#lobby{grid-template-rows:52px 98px 49px minmax(100px,1fr) 40px 14px}.lobby-heading{grid-template-rows:34px 14px}}

/* 0.6.2: visible lobby voice and unambiguous physical-tile selection. */
.room:has(#lobby:not([hidden])) .room-bar button{padding:3px 5px;font-size:10px;min-height:32px}
.room:has(#lobby:not([hidden])) #voice-open{display:inline-block;border-color:#537c61;font-weight:700}
#lobby-voice-note{color:#526d52}
.hand .tile.selected,.hand .tile.drawn.selected{position:relative;outline:3px solid #1d6a4c;outline-offset:-2px;border-color:#1d6a4c;box-shadow:0 0 0 1px #1d6a4c;transform:translateY(-2px)}
.selection-mark{position:absolute;right:-2px;top:-3px;width:14px;height:14px;display:grid;place-items:center;border-radius:50%;background:#1d6a4c;color:white;font:bold 11px/1 sans-serif;pointer-events:none;z-index:1}
/* 0.6.3: paged result sheet, bounded by the actual visible viewport. */
body:has(#result-dialog[open]){overflow:hidden}
body:has(#result-dialog[open]) .shell{height:var(--visual-height,100dvh);min-height:0;overflow:hidden}
#result-dialog{position:fixed;inset:auto;left:50%;top:calc(var(--visual-top,0px) + var(--visual-height,100dvh)/2);transform:translate(-50%,-50%);margin:0;width:calc(100% - 16px);max-width:440px;height:min(680px,calc(var(--visual-height,100dvh) - 16px - var(--result-safe-top,env(safe-area-inset-top,0px)) - var(--result-safe-bottom,env(safe-area-inset-bottom,0px))));max-height:none;padding:10px;overflow:hidden;scrollbar-gutter:auto}
#result-dialog[open]{display:grid;grid-template-rows:34px minmax(0,1fr);gap:7px}
#result-dialog .dialog-head{margin:0;height:34px}#result-dialog .dialog-head h2{font:21px Georgia,serif}#result-dialog .dialog-head button{height:34px;min-height:34px;width:34px}
#result{display:grid;grid-template-rows:36px minmax(0,1fr) 42px;gap:7px;min-height:0}
#result p,#result h3{margin:0}#result p{font-size:12px;line-height:1.3}#result h3{font-size:16px;line-height:1.25;overflow-wrap:anywhere}#result small{font-size:10px;line-height:1.2}
.result-tabs,.result-players,.result-parts{display:flex;gap:4px;min-width:0}.result-tabs button,.result-players button,.result-parts button{flex:1;min-width:0;height:36px;min-height:36px;padding:3px;font-size:12px}.result-tabs button[aria-pressed=true],.result-players button[aria-pressed=true],.result-parts button[aria-pressed=true]{background:#2c644e;color:white;border-color:#2c644e}
.result-page{min-height:0;display:flex;flex-direction:column;gap:7px;justify-content:flex-start}.result-hero p{margin-top:3px!important;color:#456149}.result-calculation,.result-payment{padding:7px 8px;border-radius:7px;background:#e5eedc}.result-calculation{display:grid;gap:3px}.result-calculation strong,.result-payment strong{font-size:14px;line-height:1.2}.result-payment{background:#f0f1e5;display:grid;gap:3px}
.result-scores{width:100%;border-collapse:collapse;table-layout:fixed;font-size:12px}.result-scores th,.result-scores td{padding:5px 4px;border-bottom:1px solid #d2dcc8;text-align:right;line-height:1.2}.result-scores th:first-child{width:58%;text-align:left;overflow-wrap:anywhere;font-weight:500}.result-scores thead th{font-size:10px;color:#53684e}.result-scores tr.round-winner{background:#e9f0e2}.result-scores td{font-variant-numeric:tabular-nums}.result-standing{font-weight:700;color:#28533e}.result-footer{display:flex;gap:6px;align-items:center}.result-footer button{flex:1;min-height:42px;height:42px;padding:4px;font-size:13px}.result-footer>span{flex:1;font-size:11px;text-align:center}
.result-pattern-list{display:grid;gap:8px}.result-pattern{display:flex;gap:10px;padding:12px 9px;border:1px solid #c7d5bd;border-radius:7px;align-items:center;min-height:56px;font-size:14px}.result-pattern span{flex:1;overflow-wrap:anywhere}.result-pattern strong{white-space:nowrap;font-size:13px}.result-pagination{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:auto;flex-shrink:0}.result-pagination button{height:36px;min-height:36px;padding:3px 7px;font-size:12px}.result-pagination span{font-size:12px}.result-guide{font-size:12px;text-align:center}.result-pattern-note{color:#53684e}
.result-players button{height:32px;min-height:32px}.result-player-name{font-size:14px!important}.result-tile-area{min-height:0}.result-tile-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.result-tile-grid .tile{width:100%;height:auto;aspect-ratio:.72;margin:0;border-bottom-width:3px}.result-tile-grid.bonus-grid{grid-template-columns:repeat(4,38px);justify-content:center}.result-meld{margin-bottom:8px}.result-meld p{margin-bottom:3px!important}.result-meld-tiles{display:flex;gap:3px}.result-meld-tiles .tile{width:35px;height:49px;margin:0}.result-tile-area .winning-tile{outline:3px solid #007f85;outline-offset:-2px}.result-tile-note{font-size:10px!important;color:#53684e}
@media(max-height:570px){#result-dialog{padding:8px}#result-dialog[open],#result,.result-page{gap:5px}.result-calculation,.result-payment{padding:5px 7px}.result-scores th,.result-scores td{padding:4px}.result-pattern{padding:8px;min-height:48px}.result-tile-grid{gap:3px}}
#result .result-scores th:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#result .result-scores tbody th{font-size:12px}
#result{padding:0}#result .result-tabs button,#result .result-parts button,#result .result-pagination button{min-height:36px}#result .result-players button{min-height:32px}#result .result-footer button{min-height:42px}
@media(max-height:570px){#result .result-hero h3{font-size:14px}.result-scores th,.result-scores td{padding:3px 4px}}
/* Lobby microphone beside its HTTPS status, below the message input. */
.room:has(#lobby:not([hidden])) #lobby-comms{display:none}
.lobby-chat{grid-template-rows:25px minmax(25px,1fr) 38px 32px}
.lobby-chat-tools,#lobby-voice-controls{display:flex;align-items:center;gap:7px;min-width:0}.lobby-chat-tools{justify-content:space-between}#lobby-voice-controls #voice-open{height:32px;min-height:32px;font-size:11px;padding:3px 8px;white-space:nowrap}#lobby-voice-note{font-size:9px;line-height:1.2}#lobby-chat-feedback{flex-shrink:0}
#result .result-footer button.primary,#result .result-footer button.primary:hover,#result .result-footer button.primary:focus{background:#2c644e;border-color:#2c644e;color:#fff}
/* 0.6.4: explicit return to the last authenticated room. */
#resume-card{display:grid;gap:5px;padding:7px 9px;background:#e3eddc;border:1px solid #89a17a;border-radius:8px;min-width:0}#resume-game{width:100%;min-height:40px;font-size:14px;background:#2c644e;border-color:#2c644e;color:white}#resume-game:hover:not(:disabled){background:#24553f}#resume-note{font-size:11px;line-height:1.3;color:#3e5b45;margin:0;overflow-wrap:anywhere}.welcome:has(#resume-card:not([hidden])){grid-template-rows:minmax(34px,auto) auto auto 42px 24px minmax(56px,1fr) 36px 28px}
.welcome:has(#resume-card:not([hidden])):has(#network-note[hidden]){grid-template-rows:minmax(34px,auto) auto auto 42px 24px minmax(56px,1fr) 36px}
@media(max-height:650px){.welcome:has(#resume-card:not([hidden])){grid-template-rows:32px auto auto 40px 22px minmax(48px,1fr) 30px 24px;gap:5px}
.welcome:has(#resume-card:not([hidden])):has(#network-note[hidden]){grid-template-rows:32px auto auto 40px 22px minmax(48px,1fr) 30px;gap:5px}#resume-card{padding:6px 8px;gap:3px}}

/* 0.6.5: one shared ready/start/mic bar immediately above room chat. */
#lobby{grid-template-rows:54px 108px 52px 44px minmax(100px,1fr) 16px}.lobby-action-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-width:0}.lobby-action-bar:has(#start[hidden]){grid-template-columns:repeat(2,minmax(0,1fr))}.lobby-action-bar #lobby-voice-controls{display:contents}.lobby-action-bar button,.lobby-action-bar #lobby-voice-controls #voice-open{width:100%;min-width:0;height:44px;min-height:44px;font-size:12px;padding:3px;line-height:1.1}.lobby-chat{grid-template-rows:25px minmax(25px,1fr) 38px 12px}.lobby-chat-tools{min-height:0}.lobby-chat-heading #lobby-voice-note{font-size:9px;text-align:right}.lobby-action-bar .primary:hover{background:#2c644e;color:white}
@media(max-height:650px){#lobby{grid-template-rows:52px 98px 49px 44px minmax(88px,1fr) 14px}}
@media(max-height:450px){#lobby{grid-template-rows:44px minmax(0,1fr)}}.shell.lobby-keyboard #lobby{grid-template-rows:44px minmax(0,1fr)}


/* 0.7.1: every winner scoring component is visible together. */
#result.winner-sheet{grid-template-rows:minmax(0,1fr) 42px;gap:4px}.winner-body{display:flex;flex-direction:column;gap:4px;min-height:0}.winner-heading{display:flex;flex-direction:column;font-size:13px;line-height:1.15}.winner-name,.winner-source{overflow-wrap:anywhere}.winner-name{font-size:14px}.winner-source{font-size:12px}.winner-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.winner-group{background:#edf2e5;border-radius:4px;padding:2px;min-width:0;text-align:center;font-size:11.5px;line-height:1.2}.winner-group-tiles{display:flex;justify-content:center;gap:1px;flex-wrap:wrap}.winner-group .tile{width:20px;height:28px;margin:0;border-bottom-width:2px}.winner-group:has(.tile:nth-child(5)){grid-column:1/-1}.winner-group:has(.tile:nth-child(5)) .tile{width:18px;height:25px}.winner-body .winning-tile{outline:2px solid #007f85;outline-offset:-2px}.winner-bonus{display:flex;align-items:center;gap:2px;font-size:12px}.winner-bonus .tile{width:17px;height:24px;margin:0;border-bottom-width:2px}.winner-base{display:flex;flex-wrap:wrap;gap:2px 9px;font-size:12px;line-height:1.2}.winner-base strong{margin-left:auto}.winner-doubles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px 6px;font-size:12px;line-height:1.2;color:#31563f}.winner-calculation{display:flex;justify-content:space-between;flex-wrap:wrap;gap:1px 7px;padding:3px 5px;background:#e5eedc;font-size:12px;line-height:1.2}.winner-limit{width:100%;font-size:11.5px}.winner-body .winner-payment{font-size:12px!important;font-weight:700}.winner-sheet .result-scores th,.winner-sheet .result-scores td{padding:2px 3px;font-size:12px;line-height:1.15}.winner-sheet .result-scores thead th{font-size:11px}.winner-sheet .result-scores th:first-child{width:52%}.winner-standing{font-size:12px!important}.winner-sheet-dialog .dialog-head h2{font-size:19px!important}.winner-sheet-dialog .dialog-head{height:30px!important}.winner-sheet-dialog[open]{grid-template-rows:30px minmax(0,1fr)!important;gap:4px!important;padding:7px!important}.opponent-tiles{display:flex;flex-wrap:wrap;gap:2px}.opponent-tiles .tile{width:27px;height:38px;margin:0}.opponent-hand{margin:10px 0}#opponent-dialog{max-height:90dvh;overflow:auto}#share-dialog input{width:100%;min-width:0;font-size:14px}#share-dialog label{display:block;margin-top:10px}#share-dialog #native-share{width:100%;min-height:44px}.share-actions{display:flex;gap:8px;margin-top:8px}.share-actions>*{flex:1;text-align:center;min-height:44px}.share-actions a{display:flex;align-items:center;justify-content:center;border:1px solid #9caf96;border-radius:6px;text-decoration:none;color:#245b43;font-weight:700}#share-status{min-height:32px;font-size:13px}
@media(min-height:700px){.winner-body{gap:7px}.winner-group .tile{width:26px;height:36px}.winner-group{font-size:12px;padding:3px}.winner-base,.winner-doubles,.winner-calculation{font-size:13px}.winner-sheet .result-scores td,.winner-sheet .result-scores th{padding:4px}}

@media(max-height:600px){.winner-body{gap:2px}.winner-group{padding:1px}.winner-group .tile{height:25px;width:18px}.winner-group-tiles{gap:1px}.winner-bonus .tile{height:22px;width:16px}.winner-sheet .result-scores td,.winner-sheet .result-scores th{padding:1px 3px}.winner-calculation{padding:2px 4px}.winner-sheet-dialog[open]{gap:2px!important}}
@media(max-height:600px){#result-dialog.winner-sheet-dialog[open]{grid-template-rows:0 minmax(0,1fr)!important;gap:0!important;width:calc(100% - 8px);padding:5px!important}.winner-sheet-dialog .dialog-head{height:0!important}.winner-sheet-dialog .dialog-head h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.winner-sheet-dialog .dialog-head button{position:absolute;right:5px;top:5px}.winner-sheet-dialog .winner-heading{padding-right:36px;min-height:30px}.winner-sheet-dialog .winner-name{font-size:13px}}

.winner-body>*,.winner-heading>*{flex-shrink:0}
@media(max-height:600px){.winner-body{gap:1px}.winner-sheet-dialog .winner-heading{display:block}.winner-sheet-dialog .winner-name,.winner-sheet-dialog .winner-source{display:inline}.winner-sheet-dialog .winner-source:before{content:' · '}}
@media(max-height:600px){.winner-sheet-dialog .dialog-head{position:static;background:transparent;padding:0;min-height:0}.winner-sheet-dialog .winner-heading{padding-top:3px}}

/* Preferred invitation targets */
#share-dialog{box-sizing:border-box;width:min(400px,calc(100vw - 20px));padding:14px}#share-dialog .invite-targets{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0 8px}#share-dialog .invite-targets>*{display:flex;align-items:center;justify-content:center;min-height:46px;box-sizing:border-box;border:1px solid #aabb9e;border-radius:7px;background:#f8f9f2;color:#24513e;font:inherit;font-weight:600;text-decoration:none;padding:8px}#share-dialog #native-share{width:100%;min-height:44px;margin-bottom:12px}#share-dialog label{display:block}#share-dialog #invite-url{box-sizing:border-box;width:100%;min-width:0}#share-dialog p{font-size:13px;line-height:1.35;margin:10px 0 0}#share-dialog .share-help{color:#52624f}#share-dialog a:focus-visible{outline:3px solid #287657;outline-offset:2px}

/* Explicit scoring terms; keep every breakdown visible. */
.winner-group>span{display:block}.winner-chows{grid-column:1/-1}.winner-calculation>span:first-child,.winner-calculation>strong{width:100%}.winner-doubles{font-size:11.5px}.winner-doubles>span{overflow-wrap:anywhere}

.winner-double-title{grid-column:1/-1;font-size:11.5px}.winner-group>span{white-space:pre-line;font-size:11px;letter-spacing:-.15px}.winner-doubles{line-height:1.15}.winner-limit{font-size:11px;line-height:1.1}

@media(max-height:600px){#result-dialog.winner-sheet-dialog[open]{height:calc(100dvh - 8px);max-height:calc(100dvh - 8px);margin:4px auto}.winner-doubles>span{font-size:11px}.winner-sheet .result-scores td,.winner-sheet .result-scores th{line-height:1.05}}

@media(max-height:600px){.winner-sheet-dialog .winner-calculation{line-height:1.1}.winner-sheet-dialog .winner-base{gap:1px 6px;line-height:1.1}.winner-sheet-dialog .winner-group{line-height:1.1}.winner-sheet-dialog .winner-limit{font-size:11px}.winner-sheet-dialog .winner-doubles{line-height:1.05}}

@media(max-height:600px){#result-dialog.winner-sheet-dialog[open]{padding:4px!important}.winner-sheet-dialog .winner-doubles{column-gap:3px}.winner-sheet-dialog .winner-calculation{padding:1px 3px}.winner-sheet-dialog .winner-group-tiles .tile{height:23px;width:17px}}

@media(max-height:600px){.winner-sheet-dialog .winner-group>span{line-height:1}.winner-sheet-dialog .winner-group-tiles .tile{height:22px;width:16px}.winner-sheet .result-scores th,.winner-sheet .result-scores td{padding-top:0;padding-bottom:0}.winner-sheet-dialog .winner-calculation{line-height:1}.winner-sheet-dialog .winner-limit{line-height:1}}

@media(max-height:600px){.winner-sheet-dialog .winner-body{gap:0}}


/* Compact independent playback controls. */
#audio-dialog{width:min(390px,calc(100vw - 20px));box-sizing:border-box;padding:14px}#audio-dialog .audio-setting{display:grid;grid-template-columns:1fr 92px;align-items:center;gap:0 8px;margin-top:10px}#audio-dialog .audio-setting>label:first-child{grid-column:1/-1;display:flex;justify-content:space-between;font-weight:600;font-size:14px}#audio-dialog input[type=range]{width:100%;min-width:0;height:44px;padding:0;accent-color:#28694d}#audio-dialog .audio-mute{display:flex;gap:6px;align-items:center;min-height:44px;font-size:13px}#audio-dialog input[type=checkbox]{width:20px;height:20px;accent-color:#28694d}#audio-dialog p{font-size:12px;line-height:1.35;margin:9px 0}.audio-footer{display:flex;gap:8px}.audio-footer button{flex:1;min-height:44px}#rules-open{font-size:20px}#game-audio-status{min-height:32px}

#pwa-dialog{box-sizing:border-box;width:min(400px,calc(100vw - 20px));padding:14px}#pwa-dialog p{font-size:13px;line-height:1.4;margin:12px 0}.pwa-actions{display:flex;gap:8px}.pwa-actions button{flex:1;min-height:44px;padding:6px}#pwa-update{min-height:44px;width:100%}#audio-dialog .audio-footer button{min-width:0;font-size:12px;padding:4px}html:fullscreen,html:fullscreen body{width:100%;height:100%;background:#164832}

#pwa-install.primary{background:#2c644e;color:#fff;border-color:#2c644e}#pwa-install:disabled{background:#e3eadb;color:#4a5c48;opacity:1;border-color:#a9bba1}

#audio-dialog,#pwa-dialog{max-height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 12px)}@media(max-height:600px){#result-dialog.winner-sheet-dialog[open]{height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 8px);max-height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 8px);margin-top:calc(4px + var(--safe-top,0px));margin-bottom:calc(4px + var(--safe-bottom,0px))}}

body:has(#result-dialog[open]) .shell{height:calc(var(--visual-height,100dvh) - var(--safe-top,0px) - var(--safe-bottom,0px))}@media(max-height:600px){#result-dialog.winner-sheet-dialog[open]{margin:0;top:calc(var(--visual-top,0px) + (var(--visual-height,100dvh) + var(--safe-top,0px) - var(--safe-bottom,0px))/2)}}

@media(min-height:601px) and (max-height:699px){.winner-sheet-dialog .winner-body{gap:1px}}
/* Public melds beneath each name; discarded-tile state stays on the server. */
.public-board{display:block;min-height:0;padding:3px!important}.public-board #public-table{height:100%;display:flex;flex-direction:column;justify-content:space-around;gap:2px;min-height:0}.public-seat{min-width:0;border-bottom:1px solid #8fae9170;padding:1px 0}.public-seat.own{border:0}.public-seat-heading{display:flex;align-items:center;gap:5px;min-width:0;font-size:11px;line-height:15px}.public-seat-heading h3{font-size:12px;margin:0;min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.public-wind{font-size:10px;white-space:nowrap}.public-total{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px}.public-seat.active{background:#e9efca;border-radius:3px}.public-melds{display:flex;flex-wrap:wrap;gap:2px 4px;align-items:center;min-height:24px}.public-meld,.public-bonus{display:flex;gap:1px;flex-wrap:nowrap}.public-meld .tile,.public-bonus .tile{height:clamp(24px,calc((100vw - 76px)/16/.72),36px);width:auto;aspect-ratio:.72;margin:0;border-bottom-width:2px;flex:none}.public-bonus .tile{height:24px}.public-empty{font-size:10px;color:#4b654b}.public-board:has(#claim-panel[open]) #public-table,.public-board:has(#claim-panel[open]) .table-details{visibility:hidden}
:root{font-family:system-ui,-apple-system,'Segoe UI','Microsoft YaHei','PingFang TC','Noto Sans CJK TC',sans-serif}
@media(min-height:601px) and (max-height:699px){.winner-sheet .result-scores th,.winner-sheet .result-scores td{padding-top:0;padding-bottom:0;line-height:1.05}.winner-heading{line-height:1.05}.winner-group>span{line-height:1.05}.winner-base{line-height:1.1}}
/* Four discard rows retained; each heading now shows cumulative score. */
.river-table .discards{grid-template-rows:repeat(4,minmax(0,1fr));gap:2px}.river-row{grid-template-columns:1fr;grid-template-rows:12px auto minmax(0,1fr);gap:1px;border-top:1px solid #adc4ac}.river-row .river-owner{display:block;align-self:auto;max-height:none;overflow:visible}.river-owner h3{font-size:10px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.river-melds{display:flex;gap:3px;min-height:0}.river-melds:empty{display:none}.river-melds .public-meld{display:flex;gap:1px}.river-melds .tile{height:clamp(21px,calc((100vw - 80px)/16/.72),29px);width:auto;aspect-ratio:.72;margin:0;border-bottom-width:2px}.river-tiles{height:100%;contain:size;min-height:0}.river-tiles .discard-entry{height:100%;max-height:32px;min-height:0}.river-tiles .discard-entry>.tile{height:100%;max-height:32px;padding-bottom:4px}.river-tiles .discard-entry>small{font-size:6px;height:6px;line-height:6px}
@media(min-height:700px){.winner-body{gap:5px}}
.river-row .river-owner{display:flex;align-items:center;gap:5px;min-width:0}.river-owner h3{flex:1;min-width:0}.river-total{font-size:11px;line-height:12px;white-space:nowrap;font-variant-numeric:tabular-nums;flex:none}
/* Allocate space to public melds on short phones while keeping hand taps >=44px. */
@media(max-height:650px){#game:has(.river-melds:not(:empty)){--hand-tile-height:46px;grid-template-rows:20px minmax(210px,1fr) 79px auto 96px 42px 0}#game:has(.river-melds:not(:empty)):has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:20px minmax(210px,1fr) 79px auto 46px 42px 0}#game:has(.river-melds:not(:empty)) .bonus-board .tile{height:23px;width:16.5px}.river-table{padding:3px;grid-template-rows:minmax(0,1fr) 20px}.river-navigation button{height:20px;min-height:20px}.river-table .discards{display:flex;flex-direction:column;gap:2px}.river-row{flex:1;min-height:29px}.river-row:has(.river-melds:not(:empty)){flex:1.65;min-height:48px}.river-row:not(:has(.river-melds:not(:empty))){grid-template-rows:12px minmax(0,1fr)}.river-row:not(:has(.river-melds:not(:empty))) .river-tiles{grid-row:2}}
.river-tiles .discard-entry{align-self:stretch}.river-tiles .discard-entry>.tile{min-height:0}
@media(max-height:650px){#game:has(.river-melds:not(:empty)){--hand-tile-height:44px;gap:1px;grid-template-rows:20px minmax(224px,1fr) 79px auto 90px 42px 0}#game:has(.river-melds:not(:empty)):has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:20px minmax(224px,1fr) 79px auto 44px 42px 0}#game:has(.river-melds:not(:empty)) .bonus-board .tile{height:21px;width:15px}.river-row:has(.river-melds:not(:empty)){min-height:53px}.river-row{min-height:31px}.river-tiles,.river-tiles .discard-entry{min-height:18px}.river-tiles .discard-entry>.tile{height:18px;min-height:18px;max-height:18px}}
@media(max-height:600px){.winner-sheet-dialog .winner-heading{min-height:44px;padding-right:46px}}
.winner-sheet .result-footer{display:flex;gap:4px}.winner-sheet .result-footer button{flex:1;min-width:0;min-height:42px;padding:3px;font-size:12px;position:static}
@media(max-height:600px){.winner-sheet-dialog .winner-heading{min-height:30px;padding-right:0}}
/* 0.7.6.1: explicit tracks prevent empty meld containers collapsing discard faces. */
.river-row .river-owner{grid-row:1}.river-melds{grid-row:2}.river-row .river-tiles{grid-row:3}
.river-row:not(:has(.river-melds:not(:empty))){grid-template-rows:12px minmax(0,1fr)}
.river-row:not(:has(.river-melds:not(:empty))) .river-tiles{grid-row:2}
@media(max-height:650px){.river-tiles .discard-entry>.tile{padding-top:0;padding-bottom:2px;border-top-width:1px;border-bottom-width:1px}}
/* Open combinations stay compact beneath names; discard history keeps priority. */
.river-melds .tile{height:22px}
@media(max-height:650px){.river-melds .tile{height:18px}}
/* Restored four-row layout: every discard remains in its own touch-scroll strip. */
.river-row .river-tiles{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;overscroll-behavior-x:contain;scrollbar-width:none;gap:2px;align-items:center;justify-content:flex-start}
.river-tiles::-webkit-scrollbar{display:none}.river-tiles .discard-entry{flex:0 0 auto;width:auto;max-width:none}.river-tiles .discard-entry>.tile{flex:none;width:auto;aspect-ratio:.72}
.river-tiles:focus-visible{outline:2px solid #287657;outline-offset:-2px}
/* 0.7.8 staging: independently requested compact header and equal toolbar. */
.shell:has(#room:not([hidden])){grid-template-rows:44px minmax(0,1fr)}
header{padding:0 4px;gap:4px;letter-spacing:0}header strong{font-size:11px}header #header-room{font-size:10px;line-height:12px;margin-right:auto}header #header-room small{display:block;font-size:8px}header #back,header #rules-open{height:44px;min-height:44px;min-width:44px;padding:2px;font-size:11px}header #rules-open{font-size:20px}
.shell:has(#room[hidden]) #header-room,.shell:has(#room[hidden]) header #back{display:none}
.shell:has(#room:not([hidden])) main{padding:2px 4px}.room{grid-template-rows:minmax(0,1fr);gap:0}.room-bar{display:none}.room:has(#lobby:not([hidden])){grid-template-rows:32px minmax(0,1fr)}.room:has(#lobby:not([hidden])) .room-bar{display:flex;height:32px}
#hand-toolbar{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}#hand-toolbar>button,#hand-toolbar>#timer{box-sizing:border-box;width:100%;height:44px;min-height:44px;max-height:44px;min-width:0;margin:0;padding:1px;font-size:11px;overflow:hidden}#hand-toolbar>#timer{display:flex;align-items:center;justify-content:center;gap:2px;border:1px solid #b3c4a5;border-radius:6px}#hand-toolbar>#timer b{font-size:26px}#hand-toolbar>#timer small{font-size:8px}
.hand-heading{grid-template-rows:36px 44px;height:83px}#room #game{grid-template-rows:20px minmax(176px,1fr) 83px auto calc(var(--hand-tile-height)*2 + 4px) 44px 0;gap:2px}#room #game:has(.hand:not(:has(.tile:nth-child(8)))){grid-template-rows:20px minmax(176px,1fr) 83px auto var(--hand-tile-height) 44px 0}
/* Own groups and all players' bonus tiles share one scrollable strip. */
#game #my-melds{display:flex;flex-wrap:nowrap;gap:4px;align-items:center;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;overscroll-behavior-x:contain;scrollbar-width:none;height:24px;min-height:24px}#game #my-melds:empty{display:none}#my-melds::-webkit-scrollbar{display:none}#game #my-melds>.meld-group{flex:none}#game #my-melds>.bonus-board{flex:0 0 auto;width:max-content;height:24px;margin:0;padding-left:4px;border-left:1px solid #96ac90;gap:2px}#game #my-melds>.bonus-board:first-child{padding-left:0;border-left:0}#game #my-melds .tile{width:16px;height:22px;flex:none;margin:0}#game #my-melds .bonus-caption{font-size:9px}#game #my-melds .bonus-owner{flex:none}
#room #game:not(:has(#hand .tile:nth-child(8))){grid-template-rows:20px minmax(176px,1fr) 83px auto var(--hand-tile-height) 44px 0}
#my-melds:focus-visible{outline:2px solid #287657;outline-offset:-2px}
/* Responsive maximum faces; controls stay below the table, no right rail. */
#room #game,#room #game:not(:has(#hand .tile:nth-child(8))){grid-template-rows:14px minmax(0,1fr) calc(var(--river-face,32px) + 46px) auto var(--hand-block-size,116px) 44px 0;gap:1px}
#game .hand-heading{height:calc(var(--river-face,32px) + 46px);grid-template-rows:var(--river-face,32px) 44px;row-gap:2px}
#turn-status #last-discard .tile{height:var(--river-face);width:var(--river-width);padding:1px;border-width:1px;border-bottom-width:3px;margin:0}
.river-table{padding:2px;grid-template-rows:minmax(0,1fr) 20px;gap:2px}.river-table .discards{display:grid;grid-template-columns:1fr;gap:2px;min-height:0}
#game .river-row,#game .river-row:not(:has(.river-melds:not(:empty))),#game .river-row:has(.river-melds:not(:empty)){display:grid;grid-template-columns:74px minmax(0,1fr);grid-template-rows:12px minmax(0,1fr);gap:0 3px;min-height:0;padding:0;align-items:start}
#game .river-row .river-owner{grid-column:1;grid-row:1;display:flex;align-items:center;gap:2px;overflow:hidden;min-height:12px}#game .river-owner h3{font-size:9px;line-height:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#game .river-owner .river-total{font-size:8px;line-height:12px}
#game .river-row .river-melds{grid-column:1;grid-row:2;display:flex;flex-direction:column;flex-wrap:nowrap;gap:1px;align-items:flex-start;min-height:0}#game .river-row .river-melds:empty{display:none}#game .river-melds .public-meld{display:flex;flex-direction:row;gap:0}#game .river-melds .tile{height:var(--meld-face,12px);width:calc(var(--meld-face,12px)*.72);padding:0;border-width:1px;border-radius:2px;margin:0}
#game .river-row .river-tiles,#game .river-row:not(:has(.river-melds:not(:empty))) .river-tiles{grid-column:2;grid-row:1/3;height:100%;min-height:0;align-items:center}
#game .river-tiles .discard-entry,#game .river-tiles .discard-entry>.tile{height:var(--river-face);min-height:var(--river-face);max-height:var(--river-face);width:var(--river-width);max-width:none;flex:none}#game .river-tiles .discard-entry>.tile{padding:1px;border-width:1px;border-bottom-width:3px;aspect-ratio:auto}
#game .river-navigation button{height:20px;min-height:20px}#game .river-navigation{gap:2px}#game .river-navigation #river-note{font-size:7px}#game .river-navigation #river-page{font-size:8px}
#game .river-tiles{--river-face:inherit}
/* Direct one-tap fullscreen; normal connection status does not occupy the header. */
header #fullscreen-toggle{flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:grid;place-items:center}header #fullscreen-toggle svg{pointer-events:none}header #fullscreen-toggle[aria-pressed=true]{background:#dbead4;border-color:#367153}header #fullscreen-toggle[data-supported=false]{color:#687766}

header{gap:2px;padding:0 4px}header>strong{flex:none;font-size:9px;letter-spacing:0}header #header-room{flex:none;white-space:nowrap;font-size:9px;line-height:14px;margin-right:auto}header #header-room small{display:inline;font:inherit}header #header-room b{font-size:9px;letter-spacing:0}header #back{font-size:10px}
header>button{align-self:start}
/* All players' public groups and bonus tiles live beside their own river. */
header>strong,header #header-room,header #header-room b{font-size:11px}header #header-room small{font:inherit}
#game #my-melds{display:none!important}
#game .river-public{grid-column:1;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px;min-width:0;align-items:start}
#game .river-public .river-melds{grid-column:1;grid-row:1;position:static}#game .river-bonus{display:grid;grid-template-columns:repeat(2,auto);gap:1px;grid-column:2;grid-row:1;align-content:start}#game .river-bonus:empty{display:none}
#game .river-bonus .tile{height:min(var(--meld-face,12px),14px);width:calc(min(var(--meld-face,12px),14px)*.72);padding:0;border-width:1px;border-radius:2px;margin:0;flex:none}
/* Preserve prior hand sizing: only opponent melds trigger the existing short-phone44px size. */
@media(max-height:650px){#room #game{--hand-tile-height:inherit}#room #game.opponent-melds{--hand-tile-height:44px}}
/* 0.7.11: state-scoped polish; keep the playing layout geometry unchanged. */
#game .game-stats #my-score{visibility:hidden}
.shell:has(#welcome:not([hidden])){grid-template-rows:44px minmax(0,1fr)}
.shell:has(#welcome:not([hidden])) header #fullscreen-toggle{margin-left:auto}
.room:has(#lobby:not([hidden])){grid-template-rows:44px minmax(0,1fr);gap:2px}
.room:has(#lobby:not([hidden])) .room-bar{height:44px;min-height:44px;border:0;justify-content:flex-end}
.room:has(#lobby:not([hidden])) .room-bar>div{width:136px;justify-content:flex-end}
.room:has(#lobby:not([hidden])) #share{width:136px;height:44px;min-height:44px;background:#2c644e;color:#fff;border-color:#24513e;font-size:13px}
.room:has(#lobby:not([hidden])) #share:hover{background:#24553f}
/* Lobby-only: use the space beside Share for the room heading and clarify duration. */
.room:has(#lobby:not([hidden])) .room-bar{justify-content:space-between;gap:6px}
.room:has(#lobby:not([hidden])) .room-bar>.lobby-heading{width:auto;flex:1;min-width:0;height:44px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:0;text-align:left}
.room:has(#lobby:not([hidden])) .room-bar>.lobby-heading>div{min-width:0;max-width:100%}
.room-bar .lobby-heading small{font-size:7px;line-height:9px;letter-spacing:.07em}
.room-bar .lobby-heading h1{font-size:16px;line-height:19px;margin:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-bar .lobby-heading #lobby-status{font-size:9px;line-height:11px;margin:0;white-space:nowrap}
#lobby{grid-template-rows:108px 84px 44px minmax(100px,1fr) 16px}
#duration-note{display:block;min-height:36px;padding-top:2px;font-size:10px;line-height:12px;color:#31553d;white-space:normal}
#duration-note strong{display:block;font-size:10px;line-height:12px}#duration-note small{display:block;font-size:9px;line-height:11px}
@media(max-height:650px){#lobby{grid-template-rows:98px 84px 44px minmax(88px,1fr) 14px}}
.room:has(#lobby:not([hidden])){min-width:0;grid-template-columns:minmax(0,1fr)}
.shell:has(#lobby:not([hidden])) main{min-width:0}
.room:has(#lobby:not([hidden])) .room-bar{min-width:0;width:100%}
.room:has(#lobby:not([hidden])) .room-bar>.lobby-heading{flex:1 1 0;overflow:hidden}
.room:has(#lobby:not([hidden])) .room-bar>.lobby-heading>div{width:100%;min-width:0;overflow:hidden}
.room:has(#lobby:not([hidden])) .room-bar>div:not(.lobby-heading){flex:0 0 136px}

/* Lobby: one full-width duration setting; game geometry stays unchanged. */
#lobby .lobby-settings{grid-template-columns:minmax(0,1fr);gap:0}
#lobby .lobby-settings>label{display:block;width:100%;min-width:0}
#lobby #duration-note{min-height:0}
#lobby{grid-template-rows:108px minmax(76px,max-content) 44px minmax(100px,1fr) 16px}
@media(max-height:650px){#lobby{grid-template-rows:98px minmax(76px,max-content) 44px minmax(88px,1fr) 14px}}

.result-readiness{font-size:11px;line-height:1.1;margin:2px 0;color:#184d39;flex-shrink:0}.result-footer button:disabled{opacity:.7}

.winner-sheet .result-readiness{font-size:11px!important;line-height:1.05!important;margin:1px 0!important}
@media(max-height:550px){.winner-sheet .result-readiness{font-size:10px!important;line-height:1!important;margin:0!important}.winner-sheet-dialog .winner-doubles,.winner-sheet-dialog .winner-doubles>span{font-size:10px!important;line-height:1!important}.winner-sheet .result-scores th,.winner-sheet .result-scores td{font-size:10px!important;line-height:1!important;padding-top:0!important;padding-bottom:0!important}.winner-sheet-dialog .winner-group-tiles .tile{height:19px;width:14px}.winner-sheet-dialog .winner-group>span{font-size:10px;line-height:1}.winner-sheet-dialog .winner-standing{font-size:10px;line-height:1}}

@media(min-height:700px){.winner-sheet-dialog .winner-body{gap:3px}}

/* Compact, textual server-authoritative connection status. */
#game .river-public .player-presence{display:block;grid-column:1/-1;grid-row:1;font-size:9px;line-height:11px;font-weight:700;color:#705200;white-space:normal;overflow-wrap:normal}#game .river-public .player-presence[hidden]{display:none}#game .river-public.has-presence .river-melds,#game .river-public.has-presence .river-bonus{grid-row:2}#game .river-public .is-disconnected,#lobby .seat-card[data-disconnected=true] p{color:#a02020}

/* Match opening draw: temporary overlay, existing table grid unchanged. */

#account-dialog{max-width:340px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}#account-dialog p{overflow-wrap:anywhere}#google-button{min-height:44px}.account-note{font-size:12px}.privacy-page{height:auto;overflow:auto;padding:20px}.privacy-page main{max-width:680px;margin:auto;display:block}.privacy-page h2{margin-top:24px}.privacy-page p{line-height:1.5}
#account-dialog{box-sizing:border-box;padding:14px}#account-dialog .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px}#account-dialog .dialog-head h2{font-size:20px;min-width:0;margin:0}#account-close{flex:0 0 auto;min-width:58px;min-height:44px;padding:6px;font-size:14px}#account-dialog p{font-size:14px;line-height:1.4}#account-dialog .account-note{font-size:12px}.privacy-page main{height:auto;overflow:visible}

#profile-form{display:grid;gap:8px;margin:12px 0}#profile-form[hidden]{display:none}#profile-form label{font-size:13px;font-weight:600}#profile-form input{box-sizing:border-box;width:100%;min-width:0;min-height:44px}#profile-id{font:12px monospace;padding:5px}.profile-id-row{display:grid;grid-template-columns:minmax(0,1fr) 54px;gap:5px}.profile-id-row button{font-size:12px;min-width:0;padding:4px}#profile-form p{margin:0}#profile-save{min-height:44px}#account-dialog #account-summary{font-size:12px}#account-dialog{overscroll-behavior:contain}

#friends-dialog{box-sizing:border-box;width:min(400px,calc(100vw - 16px));max-height:calc(100dvh - 16px);padding:12px;overflow:auto}#friends-dialog .dialog-head{position:sticky;top:-12px;background:inherit;z-index:2;display:flex;justify-content:space-between;align-items:center}#friends-dialog h2{font-size:20px}#friends-dialog h3{font-size:15px;margin:14px 0 6px}#friends-dialog button{min-height:44px;font-size:12px;padding:6px}#friends-search label{display:block;font-size:13px}.friend-search-row{display:grid;grid-template-columns:minmax(0,1fr) 54px;gap:6px}.friend-search-row input{min-width:0;width:100%;box-sizing:border-box}.friend-row{display:flex;flex-wrap:wrap;gap:6px;border:1px solid #b1c4a4;border-radius:8px;padding:8px;margin:7px 0}.friend-label{flex:1 1 100%;min-width:0;overflow-wrap:anywhere}.friend-label strong,.friend-label small{display:block}.friend-label small{font:11px monospace}.friend-presence{font-size:12px;flex:1 1 100%}.friend-help,#friends-status{font-size:12px;line-height:1.4}#account-friends{min-height:44px;margin-left:8px}

.seat-account-label{font-size:10px;color:#e4cda0;line-height:1}.seat-card[role=button]{cursor:pointer}.seat-card[role=button]:focus-visible{outline:2px solid #ecc875}#lobby-profile-dialog{width:min(340px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto}#lobby-profile-actions{display:flex;gap:8px;flex-wrap:wrap}#lobby-profile-id{font-variant-numeric:tabular-nums;font-size:24px;letter-spacing:2px}
#lobby-profile-dialog .dialog-head{position:static;gap:8px}#lobby-profile-dialog .dialog-head h2{font-size:20px;min-width:0;margin:0}#lobby-profile-dialog .dialog-head button{width:auto;min-width:64px;min-height:44px;font-size:14px;padding:6px 10px;flex-shrink:0}.seat-account-label{color:#315347;font-weight:700}

/* Direct friend access is scoped to welcome and lobby; playing layout unchanged. */
#friends-main{min-width:66px;min-height:44px;flex-shrink:0;font-size:12px;padding:5px 8px;background:#2c644e;color:#fff}.welcome-heading h1{min-width:0}#friends-lobby{margin-left:auto;min-width:72px;min-height:44px;font-size:12px;padding:5px 9px;background:#2c644e;color:#fff}#friends-context{padding:8px;background:#e9efdf;border-radius:6px;color:#31513c;font-size:12px;line-height:1.4}#friends-dialog .dialog-head button{width:auto;min-width:64px;min-height:44px;font-size:14px;padding:6px 10px}#friends-dialog .dialog-head h2{font-size:20px;margin:0}

.river-owner h3[role=button]{cursor:pointer}.river-owner h3[role=button]:focus-visible{outline:2px solid #35674f;outline-offset:1px}#lobby-profile-dialog.game-profile{position:fixed;z-index:20;top:54px;bottom:auto;left:50%;right:auto;transform:translateX(-50%);margin:0;width:min(300px,calc(100vw - 24px));padding:10px 12px;box-shadow:0 8px 30px #19372855}#lobby-profile-dialog.game-profile p{margin:6px 0;font-size:12px}#lobby-profile-dialog.game-profile #lobby-profile-id{font-size:20px}#lobby-profile-dialog.game-profile .dialog-head{margin-bottom:6px}#lobby-profile-dialog.game-profile .dialog-head h2{font-size:18px}#lobby-profile-dialog.game-profile #lobby-profile-actions button{min-height:40px}

.seat-card{min-width:0}.seat-card h3,.river-owner h3{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.river-owner{min-width:0}#lobby-profile-name{overflow-wrap:anywhere;white-space:normal;word-break:normal;max-width:100%}

.river-owner h3[role=button]{user-select:none}
#rules-open{position:relative}#dm-inbox-open{width:100%;margin:4px 0 8px}#dm-dialog{box-sizing:border-box;width:min(400px,calc(100vw - 16px));max-height:calc(100dvh - 20px);padding:12px;overflow:auto}#dm-dialog .dialog-head{position:static;margin-bottom:8px}#dm-dialog .dialog-head h2{font-size:19px;margin:0}#dm-close{width:auto;min-width:64px;font-size:13px;min-height:44px;padding:6px}#dm-status,#dm-peer,#dm-policy{font-size:11px;line-height:1.3;overflow-wrap:anywhere;margin:5px 0}#dm-inbox{display:grid;gap:8px}#dm-inbox button{text-align:left;overflow-wrap:anywhere;min-height:44px}#dm-conversation{display:flex;flex-direction:column;gap:4px}#dm-conversation[hidden],#dm-inbox[hidden]{display:none}#dm-messages{min-height:60px;max-height:36dvh;overflow:auto;overscroll-behavior:contain;border:1px solid #bbccb0;border-radius:6px;padding:6px}#dm-messages:empty::before{content:'Belum ada pesan';font-size:12px;color:#526b59}.dm-message{margin:5px 0;padding:6px;border-radius:6px;background:#e4ebdc}.dm-message.me{background:#d2e4dc;margin-left:18px}.dm-message.them{margin-right:18px}.dm-message small{font-size:10px;overflow-wrap:anywhere}.dm-message p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.4;margin:3px 0}#dm-form{display:grid;grid-template-columns:minmax(0,1fr) 68px;gap:6px}#dm-form[hidden]{display:none}#dm-text{width:100%;box-sizing:border-box;resize:none;min-height:44px;font:13px sans-serif}#dm-send{font-size:12px;padding:5px;min-height:44px}#dm-policy{color:#526b59}

#ranked-dialog{width:min(94vw,520px);max-height:90dvh;overflow:auto;padding:14px;box-sizing:border-box}#ranked-dialog p,#ranked-dialog summary{font-size:13px;line-height:1.45}#ranked-dialog .ranked-actions,#ranked-dialog .ranked-tabs{display:flex;gap:6px;flex-wrap:wrap}#ranked-dialog table{width:100%;border-collapse:collapse;font-size:13px}#ranked-dialog td,#ranked-dialog th{padding:7px 3px;text-align:left;overflow-wrap:anywhere}#ranked-dialog td:last-child{white-space:nowrap}#ranked-dialog .ranked-self{background:#e7efce}#ranked-open{font-size:12px;padding:4px 8px;min-height:28px}.ranked-result{font-size:12px;margin:2px 0}

#ranked-dialog .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px}#ranked-dialog .dialog-head h2{font-size:21px;margin:0;min-width:0}#ranked-dialog .dialog-head button{width:auto;min-width:60px;min-height:44px;font-size:13px;padding:6px 8px}#ranked-dialog button{min-height:40px;font-size:13px}#ranked-dialog select{font-size:16px;max-width:130px}

.ranked-result{display:grid;gap:2px;flex:none;background:#e6efe0;border:1px solid #a7bea2;border-radius:7px;padding:6px 8px;margin:3px 0 5px;color:#193f2c;font-family:system-ui,sans-serif;line-height:1.2}.ranked-result-season{font-size:10px}.ranked-result-delta{font-size:17px}.ranked-result-balance{font-size:13px;font-weight:700}.ranked-result-tier,.ranked-result-formula,.ranked-result-note{font-size:10px;overflow-wrap:anywhere}.ranked-result-pending{background:#fff2d5;border-color:#d4b56c}.ranked-result-void{background:#f2e7e2}.ranked-result-round{padding:4px 7px}.ranked-result-round .ranked-result-delta{font-size:12px}
@media(max-height:620px){.ranked-result{gap:1px;padding:4px 6px;margin:2px 0 3px}.ranked-result-delta{font-size:15px}.ranked-result-balance{font-size:12px}.ranked-result-season,.ranked-result-tier,.ranked-result-formula,.ranked-result-note{font-size:9px}}

.round-score-history{min-width:0}.round-score-title,.round-score-note{font-size:10px!important;line-height:1.15!important;margin:2px 0!important}.winner-sheet .round-score-matrix{table-layout:fixed;width:100%}.winner-sheet .round-score-matrix th:first-child{width:29%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.winner-sheet .round-score-matrix td,.winner-sheet .round-score-matrix th{font-size:10px;padding:2px 1px;text-align:right;font-variant-numeric:tabular-nums}.winner-sheet .round-score-matrix th:first-child{text-align:left}.winner-sheet .round-score-matrix thead th{font-size:9px}.round-cumulative-total{font-weight:700;background:#e2ecd7}
@media(max-height:620px){.winner-sheet .round-score-matrix td,.winner-sheet .round-score-matrix th{font-size:9px;padding:1px}.round-score-title,.round-score-note{font-size:9px!important;margin:1px 0!important}}
/* Use available portrait height for the expanded result only; the playing table is unchanged. */
@media(min-height:601px){#result-dialog.winner-sheet-dialog:has(.round-score-history){height:min(820px,calc(var(--visual-height,100dvh) - 16px - var(--safe-top,0px) - var(--safe-bottom,0px)))}}
@media(max-height:620px){.winner-sheet .round-score-matrix td,.winner-sheet .round-score-matrix th{font-size:10px}.ranked-result-tier,.ranked-result-formula,.ranked-result-note,.round-score-title,.round-score-note{font-size:10px!important}}

/* Keep round totals and ranking on the primary final screen; detailed hand patterns remain accessible. */
.compact-final-details .winner-base,.compact-final-details .winner-doubles,.compact-final-details .winner-limit{display:none}.compact-final-details .winner-calculation{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}.compact-final-details .winner-calculation>span,.compact-final-details .winner-calculation>strong{grid-column:1}.compact-final-details .hand-details-button{grid-column:2;grid-row:1/3;min-height:40px;padding:3px 6px;font-size:11px}.hand-breakdown-dialog{width:min(400px,calc(100vw - 20px));max-height:85dvh;box-sizing:border-box;padding:12px;overflow:auto}.hand-breakdown-dialog .dialog-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.hand-breakdown-dialog .dialog-head h2{font-size:18px;margin:0}.hand-breakdown-dialog .dialog-head button{font-size:13px;min-height:44px;width:auto;padding:6px 10px}.hand-breakdown-dialog .winner-base,.hand-breakdown-dialog .winner-doubles,.hand-breakdown-dialog .winner-calculation{margin-top:12px;font-size:13px;line-height:1.4}

/* Account history: scroll only its content, keep dismiss/navigation accessible. */
#ranked-dialog{max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain}
#ranked-dialog .dialog-head{position:sticky;top:0;z-index:2;background:#fff}
.ranked-history-row{display:grid;gap:5px;padding:12px 0;border-bottom:1px solid #d4ded7;text-align:left}
.ranked-history-row p{margin:0;font-size:13px;overflow-wrap:anywhere}
.ranked-history-row>strong{font-size:14px}.ranked-history-row>small{font-size:12px;color:#536657}
#ranked-content .history-rounds{width:100%;table-layout:fixed;margin:3px 0;font-variant-numeric:tabular-nums}
#ranked-content .history-rounds th,#ranked-content .history-rounds td{text-align:center;padding:4px 1px;font-size:12px}
.history-detail-open,.history-pagination button,.history-back,#ranked-detail-close{min-height:44px}
.history-pagination{display:flex;gap:5px;align-items:center;justify-content:space-between;padding:12px 0 4px;position:sticky;bottom:0;background:#fff}
.history-pagination button{padding:8px;font-size:12px}.history-pagination span{font-size:12px;white-space:nowrap}
#ranked-history-detail{width:min(500px,calc(100vw - 16px));max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:10px;overflow:auto;box-sizing:border-box;overscroll-behavior:contain}
#ranked-history-detail .dialog-head{position:sticky;top:0;background:#fff;z-index:2}#ranked-history-detail h2{font-size:17px}
#ranked-detail-body>p{font-size:12px;margin:8px 0}#ranked-detail-body .ranked-result{margin:8px 0}#ranked-detail-body .round-score-history{margin:10px 0}
#ranked-detail-body .round-score-matrix{width:100%;table-layout:fixed;font-size:11px}#ranked-detail-body .round-score-matrix th:first-child{width:30%}
#ranked-detail-body .round-score-matrix th,#ranked-detail-body .round-score-matrix td{padding:5px 1px;overflow:hidden;text-overflow:ellipsis}
#ranked-detail-body .history-back{width:100%;margin-top:12px}

#ranked-history-detail .dialog-head{display:flex;gap:8px;align-items:center;justify-content:space-between}#ranked-history-detail h2{min-width:0;flex:1;margin:0}#ranked-detail-close{flex:none;font-size:13px;padding:8px 10px;max-width:90px}#ranked-detail-body{min-width:0;overflow-wrap:anywhere}
#ranked-detail-close{width:auto;min-width:72px}

#ranked-leave-dialog{width:min(410px,calc(100vw - 20px));max-height:calc(100dvh - 20px);box-sizing:border-box;padding:16px;overflow:auto}#ranked-leave-dialog h2{font-size:20px;margin:0 0 10px}#ranked-leave-dialog p{font-size:14px;line-height:1.4}#ranked-leave-dialog>div{display:grid;gap:8px}#ranked-leave-dialog button{min-height:44px;font-size:14px;padding:8px}#ranked-leave-confirm{border-color:#9e4a34;color:#792f23}#ranked-leave-error{color:#792f23}

#support-dialog{width:min(360px,calc(100vw - 24px));max-height:85dvh;overflow:auto}#support-dialog textarea{width:100%;height:150px;resize:none;font-size:12px}#support-dialog p{font-size:12px}

/* Guide-only layout: game/lobby geometry is unchanged. */
#rules{width:min(760px,calc(100vw - 16px));height:calc(min(var(--visual-height,100dvh),100dvh) - 16px);max-height:calc(min(var(--visual-height,100dvh),100dvh) - 16px);padding:0;overflow:hidden;box-sizing:border-box;background:#f4f4e9}
#rules[open]{display:flex;flex-direction:column}#rules>.dialog-head{flex:none;position:static;display:flex;justify-content:space-between;align-items:center;margin:0;padding:10px 12px;border-bottom:1px solid #b9cbb0;background:#f4f4e9}#rules .dialog-head h2{font:700 18px/1.2 system-ui;margin:0}#rules .dialog-head p{font:12px/1.4 system-ui;margin:4px 0 0;color:#4c6553}#guide-close{min-height:44px;min-width:70px;font-size:13px;padding:7px;flex:none}#guide-frame{display:block;width:100%;flex:1;min-height:0;border:0;background:#f4f4e9;overflow:auto;overscroll-behavior:contain}

#ranked-queue-card{border:1px solid #b9cab0;border-radius:10px;padding:12px;margin:10px 0;background:#eef3e7}#ranked-queue-card[hidden]{display:none}#ranked-queue-card h3{font-size:17px;line-height:1.3;margin:0 0 8px}.queue-seats{display:flex;gap:10px;margin:10px 0}.queue-seats i{width:23px;height:23px;border:2px dashed #6f876a;border-radius:50%;background:transparent}#ranked-queue-card .queue-honest{font-size:12px;color:#4a6251;margin:8px 0}#ranked-queue-card dl{margin:10px 0}#ranked-queue-card dl>div{display:flex;justify-content:space-between;gap:14px;padding:7px 0;border-bottom:1px solid #c6d3bc}#ranked-queue-card dt{font-size:12px;flex:none}#ranked-queue-card dd{font-size:14px;text-align:right;margin:0;font-weight:700;overflow-wrap:anywhere}#ranked-wait{font-variant-numeric:tabular-nums}#ranked-range-note,#ranked-queue-connection{font-size:12px!important}#ranked-dialog.queue-active>.ranked-note,#ranked-dialog.queue-active>details,#ranked-dialog.queue-active>.ranked-tabs,#ranked-dialog.queue-active>#ranked-own,#ranked-dialog.queue-active>#ranked-content{display:none}#ranked-dialog.queue-active .ranked-actions{position:sticky;bottom:0;background:#fffdf3;padding:5px 0}#ranked-dialog #ranked-cancel{min-height:46px;flex:1;font-size:15px;border:2px solid #526f52}#ranked-dialog.queue-active #ranked-status{font-weight:700}#ranked-dialog #ranked-retry{min-height:44px}

#profile-ranked-stats{border-top:1px solid #8d9b8f;border-bottom:1px solid #8d9b8f;padding:10px 0;margin:10px 0}#profile-ranked-stats[hidden]{display:none}#profile-ranked-stats h3{font-size:17px;margin:0 0 6px}#profile-ranked-stats button{min-height:44px;max-width:100%;margin:4px 0}#profile-stats-values p{margin:6px 0}#profile-stats-points{font-weight:700}.profile-positions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:10px 0;text-align:center}.profile-positions dt{font-size:12px}.profile-positions dd{font-size:20px;font-weight:700;margin:4px 0}#profile-stats-coverage{font-size:12px!important}#account-dialog .dialog-head{position:sticky;top:-14px;background:#f3f5ed;z-index:1;padding:6px 0}

.voice-activity{display:inline-block;min-width:12px;margin-left:3px;font-size:10px;line-height:1;vertical-align:middle;opacity:.32}.voice-activity.speaking{opacity:1}.voice-activity[data-muted="true"]{opacity:.7}

#game .river-owner h3.has-voice-activity{display:flex;align-items:center;gap:2px}
#game .river-owner h3 .voice-player-caption{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit;color:inherit}
#game .river-owner h3 .voice-activity{display:inline-block;flex:0 0 12px;margin-left:0;font-size:10px;line-height:12px}

/* Speech indicators are absent during silence, mute and disconnection. */
.voice-activity[hidden],#game .river-owner h3 .voice-activity[hidden]{display:none!important}

#match-history-dialog{width:min(620px,calc(100vw - 24px));max-height:85dvh;overflow:auto}
#match-history-dialog .dialog-head h2{font-size:20px;min-width:0}
#match-history-dialog .dialog-head button{width:auto;min-width:64px;font-size:14px;padding:6px 10px;min-height:44px}
.history-summary{padding:12px;background:#e9f2e9;border-radius:12px;font-weight:700;color:#164832}
.history-list{list-style:none;padding:0;display:grid;gap:10px}
.history-list li{padding:12px;border:1px solid #ceddce;border-radius:10px;overflow-wrap:anywhere}
.history-list strong,.history-list small{display:block}.history-list small{margin-top:6px;opacity:.75}
.audio-footer{flex-wrap:wrap}.directory-heading{flex-wrap:wrap;gap:8px}

#invite-note{grid-column:1/-1;font-size:12px;line-height:1.4;color:#31553d;padding:7px 9px;border:1px solid #a9bca0;border-radius:8px;background:#eaf1e3;margin:0;overflow-wrap:anywhere}
.welcome:has(#invite-note:not([hidden])){grid-template-rows:minmax(34px,auto) auto auto 24px minmax(56px,1fr) 36px 28px}
.welcome:has(#invite-note:not([hidden])):has(#network-note[hidden]){grid-template-rows:minmax(34px,auto) auto auto 24px minmax(56px,1fr) 36px}
.welcome:has(#invite-note:not([hidden])):has(#resume-card:not([hidden])){grid-template-rows:minmax(34px,auto) auto auto auto 24px minmax(56px,1fr) 36px 28px}
.welcome:has(#invite-note:not([hidden])):has(#resume-card:not([hidden])):has(#network-note[hidden]){grid-template-rows:minmax(34px,auto) auto auto auto 24px minmax(56px,1fr) 36px}

#invite-preview{grid-column:1/-1;border:1px solid #a9bca0;background:#f6f8f0;border-radius:8px;padding:8px;min-width:0;overflow-wrap:anywhere}
#invite-preview p{font-size:12px;line-height:1.4;margin:0 0 6px;color:#264831}
#invite-preview small{display:block;font-size:10px;line-height:1.35;color:#48614d;margin-bottom:6px}
#invite-preview button{font-size:12px;min-height:36px;padding:5px 9px}
.welcome:has(#invite-preview:not([hidden])){height:auto;min-height:100%;grid-template-rows:minmax(34px,auto) auto auto 24px minmax(56px,1fr) 36px 28px}
.welcome:has(#invite-preview:not([hidden])):has(#network-note[hidden]){grid-template-rows:minmax(34px,auto) auto auto 24px minmax(56px,1fr) 36px}
.welcome:has(#invite-preview:not([hidden])):has(#resume-card:not([hidden])){grid-template-rows:minmax(34px,auto) auto auto auto 24px minmax(56px,1fr) 36px 28px}
.welcome:has(#invite-preview:not([hidden])):has(#resume-card:not([hidden])):has(#network-note[hidden]){grid-template-rows:minmax(34px,auto) auto auto auto 24px minmax(56px,1fr) 36px}

#quick-guide-open{display:block;min-height:32px;margin-top:4px;padding:4px 2px;font-size:12px;text-align:left;color:#245d45}

#result-share-open{min-height:40px;margin:4px 0;flex-shrink:0}
#result-share-dialog{width:min(440px,calc(100vw - 24px));max-height:85dvh;overflow:auto}
#result-share-dialog .dialog-head h2{font-size:20px;min-width:0}
#result-share-dialog .dialog-head button{width:auto;min-width:64px;min-height:44px;font-size:14px;padding:6px 10px}
#lobby .lobby-settings{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
#lobby-name-open{min-height:44px;max-width:104px;font-size:12px;padding:6px 10px}
#lobby-name-dialog{width:min(400px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:14px}
#lobby-name-dialog .dialog-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}
#lobby-name-dialog .dialog-head h2{font-size:19px}
#lobby-name-dialog button{min-height:44px;width:auto}
#lobby-name-form{display:grid;gap:10px}
#lobby-name-note,#lobby-name-status{font-size:12px;line-height:1.45;overflow-wrap:anywhere}
#result-share-text{width:100%;box-sizing:border-box;resize:vertical;min-height:150px;font:14px/1.5 system-ui;background:#fff;color:#173e32;border:1px solid #a7bba0;border-radius:8px;padding:10px}
.result-share-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}
.result-share-actions>*{min-height:44px;padding:8px;text-align:center;border:1px solid #a7bba0;border-radius:8px;color:#245b43;display:flex;align-items:center;justify-content:center;font-size:13px;text-decoration:none;font-weight:700}
#result-share-status{font-size:13px;min-height:20px}

#account-casual-history{border-top:1px solid #a5b69d;padding:12px 0;margin-top:12px}
#account-casual-history h3{font-size:17px}#account-casual-history p{font-size:12px;line-height:1.4}
#account-history-list{list-style:none;padding:0;display:grid;gap:8px}
#account-history-list li{padding:9px;border:1px solid #b7c7af;border-radius:8px;overflow-wrap:anywhere}
#account-history-list strong,#account-history-list small{display:block}#account-history-list small{font-size:11px;margin-top:5px}
#account-history-refresh{min-height:44px;max-width:100%}

#invite-recovery-dialog{width:min(400px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:16px}
#invite-recovery-dialog .dialog-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}
#invite-recovery-dialog h2{font-size:19px;min-width:0}
#invite-recovery-dialog p{font-size:13px;line-height:1.5;margin:10px 0;overflow-wrap:anywhere}
#invite-recovery-dialog button{min-height:44px;width:auto;font-size:13px}
.invite-recovery-actions{display:grid;gap:8px;margin-top:16px}
#invite-recovery-pending{color:#6d5427}

#lobby{grid-template-rows:108px minmax(76px,max-content) 44px minmax(100px,1fr) max-content}
#lobby-help{font-size:12px;line-height:1.4;padding:3px 6px;overflow-wrap:anywhere;background:#edf2e4;border-radius:6px;text-align:left}
@media(max-height:650px){#lobby{grid-template-rows:98px minmax(76px,max-content) 44px minmax(88px,1fr) max-content}#lobby-help{font-size:11px}}

#leave-room-dialog{width:min(390px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:16px}
#leave-room-dialog h2{font-size:20px;margin:0 0 12px}
#leave-room-dialog p{font-size:14px;line-height:1.5;margin:0 0 16px;overflow-wrap:anywhere}
.leave-room-actions{display:grid;gap:8px}
#leave-room-dialog button{min-height:44px;font-size:14px;width:100%}
#leave-room-confirm{border-color:#9e4a34;color:#792f23}





.winner-sheet.final-match{grid-template-rows:minmax(0,1fr) auto!important}
.winner-sheet.final-match .winner-body{overflow-y:auto;overscroll-behavior:contain;gap:6px;padding-right:2px}
.winner-sheet.final-match .result-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px}
.winner-sheet.final-match #result-ready{grid-column:1/-1;grid-row:1}
.winner-sheet.final-match .result-footer button{min-height:44px;white-space:normal;line-height:1.2;font-size:12px;padding:5px}
#final-match-summary{background:#e7efdc;border:1px solid #b8cba6;border-radius:8px;padding:8px}
#final-match-summary h3{font-size:17px;margin:0 0 5px}
#final-match-summary p{font-size:12px!important;line-height:1.4}
#final-standings{width:100%;border-collapse:collapse;font-size:12px;margin:8px 0}
#final-standings th,#final-standings td{text-align:left;padding:5px 3px;overflow-wrap:anywhere}
#final-standings th:first-child,#final-standings td:first-child{width:56px}
#final-standings th:last-child,#final-standings td:last-child{text-align:right;white-space:nowrap}
#final-standings .final-own-row{background:#d2e4bf;font-weight:700}

#game.your-turn #turn-status{background:#e3efd4;border-left:4px solid #2b694b;border-radius:6px;padding-left:5px}
#game.your-turn #turn-label{color:#184c30;font-weight:800}
#hand .tile.selected{outline:3px solid #1d6a4c;outline-offset:-2px}
#hand .selection-mark{background:#1d6a4c;width:16px;height:16px;font-size:12px}
#actions button{white-space:normal;line-height:1.15}
#claim-hint{overflow-wrap:anywhere}

#directory-filter-open{min-width:54px}
#directory-filter-dialog{width:min(390px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:16px}
#directory-filter-dialog .dialog-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}
#directory-filter-dialog h2{font-size:19px}
#directory-filter-dialog button{min-height:44px;font-size:13px}
#directory-filter-form{display:grid;gap:10px}
#directory-filter-form label{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px}
#directory-filter-form input{width:20px;height:20px;padding:0;accent-color:#2b694b}
#directory-filter-status{font-size:12px;line-height:1.4}

#share-dialog{max-height:calc(100dvh - 24px);overflow:auto}
#copy-invite-message{width:100%;min-height:44px;margin:10px 0 2px;font-size:14px}
#invite-text{display:block;width:100%;min-width:0;min-height:110px;resize:vertical;font:13px/1.45 Arial,sans-serif;padding:8px;border:1px solid #aabb9e;border-radius:7px;background:#fffdf3;color:#244b35}

#result-explanation{padding:10px;background:#edf3e4;border-radius:8px;margin-bottom:10px}#result-explanation p{margin:6px 0}#result-payments{width:100%;font-size:12px;border-collapse:collapse}#result-payments th,#result-payments td{padding:4px;text-align:left;overflow-wrap:anywhere}#result-payments td:last-child{text-align:right}#result-payments caption{text-align:left;margin:8px 0 4px}

.special-patterns{margin:10px 0}.special-pattern{border-top:1px solid #bbc9ae}.special-pattern summary{min-height:44px;padding:10px 0;cursor:pointer;font-weight:700;overflow-wrap:anywhere}.special-pattern p{font-size:13px}.special-pattern-tiles{display:flex;flex-wrap:wrap;gap:4px;padding:8px 0}.special-pattern-tiles .tile{pointer-events:none}.special-pattern summary:focus-visible{outline:2px solid #456c4b;outline-offset:2px}

.tile-size-setting{padding:10px 0;border-bottom:1px solid #bbc9ae}.tile-size-setting label{display:block;font-weight:700;margin-bottom:6px}.tile-size-setting select{min-height:44px;width:100%}.tile-size-setting p{font-size:12px;color:#526451;margin:6px 0}html[data-tile-size=large] .shell{--hand-tile-height:clamp(64px,calc((min(100vw,460px) - 40px - var(--safe-left,0px) - var(--safe-right,0px))/6/.73),96px)}html[data-tile-size=large] #room #game{--hand-tile-height:clamp(64px,calc((min(100vw,460px) - 40px - var(--safe-left,0px) - var(--safe-right,0px))/6/.73),96px)}html[data-tile-size=large] #hand,html[data-tile-size=large] #hand:not(:has(.tile:nth-child(8))){grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:var(--hand-tile-height)}html[data-tile-size=large] dialog .tile{width:42px;min-width:42px;height:58px;min-height:58px}html[data-tile-size=large] #game{overflow-y:auto;overscroll-behavior-y:contain}
html[data-tile-size=large] #room #game:has(#claim-panel[open]){grid-template-rows:14px minmax(240px,1fr) calc(var(--river-face,32px) + 46px) auto var(--hand-block-size,200px) 44px 0;scroll-padding:8px}

.contrast-setting{padding:10px 0;border-bottom:1px solid #bbc9ae}.contrast-setting label{display:flex;align-items:center;gap:10px;min-height:44px;font-weight:700}.contrast-setting input{width:22px;height:22px;flex:none}.contrast-setting p{font-size:12px;color:#526451;margin:4px 0}
html[data-high-contrast=on]{--muted:#333;--line:#111;color-scheme:light}
html[data-high-contrast=on] body,html[data-high-contrast=on] .shell,html[data-high-contrast=on] #room,html[data-high-contrast=on] #welcome,html[data-high-contrast=on] dialog{background:#fff;color:#111}
html[data-high-contrast=on] .table,html[data-high-contrast=on] .hand-heading,html[data-high-contrast=on] #result-explanation{background:#fff;color:#111;border-color:#111}
html[data-high-contrast=on] header,html[data-high-contrast=on] .dialog-head{background:#fff;color:#111;border-color:#111}
html[data-high-contrast=on] button,html[data-high-contrast=on] select,html[data-high-contrast=on] input:not([type=range]):not([type=checkbox]){border-color:#111;color:#111;background:#fff}
html[data-high-contrast=on] button.primary{color:#fff;background:#111;border-color:#111}
html[data-high-contrast=on] #hand .tile,html[data-high-contrast=on] #hand .tile:hover:not(:disabled){background:#fff;border-color:#222}
html[data-high-contrast=on] #hand .tile.drawn{border-color:#174c8e;border-style:dashed}
html[data-high-contrast=on] #hand .tile.selected,html[data-high-contrast=on] #hand .tile.drawn.selected{outline:4px solid #111;outline-offset:-2px;border-color:#111;border-style:solid;box-shadow:inset 0 0 0 2px #fff}
html[data-high-contrast=on] #hand .tile.selected .selection-mark{background:#111;color:#fff;border:1px solid #fff}
html[data-high-contrast=on] #game.your-turn #turn-status{background:#111;color:#fff;border-color:#111}
html[data-high-contrast=on] #game.your-turn #turn-label,html[data-high-contrast=on] #game.your-turn #turn-hint{color:#fff}
html[data-high-contrast=on] #game.your-turn #turn-status p,html[data-high-contrast=on] #game.your-turn #turn-status small{color:#fff}
html[data-high-contrast=on] #game .river-owner,html[data-high-contrast=on] #game .river-owner h3,html[data-high-contrast=on] #game .river-empty,html[data-high-contrast=on] #game .river-owner .river-total{color:#111}
html[data-high-contrast=on] #game .river-row.active{background:#fff5b8;box-shadow:inset 0 0 0 2px #111}
html[data-high-contrast=on] #game .discard-entry.latest{outline:3px solid #111;outline-offset:-1px;opacity:1}
html[data-high-contrast=on] #game .discard-entry.latest small{background:#111;color:#fff;font-weight:800}
html[data-high-contrast=on] #game .discard-entry.latest>.tile{background:#fff;border-color:#111}
html[data-high-contrast=on] #claim-types button{color:#111;background:#fff;border-color:#111}
html[data-high-contrast=on] #claim-types button[aria-pressed=true]{background:#111;color:#fff}
html[data-high-contrast=on] #timer{background:#fff;color:#111;border:1px solid #111}
html[data-high-contrast=on] .contrast-setting p,html[data-high-contrast=on] .tile-size-setting p,html[data-high-contrast=on] #claim-hint{color:#222}
html[data-high-contrast=on] button:focus-visible,html[data-high-contrast=on] summary:focus-visible,html[data-high-contrast=on] select:focus-visible,html[data-high-contrast=on] input:focus-visible{outline:3px solid #174c8e;outline-offset:2px}


#duration-sync-note{grid-column:1/-1;font-size:12px;line-height:1.3;color:#526451;margin:0}html[data-high-contrast=on] #duration-sync-note{color:#222}

#duration-sync-note.duration-changed{background:#fff0bc;color:#302400;border:2px solid #856516;border-radius:6px;padding:6px;font-weight:700}html[data-high-contrast=on] #duration-sync-note.duration-changed{background:#fff;color:#111;border-color:#111}

.player-volume-control{width:100%;padding:8px 0}.player-volume-control label{display:flex;justify-content:space-between;font-weight:700;font-size:14px;gap:8px}.player-volume-control input[type=range]{width:100%;min-height:44px;margin:4px 0}.player-volume-control small{display:block;font-size:12px;line-height:1.3;color:#526451}html[data-high-contrast=on] .player-volume-control small{color:#222}

.player-volume-control button{width:100%;min-height:44px;margin:4px 0}

/* Mahjong tile crown identifies the host independently of microphone activity. */
.host-tile{display:inline-flex;align-items:center;justify-content:center;width:18px;height:22px;flex:none;margin-left:5px;vertical-align:middle;background:linear-gradient(#fffdf2,#f4eccd);border:1px solid #9a8546;border-radius:3px;box-shadow:0 2px 0 #4b795a;color:#b18426}
.host-tile svg{width:80%;height:80%;fill:currentColor}
#game .river-owner h3 .host-tile{display:inline-flex;width:12px;height:12px;margin-left:0;border-radius:2px;box-shadow:0 1px 0 #4b795a}
html[data-high-contrast=on] .host-tile{background:#fff;border-color:#111;color:#684500;box-shadow:0 1px 0 #111}

.host-change-notice{position:fixed;z-index:30;top:52px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 24px);padding:10px 14px;border:1px solid #9a8546;border-radius:8px;background:#fff8df;color:#173e30;box-shadow:0 3px 12px #173e3026;font-size:14px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;pointer-events:none}
.host-change-notice[hidden]{display:none!important}
html[data-high-contrast=on] .host-change-notice{background:#fff;color:#111;border:2px solid #111}

.lobby-presence-notice.below-host{top:var(--host-notice-bottom,104px)}

#player-kick-confirmation{flex:1 0 100%;padding:12px;border:1px solid #a9bba2;border-radius:6px;background:#fff8df}#player-kick-confirmation p{margin:0 0 10px;overflow-wrap:anywhere}#player-kick-confirmation button{margin:0 8px 0 0}html[data-high-contrast=on] #player-kick-confirmation{background:#fff;border:2px solid #111}

html[data-table-theme=maroon]{--felt-light:#803c47;--felt-dark:#51202e;--felt-line:#bd8991;--felt-active:#934753}
html[data-table-theme=blue]{--felt-light:#284d69;--felt-dark:#15344e;--felt-line:#8caabd;--felt-active:#39617c}
html:not([data-high-contrast=on]):is([data-table-theme=maroon],[data-table-theme=blue]) #game .table{background:radial-gradient(ellipse at 50% 40%,var(--felt-light),var(--felt-dark));color:#fff4df;border-color:var(--felt-line);box-shadow:inset 0 1px 3px #0002}
html:not([data-high-contrast=on]):is([data-table-theme=maroon],[data-table-theme=blue]) #game .river-row{border-color:var(--felt-line)}
html:not([data-high-contrast=on]):is([data-table-theme=maroon],[data-table-theme=blue]) #game .river-row.active{background:var(--felt-active);box-shadow:inset 0 0 0 1px #efd08a}
html:not([data-high-contrast=on]):is([data-table-theme=maroon],[data-table-theme=blue]) #game :is(.table-center h2,.table-center p,.river-owner,.river-owner h3,.river-owner span:not(.host-tile),.river-owner small,.river-total,.river-empty,.player-presence,.river-navigation,.river-navigation #river-note,.table-details,.discard-entry small){color:#fff4df}
html:not([data-high-contrast=on]):is([data-table-theme=maroon],[data-table-theme=blue]) #game .discard-entry.latest small{color:#302400;background:#efd08a}
#table-theme-preview{display:flex;justify-content:center;gap:10px;margin-top:8px;padding:14px;border-radius:8px;border:1px solid #85aa8c;background:radial-gradient(ellipse at 50% 40%,#d4e6d9,#b9d4c1)}
#table-theme-preview span{display:flex;align-items:center;justify-content:center;width:28px;height:36px;border-radius:3px;border:1px solid #bbc6b5;background:#fffdf2;color:#1d5a39;font:22px serif;box-shadow:0 2px 0 #639478}
html:not([data-high-contrast=on]):is([data-table-theme=maroon],[data-table-theme=blue]) #table-theme-preview{background:radial-gradient(ellipse at 50% 40%,var(--felt-light),var(--felt-dark));border-color:var(--felt-line)}
html[data-high-contrast=on] #table-theme-preview{background:#fff;border:2px solid #111}

#game .table{position:relative}
.seat-draw-overlay{position:absolute;inset:0;z-index:12;display:flex;align-items:center;justify-content:center;padding:0;background:transparent;pointer-events:none;border:0;box-shadow:none}
.seat-draw-overlay[hidden]{display:none!important}
.seat-draw-dice{display:flex;align-items:center;justify-content:center;gap:28px;width:max-content;height:90px;background:transparent;pointer-events:none}
.seat-die-scene{display:block;perspective:550px;width:54px;height:54px}
.seat-die-cube{position:relative;display:block;width:54px;height:54px;transform-style:preserve-3d;transform:rotateX(-10deg) rotateY(-14deg);animation-timing-function:cubic-bezier(.18,.68,.25,1);animation-fill-mode:both;will-change:transform}
.seat-die-face{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:4px;padding:9px;border-radius:9px;background:linear-gradient(145deg,#fffef7,#e7dfc7);border:1px solid #b7aa85;box-shadow:inset 0 0 3px #fff;backface-visibility:hidden}
.seat-die-face .pip{border-radius:50%;background:#184b38;box-shadow:inset 0 1px 2px #0005}
.seat-die-face.red-pips .pip{background:#b82a2b}
.seat-die-face .blank{visibility:hidden}
.seat-die-face.face-front{transform:translateZ(27px)}
.seat-die-face.face-back{transform:rotateY(180deg) translateZ(27px)}
.seat-die-face.face-right{transform:rotateY(90deg) translateZ(27px)}
.seat-die-face.face-left{transform:rotateY(-90deg) translateZ(27px)}
.seat-die-face.face-top{transform:rotateX(90deg) translateZ(27px)}
.seat-die-face.face-bottom{transform:rotateX(-90deg) translateZ(27px)}
@keyframes seat-cube-roll-a{0%{transform:translateY(-24px) rotateX(520deg) rotateY(-620deg) rotateZ(-25deg)}45%{transform:translateY(9px) rotateX(200deg) rotateY(-220deg) rotateZ(18deg)}75%{transform:translateY(-5px) rotateX(35deg) rotateY(-40deg) rotateZ(-8deg)}100%{transform:translateY(0) rotateX(-10deg) rotateY(-14deg) rotateZ(0)}}
@keyframes seat-cube-roll-b{0%{transform:translateY(-32px) rotateX(-610deg) rotateY(540deg) rotateZ(28deg)}45%{transform:translateY(5px) rotateX(-240deg) rotateY(180deg) rotateZ(-15deg)}75%{transform:translateY(-7px) rotateX(-40deg) rotateY(26deg) rotateZ(7deg)}100%{transform:translateY(0) rotateX(-10deg) rotateY(-14deg) rotateZ(0)}}
@media(prefers-reduced-motion:reduce){.seat-die-cube{animation:none!important}}

body.home-mode  #welcome *{box-sizing:border-box}body.home-mode{margin:0;background:#f1f2ea;color:#233e33;font-family:system-ui,'Segoe UI',Arial,sans-serif}body.home-mode  #welcome button,body.home-mode  #welcome input{font:inherit}body.home-mode  #welcome button{cursor:pointer}body.home-mode  #welcome button:focus-visible,body.home-mode  #welcome input:focus-visible{outline:3px solid #a17d30;outline-offset:3px}body.home-mode .page{max-width:1120px;margin:0 auto;padding:28px 28px 36px}body.home-mode  .page .header{display:flex;align-items:center;gap:28px;margin-bottom:26px}body.home-mode  .page .brand{display:flex;align-items:center;gap:10px;margin-right:auto}body.home-mode  .page .logo{width:37px;height:45px;display:grid;place-items:center;border-radius:7px;background:#fffdf3;border:1px solid #c7cbb7;box-shadow:0 3px 0 #477360;font:28px Georgia;color:#275a43}body.home-mode  .page .brand strong{display:block;font:700 21px Georgia,serif}body.home-mode  .page .brand small{display:block;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#7b8574;margin-top:5px}body.home-mode  .page .nav{display:flex;align-items:center;gap:4px}body.home-mode  .page .nav button{border:0;background:transparent;border-radius:9px;padding:11px 19px;color:#617568;font-size:13px;font-weight:600}body.home-mode  .page .nav .active{background:#e0e7da;color:#204f3b}body.home-mode  .page .account{border:1px solid #ccd3c1;background:#fafbf5;color:#3c5f4d;border-radius:9px;padding:10px 14px;font-size:12px}body.home-mode  .page .home-tools{display:flex;gap:7px}body.home-mode  .page .home-tools button{display:grid;place-items:center;width:38px;height:38px;border:1px solid #ccd3c1;background:#fafbf5;border-radius:9px;color:#385b47}body.home-mode  .page .home-tools svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6}body.home-mode  #welcome .hero{position:relative;isolation:isolate;overflow:hidden;border-radius:20px;background:linear-gradient(115deg,#153e31,#285d47);padding:35px 40px;height:274px;color:#fff8e6;margin-bottom:24px;box-shadow:0 8px 24px #173d3010}body.home-mode  #welcome .hero:before{content:'';position:absolute;z-index:-1;width:500px;height:500px;border:1px solid #dbd8ab1a;border-radius:50%;right:-38px;top:-138px;box-shadow:0 0 0 45px #ddd4a905,0 0 0 90px #ddd4a905}body.home-mode  #welcome .eyebrow{display:flex;gap:8px;align-items:center;color:#d9c389;font-size:10px;letter-spacing:2px;font-weight:600;text-transform:uppercase;margin:0 0 13px}body.home-mode  #welcome .eyebrow:before{content:'';width:17px;height:1px;background:#d9c389}body.home-mode  #welcome .hero h1{font:42px/1.08 Georgia,serif;letter-spacing:-1px;margin:0 0 13px;max-width:480px}body.home-mode  #welcome .hero p{font-size:13px;color:#b7cdbd;line-height:1.6;margin:0;max-width:420px}body.home-mode  #welcome .hero-tags{display:flex;gap:8px;margin-top:18px}body.home-mode  #welcome .hero-tags span{padding:5px 9px;border:1px solid #a6bfa43c;border-radius:20px;color:#ebead9;font-size:10px}body.home-mode  #welcome .art{position:absolute;right:85px;top:36px;width:260px;height:194px;pointer-events:none}body.home-mode  #welcome .tile{position:absolute;width:91px;height:119px;background:linear-gradient(145deg,#fffdf2,#f1e9ce);border:1px solid #d9d0b5;border-radius:10px;box-shadow:0 7px 0 #baab7d,0 10px 0 #234b36,0 20px 26px #071c3b40;display:grid;place-items:center}body.home-mode  #welcome .tile svg{width:64%;height:74%}body.home-mode  #welcome .tile.a{left:0;top:30px;transform:rotate(-17deg)}body.home-mode  #welcome .tile.b{left:85px;top:8px;transform:rotate(3deg);z-index:2}body.home-mode  #welcome .tile.c{left:169px;top:35px;transform:rotate(19deg)}body.home-mode  #welcome .tile.c strong{font:65px serif;color:#a64036}body.home-mode  #welcome .star{position:absolute;color:#ddc58d;font-size:18px}body.home-mode  #welcome .star.s1{right:-20px;top:6px}body.home-mode  #welcome .star.s2{left:-29px;bottom:13px;font-size:12px}body.home-mode  #welcome .play-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:18px;margin-bottom:28px}body.home-mode  #welcome .panel{background:#fffef7;border:1px solid #d8decf;border-radius:14px;padding:23px}body.home-mode  #welcome .panel-title{display:flex;align-items:center;gap:10px;margin-bottom:18px}body.home-mode  #welcome .panel-title .number{display:grid;place-items:center;width:26px;height:26px;border-radius:7px;background:#e9eee1;color:#53724e;font-size:11px}body.home-mode  #welcome .panel h2{font:600 19px Georgia,serif;margin:0}body.home-mode  #welcome .panel .sub{font-size:12px;color:#7d8b7b;margin:0 0 15px;line-height:1.5}body.home-mode  #welcome .field-label{font-size:11px;font-weight:600;display:block;margin-bottom:6px;color:#5f7463}body.home-mode  #welcome .create-fields{display:flex;gap:10px;align-items:flex-end}body.home-mode  #welcome .name-field{flex:1;min-width:0}body.home-mode  #welcome input{width:100%;height:44px;background:#fcfcf6;border:1px solid #cbd5c3;border-radius:8px;padding:0 13px;color:#294b38;font-size:13px}body.home-mode  #welcome input::placeholder{color:#8c9988}body.home-mode  #welcome .room-choice{display:flex;gap:6px;margin-top:12px}body.home-mode  #welcome .room-choice button{display:flex;align-items:center;gap:8px;flex:1;border:1px solid #dce0d1;background:#fffdf6;border-radius:8px;padding:11px;font-size:12px;color:#5d735f}body.home-mode  #welcome .room-choice button.active{background:#eef3e5;border-color:#8ca37b;color:#2c553c}body.home-mode  #welcome .radio{width:12px;height:12px;border:1px solid #afbaa3;border-radius:50%;display:block}body.home-mode  #welcome .active .radio{border:3px solid #2e664c;background:#fff}body.home-mode  #welcome .room-choice small{display:block;font-size:10px;color:#859078;margin-top:3px}body.home-mode  #welcome .choice-text{text-align:left}body.home-mode  #welcome .primary{height:44px;background:#285f47;color:#fffaf0;border:0;border-radius:8px;padding:0 22px;font-size:13px;font-weight:600;white-space:nowrap}body.home-mode  #welcome .create-go{width:100%;margin-top:16px;display:flex;align-items:center;justify-content:space-between}body.home-mode  #welcome .arrow{font-size:19px;font-weight:400}body.home-mode  #welcome .panel-foot{display:flex;align-items:center;justify-content:center;gap:5px;font-size:10px;color:#8a9581;margin-top:12px}body.home-mode  #welcome .join-row{display:flex;gap:8px}body.home-mode  #welcome .join-row button{border:1px solid #b3c3a4;border-radius:8px;background:#edf3e4;color:#355a3e;font-weight:600;padding:0 15px;font-size:12px}body.home-mode  #welcome .guide{border-top:1px solid #e6e9dc;padding-top:14px;margin-top:19px;display:flex;align-items:center;gap:10px}body.home-mode  #welcome .guide-icon{font:21px Georgia;display:grid;place-items:center;width:34px;height:37px;background:#f6f0dd;border:1px solid #e3d8b7;border-radius:6px;color:#8b7035}body.home-mode  #welcome .guide strong{font-size:12px;color:#546443}body.home-mode  #welcome .guide p{font-size:10px;color:#8a9480;margin:4px 0 0}body.home-mode  #welcome .guide a{margin-left:auto;text-decoration:none;color:#8a7133;font-size:18px}body.home-mode  #welcome .directory-head{display:flex;align-items:center;gap:10px;margin-bottom:13px}body.home-mode  #welcome .directory-head h2{font:600 23px Georgia;margin:0}body.home-mode  #welcome .live{display:inline-flex;align-items:center;gap:5px;font-size:10px;color:#759071;background:#e6eddc;border-radius:20px;padding:4px 8px}body.home-mode  #welcome .live i{width:5px;height:5px;border-radius:50%;background:#6c9d61}body.home-mode  #welcome .directory-actions{margin-left:auto;display:flex;gap:8px}body.home-mode  #welcome .directory-actions button{border:1px solid #ccd6c1;background:#fafbf4;color:#5d745b;font-size:11px;border-radius:7px;min-height:34px;padding:0 12px}body.home-mode  #welcome .room-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}body.home-mode  #welcome .room-card{background:#fffef8;border:1px solid #d7dfcd;border-radius:12px;padding:17px 17px 15px}body.home-mode  #welcome .room-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}body.home-mode  #welcome .room-avatar{width:34px;height:40px;border-radius:5px;background:#f4f4e8;border:1px solid #d3dbc6;box-shadow:0 2px 0 #bdcbb0;font:24px serif;display:grid;place-items:center;color:#476d4c}body.home-mode  #welcome .status{font-size:10px;color:#719167;display:flex;align-items:center;gap:4px}body.home-mode  #welcome .status:before{content:'';width:4px;height:4px;border-radius:50%;background:#88a874}body.home-mode  #welcome .room-card h3{font-size:14px;margin:0 0 5px;font-weight:650}body.home-mode  #welcome .room-card p{font-size:10px;color:#899880;margin:0 0 17px}body.home-mode  #welcome .room-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}body.home-mode  #welcome .seats{display:flex;align-items:center;gap:4px}body.home-mode  #welcome .seats i{display:grid;place-items:center;width:20px;height:20px;border:1px solid #c3d2b8;background:#e6eddf;border-radius:50%;font-size:8px;font-style:normal;color:#73905f}body.home-mode  #welcome .seats i.empty{background:none;border-style:dashed;color:#acb9a0}body.home-mode  #welcome .seats b{font-size:10px;font-weight:400;color:#859477;margin-left:4px}body.home-mode  #welcome .room-bottom button{border:1px solid #bfd0ad;background:#f6f8ee;border-radius:7px;min-height:34px;padding:0 13px;color:#426342;font-size:11px;font-weight:600}body.home-mode  #welcome .pagination{display:flex;justify-content:center;align-items:center;gap:18px;margin-top:18px;font-size:10px;color:#819076}body.home-mode  #welcome .pagination button{width:28px;height:28px;border:1px solid #d3ddc8;border-radius:7px;background:transparent;color:#8a9b7f;font-size:18px}body.home-mode  #welcome .footer{margin-top:22px;text-align:center;color:#929d88;font-size:10px}body.home-mode  #welcome .mobile-join{display:none}body.home-mode  #welcome .prototype-status{font-size:12px;color:#48664e;margin:8px 0 0;min-height:0}body.home-mode  #welcome .join-panel.join-open{display:block}@media(max-width:700px){body.home-mode .page{padding:18px 16px 26px}body.home-mode  .page .header{flex-wrap:wrap;gap:16px;margin-bottom:16px}body.home-mode  .page .brand strong{font-size:18px}body.home-mode  .page .brand small{font-size:8px;letter-spacing:1.7px}body.home-mode  .page .logo{width:29px;height:36px;font-size:23px}body.home-mode  .page .home-tools button{width:34px;height:34px}body.home-mode  .page .account{display:none}body.home-mode  .page .nav{order:4;flex-basis:100%;background:#e6ebde;border-radius:9px;padding:3px}body.home-mode  .page .nav button{flex:1;padding:9px;font-size:11px}body.home-mode  .page .nav .active{background:#fffdf4;box-shadow:0 2px 4px #44533809}body.home-mode  #welcome .hero{padding:24px 20px;height:214px;border-radius:14px;margin-bottom:17px}body.home-mode  #welcome .eyebrow{font-size:8px;letter-spacing:1.3px;margin-bottom:12px}body.home-mode  #welcome .hero h1{font-size:32px;max-width:235px;letter-spacing:-.7px;margin-bottom:11px}body.home-mode  #welcome .hero p{font-size:10px;max-width:220px}body.home-mode  #welcome .hero-tags{margin-top:13px;gap:5px}body.home-mode  #welcome .hero-tags span{font-size:8px;padding:4px 7px}body.home-mode  #welcome .art{right:13px;top:100px;width:121px;height:100px}body.home-mode  #welcome .tile{width:43px;height:58px;border-radius:5px;box-shadow:0 3px 0 #baab7d,0 5px 0 #234b36,0 12px 14px #071c3b40}body.home-mode  #welcome .tile.a{left:0;top:12px}body.home-mode  #welcome .tile.b{left:39px;top:0}body.home-mode  #welcome .tile.c{left:77px;top:14px}body.home-mode  #welcome .tile.c strong{font-size:31px}body.home-mode  #welcome .star.s1{font-size:10px;right:0;top:-15px}body.home-mode  #welcome .star.s2{font-size:9px;left:-10px;bottom:8px}body.home-mode  #welcome .play-grid{display:block;margin-bottom:23px}body.home-mode  #welcome .panel{padding:18px;border-radius:12px}body.home-mode  #welcome .panel-title{margin-bottom:14px}body.home-mode  #welcome .panel h2{font-size:18px}body.home-mode  #welcome .panel-title .number{width:24px;height:24px}body.home-mode  #welcome .room-choice button{padding:9px;font-size:11px}body.home-mode  #welcome .room-choice small{font-size:9px}body.home-mode  #welcome .create-go{margin-top:13px}body.home-mode  #welcome .mobile-join{display:block;width:100%;text-align:center;padding:12px 0 0;border:0;background:none;color:#6e805f;font-size:11px}body.home-mode  #welcome .join-panel{display:none;margin-top:12px}body.home-mode  #welcome .directory-head h2{font-size:20px}body.home-mode  #welcome .live{font-size:8px;padding:3px 6px}body.home-mode  #welcome .directory-actions{gap:4px}body.home-mode  #welcome .directory-actions button{padding:0 8px;min-height:30px;font-size:10px}body.home-mode  #welcome .directory-actions .refresh{font-size:14px;padding:0 9px}body.home-mode  #welcome .room-grid{grid-template-columns:1fr;gap:9px}body.home-mode  #welcome .room-card{padding:13px 14px;display:grid;grid-template-columns:33px 1fr auto;gap:11px;align-items:center}body.home-mode  #welcome .room-top{display:contents}body.home-mode  #welcome .room-avatar{grid-row:1/3;width:29px;height:36px;font-size:22px}body.home-mode  #welcome .status{grid-column:3;grid-row:1;font-size:9px;justify-content:flex-end}body.home-mode  #welcome .room-card h3{grid-column:2;grid-row:1;margin:0;font-size:12px}body.home-mode  #welcome .room-card p{grid-column:2;grid-row:2;margin:0;font-size:9px}body.home-mode  #welcome .room-bottom{display:contents}body.home-mode  #welcome .seats{display:none}body.home-mode  #welcome .room-bottom button{grid-column:3;grid-row:2;min-height:30px;padding:0 11px;font-size:10px}body.home-mode  #welcome .room-card:last-child{display:none}body.home-mode  #welcome .pagination{margin-top:12px}body.home-mode  #welcome .footer{font-size:8px;margin-top:18px}}@media(max-width:350px){body.home-mode  #welcome .directory-head h2{white-space:nowrap}body.home-mode  #welcome .directory-head .live{display:none}body.home-mode .page{padding-left:12px;padding-right:12px}body.home-mode  #welcome .hero{padding:22px 16px}body.home-mode  #welcome .hero h1{font-size:29px}body.home-mode  #welcome .hero p{max-width:180px}body.home-mode  #welcome .hero .art{right:10px;top:112px;transform:scale(.9);transform-origin:right bottom}body.home-mode  #welcome .hero-tags{gap:4px}body.home-mode  #welcome .hero-tags span{font-size:7px}body.home-mode  #welcome .directory-head{gap:5px}body.home-mode  #welcome .directory-head h2{font-size:18px}}body.home-mode  .page .account{font-weight:650}body.home-mode  #welcome .ranked-card{display:flex;align-items:center;gap:16px;padding:21px 24px;margin:0 0 22px;border:1px solid #d5c49a;border-radius:14px;background:linear-gradient(110deg,#f9f3df,#fffdf5);box-shadow:0 3px 10px #8d6d1810}body.home-mode  #welcome .ranked-symbol{display:grid;place-items:center;flex:none;width:52px;height:58px;border-radius:11px;background:#eee1ba;border:1px solid #d9c88e;color:#8a6923}body.home-mode  #welcome .ranked-symbol svg{width:31px;height:31px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}body.home-mode  #welcome .ranked-eyebrow{font-size:8px;letter-spacing:1.6px;color:#987c3d;font-weight:700;margin:0 0 5px}body.home-mode  #welcome .ranked-copy h2{font:600 24px Georgia,serif;margin:0 0 5px;color:#59491e}body.home-mode  #welcome .ranked-copy p{font-size:12px;color:#8a825e;margin:0;line-height:1.5}body.home-mode  #welcome .ranked-action{margin-left:auto;text-align:center}body.home-mode  #welcome .ranked-join{display:flex;align-items:center;justify-content:space-between;gap:32px;min-height:45px;min-width:175px;padding:0 17px;border:1px solid #756020;border-radius:9px;background:#876c29;color:#fffdf2;font-weight:700;font-size:13px;box-shadow:0 2px 0 #5d491b}body.home-mode  #welcome .ranked-join span{font-size:19px;font-weight:400}body.home-mode  #welcome .ranked-action small{display:block;font-size:9px;color:#948461;margin-top:7px}@media(max-width:700px){body.home-mode  .page .header{gap:10px}body.home-mode  .page .brand{gap:8px}body.home-mode  .page .brand strong{font-size:16px}body.home-mode  .page .brand small{font-size:7px;letter-spacing:1.3px}body.home-mode  .page .logo{width:26px;height:34px;font-size:23px}body.home-mode  .page .account{display:inline-flex;align-items:center;justify-content:center;padding:0 12px;height:34px;font-size:11px}body.home-mode  .page .home-tools #fullscreen-toggle{display:none}body.home-mode  .page .nav{margin-top:5px}body.home-mode  #welcome .ranked-card{gap:10px;padding:16px;margin-bottom:17px;border-radius:12px;flex-wrap:wrap}body.home-mode  #welcome .ranked-symbol{width:37px;height:44px;border-radius:8px}body.home-mode  #welcome .ranked-symbol svg{width:24px;height:24px}body.home-mode  #welcome .ranked-copy h2{font-size:21px}body.home-mode  #welcome .ranked-eyebrow{font-size:7px;margin-bottom:4px}body.home-mode  #welcome .ranked-copy p{font-size:10px}body.home-mode  #welcome .ranked-action{flex:1 0 100%;margin:4px 0 0}body.home-mode  #welcome .ranked-join{width:100%;min-height:44px;font-size:13px}body.home-mode  #welcome .ranked-action small{margin-top:7px;font-size:9px}body.home-mode  #welcome .join-panel{display:block;margin-top:12px}body.home-mode  #welcome .join-panel .panel-title{margin-bottom:10px}body.home-mode  #welcome .join-panel .sub{font-size:11px;margin-bottom:12px}body.home-mode  #welcome .join-panel .sub br{display:none}body.home-mode  #welcome .join-panel .guide{margin-top:14px;padding-top:12px}body.home-mode  #welcome .play-grid{margin-bottom:23px}}@media(max-width:700px){body.home-mode{overflow:hidden}body.home-mode .page{height:100dvh;max-height:100dvh;padding:10px 12px;display:flex;flex-direction:column;gap:8px;overflow:hidden}body.home-mode  .page .header{flex:none;gap:6px 10px;margin:0}body.home-mode  .page .brand strong{font-size:16px}body.home-mode  .page .brand small{display:none}body.home-mode  .page .logo{width:26px;height:32px}body.home-mode  .page .account,body.home-mode  .page .home-tools button{height:32px}body.home-mode  .page .nav{margin:0;padding:2px}body.home-mode  .page .nav button{padding:6px;font-size:11px}body.home-mode  #welcome .hero{flex:none;height:64px;padding:12px 14px;margin:0;border-radius:10px}body.home-mode  #welcome .hero .eyebrow,body.home-mode  #welcome .hero p,body.home-mode  #welcome .hero-tags{display:none}body.home-mode  #welcome .hero h1{font:24px/1.14 Georgia,serif;letter-spacing:-.5px;margin:0;max-width:230px}body.home-mode  #welcome .hero h1 br{display:none}body.home-mode  #welcome .hero .art{top:5px;right:12px;width:121px;height:50px;transform:scale(.62);transform-origin:top right}body.home-mode  #welcome .hero h1{max-width:calc(100% - 80px)}body.home-mode  #welcome .hero .star{display:none}body.home-mode  #welcome .ranked-card{flex:none;flex-wrap:nowrap;padding:10px 12px;margin:0;gap:9px;border-radius:10px;min-height:62px}body.home-mode  #welcome .ranked-symbol{width:30px;height:36px;border-radius:6px}body.home-mode  #welcome .ranked-symbol svg{width:20px;height:20px}body.home-mode  #welcome .ranked-eyebrow,body.home-mode  #welcome .ranked-copy p{display:none}body.home-mode  #welcome .ranked-copy h2{font-size:19px;margin:0}body.home-mode  #welcome .ranked-action{flex:none;margin:0 0 0 auto}body.home-mode  #welcome .ranked-join{width:auto;min-width:93px;min-height:38px;padding:0 11px;font-size:12px;gap:12px}body.home-mode  #welcome .ranked-action small{font-size:8px;margin:4px 0 0}body.home-mode  #welcome .play-grid{flex:none;display:flex;flex-direction:column;gap:8px;margin:0}body.home-mode  #welcome .create-panel{display:grid;grid-template-columns:1.15fr 1fr;gap:8px;padding:10px;border-radius:10px}body.home-mode  #welcome .create-panel .panel-title,body.home-mode  #welcome .create-panel .field-label,body.home-mode  #welcome .panel-foot{display:none}body.home-mode  #welcome .create-panel input{grid-column:1/-1;height:40px;font-size:12px}body.home-mode  #welcome .room-choice{margin:0;gap:4px;min-width:0}body.home-mode  #welcome .room-choice button{padding:0 6px;min-height:40px;gap:4px;font-size:10px}body.home-mode  #welcome .room-choice small{display:none}body.home-mode  #welcome .radio{width:10px;height:10px;flex:none}body.home-mode  #welcome .create-go{margin:0;height:40px;min-width:0;font-size:12px;padding:0 12px}body.home-mode  #welcome .create-go .arrow{font-size:16px}body.home-mode  #welcome .join-panel{margin:0;padding:10px;border-radius:10px}body.home-mode  #welcome .join-panel .panel-title,body.home-mode  #welcome .join-panel .sub,body.home-mode  #welcome .join-panel .field-label,body.home-mode  #welcome .join-panel .guide{display:none}body.home-mode  #welcome .join-row input{height:40px;font-size:12px}body.home-mode  #welcome .join-row button{min-height:40px;min-width:69px;font-size:11px}body.home-mode  #welcome .join-row input::placeholder{font-size:11px}body.home-mode  #welcome .play-grid+section{flex:1;min-height:0;display:flex;flex-direction:column;gap:7px}body.home-mode  #welcome .directory-head{flex:none;margin:0;min-height:28px;gap:6px}body.home-mode  #welcome .directory-head h2{font-size:18px;white-space:nowrap}body.home-mode  #welcome .directory-head .live{display:none}body.home-mode  #welcome .directory-actions button{height:28px;min-height:28px;font-size:10px}body.home-mode  #welcome .room-grid{display:grid;flex:1;min-height:0;grid-template-columns:1fr;grid-template-rows:repeat(2,minmax(48px,1fr));gap:7px}body.home-mode  #welcome .room-card{padding:9px 11px;gap:6px 9px;align-content:center;min-height:0}body.home-mode  #welcome .room-card:last-child{display:none}body.home-mode  #welcome .room-card h3{font-size:12px}body.home-mode  #welcome .room-card p{font-size:9px}body.home-mode  #welcome .room-avatar{width:26px;height:32px;font-size:21px}body.home-mode  #welcome .status{font-size:8px}body.home-mode  #welcome .room-bottom button{min-height:30px;height:30px}body.home-mode  #welcome .pagination{flex:none;min-height:26px;margin:0;gap:14px}body.home-mode  #welcome .pagination button{height:26px;width:28px}body.home-mode  #welcome .footer,body.home-mode  #welcome .prototype-status:empty{display:none}body.home-mode  #welcome .prototype-status{margin:0;font-size:10px;flex:none}}@media(max-width:700px) and (max-height:700px){body.home-mode  #welcome .room-grid{grid-template-rows:minmax(48px,1fr)}body.home-mode  #welcome .room-card:nth-child(2){display:none}body.home-mode .page{gap:7px}body.home-mode  #welcome .hero{height:57px;padding:10px 12px}body.home-mode  #welcome .hero h1{font-size:22px}body.home-mode  #welcome .ranked-card{min-height:58px;padding:8px 10px}body.home-mode  #welcome .create-panel,body.home-mode  #welcome .join-panel{padding:8px}body.home-mode  #welcome .directory-head h2{font-size:17px}}@media(max-width:350px){body.home-mode  .page .brand strong{font-size:15px}body.home-mode  #welcome .ranked-copy h2{font-size:17px}body.home-mode  #welcome .ranked-symbol{display:none}body.home-mode  #welcome .ranked-join{min-width:98px}body.home-mode  #welcome .hero h1{font-size:21px}body.home-mode  #welcome .room-choice button{padding:0 4px;font-size:9px}body.home-mode  #welcome .create-go{padding:0 10px;font-size:11px}}@media(max-width:700px) and (min-height:780px){body.home-mode  #welcome .room-grid{grid-template-rows:repeat(3,minmax(48px,1fr))}body.home-mode  #welcome .room-card:last-child{display:grid}body.home-mode  #welcome .hero{height:82px;display:flex;align-items:center}body.home-mode  #welcome .hero .art{top:14px}}@media(max-width:350px){body.home-mode  #welcome .hero h1{font-size:18px}}body.home-mode  #welcome .tile img{width:78%;height:82%;object-fit:contain}body.home-mode  #welcome .room-card{padding:13px 14px}body.home-mode  #welcome .room-top{margin-bottom:10px}body.home-mode  #welcome .room-card p{margin-bottom:11px}@media(max-width:700px){body.home-mode  #welcome .room-grid{grid-template-rows:repeat(6,minmax(0,1fr));gap:5px}body.home-mode  #welcome .room-card,body.home-mode  #welcome .room-card:last-child,body.home-mode  #welcome .room-card:nth-child(2){display:grid;padding:6px 10px;gap:3px 8px;align-content:center;border-radius:8px}body.home-mode  #welcome .room-card h3{font-size:11px}body.home-mode  #welcome .room-card p{font-size:9px;margin:0}body.home-mode  #welcome .room-avatar{width:23px;height:28px;font-size:19px}body.home-mode  #welcome .room-bottom button{height:29px;min-height:29px;font-size:10px;padding:0 10px}body.home-mode  #welcome .status{font-size:8px}body.home-mode  #welcome .room-card p{grid-column:2;grid-row:2}}@media(max-width:700px) and (max-height:700px){body.home-mode  #welcome .room-grid{grid-template-rows:repeat(2,minmax(0,1fr))}body.home-mode  #welcome .room-card:nth-child(n+3){display:none}}@media(max-width:700px){body.home-mode  #welcome .room-card .status{display:none}body.home-mode  #welcome .room-card h3{line-height:14px}body.home-mode  #welcome .room-card p{line-height:12px}body.home-mode  #welcome .room-card .room-bottom button{grid-row:1/3;align-self:center}body.home-mode  #welcome .room-card .room-avatar{align-self:center}}body.home-mode  .page .logo img{width:90%;height:90%;object-fit:contain}@media(max-width:700px){body.home-mode  #welcome .room-grid{grid-template-rows:repeat(4,minmax(0,1fr));gap:6px}body.home-mode  #welcome .room-card,body.home-mode  #welcome .room-card:nth-child(n+3),body.home-mode  #welcome .room-card:last-child{display:grid}}@media(max-width:700px) and (max-height:700px){body.home-mode .page{padding:8px 12px;gap:5px}body.home-mode  .page .header{gap:4px 8px}body.home-mode  .page .logo{height:28px;width:24px}body.home-mode  .page .account,body.home-mode  .page .home-tools button{height:29px}body.home-mode  .page .nav button{padding:4px}body.home-mode  #welcome .hero{height:34px;padding:5px 10px}body.home-mode  #welcome .hero h1{font-size:18px}body.home-mode  #welcome .hero .art{top:0;transform:scale(.38)}body.home-mode  #welcome .ranked-card{min-height:43px;padding:5px 10px}body.home-mode  #welcome .ranked-copy h2{font-size:17px}body.home-mode  #welcome .ranked-join{min-height:29px}body.home-mode  #welcome .ranked-action small{font-size:7px;margin-top:2px}body.home-mode  #welcome .ranked-symbol{width:26px;height:29px}body.home-mode  #welcome .create-panel{padding:6px;gap:5px}body.home-mode  #welcome .create-panel input,body.home-mode  #welcome .room-choice button,body.home-mode  #welcome .create-go{height:34px;min-height:34px}body.home-mode  #welcome .join-panel{padding:6px}body.home-mode  #welcome .join-row input,body.home-mode  #welcome .join-row button{height:34px;min-height:34px}body.home-mode  #welcome .play-grid{gap:5px}body.home-mode  #welcome .play-grid+section{gap:5px}body.home-mode  #welcome .directory-head{min-height:24px}body.home-mode  #welcome .directory-actions button{height:24px;min-height:24px}body.home-mode  #welcome .pagination{min-height:23px}body.home-mode  #welcome .pagination button{height:23px}body.home-mode  #welcome .room-grid{grid-template-rows:repeat(4,minmax(0,1fr));gap:4px}body.home-mode  #welcome .room-card{padding:4px 8px;gap:2px 7px}body.home-mode  #welcome .room-card h3{line-height:12px;font-size:10px}body.home-mode  #welcome .room-card p{line-height:10px;font-size:8px}body.home-mode  #welcome .room-avatar{height:25px;width:21px}body.home-mode  #welcome .room-bottom button{height:27px;min-height:27px;font-size:9px}}@media(min-width:701px){body.home-mode  #welcome .room-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.home-tools{display:contents}.logo{display:none}body:not(.home-mode) #account-welcome{display:none}body:not(.home-mode) header .brand .logo{display:none}
body.home-mode{height:100dvh;overflow:hidden}body.home-mode .shell{width:100%;max-width:1120px;height:100dvh;min-height:0;display:flex;flex-direction:column;gap:12px;background:transparent;box-shadow:none;border:0;border-radius:0;overflow:hidden}body.home-mode .shell main{display:flex;flex:1;min-height:0;padding:0;overflow:hidden}body.home-mode #welcome{display:flex;flex-direction:column;flex:1;min-height:0;gap:12px;padding:0;overflow:hidden}body.home-mode header{flex:none;height:auto;min-height:0;padding:0;background:transparent;border:0;gap:20px;position:static}body.home-mode header .brand{margin-right:auto;display:flex;align-items:center;gap:10px;font:700 22px Georgia;letter-spacing:0;color:#233e33}body.home-mode header .brand em{font:inherit;color:inherit;letter-spacing:0}body.home-mode .logo{display:grid;flex:none}body.home-mode .logo svg{width:90%;height:90%}body.home-mode #header-room,body.home-mode #back{display:none}body.home-mode #welcome .panel{min-height:0}body.home-mode #welcome #entry{background:#fffef7}body.home-mode #welcome .play-grid{margin:0}body.home-mode #welcome .home-create-options{display:block}body.home-mode #welcome .visibility{padding:0;border:0;gap:6px;margin:12px 0 0;display:flex}body.home-mode #welcome .visibility label{margin:0;padding:10px;flex:1;display:flex;align-items:center;gap:7px;border:1px solid #dce0d1;border-radius:8px;font-size:12px;background:#fffdf6}body.home-mode #welcome .visibility label:has(input:checked){background:#eef3e5;border-color:#8ca37b}body.home-mode #welcome .visibility input{appearance:auto;flex:none;width:12px;height:12px;min-height:0;accent-color:#2e664c;padding:0}body.home-mode #welcome .visibility small{font-size:10px;display:block}body.home-mode #welcome #join-form{display:flex;flex-wrap:wrap;grid-template-columns:none;gap:8px;align-items:center;padding:0;border:0;background:none}body.home-mode #welcome #room-code{flex:1;min-width:0}body.home-mode #welcome #invite-note,body.home-mode #welcome #invite-preview{flex-basis:100%;font-size:10px;margin:0}body.home-mode #welcome #invite-preview small{display:none}body.home-mode #welcome #invite-preview button{height:25px;min-height:25px;font-size:10px}body.home-mode #welcome #quick-guide-open{width:100%;min-height:0;font-size:12px;color:#6f653e}body.home-mode #welcome .home-directory{display:flex;flex-direction:column;flex:1;min-height:0;gap:8px}body.home-mode #welcome #directory{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:1fr;gap:10px;flex:1;min-height:0}body.home-mode #welcome .room-card{display:grid;grid-template-columns:28px minmax(0,1fr);grid-template-rows:auto auto;align-content:center;gap:10px;min-height:0;padding:14px}body.home-mode #welcome .room-info{min-width:0}body.home-mode #welcome .room-info h3{font-size:13px;line-height:16px;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}body.home-mode #welcome .room-info p{font-size:10px;line-height:13px;margin:4px 0 0}body.home-mode #welcome .room-card>button{grid-column:1/-1;min-height:34px;font-size:11px;height:34px;border:1px solid #bfd0ad;background:#f6f8ee;border-radius:7px}body.home-mode #welcome .directory-empty{grid-column:1/-1;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-direction:column;font-size:12px}body.home-mode #welcome .pagination{margin:0}body.home-mode #welcome #resume-card{margin:0;flex:none}body.home-mode #welcome #network-note{margin:0;font-size:9px}body.home-mode .welcome-heading{order:0;display:flex;flex-basis:auto;gap:4px;margin:0;background:none;height:auto;grid-template-columns:none}body.home-mode .welcome-heading #home-main{order:0}body.home-mode .welcome-heading #ranked-open{order:1}body.home-mode .welcome-heading #friends-main{order:2}body.home-mode .welcome-heading button{min-width:0;min-height:0;border:0;background:transparent;border-radius:9px;padding:11px 19px;font-size:13px;color:#617568}body.home-mode .welcome-heading #home-main{background:#e0e7da;color:#204f3b}body.home-mode .home-tools{display:flex;gap:7px}body.home-mode #account-welcome{height:38px;min-height:38px;font-size:12px}body.home-mode .home-tools button{width:38px;height:38px;min-height:38px;min-width:38px;padding:0}body.home-mode .hero{margin:0;flex:none;height:215px}body.home-mode .ranked-card{margin:0;flex:none}body.home-mode #welcome .hero .tile svg{width:78%;height:82%}
@media(max-width:700px){body.home-mode .shell{padding:10px 12px;gap:8px}body.home-mode #welcome{gap:8px}body.home-mode header{flex-wrap:wrap;gap:6px 10px}body.home-mode header .brand{font-size:16px;gap:8px}body.home-mode .welcome-heading{order:4;flex-basis:100%;padding:2px;background:#e6ebde;border-radius:9px;height:30px}body.home-mode .welcome-heading button{flex:1;padding:4px;font-size:11px}body.home-mode .welcome-heading #home-main{background:#fffdf4}body.home-mode .home-tools #fullscreen-toggle{display:none}body.home-mode .home-tools button,body.home-mode #account-welcome{width:32px;min-width:32px;height:32px;min-height:32px}body.home-mode #account-welcome{width:auto;padding:0 12px;font-size:11px}body.home-mode .logo{width:26px;height:32px}body.home-mode #welcome .hero{height:82px}body.home-mode #welcome .ranked-card{min-height:62px}body.home-mode #welcome .create-panel{display:block;padding:10px}body.home-mode #welcome #name{height:40px}body.home-mode #welcome .home-create-options{display:grid;grid-template-columns:1.15fr 1fr;gap:8px;margin-top:8px}body.home-mode #welcome .visibility{margin:0;gap:4px}body.home-mode #welcome .visibility label{padding:0 6px;font-size:10px;min-height:40px;gap:4px}body.home-mode #welcome .visibility small{display:none}body.home-mode #welcome .create-go{height:40px;min-height:40px;margin:0;font-size:12px}body.home-mode #welcome .join-panel{padding:10px}body.home-mode #welcome #room-code,body.home-mode #welcome #join-button{height:40px;min-height:40px;font-size:11px}body.home-mode #welcome #directory{grid-template-columns:1fr;grid-template-rows:repeat(4,minmax(0,1fr));gap:6px}body.home-mode #welcome .room-card{grid-template-columns:23px minmax(0,1fr) auto;grid-template-rows:1fr;padding:6px 10px;gap:8px}body.home-mode #welcome .room-avatar{width:23px;height:28px;font-size:19px;grid-row:auto}body.home-mode #welcome .room-info{grid-column:2;grid-row:auto}body.home-mode #welcome .room-info h3{font-size:11px;line-height:14px}body.home-mode #welcome .room-info p{font-size:9px;line-height:12px;margin-top:3px}body.home-mode #welcome .room-card>button{grid-column:3;grid-row:auto;min-height:29px;height:29px;padding:0 10px}body.home-mode #welcome #resume-game{height:28px;min-height:28px;font-size:11px}body.home-mode #welcome #resume-note{display:none}}
@media(max-width:700px) and (max-height:700px){body.home-mode .shell{padding:8px 12px;gap:5px}body.home-mode #welcome{gap:5px}body.home-mode header{gap:4px 8px}body.home-mode .welcome-heading{height:26px}body.home-mode .logo{height:28px;width:24px}body.home-mode #account-welcome,body.home-mode .home-tools button{height:29px;min-height:29px}body.home-mode #welcome .hero{height:34px}body.home-mode #welcome .ranked-card{min-height:43px}body.home-mode #welcome .create-panel,body.home-mode #welcome .join-panel{padding:6px}body.home-mode #welcome #name,body.home-mode #welcome .create-go,body.home-mode #welcome #room-code,body.home-mode #welcome #join-button,body.home-mode #welcome .visibility label{height:34px;min-height:34px}body.home-mode #welcome .home-create-options{gap:5px;margin-top:5px}body.home-mode #welcome .room-card{padding:4px 8px;gap:7px}body.home-mode #welcome .room-info h3{font-size:10px;line-height:12px}body.home-mode #welcome .room-info p{font-size:8px;line-height:10px}body.home-mode #welcome .room-card>button{height:27px;min-height:27px;font-size:9px}}
@media(max-height:450px) and (max-width:700px){body.home-mode .shell{overflow-y:auto}body.home-mode .shell main,body.home-mode #welcome{overflow:visible;flex:none;height:auto}body.home-mode #welcome #directory{min-height:160px}body.home-mode #welcome .home-directory{min-height:210px}}
html[data-high-contrast=on] body.home-mode .hero{background:#fff;color:#111;border:2px solid #111}html[data-high-contrast=on] body.home-mode .ranked-card,html[data-high-contrast=on] body.home-mode #welcome .panel,html[data-high-contrast=on] body.home-mode #welcome .room-card{background:#fff;color:#111;border:2px solid #111}

body.home-mode #welcome:not([hidden]){display:flex!important}body.home-mode #welcome>.hero,body.home-mode #welcome>.ranked-card,body.home-mode #welcome>.play-grid{flex-shrink:0}body.home-mode .shell{padding:28px}body.home-mode #welcome .room-card:last-child{display:grid}body.home-mode .nav #friends-main{background:transparent;color:#617568;border:0;box-shadow:none}body.home-mode .nav #ranked-open{order:1}body.home-mode .nav #friends-main{order:2}body.home-mode .nav #home-main{order:0}@media(max-width:700px){body.home-mode .shell{padding:10px 12px}}@media(max-width:700px) and (max-height:700px){body.home-mode .shell{padding:8px 12px}}

@media(min-width:701px){body.home-mode .header{margin-bottom:0}body.home-mode #welcome>.hero{height:clamp(140px,23vh,220px);padding:24px 40px;margin:0}body.home-mode #welcome .hero h1{font-size:36px;line-height:1.05;margin-bottom:12px}body.home-mode #welcome .hero .eyebrow{margin-bottom:12px}body.home-mode #welcome .hero-tags{margin-top:14px}body.home-mode #welcome>.ranked-card{padding:15px 24px;min-height:90px;margin:0}body.home-mode #welcome>.play-grid{margin:0}body.home-mode #welcome .panel{padding:16px 20px}body.home-mode #welcome .panel-title{margin-bottom:10px}body.home-mode #welcome .visibility{margin-top:8px}body.home-mode #welcome .create-go{margin-top:8px}body.home-mode #welcome .guide{margin-top:12px;padding-top:12px}body.home-mode #welcome .hint{margin-top:8px}body.home-mode #welcome .home-directory{min-height:120px}body.home-mode #welcome .room-card{align-items:center;padding:10px}}

/* Stable home header actions and vertically centered Fa tiles. */
body.home-mode .page .home-tools{display:flex;align-items:center;gap:8px;flex:none}body.home-mode .page .home-tools button{height:38px;min-height:38px;display:grid;place-items:center;box-shadow:0 1px 2px #213e3310}body.home-mode .page .home-tools #account-welcome{display:flex;width:auto;min-width:64px;padding:0 14px;align-items:center;justify-content:center;color:#385b47;background:#fafbf5;border:1px solid #ccd3c1;border-radius:9px;font:600 12px system-ui}body.home-mode .page .home-tools #rules-open,body.home-mode .page .home-tools #fullscreen-toggle{width:38px;min-width:38px;padding:0}body.home-mode .page .home-tools #rules-open svg{width:20px;height:20px}body.home-mode #welcome .hero .art{top:50%;height:174px;transform:translateY(-50%);transform-origin:center right}
@media(max-width:700px){body.home-mode .page .home-tools{gap:8px}body.home-mode .page .home-tools button,body.home-mode .page .home-tools #account-welcome{height:36px;min-height:36px}body.home-mode .page .home-tools #account-welcome{min-width:60px;padding:0 12px;font-size:11px}body.home-mode .page .home-tools #rules-open{width:36px;min-width:36px}body.home-mode .page .home-tools #fullscreen-toggle{display:none}body.home-mode #welcome .hero .art{height:78px;top:50%;right:12px;transform:translateY(-50%) scale(.62);transform-origin:center right}}
@media(max-width:700px) and (max-height:700px){body.home-mode #welcome .hero .art{transform:translateY(-50%) scale(.38)}}

body.home-mode .page .home-tools #rules-open,body.home-mode .page .home-tools #fullscreen-toggle{height:38px;min-height:38px;max-height:38px}@media(max-width:700px){body.home-mode .page .home-tools #rules-open{height:36px;min-height:36px;max-height:36px}}

/* Rating browser uses the approved ivory, green and gold Mahjong design. */
body.home-mode .welcome-heading{justify-content:flex-start}
#ranked-dialog.rank-browser-dialog,#ranked-history-detail{background:#f1f2ea;color:#233e33;border:1px solid #d8dfcd;border-radius:18px;padding:0;width:min(420px,calc(100vw - 24px));max-width:420px;max-height:calc(100dvh - 32px);overflow:auto;font:14px/1.45 system-ui,'Segoe UI',sans-serif}
#ranked-dialog.rank-browser-dialog>.dialog-head,#ranked-history-detail>.dialog-head{padding:20px;background:#1d4937;color:#fff9e8;gap:12px;margin:0;border:0;display:flex;align-items:center;position:sticky;top:0;z-index:1}
#ranked-dialog .rank-emblem{flex:none;display:grid;place-items:center;width:42px;height:46px;background:#efe2b9;border:1px solid #cfb778;border-radius:9px;color:#836823;box-shadow:0 3px 0 #9a8a55}#ranked-dialog .rank-emblem svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7}
#ranked-dialog .rank-heading{flex:1;min-width:0}#ranked-dialog #ranked-title{font:600 27px/1.2 Georgia,serif;margin:0}#ranked-dialog .rank-subtitle{font-size:12px;margin:5px 0 0;color:#c5d7c6}
#ranked-dialog #ranked-close,#ranked-history-detail #ranked-detail-close{border:1px solid #ffffff33;background:#ffffff08;color:#fff9e8;min-height:40px;border-radius:10px;padding:0 10px;font-size:12px}
#ranked-dialog .ranked-actions:has(>button:not([hidden])){margin:12px 16px}#ranked-dialog .ranked-actions:not(:has(>button:not([hidden]))){display:none}#ranked-dialog #ranked-status,#ranked-dialog #ranked-retry,#ranked-dialog #ranked-queue-card{margin:12px 16px}#ranked-dialog #ranked-queue-card{color:#233e33;background:#fffef7;border-color:#d8dfcd}
#ranked-dialog .rank-season-bar{display:flex;align-items:center;justify-content:space-between;margin:16px 16px 12px;font-size:12px;color:#657562;min-height:36px}#ranked-dialog .rank-season-bar label{display:flex;align-items:center;gap:8px}#ranked-dialog #ranked-season{background:#fffef7;color:#233e33;border:1px solid #d8dfcd;border-radius:8px;padding:8px;font-size:12px;min-height:36px;max-width:210px}
#ranked-dialog .ranked-tabs{display:flex;background:#e4eadc;border-radius:10px;padding:3px;gap:3px;margin:0 16px 14px}#ranked-dialog .ranked-tabs button{flex:1;min-height:40px;background:transparent;border:0;color:#657562;font-size:12px;border-radius:8px}#ranked-dialog .ranked-tabs button[aria-selected=true]{background:#fffef7;color:#233e33;box-shadow:0 1px 3px #243b3010}
#ranked-dialog #ranked-own{margin:0 16px 14px}#ranked-dialog .rank-own-card{display:flex;align-items:center;gap:12px;background:#f8f1db;border:1px solid #d8c693;border-radius:10px;padding:13px 14px}#ranked-dialog .rank-own-position{font:600 29px Georgia;color:#866a28;min-width:47px}#ranked-dialog .rank-own-card>div:nth-child(2){flex:1;min-width:0}#ranked-dialog .rank-own-card strong{display:block}#ranked-dialog .rank-own-card small{display:block;font-size:11px;color:#766d4c}#ranked-dialog .rank-own-amount{text-align:right;font-variant-numeric:tabular-nums}#ranked-dialog .rank-history-heading{font-size:12px;color:#657562}
#ranked-dialog #ranked-content{margin:0 16px;max-height:none;overflow:visible;padding:0;background:transparent;border:0}#ranked-dialog .rank-board-table,#ranked-history-detail .rank-board-table,#ranked-history-detail .rank-round-table{width:100%;border-collapse:separate;border-spacing:0;background:#fffef7;color:#233e33;border:1px solid #d8dfcd;border-radius:11px;overflow:hidden;font-size:13px;table-layout:fixed}#ranked-dialog .rank-board-table th,#ranked-history-detail table th{background:#e9edde;color:#657562;font-size:11px;font-weight:500}#ranked-dialog .rank-board-table td,#ranked-dialog .rank-board-table th,#ranked-history-detail table td,#ranked-history-detail table th{padding:10px 12px;border:0;border-bottom:1px solid #e7eadf;text-align:left;overflow-wrap:anywhere}#ranked-dialog .rank-board-table th:first-child,#ranked-history-detail .rank-board-table th:first-child{width:42px}#ranked-dialog .rank-board-table th:last-child,#ranked-history-detail .rank-board-table th:last-child{width:90px}#ranked-dialog .rank-board-table td:last-child,#ranked-dialog .rank-board-table th:last-child,#ranked-history-detail table td:last-child,#ranked-history-detail table th:last-child{text-align:right;font-variant-numeric:tabular-nums}#ranked-dialog .rank-board-table td small{display:block;color:#657562;font-size:11px;font-weight:400}#ranked-dialog .rank-board-table tr:last-child td,#ranked-history-detail table tr:last-child td{border-bottom:0}#ranked-dialog .ranked-self,#ranked-history-detail .ranked-self{background:#eef3e5}
#ranked-dialog .rank-number{display:grid;place-items:center;color:#657562}#ranked-dialog .rank-medal{width:26px;height:29px;border-radius:5px;border:1px solid #d2bd7b;background:#f1e2b2;color:#795d1d;box-shadow:0 2px 0 #b4a474}#ranked-dialog .rank-medal-2{background:#e7ebe4;color:#586556;border-color:#c6cec0}#ranked-dialog .rank-medal-3{background:#f0dfc9;color:#815c35;border-color:#d8b990}
#ranked-dialog .ranked-history-row{background:#fffef7;border:1px solid #d8dfcd;border-radius:10px;padding:13px;margin:0 0 9px;display:block;color:#233e33}#ranked-dialog .rank-history-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}#ranked-dialog .rank-history-top>strong{font-size:12px;flex:1;min-width:0;overflow-wrap:anywhere}#ranked-dialog .rank-history-amount{text-align:right;color:#2b6248;font-size:13px;flex:none}#ranked-dialog .rank-history-amount.negative{color:#9b4e3b}#ranked-dialog .rank-history-amount small{display:block;font-size:11px;color:#657562}#ranked-dialog .ranked-history-row>small{display:block;font-size:11px;color:#657562;margin:6px 0}#ranked-dialog .history-detail-open{display:block;width:100%;background:transparent;border:0;color:#385b47;text-align:left;padding:3px 0;min-height:32px;font-size:12px;font-weight:400}
#ranked-dialog .history-pagination,#ranked-dialog .rank-board-pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin:12px 0;color:#657562;font-size:12px}#ranked-dialog .history-pagination button,#ranked-dialog .rank-board-pagination button{min-width:40px;min-height:40px;background:#fffef7;color:#233e33;border:1px solid #d8dfcd;border-radius:9px}#ranked-dialog #ranked-content>p:last-child{font-size:11px;color:#657562;text-align:center}
#ranked-dialog .rank-help{margin:14px 16px;color:#657562;font-size:12px}#ranked-dialog .rank-help summary{min-height:32px}#ranked-dialog .ranked-note{font-size:12px;color:#657562}#ranked-dialog .rank-back,#ranked-history-detail .history-back{display:block;margin:12px 16px 16px;width:calc(100% - 32px);min-height:42px;background:#2d654d;color:#fffef7;border:1px solid #2d654d;border-radius:9px}
#ranked-history-detail #ranked-detail-title{font:600 21px/1.2 Georgia,serif;margin:0;flex:1}#ranked-history-detail #ranked-detail-body{padding:16px}#ranked-history-detail .rank-detail-intro{padding:13px;background:#f8f1db;border:1px solid #d8c693;border-radius:10px;font-size:12px;color:#766d4c}#ranked-history-detail .rank-detail-intro p{margin:0 0 5px}#ranked-history-detail h3{font-size:13px;margin:16px 0 8px}#ranked-history-detail .rank-round-table tfoot td{background:#eef3e5;font-weight:700}#ranked-history-detail .rank-help{margin:14px 0;font-size:12px}#ranked-history-detail .history-back{margin:12px 0 0;width:100%}#ranked-history-detail .ranked-result{color:#233e33;background:#fffef7}
html[data-high-contrast=on] #ranked-dialog.rank-browser-dialog,html[data-high-contrast=on] #ranked-history-detail{background:#fff;color:#111}html[data-high-contrast=on] #ranked-dialog .ranked-history-row,html[data-high-contrast=on] #ranked-dialog .rank-own-card,html[data-high-contrast=on] #ranked-dialog .rank-board-table,html[data-high-contrast=on] #ranked-history-detail table{background:#fff;color:#111;border-color:#111}

#ranked-dialog .history-pagination{position:static;background:transparent;padding:0}


/* Shared tier emblems: whitelist assets, current season in rooms, immutable receipt in results. */
.tier-medal{display:inline-block;object-fit:contain;flex:0 0 auto;vertical-align:middle;width:38px;height:38px}.tier-medal-tiny{width:26px;height:26px}.tier-medal-medium{width:68px;height:68px}.tier-medal-large{width:116px;height:116px}
.rank-identity{display:flex;align-items:center;gap:8px;min-width:0}.rank-identity>div{min-width:0;overflow-wrap:anywhere}#ranked-dialog .rank-own-card>.rank-identity{flex:1}.rank-profile-emblem{text-align:center;padding:8px 0}.rank-profile-emblem p{margin:6px 0!important}#lobby-profile-name{display:flex;align-items:center;gap:12px}.ranked-result>.tier-medal{float:right;margin:0 0 8px 12px}
.player-medal-heading{display:flex!important;align-items:center;gap:4px;min-width:0}.player-name-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}#lobby .seat-card .tier-medal-tiny{width:24px;height:24px}.river-owner .tier-medal-tiny{width:20px;height:20px}
.rank-tier-table{width:100%;border-collapse:collapse;font-size:13px}.rank-tier-table td,.rank-tier-table th{padding:6px 4px;border-bottom:1px solid #d8dfcd;text-align:left}.rank-tier-table td:first-child{display:flex;align-items:center;gap:8px}.rank-tier-table td:last-child,.rank-tier-table th:last-child{text-align:right}.rank-help>ul{padding-left:20px;list-style-type:disc}.rank-help>ul li{margin:7px 0}.rank-help>details{margin:12px 0}.rank-tier-help p{margin-top:12px}
@media(max-width:380px){#ranked-dialog .rank-board-table td,#ranked-dialog .rank-board-table th{padding:8px 6px}#ranked-dialog .rank-board-table th:last-child{width:76px}#ranked-dialog .rank-board-table th:first-child{width:30px}.rank-identity{gap:5px}.rank-identity .tier-medal{width:30px;height:30px}#ranked-dialog .rank-own-card{padding:10px 8px;gap:6px}#ranked-dialog .rank-own-position{min-width:30px;font-size:22px}}

.rank-history-identity{display:flex;align-items:center;gap:7px;min-width:0;flex:1}.rank-history-identity>strong{min-width:0;overflow-wrap:anywhere}.rank-history-identity .tier-medal{width:34px;height:34px}.rank-detail-intro>.tier-medal{float:right;margin:0 0 8px 10px}.rank-detail-intro{display:flow-root}

.rank-combined-wrap{overflow-x:auto;margin-top:14px;border:1px solid #d8dfcd;border-radius:11px;background:#fffef7}#ranked-history-detail .rank-combined-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums;color:#233e33}.combined-name-col,.combined-total-col{width:22%}.combined-round-col{width:14%}#ranked-history-detail .rank-combined-table thead th{background:#e9edde;color:#52644d;font-size:12px;font-weight:600;padding:12px 5px;text-align:center}#ranked-history-detail .rank-combined-table [data-round-label]{white-space:nowrap}#ranked-history-detail .rank-combined-table tbody td,#ranked-history-detail .rank-combined-table tbody th{border-top:1px solid #e1e7d7;padding:16px 5px;text-align:center}#ranked-history-detail .rank-combined-table tbody td{white-space:nowrap}#ranked-history-detail .rank-combined-table th:first-child{text-align:left;padding-left:10px;overflow-wrap:anywhere}#ranked-history-detail .rank-combined-table tbody th strong{display:block}#ranked-history-detail .rank-combined-table tbody th small{display:block;font-weight:400;margin-top:5px;font-size:11px}#ranked-history-detail .rank-combined-table .combined-total{font-weight:700;background:#eef0e2}#ranked-history-detail .rank-combined-table .ranked-self th,#ranked-history-detail .rank-combined-table .ranked-self td{background:#e2ecd7}#ranked-history-detail .rank-combined-table .ranked-self .combined-total{background:#d6e5c8}#ranked-history-detail .rank-combined-table .points-positive{color:#245b3a}#ranked-history-detail .rank-combined-table .points-negative{color:#9a4535}#ranked-history-detail .rank-combined-wrap.wide-points .rank-combined-table{min-width:var(--round-table-min-width,720px)}
@media(max-width:480px){#ranked-history-detail #ranked-detail-body{padding:12px}.combined-name-col,.combined-total-col{width:20%}.combined-round-col{width:15%}#ranked-history-detail .rank-combined-table{font-size:12px}#ranked-history-detail .rank-combined-table thead th{padding:11px 2px;font-size:12px}#ranked-history-detail .rank-combined-table tbody td,#ranked-history-detail .rank-combined-table tbody th{padding:16px 2px}#ranked-history-detail .rank-combined-table th:first-child{padding-left:6px}}
html[data-high-contrast=on] #ranked-history-detail .rank-combined-table,html[data-high-contrast=on] #ranked-history-detail .rank-combined-table th,html[data-high-contrast=on] #ranked-history-detail .rank-combined-table td{background:#fff!important;color:#111!important;border-color:#111}
/* Approved homepage, 0.8.101. All layout rules are scoped to the home screen. */
body.home-mode .page .logo { border:0; background:transparent; box-shadow:none; padding:0; }
body.home-mode .page .logo img { display:block; width:100%; height:100%; object-fit:contain; }
body.home-mode #welcome .hero .hero-fa { display:block; width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 3px 3px #082f2533); }
body.home-mode .welcome-heading:empty { display:none!important; }
body.home-mode .page .home-tools #friends-main { width:auto; min-width:0; padding:0 10px; font-size:12px; color:#385b47; background:#fafbf5; border:1px solid #ccd3c1; border-radius:9px; }
body.home-mode .page .home-tools #friends-main[hidden] { display:none!important; }
body.home-mode #welcome .ranked-symbol { display:grid; place-items:center; width:54px; height:64px; min-width:0; min-height:64px; padding:0; background:linear-gradient(145deg,#fff8e4,#ecd99e); border:1px solid #d5bd7b; border-radius:10px; box-shadow:inset 0 1px 1px #fffdf4,inset 0 -2px 3px #aa813622; }
body.home-mode #welcome .ranked-symbol img { display:block; width:100%; height:100%; object-fit:contain; }
.rank-emblem img { display:block; width:100%; height:100%; object-fit:contain; }
body.home-mode #welcome #home-ranked-rating { display:flex; align-items:center; justify-content:center; gap:3px; color:#80672f; font-size:10px; line-height:1.2; margin-bottom:3px; white-space:nowrap; }
body.home-mode #welcome #home-ranked-rating[hidden] { display:none; }
body.home-mode #welcome #home-ranked-rating img { width:21px; height:21px; object-fit:contain; }
body.home-mode #welcome #home-ranked-note { white-space:nowrap; }
body.home-mode #welcome .home-name-line { grid-column:1/-1; }
@media(min-width:701px) {
 body.home-mode { height:auto; min-height:100dvh; overflow:auto; }
 body.home-mode .shell { height:auto; min-height:100dvh; overflow:visible; }
 body.home-mode .shell main { display:block; flex:none; overflow:visible; }
 body.home-mode #welcome { overflow:visible; }
 body.home-mode #welcome>.hero { height:auto; min-height:208px; padding:16px 40px; }
 body.home-mode #welcome .hero h1 { font-size:34px; margin-bottom:10px; }
 body.home-mode #welcome .hero .eyebrow { margin-bottom:8px; }
 body.home-mode #welcome .hero-tags { margin-top:10px; }
 body.home-mode #welcome .home-directory { min-height:140px; flex:none; }
 body.home-mode #welcome #directory { min-height:94px; flex:none; }
}
@media(max-width:700px) {
 body.home-mode { height:auto; min-height:100dvh; overflow:auto; background:#f1f2ea; }
 body.home-mode .shell.page { width:100%; max-width:520px; height:auto; min-height:0; overflow:visible; padding:10px; gap:8px; margin:0 auto; font:14px/1.4 Arial,sans-serif; color:#234637; container-type:inline-size; }
 body.home-mode .shell.page main { display:block; flex:none; height:auto; min-height:0; overflow:visible; }
 body.home-mode .shell.page #welcome:not([hidden]) { display:flex!important; height:auto; flex:none; min-height:0; overflow:visible; padding:0; gap:8px; }
 body.home-mode .shell.page .header { display:flex; align-items:center; flex-wrap:nowrap; gap:6px; min-height:38px; margin:0; }
 body.home-mode .shell.page .header .brand { margin-right:auto; gap:6px; font:700 21px Georgia,serif; }
 body.home-mode .shell.page .logo { width:30px; height:39px; }
 body.home-mode .shell.page .home-tools { display:flex; gap:5px; align-items:center; }
 body.home-mode .shell.page .home-tools #fullscreen-toggle { display:none; }
 body.home-mode .shell.page .home-tools #friends-main,body.home-mode .shell.page .home-tools #account-welcome { width:auto; min-width:0; padding:0 9px; height:36px; min-height:36px; font:400 12px Arial,sans-serif; }
 body.home-mode .shell.page .home-tools #rules-open { width:34px; min-width:34px; height:36px; min-height:36px; max-height:36px; padding:0; }
 body.home-mode .shell.page .home-tools #rules-open svg { width:16px; height:16px; }
 body.home-mode .shell.page #welcome>.hero { position:relative; isolation:isolate; display:grid; grid-template-columns:minmax(0,1fr) clamp(72px,calc(100cqw - 216px),158px); gap:7px; align-items:center; align-content:center; height:auto; min-height:0; padding:10px; margin:0; border-radius:12px; overflow:hidden; color:#fff7df; background:linear-gradient(110deg,#183e33,#295a47); }
 body.home-mode .shell.page #welcome .hero:before { content:""; position:absolute; z-index:-1; width:330px; height:330px; border-radius:50%; right:-185px; top:-95px; border:1px solid #f2e8b51a; box-shadow:0 0 0 27px #ffffff03,0 0 0 55px #ffffff02; }
 body.home-mode .shell.page #welcome .hero-copy { display:block; width:auto; min-width:0; }
 body.home-mode .shell.page #welcome .hero .eyebrow { display:none; }
 body.home-mode .shell.page #welcome .hero h1 { display:block; margin:0 0 5px; font:500 clamp(15px,4.7cqw,18px)/1.15 Georgia,serif; letter-spacing:-.3px; white-space:nowrap; color:#fff7df; }
 body.home-mode .shell.page #welcome .hero h1 br { display:none; }
 body.home-mode .shell.page #welcome .hero p { display:block; margin:0; max-width:none; font:400 clamp(8.5px,2.8cqw,10.5px)/1.45 Arial,sans-serif; color:#e0e9db; white-space:nowrap; }
 body.home-mode .shell.page #welcome .hero p br { display:block; }
 body.home-mode .shell.page #welcome .hero-tags { display:flex; gap:4px; flex-wrap:nowrap; margin:7px 0 0; align-items:center; }
 body.home-mode .shell.page #welcome .hero-tags span { font:400 8px/1.5 Arial,sans-serif; padding:2px 5px; border:1px solid #c9d9b42e; border-radius:20px; color:#fff4d1; white-space:nowrap; }
 body.home-mode .shell.page #welcome .hero .art { display:block; position:static; grid-column:2; grid-row:1; align-self:center; justify-self:center; width:100%; height:auto; margin:0; padding:0; transform:none; }
 body.home-mode .shell.page #welcome .hero .art img { width:100%; height:auto; }
 body.home-mode .shell.page #welcome>.ranked-card { display:grid; grid-template-columns:52px minmax(0,1fr) 91px; align-items:center; gap:8px; min-height:88px; padding:8px 10px; margin:0; border:1px solid #d9c99b; border-radius:12px; background:linear-gradient(110deg,#f7f0dc,#fffdf4); }
 body.home-mode .shell.page #welcome .ranked-symbol { display:grid; width:52px; height:100%; min-height:62px; align-self:stretch; margin:0; }
 body.home-mode .shell.page #welcome .ranked-copy { min-width:0; }
 body.home-mode .shell.page #welcome .ranked-eyebrow { display:block; font:600 9px/1.4 Arial,sans-serif; letter-spacing:1.2px; color:#957633; margin:0 0 3px; }
 body.home-mode .shell.page #welcome .ranked-copy h2 { margin:0; white-space:nowrap; font:700 21px/1.1 Georgia,serif; color:#6e501b; }
 body.home-mode .shell.page #welcome .ranked-copy p { display:block; margin:3px 0 0; font:400 10px/1.3 Arial,sans-serif; color:#92743c; }
 body.home-mode .shell.page #welcome .ranked-action { display:grid; gap:2px; align-self:center; min-width:0; }
 body.home-mode .shell.page #welcome .ranked-join { display:flex; justify-content:space-between; align-items:center; width:100%; min-width:0; height:33px; min-height:33px; margin:0; padding:5px 8px; background:#876c2b; border:1px solid #725b24; border-bottom-width:3px; border-radius:9px; color:#fff8e5; font:600 12px/16px Arial,sans-serif; }
 body.home-mode .shell.page #welcome #home-ranked-note { display:block; margin:0; font:400 7px/1.2 Arial,sans-serif; color:#92743c; text-align:center; white-space:nowrap; }
 body.home-mode .shell.page #welcome .play-grid { display:grid; grid-template-columns:1fr; gap:8px; margin:0; }
 body.home-mode .shell.page #welcome .create-panel { display:grid; grid-template-columns:1fr; align-items:stretch; gap:5px; min-height:88px; padding:8px 10px; border:1px solid #d7dfce; border-radius:12px; background:#fffef7; }
 body.home-mode .shell.page #welcome .create-panel .panel-title,body.home-mode .shell.page #welcome .create-panel .panel-foot { display:none; }
 body.home-mode .shell.page #welcome .home-name-line { display:flex; gap:8px; align-items:center; min-width:0; }
 body.home-mode .shell.page #welcome .home-name-line .field-label { display:block; flex:none; margin:0; font:400 12px Arial,sans-serif; color:#234637; }
 body.home-mode .shell.page #welcome #name { flex:1; width:100%; min-width:0; height:30px; min-height:30px; margin:0; padding:4px 8px; border:1px solid #cbd5c0; border-radius:8px; background:#fffef8; font:400 16px Arial,sans-serif; color:#234637; }
 body.home-mode .shell.page #welcome .home-create-options { display:grid; grid-template-columns:1.25fr 1fr; margin:0; gap:6px; }
 body.home-mode .shell.page #welcome .visibility { display:flex; gap:6px; margin:0; border:0; padding:0; min-width:0; }
 body.home-mode .shell.page #welcome .visibility label { display:flex; flex:1; justify-content:center; gap:4px; height:31px; min-height:31px; padding:0 5px; margin:0; font:600 12px Arial,sans-serif; border:1px solid #cbd5c0; background:#fffef7; border-radius:9px; }
 body.home-mode .shell.page #welcome .visibility label:has(input:checked) { background:#e8eedc; border-color:#8b9f75; }
 body.home-mode .shell.page #welcome .visibility input { width:10px; height:10px; margin:0; }
 body.home-mode .shell.page #welcome .visibility small { display:none; }
 body.home-mode .shell.page #welcome .create-go { height:31px; min-height:31px; padding:5px; margin:0; border-radius:9px; font:600 12px Arial,sans-serif; background:#245d43; color:#fffdf0; }
 body.home-mode .shell.page #welcome .join-panel { padding:9px; min-height:0; border:1px solid #d7dfce; border-radius:12px; background:#fffef7; }
 body.home-mode .shell.page #welcome .join-panel .panel-title,body.home-mode .shell.page #welcome .join-panel .sub,body.home-mode .shell.page #welcome .join-panel>.field-label,body.home-mode .shell.page #welcome #quick-guide-open { display:none; }
 body.home-mode .shell.page #welcome #join-form { gap:8px; }
 body.home-mode .shell.page #welcome #room-code { height:38px; min-height:38px; padding:8px 10px; border:1px solid #cbd5c0; border-radius:8px; background:#fffef8; font:400 16px Arial,sans-serif; }
 body.home-mode .shell.page #welcome #room-code::placeholder { font-size:14px; }
 body.home-mode .shell.page #welcome #join-button { min-width:65px; height:38px; min-height:38px; padding:8px 10px; border-radius:9px; background:#edf2e3; font:600 12px Arial,sans-serif; }
 body.home-mode .shell.page #welcome .home-directory { display:block; flex:none; min-height:0; margin:0; }
 body.home-mode .shell.page #welcome .directory-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:30px; margin:0 0 7px; }
 body.home-mode .shell.page #welcome .directory-head h2 { margin:0; font:700 21px/1.15 Georgia,serif; white-space:normal; }
 body.home-mode .shell.page #welcome .directory-actions { display:flex; gap:5px; }
 body.home-mode .shell.page #welcome .directory-actions button { display:flex; align-items:center; min-height:30px; height:30px; padding:5px 8px; font:400 11px Arial,sans-serif; white-space:nowrap; border:1px solid #cbd5c0; border-radius:9px; background:#fffef7; color:#284e3a; }
 body.home-mode .shell.page #welcome #directory { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto; min-height:0; gap:8px; flex:none; }
 body.home-mode .shell.page #welcome #directory .room-card { display:grid; grid-template-columns:1fr; grid-template-rows:auto auto; min-height:100px; min-width:0; gap:8px; padding:8px; align-content:start; border:1px solid #d2dcc7; border-radius:10px; background:#fffef7; }
 body.home-mode .shell.page #welcome .room-avatar { display:none; }
 body.home-mode .shell.page #welcome .room-info { grid-column:1; grid-row:1; }
 body.home-mode .shell.page #welcome .room-info h3 { font:600 13px/1.4 Arial,sans-serif; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 body.home-mode .shell.page #welcome .room-info p { font:400 11px/1.4 Arial,sans-serif; margin:5px 0 0; color:#63755b; }
 body.home-mode .shell.page #welcome .room-card>button { grid-column:1; grid-row:2; justify-self:end; width:auto; min-height:29px; height:29px; padding:5px 8px; font:600 11px Arial,sans-serif; background:#eef3e5; }
 body.home-mode .shell.page #welcome .directory-empty { min-height:100px; padding:12px; }
 body.home-mode .shell.page #welcome .pagination { display:flex; justify-content:center; gap:14px; min-height:28px; margin:8px 0 0; font:400 11px Arial,sans-serif; }
 body.home-mode .shell.page #welcome .pagination button { width:30px; height:28px; min-height:28px; padding:3px 10px; font:400 14px Arial,sans-serif; }
 body.home-mode .shell.page #welcome .ranked-join { gap:4px; }
 body.home-mode .shell.page #welcome .ranked-join span { font-size:14px; flex:none; }
}
@media(max-width:360px) {
 body.home-mode .shell.page { padding:9px; }
 body.home-mode .shell.page .header .brand { font-size:18px; }
 body.home-mode .shell.page .logo { width:27px; height:36px; }
 body.home-mode .shell.page .home-tools #friends-main,body.home-mode .shell.page .home-tools #account-welcome { padding:0 7px; font-size:11px; }
 body.home-mode .shell.page #welcome>.ranked-card { grid-template-columns:44px minmax(0,1fr) 76px; gap:6px; padding:7px 8px; }
 body.home-mode .shell.page #welcome .ranked-symbol { width:44px; min-height:60px; }
 body.home-mode .shell.page #welcome .ranked-copy h2 { font-size:17px; }
 body.home-mode .shell.page #welcome .ranked-eyebrow { letter-spacing:.2px; }
 body.home-mode .shell.page #welcome .ranked-join { font-size:11px; padding:5px 6px; }
 body.home-mode .shell.page #welcome #home-ranked-note { font-size:6px; }
}
/* Account panel 0.8.101: match the approved cream, green, and gold preview. */
#account-dialog{width:min(430px,calc(100vw - 24px));max-width:430px;max-height:calc(100dvh - 24px);padding:0;border:1px solid #cdd7c2;border-radius:17px;background:#fffef7;color:#294b3a;font:14px/1.45 Arial,sans-serif;box-shadow:0 8px 24px #173f3020}
#account-dialog *{box-sizing:border-box}
#account-dialog [hidden]{display:none!important}
#account-dialog button{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;min-height:36px;padding:7px 10px;margin:0;border:1px solid #cbd5c0;border-radius:8px;background:#fffef8;color:#294b3a;font:400 12px/1.4 Arial,sans-serif}
#account-dialog button:disabled{opacity:.5}
#account-dialog>.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:15px 17px 13px;border-bottom:1px solid #e2e7d8;background:#fffef7}
#account-dialog #account-title{font:700 25px/1.1 Georgia,serif;margin:0;color:#244634}
#account-dialog #account-close{min-height:33px;padding:6px 10px}
#account-dialog .account-content{padding:17px;display:grid;gap:15px}
#account-dialog .account-identity{display:flex;gap:12px;align-items:center;min-width:0}
#account-dialog #account-avatar{display:grid;place-items:center;width:46px;height:46px;flex:none;border-radius:13px;color:#fff8df;background:linear-gradient(135deg,#245340,#39705a);font:500 26px Georgia,serif;border:1px solid #2f604b}
#account-dialog .account-identity>div:last-child{min-width:0;flex:1}
#account-dialog #account-player-name{font:700 22px/1.2 Georgia,serif;color:#254a36;margin:0 0 3px;overflow-wrap:anywhere}
#account-dialog #account-email{font-size:12px;color:#6e7b68;overflow-wrap:anywhere;margin:0}
#account-dialog .account-id-row{display:flex;align-items:center;gap:8px;margin:0;padding:8px 10px;background:#f2f5eb;border-radius:9px;min-width:0}
#account-dialog .account-id-row label{font-size:11px;color:#6b7b61;flex:none;margin:0;white-space:nowrap}
#account-dialog #profile-id{border:0;background:transparent;box-shadow:none;border-radius:0;min-height:0;height:25px;min-width:0;width:100%;flex:1;margin:0;padding:0;font:400 12px Arial,sans-serif;letter-spacing:.5px;color:#38523a}
#account-dialog #profile-copy{padding:4px 7px;min-height:28px;font-size:11px;border:0;background:transparent;flex:none}
#account-dialog #account-stats-slot:empty{display:none}
#account-dialog #profile-ranked-stats{margin:0;padding:12px;background:linear-gradient(120deg,#f7f0dd,#fffaf0);border:1px solid #dfcf9f;border-radius:12px}
#account-dialog #profile-stats-status{font-size:11px;color:#8a7040;margin:0}
#account-dialog #profile-stats-status:empty{display:none}
#account-dialog .account-rank-main{display:flex;align-items:center;gap:11px}
#account-dialog .account-rank-main>.tier-medal{display:block;object-fit:contain;width:52px;height:60px;flex:none;margin:0}
#account-dialog .account-rank-copy{min-width:0;flex:1}
#account-dialog .account-rank-kicker{font:400 10px Arial,sans-serif;letter-spacing:1px;color:#977b3c;margin:0 0 4px}
#account-dialog .account-rating{display:flex;align-items:baseline;gap:4px;margin:0;white-space:nowrap;color:#78591e}
#account-dialog .account-rating strong{font:700 27px/1 Georgia,serif}
#account-dialog .account-rating>span{font-size:12px;color:#8a7040}
#account-dialog .account-rank-meta{display:flex;justify-content:space-between;gap:10px;margin-top:6px;font-size:11px;color:#8a7040}
#account-dialog .account-rank-meta strong{font-weight:600;color:#7c5d24}
#account-dialog .account-rank-season{font-size:11px;color:#8a7040;margin:10px 0 0;padding-top:9px;border-top:1px solid #e4d8b8}
#account-dialog .account-ranked-empty{font:500 19px/1.3 Georgia,serif;color:#78591e;margin:5px 0}
#account-dialog .account-rating-record{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;padding-top:10px;border-top:1px solid #e4d8b8;color:#80632b}
#account-dialog .account-record-identity{display:flex;align-items:center;gap:8px;min-width:0}
#account-dialog .account-record-identity>.tier-medal{display:block;width:34px;height:40px;object-fit:contain;flex:none;margin:0}
#account-dialog .account-record-identity span{display:block;font-size:11px}
#account-dialog .account-record-identity small{display:block;margin-top:3px;font-size:10px;color:#937e52}
#account-dialog .account-record-amount{text-align:right;flex:none}
#account-dialog .account-record-amount strong{display:block;font:600 20px Georgia,serif;white-space:nowrap;color:#78591e}
#account-dialog .account-record-amount>span{display:block;margin-top:3px;font:600 11px Arial,sans-serif;color:#797c7c}
#account-dialog .account-rank-links{display:flex;gap:8px;margin-top:9px;align-items:center;justify-content:space-between}
#account-dialog .account-rank-links button{font-size:11px;min-height:30px;padding:4px 7px;background:#fffdf4;border-color:#e0d3b2;color:#775c28}
#account-dialog #profile-stats-detail{margin-top:10px;font-size:12px;color:#7f6937}
#account-dialog .account-positions{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin:9px 0 0}
#account-dialog .account-positions div{text-align:center;padding:5px 0}
#account-dialog .account-positions dt{font-size:10px;color:#937e52}
#account-dialog .account-positions dd{margin:3px 0 0;font-size:16px;color:#755620}
#account-dialog #profile-form{display:block;border:0;padding:0;margin:0;background:transparent}
#account-dialog #profile-form>label{display:block;font-size:12px;font-weight:600;margin:0 0 6px}
#account-dialog .account-name-controls{display:flex;gap:7px}
#account-dialog #profile-nickname{height:39px;min-width:0;flex:1;width:100%;padding:8px 10px;margin:0;background:#fffef9;border:1px solid #cbd5c0;border-radius:8px;font:400 16px Arial,sans-serif;color:#294b3a}
#account-dialog #profile-save{background:#275e43;color:#fffdf0;border-color:#275e43;font-size:12px;padding:7px 12px}
#account-dialog .account-name-note{font:400 11px/1.5 Arial,sans-serif;color:#79816d;margin:7px 0 0}
#account-dialog #profile-status{font:400 11px/1.5 Arial,sans-serif;color:#456d49;margin:5px 0 0}
#account-dialog #profile-status:empty{display:none}
#account-dialog #account-shortcuts:empty{display:none}
#account-dialog #account-friends{padding:0;border:0;background:transparent;color:#617a59;min-height:28px;font-size:12px}
#account-dialog .account-bottom{border-top:1px solid #e2e7d8;padding-top:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}
#account-dialog #account-logout{background:transparent;border:0;min-height:34px;font-size:12px;padding:4px 0;color:#955348}
#account-dialog .account-bottom a{font-size:11px;color:#748269;text-decoration:none;margin-left:auto}
#account-dialog #account-status{margin:0 17px 12px;font-size:11px;color:#738267}
#account-dialog #account-status:empty{display:none}
#account-dialog .account-guest{text-align:center}
#account-dialog .account-guest-icon{display:grid;place-items:center;width:46px;height:46px;margin:0 auto 12px;background:#285d45;color:#fff9e7;border-radius:13px;font:26px Georgia,serif}
#account-dialog .account-guest h3{font:500 23px Georgia,serif;margin:0 0 8px;color:#254a36}
#account-dialog #account-summary{font-size:12px;color:#728168;line-height:1.6;margin:0 auto;max-width:280px}
#account-dialog #google-button{display:flex;justify-content:center;min-width:0}
#account-dialog .account-guest-note{font-size:11px;color:#7d8973;margin:0}
@media(max-width:360px){#account-dialog>.dialog-head{padding:13px}#account-dialog .account-content{padding:13px;gap:13px}#account-dialog #profile-ranked-stats{padding:10px}#account-dialog .account-rank-meta{gap:6px;font-size:10px}#account-dialog .account-rank-main>.tier-medal{width:44px;height:54px}#account-dialog .account-id-row{gap:6px;padding:7px 8px}#account-dialog #profile-id{font-size:11px}#account-dialog .account-rating strong{font-size:25px}}


#account-dialog #account-stats-slot:has(>#profile-ranked-stats[hidden]){display:none}

#account-dialog #profile-copy svg{display:block;flex:none;width:15px;height:15px}
/* Approved public-room cards, 0.8.101. */
body.home-mode #welcome #directory .room-card{display:grid;grid-template-columns:1fr;grid-template-rows:auto auto auto;gap:7px;padding:10px;background:#fffef7;border:1px solid #d2dcc7;border-radius:11px;min-width:0;min-height:0;align-content:start;align-items:start}
body.home-mode #welcome #directory .room-info{grid-column:1;grid-row:1;min-width:0}
body.home-mode #welcome #directory .room-info h3{font:600 13px/1.3 Arial,sans-serif;color:#244d36;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.home-mode #welcome #directory .room-state{display:flex;align-items:center;font:400 11px/1.3 Arial,sans-serif;color:#647b59;gap:5px;margin:7px 0 0;min-width:0}
body.home-mode #welcome #directory .room-presence{display:block;width:6px;height:6px;flex:none;border-radius:50%;background:#73925d}
body.home-mode #welcome #directory .is-playing .room-state{color:#9b7a38}
body.home-mode #welcome #directory .is-playing .room-presence{background:#b69653}
body.home-mode #welcome #directory .room-meta{grid-column:1;grid-row:2;display:flex;align-items:center;justify-content:space-between;gap:5px;margin:1px 0 0;font:400 11px/1.3 Arial,sans-serif;color:#5d7253;white-space:nowrap}
body.home-mode #welcome #directory .room-seat-dots{display:flex;align-items:center;gap:3px;flex:none}
body.home-mode #welcome #directory .room-seat-dots span{display:block;width:7px;height:7px;border-radius:50%;border:1px solid #c2ceb5;background:transparent}
body.home-mode #welcome #directory .room-seat-dots span.filled{background:#819c69;border-color:#819c69}
body.home-mode #welcome #directory .is-playing .room-seat-dots span.filled{background:#baaa7a;border-color:#baaa7a}
body.home-mode #welcome #directory .room-join{grid-column:1;grid-row:3;display:flex;align-items:center;justify-content:center;justify-self:stretch;gap:7px;width:100%;height:31px;min-height:31px;margin:1px 0 0;padding:5px 8px;font:600 11px Arial,sans-serif;border:1px solid #b9cda5;background:#e9f0df;color:#31573c;border-radius:7px}
body.home-mode #welcome #directory .room-join:disabled{background:#f2f2e8;border-color:#dcdfd0;color:#91977e;opacity:1}
body.home-mode #welcome #directory .room-join-arrow{font-size:14px;line-height:1}
body.home-mode #welcome #directory .room-join-arrow[hidden]{display:none}
body.home-mode #welcome .directory-actions{gap:5px}
body.home-mode #welcome #directory-filter-open[aria-pressed="true"]{background:#e5eddb;border-color:#94aa7f;color:#285b3e}
body.home-mode #welcome .directory-actions svg{display:block;width:14px;height:14px;flex:none}
@media(max-width:700px){
 body.home-mode .shell.page #welcome .directory-head{margin-bottom:9px;gap:7px;align-items:center}
 body.home-mode .shell.page #welcome .directory-head h2{font:700 22px/1.15 Georgia,serif;white-space:nowrap}
 body.home-mode .shell.page #welcome .directory-actions button{min-height:31px;height:31px;padding:5px 7px;font-size:11px;gap:4px}
 body.home-mode .shell.page #welcome #refresh-rooms{width:31px;min-width:31px;padding:5px;justify-content:center}
 body.home-mode .shell.page #welcome #directory{gap:8px;align-items:stretch}
 body.home-mode .shell.page #welcome #directory .room-card{padding:10px;gap:7px;min-height:0;grid-template-columns:1fr;grid-template-rows:auto auto auto}
 body.home-mode .shell.page #welcome #directory .room-info h3{font:600 13px/1.3 Arial,sans-serif}
 body.home-mode .shell.page #welcome #directory .room-state{font:400 11px/1.3 Arial,sans-serif;margin:7px 0 0}
 body.home-mode .shell.page #welcome #directory .room-join{height:31px;min-height:31px;padding:5px 8px}
 body.home-mode .shell.page #welcome .pagination{margin-top:10px;gap:14px}
 body.home-mode .shell.page #welcome .pagination button{height:29px;min-height:29px;width:30px;padding:3px 8px}
}
@media(max-width:360px){body.home-mode .shell.page #welcome .directory-head h2{font-size:20px}body.home-mode .shell.page #welcome .directory-actions button{font-size:10px;padding:5px 6px}body.home-mode .shell.page #welcome #directory .room-card{padding:9px}body.home-mode .shell.page #welcome #directory .room-meta{font-size:10px}body.home-mode .shell.page #welcome #directory .room-seat-dots span{width:6px;height:6px}}


body.home-mode #welcome .directory-actions button{display:inline-flex;align-items:center;justify-content:center;gap:4px}

/* 0.8.101: compact lobby and connected share/invite panels. */
body.lobby-mode,.lobby-social-dialog{font-family:Arial,"Segoe UI",sans-serif}
.lobby-icon{width:17px;height:17px;flex:none;vertical-align:middle}
body.lobby-mode .shell{height:var(--visual-height,100dvh);min-height:0;max-width:780px;padding:14px 16px;display:flex;flex-direction:column;gap:12px;overflow-y:auto;background:#f1f2ea;box-shadow:none;border:0}
body.lobby-mode header{display:flex;flex-wrap:wrap;flex:none;height:auto;min-height:40px;padding:0;gap:6px;background:transparent;align-items:center}
body.lobby-mode header .brand{display:flex;align-items:center;gap:7px;font:700 23px Georgia,serif;letter-spacing:0;margin-right:auto;order:0}
body.lobby-mode header .brand em{font:inherit;letter-spacing:0}
body.lobby-mode header .brand .logo{display:flex;width:29px;height:37px}
body.lobby-mode .logo img{width:100%;height:100%;object-fit:contain}
body.lobby-mode #header-room,body.lobby-mode #fullscreen-toggle,body.lobby-mode #friends-main,body.lobby-mode #lobby-comms{display:none}
body.lobby-mode .home-tools{display:contents}
#friends-lobby{display:none}
body.lobby-mode header #back,body.lobby-mode #friends-lobby,body.lobby-mode #account-welcome,body.lobby-mode header #rules-open{display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:0;height:38px;min-height:38px;padding:7px 10px;font-size:12px;border:1px solid #cbd5c0;border-radius:8px;background:#fffef7;color:#2a513a;white-space:nowrap}
body.lobby-mode header #back{order:2;color:#945f4e;background:#faf3e9;border-color:#dfc9b8}
body.lobby-mode #friends-lobby{order:3}
body.lobby-mode #account-welcome{order:4}
body.lobby-mode header #rules-open{order:5;width:36px;padding:7px}
body.lobby-mode .shell:has(#room:not([hidden])) main{flex:1 0 auto;min-height:0;height:auto;display:block;padding:0;overflow:visible}
body.lobby-mode #room:has(#lobby:not([hidden])){display:flex;flex-direction:column;height:auto;min-height:0;gap:10px}
body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;height:auto;min-height:76px;width:100%;padding:13px 15px;border:0;border-radius:12px;background:linear-gradient(110deg,#193f32,#2b5b45);color:#fff6df}
body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar>.lobby-heading{display:block;flex:1 1 auto;width:auto;height:auto;overflow:hidden}
body.lobby-mode .room-bar .lobby-heading small{display:none}
body.lobby-mode .room-bar .lobby-heading h1{font:600 26px/1.15 Georgia,serif;margin:0 0 6px;letter-spacing:0;color:#fff6df}
body.lobby-mode .room-bar .lobby-heading #lobby-status{font-size:12px;line-height:1.4;color:#d3dfcc;white-space:normal}
body.lobby-mode #lobby-privacy{border:1px solid #aec1a660;border-radius:20px;padding:5px 9px;font-size:11px;color:#e4e7cf;white-space:nowrap}
body.lobby-mode #lobby{display:flex;flex-direction:column;gap:9px;padding:0;min-height:0;overflow:visible}
body.lobby-mode #lobby button{font-family:inherit;cursor:pointer;border-radius:8px}
body.lobby-mode #lobby button:disabled{cursor:default;opacity:.5}
body.lobby-mode #lobby button:focus-visible,.lobby-social-dialog button:focus-visible,.lobby-social-dialog a:focus-visible{outline:3px solid #287657;outline-offset:2px}
.lobby-invite-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 11px;background:#fffef7;border:1px solid #d6dfcc;border-radius:10px}
.lobby-code{display:flex;align-items:center;gap:6px;min-width:0}.lobby-code>div{display:grid;gap:3px}.lobby-code small{font-size:10px;color:#7b886f}.lobby-code strong{font:600 18px/1 Arial,sans-serif;letter-spacing:2px;color:#2b5039}
body.lobby-mode #lobby-copy-code{padding:5px;min-width:32px;min-height:36px;border:0;background:transparent}
body.lobby-mode #friends-lobby{margin-left:0}
body.lobby-mode #room #lobby #share{width:auto;height:auto;min-height:36px;background:#fffef7;color:#2a513a;border-color:#cbd5c0;font-size:12px}
.lobby-invite-actions{display:flex;gap:5px}body.lobby-mode #lobby .lobby-invite-actions button{display:inline-flex;gap:5px;align-items:center;padding:7px 9px;min-height:36px;font-size:12px;border:1px solid #cbd5c0;background:#fffef7;color:#2a513a;white-space:nowrap}
.lobby-players-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:2px 0 0}.lobby-players-heading h2{font:700 23px/1.2 Georgia,serif;margin:0}.lobby-players-heading span{font-size:11px;color:#738169}
body.lobby-mode #lobby .seat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;gap:8px;height:auto;min-height:0}
body.lobby-mode #lobby .seat-card{display:flex;flex-direction:column;justify-content:center;gap:7px;min-height:99px;height:auto;padding:10px;border:1px solid #d2dcc7;background:#fffef7;border-radius:11px;text-align:left;overflow:hidden}
body.lobby-mode #lobby .seat-card.mine{background:#f7faef;border-color:#99b184}
.seat-top{display:flex;align-items:center;justify-content:space-between;min-height:17px}.seat-role{font-size:10px;color:#947638}
body.lobby-mode #lobby .seat-number{display:inline;width:auto;height:auto;background:transparent;border:0;font:16px Georgia,serif;color:#9aaa85}
.seat-name-row{display:flex;align-items:center;gap:4px;min-width:0;height:25px}
body.lobby-mode #lobby .seat-card h3{font-size:15px;align-self:center;min-width:0;flex:1;overflow:hidden;white-space:nowrap}
body.lobby-mode #lobby .seat-profile{display:flex;align-items:center;gap:4px;width:100%;max-width:100%;min-width:0;min-height:25px;border:0;padding:0;background:transparent;color:#244d36;font-size:15px;font-weight:600;text-align:left}
body.lobby-mode #lobby #lobby-name-open{flex:none;width:30px;min-width:30px;height:30px;min-height:30px;padding:5px;border:0;background:transparent;color:#6f8b60}
.seat-foot{display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:11px;min-width:0;min-height:20px}.seat-tier{display:flex;align-items:center;gap:4px;color:#7b8267;min-width:0}.seat-tier span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.lobby-mode #lobby .seat-card .tier-medal-tiny{width:19px;height:19px;flex:none}.seat-ready{color:#917f4e;max-width:64px;font-size:11px;line-height:1.2}.seat-ready:before{content:'●';font-size:9px;margin-right:4px}.seat-ready.is-ready{color:#65884f}
body.lobby-mode #lobby .empty-seat{align-items:center;border-style:dashed;background:#f5f6ed;color:#8b987b;text-align:center;position:relative}.empty-seat .seat-top{position:absolute;top:8px;left:10px}
body.lobby-mode #lobby .seat-empty-invite{border:0;background:transparent;color:#78886b;font-size:12px;min-height:32px;padding:3px}.seat-empty-note{font-size:10px;color:#859078}
body.lobby-mode #lobby .lobby-settings{display:grid;grid-template-columns:1fr;gap:7px;padding:0;background:transparent;border:0;height:auto;min-height:0}
.lobby-duration-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.lobby-duration-options{display:grid;grid-template-columns:1fr 1fr;gap:7px}
body.lobby-mode #lobby .lobby-duration-options button{min-height:38px;padding:7px 4px;font-size:12px;border:1px solid #cbd5c0;background:#fffef7;color:#2a513a;white-space:nowrap}
body.lobby-mode #lobby .lobby-duration-options button[aria-pressed=true]{background:#e4eddb;border-color:#8ea87a;color:#285337;font-weight:600}
body.lobby-mode #lobby #lobby-rules-open{margin:0;padding:4px 0;min-height:29px;border:0;background:transparent;font-size:11px}
body.lobby-mode #lobby #duration-note,body.lobby-mode #lobby #duration-sync-note{grid-column:auto;margin:0;font-size:11px;line-height:1.45;color:#758368;white-space:normal;display:block}
body.lobby-mode #lobby #duration-repeat{font-size:inherit;margin:3px 0 0;display:block;color:#886d3e}
body.lobby-mode #lobby #duration-sync-note{color:#886d3e;font-size:10px}
.lobby-start-panel{padding:11px;background:#fffef7;border:1px solid #d2dcc7;border-radius:11px}
body.lobby-mode .lobby-action-bar{display:grid;grid-template-columns:1fr 1.3fr;gap:8px}.lobby-action-bar:has(#start[hidden]){grid-template-columns:1fr!important}
body.lobby-mode #lobby .lobby-action-bar button{height:42px;min-height:42px;padding:7px;font-size:13px;width:100%;border:1px solid #cbd5c0;background:#f2f6e9;color:#315b3d}
body.lobby-mode #lobby .lobby-action-bar #start{background:#285f43;border-color:#285f43;color:#fff9e7}body.lobby-mode #lobby .lobby-action-bar #start:disabled{background:#e2e7d8;border-color:#d4ddc8;color:#748267;opacity:1}
body.lobby-mode #lobby #lobby-help{margin:8px 0 0;font-size:11px;line-height:1.45;color:#7a866c;white-space:normal;text-align:center}
body.lobby-mode #lobby .lobby-chat{display:block;min-height:0;padding:12px;border:1px solid #d2dcc7;border-radius:11px;background:#fffef7}
body.lobby-mode .lobby-chat-heading{display:flex;align-items:center;gap:6px;min-height:36px}.lobby-chat-heading h2{margin:0}
body.lobby-mode .lobby-chat-heading h2{font:700 22px/1.2 Georgia,serif;white-space:nowrap}
body.lobby-mode #lobby-voice-controls{display:flex;margin-left:auto}
body.lobby-mode #lobby-voice-controls #voice-open{display:inline-flex;align-items:center;gap:5px;width:auto;height:36px;min-height:36px;padding:7px 9px;border:1px solid #cbd5c0;background:#f3f5ec;color:#647657;font-size:11px;white-space:nowrap}
body.lobby-mode #voice-open:before{content:'';width:15px;height:16px;display:inline-block;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10v2a7 7 0 0 0 14 0v-2M12 19v3M8 22h8'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
body.lobby-mode #lobby-voice-controls #voice-open[aria-pressed=true]{background:#e2edda;border-color:#8ea97b;color:#315e3d}
body.lobby-mode #lobby-chat-toggle{min-width:30px;min-height:36px;border:0;background:transparent;padding:6px;color:#7d8b70}
#lobby-chat-toggle[aria-expanded=false] svg{transform:rotate(180deg)}
.lobby-chat-info{display:flex;justify-content:space-between;gap:7px;align-items:center}.lobby-chat-info:has(>[hidden]):not(:has(>:not([hidden]))){display:none}
body.lobby-mode #lobby-chat-messages{height:160px;min-height:110px;max-height:240px;padding:10px 0;margin:2px 0 9px;overflow-y:auto;overflow-wrap:anywhere}
body.lobby-mode #lobby-chat-messages .chat-message{display:flex;align-items:baseline;gap:10px;padding:5px 0;margin:0 0 5px;background:transparent;border:0}
body.lobby-mode #lobby-chat-messages .chat-message b{width:72px;max-width:30%;flex:none;font-size:12px;color:#597c51;overflow-wrap:anywhere}
body.lobby-mode #lobby-chat-messages .chat-message p{font-size:14px;line-height:1.5;margin:0;color:#51664a;min-width:0}
body.lobby-mode #lobby-chat-messages .chat-empty{font-size:13px}.lobby-chat .chat-empty span{font-size:11px}
body.lobby-mode #lobby-chat-form{gap:7px}body.lobby-mode #lobby-chat-input{height:44px;min-height:44px;margin:0;padding:9px 10px;background:#fafbf3;border:1px solid #ced8c2;border-radius:8px;font-size:16px}
body.lobby-mode #lobby-chat-send{width:44px;min-width:44px;height:44px;min-height:44px;padding:9px;background:#285f43;color:#fff9e7;border-color:#285f43}
body.lobby-mode #lobby-chat-feedback{margin:4px 0 0;min-height:0;white-space:normal;font-size:11px;line-height:1.4}
body.lobby-mode #lobby-chat-feedback:empty{display:none}
body.lobby-mode .lobby-chat-tools{display:block;height:auto}
.lobby-social-dialog{box-sizing:border-box;width:min(430px,calc(100vw - 24px));max-width:430px;max-height:calc(100dvh - 24px);padding:20px;border:1px solid #d0d8c6;border-radius:18px;background:#fffef7;color:#294d3a;box-shadow:0 14px 40px #193f3024;overflow-y:auto}
#share-dialog.lobby-social-dialog{width:min(430px,calc(100vw - 24px));padding:20px}
.lobby-social-dialog .dialog-head{gap:10px;margin-bottom:7px}.lobby-social-dialog .dialog-head h2{font:600 28px/1.15 Georgia,serif;margin:0;letter-spacing:-.4px}
.lobby-social-dialog .dialog-head button{width:auto;min-width:54px;min-height:36px;padding:7px 10px;font-size:12px;border:1px solid #cbd5c0;border-radius:8px;background:#fffef7;color:#2a513a}
.lobby-social-dialog p.share-intro{margin:0 0 17px;font-size:13px;color:#718067;line-height:1.5}
.share-room-card{padding:13px;background:linear-gradient(110deg,#f0f4e9,#f8f7ec);border:1px solid #d8e0cc;border-radius:12px}.share-room-top{display:flex;align-items:center;gap:10px;min-width:0}.share-tile-slot{display:flex;align-items:center;justify-content:center;flex:none;width:38px}.share-tile-slot img{width:34px;height:44px;object-fit:contain}.share-room-info{min-width:0;display:grid;gap:5px}.share-room-info strong,#lobby-invite-room{font:600 20px/1.2 Georgia,serif;color:#294e37;overflow-wrap:anywhere}.share-room-info small{font-size:11px;color:#6c7e5f}
.share-code-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:10px;margin-top:11px;border-top:1px solid #d9e0cc}.share-code-row>div{display:flex;align-items:center;gap:8px}.share-code-row small{font-size:11px;color:#718164}.share-code-row strong{font:600 16px Arial,sans-serif;letter-spacing:2px}.share-code-row button{min-width:36px;min-height:36px;padding:7px;border:0;background:transparent;color:#2a513a}
#share-dialog .share-via-label{margin:17px 0 7px;font-size:12px;font-weight:600;color:#556f4b}
#share-dialog .invite-targets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:0}
#share-dialog .invite-targets>*{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:80px;width:auto;margin:0;border:0;padding:5px 0 8px;background:transparent;border-radius:10px;color:#52694b;font:11px Arial,sans-serif;text-decoration:none}
.share-app-icon{display:flex;align-items:center;justify-content:center;width:43px;height:43px;border-radius:14px;background:#eef1e6;color:#5a7151}.share-app-icon svg{width:24px;height:24px}.share-app-icon img{width:26px;height:26px;display:block;object-fit:contain}.share-whatsapp .share-app-icon{background:#25d366}.share-wechat .share-app-icon{background:#07c160}.share-whatsapp .share-app-icon img,.share-wechat .share-app-icon img{filter:brightness(0) invert(1)}.share-telegram .share-app-icon{background:#fff;border-radius:50%}.share-telegram .share-app-icon img{width:100%;height:100%}
#share-dialog .invite-targets>*:hover{background:#f2f5eb}
.share-link-row{display:flex;gap:8px;align-items:center;margin:13px 0 12px;padding:10px;border:1px solid #dce2d1;border-radius:10px;background:#f7f8ef}.share-link-row label{flex:1;min-width:0;margin:0;font-size:11px;color:#75836a}
#share-dialog #invite-url{border:0;background:transparent;box-shadow:none;width:100%;height:27px;min-height:27px;padding:3px 0;margin:3px 0 0;font-size:12px;color:#4f6747;text-overflow:ellipsis}
.share-link-row button{flex:none;min-width:44px;min-height:44px;padding:8px;border:1px solid #cbd5c0;border-radius:8px;background:#fffef7;color:#2a513a}
#share-dialog #copy-invite-message{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:10px;background:#285f43;border:1px solid #285f43;color:#fff9e7;font-size:13px;font-weight:600;border-radius:8px}
#share-dialog .share-copy-hint{font-size:11px;text-align:center;margin:7px 0 0;color:#7d896f}#share-message-fallback{margin-top:10px;font-size:11px;color:#6f7e63}#share-message-fallback summary{cursor:pointer;padding:5px;text-align:center}#share-dialog #invite-text{box-sizing:border-box;width:100%;min-height:100px;margin:6px 0 0;font-size:13px;color:#294d3a;background:#f7f8ef;border:1px solid #cbd5c0;border-radius:8px;padding:8px}
#share-dialog #share-status,#lobby-invite-status{margin:12px 0 0;min-height:18px;color:#6f7e63;text-align:center;font-size:12px;line-height:1.5}
#lobby-invite-meta{margin:5px 0 9px;font-size:12px;color:#6c7e5f}#lobby-invite-seats{display:inline-block;padding:4px 8px;border-radius:20px;background:#e2ecd8;font-size:11px;color:#4f7240}
.invite-list-heading{display:flex;justify-content:space-between;align-items:center;gap:7px;margin:17px 0 2px}.invite-list-heading h3{margin:0;font:600 18px Georgia,serif}.invite-list-heading small{font-size:11px;color:#7b886f}
#lobby-invite-list{max-height:290px;overflow-y:auto;overscroll-behavior:contain}.invite-friend{display:flex;gap:10px;align-items:center;min-width:0;padding:12px 0;border-bottom:1px solid #e1e5d7}.invite-avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:11px;background:#eaf0e0;color:#42613a;font:600 17px Georgia,serif}.invite-friend-info{display:grid;gap:5px;flex:1;min-width:0}.invite-friend-info strong{font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.invite-friend-info small{font-size:11px;color:#89927c}.invite-friend-info .online{color:#638c4e}.invite-friend-info .online:before{content:'●';font-size:8px;margin-right:4px}
#lobby-invite-list button,#lobby-invite-retry{min-height:38px;min-width:72px;padding:7px 10px;font-size:12px;white-space:nowrap;border:1px solid #c1d1b3;border-radius:8px;background:#f2f6e9;color:#315b3d}.invite-friend .invite-sent{border-color:transparent!important;background:transparent!important;color:#6e8c58!important;opacity:1}#lobby-invite-list button:disabled{cursor:default}.invite-empty{font-size:13px;color:#718067;padding:10px 0}.invite-share-footer{border-top:1px solid #e1e5d7;margin-top:14px;padding-top:13px;text-align:center}.invite-share-footer p{font-size:12px;color:#7b886f;margin:0 0 9px}.invite-share-footer button{width:100%;min-height:42px;background:#285f43;border-color:#285f43;border-radius:8px;color:#fff9e7;font-size:13px}.invite-share-footer small{display:block;margin-top:10px;font-size:11px;color:#7d896f;line-height:1.5}
@media(max-width:440px){body.lobby-mode .shell{padding:10px;gap:9px}body.lobby-mode header .brand{flex-basis:100%;margin-bottom:1px;font-size:22px}body.lobby-mode #account-welcome{margin-left:auto}body.lobby-mode .room-bar .lobby-heading h1{font-size:25px}body.lobby-mode #lobby-chat-messages{height:145px}}
@media(max-width:360px){body.lobby-mode .shell{padding:9px}body.lobby-mode header #back,body.lobby-mode #friends-lobby,body.lobby-mode #account-welcome{font-size:11px;padding:6px 8px}.lobby-invite-strip{gap:4px;padding:8px}.lobby-code strong{font-size:16px;letter-spacing:1px}body.lobby-mode #lobby .lobby-invite-actions button{font-size:10px;padding:6px;gap:4px}.lobby-invite-actions .lobby-icon{width:14px;height:14px}body.lobby-mode #lobby .seat-card{padding:9px;gap:6px;min-height:96px}.seat-ready{max-width:48px}body.lobby-mode #lobby .seat-profile{font-size:14px}body.lobby-mode #lobby .lobby-duration-options button{font-size:11px}.lobby-social-dialog,#share-dialog.lobby-social-dialog{padding:16px}.lobby-social-dialog .dialog-head h2{font-size:25px}.share-app-icon{width:40px;height:40px}}
@media(pointer:coarse){body.lobby-mode header #back,body.lobby-mode #friends-lobby,body.lobby-mode #account-welcome,body.lobby-mode header #rules-open,body.lobby-mode #lobby .lobby-invite-actions button,body.lobby-mode #lobby-voice-controls #voice-open,body.lobby-mode #lobby-chat-toggle,.lobby-social-dialog button{min-height:44px}}
html[data-high-contrast=on] body.lobby-mode .seat-card,html[data-high-contrast=on] .lobby-social-dialog{background:#fff;color:#111;border-color:#111}

/* Keep the approved lobby arrangement within the visible viewport. */
/* Use one microphone icon in the lobby and game; a slash marks non-transmitting states. */
#voice-open[data-mic-state]::before,body.lobby-mode #voice-open[data-mic-state]::before{content:'';display:inline-block;width:15px;height:16px;flex:none;vertical-align:-3px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10v2a7 7 0 0 0 14 0v-2M12 19v3M8 22h8'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
#voice-open[data-mic-state]:not([data-mic-state=on])::before,body.lobby-mode #voice-open[data-mic-state]:not([data-mic-state=on])::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 2 20 20M9 9v3a3 3 0 0 0 5.12 2.12M9 5V5a3 3 0 0 1 6 0v4m4 1v2c0 .7-.1 1.35-.28 1.97M5 10v2a7 7 0 0 0 12 4.9M12 19v3M8 22h8'/%3E%3C/g%3E%3C/svg%3E")}
body.lobby-mode #lobby .sr-only{width:1px;min-width:0;max-width:1px;left:0;top:0;margin:0;padding:0;border:0}
body.lobby-mode .shell.page{height:var(--visual-height,100dvh);max-height:var(--visual-height,100dvh);padding:8px 10px max(8px,env(safe-area-inset-bottom));gap:6px;overflow:hidden}
body.lobby-mode .shell.page:has(#room:not([hidden])) main{flex:1 1 0;min-height:0;overflow:hidden}
body.lobby-mode #room:has(#lobby:not([hidden])){height:100%;min-height:0;gap:6px;overflow:hidden}
body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar{flex:none;min-height:54px;padding:8px 12px;border-radius:10px}
body.lobby-mode .room-bar .lobby-heading h1{font-size:23px;line-height:1.05;margin-bottom:4px}
body.lobby-mode .room-bar .lobby-heading #lobby-status{font-size:11px;line-height:14px}
body.lobby-mode #lobby{flex:1 1 0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto auto minmax(0,1fr);gap:6px;min-height:0;overflow:hidden}
body.lobby-mode #lobby .lobby-invite-strip{padding:4px 8px;gap:5px;min-height:42px}
body.lobby-mode .lobby-code>div{gap:1px}body.lobby-mode .lobby-code strong{font-size:17px}
body.lobby-mode #lobby .lobby-invite-actions button,body.lobby-mode #room #lobby #share,body.lobby-mode #lobby-copy-code{min-height:34px;height:34px;padding:5px 7px}
body.lobby-mode .lobby-players-heading{margin:0;min-height:21px}body.lobby-mode .lobby-players-heading h2{font-size:21px}
body.lobby-mode #lobby .seat-grid{gap:6px;grid-template-rows:repeat(2,minmax(0,1fr))}
body.lobby-mode #lobby .seat-card{gap:2px;padding:6px 9px;min-height:72px}
body.lobby-mode .seat-top{min-height:12px;height:12px}body.lobby-mode #lobby .seat-number{font-size:14px}
body.lobby-mode .seat-name-row{height:23px}body.lobby-mode .seat-foot{min-height:18px;line-height:1.15}
body.lobby-mode #lobby .seat-card .tier-medal-tiny{width:18px;height:18px}
body.lobby-mode .seat-ready{max-width:none;white-space:nowrap;font-size:10px}
body.lobby-mode #lobby .seat-empty-invite{min-height:28px;padding:2px}
body.lobby-mode #lobby .lobby-settings{gap:3px}
body.lobby-mode .lobby-duration-heading{min-height:20px}body.lobby-mode #lobby #lobby-rules-open{min-height:20px;padding:0}
body.lobby-mode #lobby .lobby-duration-options button{height:34px;min-height:34px;padding:5px 4px}
body.lobby-mode #lobby #duration-note{font-size:10px;line-height:13px}
body.lobby-mode #lobby #duration-repeat{display:inline;margin:0 0 0 4px;font-size:10px;line-height:13px}
body.lobby-mode #lobby #duration-note>span:nth-child(2){display:none}
body.lobby-mode #lobby #duration-sync-note:not(.duration-changed){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.lobby-mode #lobby #duration-sync-note.duration-changed{font-size:10px;line-height:13px;padding:3px 5px;border-width:1px}
body.lobby-mode .lobby-start-panel{padding:6px 8px}
body.lobby-mode #lobby .lobby-action-bar button{height:36px;min-height:36px;padding:5px;font-size:12px}
body.lobby-mode #lobby #lobby-help{margin-top:4px;padding:0;background:transparent;font-size:10px;line-height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.lobby-mode #lobby .lobby-chat{display:flex;flex-direction:column;padding:7px 9px;min-height:0;overflow:hidden}
body.lobby-mode .lobby-chat-heading{flex:none;min-height:32px}
body.lobby-mode .lobby-chat-heading h2{font-size:21px}
body.lobby-mode #lobby-voice-controls #voice-open,body.lobby-mode #lobby-chat-toggle{height:32px;min-height:32px;padding:5px 7px}
body.lobby-mode #lobby-chat-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:4px}
body.lobby-mode #lobby-chat-messages{flex:1 1 0;height:auto;min-height:0;max-height:none;padding:5px 0;margin:0;overscroll-behavior:contain}
body.lobby-mode #lobby-chat-messages .chat-message{gap:8px;padding:2px 0;margin-bottom:3px}
body.lobby-mode #lobby-chat-messages .chat-message p{font-size:13px;line-height:1.35}
body.lobby-mode #lobby-chat-messages .chat-message b{font-size:11px}
body.lobby-mode #lobby-chat-messages .chat-empty{gap:3px;font-size:12px}
body.lobby-mode #lobby-chat-messages .chat-empty span{font-size:10px}
body.lobby-mode #lobby-chat-form{flex:none}
body.lobby-mode #lobby-chat-input,body.lobby-mode #lobby-chat-send{height:38px;min-height:38px;padding:7px 9px}
body.lobby-mode #lobby-chat-send{min-width:38px;width:38px}
body.lobby-mode .lobby-chat-tools{flex:none}
body.lobby-mode #lobby-chat-feedback{margin:0;font-size:10px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.lobby-mode .lobby-chat-tools:has(#lobby-chat-feedback:empty){display:none}
body.lobby-mode .lobby-chat-info{flex:none;font-size:10px;line-height:12px}
body.lobby-mode #lobby-chat-new{min-height:20px;font-size:10px}
@media(max-height:760px){
 body.lobby-mode .shell.page{padding:6px 8px max(6px,env(safe-area-inset-bottom));gap:5px}
 body.lobby-mode header{min-height:34px;flex-wrap:nowrap;gap:4px}
 body.lobby-mode header .brand{flex:0 1 auto;min-width:0;margin:0 auto 0 0;gap:4px;font-size:17px}
 body.lobby-mode header .brand .logo{width:22px;height:29px;flex:none}
 body.lobby-mode header #back,body.lobby-mode #friends-lobby,body.lobby-mode #account-welcome,body.lobby-mode header #rules-open{height:34px;min-height:34px;font-size:10px;padding:5px 6px;flex:none}
 body.lobby-mode #account-welcome{margin-left:0}body.lobby-mode header #rules-open{width:29px}
 body.lobby-mode #room:has(#lobby:not([hidden])){gap:5px}
 body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar{min-height:46px;padding:6px 10px}
 body.lobby-mode .room-bar .lobby-heading h1{font-size:21px;margin-bottom:3px}
 body.lobby-mode #lobby{gap:5px}
 body.lobby-mode .lobby-players-heading{min-height:18px}body.lobby-mode .lobby-players-heading h2{font-size:19px}
 body.lobby-mode #lobby .seat-card{padding:4px 8px;min-height:62px;gap:1px}
 body.lobby-mode .seat-top{height:11px;min-height:11px}
 body.lobby-mode .seat-name-row{height:22px}
 body.lobby-mode #lobby .seat-profile{font-size:14px;min-height:22px}
 body.lobby-mode #lobby #lobby-name-open{width:26px;min-width:26px;min-height:26px;height:26px;padding:4px}
 body.lobby-mode .seat-foot{min-height:17px;font-size:10px}
 body.lobby-mode #lobby .seat-card .tier-medal-tiny{width:17px;height:17px}
 body.lobby-mode .lobby-start-panel{padding:5px 7px}
 body.lobby-mode #lobby .lobby-action-bar button{min-height:34px;height:34px}
 body.lobby-mode .lobby-chat-heading h2{font-size:20px}
}
@media(max-width:360px) and (max-height:760px){body.lobby-mode header .brand em{display:none}body.lobby-mode .seat-tier{gap:2px}body.lobby-mode .seat-foot{gap:3px}body.lobby-mode .seat-ready:before{margin-right:2px}body.lobby-mode #room #lobby #share{font-size:10px}}
@media(max-height:620px){
 body.lobby-mode .shell.page{padding:5px 7px;gap:4px}
 body.lobby-mode header,body.lobby-mode header #back,body.lobby-mode #friends-lobby,body.lobby-mode #account-welcome,body.lobby-mode header #rules-open{min-height:30px;height:30px}
 body.lobby-mode #room:has(#lobby:not([hidden])){gap:4px}
 body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar{min-height:42px;padding:4px 9px}
 body.lobby-mode .room-bar .lobby-heading h1{font-size:20px;margin-bottom:2px}
 body.lobby-mode #lobby{gap:4px}
 body.lobby-mode #lobby .lobby-invite-strip{padding:2px 7px;min-height:34px}
 body.lobby-mode #lobby .lobby-invite-actions button,body.lobby-mode #room #lobby #share,body.lobby-mode #lobby-copy-code{height:30px;min-height:30px;padding:3px 6px}
 body.lobby-mode .lobby-code strong{font-size:15px}.lobby-code small{font-size:9px}
 body.lobby-mode #lobby .seat-grid{gap:4px}body.lobby-mode #lobby .seat-card{min-height:57px;padding:3px 7px;gap:0}
 body.lobby-mode .seat-top{min-height:10px;height:10px}body.lobby-mode #lobby .seat-number{font-size:12px}
 body.lobby-mode .seat-name-row{height:22px}body.lobby-mode .seat-empty-note{font-size:9px}
 body.lobby-mode .lobby-duration-heading{min-height:18px;font-size:11px}body.lobby-mode #lobby #lobby-rules-open{min-height:18px;font-size:10px}
 body.lobby-mode #lobby .lobby-duration-options button{min-height:30px;height:30px;font-size:11px;padding:3px}
 body.lobby-mode .lobby-start-panel{padding:4px 6px}body.lobby-mode #lobby .lobby-action-bar button{min-height:30px;height:30px;font-size:11px}
 body.lobby-mode #lobby #lobby-help{margin-top:3px;line-height:12px}
 body.lobby-mode #lobby .lobby-chat{padding:5px 8px}
 body.lobby-mode .lobby-chat-heading,body.lobby-mode #lobby-voice-controls #voice-open,body.lobby-mode #lobby-chat-toggle{min-height:28px;height:28px}
 body.lobby-mode .lobby-chat-heading h2{font-size:19px}
 body.lobby-mode #lobby-chat-input,body.lobby-mode #lobby-chat-send{min-height:34px;height:34px;padding:5px 8px}
}
/* On wide, short screens retain every control beside the chat. */
@media(min-width:600px) and (max-height:560px){
 body.lobby-mode #room:has(#lobby:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:44px 18px 64px auto minmax(0,1fr);gap:5px 8px}
 body.lobby-mode #lobby{display:contents}
 body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar{grid-column:1;grid-row:1;min-height:0;padding:4px 9px}
 body.lobby-mode #lobby .lobby-invite-strip{grid-column:2;grid-row:1}
 body.lobby-mode .lobby-players-heading{grid-column:1/-1;grid-row:2}
 body.lobby-mode .shell.lobby-keyboard #lobby>#seats,body.lobby-mode #lobby .seat-grid{display:grid;grid-column:1/-1;grid-row:3;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}
 body.lobby-mode .shell.lobby-keyboard #lobby>.lobby-settings,body.lobby-mode #lobby .lobby-settings{display:grid;grid-column:1;grid-row:4;align-self:start}
 body.lobby-mode .lobby-start-panel{grid-column:1;grid-row:5;align-self:start}
 body.lobby-mode #lobby .lobby-chat{grid-column:2;grid-row:4/6}
}
/* A software keyboard leaves the message composer anchored in view. */
@media(max-width:599px){
 body.lobby-mode .shell.lobby-keyboard #room:has(#lobby:not([hidden])) .room-bar{display:none}
 body.lobby-mode .shell.lobby-keyboard #lobby{display:flex;flex-direction:column}
 body.lobby-mode .shell.lobby-keyboard #lobby>.lobby-invite-strip,body.lobby-mode .shell.lobby-keyboard #lobby>.lobby-players-heading,body.lobby-mode .shell.lobby-keyboard #lobby>.lobby-start-panel{display:none}
 body.lobby-mode .shell.lobby-keyboard #lobby>.lobby-chat{flex:1}
}

/* 0.8.101: shared navigation and the approved compact playing table. */
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header{display:flex;flex-wrap:nowrap;align-items:center;gap:5px;min-height:44px;height:44px;padding:0;border:0;letter-spacing:0;flex:none}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .brand{display:flex;flex:1 1 auto;align-items:center;gap:6px;min-width:0;margin:0 auto 0 0;font:700 21px/1.2 Georgia,serif;color:#234637;order:0}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .brand em{display:block;font:inherit;color:inherit;letter-spacing:0}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .logo{display:flex;flex:none;width:30px;height:39px;padding:0;background:none;border:0;box-shadow:none}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .logo img{width:100%;height:100%;object-fit:contain}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .home-tools{display:contents}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header :is(#friends-main,#friends-lobby,#account-welcome,#rules-open){display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;width:auto;min-height:44px;height:44px;padding:7px 9px;margin:0;border:1px solid #cbd5c0;border-radius:9px;background:#fffef7;color:#284e3a;font:600 12px/1.4 Arial,sans-serif;white-space:nowrap}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header :is(#friends-main,#friends-lobby){order:1}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header #account-welcome{order:2}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header #rules-open{order:3;padding:7px;width:44px}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header #rules-open svg{width:16px;height:16px;stroke-width:2}
body:is(.home-mode,.lobby-mode,.playing-mode) #fullscreen-toggle,body:is(.lobby-mode,.playing-mode) #friends-main,body.home-mode #friends-lobby,body:is(.lobby-mode,.playing-mode) #header-room{display:none!important}
body:is(.lobby-mode,.playing-mode) #back{position:relative;flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:28px;height:28px;width:auto;padding:3px 7px;border:1px solid #d4dfc177;border-radius:6px;background:#fff8e810;color:#f5ecd5;font:400 11px/1.4 Arial,sans-serif;white-space:nowrap}
body:is(.lobby-mode,.playing-mode) #back::after{content:'';position:absolute;inset:-8px 0}
body:is(.lobby-mode,.playing-mode) #back:hover{background:#fff8e824}
body.lobby-mode .room-bar #back{margin-left:4px}
body.lobby-mode .room-bar #lobby-privacy{padding:4px 7px;font-size:10px}
body.playing-mode{background:#eef1e7;color:#284a36;color-scheme:light}
body.playing-mode .shell.page{display:flex;flex-direction:column;max-width:460px;width:100%;height:var(--visual-height,100dvh);max-height:var(--visual-height,100dvh);min-height:0;margin:0 auto;padding:8px 10px max(8px,env(safe-area-inset-bottom));gap:6px;overflow:hidden;background:#f4f5eb;box-shadow:none;border:0}
body.playing-mode .shell.page:has(#room:not([hidden])) main{display:flex;flex:1 1 0;min-height:0;padding:0;overflow:hidden}
body.playing-mode #room{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;height:100%;gap:0}
body.playing-mode .room-bar{display:none}
body.playing-mode #room #game,body.playing-mode #room #game:not(:has(#hand .tile:nth-child(8))){--hand-tile-height:clamp(44px,calc((100vw - 44px)/7 * 1.35),77px);--hand-rows:2;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:24px minmax(140px,1fr) 38px calc(var(--hand-tile-height)*var(--hand-rows) + (var(--hand-rows) - 1)*4px) 40px 14px 38px;gap:5px;flex:1 1 0;min-height:0;width:100%;height:100%}
body.playing-mode #game .game-stats{grid-row:1;display:flex;justify-content:space-between;align-items:center;gap:5px;font-size:10px;line-height:1.3;color:#6a765f;padding:0 2px;white-space:nowrap}
body.playing-mode #game-room-meta{color:#31543e;font-weight:600}
body.playing-mode .game-stats :is(#hand-label,#my-score){display:none}
body.playing-mode #game>.table.river-table{grid-row:2;display:grid;grid-template-rows:28px minmax(0,1fr);min-height:0;padding:7px;gap:6px;border:1px solid #40634b;border-radius:12px;background:radial-gradient(ellipse at 50% 30%,#2b684e,#194b38);color:#f6efd9;overflow:hidden}
.board-caption{display:flex;justify-content:space-between;align-items:center;gap:8px;color:#d7dfc4;font-size:9px;letter-spacing:1.4px}
body.playing-mode #game #game-leave-slot{display:flex;align-items:center;letter-spacing:0}
body.playing-mode .table :is(#opponents,#river-navigation,#table-details){display:none}
body.playing-mode #game .river-table #discards{grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:6px;margin:0;padding:0;min-height:0;overflow:hidden}
body.playing-mode #game #discards .river-row{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:34px minmax(0,1fr) auto;gap:3px;min-width:0;min-height:0;padding:5px;background:#0c302954;border:1px solid #dae3b92e;border-radius:8px;overflow:hidden}
body.playing-mode #game #discards .river-row.active{border-color:#d9bd70;box-shadow:inset 0 0 0 1px #d9bd7038}
body.playing-mode #game .river-owner{position:static;display:flex;flex-direction:column;align-items:stretch;justify-content:center;width:100%;height:34px;min-height:34px;max-height:none;margin:0;padding:0;border:0;background:none;overflow:hidden;color:#fff4da;text-align:left}
body.playing-mode #game .river-identity{display:flex;align-items:center;gap:4px;min-width:0;color:inherit}
body.playing-mode #game .river-name{font-size:12px;font-weight:600;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.playing-mode #game .river-score{display:block;color:#cfddc5;font:400 9px/14px Arial,sans-serif;white-space:nowrap}
.ready-hand-badge{display:inline-block;flex:none;margin-left:4px;padding:1px 4px;border-radius:4px;background:#e9db9e;color:#304c33;font:600 10px/15px Arial,sans-serif;white-space:nowrap}
body.playing-mode #game #discards .river-tiles{display:flex;flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:2px;width:100%;height:100%;min-height:0;overflow-x:hidden;overflow-y:auto;contain:size;scrollbar-width:thin;overscroll-behavior:contain}
body.playing-mode #game #discards .river-tiles .discard-entry{display:block;flex:none;width:calc((100% - 10px)/6);height:auto;min-height:0;margin:0;padding:0;overflow:visible;opacity:1}
body.playing-mode #game #discards .river-tiles .discard-entry .tile{display:flex;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:.73;margin:0;padding:0;border-width:1px;border-bottom-width:2px;border-radius:3px}
body.playing-mode #game #discards .river-tiles .discard-entry.claimed{opacity:.4}
body.playing-mode #game #discards .river-tiles .discard-entry.latest .tile{outline:2px solid #e7c46c;outline-offset:-1px}
body.playing-mode .river-empty{font-size:10px;line-height:1.3;color:#c5d5bd}
body.playing-mode #game .river-public{position:static;display:flex;flex-direction:column;gap:2px;min-height:0;overflow:hidden;padding:0;margin:0}
.player-open-tiles{display:flex;align-items:flex-start;gap:5px;min-width:0;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
body.playing-mode #game .river-melds,body.playing-mode #game .river-bonus{display:flex;flex:none;gap:2px;align-items:flex-start;flex-wrap:nowrap;margin:0;padding:0;overflow:visible}
body.playing-mode #game .public-meld{display:flex;flex:none;gap:1px;margin:0;padding:0}
body.playing-mode #game .river-public .tile{flex:none;width:18px;height:25px;min-width:18px;min-height:25px;max-width:none;max-height:none;margin:0;padding:0;border-width:1px;border-bottom-width:2px;border-radius:3px}
body.playing-mode #game .player-presence{font-size:8px;line-height:10px;padding:0;color:#d6dec5;background:none}
body.playing-mode #game .hand-heading{display:contents}
body.playing-mode #game #turn-status{grid-row:3;grid-column:1;display:flex;align-items:center;gap:5px;padding:0 2px;height:38px;min-height:0;overflow:hidden}
body.playing-mode #game #turn-status h2{font:700 15px/18px Georgia,serif;color:#2b5138}
body.playing-mode #game #game-status{font:400 10px/14px Arial,sans-serif;color:#78836d}
body.playing-mode #game .turn-preview{gap:3px}
body.playing-mode #game .turn-preview small{font-size:8px;color:#7a826f}
body.playing-mode #game #last-discard .tile{width:24px;height:33px}
body.playing-mode #game #hand{grid-row:4;grid-column:1;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(var(--hand-rows),var(--hand-tile-height));gap:4px;min-height:0;width:100%;height:auto;align-self:start;align-content:start;padding:0;margin:0}
body.playing-mode #game #hand .tile{width:100%;height:var(--hand-tile-height);min-height:0;max-height:none;aspect-ratio:auto;min-width:0;padding:1px;margin:0}
body.playing-mode #game #actions{grid-row:5;grid-column:1;display:flex;align-items:stretch;gap:5px;min-height:0}
body.playing-mode #game #actions button{height:40px;min-height:40px;background:#285f43;color:#fff9e7;border:1px solid #285f43;border-radius:8px;font-size:12px}
body.playing-mode #game #actions .waiting{color:#78836d;font-size:11px}
body.playing-mode #game #hand-help{grid-row:6;grid-column:1;display:block;font:400 9px/14px Arial,sans-serif;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#7b866f}
body.playing-mode #game #hand-toolbar{grid-row:7;grid-column:1;display:flex;align-items:center;gap:4px;height:38px;min-height:0;border-top:1px solid #dce2cf;padding:0}
body.playing-mode #game #hand-toolbar>button,body.playing-mode #game #hand-toolbar>#timer{flex:1 1 0;min-width:0;width:auto;height:34px;min-height:34px;max-height:none;padding:4px;font:400 11px/1.4 Arial,sans-serif;white-space:nowrap;border:1px solid #ced8c2;border-radius:7px;background:#fffef7;color:#38583f}
body.playing-mode #game #hand-toolbar>#timer{flex:1.2;display:flex;gap:3px;border:0;background:none;color:#886c34}
body.playing-mode #game #timer b{font:600 18px/1 Arial,sans-serif}
body.playing-mode #game #timer small{font-size:9px}
body.playing-mode #game #hand-toolbar button:before{display:none}
body.playing-mode #voice-open svg{width:13px;height:13px}
body.playing-mode #game #hand-toolbar #waits-open{font-size:10px}
#leave-room-dialog{position:fixed;inset:66px 0 auto;width:min(408px,calc(100vw - 22px));max-height:calc(100dvh - 84px);margin:0 auto;padding:15px;background:#fffef7;color:#2b4c36;border:1px solid #cad6bc;border-radius:12px;box-shadow:0 10px 30px #1f40252b}
#leave-room-dialog::backdrop{background:#163c2b30}
#leave-room-dialog .dialog-head{margin:0 0 10px;align-items:center}
#leave-room-dialog h2{font:700 22px/1.2 Georgia,serif;margin:0}
#leave-room-dialog .dialog-head button{width:auto;min-height:32px;padding:4px 8px;font-size:11px;font-weight:400}
#leave-room-dialog p{font-size:12px;line-height:1.6;margin:0 0 12px;color:#758167}
#leave-room-dialog .leave-room-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#leave-room-dialog button{background:#fffef7;color:#32553c;border:1px solid #cbd5c0;border-radius:8px;min-height:38px;font-size:12px}
#leave-room-dialog #leave-room-confirm{background:#965a46;border-color:#965a46;color:#fff8eb}
body.playing-mode :is(#player-detail-dialog,#waits-dialog,#choice-dialog,#lobby-profile-dialog.game-profile,#claim-panel){position:fixed;inset:8px 0 auto;z-index:30;width:min(416px,calc(100vw - 22px));margin:0 auto;padding:13px;background:#fffef7;color:#2b4c36;border:1px solid #c9d6ba;border-radius:12px;box-shadow:0 10px 30px #153c2b40;overflow:auto;overscroll-behavior:contain}
body.playing-mode :is(#player-detail-dialog,#waits-dialog,#lobby-profile-dialog) .dialog-head{display:flex;gap:8px;align-items:center;margin:0 0 10px}
body.playing-mode :is(#player-detail-dialog,#waits-dialog,#lobby-profile-dialog) .dialog-head h2{flex:1;font:700 22px/1.2 Georgia,serif;margin:0}
body.playing-mode :is(#player-detail-dialog,#waits-dialog,#lobby-profile-dialog) button{min-height:34px;width:auto;padding:5px 8px;font-size:11px;border:1px solid #cbd5c0;background:#fffef7;color:#34583e;border-radius:7px}
.player-detail-identity{display:flex;align-items:center;gap:9px}.player-avatar{display:grid;place-items:center;flex:none;width:38px;height:42px;border-radius:9px;background:#2c6047;color:#fff6db;font:24px Georgia,serif}.player-detail-identity>div{flex:1;min-width:0}.player-detail-identity h3{display:flex;align-items:center;font:700 19px Georgia,serif;margin:0 0 3px}.player-tier{display:flex;gap:4px;align-items:center;font-size:10px;color:#79866c}.player-tier .tier-medal{width:20px;height:20px}
#player-detail-dialog .player-detail-meta{margin:8px 0;padding:5px 8px;background:#f0f3e8;border-radius:6px;font-size:11px;color:#75846a}
#player-detail-dialog h3{font-size:12px;margin:7px 0}
.detail-discards{display:flex;flex-wrap:wrap;gap:3px;max-height:95px;overflow:auto}.detail-discards .discard-entry{width:auto;height:auto}.detail-discards .tile,#player-detail-dialog .player-open-tiles .tile{width:24px;height:33px;margin:0;padding:0;min-height:0;min-width:0}.detail-discards .claimed{opacity:.4}
#player-detail-dialog .detail-open{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:10px;overflow:visible;margin:5px 0 10px}
#player-detail-dialog .river-melds,#player-detail-dialog .river-bonus{display:flex;flex-wrap:wrap;gap:2px;align-content:flex-start;min-width:0;max-height:130px;overflow:auto}
#player-detail-dialog .detail-open h3{flex-basis:100%;margin:3px 0 5px}#player-detail-dialog .public-meld{display:flex;gap:1px}#player-detail-dialog .detail-mute{width:100%}
#waits-dialog .tile{width:35px;height:48px;margin:2px}#waits-dialog p{font-size:11px;margin:0 0 8px}
body.playing-mode #claim-panel[open]{display:flex;flex-direction:column;gap:8px;height:auto;max-height:50dvh;min-height:0}
body.playing-mode #claim-panel .claim-panel-head{display:flex;align-items:center;justify-content:space-between;height:auto;min-height:24px;gap:8px}
body.playing-mode #claim-heading{font:700 22px/1.2 Georgia,serif}
body.playing-mode #claim-panel .claim-discard{display:flex;align-items:center;gap:10px;min-height:38px;height:auto}
body.playing-mode #claim-incoming .tile{width:28px;height:39px;margin:0}
body.playing-mode #claim-panel .claim-discard p{font-size:10px;margin:0;line-height:1.4}
body.playing-mode #claim-tile-name{font-size:12px}
body.playing-mode #claim-panel .claim-discard p:last-child{display:none}
body.playing-mode #claim-panel #claim-hint{display:block;position:static;clip:auto;width:auto;height:auto;margin:0;padding:0;font-size:10px;line-height:1.4}
body.playing-mode #claim-panel #claim-types{display:flex;gap:5px;flex:none}
body.playing-mode #claim-panel #claim-types button{flex:1;min-height:36px;height:36px;font-size:11px}
body.playing-mode #claim-panel #claim-combinations{display:flex;flex-direction:column;gap:5px;min-height:0;overflow:visible}
body.playing-mode #claim-panel .claim-combination{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;height:47px;min-height:47px;padding:4px 9px;border:1px solid #cbd5c0;background:#f5f6ec;color:#456044;border-radius:8px}
body.playing-mode #claim-panel .combination-label{position:static;display:block;font-size:11px;width:auto;height:auto;clip:auto}
body.playing-mode #claim-panel .combination-tiles{display:flex;gap:3px;flex:none}
body.playing-mode #claim-panel .combination-tiles .tile{width:25px;height:35px;margin:0}
body.playing-mode #claim-panel .incoming-tile{outline:2px solid #b99a43;outline-offset:-1px}
body.playing-mode #claim-panel .claim-combination[aria-pressed=true]{border-color:#5b8052;box-shadow:inset 0 0 0 1px #5b8052;background:#e9f0df}
body.playing-mode #claim-panel.choosing-chi :is(.claim-discard,#claim-types){display:none}
body.playing-mode #chi-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
body.playing-mode #chi-confirm-actions button{min-height:36px;font-size:12px}
#lobby-profile-dialog #lobby-profile-name{display:flex;align-items:center;gap:8px;font:700 22px/1.2 Georgia,serif;margin:8px 0}
#lobby-profile-dialog #lobby-profile-kind{font-size:11px;color:#7c876f;margin:0 0 9px}
#lobby-profile-dialog #lobby-profile-id{display:flex;align-items:center;justify-content:space-between;background:#f0f3e9;border-radius:7px;padding:6px 9px;font-size:12px;margin:0 0 9px}
#lobby-profile-dialog #lobby-profile-id:empty{display:none}
#lobby-profile-dialog #player-copy-id{min-width:34px;min-height:34px;display:grid;place-items:center;border:0;background:transparent;padding:6px}
#player-public-rank:not(:empty){border:1px solid #dfd7b7;background:#faf6e8;border-radius:10px;padding:12px;margin:10px 0;color:#796537}
.public-rank-main{display:flex;align-items:center;gap:12px}.public-rank-main>div{display:grid;gap:5px}.public-rank-main small{font-size:9px;letter-spacing:1px}.public-rank-main strong{font:700 24px Georgia,serif}.public-rank-main span{font-size:11px}
#player-public-rank .public-rank-season{font-size:10px;margin:10px 0 0;padding-top:8px;border-top:1px solid #e2dcc4;line-height:1.4}
.public-rank-peak{display:flex;align-items:center;gap:7px;padding-top:10px;margin-top:9px;border-top:1px solid #e2dcc4}.public-rank-peak>div{display:grid;gap:3px;font-size:11px}.public-rank-peak>div:last-child{margin-left:auto;text-align:right}.public-rank-peak strong{font:700 21px Georgia,serif}.public-rank-peak small{font-size:10px;color:#8c876d}
html[data-tile-size=large] body.playing-mode #game #hand{grid-template-columns:repeat(6,minmax(0,1fr))}
html[data-tile-size=large] body.playing-mode #room #game{--hand-tile-height:clamp(44px,calc((100vw - 40px)/6 * 1.35),83px)}
html[data-high-contrast=on] body.playing-mode #game #discards .river-row.active{outline:2px solid #ffe88f;outline-offset:-2px}
html[data-high-contrast=on] body.playing-mode #game #discards .river-tiles .discard-entry.latest .tile{outline:3px solid #b55b00}
@media(max-width:360px){body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .brand{font-size:18px;gap:4px}body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header .logo{width:27px;height:36px}body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header :is(#friends-main,#friends-lobby,#account-welcome,#rules-open){font-size:11px;padding:6px 7px}body.playing-mode .shell.page{padding-left:8px;padding-right:8px}body.playing-mode #game .game-stats{font-size:9px}body.playing-mode #game .river-name{font-size:11px}}
@media(max-height:640px){body.playing-mode #room #game,body.playing-mode #room #game:not(:has(#hand .tile:nth-child(8))){grid-template-rows:22px minmax(120px,1fr) 34px calc(var(--hand-tile-height)*var(--hand-rows) + (var(--hand-rows) - 1)*4px) 36px 12px 34px;gap:3px;--hand-tile-height:clamp(43px,calc((100vw - 44px)/7 * 1.3),62px)}body.playing-mode #game #actions button{height:36px;min-height:36px}body.playing-mode #game #turn-status{height:34px}body.playing-mode #game #hand-toolbar{height:34px}body.playing-mode #game #hand-toolbar>button,body.playing-mode #game #hand-toolbar>#timer{height:30px;min-height:30px}body.playing-mode #game .river-public .tile{width:16px;height:22px;min-width:16px;min-height:22px}html[data-tile-size=large] body.playing-mode #room #game{--hand-tile-height:49px}}
@media(orientation:landscape) and (max-height:500px){body.playing-mode .shell.page{max-width:920px;padding:5px 8px;gap:3px}body.playing-mode #room #game,body.playing-mode #room #game:not(:has(#hand .tile:nth-child(8))){grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:22px 34px minmax(0,1fr) 36px 14px 32px;gap:3px 8px;--hand-tile-height:clamp(40px,12dvh,55px)}body.playing-mode #game .game-stats{grid-column:1/-1;grid-row:1}body.playing-mode #game>.table.river-table{grid-column:1;grid-row:2/7}body.playing-mode #game #turn-status{grid-column:2;grid-row:2}body.playing-mode #game #hand{grid-column:2;grid-row:3}body.playing-mode #game #actions{grid-column:2;grid-row:4}body.playing-mode #game #hand-help{grid-column:2;grid-row:5}body.playing-mode #game #hand-toolbar{grid-column:2;grid-row:6}html[data-tile-size=large] body.playing-mode #game #hand{grid-template-columns:repeat(7,minmax(0,1fr))}html[data-tile-size=large] body.playing-mode #room #game{--hand-tile-height:clamp(40px,12dvh,55px)}}

body.playing-mode #game #discards .river-owner{grid-column:1;grid-row:1}
body.playing-mode #game #discards .river-tiles{grid-column:1;grid-row:2;align-self:stretch}
body.playing-mode #game #discards .river-public{grid-column:1;grid-row:3}
body.playing-mode #game #discards .river-melds{flex-direction:row}

body.playing-mode #game #discards .ready-hand-badge:not([hidden]){display:inline-block;color:#304c33;font-size:10px}
body.playing-mode #game #hand-toolbar #voice-open::before{display:inline-block;width:13px;height:14px;margin-right:3px}
@media(orientation:landscape) and (max-height:500px){body.playing-mode #game #hand-toolbar{height:32px}}

body.playing-mode :is(#player-detail-dialog,#waits-dialog,#choice-dialog,#lobby-profile-dialog.game-profile,#claim-panel){transform:none}

#player-detail-dialog .detail-open>.river-melds,#player-detail-dialog .detail-open>.river-bonus{grid-column:auto;grid-row:auto;align-self:start;flex-direction:row}
#player-detail-dialog .detail-open{grid-auto-flow:row}
#player-detail-dialog .player-detail-identity h3{font:700 19px/1.2 Georgia,serif}
#lobby-profile-dialog #lobby-profile-id{letter-spacing:0;font-size:12px;line-height:1.4}
#lobby-profile-dialog #lobby-profile-name .player-avatar{width:42px;height:46px}
#lobby-profile-dialog #player-public-rank .public-rank-main strong{font-size:22px}
body.playing-mode #game #hand-toolbar #voice-open::before{width:15px;height:16px}
body.playing-mode #game #hand-toolbar:has(#waits-open:not([hidden]))>button{font-size:10px}
body:is(.home-mode,.lobby-mode,.playing-mode) #audio-dialog #fullscreen-toggle{display:flex!important;align-items:center;justify-content:center;gap:7px;width:auto;height:40px;min-height:40px;padding:6px 10px;font-size:12px}

body.playing-mode #game #discards .voice-activity:not([hidden]){display:inline-block;font-size:11px;flex:none}
body.playing-mode #lobby-profile-dialog.game-profile #lobby-profile-id{font-size:12px;letter-spacing:0}

/* 0.8.101: controls above the hand and centered action/player panels. */
body.playing-mode #room #game,body.playing-mode #room #game:not(:has(#hand .tile:nth-child(8))){grid-template-rows:24px minmax(140px,1fr) 38px 38px calc(var(--hand-tile-height)*var(--hand-rows) + (var(--hand-rows) - 1)*4px) 40px 14px}
body.playing-mode #game #hand-toolbar{grid-row:4;border-top:0;border-bottom:1px solid #dce2cf}
body.playing-mode #game #hand{grid-row:5}
body.playing-mode #game #actions{grid-row:6}
body.playing-mode #game #hand-help{grid-row:7}
body.playing-mode :is(#player-detail-dialog,#waits-dialog,#choice-dialog,#lobby-profile-dialog.game-profile,#claim-panel){inset:50% auto auto 50%;transform:translate(-50%,-50%);max-height:calc(var(--visual-height,100dvh) - 24px)}
#chat-messages .chat-system,body.lobby-mode #lobby-chat-messages .chat-system{display:flex;align-items:baseline;gap:8px;padding:5px 0;margin:0;border:0;background:transparent;box-shadow:none;color:#7c886f}
#chat-messages .chat-system time,body.lobby-mode #lobby-chat-messages .chat-system time{flex:none;font-size:9px;font-variant-numeric:tabular-nums;color:#929a83}
#chat-messages .chat-system p,body.lobby-mode #lobby-chat-messages .chat-system p{font-size:11px;line-height:1.45;color:#7c886f;margin:0;padding:0;background:transparent;border:0}
/* Compact player heading: identity, wind/score and presence share one row. */
#notice,#host-change-notice,#lobby-presence-notice{display:none!important}
.entry-error{grid-column:1/-1;margin:5px 0 0;color:#965a46;font-size:12px;line-height:1.4}
body.playing-mode #game #discards .river-row{grid-template-rows:18px minmax(0,1fr) auto;cursor:pointer}
body.playing-mode #game #discards .river-owner{flex-direction:row;align-items:center;justify-content:flex-start;gap:4px;height:18px;min-height:18px;overflow:hidden}
body.playing-mode #game .river-identity{flex:0 1 auto;gap:2px;overflow:hidden}
body.playing-mode #game .river-name{min-width:0;flex:0 1 auto}
body.playing-mode #game .river-score{flex:none;font-size:9px;line-height:14px}
body.playing-mode #game #discards .ready-hand-badge:not([hidden]){margin-left:1px;padding:0 2px;font-size:9px;line-height:15px}
body.playing-mode #game .river-owner .player-presence{display:block;flex:0 0 auto;margin-left:auto;max-width:44px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;font-size:8px;line-height:14px}
body.playing-mode #game .river-owner .player-presence[data-disconnected=true],body.playing-mode #game .river-owner .player-presence[data-takeover=true]{max-width:32px}
body.playing-mode #game #discards .river-tiles{container-type:size;scrollbar-width:none}
body.playing-mode #game #discards .river-tiles::-webkit-scrollbar{display:none}
body.playing-mode #game #discards .river-tiles .discard-entry{width:min(calc((100% - 10px)/6),calc((100cqh - 2px)*.365))}
body.playing-mode #game #discards .river-tiles .discard-entry .tile{min-width:0}
/* Share the home navigation's exact appearance in every screen. */
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header :is(#friends-main,#friends-lobby,#account-welcome,#rules-open){display:inline-flex;align-items:center;justify-content:center;flex:none;width:auto;min-width:44px;height:44px;min-height:44px;max-height:44px;margin:0;padding:7px 9px;border:1px solid #cbd5c0;border-radius:9px;background:#fffef7;color:#284e3a;font:600 12px/1.4 Arial,sans-serif;box-shadow:0 1px 2px #213e3310;white-space:nowrap}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header #rules-open{width:44px;padding:7px}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header #rules-open svg{width:16px;height:16px;stroke-width:2}
#friends-dialog,#audio-dialog{font-family:system-ui,'Segoe UI',Arial,sans-serif}
body.playing-mode #game #discards .river-row,body.playing-mode #game #discards .river-row *{-webkit-tap-highlight-color:transparent}
body.playing-mode #game #discards :is(.river-row,.river-owner,.river-tiles):focus:not(:focus-visible){outline:none}
body.lobby-mode #lobby .lobby-code{gap:4px}
body.lobby-mode #lobby .lobby-code #lobby-privacy{align-self:flex-end;flex:none;margin-bottom:2px;padding:2px 5px;border:1px solid #cbd7c0;border-radius:12px;background:#edf2e5;color:#52704c;font:400 9px/14px Arial,sans-serif;white-space:nowrap}
@media(max-width:700px){
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header :is(#friends-main,#friends-lobby,#account-welcome,#rules-open){width:auto;min-width:0;height:36px;min-height:36px;max-height:36px;padding:0 9px;font:400 12px Arial,sans-serif}
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header #rules-open{width:34px;min-width:34px;padding:0;font:600 12px/1.4 Arial,sans-serif}
}
@media(max-width:360px){
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header :is(#friends-main,#friends-lobby,#account-welcome,#rules-open){padding:0 7px;font-size:11px}
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header #rules-open{padding:0}
 body.lobby-mode #lobby .lobby-code{gap:2px}
 body.lobby-mode #lobby #lobby-copy-code{min-width:24px;width:24px;padding:3px}
 body.lobby-mode #lobby .lobby-code #lobby-privacy{padding:2px 4px;font-size:8px}
}
/* One page frame and header across home, lobby and play. */
body:is(.home-mode,.lobby-mode,.playing-mode){background:#f1f2ea}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page{--frame-width:1120px;--frame-padding:28px;--frame-gap:12px;width:100%;max-width:var(--frame-width);margin:0 auto;padding:var(--frame-padding);gap:var(--frame-gap);background:#f1f2ea;border:0;box-shadow:none}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:5px;height:44px;min-height:44px;flex:none;margin:0;padding:0;background:transparent;border:0;font:400 12px/1.4 Arial,sans-serif;letter-spacing:0}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header .brand{display:flex;flex:1 1 auto;align-items:center;gap:6px;min-width:0;margin:0 auto 0 0;font:700 21px Georgia,serif;color:#234637;letter-spacing:0}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header .home-tools{display:flex;align-items:center;gap:5px;flex:none;order:3}
body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header .logo{font:inherit}
body.lobby-mode .shell.page:has(#room:not([hidden])) main{width:100%;max-width:760px;margin:0 auto}
body.playing-mode .shell.page:has(#room:not([hidden])) main{width:100%;max-width:440px;margin:0 auto}
body.lobby-mode #lobby .lobby-action-bar{grid-template-columns:repeat(2,minmax(0,1fr))}
body.lobby-mode #lobby .lobby-action-bar button{width:100%;min-width:0}
body.lobby-mode #lobby .lobby-code{gap:5px}
body.lobby-mode #lobby .lobby-code #lobby-privacy{align-self:center;margin:0;padding:3px 6px;font:400 10px/16px Arial,sans-serif}
body.lobby-mode #lobby .lobby-code strong{font-size:16px;letter-spacing:1.5px}
@media(max-width:700px){body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page{--frame-width:520px;--frame-padding:10px;--frame-gap:8px}}
@media(max-width:360px){
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page{--frame-padding:9px}
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page header.shared-header .brand{font-size:18px;gap:4px}
 body.lobby-mode #lobby .lobby-code{gap:3px}
 body.lobby-mode #lobby .lobby-code #lobby-privacy{padding:3px 5px;font-size:9px}
 body.lobby-mode #lobby .lobby-code strong{font-size:15px;letter-spacing:1px}
}
@media(orientation:landscape) and (max-height:500px){body.playing-mode .shell.page:has(#room:not([hidden])) main{max-width:904px}}
@media(max-height:700px){
 body.lobby-mode #lobby .lobby-chat{padding:3px 8px}
 body.lobby-mode .lobby-chat-heading,body.lobby-mode #lobby-voice-controls #voice-open,body.lobby-mode #lobby-chat-toggle{height:28px;min-height:28px}
 body.lobby-mode .lobby-chat-heading h2{font-size:19px}
 body.lobby-mode #lobby-chat-input,body.lobby-mode #lobby-chat-send{height:34px;min-height:34px;padding:5px 8px}
}
@media(max-height:640px){body.playing-mode #room #game,body.playing-mode #room #game:not(:has(#hand .tile:nth-child(8))){grid-template-rows:22px minmax(120px,1fr) 34px 34px calc(var(--hand-tile-height)*var(--hand-rows) + (var(--hand-rows) - 1)*4px) 36px 12px}}
@media(orientation:landscape) and (max-height:500px){body.playing-mode #room #game,body.playing-mode #room #game:not(:has(#hand .tile:nth-child(8))){grid-template-rows:22px 34px 32px minmax(0,1fr) 36px 14px}body.playing-mode #game #hand-toolbar{grid-column:2;grid-row:3}body.playing-mode #game #hand{grid-column:2;grid-row:4}body.playing-mode #game #actions{grid-column:2;grid-row:5}body.playing-mode #game #hand-help{grid-column:2;grid-row:6}}

/* Compact directory controls, optional host-owned table title and clearer small text. */
body.home-mode .shell.page #welcome .directory-head{flex-wrap:nowrap;gap:6px}
body.home-mode .shell.page #welcome .directory-head h2{white-space:nowrap;min-width:0}
body.home-mode .shell.page #welcome .directory-actions{align-items:center;flex:none;gap:5px}
body.home-mode .shell.page #welcome .directory-actions .pagination{margin:0;gap:4px;min-height:30px;white-space:nowrap}
body.home-mode .shell.page #welcome .directory-actions button{justify-content:center;width:30px;min-width:30px;height:32px;min-height:32px;padding:5px}
body.home-mode .shell.page #welcome .directory-actions .pagination button{width:25px;min-width:25px;font-size:18px;padding:2px}
body.home-mode .shell.page #welcome .directory-actions #rooms-page{min-width:29px;text-align:center;font-size:10px}
body.home-mode .shell.page #welcome .directory-filter-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body.home-mode .shell.page #welcome #directory-filter-open[aria-pressed=true]{background:#e0ebd7;border-color:#79936b;box-shadow:inset 0 0 0 1px #79936b}
body.lobby-mode .room-bar .lobby-title-row{display:flex;align-items:center;gap:6px;min-width:0;margin-bottom:4px}
body.lobby-mode .room-bar .lobby-title-row h1{flex:0 1 auto;min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.lobby-mode .room-bar #room-name-open{display:inline-flex;align-items:center;justify-content:center;flex:none;width:27px;min-width:27px;height:27px;min-height:27px;padding:5px;border:1px solid #ffffff38;border-radius:7px;background:#ffffff0c;color:#f3efd9}
body.lobby-mode .room-bar #room-name-open[hidden]{display:none}
#room-name-open svg{width:16px;height:16px}
#room-name-dialog{width:min(380px,calc(100vw - 24px));max-height:calc(var(--visual-height,100dvh) - 24px);overflow:auto;padding:18px;color:#244c38;background:#fffdf4;border-radius:16px}
#room-name-dialog .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px}
#room-name-dialog .dialog-head h2{font:700 25px/1.2 Georgia,serif}
#room-name-dialog .dialog-head button{width:auto;min-height:40px;font-size:12px}
#room-name-form{display:grid;gap:10px}
.room-name-label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}
.room-name-label small,#room-name-count{font-size:11px;color:#69775e}
#room-name-input{width:100%;min-height:44px;font-size:16px;background:#fffef9;border:1px solid #b9c9ad;border-radius:9px}
#room-name-input[aria-invalid=true]{border-color:#a55a40}
#room-name-note,#room-name-status{margin:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere;color:#68765e}
#room-name-status:empty{display:none}#room-name-status{color:#97543f}
#room-name-save{width:100%;min-height:44px;border-radius:9px;background:#245d43;color:#fffdf0}
body.lobby-mode .seat-ready{font-size:11px}
body.lobby-mode #lobby #lobby-help{font-size:11px;line-height:14px}
#chat-messages .chat-message time,body.lobby-mode #lobby-chat-messages .chat-message time{font-size:11px;color:#68775f}
#chat-messages .chat-system p,body.lobby-mode #lobby-chat-messages .chat-system p{color:#5d7053}
body.playing-mode #game #discards .river-owner{gap:6px}
body.playing-mode #game .river-score{padding-left:6px;border-left:1px solid #e7edce40}
@media(max-width:360px){
 body.home-mode .shell.page #welcome .directory-head h2{font-size:19px}
 body.home-mode .shell.page #welcome .directory-actions{gap:3px}
 body.home-mode .shell.page #welcome .directory-actions .pagination{gap:2px}
 body.home-mode .shell.page #welcome .directory-actions button{width:28px;min-width:28px}
 body.home-mode .shell.page #welcome .directory-actions .pagination button{width:23px;min-width:23px}
 body.playing-mode #game #discards .river-owner{gap:4px}
 body.playing-mode #game .river-score{padding-left:4px}
}

body.lobby-mode #room .room-bar #room-name-open{box-sizing:border-box;line-height:1;height:23px;min-height:23px;max-height:23px;width:25px;min-width:25px;padding:4px}
@media(max-height:760px){body.lobby-mode .room-bar .lobby-title-row{margin-bottom:3px}}
@media(max-height:620px){
 body.lobby-mode .room-bar .lobby-title-row{margin-bottom:2px}
 body.lobby-mode #room .room-bar #room-name-open{height:21px;min-height:21px;max-height:21px}
 body.lobby-mode #lobby #lobby-help{line-height:12px}
}
/* Compact result sheets. Dedicated selectors keep legacy saved-result styling isolated. */
#result-dialog.rs-dialog{width:min(440px,calc(100vw - 16px));height:auto;max-height:calc(var(--visual-height,100dvh) - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));padding:16px;border:1px solid #cdd3b8;border-radius:18px;background:#fffdf2;color:#204a39;overflow:hidden;box-sizing:border-box}
#result-dialog.rs-dialog[open]{display:flex;flex-direction:column;gap:0}
#result-dialog.rs-dialog>.dialog-head{height:auto;min-height:32px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 4px}
#result-dialog.rs-dialog>.dialog-head h2{font:700 26px/1.15 Georgia,serif;margin:0}
#result-dialog.rs-dialog>.dialog-head button{width:32px;height:32px;min-height:32px;border:0;box-shadow:none;background:transparent;font:22px/1 system-ui;padding:0;color:#204a39}
#result.rs-view{display:flex;flex-direction:column;gap:0;min-height:0;overflow:hidden;font:13px/1.4 system-ui}
.rs-body{min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:9px;padding:0 1px 9px;scrollbar-width:thin}
.rs-body>*{flex-shrink:0;min-width:0}
#result.rs-view p{margin:0;font-size:12px;line-height:1.45}
#result.rs-view .rs-context{color:#74816b;font-size:12px;overflow-wrap:anywhere}
.rs-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;background:linear-gradient(115deg,#174d39,#2c634b);border-radius:12px;padding:12px;color:#fff9df}
.rs-hero-caption{display:grid;gap:3px;min-width:0;flex:1}
.rs-hero-caption>small{font-size:10px;letter-spacing:1.2px}
.rs-hero-name{font:700 27px/1.13 Georgia,serif;overflow-wrap:anywhere}
.rs-hero-note{font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.rs-hero-value{display:grid;justify-items:end;gap:1px;max-width:50%;text-align:right}
.rs-hero-value>strong{font:700 29px/1.1 Georgia,serif;overflow-wrap:anywhere}
.rs-hero-value>small{font-size:10px}
.rs-tabs{display:flex;gap:18px;border-bottom:1px solid #d7dec8}
.rs-tabs button{padding:6px 0 9px;min-height:40px;background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;box-shadow:none;color:#6a7862;font:inherit}
.rs-tabs button[aria-selected=true]{border-color:#285e44;font-weight:700;color:#285e44}
.rs-panels [hidden]{display:none}
#result .rs-scores{width:100%;table-layout:fixed;border-collapse:collapse;font-size:12px;line-height:1.4;color:#204a39}
#result .rs-scores th,#result .rs-scores td{padding:8px 6px;border-bottom:1px solid #e1e5d5;text-align:right;font-variant-numeric:tabular-nums}
#result .rs-scores th:first-child{width:47%;text-align:left;font-weight:500;overflow-wrap:anywhere}
#result .rs-scores th:last-child{width:27%}
#result .rs-scores thead th{padding-top:0;font-size:11px;color:#74816b;font-weight:400}
#result .rs-scores td{font-weight:600;overflow-wrap:anywhere}
.rs-own{background:#ecf2df}
.rs-position{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:#e9eddf;min-width:22px;height:22px;margin-right:7px;font-size:11px}
#result .rs-scores tr:first-child .rs-position{background:#efe2b8;color:#796324}
.rs-you{margin-left:4px;font-size:10px;font-weight:400;color:#74816b}
.rs-negative{color:#a3553d}
.rs-muted{color:#74816b;font-size:12px;line-height:1.45;overflow-wrap:anywhere}
.rs-panels .rs-muted{margin-top:8px!important}
.rs-last{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px}
.rs-last>div{min-width:0;display:grid;gap:3px}
.rs-last>strong{flex-shrink:0}
.rs-section-label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px}
.rs-section-label small{font-size:10px;text-align:right}
.rs-tiles{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;padding:8px;background:#edf1e1;border:1px solid #d4dec5;border-radius:9px}
.rs-tiles .tile{display:block;width:100%;height:auto;aspect-ratio:40/56;min-width:0;margin:0;padding:1px;border-bottom-width:3px;border-radius:4px;box-sizing:border-box}
.rs-tiles .tile svg,.rs-meld-tiles .tile svg,.rs-flower-tiles .tile svg{display:block;width:100%;height:100%}
.tile.rs-winning{outline:2px solid #ba9939;outline-offset:-1px}
.rs-hand-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.rs-flowers{display:flex;align-items:center;gap:6px;min-width:0}
.rs-flower-tiles,.rs-meld-tiles{display:flex;flex-wrap:wrap;gap:4px}
.rs-flower-tiles .tile{width:23px;height:32px;margin:0;border-bottom-width:2px;border-radius:3px;padding:0}
.rs-hand-value{margin-left:auto;font-size:12px}
.rs-hand-value strong{font-size:17px}
.rs-footer{flex-shrink:0;display:grid;gap:10px;padding-top:1px;background:#fffdf2}
.rs-tools{display:flex;gap:5px}
#result .rs-tools button{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:5px;margin:0;padding:6px 4px;min-height:42px;border:1px solid #c7d3b9;border-radius:9px;box-shadow:none;background:#fffef7;color:#204a39;font:12px/1.2 system-ui}
.rs-tools svg{width:17px;height:17px;flex:none}
#result .rs-readiness{color:#74816b;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.rs-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#result .rs-actions button{min-width:0;min-height:46px;height:auto;margin:0;padding:8px 7px;border:1px solid #c7d3b9;border-radius:10px;box-shadow:none;background:#fffef7;color:#204a39;font:600 13px/1.3 system-ui;overflow-wrap:anywhere}
#result .rs-actions .primary{background:#255d45;color:#fffbed;border-color:#255d45}
#result .rs-actions button:disabled{opacity:.55}
.rs-history .round-score-title{display:none}
.rs-history .result-scores th:first-child{width:28%}
.rs-history .result-scores th,.rs-history .result-scores td{padding:9px 3px;font-size:11px;line-height:1.3}
.rs-history select,.rs-detail-dialog select{width:100%;min-height:40px;padding:6px 8px;font-size:13px;background:#fffef7;border:1px solid #c7d3b9;border-radius:8px;color:#204a39;margin:4px 0 10px}
.rs-field{display:block;font-size:12px;color:#74816b}
.rs-rating{display:flex;align-items:center;flex-wrap:wrap;gap:9px;border:1px solid #ded3a8;background:linear-gradient(110deg,#f5efdc,#fff9ec);padding:10px;border-radius:11px;min-width:0}
.rs-rating .tier-medal{width:42px;height:48px;flex:none;object-fit:contain}
.rs-rating-text{display:grid;gap:1px;flex:1;min-width:65px}
.rs-rating-text>strong{font-size:16px}
.rs-rating-text>small{font-size:9px}
.rs-rating-text>span{font-size:10px}
.rs-rating-points{display:grid;gap:3px;text-align:right;font-variant-numeric:tabular-nums;max-width:60%;overflow-wrap:anywhere}
.rs-rating-points strong{font:700 20px/1.2 Georgia,serif;color:#806a2d}
.rs-rating-points span{font-size:11px;color:#7a7156}
.rs-rating-note,.rs-rating-pending p,.rs-rating-void p,.rs-rating-round p{flex-basis:100%}
dialog.rs-detail-dialog,#result-share-dialog{position:fixed;inset:auto;left:50%;top:calc(var(--visual-top,0px) + var(--visual-height,100dvh)/2);transform:translate(-50%,-50%);margin:0;width:min(440px,calc(100vw - 20px));max-height:calc(var(--visual-height,100dvh) - 24px);padding:16px;border:1px solid #cdd3b8;border-radius:16px;background:#fffdf2;color:#204a39;overflow:auto;font:13px/1.5 system-ui;box-sizing:border-box}
dialog.rs-detail-dialog .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 12px}
dialog.rs-detail-dialog h2{font:700 23px/1.15 Georgia,serif;margin:0}
dialog.rs-detail-dialog .dialog-head button{width:auto;min-height:40px;padding:5px 10px;font-size:12px;flex:none}
dialog.rs-detail-dialog h3{margin:12px 0 6px;font-size:13px}
dialog.rs-detail-dialog p{font-size:12px;line-height:1.5;margin:8px 0}
dialog.rs-detail-dialog .rs-meld-tiles .tile{width:35px;height:49px;margin:0;border-bottom-width:3px}
.rs-calculation{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px;margin:0;font-size:12px}
.rs-calculation dt{overflow-wrap:anywhere}
.rs-calculation dd{margin:0;text-align:right;font-weight:600}
dialog.rs-detail-dialog #result-explanation{padding:0;background:none;border:0;font-size:12px}
dialog.rs-detail-dialog #result-payments{width:100%;border-collapse:collapse;font-size:11px;table-layout:fixed}
dialog.rs-detail-dialog #result-payments th,dialog.rs-detail-dialog #result-payments td{padding:5px 3px;overflow-wrap:anywhere}
dialog.rs-detail-dialog .special-pattern-tiles{display:flex;flex-wrap:wrap;gap:4px}
dialog.rs-detail-dialog .special-pattern-tiles .tile{width:28px;height:39px;margin:0}
dialog.rs-detail-dialog .ranked-result{margin:0}
@media(max-width:350px){
 #result-dialog.rs-dialog{padding:12px;border-radius:14px}
 #result-dialog.rs-dialog>.dialog-head h2{font-size:23px}
 .rs-body{gap:9px}
 .rs-hero{padding:11px;gap:8px}
 .rs-hero-name{font-size:23px}
 .rs-hero-value>strong{font-size:25px}
 #result .rs-scores th,#result .rs-scores td{padding:8px 4px}
 .rs-position{margin-right:4px;min-width:18px;height:18px}
 .rs-you{display:block;margin-left:0}
 .rs-tiles{padding:6px;gap:4px}
 .rs-rating{gap:6px;padding:8px}
 .rs-rating .tier-medal{width:32px;height:40px}
 .rs-rating-points strong{font-size:18px}
}
@media(max-height:650px){
 #result-dialog.rs-dialog{padding:10px}
 .rs-body{gap:7px;padding-bottom:7px}
 .rs-hero{padding:10px}
 .rs-hero-name{font-size:23px}
 .rs-hero-value>strong{font-size:25px}
 #result .rs-scores th,#result .rs-scores td{padding:6px 4px}
 .rs-footer{gap:6px}
 #result .rs-tools button{min-height:38px}
 #result .rs-actions button{min-height:42px}
}

#result #final-standings{margin:0}#result #final-standings th:first-child{width:65%}#result #final-standings td:last-child{white-space:normal}

@media(min-height:651px) and (max-height:800px){.rs-tiles{gap:4px;padding:6px;max-width:320px;width:100%;align-self:center}.rs-body{gap:8px}}
@media(max-height:650px){.rs-you{display:inline;margin-left:3px}#result-dialog.rs-dialog>.dialog-head h2{font-size:23px}.rs-body{gap:6px}.rs-hero{padding:8px}.rs-hero-name{font-size:22px}.rs-hero-caption>small{font-size:9px}.rs-hero-note{font-size:10px}.rs-rating{padding:6px}.rs-last{font-size:11px}.rs-panels .rs-muted{font-size:10px!important}#result .rs-scores th,#result .rs-scores td{padding:5px 4px}}
/* Round results use the available viewport; only the separate details dialog scrolls. */
#result-dialog.rs-round-dialog{height:min(620px,calc(var(--visual-height,100dvh) - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));padding:12px}
#result-dialog.rs-round-dialog>.dialog-head h2{font-size:23px}
#result-dialog.rs-round-dialog>.dialog-head{margin-bottom:8px}
#result.rs-view[data-final=false]{flex:1;gap:8px}
#result[data-final=false] .rs-body{flex:1;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;padding:0;overflow:visible}
#result[data-final=false] .rs-hero{padding:9px 11px;min-height:0;gap:8px}
#result[data-final=false] .rs-hero-caption>small{display:none}
#result[data-final=false] .rs-ranked-round .rs-hero-caption>small{display:block;font-size:9px;line-height:1.1}
#result[data-final=false] .rs-hero-name{font-size:23px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#result[data-final=false] .rs-hero-note{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px}
#result[data-final=false] .rs-hero-value>strong{font-size:26px}
.rs-round-hand{display:grid;grid-template-rows:auto minmax(0,1fr);gap:5px;min-height:0}
.rs-round-hand:has(.rs-flowers){grid-template-rows:auto minmax(0,1fr) auto}
.rs-round-hand .rs-section-label{font-size:12px;line-height:1.3;min-width:0}
.rs-round-hand .rs-hand-value{font-size:11px;white-space:nowrap}
.rs-round-hand .rs-hand-value strong{font-size:15px}
.rs-round-tiles{container-type:size;min-width:0;min-height:0}
.rs-round-tiles .rs-tiles{--rs-result-tile-height:min(68px,calc((100cqh - 16px)/2),calc((100cqw - 12px - (var(--rs-columns) - 1)*4px)/var(--rs-columns)*1.4));width:100%;max-width:none;height:100%;padding:6px;gap:4px;grid-template-columns:repeat(var(--rs-columns),calc(var(--rs-result-tile-height)/1.4));grid-template-rows:repeat(2,var(--rs-result-tile-height));justify-content:center;align-content:center}
.rs-round-tiles .rs-tiles .tile{width:100%;height:100%;aspect-ratio:auto;min-height:0}
.rs-round-hand .rs-flowers{gap:5px}
.rs-round-hand .rs-flower-tiles{flex-wrap:nowrap;gap:3px}
.rs-round-hand .rs-flower-tiles .tile{width:20px;height:28px}
#result[data-final=false] .rs-scores th,#result[data-final=false] .rs-scores td{padding:5px 4px;line-height:1.3}
#result[data-final=false] .rs-scores th:first-child{width:44%}
#result[data-final=false] .rs-scores th:last-child{width:28%}
#result[data-final=false] .rs-player-name{display:inline-block;max-width:100%;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#result[data-final=false] .rs-own .rs-player-name{max-width:calc(100% - 30px)}
#result[data-final=false] .rs-you{display:inline;white-space:nowrap;margin-left:3px}
#result[data-final=false] .rs-footer{gap:6px}
#result[data-final=false] .rs-round-draw{align-self:center;text-align:center;padding:12px}
@media(max-height:650px){
 #result-dialog.rs-round-dialog{padding:9px}
 #result-dialog.rs-round-dialog>.dialog-head{min-height:30px;margin-bottom:5px}
 #result-dialog.rs-round-dialog>.dialog-head h2{font-size:21px}
 #result[data-final=false],#result[data-final=false] .rs-body{gap:6px}
 #result[data-final=false] .rs-hero{padding:7px 9px}
 #result[data-final=false] .rs-hero-name{font-size:21px}
 #result[data-final=false] .rs-hero-value>strong{font-size:24px}
 #result[data-final=false] .rs-scores th,#result[data-final=false] .rs-scores td{padding:4px;line-height:1.25}
 #result[data-final=false] .rs-tools button{min-height:36px}
 #result[data-final=false] .rs-actions button{min-height:40px}
 .rs-round-hand .rs-section-label{font-size:11px}
 .rs-round-hand .rs-flower-tiles .tile{width:18px;height:25px}
}
@media(min-width:580px) and (max-height:500px){
 #result-dialog.rs-round-dialog{width:min(760px,calc(100vw - 16px))}
 #result[data-final=false] .rs-body{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:5px 14px}
 #result[data-final=false] .rs-body>.rs-hero{grid-column:2;grid-row:1}
 #result[data-final=false] .rs-body>.rs-scores{grid-column:2;grid-row:2;align-self:center}
 #result[data-final=false] .rs-round-hand,#result[data-final=false] .rs-round-draw{grid-column:1;grid-row:1/3}
 #result[data-final=false] .rs-footer{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);column-gap:14px;align-items:end}
 #result[data-final=false] .rs-tools{grid-column:1;grid-row:2}
 #result[data-final=false] .rs-readiness{grid-column:1/3;grid-row:1}
 #result[data-final=false] .rs-actions{grid-column:2;grid-row:2}
}

@media(min-height:501px){#result-dialog.rs-round-dialog:has(.rs-round-draw){height:auto}#result[data-final=false]:has(.rs-round-draw) .rs-body{grid-template-rows:auto auto auto}}
#result[data-final=false] .tile{min-width:0;min-height:0}

/* Claim names keep their Mandarin suffix readable on narrow screens. */
body.playing-mode #claim-panel #claim-types button{white-space:normal;line-height:1.2}

/* Shared Friends panel: compact rows, separate requests, and a stable close control. */
#friends-dialog{width:min(460px,calc(100vw - 20px));max-height:calc(var(--visual-height,100dvh) - 24px);padding:0;border:1px solid #d8ddce;border-radius:18px;background:#fffef6;color:#244638;overflow:hidden;box-shadow:0 18px 64px #123d3438}
#friends-dialog[open]{display:flex;flex-direction:column}
#friends-dialog>.dialog-head{position:static;flex:none;margin:0;padding:16px 18px 12px;background:transparent;border-bottom:1px solid #e7e9dd;gap:12px}
#friends-dialog>.dialog-head h2{font:700 28px Georgia,'Times New Roman',serif;letter-spacing:-.02em;color:#214837}
#friends-dialog button{min-height:40px;padding:7px 12px;border:1px solid #d2d8c8;border-radius:10px;background:#fffef7;color:#365641;font:500 13px/1.3 system-ui,'Segoe UI',sans-serif;box-shadow:none}
#friends-dialog button:hover:not(:disabled){background:#edf2e6}
#friends-dialog button:focus-visible,#friends-dialog input:focus-visible,#friends-dialog summary:focus-visible{outline:2px solid #28624a;outline-offset:2px}
#friends-dialog #friends-close{min-width:64px;min-height:40px;font-size:13px}
#friends-dialog .friends-body{padding:14px 18px 18px;overflow-y:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin}
#friends-dialog #friends-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}
#friends-dialog .friends-own-id{display:flex;align-items:center;gap:7px;min-width:0;flex:none}
#friends-dialog .friends-own-id>span{font-size:11px;color:#737d6d;white-space:nowrap}
#friends-dialog #friends-own-id{font:600 13px ui-monospace,monospace;color:#345341;white-space:nowrap}
#friends-dialog #friends-copy-id{min-width:36px;min-height:40px;padding:8px;border:0;background:#f0f3e9;display:grid;place-items:center}
#friends-dialog #dm-inbox-open{width:auto;min-width:0;margin:0;flex:0 1 auto;font-size:12px;padding:7px 10px;white-space:normal}
#friends-dialog #friends-search{margin:0 0 14px}
#friends-dialog #friends-search>label{display:block;margin:0 0 7px;font-size:12px;font-weight:600;color:#52664f}
#friends-dialog .friend-search-row{display:grid;grid-template-columns:minmax(0,1fr) 60px;gap:7px}
#friends-dialog #friend-id{height:44px;min-height:44px;margin:0;background:#fffef9;border:1px solid #cfd5c6;border-radius:10px;color:#244638;padding:10px 12px;font-size:16px}
#friends-dialog #friend-id::placeholder{color:#919988;font-size:13px}
#friends-dialog .friend-search-row button,#friends-dialog button.friends-primary{background:#275e48;border-color:#275e48;color:#fffef4}
#friends-dialog .friend-search-row button:hover:not(:disabled),#friends-dialog button.friends-primary:hover:not(:disabled){background:#1e4d3a}
#friends-dialog .friends-feedback:has(#friends-status:empty):has(#friends-retry[hidden]){display:none}
#friends-dialog .friends-feedback{margin:0 0 12px}
#friends-dialog #friends-status{font-size:12px;line-height:1.4;margin:0;color:#52634e;overflow-wrap:anywhere}
#friends-dialog #friends-retry{margin-top:6px}
#friends-dialog #friends-tabs{display:grid;grid-template-columns:1fr 1.4fr 1.1fr;gap:3px;padding:4px;background:#eef1e6;border-radius:12px;margin:0 0 12px}
#friends-dialog #friends-tabs button{min-width:0;min-height:40px;padding:6px 3px;border-color:transparent;background:transparent;border-radius:8px;font-size:12px;display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
#friends-dialog #friends-tabs button[aria-selected=true]{background:#fffef8;border-color:#d4dac8;color:#214d37;box-shadow:0 1px 3px #28483012;font-weight:700}
#friends-dialog .friends-count{font-size:10px;min-width:17px;line-height:17px;border-radius:9px;padding:0 4px;background:#dde6d2;color:#36543b}
#friends-dialog #friends-context{font-size:11px;line-height:1.4;margin:0 0 12px;padding:0;border:0;background:transparent;color:#74816c}
#friends-dialog #friends-list{outline-offset:2px}
#friends-dialog h3{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font:600 13px/1.4 system-ui,'Segoe UI',sans-serif;margin:14px 0 8px;color:#425c44}
#friends-dialog section:first-child h3{margin-top:0}
#friends-dialog .friends-online-count{font-size:11px;font-weight:400;color:#688160}
#friends-dialog .friend-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:8px;border:1px solid #e0e5d7;border-radius:12px;padding:10px;margin:0 0 8px;background:#fbfcf5;min-width:0}
#friends-dialog .friend-avatar{display:grid;place-items:center;width:36px;height:38px;border-radius:11px;background:#e6eddb;color:#3f6244;font:600 20px Georgia,serif}
#friends-dialog .friend-label{min-width:0;font-size:14px;line-height:1.35}
#friends-dialog .friend-label strong{display:block;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#friends-dialog .friend-label small{display:block;font:10px/1.5 ui-monospace,monospace;letter-spacing:.03em;color:#7e8876;margin-top:2px;overflow-wrap:anywhere}
#friends-dialog .friend-presence{font-size:10px;color:#7b8574;white-space:nowrap;align-self:start;margin-top:4px}
#friends-dialog .friend-presence.online{color:#347343}
#friends-dialog .friend-presence.online::before{content:'';display:inline-block;width:5px;height:5px;margin-right:4px;border-radius:50%;background:#568b50;vertical-align:middle}
#friends-dialog .friend-actions{grid-column:2/4;display:flex;flex-wrap:wrap;align-items:start;gap:6px;min-width:0}
#friends-dialog .friend-actions>button{flex:1;min-width:0;font-size:12px}
#friends-dialog .friend-more{flex:none;margin-left:auto}
#friends-dialog .friend-more summary{cursor:pointer;display:grid;place-items:center;width:40px;min-height:40px;border:1px solid #d2d8c8;border-radius:10px;background:#fffef7;font-size:22px;line-height:1;list-style:none;user-select:none}
#friends-dialog .friend-more summary::-webkit-details-marker{display:none}
#friends-dialog .friend-more[open]{flex-basis:100%;display:flex;flex-direction:column;align-items:end}
#friends-dialog .friend-more[open] summary{margin-left:auto;background:#eef2e7}
#friends-dialog .friend-more-actions{display:flex;gap:6px;padding-top:6px}
#friends-dialog .friend-more-actions button.friend-danger{font-size:12px;color:#8b5c48;background:#fffaf4}
#friends-dialog .friend-pending,#friends-dialog .friend-search-state{grid-column:2/4;color:#879079;font-size:11px}
#friends-dialog .friend-search-state{color:#5f7954}
#friends-dialog #friend-result .friend-row{background:#f0f5e8;border-color:#c7d8b7;margin-bottom:12px}
#friends-dialog .friends-empty{text-align:center;padding:24px 12px;color:#748069;font-size:12px;line-height:1.5}
#friends-dialog .friends-empty strong{display:block;color:#51684c;font-size:14px;font-weight:600}
#friends-dialog .friends-empty p{margin:7px auto 0;max-width:280px}
#friends-dialog #friends-login{display:block;margin:0 auto 12px;min-width:140px}
#friends-dialog .friend-help{font-size:11px;color:#78846e;margin:0 0 8px}
#friends-dialog [hidden]{display:none!important}
@media(max-width:360px){
 #friends-dialog>.dialog-head{padding:13px 12px 10px}
 #friends-dialog .friends-body{padding:12px}
 #friends-dialog #friends-tools{gap:4px}
 #friends-dialog .friends-own-id{gap:4px}
 #friends-dialog #dm-inbox-open{padding:6px;font-size:11px}
 #friends-dialog #friends-tabs button{font-size:11px;gap:3px}
 #friends-dialog .friend-row{padding:8px;gap:7px;grid-template-columns:32px minmax(0,1fr) auto}
 #friends-dialog .friend-avatar{width:32px;height:36px}
}
@media(max-height:500px){
 #friends-dialog>.dialog-head{padding:8px 14px}
 #friends-dialog>.dialog-head h2{font-size:24px}
 #friends-dialog .friends-body{padding-top:10px}
}

/* Private messages share the Friends panel palette and keep the composer in view. */
#dm-dialog{width:min(460px,calc(100vw - 20px));height:min(620px,calc(var(--visual-height,100dvh) - 24px));max-height:calc(var(--visual-height,100dvh) - 24px);padding:0;border:1px solid #d8ddce;border-radius:18px;background:#fffef6;color:#244638;font-family:system-ui,'Segoe UI',sans-serif;overflow:hidden;box-shadow:0 18px 64px #123d3438}
#dm-dialog[open]{display:flex;flex-direction:column}
#dm-dialog:has(#dm-conversation[hidden]){height:fit-content;min-height:0;max-height:min(620px,calc(var(--visual-height,100dvh) - 24px))}
#dm-dialog>.dialog-head{display:flex;align-items:center;gap:10px;flex:none;padding:14px 16px 12px;margin:0;border-bottom:1px solid #e7e9dd}
#dm-dialog>.dialog-head h2{flex:1;min-width:0;font:700 26px Georgia,'Times New Roman',serif;letter-spacing:-.025em;color:#214837;margin:0}
#dm-dialog button{min-height:40px;padding:7px 11px;margin:0;border:1px solid #d2d8c8;border-radius:10px;background:#fffef7;color:#365641;font:500 12px/1.3 system-ui,'Segoe UI',sans-serif;box-shadow:none}
#dm-dialog button:hover:not(:disabled){background:#edf2e6}
#dm-dialog button:focus-visible,#dm-dialog textarea:focus-visible,#dm-dialog summary:focus-visible{outline:2px solid #28624a;outline-offset:2px}
#dm-dialog #dm-close{flex:none;width:auto;min-width:60px;min-height:40px;font-size:13px}
#dm-dialog #dm-back{flex:none;display:grid;place-items:center;width:32px;min-width:32px;padding:4px;border:0;background:transparent}
#dm-dialog .dm-feedback{flex:none;padding:8px 16px;background:#f2f4e9}
#dm-dialog .dm-feedback:has(#dm-status:empty):has(#dm-retry[hidden]){display:none}
#dm-dialog #dm-status{margin:0;font-size:11px;line-height:1.4;color:#5c7054;overflow-wrap:anywhere}
#dm-dialog #dm-retry{margin-top:5px;min-height:32px;padding:4px 10px;font-size:11px}
#dm-dialog #dm-inbox{display:flex;flex:1;flex-direction:column;gap:8px;padding:14px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
#dm-dialog #dm-inbox .dm-thread{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;flex:none;min-height:74px;padding:12px;background:#fafcf3;border-color:#e0e5d7;border-radius:12px}
#dm-dialog #dm-inbox .dm-thread:hover{background:#f0f4e7}
#dm-dialog .dm-avatar{display:grid;place-items:center;width:40px;height:42px;border-radius:12px;background:#e6eddb;color:#3f6244;font:600 21px Georgia,serif;flex:none}
#dm-dialog .dm-thread-copy,#dm-dialog .dm-peer-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
#dm-dialog .dm-thread-copy strong,#dm-dialog .dm-peer-copy strong{font-size:14px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#2b503a}
#dm-dialog .dm-thread-copy small,#dm-dialog .dm-peer-copy small{font:10px/1.4 ui-monospace,monospace;color:#7b8773;overflow-wrap:anywhere}
#dm-dialog .dm-thread-meta{display:flex;align-items:center;gap:8px;color:#7b8a70;font-size:22px}
#dm-dialog .dm-thread-meta .dm-unread{display:grid;place-items:center;min-width:23px;height:23px;padding:0 6px;border-radius:12px;background:#306746;color:#fffef5;font-size:10px;line-height:1}
#dm-dialog .dm-archive-badge{font:10px system-ui;color:#75836c;background:#e9edde;padding:4px 7px;border-radius:6px}
#dm-dialog #dm-inbox .dm-more{flex:none;align-self:center;min-height:36px;font-size:11px}
#dm-dialog .dm-empty{margin:auto 0;padding:30px 16px;text-align:center;color:#7b886f;font-size:12px;line-height:1.5}
#dm-dialog .dm-empty strong{display:block;font-size:15px;color:#516a49;font-weight:600}
#dm-dialog .dm-empty p{max-width:280px;margin:9px auto 0}
#dm-dialog #dm-conversation{flex:1;display:flex;flex-direction:column;gap:0;min-height:0;overflow:hidden}
#dm-dialog #dm-peer{display:flex;align-items:center;flex:none;gap:10px;margin:0;padding:10px 16px;border-bottom:1px solid #e9ecdf;background:#fffef8}
#dm-dialog #dm-peer .dm-avatar{width:34px;height:36px;font-size:19px}
#dm-dialog #dm-archive{flex:none;font-size:11px;color:#6e775f;background:#edf0e4;padding:7px 14px;margin:0}
#dm-dialog .dm-history-tools{flex:none;display:flex;justify-content:center;gap:8px;padding:5px 12px;background:#f3f5eb}
#dm-dialog .dm-history-tools:has(#dm-older[hidden]):has(#dm-latest[hidden]){display:none}
#dm-dialog .dm-history-tools button{min-height:30px;font-size:10px;padding:4px 8px;background:transparent;border-color:#d9e1ce}
#dm-dialog #dm-messages{flex:1;min-height:36px;max-height:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;border:0;border-radius:0;padding:8px 14px 12px;background:#f3f5eb;display:flex;flex-direction:column;gap:7px}
#dm-dialog #dm-messages:empty::before{content:none}
#dm-dialog .dm-day{flex:none;align-self:center;font-size:10px;line-height:1.4;color:#8a957e;margin:7px 0 4px;padding:2px 8px}
#dm-dialog .dm-message{flex:none;max-width:86%;min-width:60px;margin:0;padding:9px 11px 6px;border:1px solid #e1e6d6;border-radius:13px 13px 13px 3px;background:#fffef8;align-self:flex-start;box-shadow:0 1px 1px #36513006}
#dm-dialog .dm-message.me{align-self:flex-end;background:#dcebd3;border-color:#ccdfbf;border-radius:13px 13px 3px 13px}
#dm-dialog .dm-message p{margin:0;color:#29462e;font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
#dm-dialog .dm-message time{display:block;text-align:right;font-size:9px;line-height:1.3;color:#829075;margin-top:4px}
#dm-dialog #dm-form{flex:none;display:grid;grid-template-columns:minmax(0,1fr) 70px;gap:8px;padding:10px 14px 5px;margin:0;border-top:1px solid #e1e7d7;background:#fffef7}
#dm-dialog #dm-text{display:block;width:100%;min-width:0;height:50px;min-height:50px;max-height:50px;margin:0;padding:10px 11px;border:1px solid #cdd6c1;border-radius:10px;background:#fffefb;color:#294c36;font:16px/1.4 system-ui,'Segoe UI',sans-serif;resize:none;scrollbar-width:thin}
#dm-dialog #dm-text::placeholder{font-size:13px;color:#94a087}
#dm-dialog #dm-send{min-height:50px;min-width:0;font-size:12px;background:#275e48;border-color:#275e48;color:#fffef4}
#dm-dialog #dm-send:hover:not(:disabled){background:#1e4d3a}
#dm-dialog .dm-bottom{display:flex;align-items:start;flex:none;gap:8px;padding:3px 16px 11px;background:#fffef7}
#dm-dialog #dm-policy{flex:1;min-width:0;margin:0;font-size:10px;line-height:1.4;color:#829074}
#dm-dialog #dm-policy summary{width:fit-content;cursor:pointer;min-height:22px;padding:3px 0;font-size:10px}
#dm-dialog #dm-policy p{max-height:66px;overflow-y:auto;margin:4px 0 0;padding-right:8px;font-size:10px;line-height:1.4}
#dm-dialog #dm-count{font-size:10px;color:#8a967e;white-space:nowrap;padding-top:3px}
#dm-dialog #dm-count.dm-over-limit{color:#a3483d}
#dm-dialog [hidden]{display:none!important}





















@media(max-width:360px){
 #dm-dialog>.dialog-head{padding:10px 12px;gap:6px}
 #dm-dialog>.dialog-head h2{font-size:23px}
 #dm-dialog #dm-close{min-width:55px;padding:6px 9px}
 #dm-dialog #dm-back{width:28px;min-width:28px}
 #dm-dialog #dm-inbox{padding:10px}
 #dm-dialog #dm-form{padding-left:10px;padding-right:10px}
}
@media(max-height:500px){
 #dm-dialog>.dialog-head{padding:6px 12px}
 #dm-dialog>.dialog-head h2{font-size:23px}
 #dm-dialog #dm-peer{padding:6px 12px}
 #dm-dialog #dm-peer .dm-avatar{width:30px;height:32px}
 #dm-dialog .dm-bottom{padding-bottom:5px}
 #dm-dialog #dm-form{padding-top:6px}
}

/* One conversation gets one compact card in home, lobby and game. */
#dm-dialog:has(#dm-conversation){height:fit-content;max-height:min(620px,calc(var(--visual-height,100dvh) - 24px))}
#dm-dialog #dm-messages:has(.dm-empty){min-height:120px}
#dm-dialog:has(#dm-conversation[hidden]){height:fit-content;min-height:0}
#dm-dialog #dm-inbox .dm-thread{display:flex;gap:8px;padding:9px 10px;border:1px solid #e0e5d7;min-height:74px}
#dm-dialog #dm-inbox .dm-thread-profile{display:flex;align-items:center;gap:10px;flex:1;min-width:0;min-height:46px;border:0;background:transparent;padding:0;text-align:left}
#dm-dialog #dm-inbox .dm-thread-profile:hover{background:transparent}
#dm-dialog .dm-thread-meta{flex:none;flex-direction:column;gap:4px;justify-content:center}
#dm-dialog #dm-inbox .dm-thread-chat{min-height:36px;padding:6px 10px;text-align:center;font-size:11px}
#dm-dialog .dm-thread-copy small{font-size:10px;line-height:1.4}
#dm-dialog #dm-inbox .dm-thread-profile{gap:8px}
#dm-dialog #dm-inbox .dm-avatar{width:34px;height:38px}
#dm-dialog .dm-thread-copy{flex:1;gap:2px}
#dm-dialog .dm-thread-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#dm-dialog .dm-thread-preview{display:block;min-width:0;font:11px/1.4 system-ui,'Segoe UI',sans-serif;color:#60705b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#dm-dialog .dm-thread-unread .dm-thread-preview{font-weight:600;color:#365641}
#dm-dialog .dm-thread-stamp{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-height:18px}
#dm-dialog .dm-thread-time{font:10px/1.4 system-ui,'Segoe UI',sans-serif;color:#60705b;white-space:nowrap}
#dm-dialog .dm-thread-stamp .dm-unread{min-width:18px;height:18px;padding:0 4px;font-size:9px}
#dm-dialog .dm-thread-stamp .dm-archive-badge{padding:2px 4px;font-size:9px}
#dm-dialog .dm-avatar.dm-medal,#friends-dialog .friend-avatar.friend-medal{background:transparent}
#dm-dialog .dm-medal .tier-medal,#friends-dialog .friend-medal .tier-medal{width:100%;height:100%;object-fit:contain;max-width:none;max-height:none}
#dm-dialog #dm-peer .dm-peer-profile{display:flex;align-items:center;gap:10px;width:100%;min-width:0;min-height:0;padding:0;border:0;border-radius:6px;background:transparent;text-align:left}
#friends-dialog .friend-profile-link{display:flex;align-items:center;gap:8px;grid-column:1/3;min-width:0;padding:0;border:0;background:transparent;text-align:left}
#friends-dialog .friend-profile-link .friend-label{flex:1;min-width:0}
#friends-dialog .friend-profile-link .friend-avatar{flex:none}
#friends-dialog .friend-profile-link:hover:not(:disabled){background:transparent}
/* Compact friend rows keep the direct chat action beside the identity. */
#friends-dialog>.dialog-head{padding:12px 14px 10px}
#friends-dialog>.dialog-head h2{font-size:26px}
#friends-dialog .friends-body{padding:12px 14px}
#friends-dialog #friends-tools{margin-bottom:10px}
#friends-dialog #friends-copy-id{min-height:34px;min-width:32px;padding:6px}
#friends-dialog #friends-search{margin-bottom:10px}
#friends-dialog #friends-search>label{margin-bottom:5px}
#friends-dialog #friend-id{height:40px;min-height:40px}
#friends-dialog #friends-tabs{margin-bottom:10px;padding:3px}
#friends-dialog #friends-tabs button{min-height:36px}
#friends-dialog .friend-row.friend-compact{grid-template-columns:minmax(0,1fr) auto;padding:8px;gap:8px;margin-bottom:6px;min-height:62px}
#friends-dialog .friend-compact:last-child{margin-bottom:0}
#friends-dialog .friend-compact .friend-profile-link{grid-column:1;gap:8px;min-height:42px}
#friends-dialog .friend-compact .friend-name-line{display:flex;gap:5px;align-items:center;min-width:0}
#friends-dialog .friend-compact .friend-name-line strong{min-width:0;flex:1}
#friends-dialog .friend-compact .friend-presence{flex:none;align-self:center;margin:0;font:9px/1.4 system-ui}
#friends-dialog .friend-compact .friend-label small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:0}
#friends-dialog .friend-compact>.friend-actions{grid-column:2;gap:5px;align-items:center;flex-wrap:nowrap}
#friends-dialog .friend-compact>.friend-actions>button{flex:none;min-height:36px;padding:6px 8px;font-size:11px}
#friends-dialog .friend-compact .friend-more summary{width:32px;min-height:36px;border-color:transparent;background:transparent}
#friends-dialog .friend-compact:has(.friend-more[open])>.friend-actions{grid-column:1/-1;flex-wrap:wrap;justify-content:flex-end}
#friends-dialog .friend-compact .friend-more-actions{flex-wrap:wrap;justify-content:flex-end}
#friends-dialog .friends-empty{padding:18px 10px}
#friends-dialog #dm-inbox-open{display:flex;align-items:center;gap:6px;width:auto;flex:none;min-height:36px;margin:0;padding:6px 8px;white-space:nowrap;font-size:12px}
#friends-dialog #dm-inbox-open svg{flex:none}
#friends-dialog #friends-inbox-count{min-width:19px;padding:2px 5px;border-radius:10px;background:#306746;color:#fffef5;font-size:10px;line-height:16px;text-align:center}
@media(max-width:360px){#friends-dialog #dm-inbox-open{gap:4px;padding:6px;font-size:11px}}
@media(max-width:360px){#friends-dialog .friends-body{padding:10px}#friends-dialog .friend-row.friend-compact{padding:7px;gap:6px}#friends-dialog .friend-compact .friend-profile-link{gap:6px}}
/* Profiles replace the panel body without closing the current conversation. */
#friends-dialog[data-friend-profile]>:not(.friend-profile-sheet),#dm-dialog[data-friend-profile]>:not(.friend-profile-sheet){display:none!important}
#friends-dialog[data-friend-profile],#dm-dialog[data-friend-profile]{height:fit-content!important;min-height:0}
.friend-profile-sheet{display:flex;flex-direction:column;min-height:0;overflow:hidden}
#friends-dialog .friend-profile-sheet>.dialog-head,#dm-dialog .friend-profile-sheet>.dialog-head{position:static;display:flex;align-items:center;gap:8px;margin:0;padding:12px 14px;border-bottom:1px solid #e4e8db;flex:none;background:#fffef6}
#friends-dialog .friend-profile-sheet h2,#dm-dialog .friend-profile-sheet h2{flex:1;font:700 25px Georgia,serif;margin:0;color:#214837}
#friends-dialog .friend-profile-back,#dm-dialog .friend-profile-back{width:30px;min-width:30px;min-height:36px;border:0;padding:4px;background:transparent;font-size:21px}
#friends-dialog .friend-profile-close,#dm-dialog .friend-profile-close{min-width:55px;min-height:36px;font-size:12px}
.friend-profile-body{min-height:0;padding:14px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.friend-profile-status{font-size:12px;line-height:1.4;color:#738365;overflow-wrap:anywhere}
.friend-profile-status:empty{display:none}
.friend-profile-identity{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.friend-profile-identity>.friend-avatar{display:grid;place-items:center;flex:none;width:42px;height:44px;border-radius:12px;background:#e5eddb;color:#44623e;font:700 23px Georgia,serif}
.friend-profile-identity>div{display:grid;gap:3px;min-width:0}
.friend-profile-identity strong{font:700 22px Georgia,serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#264d36}
.friend-profile-identity small{font-size:11px;color:#7a876e}
.friend-profile-id{display:flex;align-items:center;gap:8px;padding:6px 10px;background:#f0f3e8;border-radius:10px;margin-bottom:12px;font-size:11px;color:#77836c}
.friend-profile-id strong{font:600 12px ui-monospace,monospace;color:#405d41}
#friends-dialog .friend-profile-copy,#dm-dialog .friend-profile-copy{display:grid;place-items:center;margin-left:auto;border:0;min-width:34px;min-height:34px;padding:6px;background:transparent}
.friend-profile-rank{padding:14px;border:1px solid #dfd6b5;border-radius:12px;background:#faf6e8;color:#756339}
.friend-profile-rank .public-rank-season{font-size:11px;margin:10px 0 0;padding-top:8px;border-top:1px solid #e2dcc4}
#friends-dialog .friend-profile-message,#dm-dialog .friend-profile-message{width:100%;margin-top:12px;min-height:42px;background:#275e48;color:#fffef5;border-color:#275e48}
.friend-profile-rank .tier-medal-medium{width:48px;height:56px;object-fit:contain}
.friend-profile-rank .tier-medal-small{width:32px;height:38px;object-fit:contain}
@media(max-width:360px){#friends-dialog .friend-profile-sheet h2,#dm-dialog .friend-profile-sheet h2{font-size:22px}.friend-profile-body{padding:11px}.friend-profile-rank{padding:11px}}





/* One quiet notification count for all friend activity. */
[data-friends-notifications]{position:relative}
.friends-notification{position:absolute;top:-5px;right:-4px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border:2px solid #fffef7;border-radius:10px;background:#a34b3c;color:#fff;font:600 9px/14px system-ui,sans-serif;box-sizing:border-box;pointer-events:none}
.friends-notification[hidden]{display:none!important}

/* Compact Settings shares the cream/green account and friends panel. */
#audio-dialog{width:min(410px,calc(100vw - 20px));padding:0;border:1px solid #cbd5c0;border-radius:17px;background:#fffef7;color:#294b3a;overflow:auto;max-height:calc(100dvh - 20px);font:14px/1.45 system-ui,'Segoe UI',Arial,sans-serif}
#audio-dialog .dialog-head{padding:16px 18px 14px;margin:0;border-bottom:1px solid #dde3d4;gap:12px;background:#fffef7}
#audio-dialog .dialog-head h2{font:700 27px/1.1 Georgia,serif;color:#294b3a;margin:0}
#audio-dialog button{font:400 12px/1.4 system-ui,'Segoe UI',Arial,sans-serif;min-height:36px;padding:6px 11px;border:1px solid #cbd5c0;border-radius:9px;background:#fffef7;color:#294b3a;display:inline-flex;align-items:center;justify-content:center;gap:7px}
#audio-dialog .dialog-head button{width:auto;min-width:0;font-size:12px;padding:6px 12px;min-height:36px}
#audio-dialog svg{width:17px;height:17px;flex:none}
#audio-dialog .settings-content{padding:14px 18px 10px}
#audio-dialog #settings-sound-title{display:flex;align-items:center;gap:7px;margin:0 0 10px;font-size:11px;line-height:1.4;font-weight:600;letter-spacing:1.2px;text-transform:uppercase;color:#71806b}
#audio-dialog #settings-sound-title svg{width:14px;height:14px}
#audio-dialog .audio-setting{display:grid;grid-template-columns:minmax(0,1fr) 38px;align-items:center;gap:0 9px;margin:0 0 8px}
#audio-dialog .audio-setting>label:first-child{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;font-size:13px;line-height:1.45;font-weight:500}
#audio-dialog output{font:400 11px/1.4 system-ui,sans-serif;color:#53654e;min-width:34px;text-align:right;font-variant-numeric:tabular-nums}
#audio-dialog .audio-setting input[type=range]{grid-column:1;grid-row:2;display:block;appearance:none;-webkit-appearance:none;width:100%;height:26px;min-height:26px;margin:0;padding:0;background:transparent;border:0;box-shadow:none;accent-color:#2b6048;outline-offset:2px}
#audio-dialog input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:linear-gradient(to right,#2b6048 var(--audio-level),#dce4d4 var(--audio-level))}
#audio-dialog input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:13px;height:13px;margin-top:-4.5px;border-radius:50%;background:#2b6048;border:0;box-shadow:0 0 0 3px #fffef7}
#audio-dialog input[type=range]::-moz-range-track{height:4px;background:#dce4d4;border:0;border-radius:4px}
#audio-dialog input[type=range]::-moz-range-progress{height:4px;background:#2b6048;border:0}
#audio-dialog input[type=range]::-moz-range-thumb{width:13px;height:13px;background:#2b6048;border:0;border-radius:50%}
#audio-dialog .audio-setting .audio-mute{grid-column:2;grid-row:1/3;min-width:0;width:38px;height:38px;padding:0;background:#eff3e7;border:0}
#audio-dialog .audio-mute[aria-pressed=true]{background:#f7eee5;color:#985749}
#audio-dialog .audio-setting[data-muted=true] input[type=range]{opacity:.5}
#audio-dialog .audio-help{font-size:11px;line-height:1.5;color:#71806b;margin:2px 0 0}
#audio-dialog #settings-fullscreen{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #dde3d4;margin-top:14px;padding-top:10px;min-height:49px;font-size:13px;font-weight:500}
#audio-dialog #settings-fullscreen>span{white-space:nowrap;flex:none}
body:is(.home-mode,.lobby-mode,.playing-mode) #audio-dialog #settings-fullscreen #fullscreen-toggle{display:inline-flex!important;min-width:0;width:auto;min-height:36px;height:36px;padding:5px 3px;font-size:11px;border:0;background:transparent;color:#294b3a}
#audio-dialog .settings-footer{display:grid;grid-template-columns:1fr;gap:8px;padding:11px 18px 12px;border-top:1px solid #dde3d4}
#audio-dialog .settings-footer button{font-size:12px;min-height:38px;padding:6px 8px;background:#eff3e7;border-color:transparent}
#audio-dialog .settings-saved{font-size:11px;line-height:1.4;text-align:center;color:#53654e;padding:0 18px 13px;margin:0}
#audio-dialog #settings-audio-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#eff3e7;padding:7px 9px;border-radius:8px;margin:0 0 13px}
#audio-dialog #game-audio-status{min-height:0;margin:0;font-size:11px;line-height:1.4;color:#53654e}
#audio-dialog #audio-unlock{min-height:30px;font-size:11px;background:#2b6048;color:#fffef7;border:0;padding:5px 9px}
@media(pointer:coarse){#audio-dialog .audio-setting{grid-template-columns:minmax(0,1fr) 44px}#audio-dialog .audio-setting .audio-mute{width:44px;height:44px;min-height:44px}#audio-dialog .audio-setting input[type=range]{height:29px;min-height:29px}#audio-dialog .settings-footer button,#audio-dialog .dialog-head button{min-height:40px}}
@media(max-width:360px){#audio-dialog .dialog-head{padding:14px}#audio-dialog .dialog-head h2{font-size:25px}#audio-dialog .settings-content{padding:12px 14px 8px}#audio-dialog .settings-footer{padding:10px 14px}#audio-dialog .settings-saved{padding-bottom:11px}}
@media(max-height:500px) and (min-width:550px){#audio-dialog{width:min(620px,calc(100vw - 20px))}#audio-dialog .dialog-head{padding:11px 16px}#audio-dialog .dialog-head h2{font-size:24px}#settings-main{display:grid;grid-template-columns:minmax(0,1fr) 200px}#audio-dialog .settings-content{display:contents}#audio-dialog .settings-sound{grid-column:1;grid-row:2/5;padding:12px 16px;border-right:1px solid #dde3d4}#audio-dialog #settings-audio-notice{grid-column:1/-1;grid-row:1;margin:8px 12px 0}#audio-dialog #settings-fullscreen{grid-column:2;grid-row:2;margin:0;padding:10px 12px;border:0;align-self:start}#audio-dialog .settings-footer{grid-column:2;grid-row:3;grid-template-columns:1fr;border:0;padding:0 12px;align-self:center}#audio-dialog .settings-saved{grid-column:2;grid-row:4;padding:8px 12px 12px;align-self:end}}

/* Top Rank opens a compact profile without losing the selected season or page. */
#ranked-dialog .rank-player-row{cursor:pointer;-webkit-tap-highlight-color:transparent}
#ranked-dialog .rank-player-open{width:100%;min-width:0;min-height:44px;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;text-align:left;font:inherit;box-shadow:none;-webkit-tap-highlight-color:transparent}
#ranked-dialog .rank-player-open strong{font-weight:700}
#ranked-dialog .rank-player-open:focus:not(:focus-visible){outline:none}
#ranked-dialog .rank-player-open:focus-visible{outline:2px solid #35674f;outline-offset:3px}
@media(hover:hover){#ranked-dialog .rank-player-row:hover{background:#edf2e6}}
#rank-player-dialog{box-sizing:border-box;width:min(380px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #cbd5c0;border-radius:17px;background:#fffef7;color:#294b3a;overflow:auto;font:13px/1.45 system-ui,'Segoe UI',Arial,sans-serif}
#rank-player-dialog .dialog-head{position:sticky;top:0;display:flex;align-items:center;gap:10px;margin:0;padding:14px 16px;border-bottom:1px solid #dde3d4;background:#fffef7;z-index:1}
#rank-player-dialog h2{flex:1;min-width:0;margin:0;font:700 25px/1.1 Georgia,serif}
#rank-player-dialog button{width:auto;min-width:0;min-height:40px;padding:6px 11px;border:1px solid #cbd5c0;border-radius:9px;background:#fffef7;color:#294b3a;font:400 12px/1.4 system-ui,sans-serif;-webkit-tap-highlight-color:transparent}
#rank-player-body{padding:14px 16px 16px}
.rank-player-identity{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.rank-player-identity>.tier-medal{flex:none;width:44px;height:52px;object-fit:contain}
.rank-player-identity>div{min-width:0}
.rank-player-identity h3{font:700 22px/1.2 Georgia,serif;margin:0 0 3px;overflow-wrap:anywhere}
.rank-player-identity small{font-size:11px;color:#53654e}
.rank-player-id{display:flex;align-items:center;gap:8px;padding:4px 8px 4px 10px;background:#f0f3e8;border-radius:9px;font-size:11px;color:#53654e}
.rank-player-id strong{font:600 13px ui-monospace,monospace;letter-spacing:.3px}
#rank-player-dialog #rank-player-copy{display:grid;place-items:center;flex:none;min-width:40px;margin-left:auto;padding:6px;border:0;background:transparent}
.rank-player-rating{margin-top:12px;padding:12px;border:1px solid #dfd6b5;border-radius:11px;background:#faf6e8;color:#756339}
.rank-player-rating p{margin:0;font-size:11px}
.rank-player-summary{display:flex;justify-content:space-between;gap:10px;margin:7px 0 9px}
.rank-player-summary>div{display:grid;gap:2px;min-width:0}
.rank-player-summary>div:last-child{text-align:right}
.rank-player-summary strong{font:700 29px/1.15 Georgia,serif;overflow-wrap:anywhere}
.rank-player-summary>div:last-child strong{font-size:24px}
.rank-player-summary small{font-size:11px}
#rank-player-status{font-size:11px;color:#53654e;margin:10px 0 0}
#rank-player-status:empty{display:none}
@media(max-width:360px){#rank-player-dialog h2{font-size:22px}#rank-player-dialog .dialog-head{padding:12px}#rank-player-body{padding:12px}.rank-player-identity h3{font-size:20px}}
@media(max-height:500px) and (min-width:550px){#rank-player-dialog{width:min(540px,calc(100vw - 24px))}#rank-player-dialog .dialog-head{padding:10px 14px}#rank-player-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 12px;padding:12px 14px}.rank-player-identity{grid-column:1;grid-row:1;margin:0}.rank-player-identity h3{font-size:20px}.rank-player-id{grid-column:1;grid-row:2;align-self:end}.rank-player-rating{grid-column:2;grid-row:1/3;margin:0}#rank-player-status{grid-column:1/-1;margin:0}}

/* Keep the shared header aligned while making narrow landscape room tools readable. */
@media(min-width:600px) and (max-width:700px) and (max-height:560px){
 body:is(.home-mode,.lobby-mode,.playing-mode) .shell.page{--frame-width:700px}
 body.lobby-mode #room:has(#lobby:not([hidden])){grid-template-columns:minmax(0,1fr) minmax(300px,1fr)}
 body.lobby-mode #lobby .lobby-code{gap:3px;flex:none}
 body.lobby-mode #lobby .lobby-code strong{font-size:15px;letter-spacing:1px}
 body.lobby-mode #lobby .lobby-code #lobby-privacy{padding:3px 5px;font-size:9px}
 body.lobby-mode #lobby #lobby-copy-code{width:26px;min-width:26px;padding:3px}
 body.lobby-mode #lobby .lobby-invite-actions{gap:4px;flex:none}
 body.lobby-mode #lobby .lobby-invite-actions button,body.lobby-mode #room #lobby #share{font-size:11px;padding-inline:4px;gap:4px}
}
@media(min-width:600px) and (max-height:560px){
 body.lobby-mode #room:has(#lobby:not([hidden])) .room-bar{padding-block:3px}
 body.lobby-mode .room-bar .lobby-heading #lobby-status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
