@font-face{font-family:Fusion;src:url('../fonts/fusion-pixel-12px-zh-hans.woff2') format('woff2');font-display:swap}
:root{--cream:#f4edd9;--muted:#b6c6b6;--slab:#35464c;--edge:#71837e;--ink:#182e36;--coral:#e36359;--blue:#3e85ae;--gold:#e8b85c;--font:Fusion,'Microsoft YaHei',sans-serif}
*{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;overflow:hidden}body{font-family:var(--font);font-size:18px;font-weight:400;background:radial-gradient(ellipse at 35% 30%,#3f7b60,#174b48 70%);color:var(--cream);-webkit-tap-highlight-color:transparent}button,input{font:inherit;color:inherit}button{cursor:pointer;touch-action:manipulation;border:0}button:disabled{cursor:default;opacity:.55}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--gold);outline-offset:5px}input:focus-visible{outline:2px solid var(--gold);outline-offset:2px}a{color:inherit}button{background:none}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#feltFlow{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;opacity:.85}body.is-playing #feltFlow{opacity:.55}.screen-texture{position:fixed;inset:0;pointer-events:none;z-index:100;box-shadow:inset 0 0 140px 30px #041e2b55;background:repeating-linear-gradient(0deg,#0000000b 0 1px,transparent 1px 4px)}body.no-scan .screen-texture{background:none}.slab{background:var(--slab);border:3px solid var(--edge);border-radius:10px;box-shadow:inset 0 2px #98a69c,0 6px #1c333c,0 9px #102b32,0 18px 36px #071e2d33}.btn,.score-plate{--front:#526e73;--light:#829b99;--bottom:#2b474d;display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:13px 22px;border:3px solid var(--light);border-radius:6px;color:var(--cream);background:var(--front);box-shadow:0 5px var(--bottom),0 7px #102a3033;text-shadow:0 2px #0004;font-size:24px;line-height:1.1;white-space:nowrap;transition:transform .13s,box-shadow .13s}.btn:hover:not(:disabled){transform:translateY(-3px) rotate(-.5deg);box-shadow:0 8px var(--bottom),0 10px #102a3033}.btn:active:not(:disabled){transform:translateY(4px);box-shadow:0 1px var(--bottom)}.coral{--front:#dc6258;--light:#f18c76;--bottom:#93433f}.blue-btn{--front:#397eaa;--light:#7ba8bf;--bottom:#275376}.gold{--front:#d9a257;--light:#f4cd83;--bottom:#936636}.green-btn{--front:#4b9777;--light:#86b398;--bottom:#305e50}.purple-btn{--front:#8f74a5;--light:#bca2cc;--bottom:#5c496d}.square-btn{width:42px;height:42px;background:#456162!important;border:2px solid #81968c;border-radius:6px;box-shadow:0 4px #18383d;font-size:24px}.square-btn.small{width:29px;height:29px;font-size:18px}.text-btn,.tiny-link,.lobby-links button{font-size:18px;color:#c9d5bf}.text-btn:hover,.lobby-links button:hover{color:var(--gold)}.muted{color:var(--muted)}.eyebrow{font-size:12px;letter-spacing:3px;color:#e2d7b7}.connection,.toast{position:fixed;z-index:999;left:50%;transform:translateX(-50%);background:#914f48;border:2px solid #ffc2a2;border-radius:6px;padding:12px 20px;max-width:calc(100vw - 24px);text-align:center;font-size:18px}.connection{top:14px}.toast{bottom:24px;box-shadow:0 5px #4c3438}
.lobby{position:relative;width:100%;height:100dvh;display:flex;align-items:center;justify-content:center;padding:50px 20px 25px}.lobby-tools{position:absolute;top:max(22px,env(safe-area-inset-top));left:26px;right:26px;display:flex;justify-content:space-between;align-items:center}.tiny-link{text-decoration:none;font-size:18px}.title-scene{text-align:center;width:min(480px,100%);animation:panelEnter .5s both}.hero-tiles{display:flex;align-items:center;justify-content:center;height:116px;perspective:600px}.hero-tile{width:76px;height:100px;display:flex;align-items:center;justify-content:center;flex:none;background:var(--cream);font-size:60px;border:3px solid #fff5da;border-radius:6px;box-shadow:0 6px #bcb99e,0 9px #173f3a,6px 13px #14302f44;transform:rotate(var(--r)) translateY(var(--y));animation:heroFloat 7s ease-in-out infinite;--r:-17deg;--y:7px;color:#c54d48}.hero-tile:nth-child(2){--r:3deg;--y:-7px;color:#31875f;z-index:1;animation-delay:-2s;margin:0 -5px}.hero-tile:nth-child(3){--r:19deg;--y:10px;color:#397da4;animation-delay:-4s}.title-scene .eyebrow{margin:25px 0 10px;letter-spacing:4px}.title-scene h1{font-size:72px;font-weight:400;letter-spacing:6px;line-height:1.2;transform:rotate(-3deg);text-shadow:0 3px #bcbba6,0 7px #1a3438,3px 10px #10303166}.subtitle{font-size:18px;letter-spacing:2px;color:#d5dfc6;margin:18px 0 26px;text-shadow:0 2px #173b39}.lobby-form{padding:20px 22px 23px}.lobby-form>label{display:block;text-align:left;color:#c1d1be;font-size:12px;margin-bottom:9px}input[type=text],input:not([type]){width:100%;padding:12px 14px;background:#223b40;border:2px solid #193039;border-radius:5px;font-size:24px;box-shadow:inset 0 3px #162f3555}input::placeholder{color:#8fa79f}.lobby-buttons{display:grid;grid-template-columns:1.1fr 1fr;gap:12px;margin-top:15px}.lobby-buttons .btn{font-size:24px;padding:14px 13px}.lobby-buttons span{font-size:15px}.lobby-links{display:flex;align-items:center;justify-content:center;gap:20px;margin-top:23px}.lobby-links span{font-size:12px;color:#b8cdb4}.lobby-links button{font-size:12px}#joinForm{display:flex;gap:9px;padding-top:19px}#joinForm input{min-width:0;font-size:24px;letter-spacing:5px;text-align:center}#joinForm .btn{font-size:18px;padding:10px 17px}.build-stamp{position:absolute;bottom:15px;right:20px;font-size:12px;letter-spacing:2px;color:#9bb69a}
.waiting{position:relative;height:100dvh;display:grid;place-items:center;padding:20px}.waiting-card{width:min(400px,100%);padding:30px;text-align:center}.waiting-card h1{font-size:72px;color:var(--gold);letter-spacing:12px;text-shadow:0 4px #8e643d;margin:12px 0}.wait-players{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:25px 0}.wait-player{display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 8px;border:2px solid #6d8d7e;background:#294740;border-radius:6px;font-size:18px;min-width:0}.wait-player small{font-size:12px;color:#a2b7a7}.wait-player.empty{border-style:dashed;color:#97af9c}.wait-player.own{border-color:var(--gold)}.wait-hint{color:#bdceba;font-size:12px;margin-bottom:20px}.waiting-card>.btn{width:100%;margin-bottom:20px}.waiting-card .text-btn{display:block;margin:auto}#waitOwner{margin-bottom:18px}
.match-layout{position:relative;width:100%;height:100dvh;display:grid;grid-template-columns:238px minmax(0,1fr);gap:14px;padding:14px}.dashboard{display:flex;flex-direction:column;padding:15px 14px 13px;gap:16px;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#84988c #263f44}.dash-title{display:flex;align-items:center;justify-content:space-between;font-size:24px;text-shadow:0 2px #152d35;gap:5px}.round-stamp{display:flex;justify-content:space-between;gap:10px;align-items:center}.round-stamp small{display:block;font-size:12px;color:#b7c8b7;margin-bottom:5px}.round-stamp strong{font-size:48px;line-height:1;color:var(--gold);text-shadow:0 3px #806342}.round-stamp strong span{font-size:24px;color:#c2d2bb}.wall-chip{text-align:center;border:2px solid #203840;border-radius:6px;background:#263e44;padding:8px 10px}.wall-chip b{font-weight:400;font-size:30px;color:#c1d5ba}.total-block{background:#223a41;border:2px solid #19313a;border-radius:6px;text-align:center;padding:10px 8px}.total-block span{display:block;font-size:12px;color:#b6c7b6;margin-bottom:5px}.total-block strong{font-size:42px;font-weight:400;line-height:1;display:block;color:var(--gold);text-shadow:0 3px #815d39}.formula-label{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#c7d4be;margin-bottom:8px}#readyBadge{color:var(--gold)}.formula{display:flex;align-items:center;gap:6px}.chips,.mult{flex:1;flex-direction:column;gap:0;text-align:center;min-width:0;padding:8px 4px}.chips small,.mult small{display:block;font-size:12px;margin-bottom:4px}.chips strong,.mult strong{font-size:36px;line-height:1;font-weight:400;text-shadow:0 3px #0004}.multiply{font-size:24px;font-weight:400;color:#d9ddc9}.combo-block{border-top:2px solid #233b42;padding-top:12px}.combo-block>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px}.combo-block strong{font-size:18px;font-weight:400;color:var(--gold)}.combo-meter{display:grid;grid-template-columns:repeat(12,1fr);gap:3px;margin:8px 0}.combo-meter i{height:8px;border-radius:1px;background:#233c42;box-shadow:inset 0 1px #172d33}.combo-meter i.lit{background:var(--gold);box-shadow:0 2px #856235}.combo-block>small{font-size:12px;color:#acbfad;white-space:nowrap}.ranking-title{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin-bottom:-8px}.ranking-title small{color:#9eb39f}.standings{list-style:none;display:flex;flex-direction:column;gap:6px}.standing{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;padding:7px 6px;gap:5px;background:#2b4046;border:1px solid #63807555;border-radius:4px;font-size:18px}.standing.you{border-color:#bfab6d;background:#485346}.standing .rank{font-size:12px;color:#acbdab}.standing .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.standing .points{color:#f2ca79;font-size:18px}.standing .ai{font-size:10px;color:#91b39d;margin-left:3px}.dash-footer{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-top:auto;padding-top:4px}.dash-footer button{font-size:12px;color:#c7d0ba}.dash-footer button:hover{color:var(--gold)}
.play-stage{container-type:inline-size;position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;border:4px solid #6b9982;border-radius:14px;box-shadow:inset 0 2px #9eb79b,0 6px #17333c;background:linear-gradient(130deg,#2064529c,#154a496b);padding:12px 16px;gap:10px;overflow:hidden}.table-status{display:flex;justify-content:space-between;align-items:center;padding:0 4px;min-height:37px;gap:8px}.table-status>div{display:flex;gap:12px;align-items:center;min-width:0}#turnStatus{font-size:18px;color:#f5d490;white-space:nowrap}#lastAction{font-size:12px;color:#bbceaf;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.turn-clock{font-size:18px;color:#cad6b9;min-width:35px;text-align:right}.turn-clock.urgent{color:#ff9d80}.table-core{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:65px minmax(0,1fr) 65px;grid-template-rows:70px minmax(0,1fr);grid-template-areas:'top top top' 'left pool right';gap:8px 12px}.opponent{position:relative;display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;min-height:0}.top-player{grid-area:top}.left-player{grid-area:left;justify-content:center}.right-player{grid-area:right;justify-content:center}.player-label{background:#21463e;border:2px solid #88ab8770;border-radius:5px;box-shadow:0 3px #153535;padding:4px 8px;font-size:18px;text-align:center;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player-label .wind{color:#9fc6a2;font-size:12px;margin-right:5px}.player-label small{font-size:10px;color:#b4c9ae;margin-left:5px}.opponent.turn .player-label{border-color:var(--gold);background:#53694c;color:#ffe29a}.opponent .backs{display:flex;justify-content:center;gap:3px;max-width:100%;min-height:0}.left-player .backs,.right-player .backs{flex-direction:column;gap:2px}.back{flex:none;position:relative;width:23px;height:31px;border:2px solid #eee5cd;border-radius:3px;background:repeating-linear-gradient(45deg,#5d7d9d 0 2px,#516e8f 2px 4px);box-shadow:0 3px #aab49c,0 5px #133635}.back::after{content:'';position:absolute;inset:3px;border:1px solid #b3c6c7}.left-player .back,.right-player .back{width:29px;height:14px}.op-melds{display:flex;justify-content:center;gap:5px;flex-wrap:wrap}.left-player .op-melds .meld,.right-player .op-melds .meld{flex-direction:column;gap:1px}.left-player .op-melds,.right-player .op-melds{max-width:62px}.discard-zone{grid-area:pool;position:relative;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;border:1px solid #8bae7826;border-radius:40%}.table-mark{position:absolute;font-size:24px;letter-spacing:8px;color:#9cc59320;pointer-events:none}.discard-piles{position:relative;display:flex;flex-wrap:wrap;justify-content:center;align-content:center;gap:7px;width:100%;max-height:100%;overflow:auto;padding:12px 6px 18px;scrollbar-width:thin;scrollbar-color:#73967a #1d5143}.discard-piles .pile{display:contents}.discard-piles .tile:last-child{border-color:#f4cf84}.callout{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;color:#ffda88;font-size:72px;text-shadow:0 5px #694a34,4px 8px #15382c;z-index:8;transform:rotate(-8deg)}
.hand-zone{position:relative;flex:none;min-width:0;padding-top:9px;border-top:1px solid #9abe851f}.hand-heading{display:flex;align-items:center;justify-content:center;gap:15px;font-size:18px;margin-bottom:9px;min-height:21px}#ownName{color:#e5d7a7}#handHint{font-size:12px;color:#c4d7b9}.my-hand{display:flex;justify-content:center;align-items:flex-end;gap:4px;padding:10px 0 7px;perspective:900px;min-height:94px;position:relative}.tile{--ink:#bf4d48;position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:58px;height:80px;border:2px solid #fff5dc;border-bottom-color:#d0c6a8;border-radius:5px;color:var(--ink);background:linear-gradient(145deg,#fff8e7,#eee5c9);box-shadow:0 4px #b7b39a,0 6px #17392f,2px 9px #102e333b;user-select:none;--lift:0px;--rx:0deg;--ry:0deg;transform:translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));transition:transform .14s cubic-bezier(.2,1.35,.4,1),box-shadow .14s;transform-style:preserve-3d}.tile::after{content:'';position:absolute;inset:4px;border:1px solid #c9bd9a29;border-radius:2px;pointer-events:none}.tile .corner{position:absolute;left:4px;top:2px;font-size:10px;line-height:1;z-index:1}.tile .face{display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1;gap:2px;font-size:30px;pointer-events:none}.tile .face span{font-size:24px}.tile .face svg{display:block;width:39px;height:53px}.tile .honor{font-size:42px}.tile .white-dragon{width:30px;height:43px;border:3px solid #50849c;border-radius:2px;box-shadow:inset 0 0 0 2px #f4edda}.tile[data-suit=TIAO]{--ink:#297e58}.tile[data-suit=TONG]{--ink:#3b77a5}.tile[data-suit=FENG]{--ink:#865939}.my-hand .tile{width:min(58px,calc((100cqw - 78px)/14));height:auto;aspect-ratio:58/80;cursor:pointer;padding:0}.my-hand .tile:hover:not(:disabled){--lift:-9px;z-index:3}.my-hand .tile.selected{--lift:-19px!important;--rx:0deg;--ry:0deg;transform:translateY(var(--lift)) rotate(-3deg);border-color:#f8d581;box-shadow:0 4px #b59454,0 6px #17392f,0 0 0 2px #f4c86c,3px 15px #0c323344;z-index:4}.my-hand .tile:disabled{opacity:1;cursor:default}.my-hand .tile:disabled .face{opacity:.86}.my-hand .tile.drawn{animation:tileDeal .32s cubic-bezier(.16,1.4,.4,1) both}.tile.small{width:30px;height:41px;pointer-events:none}.tile.small .corner,.tile.mini .corner{display:none}.tile.small .face{font-size:18px;gap:0}.tile.small .face span{font-size:12px}.tile.small .face svg{width:22px;height:31px}.tile.small .honor{font-size:24px}.tile.small .white-dragon{width:16px;height:24px;border-width:2px}.tile.mini{width:23px;height:31px;pointer-events:none}.tile.mini .face{font-size:12px;gap:0}.tile.mini .face span{font-size:10px}.tile.mini .face svg{width:17px;height:24px}.tile.mini .honor{font-size:18px}.tile.mini .white-dragon{width:12px;height:18px;border-width:2px}.my-melds{display:flex;justify-content:center;gap:12px;min-height:0;margin-bottom:3px}.meld{display:flex;gap:2px}.my-melds:not(:empty)+.my-hand{min-height:80px}.action-bar{display:flex;align-items:center;justify-content:center;gap:10px;min-height:53px;padding:5px 0;flex-wrap:wrap}.action-bar .btn{font-size:24px;padding:10px 23px;min-height:43px}.action-bar .prompt{color:#a8c49f;font-size:18px}.action-bar .chi-choice{font-size:18px;padding:10px 15px}.flying-tile{position:fixed!important;z-index:800;pointer-events:none!important;margin:0!important;transition:none!important}
.dialog{position:fixed;inset:0;margin:auto;width:min(420px,calc(100vw - 30px));max-height:calc(100dvh - 36px);padding:27px 26px 25px;color:var(--cream);font-family:var(--font);font-size:18px;overflow:auto;scrollbar-width:thin;scrollbar-color:#9cae99 #263f44}.dialog[open]{animation:panelEnter .27s cubic-bezier(.2,1.25,.4,1)}.dialog::backdrop{background:#0b2638ba;backdrop-filter:blur(2px)}.dialog h2{font-size:36px;font-weight:400;line-height:1.2;margin-bottom:22px;color:#ffdb87;text-shadow:0 3px #2a3038}.dialog-close{position:absolute;right:13px;top:9px;font-size:30px;color:#bacab5}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:13px 0;border-bottom:1px solid #687f6c33}.setting-row input[type=checkbox]{appearance:none;width:42px;height:24px;position:relative;border:2px solid #18343c;border-radius:4px;background:#253b42;cursor:pointer}.setting-row input[type=checkbox]::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;background:#eee6cb;border-radius:2px;box-shadow:0 2px #a5aa96;transition:transform .16s}.setting-row input[type=checkbox]:checked{background:#4e9b78}.setting-row input[type=checkbox]:checked::after{transform:translateX(17px)}.setting-row input[type=range]{width:120px;accent-color:var(--gold)}#soundTest{width:100%;margin:19px 0 10px;font-size:18px}.setting-note,.credits{font-size:12px;color:#b7c9b3;line-height:1.8}.credits{margin-top:13px}.credits summary{cursor:pointer;color:#d7dfc5}.credits p{padding:8px 0}.credits a{color:var(--gold)}.rules-dialog{width:min(580px,calc(100vw - 28px));line-height:1.6}.rules-dialog .eyebrow{margin-bottom:12px}.rules-dialog h2{margin-bottom:16px}.rules-dialog p{font-size:18px;margin:16px 0}.rules-dialog .muted{font-size:12px}.rule-formula{display:flex;justify-content:center;align-items:center;gap:9px;background:#233e45;border-radius:6px;padding:12px;font-size:24px}.rule-formula span:first-child{color:#8fc8e0}.rule-formula span:nth-child(3){color:#f19d83}.rule-formula span:last-child{color:var(--gold)}.rule-formula b{font-weight:400}.rules-dialog table{width:100%;border-collapse:collapse;font-size:18px;background:#2b4147}.rules-dialog td,.rules-dialog th{padding:8px 10px;text-align:left;border-bottom:1px solid #6579654d;font-weight:400}.rules-dialog th{color:#a6c6b5;font-size:12px}.rules-dialog td:nth-child(2){color:#94c7e2}.rules-dialog td:nth-child(3){color:#f1a18b}
.score-dialog{width:min(620px,calc(100vw - 28px));padding:27px 30px 25px;text-align:center;border-color:#a7a78d}.score-dialog .eyebrow{color:#b6ceb3;font-size:12px}.score-dialog h2{font-size:60px;color:#ffcf70;margin:10px 0 6px;transform:rotate(-3deg);text-shadow:0 4px #9c6940,2px 7px #203538}.score-dialog #scoreWinner{font-size:18px;color:#d4ddc4;margin-bottom:21px}.score-math{display:flex;align-items:center;gap:15px;width:min(320px,100%);margin:0 auto 20px}.score-math>b{font-size:36px;font-weight:400}.score-math .chips strong,.score-math .mult strong{font-size:48px}.score-math .chips,.score-math .mult{padding:13px 8px}.score-factors{display:flex;flex-direction:column;gap:6px;max-width:370px;margin:auto}.score-factor{display:flex;align-items:center;justify-content:space-between;padding:7px 12px;background:#293f45;border:1px solid #6f8c7159;border-radius:4px;font-size:18px;opacity:.25}.score-factor.revealed{opacity:1}.score-factor .factor-add{display:flex;gap:16px;font-size:18px}.score-factor .factor-add span:first-child{color:#9dcbdf}.score-factor .factor-add span:last-child{color:#ffae92}.score-result{padding:18px 10px 10px}.score-result small{display:block;font-size:12px;color:#bcd0b4;margin-bottom:5px}.score-result strong{display:block;font-size:72px;font-weight:400;color:#ffce70;text-shadow:0 4px #947042;line-height:1}.score-actions{display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap;margin-top:18px}.score-actions .text-btn{font-size:12px}.hand-review{text-align:left;padding-top:15px;font-size:12px;color:#c5d4ba}.hand-review summary{cursor:pointer;text-align:center}.reveal-player{margin-top:13px}.reveal-name{font-size:12px;margin-bottom:6px}.reveal-row{display:flex;gap:3px;justify-content:center;flex-wrap:wrap;padding-bottom:7px}.match-ranking{margin-top:14px;border-top:2px solid #233a40;padding-top:15px}.match-ranking h3{font-weight:400;color:#f4d58a;font-size:24px;margin-bottom:14px}.match-ranking .standings{max-width:380px;margin:auto}.match-ranking .standing{padding:9px 12px}.match-ranking .standing:first-child{border:2px solid #d1b76d;background:#52583f}.match-ranking .standing .points{font-size:24px}
#celebration{position:fixed;inset:0;pointer-events:none;z-index:700}#fxLayer{position:fixed;inset:0;pointer-events:none;z-index:800;overflow:hidden}.floating-text{position:absolute;transform:translate(-50%,-50%) rotate(-7deg);color:var(--gold);font-size:30px;text-shadow:0 3px #6b4c33,2px 5px #15373b;white-space:nowrap}.chip-spark{position:absolute;width:7px;height:7px;background:#f4cb77;border:1px solid #fff0b0;box-shadow:2px 2px #96733e;pointer-events:none}.score-pulse{animation:scorePop .32s cubic-bezier(.16,1.4,.4,1)}
@keyframes tileDeal{from{opacity:0;transform:translateY(30px) rotate(8deg)}to{opacity:1;transform:translateY(0)}}@keyframes panelEnter{from{opacity:0;transform:translateY(16px) scale(.96) rotate(-1deg)}to{opacity:1;transform:none}}@keyframes heroFloat{50%{transform:rotate(calc(var(--r) + 3deg)) translateY(calc(var(--y) - 5px))}}@keyframes scorePop{40%{transform:scale(1.15) rotate(-3deg)}to{transform:none}}
@media(max-width:1100px){.match-layout{grid-template-columns:207px minmax(0,1fr);gap:10px;padding:10px}.dashboard{padding:13px 11px;gap:13px}.chips strong,.mult strong{font-size:30px}.play-stage{padding:10px;gap:7px}.table-core{grid-template-columns:45px minmax(0,1fr) 45px;gap:7px}.my-hand .tile .face{font-size:24px}.my-hand .tile .face span{font-size:18px}.my-hand .tile .face svg{width:30px;height:43px}.my-hand .tile .honor{font-size:36px}.my-hand .tile .white-dragon{width:24px;height:34px}.opponent .player-label{font-size:12px;padding:5px}.left-player .player-label small,.right-player .player-label small{display:none}.my-hand{min-height:83px}.action-bar .btn{font-size:18px;padding:10px 18px}.action-bar{min-height:48px}#lastAction{display:none}}
@media(max-width:700px) and (orientation:portrait){.match-layout{display:flex;flex-direction:column;padding:7px;gap:10px}.dashboard{display:grid;grid-template-columns:.8fr .95fr 1.3fr;gap:8px 10px;flex:none;padding:10px 10px 8px;border-width:2px;border-radius:7px;overflow:visible}.dash-title{grid-column:1/-1;font-size:24px;line-height:1}.dash-title .square-btn{width:25px;height:25px;font-size:18px}.round-stamp{gap:4px}.round-stamp strong{font-size:36px}.round-stamp strong span{font-size:18px}.round-stamp small{font-size:10px;margin-bottom:4px}.wall-chip{display:none}.total-block{padding:7px 3px}.total-block span{font-size:10px;margin-bottom:5px}.total-block strong{font-size:30px}.formula-label{font-size:10px;margin-bottom:6px}.formula{gap:3px}.chips,.mult{padding:5px 2px;border-width:1px;border-radius:4px}.chips small,.mult small{display:none}.chips strong,.mult strong{font-size:24px}.multiply{font-size:18px}.combo-block{grid-column:1/-1;border:0;padding-top:3px;display:flex;align-items:center;gap:9px}.combo-block>div:first-child{white-space:nowrap;gap:8px;font-size:10px}.combo-block strong{font-size:12px}.combo-meter{flex:1;margin:0;gap:2px}.combo-meter i{height:6px}.combo-block>small,.ranking-title{display:none}.standings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;grid-column:1/-1}.standing{display:flex;flex-direction:column;gap:3px;padding:4px 3px;font-size:12px;line-height:1.2}.standing .name{max-width:100%}.standing .rank,.standing .ai{display:none}.standing .points{font-size:18px}.dash-footer{grid-column:1/-1;margin:0;padding:0}.dash-footer button{font-size:10px}.play-stage{flex:1;min-height:0;padding:8px 6px 7px;border-width:3px;border-radius:9px;gap:5px}.table-status{min-height:20px;padding:0 4px}.table-status #turnStatus,.turn-clock{font-size:12px}.table-core{grid-template-columns:30px minmax(0,1fr) 30px;grid-template-rows:49px minmax(0,1fr);gap:4px}.top-player{gap:4px}.top-player .player-label{padding:2px 6px;font-size:12px}.player-label .wind{font-size:10px;margin-right:3px}.opponent .backs{gap:1px}.top-player .back{width:16px;height:22px;border-width:1px}.back::after{inset:2px}.left-player,.right-player{gap:6px}.left-player .back,.right-player .back{width:21px;height:12px;border-width:1px;margin-top:-3px}.left-player .player-label,.right-player .player-label{font-size:10px;padding:4px 2px;white-space:normal;word-break:break-all}.left-player .player-label .wind,.right-player .player-label .wind{display:none}.table-mark{font-size:18px;letter-spacing:5px}.discard-zone{border-radius:20px}.discard-piles{gap:4px;padding:5px 0 9px}.discard-piles .tile{width:23px;height:32px}.discard-piles .tile .face{font-size:12px}.discard-piles .tile .face span{font-size:10px}.discard-piles .tile .face svg{width:17px;height:24px}.discard-piles .tile .honor{font-size:18px}.discard-piles .tile .white-dragon{width:12px;height:18px;border-width:2px}.opponent .tile.mini{width:17px;height:23px}.opponent .tile.mini .face svg{width:13px;height:17px}.opponent .tile.mini .face{font-size:10px}.opponent .tile.mini .face span{font-size:8px}.opponent .tile.mini .honor{font-size:12px}.hand-zone{padding-top:4px}.hand-heading{font-size:12px;margin-bottom:3px;gap:8px;min-height:18px}#handHint{font-size:10px}.my-hand{flex-wrap:wrap;gap:6px 3px;max-width:370px;margin:auto;padding:8px 0 6px;min-height:0}.my-hand .tile{width:calc((100vw - 63px)/7);max-width:46px;aspect-ratio:58/80;border-radius:4px}.my-hand .tile .face{font-size:24px}.my-hand .tile .face span{font-size:18px}.my-hand .tile .face svg{width:30px;height:43px}.my-hand .tile .honor{font-size:36px}.my-hand .tile .corner{display:none}.my-hand .tile.selected{--lift:-7px!important}.my-hand .tile:hover:not(:disabled){--lift:0px}.my-melds{gap:6px;margin-bottom:3px}.my-melds:not(:empty)+.my-hand{min-height:0}.action-bar{min-height:43px;gap:8px;padding:3px 0}.action-bar .btn{font-size:18px;padding:8px 16px;min-height:34px;border-width:2px}.action-bar .prompt{font-size:12px}.callout{font-size:48px}.floating-text{font-size:24px}.match-ranking .standings{display:flex}.match-ranking .standing{display:grid;grid-template-columns:20px minmax(0,1fr) auto;padding:8px 12px;font-size:18px}.match-ranking .standing .rank{display:block}}
@media(max-width:700px){.lobby{padding:70px 18px 25px}.lobby-tools{top:max(15px,env(safe-area-inset-top));left:18px;right:18px}.tiny-link{font-size:12px}.title-scene{width:min(420px,100%)}.hero-tiles{height:92px}.hero-tile{width:61px;height:82px;font-size:48px}.title-scene .eyebrow{font-size:10px;letter-spacing:2px;margin-top:23px}.title-scene h1{font-size:60px;letter-spacing:3px}.subtitle{margin:14px 0 24px}.lobby-form{padding:17px 17px 20px}.lobby-buttons .btn{font-size:18px;padding:14px 10px}.lobby-links{gap:15px}.lobby-links span{font-size:10px}.build-stamp{font-size:10px}.score-dialog{padding:25px 20px 22px}.score-dialog h2{font-size:48px}.score-math{width:270px;margin-bottom:17px;gap:12px}.score-math .chips strong,.score-math .mult strong{font-size:36px}.score-result strong{font-size:60px}.score-factor{font-size:18px;padding:6px 8px}.score-factor .factor-add{font-size:12px;gap:12px}.score-actions{gap:14px}.score-actions .btn{font-size:18px}.rules-dialog h2{font-size:30px}.rule-formula{font-size:18px}.dialog{padding:24px 20px}.score-math .chips small,.score-math .mult small{display:block}}
@media(max-height:700px) and (orientation:portrait){.dashboard{gap:6px 8px;padding:8px 10px}.dash-title{font-size:18px}.round-stamp strong{font-size:30px}.total-block strong{font-size:24px}.total-block{padding:5px 2px}.formula-label{margin-bottom:5px}.standing{padding:3px;font-size:10px}.standing .points{font-size:14px}.left-player .back,.right-player .back{height:10px;margin-top:-3px}.left-player .backs,.right-player .backs{gap:0}.table-core{grid-template-rows:42px minmax(0,1fr)}.top-player .back{height:18px}.top-player .player-label{font-size:10px}.hand-heading{font-size:10px;min-height:14px}.my-hand .tile{width:calc((100vw - 70px)/7);max-width:38px}.my-hand .tile .face{font-size:18px}.my-hand .tile .face span{font-size:12px}.my-hand .tile .face svg{width:25px;height:35px}.my-hand .tile .honor{font-size:30px}.my-hand .tile .white-dragon{width:18px;height:27px}.my-hand{gap:6px 3px;padding-top:7px}.action-bar{min-height:35px}.action-bar .btn{font-size:14px;padding:7px 13px;min-height:30px}.lobby{padding-top:58px}.hero-tiles{height:65px}.hero-tile{width:46px;height:63px;font-size:36px}.title-scene h1{font-size:48px}.title-scene .eyebrow{margin:18px 0 7px}.subtitle{font-size:14px;margin:12px 0 15px}.lobby-form{padding:14px 16px 18px}.lobby-form>label{font-size:10px}.lobby-form input{font-size:18px;padding:9px 12px}.lobby-links{margin-top:17px}}
@media(max-height:540px) and (orientation:landscape){.match-layout{grid-template-columns:172px minmax(0,1fr);padding:6px;gap:8px}.dashboard{padding:10px 9px;gap:9px}.dash-title{font-size:18px}.dash-title .square-btn{width:24px;height:24px;font-size:18px}.round-stamp strong{font-size:30px}.round-stamp small{font-size:10px}.round-stamp strong span{font-size:18px}.wall-chip{padding:4px 7px}.wall-chip b{font-size:18px}.wall-chip small{font-size:10px}.total-block{padding:5px}.total-block strong{font-size:30px}.formula-label{font-size:10px;margin-bottom:5px}.chips,.mult{padding:5px 2px}.chips strong,.mult strong{font-size:24px}.chips small,.mult small{display:none}.combo-block{padding-top:7px}.combo-block strong{font-size:14px}.combo-block>div:first-child{font-size:10px}.combo-meter{margin:5px 0;gap:2px}.combo-meter i{height:5px}.combo-block>small{display:none}.ranking-title{font-size:10px}.standing{font-size:12px;padding:4px}.standing .points{font-size:14px}.standings{gap:4px}.dash-footer button{font-size:10px}.play-stage{padding:6px 9px;gap:4px;border-width:3px}.table-status{min-height:22px}#turnStatus,.turn-clock{font-size:12px}.table-core{grid-template-rows:43px minmax(0,1fr);grid-template-columns:38px minmax(0,1fr) 38px;gap:4px}.top-player .back{width:16px;height:22px;border-width:1px}.opponent{gap:4px}.opponent .player-label{font-size:10px;padding:3px 5px}.player-label small,.player-label .wind{font-size:9px}.left-player .back,.right-player .back{width:23px;height:8px;border-width:1px;margin-top:-1px}.back::after{inset:1px}.discard-piles{gap:4px;padding:5px 0 10px}.discard-piles .tile{width:22px;height:30px}.discard-piles .face{font-size:12px!important}.discard-piles .face span{font-size:10px!important}.discard-piles .face svg{width:16px!important;height:23px!important}.discard-piles .honor{font-size:18px!important}.table-mark{font-size:18px;letter-spacing:5px}.hand-zone{padding-top:3px}.hand-heading{min-height:14px;margin-bottom:0;font-size:10px}#handHint{font-size:10px}.my-hand{gap:3px;padding:8px 0 6px;min-height:0;flex-wrap:nowrap}.my-hand .tile{width:min(35px,calc((100cqw - 42px)/14));height:auto;aspect-ratio:58/80}.my-hand .tile .face{font-size:18px}.my-hand .tile .face span{font-size:12px}.my-hand .tile .face svg{width:24px;height:33px}.my-hand .tile .honor{font-size:24px}.my-hand .tile .white-dragon{width:17px;height:24px;border-width:2px}.my-hand .tile .corner{display:none}.my-hand .tile.selected{--lift:-9px!important}.my-melds{position:absolute;right:0;bottom:4px;max-width:150px;flex-wrap:wrap;gap:4px}.my-melds .tile{width:19px;height:26px}.my-melds .face svg{width:13px!important;height:18px!important}.my-melds:not(:empty)+.my-hand{min-height:0}.action-bar{padding:1px 0 3px;min-height:30px;gap:7px}.action-bar .btn{font-size:12px;padding:5px 15px;min-height:25px;border-width:2px}.action-bar .prompt{font-size:10px}.callout{font-size:48px}.lobby{padding:20px}.title-scene{width:430px;display:grid;grid-template-columns:140px 1fr;align-items:center;gap:8px 18px}.hero-tiles{grid-row:1/5;height:100px}.hero-tile{width:45px;height:61px;font-size:36px}.title-scene .eyebrow{font-size:9px;letter-spacing:1px;margin:0}.title-scene h1{font-size:42px;letter-spacing:1px}.subtitle{font-size:12px;margin:7px 0 0}.lobby-form{grid-column:1/-1;padding:12px 16px 15px}.lobby-form>label{font-size:10px;margin-bottom:6px}.lobby-form input{font-size:18px;padding:8px 12px}.lobby-buttons{margin-top:10px}.lobby-buttons .btn{font-size:18px;padding:10px}.lobby-links{grid-column:1/-1;margin-top:8px}.lobby-tools{top:15px}.waiting-card{padding:20px;width:430px}.waiting-card h1{font-size:48px;margin:8px 0}.wait-players{display:flex;gap:8px;margin:14px 0}.wait-player{flex:1;padding:10px 5px;font-size:12px}.wait-hint{margin-bottom:12px}.waiting-card>.btn{font-size:18px;margin-bottom:14px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.dialog::backdrop{backdrop-filter:none}}
body.no-effects *,body.no-effects *::before,body.no-effects *::after{animation:none!important;transition:none!important}
.discard-piles .tile:last-child{border-color:#fff5dc}.discard-piles .tile.last{border-color:#f4cf84}
/* Other players' cards retain a readable physical presence. */
@media(min-width:701px) and (min-height:541px){.table-core{grid-template-rows:98px minmax(0,1fr);grid-template-columns:86px minmax(0,1fr) 86px}.opponent .back{width:33px;height:45px;border-width:3px}.left-player .back,.right-player .back{width:43px;height:23px;border-width:2px;margin-top:-3px}.opponent .tile.mini{width:30px;height:41px}.opponent .tile.mini .face{font-size:18px}.opponent .tile.mini .face span{font-size:12px}.opponent .tile.mini .face svg{width:22px;height:31px}.opponent .tile.mini .honor{font-size:24px}.opponent .tile.mini .white-dragon{width:17px;height:24px}.left-player .op-melds,.right-player .op-melds{max-width:80px}.opponent .player-label{font-size:18px}}
@media(max-width:700px) and (orientation:portrait){.table-core{grid-template-rows:58px minmax(0,1fr)}.top-player .back{width:20px;height:28px}.left-player .back,.right-player .back{width:26px;height:15px;margin-top:-5px}.opponent .tile.mini{width:21px;height:29px}.opponent .tile.mini .face svg{width:16px;height:22px}.opponent .tile.mini .honor{font-size:18px}}
@media(max-width:700px) and (max-height:700px) and (orientation:portrait){.table-core{grid-template-rows:46px minmax(0,1fr)}.top-player .back{width:18px;height:24px}.left-player .back,.right-player .back{width:25px;height:12px;margin-top:-5px}}
.discard-piles{display:grid;grid-template-columns:repeat(auto-fit,38px);width:min(100%,443px);gap:7px;align-content:start;justify-content:center;overflow-x:hidden;max-height:100%;padding:8px 2px 15px}
.discard-piles .tile{width:38px;height:52px}.discard-piles .tile .face{font-size:24px}.discard-piles .tile .face span{font-size:18px}.discard-piles .tile .face svg{width:28px;height:39px}.discard-piles .tile .honor{font-size:30px}
@media(max-width:700px) and (orientation:portrait){.discard-piles{grid-template-columns:repeat(auto-fit,25px);gap:4px;width:min(100%,228px);padding:6px 0 12px}.discard-piles .tile{width:25px;height:35px}.discard-piles .tile .face{font-size:14px}.discard-piles .tile .face span{font-size:10px}.discard-piles .tile .face svg{width:18px;height:27px}.discard-piles .tile .honor{font-size:20px}}
@media(max-height:540px) and (orientation:landscape){.discard-piles{grid-template-columns:repeat(auto-fit,26px);width:min(100%,314px);gap:5px}.discard-piles .tile{width:26px;height:35px}}
.tile[data-suit=WAN]{container-type:inline-size}
.tile[data-suit=WAN] .wan-face{font-size:60cqw!important;line-height:1.05;gap:2px;font-weight:700;-webkit-text-stroke:0}
.tile[data-suit=WAN] .wan-character{display:block;font:inherit;line-height:inherit}
.tile .face svg{overflow:visible}
.music-picker{padding:12px 0;border-bottom:1px solid #687f6c33}
.music-picker select{width:100%;padding:10px 9px;background:#233e45;border:2px solid #718b7e;border-radius:4px;color:var(--cream);font:inherit;font-size:16px}
.music-credit{display:block;color:#b7c9b3;font-size:12px;line-height:1.5;margin-top:8px;min-height:18px}
.sound-previews{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}
.sound-previews .btn{min-width:0;width:100%;padding:11px 8px;font-size:16px;white-space:normal;line-height:1.35}
#soundTest{width:auto;margin:0}

#waitCode{font-size:clamp(19px,4.7vw,28px);letter-spacing:2px;overflow-wrap:anywhere}
