:root{color-scheme:dark;--bg:#0c1c1c;--surface:#142827;--text:#f3eddb;--muted:#b1bfb5;--gold:#e3c48c;--red:#b84136;--line:#ffffff1b;--felt:#205a50;--font:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.6}button,input,select{font:inherit}button,a,input,select{outline-offset:5px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--gold)}button{border:0;cursor:pointer;transition:background .18s,transform .18s;color:inherit}button:disabled{opacity:.4;cursor:not-allowed}a{color:var(--gold);text-decoration:none}button svg{width:18px;height:18px;vertical-align:middle;flex-shrink:0}h1,h2,h3,p{margin:0}button:active:not(:disabled){transform:translateY(1px)}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:14px;min-height:46px;padding:11px 23px;border-radius:5px;font-weight:650}.primary{background:var(--gold);color:#20342c;box-shadow:0 3px 0 #846e48}.primary:hover:not(:disabled){background:#f5daaa}.secondary{background:#ffffff0a;border:1px solid #d6bf8b66;color:var(--text)}.secondary:hover:not(:disabled){background:#ffffff15}.quiet{display:inline-flex;align-items:center;gap:8px;background:none;color:var(--muted);padding:10px 13px;min-height:44px;border-radius:4px}.quiet:hover{background:#ffffff0c;color:var(--text)}.full{width:100%}.brand{display:flex;align-items:center;gap:13px;color:var(--text);font-family:"KaiTi","STKaiti",serif;font-size:25px;letter-spacing:3px;line-height:1.3;white-space:nowrap}.brand small{display:block;font:8px/2 var(--font);letter-spacing:2.8px;color:var(--muted)}.brand-seal{width:44px;height:48px;background:var(--red);display:grid;place-items:center;border:1px solid #ed9b794d;box-shadow:inset 0 0 0 3px #912d25,0 4px 10px #0002;border-radius:3px;font-size:32px;color:#f6e3ba;letter-spacing:0}.home{max-width:1540px;margin:auto;padding:0 5.7%;min-height:100vh;background:radial-gradient(ellipse at 20% 48%,#21473d66,transparent 55%)}header{display:flex;align-items:center;justify-content:space-between;min-height:110px;border-bottom:1px solid var(--line);gap:24px}.edition{margin-right:auto;margin-left:30px;padding-left:30px;border-left:1px solid var(--line);color:var(--muted);font-size:12px;letter-spacing:2px}.home-main{display:grid;grid-template-columns:1.05fr 1fr;gap:10%;padding:58px 0 65px;align-items:start}.intro{padding-top:30px;position:relative}.eyebrow{font-size:10px;letter-spacing:2.3px;color:var(--gold);font-weight:600}.intro .eyebrow{font-size:11px;display:flex;align-items:center;gap:10px;letter-spacing:3px}.eyebrow i{width:6px;height:6px;background:var(--gold);border-radius:50%}h1{font-family:"KaiTi","STKaiti",serif;font-size:clamp(44px,4.8vw,74px);font-weight:500;letter-spacing:4px;line-height:1.42;margin:27px 0 20px}h1 span{color:var(--gold)}.intro-copy{color:var(--muted);font-size:14px;line-height:2.1;letter-spacing:1px}.hero-tiles{position:relative;display:flex;gap:9px;margin:44px 0 30px;padding:20px 0 30px;isolation:isolate}.hero-tiles .tile{width:75px;height:103px;transform:rotate(-9deg);box-shadow:3px 10px 0 #b9a777,5px 18px 20px #0005}.hero-tiles .tile:nth-child(2){transform:translateY(-10px) rotate(-3deg)}.hero-tiles .tile:nth-child(3){transform:translateY(-10px) rotate(4deg)}.hero-tiles .tile:nth-child(4){transform:rotate(11deg)}.orbit{position:absolute;left:-26px;top:-36px;width:360px;height:210px;border:1px solid #a5b99320;border-radius:50%;transform:rotate(-10deg);z-index:-1}.intro-foot{display:flex;gap:20px;color:#9fb4a7;font-size:10px;letter-spacing:1px}.intro-foot span+span:before{content:'·';margin-right:20px;color:var(--gold)}.entry-panel{background:linear-gradient(140deg,#1b3431,#152927);border:1px solid #c6d7bf20;box-shadow:0 24px 80px #0003;border-radius:10px;overflow:hidden}.tab-list{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line);padding:0 28px}.tab-list button{background:transparent;color:var(--muted);padding:19px 0;font-size:14px;border-bottom:2px solid transparent}.tab-list button.active{color:var(--gold);border-bottom-color:var(--gold)}form{padding:28px 35px 24px}.form-heading{margin-bottom:22px}.form-heading h2{margin-top:7px;font-size:24px;font-weight:500;letter-spacing:1px}label{display:block;font-size:12px;color:#ccd4c8}input:not([type=checkbox]),select{display:block;width:100%;min-height:44px;border:1px solid #ffffff26;background:#0c211f;color:var(--text);border-radius:4px;padding:10px 12px;margin:7px 0 17px}input::placeholder{color:#7f938a}select{appearance:auto}input[type=checkbox]{accent-color:var(--gold);width:17px;height:17px;flex-shrink:0;margin:0;cursor:pointer}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.wide{grid-column:1/-1}.config-details{border-top:1px solid var(--line);padding:13px 0;color:var(--text)}summary{cursor:pointer;font-size:12px;min-height:24px}summary span{float:right;font-size:10px;color:var(--muted)}.hint{font-size:11px;color:var(--muted);margin:9px 0;line-height:1.8}.special-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px 15px;margin:14px 0}.special{display:flex;align-items:center;justify-content:space-between;gap:5px;min-height:36px;font-size:11px}.special span{display:flex;align-items:center;gap:5px;white-space:nowrap}.special select{width:85px;padding:5px 3px;font-size:10px;min-height:34px;margin:0}.special small{font-size:10px;color:var(--muted)}.boundaries ol{padding-left:20px;font-size:11px;color:var(--muted)}.boundaries li{margin:9px 0}.consent{display:flex;align-items:flex-start;gap:9px;margin:15px 0;font-size:10px;line-height:1.8}.consent input{margin-top:2px}.error{font-size:12px;color:#ffb0a1;margin-bottom:12px}.footnote{text-align:center;font-size:10px;color:#8fa399;margin-top:15px;letter-spacing:.3px}.join-note{color:var(--muted);line-height:2;font-size:12px;margin:15px 0 30px}footer{border-top:1px solid var(--line);display:flex;align-items:center;gap:30px;padding:22px 0;color:#9aae9f;font-size:10px;letter-spacing:1px}footer span:last-child{margin-left:auto}.tile{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:42px;height:57px;position:relative;flex-shrink:0;line-height:1;border-radius:4px;border:1px solid #dcd8c6;background:linear-gradient(125deg,#fffef2,#e8e6d6);box-shadow:0 4px 0 #bba779,1px 5px 4px #0006;color:#192f2c;overflow:hidden}.wan{display:flex;align-items:center;flex-direction:column;font-family:"KaiTi","STKaiti",serif;font-weight:bold;width:100%;height:90%;justify-content:center}.wan b{font-size:23px;font-weight:700}.wan em{font-size:22px;font-style:normal;color:#a4332d;margin-top:1px}.honor{font-family:"KaiTi","STKaiti",serif;font-size:32px;font-weight:bold}.h31{color:#ae332b}.h32{color:#176141}.blank{display:block;width:25px;height:33px;border:3px double #497d9c;border-radius:3px}.wild{position:absolute;right:1px;top:2px;background:#a92f26;color:#fff9d4;border-radius:2px;font:6px/1.3 var(--font);padding:1px}.pips{width:85%;height:85%}.pip.c0{fill:#263e4f}.pip.c1{fill:#a23934}.pip.c2{fill:#24634e}.ring{fill:none;stroke:#e8e4c8;stroke-width:1.5}.bamboo,.bird{width:85%;height:90%}.bamboo rect{fill:#226749;stroke:#174b36;stroke-width:1}.bamboo path{stroke:#174b36;stroke-width:2;fill:none}.tile-back{width:100%;height:100%;background:linear-gradient(115deg,#73a895,#367864);border:3px solid #f0eddb;display:grid;place-items:center;border-radius:3px}.tile-back i{width:70%;height:78%;border:1px solid #d2d5aa4d;border-radius:2px;background:repeating-linear-gradient(45deg,transparent 0 3px,#e9dfb710 3px 4px)}.hero-tiles .wan b{font-size:40px}.hero-tiles .wan em{font-size:37px}.hero-tiles .honor{font-size:62px}.hero-tiles .wild{font-size:10px;right:4px;top:4px}.room-app{max-width:1920px;margin:auto;padding:0 26px}.room-header{height:88px;min-height:88px}.room-header .brand{font-size:23px}.room-header .brand-seal{width:39px;height:43px}.room-label{display:flex;align-items:center;gap:12px;margin-right:auto;margin-left:30px;border-left:1px solid var(--line);padding-left:30px}.room-label>span{color:var(--muted);font-size:12px}.room-label>b{font-family:Georgia,serif;font-weight:400;font-size:24px;letter-spacing:3px;color:var(--gold)}.icon-button{display:grid;place-items:center;min-width:44px;min-height:44px;background:transparent;color:var(--muted)}.icon-button svg{width:17px}.header-right{display:flex;align-items:center;gap:12px}.connection{color:#b8d1b5;font-size:10px;display:flex;align-items:center;gap:6px}.connection:before{content:'';width:5px;height:5px;border-radius:100%;background:#96bf90}.connection.offline{color:#efb692}.room-layout{display:grid;grid-template-columns:minmax(0,1fr) 224px;gap:22px;padding:22px 0 18px}.arena{position:relative;min-height:650px;height:calc(100vh - 173px);max-height:940px;background:radial-gradient(ellipse at 50% 48%,#2d6b5d,#174b44 70%);border:12px solid #233b32;border-radius:22px;box-shadow:0 2px 0 #7b7250,inset 0 0 0 2px #afb18d55,inset 0 0 45px #0006,0 12px 30px #0004;overflow:hidden;isolation:isolate}.table-grain{position:absolute;inset:0;opacity:.2;background-image:repeating-linear-gradient(0deg,transparent 0 2px,#0001 2px 3px),repeating-linear-gradient(90deg,transparent 0 2px,#fff1 2px 3px);pointer-events:none;z-index:-1}.table-line{position:absolute;inset:10% 12% 20%;border:1px solid #a8c5a422;clip-path:polygon(6% 0,94% 0,100% 8%,100% 92%,94% 100%,6% 100%,0 92%,0 8%);pointer-events:none}.table-caption{position:absolute;left:50%;top:19%;transform:translateX(-50%);font-family:"KaiTi",serif;font-size:21px;color:#c6d5b229;letter-spacing:8px;text-align:center;white-space:nowrap}.table-caption span{display:block;font-family:var(--font);font-size:8px;letter-spacing:3px;margin-top:3px}.player{position:absolute;display:flex;gap:10px;align-items:center;z-index:5;padding:8px 12px;background:#102b28cf;border:1px solid #a8b99a33;border-radius:7px;min-width:145px;box-shadow:0 5px 14px #0002}.avatar{width:44px;height:44px;display:grid;place-items:center;position:relative;border-radius:5px;overflow:hidden;border:1px solid #e2d7ab77;background:#b0ae7c;flex-shrink:0}.avatar i{position:absolute;inset:-12px;transform:rotate(40deg);background:repeating-linear-gradient(90deg,transparent 0 9px,#19382a15 9px 10px)}.avatar b{font-family:"KaiTi",serif;color:#fdf6df;font-size:25px;z-index:1}.avatar-1{background:#9a6c58}.avatar-2{background:#667d88}.avatar-3{background:#7c7d59}.player strong{font-size:12px;font-weight:500;display:block;white-space:nowrap}.player>div>span{display:flex;gap:11px;align-items:center}.score{font:20px/1.6 Georgia,serif;color:var(--gold)}.player small{font-size:9px;color:var(--muted)}.dealer{font-size:9px;background:var(--gold);color:#263b2b;font-weight:500;padding:1px 3px;border-radius:2px;margin-left:3px}.turn{border-color:var(--gold);box-shadow:0 0 0 2px #dfc48615,0 0 20px #d6d39c10}.turn-indicator{width:6px;height:6px;background:var(--gold);border-radius:50%;position:absolute;top:8px;right:7px}.pos-0{bottom:150px;left:25px}.pos-1{right:16px;top:27%}.pos-2{right:20%;top:15px}.pos-3{left:16px;top:27%}.waiting .pos-0{left:50%;bottom:120px;transform:translateX(-50%)}.waiting .pos-1{top:47%;right:25px}.waiting .pos-2{right:auto;left:50%;transform:translateX(-50%);top:55px}.waiting .pos-3{top:47%;left:25px}.center-board{position:absolute;left:50%;top:43%;transform:translate(-50%,-50%);width:158px;min-height:164px;background:linear-gradient(130deg,#152e2b,#1d3933);box-shadow:0 7px 0 #112c26,0 10px 12px #0005,inset 0 0 0 2px #b8be8f33;border:2px solid #7a8f6e;border-radius:12px;text-align:center;padding:12px;z-index:1}.round-label{color:#bed2bc;font-size:10px;letter-spacing:1px}.round-label span{margin-left:10px;color:#91ab98}.wall-count{font:40px/1.25 Georgia,serif;color:var(--gold)}.compass{display:flex;justify-content:center;gap:8px;font-size:8px;color:#91a793;padding:7px 0;border-top:1px solid #d8d5ab22;margin-top:5px}.compass .current{color:var(--gold);text-decoration:underline;text-underline-offset:4px}.red-status{font-size:9px;color:#c3cdb5;white-space:nowrap}.red-status b{color:var(--gold);margin-left:5px;font-size:14px}.center-lobby{width:350px;padding:30px 25px;background:#14352ce6;top:46%;border-color:#b4b78a66;min-height:235px}.center-lobby h2{font-family:"KaiTi",serif;font-size:28px;font-weight:400;margin:12px 0}.center-lobby p{color:var(--muted);font-size:13px;margin-bottom:20px}.center-lobby p strong{color:var(--gold);font:23px Georgia,serif;letter-spacing:4px;margin-left:12px}.center-lobby small{display:block;color:var(--muted);margin-top:12px;font-size:10px}.hidden-hand{position:absolute;display:flex;gap:2px}.hidden-hand .tile{width:25px;height:36px;border-radius:2px;box-shadow:0 3px 0 #baa979,1px 4px 5px #0004}.hidden-hand .tile-back{border-width:2px}.hidden-2{top:25px;left:20px;max-width:48%;flex-wrap:wrap}.hidden-1{right:12px;top:42%;width:28px;gap:0;transform:translateY(-20%)}.hidden-3{left:12px;top:42%;width:28px;gap:0;transform:translateY(-20%)}.hidden-1 .tile,.hidden-3 .tile{width:30px;height:19px;border-bottom:0;box-shadow:2px 2px 0 #baa979}.river{position:absolute;display:grid;grid-template-columns:repeat(6,27px);gap:4px 2px;z-index:2;max-height:calc(36px*4 + 4px*3)}.river-tile{width:27px;height:36px;border-radius:2px;box-shadow:0 2px 0 #baa979,1px 3px 3px #0005}.river-tile .wan b{font-size:15px}.river-tile .wan em{font-size:13px}.river-tile .honor{font-size:23px}.river-tile .blank{width:16px;height:23px;border-width:2px}.river-tile .wild{font-size:5px}.river-0{left:50%;top:60%;transform:translateX(-50%)}.river-2{left:50%;bottom:70%;transform:translateX(-50%) rotate(180deg)}.river-1{left:calc(50% + 130px);top:47%;transform:translateY(-50%) rotate(-90deg)}.river-3{right:calc(50% + 130px);top:47%;transform:translateY(-50%) rotate(90deg)}.latest{outline:2px solid var(--gold);outline-offset:1px}.melds{position:absolute;display:flex;gap:10px;z-index:3}.meld{display:flex;gap:1px}.meld-tile{width:25px;height:34px}.meld-tile .wan b{font-size:15px}.meld-tile .wan em{font-size:13px}.meld-tile .honor{font-size:22px}.melds-0{bottom:132px;right:25px}.melds-2{top:85px;left:30px;transform:rotate(180deg)}.melds-1{right:50px;bottom:190px;transform-origin:right bottom;transform:rotate(-90deg)}.melds-3{left:50px;bottom:190px;transform-origin:left bottom;transform:rotate(90deg)}.hand{position:absolute;left:50%;bottom:74px;display:flex;gap:3px;transform:translateX(-50%);width:max-content;max-width:98%;padding:13px 3px 7px;z-index:6}.hand-tile{width:clamp(30px,3.4vw,51px);height:clamp(45px,4.8vw,72px);padding:0;overflow:visible;border-radius:4px}.hand-tile .wan b{font-size:clamp(20px,2.2vw,32px)}.hand-tile .wan em{font-size:clamp(18px,2vw,29px)}.hand-tile .honor{font-size:clamp(28px,3.2vw,45px)}.hand-tile:disabled{opacity:1;cursor:default}.hand-tile:hover:not(:disabled){transform:translateY(-8px)}.hand-tile.selected{transform:translateY(-13px);outline:2px solid var(--gold);outline-offset:2px;box-shadow:0 5px 0 #bea86d,0 10px 20px #0007}.hand-tile.drawn{margin-left:13px}.action-bar{position:absolute;left:0;bottom:0;width:100%;min-height:65px;background:#0b2b25a6;border-top:1px solid #e7d79a22;display:flex;align-items:center;justify-content:center;gap:10px;padding:9px 15px;z-index:7}.action-prompt{font-size:11px;color:#c4d1bd;letter-spacing:.5px;margin-right:8px}.action-bar .primary,.action-bar .secondary{min-height:40px;font-size:12px;padding:8px 18px}.win-button{background:#e0a366;color:#382f1c}.table-aside{display:flex;flex-direction:column;padding:5px 4px}.aside-section{padding:18px 0 25px;border-bottom:1px solid var(--line)}.aside-section:first-child{padding-top:5px}.aside-section h2{font-size:16px;font-weight:400;letter-spacing:1px;margin:7px 0 17px}.rule-row{display:flex;justify-content:space-between;align-items:center;margin:13px 0;font-size:11px;color:var(--muted)}.rule-row b{font-size:13px;font-weight:500;color:var(--text)}.text-button{background:transparent;padding:0;color:var(--gold);font-size:11px;min-height:32px;display:inline-flex;gap:5px;align-items:center}.text-button svg{width:13px}.game-log{padding:0;margin:0;list-style:none;font-size:10px;color:var(--muted);max-height:240px;overflow:auto;scrollbar-width:thin}.game-log li{padding:6px 0 6px 12px;border-left:1px solid #b2be9c3d;position:relative}.game-log li:before{content:'';width:3px;height:3px;border-radius:50%;background:#b9c6a3;position:absolute;left:-2px;top:13px}.game-log li:first-child{color:var(--gold)}.table-tip{margin-top:auto;display:flex;gap:12px;align-items:center;padding-top:25px}.table-tip>span{font:30px "KaiTi",serif;color:var(--red);border:1px solid #a3403444;width:42px;height:48px;display:grid;place-items:center;border-radius:4px}.table-tip p{font-size:10px;color:#9bb2a2;line-height:1.9}.room-footer{padding:10px 0;font-size:9px}.room-footer .text-button{min-height:24px;font-size:9px}.loading{min-height:100vh;display:flex;flex-direction:column;gap:16px;align-items:center;justify-content:center;color:var(--gold)}#toast{position:fixed;left:50%;top:20px;transform:translate(-50%,-20px);background:#f2e5c9;color:#173c2c;box-shadow:0 8px 30px #0005;border-radius:7px;padding:13px 25px;z-index:100;opacity:0;pointer-events:none;transition:.2s;max-width:90%;text-align:center}#toast.show{opacity:1;transform:translate(-50%,0)}dialog{color:var(--text);background:linear-gradient(130deg,#1b3731,#112925);border:1px solid #d4c59166;border-radius:12px;max-width:min(740px,94vw);width:740px;max-height:88vh;padding:35px;box-shadow:0 25px 100px #0008;line-height:1.9}dialog::backdrop{background:#001913b8;backdrop-filter:blur(5px)}dialog h2{font:30px/1.4 "KaiTi",serif;margin:10px 0 24px}dialog h3{font-size:14px;font-weight:500;margin:20px 0 12px}dialog p{color:#c1cebd;font-size:12px;margin:12px 0}dialog .full{margin-top:22px}.close-dialog{position:absolute;right:12px;top:8px;width:44px;height:44px;background:none;color:var(--muted);font-size:28px}.formula{padding:14px 20px;border:1px solid #d8c18d44;border-radius:5px;background:#e0cb9410;color:var(--gold);font:16px/1.8 Georgia,var(--font)}.boundary-list{list-style:none;padding:0;display:grid;gap:12px}.boundary-list li{display:flex;gap:15px;font-size:11px;color:var(--muted)}.boundary-list b{color:var(--gold);font:12px Georgia,serif}.config-summary{background:#ffffff08;padding:12px;font-size:13px;border-radius:4px;color:var(--gold)}.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px 30px;padding:20px 0;border-bottom:1px solid var(--line);font-size:11px}.summary-grid>span{display:flex;justify-content:space-between;gap:20px}.summary-grid b{color:var(--gold);font-weight:400}.win-detail{display:flex;gap:30px;align-items:center;font-size:12px;color:var(--muted);flex-wrap:wrap}.win-detail .tile{width:32px;height:45px;margin-left:8px}.code-tiles{display:flex;gap:5px;flex-wrap:wrap;padding-bottom:8px}.code-tiles .tile{width:35px;height:48px}.hit{outline:2px solid var(--gold);outline-offset:1px}.winner-detail{border:1px solid #ddd0a830;border-radius:5px;padding:0 18px 5px;margin:18px 0}.winner-detail h3{display:flex;justify-content:space-between}.positive{color:#d6d99b}.ledger-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:12px}th,td{border-bottom:1px solid var(--line);text-align:right;padding:10px 7px;white-space:nowrap}th{font-size:10px;color:var(--muted);font-weight:400}th:first-child,td:first-child{text-align:left}.reveal-hand{display:flex;gap:3px;flex-wrap:wrap;padding-bottom:6px}.reveal-hand .tile{width:28px;height:38px}.reveal-hand .wan b{font-size:17px}.reveal-hand .wan em{font-size:15px}.reveal-hand .honor{font-size:24px}.settle-option{display:flex;width:100%;flex-direction:column;gap:5px;padding:22px;text-align:left;background:#e6d0990d;border:1px solid #d7c5936e;border-radius:6px;margin:15px 0}.settle-option:hover{background:#e6d09920}.settle-option b{font-size:16px;color:var(--gold)}.settle-option span{font-size:12px;color:var(--muted)}
@media(min-width:1600px){.arena{min-height:760px}.river{grid-template-columns:repeat(6,34px);gap:5px 3px}.river-tile{width:34px;height:47px}.river-tile .wan b{font-size:20px}.river-tile .wan em{font-size:18px}.river-tile .honor{font-size:28px}.river-1{left:calc(50% + 165px)}.river-3{right:calc(50% + 165px)}.river-2{bottom:69%}.center-board{width:176px}.hand-tile{width:58px;height:81px}.hand-tile .wan b{font-size:36px}.hand-tile .wan em{font-size:32px}.hand-tile .honor{font-size:49px}.room-layout{grid-template-columns:minmax(0,1fr) 260px}}
@media(max-width:1150px){.home-main{gap:6%}.home{padding:0 4%}.intro-foot{gap:8px;font-size:9px}.intro-foot span+span:before{margin-right:8px}.entry-panel form{padding:25px}.room-layout{grid-template-columns:minmax(0,1fr)}.table-aside{display:none}.arena{height:calc(100vh - 160px)}.room-header{height:80px;min-height:80px}.room-app{padding:0 16px}.hand-tile{width:45px;height:64px}.hand-tile .wan b{font-size:28px}.hand-tile .wan em{font-size:26px}.hand-tile .honor{font-size:39px}.pos-1,.pos-3{top:24%}}
@media(max-width:760px){.home-main{grid-template-columns:1fr;padding-top:20px;gap:30px}.intro{padding-top:5px}.intro .eyebrow{font-size:10px}h1{font-size:45px;margin:17px 0 14px}.intro-copy{font-size:12px}.hero-tiles{position:absolute;right:4px;top:75px;gap:4px;transform:scale(.67);transform-origin:right center;margin:0}.hero-tiles .tile{width:52px;height:74px}.hero-tiles .wan b{font-size:29px}.hero-tiles .wan em{font-size:28px}.hero-tiles .honor{font-size:45px}.orbit{display:none}.intro-foot{margin-top:24px;font-size:8px}.edition{display:none}.home header{min-height:90px}.brand{font-size:23px}.home-main{padding-bottom:35px}.entry-panel form{padding:24px}.home footer{gap:10px;font-size:8px}.home footer span:first-child{display:none}.room-app{padding:0 6px}.room-header{gap:6px;min-height:65px;height:65px}.room-header .brand{font-size:18px;gap:7px;letter-spacing:1px}.room-header .brand small{font-size:5px;letter-spacing:1px}.room-header .brand-seal{width:29px;height:35px;font-size:25px}.room-label{margin:0 0 0 10px;padding-left:12px;gap:3px}.room-label>span{display:none}.room-label>b{font-size:19px;letter-spacing:2px}.room-label .icon-button{min-width:32px}.header-right{gap:0}.header-right .quiet{font-size:10px;gap:3px;padding:8px}.header-right .quiet svg{display:none}.connection{display:none}.room-layout{padding:8px 0;gap:0}.arena{border-width:6px;border-radius:12px;height:calc(100dvh - 115px);min-height:650px}.player{min-width:104px;padding:5px;gap:5px;border-radius:5px}.avatar{width:30px;height:34px}.avatar b{font-size:22px}.player strong{font-size:10px;max-width:90px;overflow:hidden;text-overflow:ellipsis}.score{font-size:16px}.player>div>span{gap:4px}.player small{font-size:7px}.pos-0{bottom:152px;left:9px}.pos-1{right:8px;top:22%}.pos-3{left:8px;top:22%}.pos-2{top:9px;right:10px}.center-board{width:112px;min-height:137px;padding:9px 5px;top:43%;border-radius:8px}.wall-count{font-size:33px}.round-label{font-size:8px}.compass{font-size:7px;gap:6px}.red-status{font-size:7px}.red-status b{font-size:12px}.hidden-2{top:15px;left:10px;width:52%;max-width:52%;gap:1px}.hidden-2 .tile{width:12px;height:22px;box-shadow:0 2px 0 #baa979}.hidden-2 .tile-back{border-width:1px}.hidden-1,.hidden-3{top:43%;width:18px}.hidden-1{right:3px}.hidden-3{left:3px}.hidden-1 .tile,.hidden-3 .tile{width:18px;height:14px}.hidden-hand .tile-back{border-width:1px}.river{grid-template-columns:repeat(6,19px);gap:3px 1px}.river-tile{width:19px;height:27px;box-shadow:0 2px 0 #baa979}.river-tile .wan b{font-size:11px}.river-tile .wan em{font-size:10px}.river-tile .honor{font-size:17px}.river-tile .blank{width:12px;height:17px;border-width:1px}.river-tile .wild{display:none}.river-0{top:59%}.river-2{bottom:70%}.river-1{left:calc(50% + 55px);top:43%}.river-3{right:calc(50% + 55px);top:43%}.hand{gap:1px;bottom:85px;max-width:100%;padding-left:1px;padding-right:1px}.hand-tile{width:clamp(21px,6.3vw,39px);height:clamp(34px,9.2vw,57px);border-radius:3px}.hand-tile .wan b{font-size:clamp(14px,4.1vw,24px)}.hand-tile .wan em{font-size:clamp(13px,3.8vw,22px)}.hand-tile .honor{font-size:clamp(21px,5.5vw,32px)}.hand-tile .wild{font-size:5px;right:0;top:1px}.hand-tile .blank{width:16px;height:24px;border-width:2px}.hand-tile.drawn{margin-left:4px}.action-bar{min-height:75px;gap:7px;padding:7px;flex-wrap:wrap}.action-bar .action-prompt{font-size:9px;flex-basis:100%;text-align:center;margin:0;line-height:1.2}.action-bar .primary,.action-bar .secondary{min-height:38px;padding:7px 15px;font-size:11px}.center-lobby{width:230px;top:42%;padding:20px 12px;min-height:220px}.center-lobby h2{font-size:25px}.center-lobby .eyebrow{font-size:8px}.waiting .pos-0{bottom:160px}.waiting .pos-1,.waiting .pos-3{top:63%;min-width:100px}.waiting .pos-1{right:10px}.waiting .pos-3{left:10px}.waiting .pos-2{top:35px}.table-caption{top:15%;font-size:15px}.table-caption span{font-size:6px;letter-spacing:1px}.room-footer{font-size:7px;padding:4px 3px;gap:5px}.room-footer span:first-child{max-width:65%}.room-footer .text-button{font-size:8px}.melds-0{bottom:143px;right:8px}.meld-tile{width:17px;height:25px}.meld-tile .wan b{font-size:10px}.meld-tile .wan em{font-size:9px}.meld-tile .honor{font-size:16px}.melds{gap:5px}.melds-2{top:59px;left:10px}.melds-1{right:27px;bottom:202px}.melds-3{left:27px;bottom:202px}dialog{padding:27px 20px;max-height:90dvh}dialog h2{font-size:26px}.formula{font-size:13px;padding:12px}.win-detail{gap:14px;font-size:11px}.code-tiles .tile{width:28px;height:39px}.code-tiles .wan b{font-size:16px}.code-tiles .wan em{font-size:15px}.code-tiles .honor{font-size:25px}.summary-grid{gap:10px 15px;font-size:10px}}
@media(max-height:560px) and (min-width:761px){.room-header{min-height:60px;height:60px}.arena{min-height:510px}.room-layout{padding-top:8px}.room-header .brand{font-size:19px}.room-header .brand-seal{height:35px;width:31px}.hand{bottom:65px}.player.pos-0{bottom:136px}.hand-tile{width:35px;height:49px}.action-bar{min-height:58px}.hand-tile .wan b{font-size:23px}.hand-tile .wan em{font-size:20px}.hand-tile .honor{font-size:31px}}
.seat-bot{display:block;position:absolute;top:100%;left:0;width:100%;background:#102d28;border:1px solid #d4c08a66;color:var(--gold);padding:6px 4px;font-size:10px;min-height:34px;border-radius:0 0 5px 5px}.seat-bot:hover{background:#2c4e3e}
.hidden-1,.hidden-3{flex-direction:column;flex-wrap:nowrap}
@media(max-width:760px){.seat-bot{font-size:9px;min-height:32px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

.recover-seat{margin-bottom:18px;font-size:11px;min-height:40px;padding:8px 10px}

/* Keep every operation visible and reserve space above it for the local hand. */
.arena{min-height:700px}
.playing-actions{min-height:100px;flex-direction:column;gap:7px;padding:9px 14px}
.operation-message{display:flex;align-items:center;justify-content:center;gap:14px;font-size:12px;color:#dbe1cc;line-height:1.5;text-align:center}
.operation-help{background:none;color:var(--gold);font-size:10px;padding:2px 5px;text-decoration:underline;text-underline-offset:3px;min-height:24px}
.operation-buttons{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap}
.operation-buttons button:disabled{opacity:.48;box-shadow:none;background:#173b33;border:1px solid #b7c1ab55;color:#b8c4b0}
.operation-reasons b{color:var(--gold)}
.hand{bottom:116px}
.pos-0{bottom:204px}
.melds-0{bottom:188px}
.melds-1,.melds-3{bottom:210px;transform:none;flex-direction:column;gap:7px}
.melds-1{right:60px}.melds-3{left:60px}
.river{max-height:calc(36px*2 + 4px*1);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;padding-bottom:4px}
.river-0{top:56%}
@media(max-width:760px){
 .arena{min-height:700px}
 .playing-actions{min-height:100px;padding:6px;gap:4px}
 .operation-message{font-size:10px;gap:6px}
 .operation-help{font-size:9px;min-height:28px}
 .operation-buttons{gap:5px}
 .operation-buttons .primary,.operation-buttons .secondary{padding:8px 10px;min-height:40px;font-size:11px}
 .hand{bottom:116px}
 .pos-0{bottom:187px}
 .melds-0{bottom:176px}
 .melds-1{right:28px}.melds-3{left:28px}
 .melds-1,.melds-3{bottom:215px;gap:6px}
 .river-0{top:57%}
}

/* Ivory face, softly rounded bevel, visible jade resin body and table shadow. */
.tile{overflow:visible;isolation:isolate;background:linear-gradient(115deg,#fffff7 0%,#f6f5ea 56%,#e3e3d5 100%);border:1px solid #d1d3c4;border-radius:5px;box-shadow:0 1px 0 #ffffffeb,inset 1px 1px 1px #fff,inset -1px -2px 2px #d0d2bf;transform-style:flat}
.tile:before{content:'';position:absolute;inset:5px -1px -7px 1px;border-radius:5px;background:linear-gradient(90deg,#6c9f89,#4d856e 78%,#32634f);border:1px solid #2e5c49;box-shadow:1px 3px 2px #061a1377,3px 7px 9px #00160f70;z-index:-1;pointer-events:none}
.tile:after{content:'';position:absolute;inset:0;border-radius:4px;box-shadow:inset 0 2px 1px #ffffffd9,inset -2px -1px 2px #a5ad982d;pointer-events:none}
.tile-art{display:block;width:93%;height:94%;overflow:visible;filter:drop-shadow(0 .3px .1px #011a1320)}
.tile-calligraphy{font-family:"KaiTi","STKaiti","楷体",serif;font-weight:400;paint-order:stroke;stroke-width:.35px;stroke:currentColor}
.tile-art .numeral{font-size:59px;letter-spacing:-2px}.tile-art .myriad{font-size:66px}.tile-art .honor-letter{font-size:86px}
.tile-back{display:flex;align-items:center;justify-content:center;background:linear-gradient(110deg,#80ad95,#54917a 60%,#427a63);border:3px solid #ecefe1;border-radius:4px;width:100%;height:100%;box-shadow:inset 0 0 0 1px #2f654e}
.tile-back .tile-art{width:100%;height:100%;filter:none}
.tile-back i{display:none}.tile .wild{font-size:6px;padding:2px;top:3px;right:2px;background:#a4372d;color:#fff0c9;line-height:1;border:1px solid #c96a4e;box-shadow:0 1px 2px #0002}
.hand{perspective:none;gap:4px;align-items:flex-end;padding-bottom:12px}
.hand-tile{height:clamp(57px,5.4vw,79px);width:clamp(39px,3.8vw,56px);transform:none;border-radius:5px;box-shadow:inset 1px 2px 2px #fff,inset -1px -1px 2px #a1a99733}
.hand-tile:before{inset:5px -1px -9px 1px;border-radius:5px;box-shadow:1px 3px 2px #001e1370,3px 9px 10px #00160f70}
.hand-tile:hover:not(:disabled){transform:translateY(-9px)}.hand-tile.selected{transform:translateY(-16px);box-shadow:inset 1px 1px 2px #fff,0 0 0 2px var(--gold)}
.hand-tile:disabled{opacity:1}.hand-tile.drawn{margin-left:14px}
.hero-tiles .tile{box-shadow:inset 1px 2px 1px #fff}.hero-tiles .tile:before{bottom:-11px;box-shadow:3px 12px 20px #0005}
.river .tile:before,.meld .tile:before{inset:3px -1px -4px 1px;border-radius:3px;box-shadow:1px 2px 2px #00180d70,1px 4px 4px #00180d40}
.river .tile,.meld .tile{border-radius:3px}
.hidden-hand{width:max-content;max-width:none;flex-direction:row;flex-wrap:nowrap;gap:2px;z-index:2}
.hidden-hand .tile{width:29px;height:43px;box-shadow:inset 0 1px 1px #fff}
.hidden-hand .tile:before{inset:4px -1px -6px 1px;border-radius:3px}
.hidden-hand .tile-back{border-width:2px}
.hidden-2{left:50%;right:auto;top:19px;transform:translateX(-50%) rotate(180deg)}
.hidden-1{left:auto;right:28px;top:43%;transform:translate(50%,-50%) rotate(90deg)}
.hidden-3{right:auto;left:28px;top:43%;transform:translate(-50%,-50%) rotate(-90deg)}
.pos-2{top:81px;right:22px}.pos-1,.pos-3{top:20%}
.waiting .pos-1,.waiting .pos-3{top:47%}.waiting .pos-2{top:55px;right:auto}
@media(min-width:1600px){.hand-tile{width:58px;height:85px}.hidden-hand .tile{width:34px;height:49px}}
@media(max-width:1150px){.hand-tile{width:45px;height:67px}}
@media(max-width:760px){
 .hand{gap:2px;padding-bottom:10px}.hand-tile{width:clamp(20px,6vw,39px);height:clamp(33px,9.1vw,59px)}
 .hand-tile.drawn{margin-left:5px}.hand-tile:before{bottom:-6px}
 .hidden-hand{gap:1px}.hidden-hand .tile{width:17px;height:27px}.hidden-hand .tile-back{border-width:1px}
 .hidden-hand .tile:before{bottom:-4px}.hidden-2{top:14px;width:max-content;max-width:none;left:50%}
 .hidden-1{right:17px;top:43%;width:max-content}.hidden-3{left:17px;top:43%;width:max-content}
 .pos-2{top:58px;right:9px}.pos-1,.pos-3{top:16%}
 .waiting .pos-2{top:35px}.waiting .pos-1,.waiting .pos-3{top:63%}
 .tile .wild{font-size:5px;padding:1px;right:1px;top:2px}
}

.tile>.tile-art{position:relative;z-index:0;width:100%;height:100%;padding:2px;background:linear-gradient(110deg,#fffff8,#f2f1e7 70%,#e8e8dc);border-radius:inherit;filter:none}
.tile>.tile-back{position:relative;z-index:0}
.pos-2{top:25px;right:22px}.pos-1{right:62px}.pos-3{left:62px}.pos-0{left:62px}
.waiting .pos-0{left:50%}.waiting .pos-1{right:25px}.waiting .pos-3{left:25px}.waiting .pos-2{top:55px;right:auto}
.arena{min-height:600px}
@media(max-height:800px) and (min-width:761px){
 .room-header{min-height:72px;height:72px}.room-layout{padding:12px 0 10px}
 .arena{height:calc(100dvh - 145px);min-height:490px}
 .room-footer{padding:5px 0}.room-footer .text-button{min-height:22px}
 .center-board:not(.center-lobby){top:37%;min-height:132px;padding:8px}
 .wall-count{font-size:32px}.compass{padding:5px 0}
 .river-0{top:56%}
 .hand{bottom:106px}.pos-0{bottom:184px}.melds-0{bottom:174px}
 .playing-actions{min-height:90px;padding:6px 12px;gap:4px}
 .hidden-hand .tile{width:23px;height:34px}
 .melds-1,.melds-3{bottom:185px}
}
@media(max-width:760px){.pos-2{top:58px;right:9px}.pos-1{right:40px}.pos-3{left:40px}.pos-0{left:9px}.waiting .pos-2{top:35px;right:auto}.waiting .pos-1{right:10px}.waiting .pos-3{left:10px}.waiting .pos-0{left:50%}}
@media(max-width:760px) and (max-height:750px){.arena{height:calc(100dvh - 110px);min-height:560px}}

.pos-0{left:24%}.waiting .pos-0{left:50%}
@media(max-width:760px){.pos-0{left:9px}.waiting .pos-0{left:50%}.melds-1,.melds-3{bottom:240px}}

.melds-2{top:72px}.melds-1,.melds-3{bottom:226px}
@media(max-height:800px) and (min-width:761px){.melds-1,.melds-3{bottom:201px}}
@media(max-width:760px){.melds-2{top:54px}.melds-1,.melds-3{bottom:256px}}

/* Contextual choices appear only beside the tile that triggered them. */
.context-operations{position:absolute;z-index:30;visibility:hidden;max-width:calc(100% - 16px);padding:9px 10px 11px;border:1px solid #d7bc83b8;border-radius:8px;background:linear-gradient(135deg,#193b31f7,#0b2821f7);box-shadow:0 9px 25px #00140cc9;isolation:isolate}
.context-operations.positioned{visibility:visible}
.context-operations:after{content:'';position:absolute;right:15px;bottom:-6px;width:10px;height:10px;transform:rotate(45deg);background:#102e25;border-right:1px solid #d7bc83b8;border-bottom:1px solid #d7bc83b8;z-index:-1}
.context-label{display:block;font-size:10px;line-height:1.5;color:#e3d3af;letter-spacing:1px;margin:0 1px 7px}
.context-buttons{display:flex;gap:7px;flex-wrap:wrap}
.context-buttons .primary,.context-buttons .secondary{min-width:44px;min-height:44px;padding:8px 13px;font-size:13px}
.arena.playing-table .hand{bottom:48px}
.arena.playing-table .pos-0{bottom:151px}
.arena.playing-table .melds-0{bottom:145px}
.match-complete{gap:14px;font-size:12px;color:var(--gold)}
.match-ledger{margin:22px 0}.match-ledger td{padding:15px 8px}.match-ledger td:last-child{font-size:19px}.match-ledger small{display:block;font-size:10px;font-weight:400}.my-result{background:#e6d0930b}.negative{color:#efb29f}
@media(max-width:760px){.context-operations{padding:8px;max-width:calc(100% - 16px)}.context-buttons{gap:6px}.context-buttons .primary,.context-buttons .secondary{min-width:44px;min-height:44px;padding:8px 11px;font-size:12px}.context-label{font-size:9px}.arena.playing-table .hand{bottom:42px}.arena.playing-table .pos-0{bottom:130px}.arena.playing-table .melds-0{bottom:125px}.match-complete{flex-wrap:wrap;padding:9px}.match-ledger td{padding:12px 6px;font-size:11px}}


/* Original artwork already includes its bevel and green backing. */
.tile,.hero-tiles .tile,.hidden-hand .tile,.river .tile,.meld .tile,.hand-tile,.hand-tile:disabled,.hand-tile.selected{background:transparent;border:0;box-shadow:none;filter:none;transform-style:flat;border-radius:0}
.tile:before,.tile:after{content:none;display:none}
.tile-image{position:absolute;inset:0;display:block;pointer-events:none}
.tile-art,.tile-image>.supplied-art{display:block;width:100%;height:100%;padding:0;background:transparent;filter:none;overflow:hidden}
.hand{perspective:none;gap:3px}
.hand-tile,.hand-tile:disabled{transform:none}
.hand-tile:hover:not(:disabled){transform:translateY(-9px)}
.hand-tile.selected{transform:translateY(-16px);outline:2px solid var(--gold);outline-offset:2px}
.tile-back{background:#4e856d;box-shadow:none}
.tile .wild{box-shadow:none}

/* Melds stay on each player's own left; choices stay beside the local hand. */
.own-tiles{position:absolute;left:50%;bottom:116px;transform:translateX(-50%);display:flex;align-items:flex-end;gap:18px;width:max-content;max-width:96%;z-index:6}
.arena.playing-table .own-tiles{bottom:48px}
.own-tiles .hand{position:static;left:auto;bottom:auto;transform:none;max-width:none}
.own-tiles .melds-0{position:static;left:auto;right:auto;bottom:auto;transform:none;margin-bottom:10px;flex-shrink:0}
.own-tiles .melds-0:empty{display:none}
.melds-2{top:20px;right:7%;left:auto;bottom:auto;transform:rotate(180deg);flex-direction:row}
.melds-1{left:calc(100% - 20px);right:auto;top:auto;bottom:24%;transform-origin:0 100%;transform:rotate(-90deg);flex-direction:row;width:max-content}
.melds-3{left:54px;right:auto;top:24%;bottom:auto;transform-origin:0 0;transform:rotate(90deg);flex-direction:row;width:max-content}
@media(max-width:760px){
 .own-tiles{bottom:116px;gap:8px;max-width:98%}.arena.playing-table .own-tiles{bottom:42px}
 .own-tiles .hand{gap:1px;padding-left:0;padding-right:0}
 .own-tiles .hand-tile{width:clamp(15px,calc((100vw - 60px)/18),39px);height:clamp(23px,calc((100vw - 60px)/12.3),59px)}
 .own-tiles .hand-tile.drawn{margin-left:4px}
 .own-tiles .melds{gap:4px}.own-tiles .meld-tile{width:clamp(12px,calc((100vw - 80px)/22),17px);height:clamp(18px,calc((100vw - 80px)/15),25px)}
 .melds-2{top:14px;right:5%;left:auto}.melds-1{left:calc(100% - 7px);bottom:24%;right:auto}.melds-3{left:32px;top:24%;bottom:auto}
}

/* Keep every opponent's exposed groups beside their concealed row. */
.seat-tiles{position:absolute;display:flex;align-items:flex-end;gap:8px;width:max-content;max-width:none;z-index:2}
.seat-tiles .hidden-hand{position:static;left:auto;right:auto;top:auto;bottom:auto;transform:none;max-width:none;width:max-content}
.seat-tiles .melds{position:static;left:auto;right:auto;top:auto;bottom:auto;transform:none;flex-direction:row;gap:7px;width:max-content}
.seat-tiles .melds:empty{display:none}
.seat-tiles-1{left:calc(100% - 28px);top:43%;transform:translate(-50%,-50%) rotate(-90deg)}
.seat-tiles-2{left:50%;top:19px;transform:translateX(-50%) rotate(180deg)}
.seat-tiles-3{left:28px;top:43%;transform:translate(-50%,-50%) rotate(90deg)}
@media(max-width:760px){.seat-tiles{gap:5px}.seat-tiles-1{left:calc(100% - 17px)}.seat-tiles-3{left:17px}.seat-tiles-2{top:14px}.seat-tiles .melds{gap:4px}}

.round-review{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 18px;color:var(--gold);font-size:12px}
.round-review [data-review-seconds]{font-size:22px;font-variant-numeric:tabular-nums}
.round-review [data-review-count]{color:var(--muted);font-size:11px}
dialog .round-review{margin-top:20px;padding:14px;border:1px solid #d7bc8344;border-radius:6px;background:#e3c48c09}
.review-bar{gap:12px;flex-wrap:wrap}.review-bar .round-review{gap:6px 12px}
@media(max-width:760px){.review-bar{padding:7px;gap:5px}.review-bar .round-review{font-size:10px;gap:4px 8px}.review-bar .primary,.review-bar .secondary{min-height:44px;padding:7px 10px;font-size:11px}.review-bar [data-review-seconds]{font-size:18px}}

.settlement-hands{display:grid;gap:10px;margin:12px 0 20px}
.settlement-player{padding:10px 12px;background:#ffffff04;border:1px solid #ffffff12;border-radius:5px;min-width:0}
.settlement-winner{background:#e3c48c0a;border-color:#d7bc8355}
.settlement-player-label{display:flex;align-items:center;gap:10px;line-height:1.5;font-size:12px;margin-bottom:9px}
.settlement-player-label b{font-weight:500}.settlement-player-label span{font-size:10px;color:var(--muted)}
.settlement-player-label strong{margin-left:auto;font-size:14px}
.settlement-tile-row,.settlement-concealed{display:flex;align-items:flex-end;gap:3px;flex-wrap:wrap;min-width:0}
.settlement-meld{display:flex;gap:1px;margin-right:8px}
.settlement-tile{width:clamp(22px,3.8vw,34px);height:clamp(33px,5.6vw,50px)}
.settlement-tile.winning-tile{margin-left:7px;outline:2px solid var(--gold);outline-offset:1px}
.round-review small{color:var(--muted);font-size:11px}
@media(max-width:520px){.settlement-player{padding:8px}.settlement-tile{width:clamp(15px,calc((100vw - 105px)/15),24px);height:clamp(23px,calc((100vw - 105px)/10.2),36px)}.settlement-tile-row,.settlement-concealed{gap:1px}.settlement-meld{margin-right:5px}.settlement-player-label{font-size:11px}}

.settlement-meld{flex-direction:column;gap:4px}.settlement-meld small{font-size:9px;line-height:1.4;color:var(--gold);white-space:nowrap}.settlement-meld-tiles{display:flex;gap:1px}

.table-motion{position:absolute;z-index:14;pointer-events:none}.motion-tile{width:100%;height:100%}
.table-action-label{position:absolute;z-index:18;pointer-events:none;max-width:calc(100% - 16px);padding:5px 10px;border:1px solid #d7bc8388;border-radius:5px;background:#0d2823f5;color:var(--gold);font-size:12px;line-height:1.6;white-space:nowrap}
.table-action-label.action-hu{font-size:17px;background:#7f3029;color:#fff0c9;border-color:#e3c48c}
@media(max-width:760px){.table-action-label{font-size:10px;padding:4px 7px}.table-action-label.action-hu{font-size:14px}}

dialog .round-review{position:sticky;top:0;z-index:5;margin:10px 0;padding:8px 10px;background:#17372e;gap:6px 10px}dialog .round-review>span:first-child{font-size:11px}
.settlement-player{padding:8px 10px}.settlement-hands{gap:6px}.settlement-player-label{margin-bottom:6px}.settlement-tile{width:clamp(22px,3.4vw,30px);height:clamp(33px,5vw,44px)}
@media(max-width:520px){.settlement-tile{width:clamp(15px,calc((100vw - 105px)/15),24px);height:clamp(23px,calc((100vw - 105px)/10.2),36px)}}

/* First click previews winning draws; the second click still discards. */
.listening-panel{position:absolute;z-index:21;visibility:hidden;padding:10px 12px 8px;border:1px solid #d7bc8388;border-radius:7px;background:#102f28f5;color:var(--text);pointer-events:none;max-width:calc(100% - 16px)}
.listening-panel.positioned{visibility:visible}.listening-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;font-size:12px}.listening-heading b{font-weight:500;color:var(--gold)}.listening-heading>span{font-size:10px;color:var(--muted)}
.listening-waits{display:flex;align-items:flex-start;flex-wrap:wrap;gap:7px 9px;max-height:180px;overflow:hidden}
.listening-option{display:flex;align-items:center;flex-direction:column;gap:5px}.listening-tile{width:29px;height:43px}.listening-option small{font-size:11px;color:var(--gold);line-height:1.2}.listening-option.exhausted{opacity:.45}.listening-panel p{font-size:9px;color:var(--muted);line-height:1.5;margin-top:7px}.listening-panel.compact{font-size:11px;color:var(--muted);width:max-content}
@media(max-width:760px){.listening-panel{padding:8px}.listening-heading{font-size:10px;gap:5px;margin-bottom:6px}.listening-heading>span{font-size:9px}.listening-waits{gap:6px;max-height:132px}.listening-tile{width:23px;height:34px}.listening-option small{font-size:10px}.listening-panel p{font-size:8px;margin-top:5px}}
.listening-waits{max-height:none;overflow:visible}

/* Mobile web: safe-area controls and a fixed landscape table. */
button,a,input,select{touch-action:manipulation}
.media-controls{display:flex;align-items:center;gap:3px;flex-wrap:wrap}.media-controls button{min-height:44px;white-space:nowrap}.media-controls [aria-pressed=true]{color:var(--gold)}
[data-media]{position:relative}.voice-status{position:absolute;right:0;top:100%;z-index:40;max-width:290px;width:max-content;white-space:normal;padding:6px 10px;background:#102e28;border:1px solid #e3c48c44;border-radius:5px;font-size:10px;color:var(--muted)}
.hand-guide{display:none}.header-right{flex-wrap:wrap}.room-header{gap:12px}.room-label{margin-right:0}.home header [data-media]{margin-left:auto}
[data-landscape]{display:none}
@media(max-width:760px){
 .room-app{padding:0 max(5px,env(safe-area-inset-right)) 0 max(5px,env(safe-area-inset-left))}
 .room-header{height:auto;min-height:104px;display:flex;flex-wrap:wrap;padding:6px 4px;gap:0 12px}
 .room-header .brand{flex:1}.room-label{margin:0;border:0;padding:0}.room-label .icon-button{min-width:44px}
 .header-right{width:100%;justify-content:flex-end;gap:2px}.header-right .quiet{min-height:44px;font-size:11px;padding:7px 9px}.connection{display:inline;font-size:9px;margin-right:auto}.header-right [data-media]{margin-left:auto}
 .room-layout{padding:3px 0}.arena{height:calc(100dvh - 143px - env(safe-area-inset-bottom));min-height:570px;border-width:5px}
 .arena .own-tiles{left:0;bottom:116px;transform:none;width:100%;max-width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:0 6px;z-index:8}
 .arena.playing-table .own-tiles{bottom:22px}
 .own-tiles .hand{display:flex;justify-content:flex-start;gap:3px;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;padding:22px 4px 5px;scrollbar-width:thin;scroll-padding:4px}
 .own-tiles .hand-tile{flex:0 0 34px;width:34px;height:51px}.own-tiles .hand-tile.drawn{margin-left:9px}.own-tiles .hand-tile:hover:not(:disabled){transform:none}.own-tiles .hand-tile.selected{transform:translateY(-13px)}
 .own-tiles .melds-0{margin:0 0 -16px 4px;gap:8px;max-width:100%;flex-wrap:wrap}.own-tiles .meld-tile{width:20px;height:30px}.hand-guide{display:block;align-self:center;font-size:9px;color:#d8dfcb99;line-height:1.6}
 .arena.playing-table .pos-0{bottom:150px;left:12px}.pos-0{bottom:240px}.arena.playing-table .pos-0:has(~.own-tiles .meld:not(:empty)){bottom:165px}
 .pos-2{top:49px;right:10px}.pos-1,.pos-3{top:24%}.player{min-width:100px}.player strong{max-width:82px}
 .seat-tiles-2{top:9px}.seat-tiles .hidden-hand{display:flex;flex-direction:row;gap:1px}.seat-tiles .hidden-hand .tile{width:13px;height:20px}.seat-tiles .meld-tile{width:13px;height:20px}
 .center-board{width:88px;min-height:112px;top:43%;padding:7px 3px}.wall-count{font-size:29px}.compass{gap:3px;font-size:6px}.red-status{font-size:6px}.round-label{font-size:7px}.river{grid-template-columns:repeat(6,16px);gap:2px 0}.river-tile{width:16px;height:24px}.river-0{top:58%}.river-2{bottom:68%}.river-1{left:calc(50% + 42px)}.river-3{right:calc(50% + 42px)}
 .seat-bot{min-height:44px}.action-bar .primary,.action-bar .secondary{min-height:44px}.waiting .pos-0{bottom:130px}.waiting .pos-2{top:45px}.center-lobby{width:220px;min-height:210px;top:42%}
 .home header{flex-wrap:wrap;padding:12px 0;gap:5px;min-height:90px}.home header .quiet{font-size:11px;padding:8px;min-height:44px}.home header [data-media]{margin-left:auto}.home .brand{font-size:21px}.home .brand-seal{width:32px;height:39px;font-size:27px}
 dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(94dvh - env(safe-area-inset-bottom));padding:24px 14px}.close-dialog{z-index:8;background:#17372e;border-radius:6px}dialog .round-review{top:-24px;padding-right:28px}.room-footer{padding-bottom:max(4px,env(safe-area-inset-bottom))}
}
@media(max-height:520px) and (min-width:600px), (max-width:760px) and (orientation:portrait){
 .room-app{padding:0 max(6px,env(safe-area-inset-left))}.room-header{height:50px;min-height:50px;padding:0;flex-wrap:nowrap}.room-header .brand{font-size:18px;flex:0 0 auto}.brand small{display:none}.room-header .brand-seal{width:27px;height:32px;font-size:23px}.room-label{margin-left:8px;padding-left:8px}.room-label>b{font-size:19px}.header-right{width:auto;flex:1;flex-wrap:nowrap}.header-right .quiet{font-size:10px;padding:5px 8px}.connection{display:none}.room-layout{padding:3px 0}.arena{height:calc(100dvh - 79px);min-height:290px;border-width:4px}.room-footer{padding:0;font-size:7px}
 .arena .own-tiles,.arena.playing-table .own-tiles{bottom:8px;left:50%;transform:translateX(-50%);width:max-content;max-width:94%;padding:0;flex-direction:row;align-items:flex-end;gap:12px}.arena:not(.playing-table) .own-tiles{bottom:77px}.own-tiles .hand{width:max-content;max-width:100%;gap:2px;padding:18px 3px 2px;overflow-x:auto}.own-tiles .hand-tile{width:30px;height:45px;flex:0 0 30px}.own-tiles .melds-0{margin:0 0 3px;max-width:190px}.own-tiles .meld-tile{width:18px;height:27px}.hand-guide{display:none}
 .player{padding:4px;min-width:108px}.avatar{width:26px;height:30px}.avatar b{font-size:20px}.player strong{font-size:9px}.score{font-size:16px}.player small{font-size:7px}.arena.playing-table .pos-0,.arena.playing-table .pos-0:has(~.own-tiles .meld:not(:empty)){bottom:82px;left:50px}.pos-0{bottom:148px;left:50px}.pos-2{top:10px;right:40px}.pos-1{top:29%;right:30px}.pos-3{top:29%;left:30px}
 .seat-tiles-2{top:7px}.seat-tiles-1{left:calc(100% - 13px);top:44%}.seat-tiles-3{left:13px;top:44%}.seat-tiles .hidden-hand{display:flex;flex-direction:row;gap:1px}.seat-tiles .hidden-hand .tile,.seat-tiles .meld-tile{width:11px;height:17px}.seat-tiles .melds{gap:4px}.center-board{width:85px;min-height:100px;top:42%;padding:6px 3px}.wall-count{font-size:26px}.round-label{font-size:7px}.compass{font-size:6px;gap:4px}.red-status{font-size:6px}.river{grid-template-columns:repeat(6,15px);gap:1px}.river-tile{width:15px;height:22px}.river-0{top:58%}.river-2{bottom:69%}.river-1{left:calc(50% + 47px);top:40%}.river-3{right:calc(50% + 47px);top:40%}.action-bar{min-height:66px;padding:4px}.review-bar .round-review{font-size:10px;gap:4px 8px}.waiting .pos-0{bottom:78px}.waiting .pos-1,.waiting .pos-3{top:45%}.waiting .pos-2{top:13px}.center-lobby{width:230px;min-height:175px;top:40%;padding:12px}.center-lobby h2{font-size:23px;margin:8px}.table-caption{display:none}
}
@media(max-width:1000px){.room-header [data-landscape]{display:inline-flex}}
@media(max-width:760px) and (orientation:portrait){
 body:has(.room-app){overflow:hidden}
 .room-app{position:fixed;left:100%;top:0;width:100dvh;height:100dvw;transform-origin:0 0;transform:rotate(90deg);padding:0 max(6px,env(safe-area-inset-bottom));overflow:hidden}
 .room-app .arena{height:100%;min-height:0}.room-app .room-layout{height:auto}.room-app .hand{overflow:visible}.room-app .own-tiles .hand-tile{flex:0 0 30px}
 body:has(.room-app) dialog{position:fixed;inset:auto;left:50%;top:50%;margin:0;transform:translate(-50%,-50%) rotate(90deg);width:min(740px,calc(100dvh - 20px));max-width:calc(100dvh - 20px);max-height:calc(100dvw - 20px)}
 body:has(.room-app) #toast,body:has(.room-app) #toast.show{top:50%;left:50%;transform:translate(-50%,-50%) rotate(90deg);max-width:calc(100dvh - 30px)}
}
@media(max-height:520px) and (min-width:600px), (max-width:760px) and (orientation:portrait){
 .arena .player{min-width:0;width:max-content;max-width:118px;padding:4px 6px;gap:5px;border-radius:5px}
 .arena .avatar{width:23px;height:27px}.arena .avatar b{font-size:18px}.arena .player strong{font-size:9px;line-height:1.4;max-width:78px}.arena .score{font-size:14px;line-height:1.2}.arena .player small{font-size:7px;line-height:1.2}.arena .player>div>span{gap:4px}.arena .dealer{font-size:7px;padding:0 2px}.arena .turn-indicator{width:4px;height:4px;right:4px;top:5px}
 .arena .pos-2{right:30px;top:8px}.arena .pos-1{right:30px;top:27%}.arena .pos-3{left:30px;top:27%}
 .arena.playing-table .pos-0,.arena.playing-table .pos-0:has(~.own-tiles .meld:not(:empty)){left:45px;bottom:80px}
 .arena .listening-panel.compact{padding:5px 9px;max-width:260px;font-size:10px;border-radius:5px;background:#102f28ed}.listening-panel{padding:7px 9px}.listening-heading{font-size:10px;margin-bottom:5px}.listening-heading>span{font-size:9px}.listening-waits{gap:5px 7px}.listening-tile{width:22px;height:33px}.listening-option{gap:3px}.listening-option small{font-size:9px}.listening-panel p{font-size:8px;margin-top:5px}
 .arena .center-board:not(.center-lobby){width:76px;min-height:90px;padding:5px 3px}.arena .wall-count{font-size:24px;line-height:1.1;margin:6px 0}.arena .round-label{font-size:7px;letter-spacing:0;white-space:nowrap}.arena .red-status{padding-top:5px}.arena .compass{padding-top:5px;padding-bottom:5px}
}
@media(max-height:520px) and (min-width:600px), (max-width:760px) and (orientation:portrait){
 body:has(.room-app){overflow:hidden}
 .room-app{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.room-app .room-header{flex:0 0 50px}.room-app .room-layout{flex:1;min-height:0;display:block;padding:3px 0;height:auto}.room-app .arena{height:100%;min-height:0}.room-app .room-footer{flex:0 0 16px;min-height:16px;line-height:1;padding:0}
 .arena{--table-short:100dvh;--river-band:clamp(22px,calc((var(--table-short) - 300px)/2),44px)}
 .arena .center-board:not(.center-lobby){top:42%;width:78px;height:82px;min-height:82px;padding:5px 3px;box-shadow:0 3px 0 #112c26,inset 0 0 0 1px #b8be8f33}
 .arena .round-label{line-height:1.3}.arena .round-label span{margin-left:4px}.arena .wall-count{display:block;font-size:24px;line-height:1;margin:3px 0}.arena .compass{margin-top:3px;padding:3px 0;font-size:6px;line-height:1.2}.arena .red-status{padding:0;font-size:7px;line-height:12px}.arena .red-status b{font-size:10px;margin-left:3px}
 .arena .river{max-height:var(--river-band);padding-bottom:0;grid-template-columns:repeat(6,15px);gap:1px}.arena .river-0{top:calc(42% + 54px);bottom:auto}.arena .river-2{top:auto;bottom:calc(58% + 54px)}.arena .river-1{left:calc(50% + 75px);right:auto;top:42%}.arena .river-3{right:calc(50% + 75px);left:auto;top:42%}
}
@media(max-width:760px) and (orientation:portrait){.room-app{height:100dvw}.arena{--table-short:100dvw}}

/* Touch dragging uses table coordinates, including the rotated phone layout. */
.own-tiles .hand-tile{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.hand-tile img{pointer-events:none;-webkit-user-drag:none}.hand-tile.drag-source{opacity:.3}
.hand-drag-preview{position:absolute;z-index:30;pointer-events:none;will-change:transform}
.hand-drag-preview .hand-drag-tile{width:100%;height:100%}
.hand-drag-preview.ready .hand-drag-tile{outline:2px solid var(--gold);outline-offset:2px}
.hand-drag-label{position:absolute;left:50%;bottom:calc(100% + 9px);transform:translateX(-50%);width:max-content;padding:3px 7px;border:1px solid #d7bc8388;border-radius:4px;background:#102f28f5;color:var(--text);font-size:10px;line-height:1.5;white-space:nowrap}
.hand-drag-preview.ready .hand-drag-label{color:var(--gold)}

/* The supplied artwork already carries the bevel, so depth comes from a contact
   shadow plus travel: a lifted tile leaves its shadow on the felt, a flat one
   does not. Only wide viewports pay for this, since the phone table is dense. */
@media(min-width:761px){
 .own-tiles .hand{gap:5px}
 .own-tiles .hand-tile{filter:drop-shadow(0 1px 1px #00160f59) drop-shadow(0 5px 4px #00160f38);transition:transform .15s cubic-bezier(.2,1.2,.4,1),filter .15s ease-out}
 .own-tiles .hand-tile:hover:not(:disabled){transform:translateY(-12px);filter:drop-shadow(0 2px 1px #00160f4d) drop-shadow(0 11px 9px #00160f4a)}
 .own-tiles .hand-tile.selected{transform:translateY(-22px);filter:drop-shadow(0 3px 1px #00160f47) drop-shadow(0 15px 12px #00160f52)}
 .own-tiles .hand-tile.drawn{margin-left:20px}
 .river-tile,.meld .tile{filter:drop-shadow(0 1px 1px #00160f4d)}
}
/* A tile in flight sits well above the felt, so it keeps a wide soft shadow. */
.hand-drag-preview .hand-drag-tile{filter:drop-shadow(0 2px 2px #00160f80) drop-shadow(0 9px 12px #00160f99)}

/* The same integer-row rule for the breakpoints that are not the phone table.
   Row height = tile height + row gap, and each band below is the largest whole
   row count that still fits inside the band it replaces, so nothing new can
   overlap the hand or the players. */
@media (min-width:1600px){.river{max-height:calc(47px*2 + 5px*1)}}
@media (max-width:760px){.river{max-height:calc(24px*4 + 2px*3)}}
@media (max-width:760px) and (max-height:750px){.river{max-height:calc(24px*3 + 2px*2)}}

/* Phone discard areas: the band used to be clamp(22px,(100dvh-300px)/2,44px),
   which is 37.5px on a 375px-tall phone while a row of 22px tiles plus its gap
   is 23px. 37.5 / 23 = 1.63 rows, so the second row was sliced in half -- the
   cropping reported from real phones. The band is now derived from whole rows,
   and the two top/bottom rivers are widened so 13 to 16 discards still reach
   sixteen slots instead of spilling into a third row. */
@media (max-height:520px) and (min-width:600px), (max-width:760px) and (orientation:portrait){
  .arena{--river-row:23px;--river-rows:2;--river-band:calc(var(--river-row)*var(--river-rows) - 1px)}
  .arena .center-board:not(.center-lobby){height:66px;min-height:66px;padding:4px 3px}
  .arena .wall-count{font-size:21px;margin:1px 0}
  .arena .river{max-height:var(--river-band);overflow-y:auto;overflow-x:hidden;padding-bottom:0;align-content:start}
  .arena .river-0,.arena .river-2{grid-template-columns:repeat(8,15px)}
  .arena .river-1,.arena .river-3{grid-template-columns:repeat(7,15px)}
  .arena .river-0{top:calc(42% + 46px);bottom:auto}
  .arena .river-2{top:auto;bottom:calc(58% + 46px)}
  .arena .river-1{left:calc(50% + 72px);right:auto;top:42%}
  .arena .river-3{right:calc(50% + 72px);left:auto;top:42%}
}

/* The volume panel is a body-level fixed box, so renderRoom() can rebuild the
   whole table without interrupting a drag of either slider. */
.audio-mixer{position:fixed;right:12px;bottom:12px;z-index:60;display:grid;gap:8px;width:min(244px,calc(100vw - 24px));padding:12px 14px;border-radius:14px;background:#0f221b;border:1px solid #2c4a3e;box-shadow:0 14px 34px #001009;}
.audio-mixer[hidden]{display:none}
.mixer-head{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#d6e8dd;font-weight:600;font-size:13px}
.mixer-row{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:10px;color:#a6c1b3;font-size:12px}
.mixer-row input[type="range"]{width:100%;height:22px;accent-color:#7fd6a8;background:transparent}
.mixer-note{margin:0;color:#7d998b;font-size:11px;line-height:1.55}
