/* Layout follows liumengniu/majiang Main.ts: 1334 x 750 landscape stage,
   native myCard / first / second / third / fourth perspective sprites. */
.tile-art{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
body.in-game{overflow:hidden;background:#105941}
body.in-game>.masthead,body.in-game>footer{display:none}
body.in-game .game{position:fixed;inset:0;max-width:none;width:100dvw;height:100dvh;padding:0;margin:0;container-type:size;overflow:hidden;isolation:isolate;background:#116548}
body.in-game .game-layout,body.in-game .table-wrap{position:absolute;inset:0;display:block;padding:0;margin:0}
body.in-game .sidebar{display:none}
body.in-game .felt{position:absolute;inset:0;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:radial-gradient(ellipse at 50% 44%,#198458 0%,#126f4c 55%,#0e593f 100%);box-shadow:inset 0 0 2cqw #09352a;overflow:hidden}
body.in-game .felt::before{content:"";position:absolute;inset:.6cqh .4cqw;pointer-events:none;border:1px solid #94723d;border-radius:1cqh;box-shadow:0 0 0 .5cqh #442d16,inset 0 0 0 .8cqh #214e31}
body.in-game .felt::after{content:"";position:absolute;inset:2cqh 1.4cqw;pointer-events:none;opacity:.08;background:repeating-linear-gradient(30deg,transparent,transparent 2px,#d8e1bb33 2px,#d8e1bb33 3px)}
body.in-game .room-bar{position:absolute;z-index:10;left:1.3%;right:1.3%;top:1.4%;height:5%;padding:0;display:flex;align-items:center;justify-content:space-between;margin:0;background:none}
body.in-game .room-bar>div:first-child{display:flex;gap:1.3cqw;align-items:center}
body.in-game .room-bar h1{font-size:clamp(10px,2.2cqh,16px);margin:0;font-weight:500;letter-spacing:0;color:#f4f4de}
body.in-game .room-bar h1>span{font:inherit;letter-spacing:.05em}
body.in-game .room-bar .eyebrow{font-size:clamp(9px,1.8cqh,13px);letter-spacing:0;color:#e9ecce}
body.in-game .copy-button{font-size:clamp(8px,1.6cqh,10px);margin-left:5px;padding:2px 4px;border-color:#adc38b66;color:#dddab4}
body.in-game .room-tools{display:flex;gap:.6cqw}
body.in-game .room-tools button{font-size:clamp(10px,2cqh,14px);padding:.7cqh .9cqw;min-height:0;border:1px solid #a0bf8b55;border-radius:.7cqh;background:#0a4e37aa;color:#f2ebc3;box-shadow:none}
body.in-game #leaveButton:disabled{display:none}
body.in-game .table-topline{position:absolute;left:16%;right:auto;top:20.5%;width:17%;height:6%;display:flex;align-items:center;justify-content:center;font-size:clamp(10px,2cqh,15px);color:#f5e8b9;letter-spacing:0;pointer-events:none}
body.in-game .table-topline>span:first-child{display:none}
body.in-game .table-topline>span:last-child{margin-left:0;white-space:nowrap}
body.in-game .table-watermark{display:none}
body.in-game .table-watermark small{display:none}
body.in-game .opponents{position:absolute;inset:0;display:block;z-index:4;margin:0;pointer-events:none}
body.in-game .opponent{position:absolute;inset:0;width:auto;height:auto;min-height:0;padding:0;background:none;border:0;border-radius:0;box-shadow:none;pointer-events:none}
body.in-game .opponent .player-head{position:absolute;font-size:clamp(10px,2.1cqh,14px);display:flex;align-items:center;gap:.4cqw;white-space:nowrap}
body.in-game .opponent .player-head strong{display:flex;align-items:center;gap:.6cqw;white-space:nowrap;overflow:visible;font-weight:500}
body.in-game .opponent .avatar{width:6cqw;max-width:10cqh;height:10cqh;object-fit:contain;border-radius:.8cqh;border:1px solid #a7d5b488;background:#2d896e;padding:0;margin:0;box-shadow:0 2px 3px #06382455;display:block;color:transparent;flex-shrink:0}
body.in-game .opponent.current .avatar{outline:2px solid #f8d67e;box-shadow:0 0 12px #d5d76488}
body.in-game .opponent .badge{font-size:clamp(8px,1.5cqh,10px);color:#f6e4a7;background:#145b3c;border:1px solid #c2cb7b77;padding:1px 3px}
body.in-game .opponent .player-stats{position:absolute;white-space:nowrap;margin:0;color:#e2e9cb;font-size:clamp(9px,1.8cqh,12px);line-height:1.4;text-shadow:0 1px 2px #104b35}
body.in-game .opponent .back-tiles{position:absolute;margin:0;display:flex;gap:0;padding:0;justify-content:flex-start;align-items:flex-start;transform:none}
body.in-game .opponent .back-tiles img{display:block;object-fit:contain;flex-shrink:0}
body.in-game .opponent .small-tiles{position:absolute;width:max-content;min-height:0;display:flex;gap:.5cqw;flex-wrap:nowrap;align-items:flex-end;transform:none}
body.in-game .opponent .small-tiles .meld{display:flex;gap:0;margin:0}
body.in-game .seat-top .player-head{left:16%;top:7.5%;width:10%;max-width:10%;flex-wrap:wrap}
body.in-game .seat-top .player-head strong{display:flex;flex-direction:column;gap:.7cqh;font-size:1.9cqh}
body.in-game .seat-top .player-stats{left:28%;top:17.5%;max-width:55%;overflow:hidden;text-overflow:ellipsis}
body.in-game .seat-top .back-tiles{position:static;flex-direction:row;flex:none}
body.in-game .seat-top .back-tiles img{width:min(3.1cqw,5.5cqh);height:auto;aspect-ratio:44/72}
body.in-game .seat-top .small-tiles{position:static;flex-direction:row-reverse;flex:none}
body.in-game .seat-top .small-tiles .tile{width:min(2.8cqw,4.9cqh);height:min(4cqw,7cqh)}
body.in-game .seat-right .player-head{right:2%;top:11%;max-width:12%;flex-wrap:wrap;justify-content:flex-end}
body.in-game .seat-right .player-head strong{display:flex;flex-direction:column;font-size:1.9cqh;gap:.7cqh}
body.in-game .seat-right .player-stats{right:2%;top:24%;white-space:normal;max-width:10%;text-align:right}
body.in-game .seat-right .back-tiles{right:2.8%;top:33%;flex-direction:column}
body.in-game .seat-right .back-tiles img{width:min(1.95cqw,3cqh);height:auto;aspect-ratio:26/56;margin-bottom:max(-2.7cqw,-4cqh)}
body.in-game .seat-right .back-tiles img:last-child{margin-bottom:0}
body.in-game .seat-right .small-tiles{right:6.8%;top:33%;width:8%;display:grid;grid-template-columns:repeat(2,max-content);gap:1cqh .4cqw;align-items:start;justify-content:end}
body.in-game .seat-right .small-tiles .meld{flex-direction:column;gap:0}
body.in-game .seat-right .small-tiles .tile{width:min(3.3cqw,5.4cqh);height:min(2.68cqw,4.4cqh)}
body.in-game .seat-left .player-head{left:2%;top:11%;max-width:12%;flex-wrap:wrap;justify-content:flex-start}
body.in-game .seat-left .player-head strong{display:flex;flex-direction:column;font-size:1.9cqh;gap:.7cqh}
body.in-game .seat-left .player-stats{left:2%;top:24%;white-space:normal;max-width:10%;text-align:left}
body.in-game .seat-left .back-tiles{left:2.8%;top:33%;flex-direction:column}
body.in-game .seat-left .back-tiles img{width:min(1.95cqw,3cqh);height:auto;aspect-ratio:26/56;margin-bottom:max(-2.7cqw,-4cqh)}
body.in-game .seat-left .back-tiles img:last-child{margin-bottom:0}
body.in-game .seat-left .small-tiles{left:6.8%;top:33%;width:8%;display:grid;grid-template-columns:repeat(2,max-content);gap:1cqh .4cqw;align-items:start}
body.in-game .seat-left .small-tiles .meld{flex-direction:column;gap:0}
body.in-game .seat-left .small-tiles .tile{width:min(3.3cqw,5.4cqh);height:min(2.68cqw,4.4cqh)}
body.in-game .empty-seat{position:absolute;left:50%;top:6%;transform:translateX(-50%);min-height:0;padding:1cqh 1cqw;color:#bacda1;border:1px dashed #9db38977;border-radius:5px;font-size:2.2cqh}
body.in-game .walls{display:none}
body.in-game .table-center{position:absolute;inset:0;margin:0;display:block;pointer-events:none}
body.in-game .dragon-box{position:absolute;left:34%;top:20.5%;width:30%;height:6%;min-width:0;box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;gap:1cqw;align-items:center;background:#0c5a3c88;border:1px solid #b5bd7b88;border-radius:.9cqh;padding:.3cqh .6cqw;color:#ffe5a0;font-size:2.1cqh}
body.in-game .dragon-box .tile{width:3.2cqh;height:4.7cqh;padding:0;border:0}
body.in-game .dragon-box small{font-size:1.8cqh;color:#d5dfbf;white-space:nowrap}
body.in-game .dice-box{position:absolute;left:66%;right:auto;top:20.5%;width:18%;height:6%;min-width:0;max-width:none;display:flex;flex-direction:row;justify-content:center;gap:.7cqw;align-items:center;font-size:1.8cqh;color:#c2d4ae}
body.in-game .dice-box b{font:bold 2.7cqh Georgia;color:#f7e4ad;letter-spacing:.1em;white-space:nowrap}
body.in-game .dice-box small{position:absolute;left:-61%;top:450%;width:58%;max-width:none;max-height:4.5cqh;overflow-y:auto;overflow-wrap:anywhere;pointer-events:auto;font-size:1.7cqh;text-align:center;line-height:1.35;color:#ffe2aa}
body.in-game .center-message{position:absolute;left:50%;top:47%;transform:translate(-50%,-50%);width:8cqw;height:7cqh;max-height:none;display:block;border:0;border-radius:0;background:url('/classic/ui/timer.png') center/contain no-repeat;box-shadow:none}
body.in-game .compass{position:absolute;inset:0;pointer-events:none}
body.in-game .compass i{position:absolute;font:1.8cqh "KaiTi",serif;color:#c0d8ab;font-style:normal}
body.in-game .compass .north{left:50%;top:15%;transform:translateX(-50%)}
body.in-game .compass .south{left:50%;bottom:12%;transform:translateX(-50%)}
body.in-game .compass .west{left:13%;top:50%;transform:translateY(-50%)}
body.in-game .compass .east{right:13%;top:50%;transform:translateY(-50%)}
body.in-game #countdown{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font:3.4cqh/1 Georgia,serif;min-height:0;color:#ffe58d}
body.in-game #turnMessage{position:absolute;left:calc(100% + .6cqw);top:0;width:10.5cqw;max-height:4cqh;overflow-y:auto;overflow-wrap:anywhere;pointer-events:auto;font-size:1.7cqh;line-height:1.3;white-space:normal;text-align:left;color:#ebe8b6;letter-spacing:0;text-shadow:0 1px 2px #164c29}
body.in-game #flightMessage{position:absolute;right:calc(100% + .6cqw);left:auto;top:0;width:10.5cqw;max-height:8cqh;overflow-y:auto;overflow-wrap:anywhere;pointer-events:auto;font-size:1.7cqh;line-height:1.35;white-space:normal;text-align:right;color:#ffe49b}
/* Each river owns a bounded scroll region. Sprite boxes include the complete
   perspective PNG (46x64 / 42x60 / 59x48), so neither rows nor seats overlap. */
body.in-game .discard-board{position:absolute;inset:0;display:block;pointer-events:none;z-index:2}
body.in-game .discard-zone{position:absolute;display:flex;flex-direction:column;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:transparent;overflow:hidden;pointer-events:auto;transform:none}
body.in-game .river-top{left:34%;top:27%;width:32%;height:15.5%}
body.in-game .river-bottom{left:34%;top:52%;width:32%;height:15.5%}
body.in-game .river-left{left:16%;top:27%;width:17%;height:40%}
body.in-game .river-right{left:67%;right:auto;top:27%;width:17%;height:40%}
body.in-game .river-heading{display:flex;align-items:center;justify-content:space-between;flex:0 0 16px;min-width:0;gap:3px;padding:0 2px 2px}
body.in-game .river-heading>small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d5e3c5;font-size:clamp(10px,1.6cqh,12px);line-height:12px;margin:0}
body.in-game .river-latest{flex:none;min-height:14px;padding:0 4px;border:0;border-radius:0;background:transparent;color:#e3d5a3;font-size:10px;line-height:12px;white-space:nowrap}
body.in-game .discard-viewport{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a5b67b66 transparent;touch-action:auto;scrollbar-gutter:stable}
body.in-game .discard-tiles{--river-tile-width:clamp(22px,2.2cqw,34px);display:grid;grid-template-columns:repeat(auto-fill,var(--river-tile-width));grid-auto-rows:max-content;gap:3px;justify-content:start;align-content:start;padding:2px}
body.in-game .discard-zone .tile.tiny{display:block;position:relative;width:var(--river-tile-width);height:calc(var(--river-tile-width)*64/46);min-width:0;min-height:0;max-width:none;padding:0;margin:0;box-shadow:none;border:0;border-radius:0;background:none;transform:none;transition:none}
body.in-game .river-top .tile.tiny{height:calc(var(--river-tile-width)*60/42)}
body.in-game .river-left .discard-tiles,body.in-game .river-right .discard-tiles{--river-tile-width:clamp(28px,3cqw,44px);grid-template-columns:repeat(auto-fill,var(--river-tile-width));grid-auto-flow:row}
body.in-game .river-left .tile.tiny,body.in-game .river-right .tile.tiny{height:calc(var(--river-tile-width)*48/59)}
body.in-game .discard-zone .latest-discard{outline:0;border-radius:0;background:none;filter:brightness(1.06)}
body.in-game .discard-zone .latest-discard::before{display:none}
body.in-game .waiting-controls{position:absolute;z-index:8;left:50%;top:47%;transform:translate(-50%,-50%);min-width:42%;background:#104a32ee;border:2px solid #d9bd63;border-radius:1cqh;padding:4cqh 3cqw;box-shadow:0 .5cqh 1cqh #08352266}
body.in-game .waiting-controls p{font-size:2.6cqh;white-space:nowrap;margin-bottom:3cqh;color:#eee3b4}
body.in-game .waiting-controls>div{gap:1cqw;flex-wrap:nowrap}
body.in-game .waiting-controls button{font-size:2.4cqh;padding:1.5cqh 1.5cqw;min-height:7cqh;border-radius:.8cqh}
body.in-game .own-area{position:absolute;inset:0;padding:0;pointer-events:none}
body.in-game .own-meta{position:absolute;bottom:6%;left:1.6%;display:block;width:9%;margin:0;line-height:1.8}
body.in-game .own-meta>div{display:flex;flex-direction:column;gap:.8cqh}
body.in-game .own-meta strong{font-size:2.2cqh;font-weight:500;color:#e6eacb}
body.in-game .own-meta span{font:3cqh Georgia;margin:0;color:#f7df88}
body.in-game #handHint{display:none}
body.in-game .hand{position:static;transform:none;width:max-content;max-width:none;display:flex!important;flex-wrap:nowrap;gap:0;justify-content:flex-start;align-items:flex-end;min-height:0;padding:0;pointer-events:auto;flex:none}
body.in-game .hand .tile,body.in-game .hand:has(.tile:nth-child(8):last-child) .tile{--w:min(4.7cqw,9.6cqh);width:var(--w);height:calc(var(--w)*99/65);padding:0;flex:0 0 var(--w);border:0;border-radius:0;box-shadow:none;background:none;transform:none;outline:0}
body.in-game .hand .tile.selected{transform:translateY(-2.6cqh);filter:brightness(1.05);outline:0}
body.in-game .hand .tile.drawn{margin-left:1.1cqw}
body.in-game .tile.is-dragon::after{display:none}
body.in-game .hand .tile.is-dragon::after{content:'财';display:block;position:absolute;top:-2.4cqh;left:50%;right:auto;bottom:auto;transform:translateX(-50%);font:600 1.8cqh/2.2cqh sans-serif;height:2.2cqh;min-width:2.2cqh;padding:0 .25cqw;color:#ffe7a4;background:#b04926;border:1px solid #e7b55b;border-radius:.35cqh;box-shadow:none;z-index:2}
body.in-game .tile.mini,body.in-game .tile.tiny{padding:0;border:0;border-radius:0;box-shadow:none;background:none;flex-shrink:0}
body.in-game .own-exposed{position:static;display:flex;gap:.5cqw;align-items:flex-end;justify-content:flex-start;margin:0;pointer-events:none;flex:none}
body.in-game .own-exposed .meld{display:flex;gap:0}
body.in-game .own-exposed .tile.mini{width:min(3.45cqw,7cqh);height:min(4.8cqw,9.74cqh)}
body.in-game .flower-chip{font-size:1.6cqh;line-height:2.1cqh;padding:0 .2cqw;border:1px solid #c4ce9966;border-radius:.3cqh;background:#205b36aa;color:#ede1a2;white-space:nowrap}
body.in-game .own-exposed>.flower-chip{transform:translateY(-8cqh);margin-right:-1.1cqw}
body.in-game .honor{position:relative;background:linear-gradient(#f1f1e8,#fff 60%,#efeee2)!important;border-radius:.4cqh!important;box-shadow:inset 0 -1cqh #20773e,inset 0 1px #e0d8c5!important}
body.in-game .honor .honor-glyph{font:bold 4.8cqh/1 "KaiTi","STKaiti","SimSun",serif;color:#153956;display:grid;place-items:center;width:100%;height:100%;padding-bottom:.7cqh}
body.in-game .hand .honor{box-shadow:inset 0 .6cqh #d8aa33,inset 0 -.7cqh #d7d8c7!important;border:1px solid #bfc4aa!important}
body.in-game .hand .honor .honor-glyph{font-size:7cqh;padding-top:.3cqh;padding-bottom:0}
body.in-game .tile-view-top.honor .honor-glyph{transform:rotate(180deg)}
body.in-game .tile-view-left.honor .honor-glyph{transform:rotate(90deg);font-size:3.3cqh}
body.in-game .tile-view-right.honor .honor-glyph{transform:rotate(-90deg);font-size:3.3cqh}
body.in-game .tile.back{background:url('/classic/cardBack/bbm.png') center/100% 100% no-repeat!important;border:0;box-shadow:none}
/* The transparent scrollable rivers overlap claim buttons. Keep only the
   controls above them; the full-stage wrapper still passes pointer input. */
body.in-game .action-row{position:absolute;inset:0;display:block;margin:0;padding:0;min-height:0;pointer-events:none;z-index:6}
body.in-game .claim-buttons{position:absolute;right:16%;bottom:24%;max-width:68%;height:8%;display:flex;align-items:center;justify-content:flex-end;gap:1cqw;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;pointer-events:auto}
body.in-game .claim-buttons button{flex:none;min-width:8cqw;min-height:6cqh;max-height:8cqh;padding:.5cqh .7cqw;font:bold 2.6cqh "KaiTi",serif;border:1px solid #d8b65e;border-radius:1cqh;background:linear-gradient(#ffe9a0,#ddb753);color:#704714;box-shadow:0 2px 2px #1a4d29}
body.in-game .claim-buttons button.sprite-action{width:6.5cqw;height:8cqh;min-width:0;min-height:0;background:none;border:0;box-shadow:none;padding:0;border-radius:0}
body.in-game .sprite-action img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 1px #2b4e24);pointer-events:none}
body.in-game .discard-actions{position:absolute;right:1.6%;bottom:5%;display:flex;flex-direction:column;gap:1cqh;margin:0;align-items:center;pointer-events:auto}
body.in-game .discard-actions>.primary{min-width:0;width:9cqw;min-height:8cqh;padding:1cqh;font:600 3cqh "KaiTi",serif;background:linear-gradient(#e8cf77,#c5a13a);border:1px solid #f7de8d;color:#614311;border-radius:1cqh;box-shadow:0 2px 0 #806e31}
body.in-game #sortButton{color:#e4dfb3;font-size:1.9cqh;padding:.6cqh 1cqw}
body.in-game .action-hint{position:absolute;left:12%;right:12%;bottom:.8%;font-size:1.6cqh;line-height:1.2;min-height:0;max-height:2cqh;overflow:hidden;text-overflow:ellipsis;text-align:center;margin:0;color:#baceab;white-space:nowrap}
body.in-game #resultButton{display:none}
body.in-game dialog{position:fixed;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);margin:0;width:min(700px,80dvw);max-width:none;max-height:90dvh;padding:22px;border:2px solid #d5b96f;background:#174d34}
body.in-game dialog .tile{width:29px;height:42px}
body.in-game dialog .honor-glyph{font-size:25px}
body.in-game dialog h2{font-size:20px}
body.in-game .toast{bottom:3%;z-index:1000}
@media(orientation:portrait){body.in-game .game{inset:auto;left:50%;top:50%;width:100dvh;height:100dvw;transform:translate(-50%,-50%) rotate(90deg)}body.in-game dialog{width:min(700px,85dvh);max-height:90dvw;transform:translate(-50%,-50%) rotate(90deg)}body.in-game .toast{left:50%;top:50%;bottom:auto;max-width:80dvh;transform:translate(-50%,-50%) rotate(90deg)}}
@media(orientation:portrait) and (pointer:fine){body.in-game .game{width:100dvw;height:56.25dvw;max-height:100dvh;transform:translate(-50%,-50%)}body.in-game dialog{width:92dvw;max-height:85dvh;transform:translate(-50%,-50%)}body.in-game .toast{top:auto;bottom:5%;max-width:90dvw;transform:translateX(-50%)}}
/* Honor glyphs scale against the tile itself, never the screen height. */
body.in-game .tile.honor{container-type:inline-size;min-width:0;min-height:0}
body.in-game .tile.honor .honor-glyph,
body.in-game .hand .tile.honor .honor-glyph,
body.in-game dialog .tile.honor .honor-glyph{font-family:"KaiTi","STKaiti","SimSun",serif;font-size:70cqw;line-height:1;font-weight:600;box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;padding:0 8% 4%;overflow:hidden;display:grid;place-items:center;white-space:nowrap}
body.in-game .tile-view-left.honor .honor-glyph,
body.in-game .tile-view-right.honor .honor-glyph{font-size:54cqw;padding:0}
.flowers-row{display:flex;align-items:flex-end;flex-wrap:wrap;gap:2px}
body.in-game .opponent>.flowers-row{position:absolute;display:flex;flex-wrap:wrap;gap:1px;max-width:25%;pointer-events:none}
body.in-game .opponent>.flowers-row .tile{width:2.05cqw;height:2.9cqw;background:none;border:0;padding:0;box-shadow:none}
body.in-game .seat-top>.flowers-row{left:66%;top:17%;width:18%;max-width:18%;max-height:3%;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;pointer-events:auto}
body.in-game .seat-left>.flowers-row{left:8.7%;top:11%;width:6.3%;max-width:6.3%;max-height:20%;overflow-y:auto;pointer-events:auto}
body.in-game .seat-right>.flowers-row{right:8.7%;top:11%;width:6.3%;max-width:6.3%;max-height:20%;overflow-y:auto;pointer-events:auto}
body.in-game .own-flowers{position:absolute;left:16%;bottom:19%;width:68%;height:4%;max-width:none;gap:1px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;pointer-events:auto}
body.in-game .own-flowers .tile{width:2.5cqh;height:3.7cqh;flex-shrink:0;border:0;padding:0;box-shadow:none;background:none}
body.in-game .seat-top .drawn-back{margin-left:1.3cqw}
body.in-game .seat-left .drawn-back,body.in-game .seat-right .drawn-back{margin-top:1.2cqh}
body.in-game #ownCount{font-size:1.5cqh;color:#d5e0ba;line-height:1.4}
.result-player{border:1px solid #64835b;border-radius:7px;padding:13px;margin:15px 0}
.result-player.winner{border-color:#dbbf73;background:#315c3777}
.result-player h3{font-size:15px;margin:0 0 8px;color:#f2dfaa}
.result-player .result-count{font-size:11px;line-height:1.8;margin:0 0 11px;color:#cfdbbf}
.result-player>small{display:block;margin:11px 0 6px;font-size:11px;color:#c3cea9}
.result-player .result-hand,.result-player .result-melds,.result-player .result-flowers{display:flex;flex-wrap:wrap;gap:3px;align-items:flex-end}
.result-melds{gap:13px!important}
.result-meld{display:flex;flex-direction:column;gap:4px}
.result-meld>div{display:flex;gap:1px}
.result-meld>small{color:#d4c797;font-size:10px}
.empty-group{font-size:11px;color:#8dab88;padding:4px}
body.in-game #resultDialog .result-player .tile{width:30px;height:43px;background:none;box-shadow:none;border:0;padding:0;transform:none}
body.in-game #resultDialog .result-player .flowers-row{position:static;max-width:none;display:flex;gap:3px}
.catalog-group{margin:10px 0 18px}
.catalog-group h3{font-size:12px;color:#dfd5aa;margin:0 0 8px}
.catalog-group>div{display:flex;gap:5px;flex-wrap:wrap}
.catalog-item{display:flex;flex-direction:column;gap:3px;align-items:center}
.catalog-item>small{font-size:9px;color:#b6c8a5}
body.in-game #catalogDialog .tile{width:37px;height:52px;background:none;border:0;padding:0;box-shadow:none}
.rule-context{padding:11px 13px;background:#365138;border:1px solid #78966a66;border-radius:6px;font-size:12px;line-height:1.9;color:#ebdfb9;margin:10px 0 16px}
.rule-section{border:1px solid #64815d66;border-radius:7px;padding:13px;margin:14px 0}
.rule-section>summary,.flower-statement>summary{cursor:pointer;color:#ecdbab;font-size:14px;font-weight:600;line-height:1.8}
.rule-section p{font-size:12px;line-height:2;color:#c6d3bf;margin:13px 0}
.rule-table{border-collapse:collapse;width:100%;font-size:12px;line-height:1.7;margin:13px 0}
.rule-table th,.rule-table td{border-bottom:1px solid #67805c66;text-align:left;padding:9px 7px;vertical-align:middle}
.rule-table th{color:#dccb98;font-weight:500;background:#2b4a34}
.rule-table td{color:#cfdbc5}
.rule-table td:nth-child(2){white-space:nowrap}
.table-scroll{overflow-x:auto}
.rule-flower-examples{display:flex;flex-wrap:wrap;gap:9px;padding:10px 0 12px}
#rulesDialog .rule-flower-examples .tile{width:32px;height:45px;flex:none;background:none;box-shadow:none;padding:0;border:0;transform:none}
#rulesDialog .tile.is-dragon::after,#resultDialog .tile.is-dragon::after{display:none}
.rule-flower-examples small{color:#c7d4ba;font-size:10px}
.flower-statement{margin:15px 0 25px;border:1px solid #7c966866;border-radius:6px;padding:12px}
.statement-tiles{display:flex;gap:1px;margin-top:4px}
body.in-game #resultDialog .statement-tiles .tile{width:21px;height:29px;flex:none;background:none;box-shadow:none;border:0;padding:0}
.history-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:18px}
.history-ledger{min-width:430px;white-space:nowrap}
#historyContent h3{font-size:15px;color:#dfd0a1;margin:23px 0 10px}
#roundLimit{width:100%;padding:11px 13px;border:1px solid #5f7657;border-radius:7px;background:#163b2e;color:#eee1ba;margin:7px 0}
#roundLimit+.fine-print{margin:0 0 15px;line-height:1.8}
body.in-game .waiting-controls{max-width:64%}
body.in-game .waiting-controls>div{flex-wrap:wrap}
@media(max-width:600px){.rule-table{font-size:11px}.rule-table th,.rule-table td{padding:7px 5px}.rule-section{padding:10px}.rule-flower-examples{gap:6px}body.in-game .room-tools{gap:.4cqw}body.in-game .room-tools button{font-size:clamp(9px,1.8cqh,13px);padding:.6cqh .6cqw}}

/* Separate card rails reserve space instead of shifting hands over melds. */
body.in-game .own-cards{position:absolute;left:11%;right:11%;bottom:4%;display:flex;gap:1.1cqw;align-items:flex-end;justify-content:center;pointer-events:none}
body.in-game .seat-top .opponent-cards{position:absolute;left:28%;right:16%;top:7.5%;height:10%;display:flex;align-items:flex-start;justify-content:flex-start;gap:1cqw}
body.in-game .seat-top .avatar{width:4cqw;height:7cqh}
body.in-game .opponent .player-head strong{max-width:100%;overflow:hidden;text-overflow:ellipsis}
body.in-game .seat-left .player-head,body.in-game .seat-right .player-head{max-width:6.2%;width:6.2%}
body.in-game .seat-top>.flowers-row .tile{width:2cqh;height:2.9cqh}
body.in-game .seat-left>.flowers-row .tile,body.in-game .seat-right>.flowers-row .tile{width:min(2.05cqw,3.4cqh);height:min(2.9cqw,4.8cqh)}

@container (max-height:340px){body.in-game .discard-tiles{--river-tile-width:20px}body.in-game .river-left .discard-tiles,body.in-game .river-right .discard-tiles{--river-tile-width:26px}}

/* Room dissolution is a confirmed action, distinct from leaving a seat. */
#dissolveDialog .dissolve-actions{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-end}#dissolveDialog p{line-height:1.8}body.in-game #dissolveButton{color:#ffe2a4;border-color:#d5b96f99}body.in-game #dissolveButton:disabled{opacity:.5}

/* The audio dialog rotates with the phone table: use the rotated viewport axes. */
body.in-game #audioDialog{width:min(600px,calc(100dvw - 28px));max-height:calc(100dvh - 28px);padding:16px}
@media(orientation:portrait){body.in-game #audioDialog{width:min(600px,calc(100dvh - 28px));max-height:calc(100dvw - 28px)}}
@media(orientation:portrait) and (pointer:fine){body.in-game #audioDialog{width:min(430px,calc(100dvw - 28px));max-height:calc(100dvh - 28px)}}

/* Care mode: fixed landscape table, large controls, bounded local overflow. */
.care-summary{display:contents}.action-text,.care-only{display:none}
#displayDialog{width:min(560px,calc(100dvw - 24px));max-height:calc(100dvh - 24px);padding:16px;overflow:hidden}
#displayDialog[open]{display:flex;flex-direction:column}
#displayDialog .dialog-head{flex:none;align-items:center;margin:0 0 12px}
#displayDialog .dialog-head h2{margin:0}
#displayDialog .close-dialog{min-height:48px;min-width:76px;font-size:18px;color:var(--text)}
#displayDialog .primary{color:#183d2e}
#displayDialog .display-settings{overflow-y:auto;min-height:0;overscroll-behavior:contain;padding:0 4px 12px}
.care-toggle{display:flex;gap:14px;align-items:center;min-height:72px;border:2px solid #9ab897;border-radius:10px;padding:12px;margin:0 0 12px;font-size:24px;color:#fff}
.care-toggle input{width:28px;height:28px;min-height:28px;flex:none;accent-color:#e5c88c}
.care-toggle small{display:block;font-size:17px;color:#e0e8dc;margin-top:4px}
#careDescription,.display-local-note{font-size:17px;line-height:1.7;color:#e0e8dc;margin:10px 0}
#displayGameTools h3{font-size:20px;margin:16px 0 10px}
.display-tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.display-tool-grid button{min-height:48px;font-size:18px;white-space:normal}
.display-dialog-actions{flex:none;padding-top:12px;border-top:1px solid var(--line)}
body.in-game #displayDialog{width:min(560px,calc(100dvw - 24px));max-height:calc(100dvh - 24px)}
@media(orientation:portrait){body.in-game #displayDialog{width:min(560px,calc(100dvh - 24px));max-height:calc(100dvw - 24px)}}
@media(orientation:portrait) and (pointer:fine){body.in-game:not(.care-mode) #displayDialog{width:min(560px,calc(100dvw - 24px));max-height:calc(100dvh - 24px)}}
body.care-mode{font-size:18px}
body.care-mode button,body.care-mode input,body.care-mode select,body.care-mode summary{min-height:48px;font-size:18px}
body.care-mode button:focus-visible,body.care-mode input:focus-visible,body.care-mode select:focus-visible,body.care-mode summary:focus-visible,body.care-mode [tabindex]:focus-visible{outline:3px solid #ffe38d;outline-offset:2px}
body.care-mode button:disabled{opacity:.55}
body.care-mode .lobby{display:block;max-width:760px;padding:24px 16px}
body.care-mode .intro,body.care-mode .step-mark,body.care-mode .brand small,body.care-mode .lobby .fine-print:not([id]),body.care-mode footer{display:none}
body.care-mode .lobby label,body.care-mode .lobby legend,body.care-mode .panel-heading p,body.care-mode .lobby .fine-print[id]{font-size:18px;color:#e3eadf}
body.care-mode .lobby h2{font-size:24px}
body.care-mode .lobby input[type=checkbox]{width:24px;height:24px;min-height:24px}
body.care-mode .masthead{padding:12px 16px;flex-wrap:wrap;gap:10px}
body.care-mode .header-right{flex-wrap:wrap;gap:8px}
body.care-mode .connection{font-size:16px}
body.care-mode .room-settings{font-size:18px}
body.care-mode .settings-grid{grid-template-columns:1fr}
body.care-mode .settings-grid input,body.care-mode .settings-grid select{font-size:18px}
body.care-mode.in-game{overflow:hidden;overscroll-behavior:none}
body.care-mode.in-game .game{position:fixed;inset:0;width:100dvw;height:100dvh;max-height:none;transform:none;overflow:hidden;container-type:size;padding:0;touch-action:manipulation;background:#104b37;--care-gap:6px;--care-side:clamp(112px,15cqw,190px);--care-head:48px;--care-players:clamp(48px,15cqh,90px);--care-actions:48px;--care-cards:clamp(92px,25cqh,132px);--care-hint:clamp(22px,6cqh,42px)}
body.care-mode.in-game .room-bar{position:absolute;inset:4px 8px auto;height:var(--care-head);margin:0;gap:8px;display:flex;flex-wrap:nowrap;align-items:center;overflow:hidden}
body.care-mode.in-game .room-bar>div:first-child{gap:10px;min-width:0;display:flex;align-items:center}
body.care-mode.in-game .room-bar h1,body.care-mode.in-game .room-bar .eyebrow{font-size:clamp(16px,2.6cqh,20px);color:#fff;white-space:nowrap}
body.care-mode.in-game .copy-button{min-width:44px;min-height:44px;font-size:16px;margin-left:5px}
body.care-mode.in-game .room-tools{gap:6px;flex-wrap:nowrap}
body.care-mode.in-game .room-tools button{padding:6px 10px;min-height:44px;font-size:18px;border-radius:7px;color:#fff;white-space:nowrap}
body.care-mode.in-game .room-tools :is(#historyButton,#catalogButton,#gameRulesButton,#gameSoundButton,#trusteeButton,#leaveButton){display:none}
body.care-mode.in-game .game-layout{position:absolute;inset:calc(var(--care-head) + 8px) 8px 6px;display:block;margin:0;padding:0;min-height:0;overflow:hidden}
body.care-mode.in-game .table-wrap{position:absolute;inset:0;display:grid;grid-template-columns:var(--care-side) minmax(0,1fr);grid-template-rows:var(--care-players) minmax(0,1fr) var(--care-actions) var(--care-cards) var(--care-hint);grid-template-areas:'summary players' 'summary rivers' 'meta actions' 'cards cards' 'hint hint';gap:var(--care-gap);margin:0;min-height:0;overflow:hidden}
body.care-mode.in-game .felt,body.care-mode.in-game .own-area{display:contents}
body.care-mode.in-game .felt::before,body.care-mode.in-game .felt::after,body.care-mode.in-game .compass,body.care-mode.in-game .table-watermark{display:none}
body.care-mode.in-game .care-summary{grid-area:summary;display:flex;flex-direction:column;gap:4px;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;padding:6px;border:1px solid #779b73;border-radius:8px;background:#153e30;scrollbar-width:thin}
body.care-mode.in-game .table-topline{position:static;inset:auto;width:auto;height:auto;display:block;margin:0;font-size:clamp(16px,3cqh,21px);font-weight:600;color:#fff;pointer-events:auto}
body.care-mode.in-game .table-center{position:static;inset:auto;display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0;pointer-events:auto}
body.care-mode.in-game .dragon-box{position:static;inset:auto;width:auto;height:auto;display:flex;flex-direction:row;justify-content:flex-start;gap:6px;padding:0;border:0;background:none;font-size:20px;color:#ffe38d}
body.care-mode.in-game .dragon-box .tile{width:34px;height:48px}
body.care-mode.in-game #indicatorLabel,body.care-mode.in-game .dice-box>span,body.care-mode.in-game .dice-box>b{display:none}
body.care-mode.in-game .center-message{position:static;inset:auto;transform:none;width:auto;height:auto;display:flex;flex-direction:column;gap:2px;align-items:flex-start;background:none}
body.care-mode.in-game #turnMessage,body.care-mode.in-game #flightMessage,body.care-mode.in-game #countdown{position:static;inset:auto;transform:none;width:auto;max-height:none;overflow:visible;white-space:normal;text-align:left;font:600 clamp(16px,2.6cqh,20px)/1.35 "Microsoft YaHei",sans-serif;color:#fff;letter-spacing:0}
body.care-mode.in-game #countdown{font-size:22px;color:#ffe38d;min-height:0}
body.care-mode.in-game #countdown:empty,body.care-mode.in-game #flightMessage:empty,body.care-mode.in-game .dice-box:has(#contractLabel:empty){display:none}
body.care-mode.in-game .dice-box{position:static;inset:auto;width:auto;height:auto;max-width:none;display:block}
body.care-mode.in-game #contractLabel{position:static;inset:auto;width:auto;max-width:none;max-height:none;overflow:visible;font-size:16px;text-align:left;line-height:1.4;color:#ffe2aa}
body.care-mode.in-game .opponents{grid-area:players;position:static;inset:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;pointer-events:auto;margin:0;min-width:0;min-height:0;overflow:hidden}
body.care-mode.in-game .opponents:has(>.opponent:nth-child(1):last-child){grid-template-columns:minmax(0,1fr)}
body.care-mode.in-game .opponents:has(>.opponent:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
body.care-mode.in-game .opponent{position:static;inset:auto;display:flex;flex-direction:column;gap:2px;min-width:0;min-height:0;padding:4px;border:1px solid #729c76;border-radius:7px;background:#153e30;pointer-events:auto;overflow:hidden}
body.care-mode.in-game .opponent.current{border:2px solid #ffe38d;padding:3px}
body.care-mode.in-game .opponent .player-head{position:static;inset:auto;width:auto;max-width:none;display:flex;flex-wrap:nowrap;gap:4px;justify-content:flex-start;white-space:nowrap;min-height:22px;flex:none}
body.care-mode.in-game .opponent .player-head strong{display:block;min-width:0;max-width:100%;font-size:18px;font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.care-mode.in-game .opponent .badge{font-size:16px;padding:0 3px;color:#fff4ce;flex:none}
body.care-mode.in-game .opponent .avatar,body.care-mode.in-game .opponent .back-tiles,body.care-mode.in-game .opponent .player-stats,body.care-mode.in-game .opponent>.flowers-row{display:none}
body.care-mode.in-game .opponent .opponent-cards{position:static;inset:auto;height:auto;display:block;min-height:0;min-width:0;overflow:auto;scrollbar-width:thin}
body.care-mode.in-game .opponent .small-tiles{position:static;inset:auto;display:flex;flex-direction:row;flex-wrap:nowrap;width:max-content;min-height:0;gap:5px;justify-content:flex-start}
body.care-mode.in-game .opponent .small-tiles .meld{display:flex;flex-direction:row;gap:0;flex:none}
body.care-mode.in-game .opponent .small-tiles .tile{width:26px;height:36px;flex:none}
body.care-mode.in-game .empty-seat{position:static;transform:none;font-size:18px;min-height:0;padding:0;display:block}
body.care-mode.in-game .discard-board{grid-area:rivers;position:static;inset:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;min-height:0;min-width:0;pointer-events:auto;overflow:hidden}
body.care-mode.in-game .discard-board:has(>.discard-zone:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
body.care-mode.in-game .discard-board:has(>.discard-zone:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
body.care-mode.in-game .discard-zone{position:static;inset:auto;width:auto;height:auto;display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:20px minmax(0,1fr);gap:2px;padding:3px;background:#153e30;border:1px solid #6f946c;border-radius:7px;min-width:0;min-height:0;overflow:hidden}
body.care-mode.in-game .river-heading{display:contents}
body.care-mode.in-game .river-heading>small{grid-column:1;grid-row:1;font-size:14px;line-height:20px;color:#fff;min-width:0;padding:0}
body.care-mode.in-game .river-latest{grid-column:2;grid-row:1/3;align-self:center;min-height:44px;min-width:44px;max-width:44px;font-size:16px;line-height:1.2;padding:3px;border:1px solid #819d70;border-radius:6px;color:#fff;white-space:normal;overflow-wrap:anywhere}
body.care-mode.in-game .discard-viewport{grid-column:1;grid-row:2;min-height:0;min-width:0;scrollbar-width:thin;scrollbar-color:#acc69a #244b38}
body.care-mode.in-game .discard-tiles{--river-tile-width:clamp(26px,4.4cqh,38px);gap:2px;padding:1px;grid-template-columns:repeat(auto-fill,var(--river-tile-width))}
body.care-mode.in-game .discard-zone .tile.tiny{width:var(--river-tile-width);height:calc(var(--river-tile-width)*1.4)}
body.care-mode.in-game .waiting-controls{grid-area:rivers;position:static;inset:auto;transform:none;min-width:0;min-height:0;max-width:none;max-height:none;width:auto;overflow:auto;padding:6px;border-radius:7px;z-index:5}
body.care-mode.in-game .waiting-controls p{font-size:18px;white-space:normal;margin:0 0 6px}
body.care-mode.in-game .waiting-controls>div{gap:6px;flex-wrap:wrap}
body.care-mode.in-game .waiting-controls button{font-size:18px;min-height:44px;padding:6px 10px}
body.care-mode.in-game .own-meta{grid-area:meta;position:static;inset:auto;width:auto;height:auto;min-height:0;overflow:auto;display:block;line-height:1.3;margin:0;pointer-events:auto}
body.care-mode.in-game .own-meta>div{display:flex;flex-direction:column;gap:0;align-items:flex-start}
body.care-mode.in-game .own-meta strong{font-size:16px;color:#fff;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.care-mode.in-game .own-meta span{font:700 22px/1.3 sans-serif;color:#ffe38d;margin:0}
body.care-mode.in-game #ownCount,body.care-mode.in-game #ownFlowers,body.care-mode.in-game #handHint{display:none}
body.care-mode.in-game .own-cards{grid-area:cards;position:static;inset:auto;display:flex;flex-direction:row;flex-wrap:nowrap;gap:8px;align-items:flex-end;justify-content:flex-start;min-height:0;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;scrollbar-width:thin;padding:20px 3px 4px;pointer-events:auto}
body.care-mode.in-game .own-exposed{position:static;inset:auto;display:flex;flex-wrap:nowrap;gap:6px;flex:none;pointer-events:auto;margin:0}
body.care-mode.in-game .own-exposed .tile.mini{width:clamp(26px,4.4cqw,40px);height:clamp(36px,6.1cqw,56px)}
body.care-mode.in-game .hand{position:static;inset:auto;width:max-content;max-width:none;min-height:0;display:flex!important;flex-wrap:nowrap;gap:2px;flex:none;justify-content:flex-start;align-items:flex-end;padding:0;overflow:visible}
body.care-mode.in-game .hand .tile,body.care-mode.in-game .hand:has(.tile:nth-child(8):last-child) .tile{--w:clamp(44px,min(5.6cqw,calc((var(--care-cards) - 24px)*65/99)),68px);width:var(--w);height:calc(var(--w)*99/65);flex:0 0 var(--w);min-height:0;min-width:0}
body.care-mode.in-game .hand .tile.selected{transform:translateY(-8px);outline:3px solid #ffe38d;outline-offset:0;border-radius:5px}
body.care-mode.in-game .hand .tile.drawn{margin-left:6px}
body.care-mode.in-game .hand .tile.is-dragon::after{top:-19px;font:700 14px/17px sans-serif;height:18px;min-width:20px;padding:0 3px;left:50%;border-radius:3px}
body.care-mode.in-game .action-row{grid-area:actions;position:static;inset:auto;display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:stretch;gap:6px;margin:0;min-height:0;min-width:0;overflow:hidden;pointer-events:auto}
body.care-mode.in-game .claim-buttons{position:static;inset:auto;display:flex;flex-wrap:nowrap;gap:6px;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;flex:1 1 auto;align-items:stretch}
body.care-mode.in-game .discard-actions{position:static;inset:auto;display:flex;flex-direction:row;gap:6px;margin:0;flex:none;align-items:stretch}
body.care-mode.in-game .claim-buttons button,body.care-mode.in-game .claim-buttons button.sprite-action,body.care-mode.in-game .discard-actions button{width:auto;height:auto;min-width:58px;min-height:44px;max-height:100%;max-width:180px;flex:none;font:700 20px/1.2 "Microsoft YaHei","PingFang SC",system-ui,sans-serif;padding:5px 10px;white-space:normal;border-radius:7px;background:#e5c88c;color:#173c2d;border:2px solid #f5e4bc;box-shadow:none}
body.care-mode.in-game .claim-buttons button.win-button{background:#f9de86;color:#173c2d}
body.care-mode.in-game .sprite-action img{display:none}
body.care-mode.in-game .sprite-action .action-text{display:inline}
body.care-mode.in-game .discard-actions #sortButton{font-size:18px;min-width:48px;background:#244f3a;color:#fff}
body.care-mode.in-game #discardButton{min-width:78px}
body.care-mode.in-game .action-hint{grid-area:hint;position:static;inset:auto;width:auto;height:auto;min-height:0;max-height:none;max-width:none;overflow:auto;text-align:left;font-size:16px;line-height:1.35;color:#fff;margin:0;pointer-events:auto;white-space:normal;scrollbar-width:thin}
body.care-mode.in-game .honor .honor-glyph{font-size:28px;padding:0}
body.care-mode.in-game .hand .honor .honor-glyph{font-size:40px;padding:0}
body.care-mode.in-game .toast{left:50%;top:auto;bottom:10px;max-width:calc(100dvw - 24px);transform:translateX(-50%);font-size:18px}
body.care-mode dialog,body.care-mode.in-game dialog,body.care-mode.in-game #audioDialog,body.care-mode.in-game #displayDialog{width:min(760px,calc(100dvw - 24px));max-height:calc(100dvh - 24px);padding:14px;font-size:18px;transform:translate(-50%,-50%)}
body.care-mode:not(.in-game) dialog{transform:none}
body.care-mode dialog :is(p,small,label,.fine-print,.rule-context,.rule-table,.score-table,.score-table th,.result-fans span,.result-count,.result-note,.rule-section summary,.flower-statement summary){font-size:18px!important;line-height:1.6;color:#e7ecde}
body.care-mode dialog h2,body.care-mode.in-game dialog h2{font-size:24px}
body.care-mode dialog .dialog-head{align-items:center}
body.care-mode dialog .close-dialog,body.care-mode #audioDialog .dialog-head .close-dialog{min-height:48px;min-width:76px;font-size:18px}
body.care-mode .audio-settings input[type=checkbox]{width:24px;height:24px;min-height:24px}
body.care-mode.in-game #resultDialog .result-player .tile{width:40px;height:56px}
@media(orientation:portrait){
 body.care-mode.in-game .game{inset:auto;left:50%;top:50%;width:100dvh;height:100dvw;max-height:none;transform:translate(-50%,-50%) rotate(90deg)}
 body.care-mode.in-game dialog,body.care-mode.in-game #audioDialog,body.care-mode.in-game #displayDialog{width:min(760px,calc(100dvh - 24px));max-height:calc(100dvw - 24px);transform:translate(-50%,-50%) rotate(90deg)}
 body.care-mode.in-game .toast{left:50%;top:50%;bottom:auto;max-width:calc(100dvh - 24px);transform:translate(-50%,-50%) rotate(90deg)}
}
@container(max-width:760px){body.care-mode.in-game .room-bar .eyebrow{display:none}body.care-mode.in-game .room-tools button{font-size:16px;padding:5px 8px}body.care-mode.in-game .opponent .badge{font-size:14px}body.care-mode.in-game .opponent .player-head strong{font-size:16px}}
@container(max-height:350px){body.care-mode.in-game .room-bar{height:44px;top:2px}body.care-mode.in-game .game-layout{top:48px;bottom:4px}body.care-mode.in-game .table-wrap{grid-template-rows:36px minmax(0,1fr) 44px 92px 22px;gap:4px}body.care-mode.in-game .opponent{flex-direction:row;align-items:center}body.care-mode.in-game .opponent .player-head{flex-direction:column;align-items:flex-start;gap:0;max-width:85px;min-height:0}body.care-mode.in-game .opponent .player-head strong{font-size:14px;line-height:16px}body.care-mode.in-game .opponent .badge{font-size:14px;line-height:16px}body.care-mode.in-game .opponent .opponent-cards{flex:1;max-height:28px}body.care-mode.in-game .opponent .small-tiles .tile{width:20px;height:28px}body.care-mode.in-game .dragon-box .tile{width:28px;height:40px}body.care-mode.in-game #countdown{font-size:20px}body.care-mode.in-game .discard-zone{grid-template-rows:18px minmax(0,1fr)}body.care-mode.in-game .river-heading>small{font-size:13px;line-height:18px}body.care-mode.in-game .claim-buttons button,body.care-mode.in-game .discard-actions button{font-size:18px;padding:4px 8px}}
@media(prefers-reduced-motion:reduce){body.care-mode *,body.care-mode *::before,body.care-mode *::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* Opponents' rivers remain in one upper row, aligned with their seats. */
body.care-mode.in-game #careSelfScore{display:block;flex:none;font-size:18px;font-weight:700;color:#ffe38d;white-space:nowrap}
body.care-mode.in-game .own-meta{display:none}
body.care-mode.in-game .discard-board{grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible}
body.care-mode.in-game .discard-board:has(>.discard-zone:nth-child(2):last-child){grid-template-columns:minmax(0,1fr)}
body.care-mode.in-game .discard-board:has(>.discard-zone:nth-child(3):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
body.care-mode.in-game .river-left{order:1}body.care-mode.in-game .river-top{order:2}body.care-mode.in-game .river-right{order:3}
body.care-mode.in-game .river-bottom{position:absolute;left:0;bottom:calc(var(--care-cards) + var(--care-hint) + 2 * var(--care-gap));width:var(--care-side);height:var(--care-actions);z-index:2}
body.care-mode.in-game .claim-buttons{height:auto;justify-content:flex-start}
@container(max-height:350px){body.care-mode.in-game .river-bottom{bottom:122px;height:44px}}
@container(max-width:760px){body.care-mode.in-game #careSelfScore{font-size:16px}}

/* Keep the clock visible beside the wildcard even on short phone screens. */
body.care-mode.in-game .table-center{display:grid;grid-template-columns:44px minmax(0,1fr);gap:3px}
body.care-mode.in-game .dragon-box{grid-column:1;grid-row:1;flex-direction:column;gap:0;font-size:16px;line-height:18px;min-width:0}
body.care-mode.in-game .dragon-box .tile{margin:0}
body.care-mode.in-game .center-message{display:contents}
body.care-mode.in-game #turnMessage{grid-column:1/3;grid-row:2}
body.care-mode.in-game #countdown{grid-column:2;grid-row:1;align-self:center;font-size:22px}
body.care-mode.in-game #flightMessage{grid-column:1/3;grid-row:3}
body.care-mode.in-game .dice-box{grid-column:1/3}
body.care-mode.in-game .action-row:has(.claim-buttons .claim-pass) .discard-actions{display:none}
@container(max-height:350px){body.care-mode.in-game .dragon-box .tile{width:25px;height:32px}body.care-mode.in-game .dragon-box{font-size:14px;line-height:16px}body.care-mode.in-game .table-center{grid-template-columns:34px minmax(0,1fr)}body.care-mode.in-game #countdown{font-size:20px}}

body.care-mode.in-game .own-exposed:empty{display:none}
body.care-mode.in-game .hand{gap:1px}

body.care-mode.in-game .hand .tile.selected.is-dragon::after{top:0}
/* Care river panels reserve complete large tiles, independent of opponent melds. */
.care-river-board{display:none}
body.care-mode.in-game .game{--care-side:clamp(160px,22cqw,230px)}
body.care-mode.in-game .table-wrap{grid-template-areas:'rivers rivers' 'summary actions' 'cards cards' 'hint hint';grid-template-rows:minmax(92px,1fr) 48px var(--care-cards) var(--care-hint)}
body.care-mode.in-game #discardBoard,body.care-mode.in-game #opponents{display:none}
body.care-mode.in-game .care-river-board{grid-area:rivers;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;min-width:0;min-height:0;overflow:hidden}
body.care-mode.in-game .care-river-board:has(>.care-river-panel:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
body.care-mode.in-game .care-river-board:has(>.care-river-panel:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
body.care-mode.in-game .care-river-panel{display:flex;flex-direction:column;align-items:stretch;gap:2px;min-width:0;min-height:0;width:100%;height:100%;padding:4px;border:2px solid #8dac84;border-radius:8px;background:#163e2e;color:#fff;text-align:left;overflow:hidden;cursor:pointer;touch-action:manipulation}
body.care-mode.in-game .care-river-panel.own-river{border-color:#eed288;background:#244b34}
body.care-mode.in-game .care-river-head{display:flex;align-items:center;gap:3px;flex:none;height:22px;line-height:22px;font-size:17px;min-width:0}
body.care-mode.in-game .care-river-head strong{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:1;min-width:0}
body.care-mode.in-game .care-river-score{flex:none;font-size:16px;color:#ffe397}
body.care-mode.in-game .care-river-note{display:block;flex:none;font-size:14px;line-height:18px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#e5eccf}
body.care-mode.in-game .care-river-melds{display:flex;flex:none;height:32px;gap:6px;overflow:hidden;pointer-events:none}
body.care-mode.in-game .care-river-melds:empty{display:none}
body.care-mode.in-game .care-river-panel:has(.care-river-melds:not(:empty)) .care-river-note{display:none}
body.care-mode.in-game .care-river-melds .meld{display:flex;gap:0;flex:none}
body.care-mode.in-game .care-river-melds .tile{width:23px;height:32px;padding:0;border:0;box-shadow:none;background:none;flex:none}
body.care-mode.in-game .care-river-preview{display:grid;grid-auto-rows:62px;align-content:start;justify-content:start;gap:4px;min-height:62px;min-width:0;flex:1;overflow:hidden;pointer-events:none;padding:0}
body.care-mode.in-game .care-river-preview .tile{display:block;flex:none;width:44px;height:62px;min-width:44px;min-height:62px;max-width:none;padding:0;margin:0;border:0;background:none;box-shadow:none;transform:none}
body.care-mode.in-game .care-river-empty{font-size:18px;color:#d5e1c3;grid-column:1/-1;align-self:center}
body.care-mode.in-game .care-summary{display:grid;grid-template-columns:minmax(0,1fr) 28px 40px;grid-template-rows:18px 20px;gap:0 3px;padding:3px 4px;border:0;background:transparent;border-radius:0}
body.care-mode.in-game .care-summary .table-topline{grid-column:1;grid-row:1;font-size:16px;line-height:18px;white-space:nowrap}
body.care-mode.in-game .care-summary .table-center,body.care-mode.in-game .care-summary .center-message{display:contents}
body.care-mode.in-game .care-summary .dragon-box{grid-column:2;grid-row:1/3;font-size:12px;line-height:12px;align-self:center}
body.care-mode.in-game .care-summary .dragon-box .tile{width:22px;height:28px}
body.care-mode.in-game .care-summary #countdown{grid-column:3;grid-row:1/3;font-size:18px;align-self:center}
body.care-mode.in-game .care-summary #turnMessage{grid-column:1;grid-row:2;font-size:14px;line-height:20px;white-space:nowrap}
body.care-mode.in-game .care-summary #flightMessage,body.care-mode.in-game .care-summary .dice-box{grid-column:1/4;grid-row:auto;font-size:16px}
body.care-mode.in-game #careRiverDialog[open]{display:flex;flex-direction:column;overflow:hidden}
#careRiverDialog .dialog-head,#careRiverDialog .display-dialog-actions{flex:none}
#careRiverDialog .dialog-head{margin:0 0 8px;align-items:center}
#careRiverDialog .dialog-head h2{margin:0;font-size:22px}
#careRiverDialog .care-river-detail{min-height:0;overflow:auto;overscroll-behavior:contain}
#careRiverDialog h3{font-size:20px;margin:10px 0}
#careRiverDialog .care-detail-tiles{display:grid;grid-template-columns:repeat(auto-fill,56px);gap:8px}
#careRiverDialog .care-detail-card{display:flex;flex-direction:column;align-items:center;gap:2px}
body.care-mode.in-game #careRiverDialog .tile{display:block;width:56px;height:80px;padding:0;border:0;background:none;box-shadow:none;flex:none}
#careRiverDialog .care-detail-card>small{font-size:16px;color:#fff}
#careRiverDialog .care-detail-melds{display:flex;flex-wrap:wrap;gap:16px}
#careRiverDialog .care-detail-melds .meld{display:flex;gap:2px}
#careRiverDialog .care-river-explanation{font-size:16px!important;line-height:1.5;margin:12px 0}
@container(max-height:370px){body.care-mode.in-game .care-river-melds{display:none}body.care-mode.in-game .care-river-panel:has(.care-river-melds:not(:empty)) .care-river-note{display:block}}
@container(max-height:350px){body.care-mode.in-game .table-wrap{grid-template-rows:minmax(92px,1fr) 48px 92px 22px;gap:4px}body.care-mode.in-game .care-river-board{gap:4px}body.care-mode.in-game .care-river-panel{padding:3px;gap:0}body.care-mode.in-game .care-river-note,body.care-mode.in-game .care-river-panel:has(.care-river-melds:not(:empty)) .care-river-note{display:none}body.care-mode.in-game .care-river-head{font-size:16px}body.care-mode.in-game .care-river-score{font-size:14px}}

body.care-mode.in-game .care-river-expand{flex:none;font-size:14px;line-height:20px;color:#ffe397;text-decoration:underline}

/* Shared table geometry. No game-rule or network behavior lives here. */
body.care-mode.in-game{overflow:hidden;overscroll-behavior:none}
body.care-mode.in-game .game{position:fixed;inset:0;width:100dvw;height:100dvh;max-height:none;transform:none;container-type:size;overflow:hidden;isolation:isolate;background:radial-gradient(ellipse at 50% 40%,#276b57,#123f32 85%);--table-head:48px;--table-hand:80px;--table-action:48px;--table-side:24%;--care-preview-width:38px;--care-preview-height:54px}
body.care-mode.in-game .game{--care-preview-width:44px;--care-preview-height:62px;background:#164c3a}
body.care-mode.in-game .room-bar{position:absolute;inset:4px 8px auto;display:flex;align-items:center;justify-content:flex-end;height:40px;gap:8px;overflow:hidden;z-index:5}
body.care-mode.in-game .room-bar>div:first-child{display:none}
body.care-mode.in-game #careSelfScore{display:block;font:700 18px/1.2 system-ui;color:#f2df9d;margin-right:4px}
body.care-mode.in-game .room-tools{display:flex;gap:6px;flex-wrap:nowrap}
body.care-mode.in-game .room-tools button{min-height:40px;font-size:16px;line-height:1.2;padding:7px 12px;color:#f3f4e8;background:#143e31;border:1px solid #90ac9466;border-radius:9px;white-space:nowrap}
body.care-mode.in-game .room-tools :is(#historyButton,#catalogButton,#gameRulesButton,#gameSoundButton,#trusteeButton,#leaveButton){display:none}
body.care-mode.in-game .game-layout{position:absolute;inset:var(--table-head) 10px 4px;display:block;overflow:hidden;margin:0;padding:0}
body.care-mode.in-game .table-wrap{position:absolute;inset:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) var(--table-action) var(--table-hand);grid-template-areas:'rivers' 'actions' 'cards';gap:5px;overflow:hidden;margin:0;padding:0}
body.care-mode.in-game .felt,body.care-mode.in-game .own-area{display:contents}
body.care-mode.in-game .felt::before,body.care-mode.in-game .felt::after,body.care-mode.in-game #opponents,body.care-mode.in-game #discardBoard,body.care-mode.in-game .own-meta,body.care-mode.in-game #ownFlowers,body.care-mode.in-game .table-watermark,body.care-mode.in-game .compass{display:none}
body.care-mode.in-game .care-river-board,body.care-mode.in-game .care-river-board:has(>.care-river-panel:nth-child(2):last-child),body.care-mode.in-game .care-river-board:has(>.care-river-panel:nth-child(3):last-child){grid-area:rivers;position:static;inset:auto;display:grid;grid-template-columns:var(--table-side) minmax(0,1fr) var(--table-side);grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:6px;min-width:0;min-height:0;overflow:hidden;pointer-events:none}
body.care-mode.in-game .care-river-panel{display:flex;flex-direction:column;align-items:stretch;position:relative;inset:auto;min-width:0;min-height:0;width:100%;height:100%;margin:0;padding:4px 5px;gap:2px;background:#123c2c70;border:1px solid #8ca88e55;border-radius:9px;color:#f4f7eb;text-align:left;overflow:hidden;cursor:pointer;pointer-events:auto;touch-action:manipulation;box-shadow:inset 0 1px #ffffff08}
body.care-mode.in-game .care-seat-top{grid-area:1/2/2/3}
body.care-mode.in-game .care-seat-bottom{grid-area:2/2/3/3}
body.care-mode.in-game .care-seat-left{grid-area:1/1/3/2;align-self:center;height:96%}
body.care-mode.in-game .care-seat-right{grid-area:1/3/3/4;align-self:center;height:96%}
body.care-mode.in-game .care-river-panel.own-river{background:#244f3e88;border-color:#cab67788}
body.care-mode.in-game .care-river-panel.current{border:2px solid #f1d88d;padding:3px 4px;box-shadow:0 0 0 1px #f1d88d33}
body.care-mode.in-game .care-river-head{display:flex;align-items:center;gap:5px;flex:none;min-width:0;height:20px;font:600 14px/20px system-ui}
body.care-mode.in-game .care-river-head strong{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.care-mode.in-game .care-river-score{flex:none;color:#f4dfa0;font-size:14px}
body.care-mode.in-game .care-river-expand{flex:none;color:#c0d4bd;font-size:12px;text-decoration:none}
body.care-mode.in-game .care-river-note{display:none}
body.care-mode.in-game .care-river-melds{display:flex;position:static;inset:auto;flex:none;height:25px;min-height:25px;gap:5px;overflow:hidden;pointer-events:none}
body.care-mode.in-game .care-river-melds:empty,body.care-mode.in-game .own-river .care-river-melds{display:none}
body.care-mode.in-game .care-river-melds .meld{display:flex;gap:0;flex:none}
body.care-mode.in-game .care-river-melds .tile{display:block;width:18px;height:25px;padding:0;border:0;background:none;box-shadow:none;flex:none;transform:none}
body.care-mode.in-game .care-river-preview{display:grid;grid-auto-rows:var(--care-preview-height);gap:4px;align-content:start;justify-content:center;min-height:var(--care-preview-height);min-width:0;flex:1;overflow:hidden;pointer-events:none;padding:0}
body.care-mode.in-game .care-river-preview .tile{display:block;flex:none;width:var(--care-preview-width);height:var(--care-preview-height);min-width:var(--care-preview-width);min-height:var(--care-preview-height);max-width:none;padding:0;margin:0;border:0;background:none;box-shadow:none;transform:none}
body.care-mode.in-game .care-river-preview .tile:last-child{filter:drop-shadow(0 0 2px #ffe295)}
body.care-mode.in-game .care-river-empty{font:14px/1.4 system-ui;color:#a8c6b6;grid-column:1/-1;align-self:center}
body.care-mode.in-game .care-summary{position:fixed;left:10px;top:3px;width:280px;height:40px;display:grid;grid-template-columns:64px 94px minmax(0,1fr);grid-template-rows:20px 20px;gap:0 7px;padding:0;border:0;background:none;overflow:hidden;pointer-events:none}
body.care-mode.in-game .care-summary .table-center,body.care-mode.in-game .care-summary .center-message{display:contents}
body.care-mode.in-game .care-summary .table-topline{position:static;inset:auto;grid-area:1/2/2/3;display:block;width:auto;height:auto;font:600 15px/20px system-ui;color:#f0f4e6;letter-spacing:0}
body.care-mode.in-game .care-summary .table-topline>span:first-child{display:none}
body.care-mode.in-game .care-summary .dragon-box{position:static;inset:auto;grid-area:1/1/3/2;display:flex;align-items:center;justify-content:flex-start;flex-direction:row;width:auto;height:auto;gap:3px;padding:0;border:0;background:none;color:#f3df97;font:600 14px/18px system-ui}
body.care-mode.in-game .care-summary .dragon-box .tile{width:28px;height:40px;flex:none}
body.care-mode.in-game #indicatorLabel,body.care-mode.in-game .dice-box>span,body.care-mode.in-game .dice-box>b{display:none}
body.care-mode.in-game .care-summary #countdown{position:static;inset:auto;transform:none;grid-area:1/3/2/4;display:block;width:auto;height:auto;min-height:0;font:700 17px/20px system-ui;color:#f4de96;text-align:left;letter-spacing:0}
body.care-mode.in-game .care-summary #turnMessage{position:static;inset:auto;transform:none;grid-area:2/2/3/4;display:block;width:auto;height:auto;max-height:20px;overflow:hidden;font:600 14px/20px system-ui;color:#fff;text-align:left;white-space:nowrap;letter-spacing:0}
body.care-mode.in-game .care-summary #flightMessage,body.care-mode.in-game .care-summary .dice-box{display:none}
body.care-mode.in-game .own-cards{grid-area:cards;position:static;inset:auto;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-end;justify-content:safe center;gap:10px;min-width:0;min-height:0;max-width:100%;padding:16px 2px 3px;margin:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;scrollbar-width:thin;pointer-events:auto}
body.care-mode.in-game .own-exposed{position:static;inset:auto;display:flex;flex-wrap:nowrap;gap:6px;flex:none;margin:0}
body.care-mode.in-game .own-exposed:empty{display:none}
body.care-mode.in-game .own-exposed .tile.mini{width:30px;height:42px;flex:none}
body.care-mode.in-game .hand{position:static;inset:auto;display:flex!important;width:max-content;max-width:none;min-height:0;flex:none;flex-wrap:nowrap;align-items:flex-end;justify-content:flex-start;gap:1px;padding:0;overflow:visible}
body.care-mode.in-game .hand .tile,body.care-mode.in-game .hand:has(.tile:nth-child(8):last-child) .tile{--w:clamp(40px,min(5.6cqw,calc((var(--table-hand) - 20px)*65/99)),68px);width:var(--w);height:calc(var(--w)*99/65);flex:0 0 var(--w);min-width:0;min-height:0}
body.care-mode.in-game .hand .tile.drawn{margin-left:8px}
body.care-mode.in-game .hand .tile.selected{transform:translateY(-7px);outline:3px solid #ffe38d;outline-offset:0;border-radius:5px}
body.care-mode.in-game .hand .tile.is-dragon::after{top:-16px;left:50%;height:16px;min-width:18px;padding:0 3px;font:700 12px/16px system-ui;border-radius:3px}
body.care-mode.in-game .hand .tile.selected.is-dragon::after{top:0}
body.care-mode.in-game .action-row{grid-area:actions;position:relative;inset:auto;display:flex;flex-wrap:nowrap;align-items:stretch;justify-content:flex-end;gap:8px;min-height:0;min-width:0;height:auto;margin:0;padding:0;overflow:hidden;z-index:20;pointer-events:auto}
body.care-mode.in-game .claim-buttons{position:static;inset:auto;display:flex;flex-wrap:nowrap;align-items:stretch;justify-content:flex-end;gap:7px;min-width:0;max-width:100%;height:100%;overflow-x:auto;overflow-y:hidden;flex:1;scrollbar-width:thin}
body.care-mode.in-game .discard-actions{position:static;inset:auto;display:flex;flex-direction:row;align-items:stretch;gap:7px;flex:none;margin:0}
body.care-mode.in-game .claim-buttons button,body.care-mode.in-game .claim-buttons button.sprite-action,body.care-mode.in-game .discard-actions button{width:auto;height:100%;min-width:66px;min-height:44px;max-height:100%;max-width:170px;flex:none;padding:3px 14px;border:1px solid #f2e3bb;border-radius:9px;background:linear-gradient(#f6e4b2,#dfbf79);color:#173d2e;font:700 22px/1.15 system-ui;white-space:normal;box-shadow:0 2px 0 #152d22}
body.care-mode.in-game .claim-buttons .claim-pass,body.care-mode.in-game .discard-actions #sortButton{background:#214c3a;color:#e5eee2;border-color:#8ca88e;font-size:18px}
body.care-mode.in-game .sprite-action img{display:none}
body.care-mode.in-game .sprite-action .action-text{display:inline}
body.care-mode.in-game .action-row:has(.claim-pass) .discard-actions{display:none}
body.care-mode.in-game #discardButton{min-width:94px}
body.care-mode.in-game .action-hint{display:none}
body.care-mode.in-game .waiting-controls{position:absolute;inset:10px 26% auto;transform:none;max-height:calc(100% - var(--table-hand) - var(--table-action) - 20px);min-width:0;max-width:none;width:auto;overflow:auto;z-index:25;background:#153f32f5;border:1px solid #c3b783;border-radius:12px;padding:12px}
body.care-mode.in-game .waiting-controls p{font-size:16px;line-height:1.5}
body.care-mode.in-game .waiting-controls>div{display:flex;gap:8px;flex-wrap:wrap}
body.care-mode.in-game .waiting-controls button{min-height:44px;font-size:18px}
body.care-mode.in-game #careRiverDialog[open]{display:flex;flex-direction:column;overflow:hidden}
body.care-mode.in-game button:focus-visible{outline:3px solid #ffe38d;outline-offset:-3px}
body.care-mode.in-game .care-river-head{font-size:16px}
body.care-mode.in-game .care-river-score{font-size:16px}
body.care-mode.in-game .room-tools button{font-size:18px}
body.care-mode.in-game .claim-buttons button,body.care-mode.in-game .claim-buttons button.sprite-action,body.care-mode.in-game #discardButton{font-size:24px}
@container(min-height:500px){body.care-mode.in-game .game-layout{--table-hand:120px;--table-action:54px}body.care-mode.in-game .care-river-head{height:26px;font-size:18px}body.care-mode.in-game .care-river-melds{height:34px;min-height:34px}body.care-mode.in-game .care-river-melds .tile{width:24px;height:34px}}
@container(max-height:380px){body.care-mode.in-game .game-layout{--table-hand:78px}body.care-mode.in-game .care-river-board{--care-preview-width:38px;--care-preview-height:54px}}
@container(max-height:340px){body.care-mode.in-game .game-layout{--table-hand:68px;--table-action:44px}body.care-mode.in-game .care-river-board{--care-preview-width:34px;--care-preview-height:48px}body.care-mode.in-game .care-river-panel{padding:2px 3px}body.care-mode.in-game .care-river-panel.current{padding:1px 2px}body.care-mode.in-game .care-river-head{font-size:13px;height:18px;line-height:18px}body.care-mode.in-game .care-river-melds{height:20px;min-height:20px}body.care-mode.in-game .care-river-melds .tile{width:14px;height:20px}body.care-mode.in-game .hand .tile{--w:min(38px,calc((100cqw - 50px)/14 - 1px))}body.care-mode.in-game .care-river-expand{font-size:11px}body.care-mode.in-game .room-tools button{padding:6px;font-size:15px}body.care-mode.in-game #careSelfScore{font-size:15px}}
@media(orientation:portrait){body.care-mode.in-game .game{inset:auto;left:50%;top:50%;width:100dvh;height:100dvw;transform:translate(-50%,-50%) rotate(90deg)}}

body.care-mode.in-game .care-seat-top .care-river-head{width:44%;height:24px;line-height:24px}
body.care-mode.in-game .care-seat-top .care-river-expand{display:none}
body.care-mode.in-game .care-seat-top .care-river-melds{position:absolute;top:4px;right:5px;width:52%;height:24px;min-height:24px;justify-content:flex-end}
body.care-mode.in-game .care-summary #flightMessage,body.care-mode.in-game .care-summary .dice-box{display:block;position:fixed;top:auto;bottom:calc(var(--table-hand) + var(--table-action) + 13px);height:18px;max-height:18px;width:23%;overflow:auto;white-space:nowrap;font:13px/18px system-ui;pointer-events:auto}
body.care-mode.in-game .care-summary #flightMessage{left:10px;right:auto}
body.care-mode.in-game .care-summary .dice-box{left:auto;right:10px}
body.care-mode.in-game .care-summary .dice-box #contractLabel{font:13px/18px system-ui;position:static}
body.care-mode.in-game .care-summary #flightMessage:empty,body.care-mode.in-game .care-summary .dice-box:has(#contractLabel:empty){display:none}

/* Match legacy care selectors without changing either mode's behavior. */
@media(orientation:portrait){body.care-mode.in-game dialog,body.care-mode.in-game #audioDialog,body.care-mode.in-game #displayDialog{width:min(760px,calc(100dvh - 24px));max-height:calc(100dvw - 24px);transform:translate(-50%,-50%) rotate(90deg)}}

body.care-mode.in-game .care-river-board[data-count="2"] .care-river-panel{grid-column:1/4}
body.care-mode.in-game .action-hint{display:block;position:static;inset:auto;transform:none;width:auto;flex:1;min-width:0;align-self:center;max-height:100%;overflow:auto;margin:0;color:#d4e2d1;font:14px/1.4 system-ui;pointer-events:auto}
body.care-mode.in-game .action-row:has(.claim-pass) .action-hint,body.care-mode.in-game .claim-buttons:empty{display:none}
body.care-mode.in-game .claim-buttons{flex:0 1 auto}

body.care-mode.in-game .action-hint{white-space:normal;text-overflow:clip;text-align:left;overflow-x:hidden;overflow-y:auto}
body.care-mode.in-game .claim-buttons button,body.care-mode.in-game .claim-buttons button.sprite-action{line-height:1;padding:2px 10px;font-size:20px}
body.care-mode.in-game .claim-buttons button,body.care-mode.in-game .claim-buttons button.sprite-action{font-size:22px}

/* Normal mode keeps the table, avatars and tools; care cards are opt-in only. */
body.in-game:not(.care-mode) .game{--normal-flower-height:clamp(20px,5.2cqh,38px)}
body.in-game:not(.care-mode) .care-river-board{display:none}
body.in-game:not(.care-mode) .room-tools{max-width:72%;overflow-x:auto;scrollbar-width:none;flex:none}
body.in-game:not(.care-mode) .room-tools button{white-space:nowrap;flex:none;min-height:28px}
body.in-game:not(.care-mode) .room-bar{height:32px;top:3px}
body.in-game:not(.care-mode) .room-bar>div:first-child{min-width:0}
body.in-game:not(.care-mode) .room-bar .eyebrow{display:none}
body.in-game:not(.care-mode) .room-bar h1{white-space:nowrap}
body.in-game:not(.care-mode) .opponent>.flowers-row{display:flex;align-items:center;gap:2px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;min-height:var(--normal-flower-height);height:var(--normal-flower-height);max-height:none;pointer-events:auto;cursor:pointer;scrollbar-width:none;border-radius:4px;background:#0b4c3655}
body.in-game:not(.care-mode) .opponent>.flowers-row .tile,body.in-game:not(.care-mode) #ownFlowers .tile{width:calc(var(--normal-flower-height)*46/64);height:var(--normal-flower-height);flex:none}
body.in-game:not(.care-mode) .seat-top>.flowers-row{left:59%;top:18%;width:25%;max-width:25%}
body.in-game:not(.care-mode) .seat-left>.flowers-row{left:1.8%;top:28%;width:12%;max-width:12%}
body.in-game:not(.care-mode) .seat-right>.flowers-row{right:1.8%;top:28%;width:12%;max-width:12%}
body.in-game:not(.care-mode) #ownFlowers{display:flex;left:16%;bottom:20%;width:68%;height:var(--normal-flower-height);align-items:center;gap:2px;cursor:pointer;scrollbar-width:none}
body.in-game:not(.care-mode) .flower-count{flex:none;color:#f5df95;font:600 clamp(11px,2.1cqh,15px)/1.2 system-ui;margin-right:3px}
body.in-game:not(.care-mode) .action-row{z-index:20}
body.in-game:not(.care-mode) .claim-buttons{bottom:26%;height:clamp(40px,8cqh,60px);max-width:68%;align-items:stretch}
body.in-game:not(.care-mode) .claim-buttons button,body.in-game:not(.care-mode) .claim-buttons button.sprite-action{min-width:48px;min-height:40px;max-height:none;height:100%}
body.in-game:not(.care-mode) .discard-actions>.primary{min-height:40px;min-width:48px}
body.in-game:not(.care-mode) #sortButton{min-height:28px}
body.in-game:not(.care-mode) .hand .tile.is-dragon::after{font-size:clamp(10px,1.8cqh,14px);height:clamp(14px,2.4cqh,18px);line-height:clamp(14px,2.4cqh,18px);top:calc(-1 * clamp(14px,2.4cqh,18px))}
body.in-game:not(.care-mode) .dragon-box .tile{width:clamp(18px,3.6cqh,28px);height:clamp(25px,5.1cqh,39px)}
body.in-game:not(.care-mode) .dragon-box{height:7%;top:19.5%}
body.in-game:not(.care-mode) .hand .tile.selected{transform:translateY(-1.5cqh)}
body.in-game:not(.care-mode) #careRiverDialog[open]{display:flex;flex-direction:column;overflow:hidden}
body.in-game #careRiverDialog .tile{width:46px;height:64px;flex:none}
body.in-game .care-detail-flowers{display:flex;flex-wrap:wrap;gap:6px}
body.in-game .care-flower-count{font-size:13px;flex:none;color:#f4df9c}
body.in-game .flowers-row:focus-visible{outline:2px solid #f7dc8c}

body.in-game:not(.care-mode) .river-bottom{height:13%}
body.in-game:not(.care-mode) .river-left,body.in-game:not(.care-mode) .river-right{height:38%}
body.in-game:not(.care-mode) .claim-buttons{bottom:24%}
body.in-game:not(.care-mode) #ownFlowers{bottom:18%}
body.in-game:not(.care-mode) .river-heading{gap:2px}
body.in-game:not(.care-mode) .river-expand{flex:none;font-size:11px;line-height:14px;padding:1px 3px;border:0;background:#164c3899;color:#f5e1aa;min-height:18px}
body.in-game:not(.care-mode) .river-heading>small{flex:1}

body.in-game:not(.care-mode) .revealed-backs{gap:1px}
body.in-game:not(.care-mode) .revealed-backs .tile{width:clamp(19px,3.2cqw,36px);height:clamp(27px,4.45cqw,50px);flex:none}
body.in-game:not(.care-mode) .seat-left .revealed-backs,body.in-game:not(.care-mode) .seat-right .revealed-backs{display:grid;grid-template-columns:repeat(2,max-content);gap:2px;top:35%;max-height:40%;overflow:auto;width:auto}
body.in-game:not(.care-mode) .seat-left .revealed-backs{left:1.8%}
body.in-game:not(.care-mode) .seat-right .revealed-backs{right:1.8%}
body.in-game .game[data-phase="ended"] .waiting-controls{left:50%;right:auto;top:43%;bottom:auto;transform:translate(-50%,-50%);width:max-content;min-width:0;max-width:58%;max-height:27%;padding:8px 12px;z-index:25;overflow:auto}
body.in-game .game[data-phase="ended"] .waiting-controls p{font-size:clamp(12px,2.2cqh,17px);line-height:1.3;white-space:normal;margin:0 0 6px}
body.in-game .game[data-phase="ended"] .waiting-controls button{font-size:clamp(14px,2.5cqh,19px);min-height:36px;padding:6px 10px}
body.in-game .game[data-phase="ended"] .care-river-preview{overflow:auto}
body.in-game .game[data-phase="ended"] .discard-actions{display:none}

/* Latest opponent discard: read-only, above the river but away from actions. */
.discard-flash{position:absolute;z-index:15;top:29%;display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 8px;border-radius:8px;background:#173d32ed;box-shadow:0 2px 10px #0007;pointer-events:none!important;max-width:20%;}
.discard-flash[hidden]{display:none!important}.discard-flash *{pointer-events:none!important}.discard-flash .tile{--w:clamp(36px,6cqw,64px)}.discard-flash-name{font-size:12px;color:#fff;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.flash-left{left:19%}.flash-right{right:19%}.flash-top{left:50%;transform:translateX(-50%);top:18%}

/* Normal action labels are live text: never wait for decorative PNG downloads. */
body.in-game:not(.care-mode) .claim-buttons button.sprite-action{width:auto;min-width:48px;padding:3px 12px;background:#dbc58e;border:1px solid #f4dfaa;border-radius:5px;color:#233c2a;font:700 20px/1.2 system-ui;box-shadow:0 2px 2px #173e2d}
body.in-game:not(.care-mode) .sprite-action img{display:none}
body.in-game:not(.care-mode) .sprite-action .action-text{display:inline}
body.in-game:not(.care-mode) .river-bottom{left:27%;top:41%;width:46%;height:24%}
body.in-game:not(.care-mode) .river-bottom .discard-tiles{grid-template-columns:repeat(18,minmax(0,1fr));gap:2px}
body.in-game:not(.care-mode) .river-bottom .tile.tiny{width:100%;height:auto;aspect-ratio:46/64}
body.in-game:not(.care-mode) .compass{top:35%}
/* Back-tile negative margins must never leak into revealed face artwork. */
body.in-game:not(.care-mode) .revealed-backs .tile img{width:100%;height:100%;aspect-ratio:auto;margin:0!important;object-fit:contain}
body.in-game:not(.care-mode) .revealed-backs{align-items:start;justify-content:start}
body.in-game:not(.care-mode) .seat-top .revealed-backs{flex-direction:row}


body.in-game:not(.care-mode) .river-left{left:13%;width:13%}
body.in-game:not(.care-mode) .river-right{left:74%;width:13%}
body.in-game:not(.care-mode) .seat-left .revealed-backs,body.in-game:not(.care-mode) .seat-right .revealed-backs{grid-template-columns:repeat(4,max-content);gap:2px;max-height:50%;overflow:visible}
body.in-game:not(.care-mode) .seat-left .revealed-backs .tile,body.in-game:not(.care-mode) .seat-right .revealed-backs .tile{width:clamp(15px,2cqw,26px);height:clamp(21px,2.8cqw,36px)}

body.in-game:not(.care-mode) .seat-left .small-tiles .tile,body.in-game:not(.care-mode) .seat-right .small-tiles .tile{width:clamp(23px,3.6cqw,34px);height:clamp(19px,2.93cqw,28px)}
body.in-game:not(.care-mode) .seat-top .small-tiles .tile{width:clamp(23px,3cqw,34px);height:clamp(32px,4.2cqw,47px)}
body.care-mode.in-game .care-river-melds{height:36px;min-height:36px;overflow-x:auto;overflow-y:hidden}
body.care-mode.in-game .care-river-melds .tile{width:26px;height:36px}

body.in-game:not(.care-mode) .river-top{height:14%}
.winner-badge{background:#f4cc64;color:#59250c;border:2px solid #fff0b5;border-radius:5px;padding:3px 7px;font:bold 18px/1.2 system-ui!important;white-space:nowrap}

body.in-game:not(.care-mode) .player-stats,body.in-game:not(.care-mode) #ownCount{display:none}
body.in-game:not(.care-mode) .player-score{position:absolute;z-index:10;color:#ffe49a;background:#164c38e8;padding:2px 5px;border-radius:3px;font:bold clamp(13px,2.8cqh,20px)/1.1 system-ui;pointer-events:none}
body.in-game:not(.care-mode) .seat-left .player-score{left:2%;top:23%}
body.in-game:not(.care-mode) .seat-right .player-score{right:2%;top:23%}
body.in-game:not(.care-mode) .seat-top .player-score{left:17%;top:20%}
body.in-game:not(.care-mode) .own-meta{z-index:12;width:12%;line-height:1.3}
body.in-game:not(.care-mode) #ownScore{display:block;color:#ffe49a;background:#164c38e8;width:max-content;padding:3px 5px;font:bold clamp(14px,3cqh,22px)/1.1 system-ui}
body.care-mode.in-game .care-river-note{display:none}
body.care-mode.in-game .care-river-score{flex:none;position:relative;z-index:3;background:#164c38;color:#ffe49a;font-weight:bold}

/* A compact wildcard plaque: the tile, not empty background, gets the space. */
body.in-game:not(.care-mode) .dragon-box{left:50%;transform:translateX(-50%);top:17%;width:max-content;max-width:28%;height:auto;gap:5px;padding:2px 6px;font-size:clamp(12px,2.6cqh,18px)}
body.in-game:not(.care-mode) .dragon-box .tile{width:min(34px,6.3cqh);height:min(47px,8.7cqh);flex:none}
body.in-game:not(.care-mode) .dragon-box small{display:none}
body.in-game:not(.care-mode) .river-top{top:28%;height:13%}
body.care-mode.in-game .care-summary .dragon-box .tile{width:30px;height:42px}

/* Countdown occupies its own upper-table slot, never the hand/action band. */
body.in-game:not(.care-mode) #countdown{position:absolute;left:27%;top:19%;transform:none;width:44px;height:28px;min-height:28px;display:flex;align-items:center;justify-content:center;background:#174a35;border:1px solid #ddc47d;border-radius:5px;font:bold 18px/1 system-ui;pointer-events:none;z-index:12}
body.in-game:not(.care-mode) #countdown:empty{visibility:hidden}
body.care-mode.in-game .care-summary #countdown{min-width:44px;min-height:28px;line-height:28px;background:#174a35;border-radius:4px;text-align:center;pointer-events:none}

body.in-game:not(.care-mode) .center-message{left:27%;top:19%;transform:none;width:44px;height:28px;background:none}
body.in-game:not(.care-mode) .center-message .compass{display:none}
body.in-game:not(.care-mode) #countdown{left:0;top:0}


/* Source badges overlap the group edge without taking a row or intercepting taps. */
.has-meld-source{position:relative!important;overflow:visible!important}
.meld-source{position:absolute;z-index:3;bottom:-5px;left:50%;transform:translateX(-50%);display:inline-block;box-sizing:border-box;min-width:16px;height:16px;line-height:14px;padding:0 3px;border:1px solid #fff9df;border-radius:5px;color:#fff!important;font:700 11px/14px system-ui,sans-serif;text-align:center;white-space:nowrap;pointer-events:none;text-shadow:none;box-shadow:0 1px 2px #0005}
body.care-mode .meld-source,.care-detail-melds .meld-source,.result-meld .meld-source{height:20px;min-width:20px;font-size:14px;line-height:18px;bottom:-6px}
/* Reserve the actual minimum button width on compact normal tables. */
@container(max-width:600px){body.in-game:not(.care-mode) .own-cards{right:calc(1.6% + 60px);left:5%;justify-content:safe center;overflow-x:auto;overflow-y:hidden;padding-top:20px;padding-bottom:8px;pointer-events:auto}}
.quick-chat-panel{position:absolute;z-index:65;top:42px;right:10px;width:min(330px,80cqw);max-height:45cqh;overflow:auto;background:#123f31;border:1px solid #e6d391;border-radius:10px;padding:10px;box-shadow:0 5px 20px #0008;color:#fff;pointer-events:auto;font:14px/1.4 system-ui}
.quick-chat-panel[hidden]{display:none}.quick-chat-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}.quick-chat-list{display:grid;grid-template-columns:1fr 1fr;gap:6px}.quick-chat-panel button{min-height:40px;padding:6px;font:inherit;white-space:normal;background:#e8d59f;color:#183e2e;border:1px solid #fff4c4;border-radius:6px}.quick-chat-panel label{display:flex;align-items:center;gap:8px;margin-top:8px}.quick-chat-panel input[type=range]{min-width:0;flex:1}.quick-chat-panel input[type=checkbox]{width:20px;height:20px}.care-mode .quick-chat-panel{font-size:18px}.care-mode .quick-chat-panel button{font-size:18px;min-height:44px}
