:root{color-scheme:dark;--cream:#f5f0dc;--gold:#dfc77f;--muted:#a8bcb0;--line:#ffffff17}*{box-sizing:border-box}body{margin:0;background:#0b2d25;color:var(--cream);font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background-image:radial-gradient(ellipse at 50% 30%,#1d50403d,transparent 70%)}button,select,a{-webkit-tap-highlight-color:transparent}button,select{font:inherit}button,a,select{touch-action:manipulation}button{cursor:pointer;color:var(--cream);background:#ffffff08;border:1px solid #ffffff24;border-radius:8px;min-height:44px;padding:9px 15px;transition:background .15s,border-color .15s}button:hover{background:#ffffff15;border-color:#dfc77f80}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible,.board-scroll:focus-visible{outline:3px solid var(--gold);outline-offset:4px}a{color:inherit}.gold{color:var(--gold)}.site-header{height:76px;display:flex;align-items:center;gap:18px;border-bottom:1px solid var(--line);padding:0 max(24px,calc((100vw - 1320px)/2));background:#08271f80}.brand{font-size:22px;font-weight:750;text-decoration:none;display:flex;gap:10px;align-items:center}.brand>span{font-size:19px}.preview-tag{color:var(--gold);font-size:9px;letter-spacing:1.6px;border:1px solid #dfc77f42;border-radius:4px;padding:3px 7px}.back-link{margin-left:auto;color:#bacbc2;font-size:13px;text-decoration:none}main{max-width:1320px;margin:0 auto;padding:36px 24px 16px}.heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}.eyebrow{font-size:10px;letter-spacing:2.5px;color:var(--gold);font-weight:650;margin:0 0 8px}h1{font:normal 42px/1.15 Georgia,serif;letter-spacing:-1px;margin:0 0 10px}.intro{color:var(--muted);margin:0;font-size:14px}.quiet{font-size:13px;background:transparent;border:0}.quiet span{display:inline-grid;place-items:center;border:1px solid #a8bcb065;border-radius:50%;width:21px;height:21px;margin-left:8px}.table{border:1px solid #728a614f;border-radius:16px;background:radial-gradient(ellipse at 50% 35%,#245c46,#123e30 85%);box-shadow:0 20px 70px #0003;overflow:hidden}.table-bar{display:flex;justify-content:space-between;align-items:center;padding:18px 26px;border-bottom:1px solid var(--line);gap:15px;background:#072b2129}.settings{display:flex;gap:24px}.settings label{display:flex;flex-direction:column;color:var(--muted);font-size:10px;letter-spacing:1px;gap:1px}.settings select{color:var(--cream);font-size:14px;letter-spacing:0;padding:5px 26px 5px 0;background:transparent;border:0;cursor:pointer;min-height:32px}.settings option{background:#123e30}.stats{display:flex;gap:32px}.stats>div{display:flex;flex-direction:column;align-items:center;min-width:54px}.stats span{font-size:9px;letter-spacing:1.3px;color:var(--muted)}.stats strong{font-weight:500;font-size:23px;font-variant-numeric:tabular-nums}.board-scroll{width:100%;overflow:auto;padding:25px 24px 10px;scrollbar-color:#66816b #123e30;scrollbar-width:thin;overscroll-behavior-x:contain}.board{position:relative;margin:auto;isolation:isolate}.tile{position:absolute;padding:0;min-height:0;border:1px solid #d6cbb0;border-radius:5px;background:linear-gradient(110deg,#fffef5,#f1ebd9);box-shadow:1px 2px 0 #c1b595,2px 4px 0 #8a8166,3px 6px 0 #68664d,4px 8px 8px #00180d88;transition:filter .12s,transform .12s;touch-action:manipulation}.tile svg,.tile img{width:100%;height:100%;display:block;pointer-events:none;border-radius:4px}.tile svg{padding:5%}.tile img{object-fit:contain;padding:3%}.tile[aria-disabled=true]{filter:brightness(.79);cursor:not-allowed}.tile:hover{background:#fffbea;border-color:#dfc77f}.tile[aria-disabled=false]:hover{filter:brightness(1.08)}.tile.selected{outline:3px solid #f7cd62;outline-offset:-1px;transform:translateY(-3px);background:#ffe9a6}.tile.hinted{outline:3px solid #a9edc0;outline-offset:-1px;background:#dbffe4}.tile:focus-visible{outline:3px solid #6db7ff;outline-offset:-2px}.board.is-paused{visibility:hidden}.board-message{display:flex;align-items:center;justify-content:center;gap:8px;min-height:49px;padding:8px 22px;color:#c0d1c3;font-size:12px}.board-message p{margin:0}.status-dot{width:5px;height:5px;flex:none;background:#bfd397;border-radius:50%}.text-button{border:0;color:var(--gold);background:transparent;padding:4px 8px;font-size:11px;margin-left:auto;white-space:nowrap}.toolbar{padding:17px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);background:#06271f45}.primary{background:var(--gold);border-color:var(--gold);color:#243d2b;font-weight:650}.primary:hover{background:#f0d995;color:#163324}.tools{display:flex;gap:7px}.tools button{font-size:13px}.tools button span{font-size:18px;margin-right:4px;vertical-align:-1px}.under-table{display:flex;justify-content:space-between;color:#96ae9f;font-size:11px;padding:14px 3px}.under-table>span:first-child{color:#c6c39a}.tips{display:grid;grid-template-columns:repeat(3,1fr);gap:38px;margin:26px 0 32px}.tips article{display:flex;gap:14px}.tip-number{color:#c8bc7d;font:italic 24px Georgia,serif;opacity:.65}.tips h2{font-size:13px;font-weight:550;margin:0 0 5px}.tips p{font-size:12px;color:var(--muted);margin:0;max-width:300px}footer{border-top:1px solid var(--line);padding:18px 0 0;color:#839d8f;font-size:11px;display:flex;justify-content:space-between;gap:20px}footer span{font-size:10px}dialog{color:var(--cream);background:#123e30;border:1px solid #8e9861;border-radius:16px;max-width:460px;width:calc(100% - 36px);box-shadow:0 30px 120px #0009;padding:30px}dialog::backdrop{background:#031a15b8;backdrop-filter:blur(5px)}dialog h2{font:32px Georgia,serif;margin:8px 0 14px}dialog p:not(.eyebrow){color:#c1d0c5;font-size:14px;line-height:1.8;white-space:pre-line}#dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:25px}#game:fullscreen{max-width:none;overflow:auto;background:#0b2d25;padding:24px}#game:fullscreen .tips,#game:fullscreen footer{display:none}.noscript{position:fixed;inset:30%;background:#123e30;padding:30px}@media(min-width:1400px){main{padding-top:42px}.board-scroll{padding-top:32px}}@media(max-width:760px){.site-header{height:60px;padding:0 16px;gap:10px}.brand>span{font-size:16px}.preview-tag{font-size:8px}.back-link{font-size:11px}main{padding:24px 12px 12px}h1{font-size:32px}.eyebrow{font-size:8px;letter-spacing:1.8px}.intro{font-size:12px}.heading{margin-bottom:20px;gap:10px}.heading .quiet{font-size:0;padding:6px}.heading .quiet span{font-size:14px}.table-bar{padding:12px 14px;flex-wrap:wrap}.settings{gap:22px}.stats{gap:18px;margin-left:auto}.stats strong{font-size:20px}.stats span{font-size:8px;letter-spacing:.7px}.stats>div{min-width:40px}.board-scroll{padding:22px 12px 10px}.toolbar{flex-direction:column;padding:14px 12px;align-items:stretch}.tools{justify-content:space-between;gap:4px}.tools button{padding:7px 8px;font-size:11px}.tools button span{margin-right:1px;font-size:16px}.tips{gap:18px;margin:22px 5px}.tips article{gap:7px}.tips p{font-size:11px}.tip-number{font-size:18px}.board-message{padding:8px 12px;font-size:11px}.under-table{font-size:10px;gap:12px}footer{flex-direction:column;gap:8px}.table{border-radius:12px}}@media(max-width:440px){.table-bar{gap:12px}.settings{width:100%;justify-content:space-between}.stats{width:100%;justify-content:space-between;margin:0}.stats>div{flex-direction:row;gap:8px}.stats strong{font-size:18px}.tips{grid-template-columns:1fr;gap:15px}.tips p{max-width:none}.tools button{font-size:10px;padding:7px 6px}.tools button span{display:block;font-size:19px}.back-link{max-width:64px;line-height:1.3}.board-message{flex-wrap:wrap;justify-content:flex-start}.under-table{align-items:flex-start}.under-table>span:last-child{text-align:right;max-width:96px}.text-button{min-height:30px}.heading h1{font-size:29px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Keep sound beside New game so every control fits on small phones. */
.new-controls{display:flex;gap:10px}.new-controls .primary{flex:1}.sound-toggle{font-size:13px;white-space:nowrap}.sound-toggle.muted{color:var(--muted)}

/* Visual feedback adapted from ffalt/mah's board.component.html (MIT).
   Its license is included in sound.js. Keep hint motion inside the button
   so the tile's click target stays stationary. */
@keyframes mah-wiggle {
  0%,100%{transform:rotate(0deg)}
  20%{transform:rotate(-3deg)}
  40%{transform:rotate(3deg)}
  60%{transform:rotate(-1deg)}
  80%{transform:rotate(1deg)}
}
@keyframes mah-select-pop {
  0%{transform:translateY(-3px) scale(1)}
  60%{transform:translateY(-3px) scale(1.08)}
  100%{transform:translateY(-3px) scale(1.04)}
}
@keyframes mah-match-flash {
  0%,100%{transform:scale(1)}
  40%{transform:scale(1.14)}
}
.tile.wiggle{animation:mah-wiggle 250ms ease-in-out;transform-origin:center}
.tile.selected{transform:translateY(-3px) scale(1.04);animation:mah-select-pop 140ms ease-out}
.tile.hinted svg,.tile.hinted img{animation:mah-match-flash 3000ms ease-out infinite;transform-origin:center}
@media(prefers-reduced-motion:reduce){
  .tile.wiggle,.tile.selected,.tile.hinted svg,.tile.hinted img{animation:none}
  .tile.selected{transform:translateY(-3px)}
}

/* Menu and control buttons */
.icon-definitions{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
.control-icon{display:block;width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.settings{gap:12px}
.menu-button{display:flex;align-items:center;gap:13px;min-width:180px;min-height:62px;padding:10px 14px;text-align:left;border:1px solid #bdccaa40;border-top-color:#cbd8aa60;border-radius:12px;background:linear-gradient(180deg,#42634be6,#284b36e6);box-shadow:inset 0 1px 0 #ffffff12,0 3px 0 #082b20,0 5px 10px #001a1529}
.menu-button>.control-icon:first-child{color:#e4cd8d;width:23px;height:23px}
.menu-button .chevron{width:16px;height:16px;color:#d2d7b9;margin-left:auto}
.menu-copy{display:flex;flex-direction:column;gap:2px}
.menu-copy small{font-size:8px;color:#c4cbaa;letter-spacing:1.7px;font-weight:650}
.menu-copy strong{font-size:14px;font-weight:600;white-space:nowrap}
.menu-button:hover{background:linear-gradient(180deg,#506f54,#335a40);border-color:#d8c48a99}
.toolbar{gap:22px;padding:20px 24px;background:#082e22a6}
.toolbar button,#dialog-actions button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border-radius:11px;padding:10px 15px;font-size:13px;font-weight:600;border:1px solid #b3c6a43d;border-top-color:#c2d1b567;background:linear-gradient(180deg,#45664c,#2b4a36);box-shadow:inset 0 1px 0 #ffffff12,0 3px 0 #071f16,0 5px 9px #00150d33;transition:transform .12s,background .12s,box-shadow .12s,border-color .12s}
.toolbar button:not(:disabled):hover,#dialog-actions button:hover{background:linear-gradient(180deg,#527659,#35543e);border-color:#d9ca9190;transform:translateY(-1px)}
.toolbar button:not(:disabled):active,.menu-button:active,#dialog-actions button:active{transform:translateY(2px);box-shadow:inset 0 1px 3px #00190d35,0 1px 0 #071f16}
.toolbar button.primary,#dialog-actions button.primary{background:linear-gradient(180deg,#f0dda0 0%,#d8b965 100%);color:#343e25;border-color:#dfc580;border-top-color:#fff0b9;box-shadow:inset 0 1px 0 #fff8dc80,0 3px 0 #8e773a,0 6px 14px #001b184d}
.toolbar button.primary:hover,#dialog-actions button.primary:hover{background:linear-gradient(180deg,#f9e9b6,#e5c779)}
.new-controls{gap:10px;flex:none}.new-controls #new{min-width:145px}.tools{gap:8px}.tools button{min-width:73px}
.tools button .control-label{font-size:12px;margin:0;vertical-align:baseline}.tools button .control-icon{color:#e3d6a7}
#fullscreen{min-width:48px;padding:10px}#fullscreen .control-label{display:none}
.toolbar button:disabled{opacity:.38;box-shadow:inset 0 1px 0 #ffffff0d;filter:saturate(.5)}
.sound-toggle .sound-off,.sound-toggle.muted .sound-on{display:none}.sound-toggle.muted .sound-off{display:block}.sound-toggle.muted{color:#b7c5b3}
.heading .quiet{display:flex;align-items:center;gap:8px;border:1px solid #b5b98350;border-radius:10px;padding:10px 14px;background:#29493450;color:#e2d9b6;font-size:12px}
.heading .quiet .control-label{border:0;border-radius:0;width:auto;height:auto;margin:0;font-size:12px;display:block}
.heading .quiet .control-icon{width:18px;height:18px}
#zoom{padding:8px 12px;border:1px solid #c9bd7745;border-radius:8px;background:#10372680;min-height:36px}
.stats{gap:26px}.stats strong{color:#f5e9c6}
dialog{max-width:490px;padding:32px;border-radius:20px;border-color:#b3ac7270;background:radial-gradient(ellipse at 50% 0,#34573c,#153e2d 70%);box-shadow:inset 0 1px 0 #eff1bb1f,0 30px 100px #0008;max-height:calc(100dvh - 32px);overflow:auto}
dialog .eyebrow{padding-right:35px}dialog h2{font-size:34px;letter-spacing:-.5px;margin-top:12px}dialog p:not(.eyebrow){font-size:13px;line-height:1.7;color:#c1d1be}
.dialog-close{position:absolute;top:16px;right:16px;min-height:36px;width:36px;padding:8px;background:#092e2180;border:1px solid #bbcca32e;border-radius:50%}
.dialog-close .control-label{display:none}.dialog-close .control-icon{width:18px;height:18px}
#dialog-actions{gap:12px;justify-content:flex-end;border-top:1px solid #d2d6ae1c;padding-top:22px;margin-top:24px}
#dialog-actions button{min-width:122px}
.choice-dialog{max-width:740px;width:calc(100% - 32px)}
#dialog-options:empty{display:none}
#dialog-options{display:flex;gap:14px;margin-top:24px}
.choice-button{position:relative;display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;text-align:center;padding:0 0 17px;overflow:hidden;border:1px solid #baca9f40;border-radius:13px;background:linear-gradient(180deg,#345840,#234732);box-shadow:0 4px 0 #082d21;transition:transform .15s,border-color .15s,background .15s}
.choice-button:hover{transform:translateY(-3px);border-color:#e7cc81;background:linear-gradient(180deg,#46694b,#30543c)}
.choice-button[aria-pressed=true]{border-color:#e7cb7e;box-shadow:0 0 0 1px #e7cb7e55,0 4px 0 #082d21}
.choice-preview{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;height:125px;background:radial-gradient(ellipse at center,#58754d45,#0c35203b);border-bottom:1px solid #c3d3a119;margin-bottom:16px;padding:10px}
.choice-preview>svg{width:100%;height:100%;display:block}
.choice-button>strong{font:23px Georgia,serif;color:#f4ebcc;margin-bottom:5px}
.choice-detail{font-size:10px;line-height:1.6;color:#bed0b7;padding:0 10px;min-height:32px}
.choice-badge{margin-top:12px;font-size:10px;font-weight:650;letter-spacing:.2px;padding:5px 11px;border-radius:20px;background:#102f22;color:#d3d7b6;border:1px solid #aac29330}
.choice-button[aria-pressed=true] .choice-badge{background:#e0c780;color:#283d27;border-color:#e0c780}
.sample-tile{display:block;width:43px;height:61px;flex:none;padding:3px;background:linear-gradient(110deg,#fffef5,#f1ebd9);border:1px solid #d6cbb0;border-radius:4px;box-shadow:1px 3px 0 #b4aa89,3px 6px 10px #001b1866;transform:rotate(-10deg) translateY(3px)}
.sample-tile:nth-child(2){transform:translateY(-6px);z-index:1}.sample-tile:nth-child(3){transform:rotate(10deg) translateY(3px)}
.sample-tile svg,.sample-tile img{display:block;width:100%;height:100%;object-fit:contain}
@media(max-width:1100px){.toolbar{flex-direction:column;align-items:stretch;gap:15px}.new-controls #new{flex:1}.tools{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}.tools button{min-width:0}.menu-button{min-width:165px}.stats{gap:18px}}
@media(max-width:760px){.table-bar{padding:16px 14px;gap:20px}.settings{gap:10px}.menu-button{min-width:150px;min-height:58px;padding:9px 11px;gap:9px}.menu-copy strong{font-size:13px}.stats{gap:14px}.toolbar{padding:16px 14px}.tools button{flex-direction:column;gap:6px;padding:10px 4px}.tools button .control-label{font-size:11px;display:block}.tools button .control-icon{width:20px;height:20px}#fullscreen .control-label{display:block}.heading .quiet{width:40px;min-width:40px;min-height:40px;padding:10px}.heading .quiet .control-label{display:none}.choice-dialog{padding:26px 20px}.choice-preview{height:105px}.choice-button>strong{font-size:21px}dialog h2{font-size:30px}}
@media(max-width:600px){.settings{width:100%;display:grid;grid-template-columns:1fr 1fr}.menu-button{min-width:0;width:100%}.stats{width:100%;justify-content:space-between}.stats>div{flex-direction:row;gap:8px}.stats strong{font-size:20px}.stats span{font-size:8px}.tools{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.tools button{flex-direction:row;min-height:46px;gap:7px;padding:9px 7px}#fullscreen{padding:9px 7px}.tools button .control-label{font-size:11px}.table-bar{gap:16px}.choice-dialog{max-width:420px}#dialog-options{flex-direction:column;gap:12px}.choice-button{display:grid;grid-template-columns:100px 1fr;grid-template-rows:auto auto auto;align-items:center;text-align:left;column-gap:14px;padding:12px}.choice-preview{grid-row:1/4;height:88px;padding:5px;margin:0;border:0;border-radius:8px}.choice-button>strong{font-size:21px;margin:0;align-self:end}.choice-detail{padding:2px 0;min-height:0;font-size:10px}.choice-badge{justify-self:start;margin:4px 0 0;font-size:9px;padding:3px 8px}.sample-tile{width:25px;height:37px;padding:1px}.choice-preview{gap:3px}.choice-dialog h2{font-size:29px}#dialog-actions{flex-wrap:wrap}#dialog-actions button{flex:1;min-width:100px}}
@media(max-width:360px){.menu-button{gap:7px;padding:9px}.menu-button>.control-icon:first-child{width:18px;height:18px}.menu-copy strong{font-size:12px}.menu-copy small{font-size:7px}.menu-button .chevron{width:12px}.tools button{gap:5px}.tools button .control-label{font-size:10px}.choice-dialog{padding:24px 16px}.choice-button{grid-template-columns:80px 1fr;column-gap:10px}.choice-preview{height:80px}.sample-tile{width:21px;height:32px}}
@media(prefers-reduced-motion:reduce){.choice-button:hover,.toolbar button:not(:disabled):hover{transform:none}}
.menu-copy{min-width:0;flex:1}.menu-copy strong{overflow:hidden;text-overflow:ellipsis}

/* Main-site navigation and the public rules/FAQ below the approved game UI. */
.mahjong-live .site-header{height:auto;min-height:76px;flex-wrap:wrap;padding-top:14px;padding-bottom:14px;gap:22px}
.mahjong-live .site-nav{display:flex;align-items:center;gap:22px;margin-left:auto;font-size:13px}
.mahjong-live .site-nav a{color:#cbd5bd;text-decoration:none}.mahjong-live .site-nav a:hover{color:var(--gold)}
.mahjong-live .site-header .community-tools{width:auto;gap:14px;font-size:12px;justify-content:flex-end}
.mahjong-live .community-tools [data-account-link]{max-width:140px;white-space:nowrap}
.mahjong-info{border-top:1px solid var(--line);padding:34px 0 18px;margin-top:32px}
.mahjong-info>h2,.mahjong-faq>h2{font:28px Georgia,serif;letter-spacing:-.3px;margin:0 0 16px}
.mahjong-info>p{color:var(--muted);font-size:14px;max-width:780px;margin:0 0 24px}
.mahjong-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.mahjong-panel{padding:24px;border:1px solid var(--line);border-radius:14px;background:#20453255}
.mahjong-panel h2,.mahjong-panel h3{color:#e3d19a;font-size:16px;font-weight:600;margin:0 0 10px}
.mahjong-panel h3{font-size:14px;margin-top:20px}
.mahjong-panel ul{padding-left:20px;margin:0}.mahjong-panel li{padding:4px 0}
.mahjong-panel p,.mahjong-panel li{font-size:13px;line-height:1.75;color:#b6c9b9}.mahjong-panel p{margin:0}
.mahjong-faq{padding:24px 0 36px}.mahjong-faq details{border-bottom:1px solid var(--line);padding:15px 4px}
.mahjong-faq summary{cursor:pointer;font-size:14px;font-weight:600;color:#e2e2c9}.mahjong-faq summary:focus-visible{outline:2px solid var(--gold);outline-offset:4px}
.mahjong-faq details p{font-size:13px;line-height:1.75;color:#b6c9b9;max-width:900px;margin:12px 0 0}
.mahjong-live footer{flex-wrap:wrap}.mahjong-live footer nav{width:100%;font-size:11px}
#game:fullscreen .mahjong-info,#game:fullscreen .mahjong-faq{display:none}
@media(max-width:1000px){.mahjong-live .site-header{gap:12px}.mahjong-live .site-nav{gap:14px}}
@media(max-width:700px){.mahjong-live .site-header{padding:12px 16px;gap:12px}.mahjong-live .site-nav{order:3;width:100%;justify-content:space-between;margin:0;padding-top:10px;border-top:1px solid var(--line);font-size:12px}.mahjong-live .site-header .community-tools{margin-left:auto;gap:8px}.mahjong-live .community-board-link{display:none}.mahjong-live .community-tools [data-account-link]{padding:6px 10px;max-width:115px}.mahjong-columns{grid-template-columns:1fr}.mahjong-panel{padding:20px}.mahjong-info>h2,.mahjong-faq>h2{font-size:25px}}
@media(max-width:600px){.menu-button>.control-icon:first-child{width:18px;height:18px}.menu-button .chevron{width:12px;height:12px}.menu-button{gap:8px}}

/* Keep the table and every game control in the first screen. */
.mahjong-live .site-header{min-height:56px;padding-top:8px;padding-bottom:8px;gap:18px}
.mahjong-live .brand{gap:9px}.mahjong-live .brand-logo{display:block;flex:none;width:auto;height:36px}
.mahjong-live main{padding-top:12px}
.mahjong-live .heading{margin-bottom:12px;min-height:40px}
.mahjong-live .heading h1{font-size:30px;line-height:1.15;margin:0}
.mahjong-live .table-bar{padding:10px 16px;gap:12px}
.mahjong-live .menu-button{min-height:52px;padding:7px 12px}
.mahjong-live .toolbar{padding:10px 16px;gap:12px;border-top:0;border-bottom:1px solid var(--line)}
.mahjong-live .toolbar button{min-height:44px;padding-top:8px;padding-bottom:8px}
.mahjong-live .board-message{padding:6px 16px;min-height:42px;flex-wrap:nowrap;justify-content:flex-start;gap:8px}
.mahjong-live .board-message p{flex:1;min-width:0;font-size:11px;line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.mahjong-live #zoom{flex:none;min-height:32px;padding:5px 9px;font-size:10px}
.mahjong-live .board-scroll{padding:12px 16px 10px;scrollbar-gutter:stable}
.mahjong-live .under-table{padding-top:9px;padding-bottom:9px}
@media(max-width:1100px){.mahjong-live .toolbar{gap:10px}.mahjong-live .tools{gap:7px}}
@media(max-width:700px){
  .mahjong-live .site-header{padding:8px 12px;gap:8px}.mahjong-live .brand-logo{height:32px}.mahjong-live .brand{gap:7px}
  .mahjong-live .site-nav{padding-top:6px;font-size:11px}.mahjong-live .brand>span{font-size:15px}
  .mahjong-live main{padding-top:10px}.mahjong-live .heading{margin-bottom:10px}.mahjong-live .heading h1{font-size:26px}
  .mahjong-live .table-bar{padding:9px 12px;gap:10px}.mahjong-live .menu-button{padding:7px 9px;min-height:48px}
  .mahjong-live .toolbar{padding:10px 12px}.mahjong-live .board-message{padding:5px 12px}.mahjong-live .board-scroll{padding:10px 10px 8px}
  .mahjong-live .stats strong{font-size:18px}.mahjong-live .stats span{font-size:8px}
}
@media(min-width:701px) and (max-height:600px){
  .mahjong-live .site-header{min-height:44px;padding-top:4px;padding-bottom:4px}.mahjong-live .brand-logo{height:30px}
  .mahjong-live main{padding-top:6px}.mahjong-live .heading{min-height:34px;margin-bottom:6px}.mahjong-live .heading h1{font-size:25px}
  .mahjong-live .table-bar{padding:6px 12px}.mahjong-live .menu-button{min-height:44px;padding:5px 10px}
  .mahjong-live .toolbar{flex-direction:row;align-items:center;padding:7px 12px;gap:10px}.mahjong-live .new-controls #new{min-width:110px}
  .mahjong-live .tools{display:flex;flex:1}.mahjong-live .tools button{flex:1;min-width:0;flex-direction:row;gap:5px;padding:7px}
  .mahjong-live .toolbar .control-label{font-size:10px}.mahjong-live #fullscreen .control-label{display:none}
  .mahjong-live .board-message{min-height:36px;padding-top:3px;padding-bottom:3px}
}

/* A complete board deserves a moment of celebration. */
dialog.win-dialog{max-width:560px;padding:0;overflow:visible;background:transparent;border:0;box-shadow:none;text-align:center}
.win-dialog::backdrop{background:#031a15d4;backdrop-filter:blur(7px)}
.win-dialog .dialog-content{position:relative;z-index:1;padding:32px 34px 30px;max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #dfc77f90;border-radius:24px;background:radial-gradient(ellipse at 50% 0,#496242,#173f30 60%,#103629);box-shadow:inset 0 1px 0 #fff7d447,0 0 65px #dfc77f18,0 30px 100px #0009;animation:mahjong-win-enter .55s cubic-bezier(.2,.8,.2,1) both}
.win-dialog .eyebrow{padding:0;margin:14px 0 8px;font-size:9px;letter-spacing:2.5px}
.win-dialog h2{font:normal clamp(30px,6vw,46px)/1.15 Georgia,serif;color:#ffe5a0;letter-spacing:-1.2px;margin:0 0 10px;text-shadow:0 2px 18px #dfc77f24}
.win-dialog #dialog-text{max-width:340px;margin:0 auto;color:#d3dfcc;font-size:14px;line-height:1.65}
.win-emblem{position:relative;isolation:isolate;width:180px;height:108px;margin:0 auto;display:grid;place-items:center}
.win-emblem::before{content:"";position:absolute;inset:-12px;border-radius:50%;background:radial-gradient(ellipse,#eed58b33,transparent 68%);animation:mahjong-win-glow 1.6s ease-out 2}
.win-trophy{position:relative;z-index:1;width:104px;height:104px;filter:drop-shadow(0 4px 12px #0003);animation:mahjong-trophy-pop .8s cubic-bezier(.2,.9,.3,1.2) both}
.win-tile{position:absolute;width:46px;height:64px;padding:3px;border-radius:6px;border:1px solid #e7dcae;background:#fff6db;box-shadow:0 3px 0 #ad9863,0 7px 14px #001c1b66;left:7px;top:29px;transform:rotate(-17deg)}
.win-tile:nth-child(2){left:auto;right:7px;transform:rotate(17deg)}
.win-tile svg,.win-tile img{width:100%;height:100%;display:block;object-fit:contain}
.win-dialog #dialog-options{margin-top:24px;display:block}
.win-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;border:1px solid #d7d6a632;border-radius:14px;background:#092e2380;padding:17px 0}
.win-stats>div{min-width:0;padding:0 8px}
.win-stats>div+div{border-left:1px solid #d7d6a625}
.win-stats dt{font-size:9px;letter-spacing:1px;text-transform:uppercase;color:#b9cab4;margin-bottom:5px}
.win-stats dd{margin:0;font-size:22px;font-weight:650;color:#fff0bf;font-variant-numeric:tabular-nums}
.win-stats>div:last-child dd{font-size:17px;line-height:33px}
.win-dialog #dialog-actions{margin-top:22px;padding-top:0;border:0;display:grid;grid-template-columns:1.1fr 1fr;gap:12px}
.win-dialog #dialog-actions button{min-width:0;min-height:50px}
.win-dialog #dialog-actions .primary{box-shadow:inset 0 1px 0 #fff5c880,0 3px 0 #8d7741,0 6px 22px #e4c77624}
.win-confetti{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.win-confetti i{position:absolute;display:block;pointer-events:none;border-radius:2px}
.win-confetti .confetti-star{clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%);border-radius:0}
@keyframes mahjong-win-enter{from{opacity:0;transform:translateY(18px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes mahjong-trophy-pop{0%{opacity:0;transform:scale(.5) rotate(-12deg)}65%{opacity:1;transform:scale(1.08) rotate(3deg)}100%{transform:scale(1) rotate(0)}}
@keyframes mahjong-win-glow{0%,100%{opacity:.5;transform:scale(.9)}50%{opacity:1;transform:scale(1.15)}}
@media(max-width:480px){.win-dialog .dialog-content{padding:25px 18px 22px;border-radius:20px}.win-dialog #dialog-text{font-size:12px}.win-stats dd{font-size:20px}.win-stats>div:last-child dd{font-size:14px;line-height:30px}.win-stats dt{font-size:8px;letter-spacing:.5px}.win-dialog #dialog-actions{gap:8px}.win-dialog #dialog-actions button{font-size:12px;padding:10px 8px}}
@media(max-height:600px){.win-dialog .dialog-content{padding:16px 20px}.win-emblem{height:64px;width:140px}.win-trophy{width:64px;height:64px}.win-tile{width:32px;height:45px;top:12px;left:10px}.win-tile:nth-child(2){right:10px}.win-dialog .eyebrow{margin-top:8px;font-size:8px}.win-dialog h2{font-size:30px;margin-bottom:6px}.win-dialog #dialog-text{font-size:12px}.win-dialog #dialog-options{margin-top:14px}.win-stats{padding:10px 0}.win-dialog #dialog-actions{margin-top:14px}.win-dialog #dialog-actions button{min-height:44px}.win-dialog .dialog-close{top:10px;right:10px}}
@media(prefers-reduced-motion:reduce){.win-dialog .dialog-content,.win-trophy,.win-emblem::before{animation:none}.win-confetti{display:none}}

/* The clock is the same pause shortcut used by the card games. */
.stats .hud-pause{cursor:pointer;border-radius:8px;padding:2px 8px;margin:-2px -2px}
.stats .hud-pause:hover,.stats .hud-pause:focus-visible{background:#ffffff1f}
.stats .hud-pause:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
.stats .hud-pause>span::after{content:'';display:inline-block;width:8px;height:10px;margin-left:4px;vertical-align:-1px;border-radius:1px;background:linear-gradient(to right,#fff 0 35%,transparent 35% 65%,#fff 65% 100%)}
