#linkStatus,.bulletin {position:absolute;z-index:8;left:50%;top:72px;transform:translateX(-50%);max-width:85%;border:1px solid #dcb071;border-radius:18px;padding:6px 15px;color:#fff2ce;background:#482820f0;text-align:center;font-size:14px}
.bulletin {top:auto;bottom:19%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:64%}
#bench .empty {opacity:.52;filter:grayscale(.8)}
#roomname,#bench b,.nameplate {overflow:hidden;text-overflow:ellipsis}
button:disabled{cursor:default}
#waitActions {margin:4px auto} #waitActions:empty{display:none}
.filter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.45rem}
.filter-grid input,.filter-grid select{min-width:0;width:100%}
.hud .playerchip{padding-inline-end:21px}
.playerchip span{min-width:0;row-gap:3px}
@media(orientation:portrait){.hud .playerchip{padding-inline-end:14px}}
#playerName,.nameplate,#selfLabel,#gameroom{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#playerName{max-width:10em}
.nameplate{max-width:min(18vw,180px)}
#selfLabel{max-width:45%}
.roomtag{max-width:42vw}
#linkStatus .smallbtn{margin-left:.3rem}
@media(orientation:portrait){#playerName{max-width:16vw}.nameplate{max-width:24vw}.roomtag{max-width:72vw}}
dialog .formerror:empty {display:none}
dialog label {display:block}
[data-action="copyRoom"]{font-size:14px;padding:3px 10px}
@media(orientation:portrait){.bulletin{bottom:26%}}
@media(orientation:landscape) and (max-height:560px){#linkStatus{top:42px}.bulletin{bottom:26%}}

.portrait:is(.cat4,.cat5,.cat6,.cat7,.cat8,.cat9) {background-image:url('design/cats-extra.webp');background-size:300% 200%}
.cat4 {background-position:0 0}.cat5 {background-position:50% 0}.cat6 {background-position:100% 0}
.cat7 {background-position:0 100%}.cat8 {background-position:50% 100%}.cat9 {background-position:100% 100%}

@property --time-left {syntax:'<angle>';inherits:true;initial-value:1turn}
.rackhead .clock {--ring:#f9d17e;position:relative;display:inline-flex;align-items:baseline;justify-content:center;gap:1px;min-width:44px;padding:5px 8px;color:#fff2ce;border-radius:99px;background:#3b2b23;font-size:14px;line-height:1.1;transition:--time-left .2s linear}
.rackhead .clock[hidden] {display:none}
.clock::before {content:'';position:absolute;inset:0;padding:2px;border-radius:inherit;background:conic-gradient(var(--ring) var(--time-left),#826d50 0);mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude}
.clock[data-phase="claims"] {--ring:#8de0b5}
.clock.urgent {--ring:#ff926e}
.clock small {font-size:.7em}
.clock.urgent #clockValue {animation:clock-beat 1s ease-out infinite;color:#ffba97}
@keyframes clock-beat {0%,70%,100% {transform:scale(1)} 20% {transform:scale(1.22)}}

@media(prefers-reduced-motion:reduce) {.rackhead .clock{transition:none}.clock.urgent #clockValue{animation:none}}

:root {--hand-piece-size:clamp(46px,5.4vw,82px)}
@media(orientation:portrait) {
  :root {--hand-piece-size:clamp(46px,13vw,69px)}
}
#hand button.piece {--tile:var(--hand-piece-size)}
@media(orientation:landscape) and (max-height:560px) {
  :root {--hand-piece-size:clamp(34px,10.5vh,48px)}
  .game .playfield {inset:3% 5% clamp(92px,26vh,132px)}
  .game .middle {top:72%}
  .game .rack {left:50%;right:auto;bottom:max(5px,env(safe-area-inset-bottom));transform:translateX(-50%);
    width:min(94vw,780px);box-sizing:border-box;padding:4px 9px 6px;
    display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center}
  .game .rackhead {grid-column:1 / -1;font-size:12px;min-height:22px}
  .game #hand {grid-column:2;grid-row:2;max-width:none;flex-wrap:nowrap;gap:5px;padding:6px 0 4px}
  .game #hand .piece {--tile:var(--hand-piece-size)}
  .game #moves {grid-column:3;grid-row:2;justify-self:center;max-width:100%;min-height:0;gap:4px}
  .game #moves .quietplay {font-size:11px;min-height:0;line-height:1.4}
  .game .seat.before,.game .seat.after {top:41%}
}

.match-art {display:block; flex:0 1 auto; inline-size:clamp(158px,22vw,326px); scale:1.1; transform-origin:center; padding:0; border:0; background:transparent; filter:drop-shadow(0 4px 3px #41211088); cursor:pointer}
.match-art img {width:100%;height:auto;display:block}
.match-art:focus-visible {outline:3px solid #ffefaf;outline-offset:3px;border-radius:22px}

.round-call {position:absolute;z-index:8;left:50%;top:46%;transform:translate(-50%,-50%);display:grid;justify-items:center;pointer-events:none;white-space:nowrap;color:#ffe9a3;text-shadow:0 3px 0 #7d321e,0 5px 12px #412216;font-family:var(--round)}
.round-call[hidden]{display:none}
.round-call b {font-size:clamp(22px,5vmin,48px);line-height:1.2;letter-spacing:.08em}
.round-call small,[data-seat-result]::after {background:#8f3327;color:#fff4d0;border:2px solid #edc375;border-radius:1em;padding:.1em .65em}
.round-call small {font-size:clamp(14px,2.7vmin,24px);font-weight:bold}
.seat[data-seat-result]::after {font-family:var(--round);font-weight:400}
[data-seat-result]::after {content:attr(data-seat-result);position:absolute;z-index:3;top:0;left:50%;transform:translate(-50%,-54%);white-space:nowrap;font-style:normal;pointer-events:none;animation:fault-stamp .55s ease-out both;line-height:1.3}
#selfLabel .self-result {display:none}
#selfLabel[data-seat-result] {
  display:inline-flex;align-items:center;gap:8px;max-width:100%;min-width:0;
}
#selfLabel[data-seat-result] #selfName {overflow:hidden;text-overflow:ellipsis}
#selfLabel[data-seat-result]::after {content:none}
#selfLabel[data-seat-result] .self-result {
  display:inline-block;flex:none;padding:2px 7px;border-radius:5px;
  border:1px solid #daaa75;background:#873c30;color:#fff4d8;
  font:400 12px/1.2 var(--round);animation:self-result-in .25s ease-out both;
}
@keyframes self-result-in {from{opacity:0;scale:.9}to{opacity:1;scale:1}}
@media(prefers-reduced-motion:reduce){#selfLabel[data-seat-result] .self-result {animation:none}}
#stage.ending #selfLabel[data-seat-result] ~ :is(#turn,#clock) {display:none}
#stage.ending :is(#clock,#moves,#turn,#riverBtn,#listenHint) {visibility:hidden}
@keyframes round-stamp {from{opacity:0;transform:scale(1.55) rotate(-8deg)}65%{transform:scale(.95) rotate(2deg)}to{opacity:1;transform:scale(1)}}
@keyframes fault-stamp {from{opacity:0;translate:0 -8px;rotate:-12deg}to{opacity:1;translate:0 0;rotate:-4deg}}

@media(prefers-reduced-motion:reduce){.round-call b,[data-seat-result]::after{animation:none}}
@media(max-height:480px) and (orientation:landscape){.match-art{width:clamp(143px,22vw,195px)}}

.modhead {flex-shrink:0}
.modbody {min-height:0}
@media (orientation:landscape) {
  .roomtag {right:calc(max(3.2vw,env(safe-area-inset-right)) + 110px);max-width:min(30vw,22em)}
}
.roundicon img {display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.gift img {width:1.35em;height:1.35em;vertical-align:middle;margin-right:3px}
.round-call .call-cat {display:block;width:clamp(94px,23vmin,210px);aspect-ratio:1;background-size:300% 100%;background-position:100% center;background-repeat:no-repeat}
.round-call[data-outcome=selfdraw] .call-cat {background-image:url('design/call-selfdraw.webp')}
.round-call[data-outcome=win] .call-cat {background-image:url('design/call-win.webp')}
.round-call[data-outcome=draw] .call-cat {background-image:url('design/call-draw.webp')}
.round-call small {order:2}
.round-call b {order:1}
@keyframes cat-call-poses {
  0% {background-position:0% center}
  32% {background-position:50% center}
  70%,100% {background-position:100% center}
}
button:enabled {touch-action:manipulation}
button:enabled:focus-visible {outline:3px solid #fff4ad;outline-offset:2px;box-shadow:0 0 0 5px #74472c}
@media (hover:hover) and (pointer:fine) {
  button:enabled:hover {filter:brightness(1.09)}
}
button:enabled:active {filter:brightness(.86)}
@media (prefers-reduced-motion:no-preference) {
  .round-call .call-cat {animation:cat-call-poses .86s steps(1,end) both}
  button:enabled {transition:translate 120ms ease-out,filter 110ms ease-out}
  @media (hover:hover) and (pointer:fine) {
    button:enabled:hover {translate:0 -2px}
  }
  button:enabled:active {translate:0 2px;transition-duration:55ms}
}

@media (prefers-reduced-motion:reduce) {button:enabled:active {translate:none}}
@media (max-height:560px) and (orientation:landscape) {
  #moves button {min-width:0;min-height:32px;border-width:5px 10px;padding:1px 2px}
  .modbody .auth-heading .heroCat {width:42px}
}
