*{box-sizing:border-box}
:root{--ink:#202e28;--muted:#606c62;--paper:#fffdf6;--ground:#f0eee3;--green:#143e33;--green2:#215747;--line:#deded1;--gold:#f9c07a;--red:#a83a35;--shadow:0 14px 40px #19392b12}
body{margin:0;background:var(--ground);color:var(--ink);font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;line-height:1.5;-webkit-tap-highlight-color:transparent}
button,a,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.48}button:focus-visible,a:focus-visible{outline:3px solid #d99240;outline-offset:3px}input:focus-visible{outline:2px solid #2f7058;outline-offset:1px}
[hidden]{display:none!important}.apphead{max-width:1110px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:20px 28px 14px;min-height:76px}.brand,.head-actions,.row,.section-heading,.cardline,.seatlist li,.ledger-row,.foot-actions,.deskmeta,.moneyline,.dialog-actions{display:flex;align-items:center}.brand{gap:10px;font-size:22px;letter-spacing:.08em;font-weight:820;line-height:1.1}.brand small{display:block;color:var(--muted);font-size:10px;letter-spacing:.18em;font-weight:550;margin-top:4px}.mark{height:41px;width:37px;border-radius:9px;background:var(--green);color:var(--gold);display:grid;place-items:center;font-family:Georgia,serif;font-size:32px;line-height:1;transform:rotate(-5deg)}.head-actions{gap:10px}.quiet,.textbtn{border:0;background:transparent;color:var(--green);font-weight:650}.quiet{padding:7px 14px;border:1px solid #c4c9b9;border-radius:30px;font-size:13px}.connection{font-size:12px;color:var(--muted)}.connection:before,.online:before{content:"";display:inline-block;width:7px;height:7px;background:#34865d;border-radius:50%;margin-right:6px}.connection.off:before{background:#c7833e}
#app{max-width:1110px;padding:12px 28px 36px;margin:auto}h1,h2,h3,p{margin:0}h1,h2,h3{line-height:1.25}h1{font-size:clamp(30px,4.4vw,52px);letter-spacing:-.045em}h2{font-size:22px}h3{font-size:16px}.sub,.hint,.mini{color:var(--muted)}.sub{font-size:14px}.hint{font-size:13px}.mini{font-size:12px}.panel{background:var(--paper);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)}.lobby{display:grid;grid-template-columns:1.08fr .92fr;gap:20px;align-items:stretch}.hero{position:relative;isolation:isolate;overflow:hidden;min-height:510px;background:radial-gradient(ellipse at 80% 90%,#2d6049 0%,#1c493a 42%,#12382e 80%);color:#fff9e5;border-radius:22px;padding:44px 42px;display:flex;flex-direction:column;justify-content:space-between}.hero:before,.hero:after{content:"";inset:14px;position:absolute;border:1px solid #e5d4a535;border-radius:15px;pointer-events:none;z-index:-1}.hero:after{inset:19px;border-color:#e5d4a518;border-radius:11px}.hero h1{font:700 clamp(55px,6vw,82px)/1.1 "STKaiti","KaiTi","Noto Serif CJK SC",serif;letter-spacing:.05em;margin:10px 0 13px}.hero-kicker{font:italic 20px/1.1 Georgia,serif;color:#f4c489;letter-spacing:.015em}.hero-desc{font-size:14px;color:#e3e5d7;letter-spacing:.12em}.hero-foot{position:relative;z-index:2;font-size:13px;color:#f3d4a4;letter-spacing:.12em}.fan{position:absolute;right:17%;bottom:15%;width:128px;height:175px;pointer-events:none}.fan .playing-card{position:absolute;inset:0;width:100%;height:100%;transform-origin:50% 110%;box-shadow:0 7px 18px #001f1970;--rank:34px;--pip:68px;border-radius:12px}.fan .playing-card:nth-child(1){transform:rotate(-32deg) translateX(-24px)}.fan .playing-card:nth-child(2){transform:rotate(-7deg)}.fan .playing-card:nth-child(3){transform:rotate(19deg) translateX(18px)}
.lobby-form,.room-panel,.results{padding:28px}.lobby-form{display:flex;flex-direction:column;gap:20px}.tabs{display:flex;background:#edeee4;border-radius:11px;padding:4px;gap:3px}.tabs button{flex:1;min-height:40px;border:0;background:transparent;border-radius:8px;font-weight:700;color:var(--muted)}.tabs button.selected{background:var(--paper);box-shadow:0 2px 5px #143e3320;color:var(--green)}.field{display:grid;gap:7px;font-size:14px;font-weight:650}.field input,.input{width:100%;min-width:0;border:1px solid #c9d0c2;border-radius:10px;padding:11px 13px;background:white;color:var(--ink);font-size:16px}.field input::placeholder{color:#899288;font-size:14px}.hand-picks{display:flex;gap:10px}.hand-picks label{flex:1;position:relative;cursor:pointer}.hand-picks input{position:absolute;width:1px;height:1px;opacity:0}.hand-picks span{display:block;border:1px solid #cad0c3;border-radius:9px;text-align:center;padding:9px}.hand-picks input:checked+span{color:var(--green);border-color:var(--green);background:#eaf0e5;box-shadow:inset 0 0 0 1px var(--green)}.hand-picks input:focus-visible+span{outline:3px solid #d99240}.stack,.form-fields{display:grid;gap:15px}.btn{border:1px solid transparent;border-radius:10px;min-height:43px;padding:9px 15px;font-weight:700;line-height:1.3;background:var(--green);color:white}.btn:hover:not(:disabled){filter:brightness(1.08)}.btn.gold{background:var(--gold);color:#352519}.btn.soft{background:#e8eddf;color:var(--green)}.btn.line{background:transparent;color:var(--ink);border-color:#c7cdbf}.btn.danger{background:#f7e8df;color:#923b32}.btn.large{width:100%;min-height:48px}.foot-actions{justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:auto;padding-top:12px;border-top:1px solid var(--line)}.foot-actions a,.share-link{color:var(--green);font-size:13px;font-weight:650;text-underline-offset:3px}.banner,.alert{padding:12px 14px;background:#e8eee2;border-radius:10px;font-size:13px;color:var(--green)}.alert{background:#f8e7dc;color:#8b3b32}.resume{display:flex;align-items:center;gap:12px;justify-content:space-between}.section-heading{justify-content:space-between;gap:10px}.page-title{margin:0 0 16px}.page-title h1{font-size:30px}.page-title .sub{margin-top:6px}.room-grid{display:grid;grid-template-columns:1fr .77fr;gap:18px}.invite-code{font-family:ui-monospace,"Cascadia Code",monospace;font-size:clamp(40px,6vw,64px);font-weight:700;letter-spacing:.1em;color:var(--green);line-height:1.25}.invite-box{background:#e9eddc;border-radius:17px;padding:22px;margin:18px 0}.seatlist,.ledger{list-style:none;padding:0;margin:0}.seatlist li,.ledger-row{gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}.seatlist li:last-child,.ledger-row:last-child{border:0}.label-end{margin-left:auto;text-align:right}.avatar{border-radius:50%;width:36px;height:36px;background:#dce4cf;color:var(--green);display:inline-grid;place-items:center;flex-shrink:0;font-weight:800}.avatar.empty{background:transparent;border:1px dashed #afb9a8;color:#73816f}.ellipsis{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.badge{font-size:11px;padding:2px 6px;border-radius:5px;background:#e0ead8;color:var(--green);white-space:nowrap}.rulelist{margin:0;padding-left:20px;display:grid;gap:9px;font-size:14px}.rulelist strong{color:var(--green)}.room-panel .rulelist{margin:18px 0}.btn-row{display:flex;gap:8px;flex-wrap:wrap}.btn-row .btn{flex:1}.muted{color:var(--muted)}
.table-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(215px,.7fr);align-items:start;gap:16px}.desk-wrap{min-width:0;border-radius:21px;overflow:hidden;background:#0e332a;box-shadow:var(--shadow)}.deskmeta{color:#fff7df;justify-content:space-between;padding:14px 19px;gap:15px;background:#12392f}.deskmeta b{letter-spacing:.025em}.deskmeta .desksub{color:#d2dbc9;font-size:13px}.desk{position:relative;height:clamp(248px,32vw,340px);overflow:hidden;isolation:isolate;background:radial-gradient(ellipse at 50% 45%,#32674d 0%,#21543f 55%,#1c493a 100%)}.desk:before,.desk:after{content:"";position:absolute;inset:8% 4% 3%;border:1px solid #d7bd791e;border-radius:48%;z-index:-1}.desk:after{inset:10% 5% 5%}.pot{position:absolute;top:54%;left:50%;transform:translate(-50%,-50%);text-align:center;color:#e9e0bc;white-space:nowrap}.pot small{display:block;letter-spacing:.14em;font-size:11px}.pot strong{display:block;font:700 42px/1.15 Georgia,serif;color:#ffcf88}.pot span{font-size:12px;color:#dddcc5}.opponent{position:absolute;transform:translate(-50%,-50%);width:25%;text-align:center;color:#f8f7ea;font-size:12px}.opponent .avatar{height:36px;width:36px;background:#efd3a4;color:#2b4234;border:2px solid #e9ead548}.opponent.current .avatar{outline:3px solid var(--gold);outline-offset:2px}.opponent.dim .avatar{background:#758c76}.opponent .ellipsis{font-weight:700;margin-top:2px;text-shadow:0 1px 2px #153a30}.opponent small{font-size:10px;color:#e5e2cd;display:block;white-space:nowrap}.opponent.current small{color:#ffd59c}.desk-self{padding:16px 20px;color:#f8f5e7;display:flex;align-items:center;justify-content:space-between;gap:10px}.self-title strong{display:block;font-size:16px}.self-title small{display:block;color:#d9e2d1;font-size:12px}.self-title .turn{color:var(--gold)}.cardline{gap:5px}.playing-card{position:relative;display:inline-block;flex-shrink:0;width:43px;height:62px;overflow:hidden;border-radius:5px;color:#1d2b27;border:1px solid #e0ddca;background:linear-gradient(135deg,#fffdf5,#ece7d8);box-shadow:0 2px 4px #061f1c33;font-family:Georgia,serif;--rank:17px;--pip:24px}.playing-card.red{color:#a83430}.rank{position:absolute;left:9%;top:3%;font:bold var(--rank)/1.1 Georgia,serif}.pip{position:absolute;inset:0;display:grid;place-items:center;font:var(--pip)/1 Georgia,serif;transform:translate(8%,8%)}.playing-card.back{border:2px solid #eee4cb;background:repeating-linear-gradient(45deg,transparent 0 3px,#eac58a52 3px 4px),repeating-linear-gradient(-45deg,#864932 0 3px,#ac7745 3px 4px)}.playing-card.back:after{content:"♠";position:absolute;inset:12%;display:grid;place-items:center;border:1px solid #e9d2a5;border-radius:3px;background:#864834;color:#f6d7a2;font-size:15px}
.controls{margin-top:12px;padding:17px 19px}.moneyline{justify-content:space-between;gap:8px;margin-bottom:12px}.moneyline .hint{font-variant-numeric:tabular-nums}.turntime{color:var(--green);font-variant-numeric:tabular-nums;font-weight:750}.turntime.urgent{color:var(--red)}.game-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.game-buttons button{font-size:14px}.action-hint{margin-top:9px}.side-log{padding:20px}.side-log h3{margin-bottom:12px}.logs{list-style:none;padding:0;margin:0;font-size:13px}.logs li{padding:7px 0;border-bottom:1px solid var(--line)}.logs li:last-child{border:0}.side-log .btn{margin-top:10px}.compact-actions{margin:12px 0;display:flex;gap:8px;flex-wrap:wrap}.compact-actions button{font-size:12px}.results{margin-top:14px}.result-hero{background:var(--green);color:var(--paper);padding:22px;border-radius:15px;margin:14px 0}.result-hero p{color:#efca91;font-size:13px;margin-bottom:5px}.result-hero h2{line-height:1.45}.signed{font-weight:780;font-variant-numeric:tabular-nums}.signed.pos{color:#28734c}.signed.neg{color:#a8483c}.place{width:25px;color:var(--muted);font:700 18px Georgia,serif}.ledger-row .cardline .playing-card{width:30px;height:43px;--rank:12px;--pip:16px}.history details{padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}.history summary{cursor:pointer}.history p{color:var(--muted);padding:5px 0}.stack hr{width:100%;border:0;border-top:1px solid var(--line)}dialog{width:min(94vw,460px);max-height:min(84vh,700px);margin:auto;padding:22px;border:1px solid var(--line);border-radius:18px;background:var(--paper);color:var(--ink);box-shadow:0 15px 80px #09291f50;overflow:auto}dialog::backdrop{background:#16332880}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}.sheet-head h2{font-size:21px}.round-button{border:0;background:#e8ecdf;color:var(--ink);width:32px;height:32px;border-radius:50%;font-size:22px;line-height:1}.dialog-actions{justify-content:flex-end;gap:8px;margin-top:16px}.chips{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0}.chip{padding:5px 12px;border-radius:18px;border:1px solid #c3cebb;background:#eef1e6;color:var(--green);font-weight:650}.target{display:flex;align-items:center;justify-content:space-between;width:100%;border:1px solid var(--line);border-radius:9px;padding:10px 14px;background:#eff2e8;color:var(--ink);font-weight:680}.field-error{font-size:13px;min-height:18px;color:var(--red)}#toast{position:fixed;z-index:99;max-width:calc(100% - 30px);bottom:max(22px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:#242e26;color:white;padding:10px 17px;border-radius:10px;font-size:14px;box-shadow:var(--shadow);pointer-events:none}.status-screen{max-width:440px;margin:8vh auto;padding:26px}
@media(min-width:740px){.lobby-form{padding:32px}.game-buttons{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:739px){.apphead{padding:12px 15px 7px;min-height:60px}#app{padding:8px 13px max(24px,env(safe-area-inset-bottom))}.lobby,.room-grid,.table-grid{grid-template-columns:1fr;gap:12px}.hero{min-height:172px;border-radius:16px;padding:25px 24px}.hero h1{font-size:47px;margin:4px 0}.hero-kicker{font-size:15px}.hero-desc{font-size:11px}.hero-foot{display:none}.fan{width:66px;height:95px;bottom:20%;right:16%}.fan .playing-card{--rank:20px;--pip:36px;border-radius:6px}.fan .playing-card:nth-child(1){transform:rotate(-27deg) translateX(-10px)}.fan .playing-card:nth-child(3){transform:rotate(19deg) translateX(9px)}.panel{border-radius:15px}.lobby-form,.room-panel,.results{padding:18px}.lobby-form{gap:14px}.side-log{padding:16px}.deskmeta{padding:11px 13px}.desk{height:239px}.desk-wrap{border-radius:15px}.desk-self{padding:10px 13px}.controls{padding:13px}.page-title h1{font-size:25px}.page-title{margin-bottom:12px}.section-heading h2{font-size:19px}.invite-box{margin:12px 0;padding:16px}.apphead .mark{width:32px;height:35px;font-size:26px}.brand{font-size:19px}.brand small{font-size:9px}.room-grid>.room-panel:nth-child(2){box-shadow:none}.results{margin-top:0}.game-buttons .btn{padding:8px 4px;min-height:40px}.pot strong{font-size:37px}.deskmeta .desksub{font-size:12px}.opponent .avatar{width:30px;height:30px}.self-title strong{font-size:14px}.self-title small{font-size:11px}.desk-self .playing-card{width:35px;height:50px;--rank:15px;--pip:21px}.compact-actions{margin:8px 0}.side-log .logs li:nth-child(n+6){display:none}.results .ledger-row{padding:8px 0}}
@media(max-width:360px){.hero{padding:25px 19px}.hero h1{font-size:40px}.fan{right:14%;width:53px;height:80px}.game-buttons .btn{font-size:12px}.invite-code{font-size:34px}.connection{font-size:10px}.table-grid{gap:8px}.desk{height:223px}}
@media(prefers-reduced-motion:no-preference){.btn,.chip,.quiet{transition:filter .15s,background .15s}.btn:active:not(:disabled),.chip:active{transform:translateY(1px)}}
