.mj-screen-tools,.mj-panel,.mj-panel-backdrop { display:none; }
html.mj-viewport-lock,html.mj-viewport-lock body { overflow:hidden; overscroll-behavior:none; }
[data-mj-screen] {
 --mj-top:max(4px,env(safe-area-inset-top,0px)); --mj-left:max(6px,env(safe-area-inset-left,0px));
 --mj-right:max(6px,env(safe-area-inset-right,0px)); --mj-bottom:max(4px,env(safe-area-inset-bottom,0px));
 --mj-head:48px; --mj-dock:56px; --mj-score:0px;
 position:fixed; z-index:7; inset:0; box-sizing:border-box; isolation:isolate;
 width:100%; max-width:none; height:100%; min-height:0;
 margin:0; padding:var(--mj-top) var(--mj-right) var(--mj-bottom) var(--mj-left);
 color:#f7ebcc; color-scheme:dark; background:#152b23;
}
[data-mj-screen]:is([data-mj-game="26"],[data-mj-region]) { --mj-dock:68px; --mj-score:39px; }
.fv[data-mj-screen="play"],[data-mj-screen="watch"]>.mj-watch-frame {
 display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:var(--mj-head) minmax(0,1fr) auto;
}
.fv[data-mj-screen]::before { filter:brightness(.67); }
[data-mj-screen="watch"]>.mj-watch-frame { height:100%; width:100%; max-width:none; gap:0; padding:0; margin:0; }
.fv[data-mj-screen] .fv-head,.mj-watch-header {
 display:flex; gap:10px; align-items:center; align-self:stretch; flex-wrap:nowrap;
 box-sizing:border-box; width:100%; max-width:none; min-width:0; min-height:0; padding:0 2px 4px; margin:0;
}
.fv[data-mj-screen] .fv-head > div:not(.mj-screen-tools) { display:flex; align-items:center; align-self:center; padding:0; }
.fv[data-mj-screen] .fv-head h1,.mj-watch-header h1 { flex:1; min-width:0; margin:0; color:#fff2d5; font:600 clamp(16px,2.4vmin,25px)/1.12 "Baskervville",Georgia,serif; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-mj-screen] .mj-screen-tools { display:flex; gap:5px; flex:none; }
[data-mj-screen] .mj-screen-control,[data-mj-screen] .fv-head > button,.mj-watch-header .rb-button {
 box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; flex:none;
 height:39px; min-height:0; min-width:39px; padding:0 9px; margin:0;
 border:1px solid #9b9e7b8c; border-radius:8px; background:#1c322ae8; color:#f5e7c5;
 font:650 13px/1.1 system-ui,sans-serif; cursor:pointer;
}
[data-mj-screen] .mj-screen-control { width:39px; padding:9px; }
[data-mj-screen] .mj-screen-control[hidden] {display:none;}
[data-mj-screen] .mj-screen-control:focus-visible,.mj-watch-header a:focus-visible,.mj-panel :is(summary,button,a):focus-visible {outline:2px solid #ffda89;outline-offset:1px;}
[data-mj-screen] .mj-screen-control svg {display:block; width:100%; height:100%;}
[data-mj-screen] .mj-screen-control[aria-pressed="true"] { background:#63573b; }
[data-mj-screen] [data-fv-content] { min-width:0; min-height:0; grid-row:2; }
.fv[data-mj-screen] .fv-board[data-game],[data-mj-screen] .rt-watch.fv-board {
 position:relative; isolation:isolate; box-sizing:border-box; display:grid; align-items:stretch; align-content:stretch; justify-items:stretch;
 grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) var(--mj-dock) var(--mj-score);
 width:100%; height:100%; max-width:none; min-height:0; padding:0; margin:0; gap:0;
 border:1px solid #ad926376; border-radius:10px; background:linear-gradient(110deg,#243d31,#132b22 55%,#22372b);
 box-shadow:0 2px 7px #080e0aba;
}
[data-mj-screen="watch"] .rt-watch.fv-board { --mj-dock:0px; grid-row:2; }
[data-mj-screen] .fv-board .rt-world.rt-mj {
 box-sizing:border-box; grid-column:1; grid-row:1; width:100%; height:100%; min-width:0; min-height:0; max-height:none; aspect-ratio:auto;
 margin:0; border:0; border-radius:9px; container-type:size; background-size:100% 100%; box-shadow:inset 0 0 14px #2718085c,0 3px 6px #0a140e9e;
}
[data-mj-screen] .fv-board>.fv-map-head,[data-mj-screen] .fv-board>.rt-ribbon {
 display:flex; position:absolute; z-index:4; top:8px; align-items:center; justify-content:center;
 box-sizing:border-box; min-width:0; max-width:43%; margin:0; padding:4px 9px; gap:4px 8px; line-height:1.14;
 border:1px solid #cebb8994; border-radius:7px; background:#15271fed; box-shadow:0 1px 4px #050d08a6;
 color:#fff3d4; font-size:clamp(10px,1.65vmin,15px); text-align:center; overflow-wrap:anywhere;
}
[data-mj-screen] .fv-board>.fv-map-head { left:8px; flex-wrap:wrap; gap:3px 6px; }
[data-mj-screen] .mj-turn-caption { min-width:0; }
[data-mj-screen] .mj-turn-clock {
 display:inline-flex; flex:none; align-items:center; justify-content:center; gap:.28em;
 padding:.1em .48em .1em .26em; border:1px solid #8cae8a; border-radius:99px;
 background:#254737; color:#f4f9e2; white-space:nowrap; font-size:clamp(12px,1.7vmin,16px); font-variant-numeric:tabular-nums;
}
[data-mj-screen] .mj-turn-clock[hidden] { display:none; }
[data-mj-screen] .mj-turn-clock b { font-size:1em; line-height:1.16; font-weight:700; }
[data-mj-screen] .mj-turn-clock svg { width:1.25em; height:1.25em; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
[data-mj-screen] .mj-turn-clock svg circle:first-child { opacity:.26; }
[data-mj-screen] .mj-clock-ring { transform:rotate(-90deg); transform-origin:center; stroke-dasharray:var(--mj-seconds,20) 20; }
[data-mj-screen] .mj-turn-clock[data-urgent] { font-size:clamp(14px,1.9vmin,18px); background:#7b331b; color:#fff1b8; border-color:#ffb667; box-shadow:0 0 0 1px #4f2318; }
[data-mj-screen] .mj-turn-clock[data-waiting] { border-style:dashed; border-color:#ccbc95; background:#373b2e; color:#fff0d3; }
[data-mj-screen] .mj-turn-clock[data-paused] { background:#37433b; color:#dedfd6; }

[data-mj-screen] .fv-board>.rt-ribbon { right:8px; }
[data-mj-screen] .fv-board>.rt-ribbon span {white-space:nowrap;}
[data-mj-screen] .fv-board>.rt-controls {
 display:flex; position:static; grid-area:2/1; align-self:stretch; align-items:center; align-content:center; justify-content:center;
 flex-wrap:wrap; gap:4px 10px; min-width:0; min-height:0; margin:0; padding:2px 8px;
}
[data-mj-screen] .fv-board>.rt-controls:empty {display:none;}
[data-mj-screen] .rt-controls .fv-button { min-height:40px; min-width:44px; margin:0; padding:6px 14px; font-size:clamp(12px,1.8vmin,16px); }
[data-mj-screen] .fv-board>.sc-scoreboard { grid-area:3/1; display:flex; gap:8px; align-self:stretch; align-items:center; min-height:0; margin:0; padding:2px 9px; }
[data-mj-screen] .sc-scoreboard>strong { flex:none; margin:0; font-size:11px; }
[data-mj-screen] .fv-board>.sc-notice,[data-mj-screen] .fv-board>[data-mj-advice]:not([hidden]) {
 position:absolute; z-index:4; bottom:calc(var(--mj-dock) + var(--mj-score) + 7px); left:50%; transform:translateX(-50%);
 width:max-content; max-width:83%; min-height:0; margin:0; padding:3px 9px; border-radius:6px;
 color:#fff0ca; background:#1a2e25f0; font-size:12px; line-height:1.2; text-align:center;
}
[data-mj-screen] .fv-board>.fv-result {
 position:absolute; z-index:5; left:0; right:0; bottom:calc(var(--mj-score) + 4px);
 width:max-content; max-width:95%; margin:0 auto; padding:5px 10px; gap:6px; display:flex; justify-content:center; flex-wrap:wrap;
 align-items:center; border:1px solid #b39862; border-radius:8px; background:#273b2df7; color:#f9e9c1; box-shadow:0 3px 10px #09170e80;
}
[data-mj-screen] .fv-result .fv-button { min-height:30px; padding:4px 8px; font-size:12px; }
[data-mj-screen] .fv-result span,[data-mj-screen] .fv-result strong { font-size:clamp(12px,2vmin,16px); line-height:1.2; }
.fv[data-mj-screen]>.fv-log { min-height:16px; width:100%; max-width:none; margin:0; padding:2px 5px 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#e6dfc4; background:none; border:0; font-size:11px; line-height:1.16; }
[data-mj-screen] .rt-mj .rt-person.rt-far { width:min(17cqw,25cqh); left:50%; translate:-50% 0; }
[data-mj-screen] .rt-mj .rt-person.rt-near { width:min(23cqw,30cqh); left:50%; translate:-50% 0; }
[data-mj-screen] .rt-mj .rt-person:is(.rt-left,.rt-right) { width:min(19cqw,29cqh); }
[data-mj-screen] .rt-mj .rt-hand.rt-mj-hand { width:86%; gap:clamp(1px,.17cqw,3px); }
[data-mj-screen] .rt-mj .rt-hand.rt-mj-hand .fv-tile { flex:0 1 min(5.8cqw,9cqh); width:min(5.8cqw,9cqh); height:min(8.3cqw,11cqh); max-width:none; border-radius:clamp(3px,.6cqw,7px); }
[data-mj-screen] .rt-mj .rt-river { --cell:clamp(7px,min(2.1cqw,3cqh),28px); }
[data-mj-screen] .rt-world .rt-nameplate b {font-size:clamp(10px,min(2.6cqw,2.8cqh),18px);}
[data-mj-screen] .rt-world .rt-nameplate small {font-size:clamp(8px,min(2cqw,2.3cqh),14px);}
[data-mj-screen][data-mj-menu-open] .mj-panel-backdrop { display:block; position:absolute; inset:0; z-index:8; background:#07120cb8; }
[data-mj-screen][data-mj-menu-open] .mj-panel:not([hidden]) { display:flex; position:absolute; flex-direction:column; z-index:9; inset:var(--mj-top) var(--mj-right) var(--mj-bottom) auto;
 width:min(428px,calc(100% - var(--mj-left) - var(--mj-right))); padding:0; margin:0; border:1px solid #ab9362; border-radius:12px;
 box-shadow:-8px 3px 40px #07120c99; background:#20362c; color:#f1e5c7; }
.mj-panel-top { display:flex; gap:10px; justify-content:space-between; align-items:center; padding:8px 13px; border-bottom:1px solid #7c826480; }
.mj-panel-top h2 { margin:0; font-size:19px; }
.mj-panel-body { min-height:0; padding:12px; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; text-align:start; }
.mj-voice-settings {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid #7c826480;}
.mj-voice-settings label {display:inline-flex;align-items:center;gap:8px;min-height:40px;cursor:pointer;}
.mj-voice-settings input {width:18px;height:18px;accent-color:#7bc7a3;}
.mj-voice-settings button {min-height:40px;}
.mj-voice-settings small {flex-basis:100%;}
.mj-voice-settings small:empty {display:none;}
.mj-panel .fv-actions,.mj-panel .mj-tray { margin:0 0 8px; text-align:start; }
.mj-panel .fv-actions { justify-content:flex-start; }
.mj-panel .fv-guide summary { min-height:42px; padding:10px 4px; }
.mj-panel .rb-side { padding:8px; }
.mj-panel :is(.rb-controls,.rb-watch-tools) { display:flex; gap:5px; margin:6px 0; }
@container game-screen (max-width:600px) and (orientation:portrait){
 [data-mj-screen] { --mj-head:46px; --mj-dock:57px; }
 [data-mj-screen]:is([data-mj-game="26"],[data-mj-region]) { --mj-dock:90px; --mj-score:42px; }
 [data-mj-screen] .fv-board>.rt-ribbon,[data-mj-screen] .fv-board>.fv-map-head { top:5px; padding:3px 6px; }
 [data-mj-screen] .fv-board>.rt-ribbon { right:4px; flex-wrap:wrap; }
 [data-mj-screen] .fv-board>.fv-map-head { left:4px; }
 [data-mj-screen] .rt-mj .rt-person.rt-far { width:23cqw; top:8%; }
 [data-mj-screen] .rt-mj .rt-person.rt-near { width:31cqw; top:77%; }
 [data-mj-screen] .rt-mj .rt-person:is(.rt-right,.rt-left) { width:24cqw; top:30%; }
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand { width:95%; gap:1px; bottom:26%; }
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand .fv-tile { width:6.5cqw; flex-basis:6.5cqw; height:clamp(34px,9cqw,48px); }
 [data-mj-screen] .rt-mj .rt-river { --cell:2.7cqw; }
 [data-mj-screen] .rt-mj .rt-river-left { right:58.5%; } [data-mj-screen] .rt-mj .rt-river-right { left:58.5%; }
 [data-mj-screen] .sc-scoreboard>strong {position:absolute;clip-path:inset(50%); width:1px;height:1px;overflow:hidden;}
 [data-mj-screen] .sc-controls[data-phase="choose"] .sc-prompt { flex-direction:row; justify-content:center; gap:6px; }
 [data-mj-screen] .sc-controls .sc-action-title { max-width:18em; }
}
@container game-screen (orientation:landscape) and (max-height:560px){
 [data-mj-screen] { --mj-head:35px; --mj-dock:38px; --mj-bottom:max(2px,env(safe-area-inset-bottom,0px)); }
 [data-mj-screen]:is([data-mj-game="26"],[data-mj-region]) { --mj-dock:40px; --mj-score:25px; }
 [data-mj-screen] .mj-screen-control,[data-mj-screen] .fv-head > button,.mj-watch-header .rb-button { height:30px; min-width:34px; }
 [data-mj-screen] .mj-screen-control { width:34px; padding:6px; }
 .fv[data-mj-screen]>.fv-log { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
 [data-mj-screen] .fv-board>.rt-ribbon,[data-mj-screen] .fv-board>.fv-map-head { top:3px; padding:2px 6px; }
 [data-mj-screen] .rt-controls .fv-button { min-height:32px; padding:4px 10px; }
 [data-mj-screen] .sc-controls[data-phase="choose"] .sc-prompt {width:auto; flex-direction:row; gap:6px; align-items:center;}
 [data-mj-screen] .sc-score {display:flex; align-items:center; justify-content:space-between; gap:3px; padding:2px 4px;}
 [data-mj-screen] .sc-score small { font-size:9px; white-space:nowrap; }
 [data-mj-screen] .fv-board>.sc-scoreboard { padding-block:0; }
}
@container game-screen (min-aspect-ratio:2/1) {
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand { gap:clamp(1px,.3cqw,5px); }
}
#roomPage[data-mj-screen="watch"] { position:fixed; }
[data-mj-screen] .fv-board[data-game] > .fv-actions.rt-controls { grid-area:2/1; }
[data-mj-screen] .fv-board[data-game] > .fv-map-head { grid-area:1/1; }
[data-mj-screen] .fv-board[data-game] > .fv-result:has(.mj-room-scores) {
 display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); justify-content:stretch; justify-items:stretch; gap:4px 8px;
 inset:auto 0 calc(var(--mj-score) + 4px); width:min(560px,96%);
 max-height:calc(100% - var(--mj-score) - 8px); overflow:auto; overscroll-behavior:contain;
}
[data-mj-screen] .fv-result:has(.mj-room-scores) > :is(strong,span,table) { grid-column:1/-1; }
[data-mj-screen] .fv-result .mj-room-scores { width:100%; table-layout:fixed; font-size:clamp(10px,1.7vmin,14px); }
[data-mj-screen] .mj-room-scores :is(td,th) { padding:2px 4px; overflow-wrap:anywhere; }
@container game-screen (orientation:portrait) and (max-aspect-ratio:4/5) {
 [data-mj-screen][data-mj-game="22"] .fv-board .rt-world.rt-mj { background-image:url("/scenes/festival-mj-table-portrait.webp"); }
 [data-mj-screen]:is([data-mj-game="26"],[data-mj-region]) .fv-board .rt-world.rt-mj { background-image:url("/scenes/festival-sichuan-table-portrait.webp"); }
 [data-mj-screen] .rt-mj .rt-person.rt-far { top:11%; }
 [data-mj-screen] .rt-mj .rt-person.rt-near { top:70%; width:34cqw; }
 [data-mj-screen] .rt-mj .rt-rack-far { top:27%; height:2.6%; }
 [data-mj-screen] .rt-mj .rt-wall-far { top:31%; height:2.6%; }
 [data-mj-screen] .rt-mj .rt-wall-near { top:55%; height:2.7%; }
 [data-mj-screen] .rt-mj .rt-rack-left,[data-mj-screen] .rt-mj .rt-rack-right { top:33%; height:21%; }
 [data-mj-screen] .rt-mj .rt-wall-left,[data-mj-screen] .rt-mj .rt-wall-right { top:35%; height:16%; }
 [data-mj-screen] .rt-mj .rt-river-far { top:35%; }
 [data-mj-screen] .rt-mj .rt-river-left,[data-mj-screen] .rt-mj .rt-river-right { top:38%; }
 [data-mj-screen] .rt-mj .rt-open-far { top:27%; }
 [data-mj-screen] .rt-mj .rt-open-near { bottom:43%; }
 [data-mj-screen] .rt-mj .rt-rack-near { bottom:38%; }
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand { width:89%; bottom:36%; }
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand .fv-tile { height:clamp(36px,10.2cqw,54px); }
 [data-mj-screen] .rt-mj .rt-dice { top:44.8%; }
}
@container game-screen (min-aspect-ratio:2/1) {
 [data-mj-screen][data-mj-game="22"] .fv-board .rt-world.rt-mj { background-image:url("/scenes/festival-mj-table-wide.webp"); }
 [data-mj-screen]:is([data-mj-game="26"],[data-mj-region]) .fv-board .rt-world.rt-mj { background-image:url("/scenes/festival-sichuan-table-wide.webp"); }
 [data-mj-screen] .rt-mj .rt-person:is(.rt-left,.rt-right) { top:23%; width:min(17cqw,38cqh); }
 [data-mj-screen] .rt-mj .rt-person.rt-left { left:4%; }
 [data-mj-screen] .rt-mj .rt-person.rt-right { right:4%; }
 [data-mj-screen] .rt-mj .rt-rack-far {width:27%; left:36.5%; top:24%; height:3.6%;}
 [data-mj-screen] .rt-mj .rt-wall-far,[data-mj-screen] .rt-mj .rt-wall-near {left:33%;width:34%;}
 [data-mj-screen] .rt-mj .rt-wall-far {top:30%;}
 [data-mj-screen] .rt-mj .rt-rack-left {left:25%;}
 [data-mj-screen] .rt-mj .rt-rack-right {right:25%;}
 [data-mj-screen] .rt-mj .rt-wall-left {left:29%;}
 [data-mj-screen] .rt-mj .rt-wall-right {right:29%;}
 [data-mj-screen] .rt-mj .rt-wall-left,[data-mj-screen] .rt-mj .rt-wall-right {width:1.6%;}
 [data-mj-screen] .rt-mj .rt-rack-left,[data-mj-screen] .rt-mj .rt-rack-right {width:1.6%;}
 [data-mj-screen] .rt-mj .rt-river-far {top:34%;}
 [data-mj-screen] .rt-mj .rt-river-left {right:57%;}
 [data-mj-screen] .rt-mj .rt-river-right {left:57%;}
 [data-mj-screen] .rt-mj .rt-open-far {left:63%;top:24%;}
 [data-mj-screen] .rt-mj .rt-open-left {left:27%;}
 [data-mj-screen] .rt-mj .rt-open-right {right:27%;}
 [data-mj-screen] .rt-mj .rt-open-near {left:23%;}
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand {width:60%;gap:clamp(1px,.19cqw,4px);bottom:26.5%;}
 [data-mj-screen] .rt-mj .rt-hand.rt-mj-hand .fv-tile {flex-basis:4.05cqw;width:4.05cqw;height:min(6cqw,13.5cqh);}
}
[data-mj-screen] .fv-result:has(.mj-room-scores) > button:only-of-type { grid-column:1/-1; }
@container game-screen (orientation:portrait) and (max-aspect-ratio:4/5) {
 [data-mj-screen] .rt-mj .rt-person.rt-far {top:15%;}
 [data-mj-screen] .rt-mj .rt-person.rt-near {top:66.5%;width:47cqw;}
 [data-mj-screen] .rt-mj .rt-near .rt-figure {mask-image:linear-gradient(#000 0 62%,#000d 72%,transparent 85%);}
 [data-mj-screen] .rt-mj .rt-near .rt-nameplate {left:81%;top:38%;}
}

/* Keep the same physical rack through a turn change. The controls float a tile's
   height plus the picked-up tile clearance above that fixed bottom edge. */
.fv[data-mj-screen="play"] .fv-board[data-game] {
 --mj-dock:0px;
 grid-template-rows:minmax(0,1fr) auto var(--mj-score);
}
[data-mj-screen="play"] .rt-world.rt-mj {
 --mj-hand-base:18.5%; --mj-face-height:min(8.3cqw,11cqh); --mj-lift-clearance:clamp(11px,1.6cqh,17px);
}
[data-mj-screen="play"] .rt-world .rt-hand.rt-mj-hand { bottom:var(--mj-hand-base); }
[data-mj-screen="play"] .rt-world .rt-hand.rt-mj-hand .fv-tile { height:var(--mj-face-height); }
[data-mj-screen="play"] .rt-mj .rt-person.rt-near { top:82%; }
[data-mj-screen="play"] .rt-world .fv-actions.mj-action-rail {
 box-sizing:border-box; position:absolute; z-index:6; bottom:calc(var(--mj-hand-base) + var(--mj-face-height) + var(--mj-lift-clearance));
 left:50%; transform:translateX(-50%); display:flex; flex-flow:row nowrap; align-items:stretch; justify-content:safe center;
 width:max-content; max-width:calc(100% - 12px); min-width:0; gap:clamp(3px,.55cqw,9px); margin:0; padding:3px;
 overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; border:1px solid #b4a375;
 border-radius:12px; background:linear-gradient(175deg,#33493af5,#142b22f5); box-shadow:0 2px 0 #101e17,0 3px 7px #11201980;
}
[data-mj-screen="play"] .mj-action-rail .fv-button {
 display:flex; flex:none; align-items:center; justify-content:center; gap:3px; min-width:44px; min-height:42px; padding:5px clamp(8px,1.2cqw,17px);
 white-space:nowrap; touch-action:manipulation; font:650 clamp(13px,1.9cqh,17px)/1.12 system-ui,sans-serif;
 border-radius:8px; border:1px solid #8a9e7c; background:linear-gradient(#425f48,#294735); color:#fff6df;
}
[data-mj-screen="play"] .mj-action-rail .fv-button:focus-visible { outline:2px solid #ffe2a1; outline-offset:-3px; }
[data-mj-screen="play"] .mj-action-rail .primary { color:#31200d; border-color:#f3dba3; background:linear-gradient(#ffe3aa,#dfb76e); }
[data-mj-screen="play"] .mj-action-rail .mj-move-hu { color:#fff2ce; border-color:#ecb781; background:linear-gradient(#a44b35,#843825); }
[data-mj-screen="play"] .mj-action-rail :is(.mj-move-kong,.mj-move-upgrade) { border-color:#d3ab75; background:linear-gradient(#795b35,#58422b); }
[data-mj-screen="play"] .mj-action-rail :is(.quiet,.mj-move-pass) { border-color:#84937b; background:#20372d; }
[data-mj-screen="play"] .mj-action-rail .sc-suit-0 {background:#794d40;}
[data-mj-screen="play"] .mj-action-rail .sc-suit-1 {background:#415c70;}
[data-mj-screen="play"] .mj-action-rail .sc-suit-2 {background:#3b604d;}
[data-mj-screen="play"] .mj-action-rail .fv-button:disabled { opacity:.75; border-color:#7d856e; background:#425046; color:#d9dfd2; }
[data-mj-screen="play"] .mj-action-rail .sc-picked {align-self:center; min-width:3em; padding-inline:5px; font-size:clamp(14px,2cqh,19px);}
.mj-option-tiles { display:inline-flex; flex:none; align-items:center; gap:1px; }
.mj-option-tiles .fv-tile {
 display:inline-flex; flex:none; box-sizing:border-box; width:13px; height:18px; margin:0; padding:1px 0 2px;
 border-radius:2px; color:#254436; background:#f2e6c9; box-shadow:0 1px #68826c;
}
[data-mj-screen="play"] .mj-table-note { grid-area:2/1; min-width:0; color:#f6e6bd; text-align:center; }
[data-mj-screen="play"] .mj-table-note:empty,[data-mj-screen="play"] .mj-table-note:not(:has(>:not([hidden]))) { display:none; }
[data-mj-screen="play"] .mj-table-note :is(.sc-prompt,.sc-notice,[data-mj-advice]:not([hidden])) {
 display:flex; align-items:center; justify-content:center; flex-wrap:wrap; flex-direction:row; gap:2px 9px;
 width:auto; max-width:100%; margin:0; padding:3px 6px; font-size:12px; line-height:1.16;
}
[data-mj-screen="play"] .mj-table-note .sc-action-title { font-size:clamp(12px,1.8vmin,15px); }
[data-mj-screen="play"] .mj-table-note .sc-received .fv-tile { width:15px; height:19px; }

[data-mj-screen] .mj-turn-clock {
 order:-1; padding:.12em .54em .15em .27em; font-size:clamp(16px,2.5vmin,25px); letter-spacing:.015em;
 color:#fff6da; border-color:#e3ca8d; background:linear-gradient(155deg,#42674b,#213f30);
 box-shadow:inset 0 1px 0 #fff2c92a,0 1px 3px #0b140f99;
}
[data-mj-screen] .mj-turn-clock b {font-weight:750;}
[data-mj-screen] .mj-turn-clock[data-urgent] { font-size:clamp(20px,3vmin,30px); border-color:#ffdc89; color:#fff6cb; background:linear-gradient(145deg,#a44c2c,#72331e); }
[data-mj-screen] .mj-turn-clock[data-waiting] { font-size:clamp(12px,1.9vmin,18px); }
[data-mj-screen] .mj-turn-caption { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-mj-screen] .mj-turn-clock[data-waiting] b {white-space:normal; overflow-wrap:anywhere;}
[data-mj-screen] .mj-turn-clock[data-waiting] {max-width:100%;}
@media (prefers-reduced-motion:no-preference) {
 [data-mj-screen] .mj-turn-clock[data-urgent] { animation:mj-clock-light 1s ease-in-out infinite; }
 @keyframes mj-clock-light { 50% { box-shadow:0 0 0 2px #ffc8797a,0 2px 5px #25150988; } }
}
@container game-screen (orientation:portrait) and (max-aspect-ratio:4/5) {
 [data-mj-screen="play"] .rt-world.rt-mj { --mj-hand-base:25%; --mj-face-height:clamp(36px,10.2cqw,54px); }
 [data-mj-screen="play"] .rt-mj .rt-person.rt-near { top:76%;width:43cqw; }
 [data-mj-screen="play"] .mj-action-rail .fv-button {min-height:40px;}
}
@container game-screen (orientation:landscape) and (max-height:560px) {
 [data-mj-screen="play"] .rt-world.rt-mj { --mj-hand-base:9.5%; --mj-face-height:min(8cqw,15cqh); --mj-lift-clearance:10px; }
 [data-mj-screen="play"] .rt-mj .rt-person.rt-near { top:90.2%; left:50%; width:min(13cqw,16cqh); }
 [data-mj-screen="play"] .rt-mj .rt-near .rt-nameplate {left:89%;right:auto;top:15%;}
 [data-mj-screen="play"] .rt-world .rt-hand.rt-mj-hand {width:80%; gap:clamp(1px,.18cqw,3px);}
 [data-mj-screen="play"] .rt-world .rt-hand.rt-mj-hand .fv-tile {flex-basis:5.45cqw; width:5.45cqw;}
 [data-mj-screen="play"] .mj-action-rail .fv-button {min-height:34px; padding:3px 8px;}
 [data-mj-screen="play"] .mj-table-note .sc-received .fv-tile {width:12px;height:16px;}
 [data-mj-screen="play"] .rt-mj .rt-wall-near {top:50.3%;height:2.5%;}
 [data-mj-screen="play"] .rt-mj .rt-river-near {left:39%;bottom:52%;}
}
@container game-screen (max-width:420px) {
 [data-mj-screen="play"] .mj-action-rail .fv-button {padding-inline:6px;}
 [data-mj-screen="play"] .mj-action-rail .fv-button:has(.mj-option-tiles) {flex-direction:column;gap:1px;}
}
@container game-screen (orientation:portrait) and (max-height:690px) {
 [data-mj-screen="play"] .rt-world.rt-mj { --mj-hand-base:17%; }
 [data-mj-screen="play"] .rt-mj .rt-person.rt-near {top:82%;width:37cqw;}
}
/* Logical top, right, bottom and left lie at different screen edges when
   the physical phone stays upright and the table is turned clockwise. */
html.table-turned [data-mj-screen] {
 --mj-top:max(4px,env(safe-area-inset-right,0px)); --mj-right:max(6px,env(safe-area-inset-bottom,0px));
 --mj-bottom:max(2px,env(safe-area-inset-left,0px)); --mj-left:max(6px,env(safe-area-inset-top,0px));
}
[data-mj-screen="play"] .mj-table-note > [data-mj-advice]:not([hidden]) {
 position:absolute; z-index:4; left:5px; bottom:calc(var(--mj-score) + 4px); width:max-content; max-width:min(38%,28em);
 border:1px solid #bba777; border-radius:6px; background:#1d3429f2; pointer-events:none;
}

[data-mj-screen] .mj-region-badge{position:absolute;left:16%;top:7%;display:flex;align-items:center;gap:8px;color:#fff1c7;font-size:clamp(10px,1.6cqw,15px);z-index:4;pointer-events:none;text-shadow:0 1px 3px #000}.mj-region-badge span{display:flex;align-items:center;gap:4px}.mj-region-badge .fv-tile{display:inline-flex;width:22px;height:29px}.mj-region-badge .fv-tile svg{width:100%;height:100%}
