/* Shared player controls and teahouse dialogs */
#linkStatus[data-mode=readonly] {
  display:flex;align-items:center;justify-content:space-between;gap:14px;width:max-content;
  max-width:calc(100vw - 28px);padding:9px 12px;border:1px solid #b6a786;
  border-radius:11px;background:#f7f0df;color:#304c41;text-align:left;box-shadow:none;
}
#linkStatus[data-mode=readonly] strong,#linkStatus[data-mode=readonly] small {display:block;font-weight:400;line-height:1.45}
#linkStatus[data-mode=readonly] small {color:#646452;font-size:12px}
#linkStatus .take-control {border:0;border-radius:7px;background:#315b4a;color:#fff4db;min-height:42px;padding:6px 12px;white-space:nowrap;font:400 15px/1.2 var(--round)}
@media (max-width:360px) and (orientation:portrait) {
  #linkStatus[data-mode=readonly] {display:grid;gap:6px}
}
/* Optical alignment for Huninn's CJK glyphs and its descending numeric comma. */
.cash .currency-name {position:relative;top:.045em}
.cash strong {position:relative;top:-.08em}
#waitActions {gap:6px;margin:7px auto}
.room-share {display:inline-flex;align-items:center;max-width:100%;background:#ebe2c974;border:1px solid #c4b18a;border-radius:9px}
.room-share button {
  display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:42px;
  padding:4px clamp(8px,2vw,14px);background:none;color:#51452f;font:400 14px/1.3 var(--round);
  border:0;border-radius:7px;white-space:nowrap;
}
.room-share button+button {position:relative}
.room-share button+button::before {content:'';position:absolute;left:0;top:24%;bottom:24%;width:1px;background:#bdad8a}
.room-share .item {width:24px;height:24px;flex:none}
.waitbox .controls>[data-action=leaveWaiting] {border:0;border-radius:6px;background:none;box-shadow:none;color:#705239}
.waitbox #ready {border:1px solid #284d3f;border-radius:8px;background:#315b4a;color:#fff1d8;padding:7px 16px}
#box:has(.matchmaking) .modhead {
  min-height:0;aspect-ratio:3 / 1;padding:12px 16px 12px 5%;
  background:#f5e9d3 url('design/matching-teahouse.webp') center / cover no-repeat;
  border-bottom:1px solid #c6b58d;
}
#box:has(.matchmaking) #modalTitle {max-width:42%;font-weight:400;color:#493d2b}
.matchmaking {display:grid;gap:15px}
.match-status {display:flex;align-items:center;justify-content:space-between;gap:12px}
.match-status h3 {display:flex;align-items:center;gap:9px;font:400 clamp(19px,4vw,24px)/1.3 var(--round);margin:0;color:#234b40}
#body .match-status p {margin:4px 0 0;color:#506258;font-size:14px;line-height:1.5}
.match-pulse {display:inline-flex;align-items:center;gap:4px;flex:none}
.match-pulse i {width:6px;height:6px;background:#68896e;border-radius:50%}
@media(prefers-reduced-motion:no-preference) {
  .match-pulse i {animation:match-wait 1.65s ease-in-out infinite}
  .match-pulse i:nth-child(2) {animation-delay:.16s}
  .match-pulse i:nth-child(3) {animation-delay:.32s}
}
@keyframes match-wait {0%,65%,100%{opacity:.42}32%{opacity:1}}
.match-clock {flex:none;display:flex;align-items:baseline;gap:3px;background:#e3ecdf;border-radius:8px;padding:4px 10px;color:#295644;font-size:13px}
.match-clock strong {font:400 26px/1.2 var(--round);min-width:2ch;text-align:center;font-variant-numeric:tabular-nums}
.match-actions {display:flex;justify-content:flex-end;align-items:center;gap:10px;border-top:1px solid #d5cbb4;padding-top:9px}
.match-actions .match-cancel {color:#4b594d;background:transparent;padding:6px 10px;font:inherit;min-height:44px}
.match-actions .primary {min-width:110px}
@media(orientation:landscape) and (max-height:560px){
  #box:has(.matchmaking) .modhead {aspect-ratio:auto;height:clamp(66px,24dvh,118px);background-position:center 58%}
  .matchmaking {gap:8px}
}
.member-sheet {display:grid;gap:16px}
.member-identity,.profile-draft {display:flex;align-items:center;gap:12px}
.member-identity {flex-wrap:wrap;padding-bottom:14px;border-bottom:1px solid #d5cbb4}
.member-portrait {width:74px;height:74px;display:grid;place-items:center;flex:none;border-radius:50%;background:#eee4cb url('design/teahouse-window-light.webp') center/cover}
.member-portrait .portrait {width:90%;height:90%}
.member-title {flex:1 1 130px;min-width:0}
.member-title h3 {font:400 23px/1.25 var(--round);margin:0 0 5px;overflow-wrap:anywhere}
.member-id,.account-id small {font-size:12px;color:var(--subtle-ink)}
.member-id strong {font-weight:400;font-variant-numeric:tabular-nums}
.edit-profile {background:#235647;color:#fff6df;border:0;border-radius:7px;padding:7px 12px;min-height:42px}
.member-shortcuts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.member-shortcuts button {min-height:60px;display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:8px 12px;background:#efe8d6;border:1px solid #d8c9ac;border-radius:9px;text-align:left;font:inherit;color:var(--ink)}
.member-shortcuts .item,.member-shortcuts img {width:32px;height:32px;object-fit:contain;flex:none}
.member-shortcuts strong {display:block;font-size:13px;color:#526854;font-weight:400;font-variant-numeric:tabular-nums}
.member-account {display:flex;align-items:center;flex-wrap:wrap;gap:2px 12px;border-top:1px solid #d5cbb4;padding-top:7px}
.account-id {flex:1 1 145px;min-width:0;font-size:14px;overflow-wrap:anywhere}
.account-id small {display:block;margin-bottom:2px}
.member-link {border:0;padding:4px 2px;min-height:44px;background:transparent;color:#36594d;font:inherit}
.member-account [data-action=logout] {color:#894336}
.member-saved {font-size:14px;color:#24604d}
#body:has(#nicknameForm) {display:flex;flex-direction:column;overflow:hidden}
#nicknameForm {display:flex;flex-direction:column;min-height:0}
.profile-fields {min-height:0;overflow-y:auto;padding:3px 4px;overscroll-behavior:contain}
.profile-draft {margin-bottom:14px}
#body .profile-draft label {flex:1;min-width:0;margin:0}
.avatar-gallery {margin:0;padding:0;border:0}
.avatar-gallery legend {padding:0;margin:0 0 8px;font-size:15px}
.avatar-gallery>div {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
#body .avatar-gallery label {display:block;position:relative;min-width:0;margin:0;cursor:pointer}
.avatar-gallery input {position:absolute;opacity:0;inset:0;pointer-events:none}
.avatar-option {display:grid;justify-items:center;align-content:center;min-height:57px;gap:2px;padding:4px 0;font-size:12px;border-radius:8px;border:1px solid transparent}
.avatar-option .portrait {width:clamp(34px,9vw,48px);aspect-ratio:1}
.avatar-gallery input:checked+.avatar-option {background:#deeadb;border-color:#659681;color:#174d3a}
.avatar-gallery input:focus-visible+.avatar-option {outline:2px solid #3b7461;outline-offset:-2px}
@media (hover:hover) {.avatar-gallery label:hover .avatar-option {background:#ebe9d8}}
.profile-footer {flex:none;display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid #d5cbb4}
#body .profile-footer .formerror:empty {display:none}
#body .profile-footer .formerror {flex-basis:100%;margin:0}
#body .profile-footer .primary {width:auto}
@container (max-width:330px) {
  .member-portrait {width:54px;height:54px}
  .member-title {flex-basis:105px}
  .member-identity,.profile-draft {gap:8px}
  .member-shortcuts button {gap:6px;padding:7px}
}
@media (orientation:landscape) and (max-height:560px) {
  .profile-draft .member-portrait {width:42px;height:42px}
  .profile-draft {margin-bottom:6px}
  .avatar-option .portrait {width:32px}
  .profile-footer {margin-top:5px;padding-top:5px}
}
@keyframes lobby-logo-float {
  0%,100% {translate:0 0}
  50% {translate:0 -4px}
}
@media (prefers-reduced-motion:no-preference) {
  #stage[data-scene=lobby] .wordmark {animation:lobby-logo-float 5s ease-in-out infinite}
}
:root {
  --paper:#f7f4e9;
  --ink:#273c35;
  --subtle-ink:#506258;
  --rule:#bfc7b6;
  --jade:#245447;
}
:is(.controls,.modbody,.seg) button:is(.primary,.soft,.smallbtn),.seg button,.riverBtn,
.modbody .row button,button.gift,#linkStatus .smallbtn {
  --face:url('design/matte-paper.webp');
  box-sizing:border-box;
  border:solid transparent;
  border-width:6px 12px;
  border-image-source:var(--face);
  border-image-slice:10 18 fill;
  background:transparent;
  color:var(--ink);
  border-radius:8px;
  padding:3px 8px;
  min-height:40px;
  box-shadow:none;
  text-shadow:none;
  line-height:1.25;
  font-weight:400;
}
:is(.modbody,.controls) button.primary,.seg button.current,button.gift {
  --face:url('design/matte-jade.webp');color:#fff9e6;
}
.modbody [data-action=logout],.modbody [data-action=exitRound] {color:#813924}
.hud .gift img {display:none}
button:enabled:focus-visible {outline:3px solid #f6ce7e;outline-offset:2px;box-shadow:0 0 0 4px #3f5346}
button:disabled {cursor:default}
.controls button:disabled,.modbody button:disabled {opacity:.62}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  button:enabled:hover {translate:0 -1px}
}
@media (prefers-reduced-motion:no-preference) {
  button:enabled:active {translate:0 1px}
}

#box {
  width:min(540px,calc(100vw - 26px));max-width:100%;
  max-height:min(90dvh,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px));
  border:1px solid #a29c80;outline:none;border-radius:17px;
  background:var(--paper);color:var(--ink);box-shadow:none;
  overflow:hidden;
}
#box::backdrop {background:#18292299}
#box[open] {animation:none}
#box .modhead {
  box-sizing:border-box;min-height:clamp(80px,15vh,112px);position:relative;
  padding:14px 20px;gap:12px;align-items:center;
  background:#f5e6c8 url("design/dialog-teahouse-panorama.webp") center 48% / cover no-repeat;
  border-bottom:2px solid #bca47b;
}
#box .modhead > * {position:relative}
#box .modhead h2 {max-width:calc(60% - 24px)}
#modalTitle {color:#493524;font-size:clamp(23px,3.5vw,32px);line-height:1.2;max-width:58%;margin:0;text-wrap:balance}
#modalTitle:focus {outline:none}
.modhead .roundicon {align-self:flex-start;flex:none;box-shadow:none}
.modhead .roundicon::after {content:'';position:absolute;inset:-2px;border-radius:inherit}
#body {
  padding:16px clamp(14px,3vw,25px) 20px;scrollbar-width:thin;
  scrollbar-color:#abb7a6 var(--paper);color:var(--ink);container-type:inline-size;
}
#body .fine,#body .row small {color:var(--subtle-ink)}
.game .rack {
  --rail-width:min(100%,490px);
  isolation:isolate;border:0;background:none;box-shadow:none;
}
.game .roomtag {width:max-content;text-align:center}
.seat-pieces {
  --back-size:clamp(15px,1.65vw,24px);
  display:flex;align-items:center;justify-content:center;gap:1px;margin-top:4px;
}
.seat-pieces .concealed {display:inline-flex;gap:1px}
.seat-pieces .chess-back {
  width:var(--back-size);height:var(--back-size);
  background:url('design/paw-piece-back.webp') center / contain no-repeat;
}
.seat-pieces .chess-back:nth-child(5) {margin-left:2px}
.game .seat-pieces .piece.mini {--tile:var(--back-size);border-width:1px;outline-offset:-2px}
@media (orientation:landscape) and (max-height:560px) {
  .seat-pieces {--back-size:15px;margin-top:2px}
}
.game .rackhead {
  position:relative;width:var(--rail-width);margin:0 auto;gap:6px;color:#fff4d4;
  font-weight:400;text-shadow:0 1px 3px #18352d;
}
.rackhead #listenHint {
  position:absolute;inset-inline-start:0;bottom:calc(100% + 4px);max-width:100%;
  padding:3px 8px;border-radius:5px;background:#193c32ed;color:#ffd287;
  font-size:12px;line-height:1.35;text-align:start;text-wrap:pretty;
}
.game .rackhead :is(#selfLabel,#turn) {
  background:#193c32ed;border-radius:5px;padding:4px 8px;line-height:1.2;
}
.game .rackhead #turn {margin-left:auto;color:#f4d69c;font-weight:400}
.game #hand {position:relative;isolation:isolate;padding:14px 0 17px}
.game #hand::before {
  content:'';position:absolute;z-index:-1;bottom:1px;left:50%;transform:translateX(-50%);
  width:var(--rail-width);height:clamp(24px,4vw,38px);
  background:url('design/plum-chess-rail.webp') center / 100% 100% no-repeat;
}
.game #hand .chosen {
  box-shadow:0 0 0 2px #ffedb5,0 4px #996d3c,0 8px 10px #061b15a8;
}
.game #moves {min-height:46px;margin:5px auto 0}
.game #moves:has(button) {
  width:max-content;max-width:100%;gap:0;flex-wrap:nowrap;overflow:hidden;
  border:1px solid #b69a70;border-radius:12px;
  background:#f4e6c9 url('design/matte-paper.webp') center / 175% 240%;
  box-shadow:0 2px 2px #402b1f44;
}
#stage #moves button {
  position:relative;min-width:0;width:clamp(79px,14vw,102px);min-height:44px;
  padding:5px 8px;border:0;border-radius:0;background:transparent;
  color:#48382b;font:400 17px/1.2 var(--round);letter-spacing:.04em;
  text-shadow:none;box-shadow:none;translate:none;
}
#stage #moves button+button::before {
  content:'';position:absolute;inset:24% auto 24% 0;width:1px;background:#b19c787a;
}
#stage #moves [data-action=win] {color:#a33423}
#stage #moves button:focus-visible {outline:2px solid #755434;outline-offset:-4px}
#stage #moves button:enabled:active {background:#936a352e}
.game #latest {--center-tile:64.8px}
.game #latest .piece.mini {--tile:var(--center-tile)}
.game .middle {width:clamp(124px,34vw,202px);min-width:0}
.table-utilities {
  display:none;position:absolute;inset-inline:0;top:calc(100% + 4px);
  justify-content:space-between;align-items:center;pointer-events:none;
}
#stage[data-scene=game]:not(.ending) .table-utilities {display:flex}
#stage:has(.middle.rolling) .table-utilities {visibility:hidden}
.table-utilities .wall {margin:0;white-space:nowrap}
.table-move {
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto var(--center-tile) 15px;
  justify-items:center;gap:11px;color:#fff1cd;
}
.move-caption {
  display:flex;justify-content:center;align-items:baseline;max-width:100%;
  padding:3px 8px;background:#123f32ec;border-radius:6px;line-height:1.25;
}
.move-caption b {font-size:13px;font-weight:400;color:#ffe6a3;white-space:pre}
.move-caption span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.table-move small {grid-row:3;max-width:100%;overflow:hidden;text-overflow:ellipsis;padding:1px 7px;border-radius:6px;background:#174a3bf0;font-size:11px;white-space:nowrap}
.move-piece {grid-row:2;display:grid;place-items:center}
.roll-tray {
  display:grid;gap:7px;justify-items:center;padding:9px 5px 7px;border:1px solid #bca374;
  border-radius:12px;background:#f7ead0 url('design/matte-paper.webp') center / 180% 200%;color:#463827;
}
.roll-tray>b {font-weight:400;font-size:14px}
.roll-tray>small {font-size:11px;color:#67583e}
.roll-line {display:flex;justify-content:center;gap:clamp(3px,.6vw,9px)}
.roll-seat {display:grid;justify-items:center;gap:3px}
.roll-seat small {font-size:11px}
.roll-seat.high {color:#923323}
.pip-die {
  width:clamp(22px,3.3vw,32px);aspect-ratio:1;padding:3px;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);
  gap:1px;border:1px solid #b99c73;border-radius:5px;background:#fff9e9;box-shadow:0 2px #c4a87e;
}
.pip-die i {border-radius:50%;background:#4d463a}
.high .pip-die i {background:#a33e2b}
@media (orientation:portrait) {
  .game .roomtag {max-width:calc(94vw - 176px)}
}
@media(prefers-reduced-motion:no-preference) {
  .pip-die {animation:table-roll .48s ease-out both}
  @keyframes table-roll {0%{transform:translateY(-6px) rotate(-22deg)}55%{transform:translateY(1px) rotate(9deg)}80%{transform:translateY(-2px) rotate(-3deg)}}
}
#stage #riverBtn {
  display:inline-flex;align-items:center;justify-content:center;gap:5px;position:relative;
  margin:0;min-height:44px;padding:0 11px;border:0;background:transparent;pointer-events:auto;isolation:isolate;
  color:#fff0ca;font:400 14px/1.2 var(--round);text-shadow:0 1px 3px #113d29;
}
#stage #riverBtn::before {
  content:'';width:16px;height:16px;background:currentColor;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3' width='14' height='15' rx='2'/%3E%3Cpath d='M3 7v12a2 2 0 0 0 2 2h11M10 8h6M10 12h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
#stage #riverBtn::after {
  content:'';position:absolute;inset:6px 0;z-index:-1;border-radius:20px;background:#104938d9;
}
@media (hover:hover) {
  #stage #moves button:enabled:hover {background-color:#936a3519}
  #stage #riverBtn:hover {filter:brightness(1.12)}
}
@media (orientation:landscape) and (max-height:560px) {
  .game #hand {padding:5px 0 12px}
  .game #hand::before {width:calc(100% + 25px);bottom:0;height:18px}
  .game #latest {--center-tile:57.6px}
  .game .rackhead {width:100%}
  .rackhead #listenHint {
    top:calc(100% + 4px);bottom:auto;
    max-width:calc((100% - 5 * var(--hand-piece-size) - 20px) / 2 - 8px);
  }
  .game #moves {margin:0}
  #stage #moves button {width:clamp(46px,7.5vw,70px);padding:4px;font-size:15px;white-space:nowrap}
}
.river-list {width:100%;table-layout:fixed;border-collapse:collapse}
.river-list col:nth-child(1) {width:10%}
.river-list col:nth-child(2) {width:30%}
.river-list col:nth-child(3) {width:20%}
.river-list col:nth-child(4) {width:40%}
.river-list :is(th,td) {padding:9px 0;border-bottom:1px solid #d6dbcb;vertical-align:middle}
.river-list th {font-weight:400;text-align:left}
.river-list td:first-child {font-variant-numeric:tabular-nums}
.river-list td:nth-child(3) {text-align:center}
.river-list .piece {vertical-align:middle}
.river-list td:last-child {text-align:right;color:var(--subtle-ink);font-size:12px}
#body label {color:var(--ink);font-size:15px;font-weight:400}
#body input:not([type=range]):not([type=radio]),#body select {
  box-sizing:border-box;border:1px solid #a2ae9c;background:#fffdf6;
  color:#263d34;border-radius:7px;min-height:40px;max-width:100%;font-size:16px;padding:7px 10px;
}
#body input::placeholder {color:#68766b}
#body :is(input,select):focus-visible {outline:2px solid #3d7561;outline-offset:1px}
#body input[type=range] {accent-color:var(--jade)}
#body form {clear:both}
#body .seg {gap:7px}
#body .formerror:not(:empty) {color:#973728}

.settings-sheet {display:grid;gap:16px}
.practice-choices {border:0;padding:0;margin:0 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.table-modes {display:grid;gap:10px}
.entry-rules {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}
#body .table-modes button {
  display:flex;align-items:center;gap:14px;padding:10px 14px;text-align:left;
  border:1px solid #cbb699;border-radius:12px;background:#fcf3df;color:#493927;
}
#body .table-modes button:last-child {background:#e8eee3;border-color:#aab8a4}
#body .table-modes button:is(:hover,:focus-visible) {border-color:#82663d}
.table-modes :is(.portrait,.item) {width:48px;height:48px;flex:none}
.table-modes b,.table-modes small {display:block;font-weight:400}
.table-modes b {font-size:19px}
.table-modes small {font-size:13px;margin-top:4px;line-height:1.4}
.practice-choices legend {margin:0 0 8px;font-size:14px}
#body .practice-choices label {display:flex;align-items:center;gap:7px;margin:0;padding:8px 10px;border:1px solid #c6c5ae;border-radius:7px;cursor:pointer}
#body .practice-choices label:has(:checked) {background:#e3ecdf;border-color:#52816d}
#body .practice-choices input {width:16px;min-height:0;height:16px;margin:0;accent-color:var(--jade)}
.settings-prefs {min-width:0}
.volume-group {display:grid;min-width:0;margin:0;border:0;gap:12px;padding:14px 16px 11px;background:#eaf0e5;border-radius:10px}
.volume-group:disabled .volume-row {opacity:.62;filter:grayscale(1)}
#body .volume-group:disabled input[type=range] {cursor:not-allowed}
.volume-row {display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:8px}
#body .volume-row label {display:block;margin:0;font-size:15px}
.volume-row span {color:#34594b;font-size:14px;font-variant-numeric:tabular-nums}
#body .volume-row input[type=range] {
  grid-column:1/-1;appearance:none;cursor:pointer;width:100%;height:26px;min-height:26px;
  margin:0;padding:0;border:0;background:transparent;
}
.volume-row input::-webkit-slider-runnable-track {
  height:4px;border-radius:3px;background:linear-gradient(to right,#386956 var(--volume),#bbcbbb var(--volume));
}
.volume-row input::-webkit-slider-thumb {
  appearance:none;width:16px;height:16px;margin-top:-6px;border-radius:50%;background:#2a5848;border:2px solid #faf9ed;
  box-shadow:0 0 0 1px #597a69;
}
.volume-row input::-moz-range-track {height:4px;border-radius:3px;background:#bbcbbb}
.volume-row input::-moz-range-progress {height:4px;background:#386956}
.volume-row input::-moz-range-thumb {width:13px;height:13px;border-radius:50%;background:#2a5848;border:2px solid #faf9ed}
.preference-group,.settings-links {display:grid;padding:0 4px}
.preference-group {margin-top:8px}
.settings-sheet :is(.preference,.settings-link) {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:44px;width:100%;padding:8px 6px;color:var(--ink);background:transparent;
  border:0;text-align:start;box-shadow:none;border-radius:0;font:inherit;
}
.settings-sheet :is(.preference,.settings-link) + button {border-top:1px solid #d9dece}
.preference i {width:36px;height:21px;flex:none;background:#d2d6ca;border:1px solid #889384;border-radius:12px;padding:2px;box-sizing:border-box}
.preference i::before {content:'';display:block;width:15px;height:15px;border-radius:50%;background:#fffdf5;box-shadow:0 1px 2px #34483b40}
.preference[aria-checked=true] i {background:#386956;border-color:#386956}
.preference[aria-checked=true] i::before {transform:translateX(14px)}
.settings-links {border-top:2px solid #bfc9b6}
.settings-link::after {content:'';width:7px;height:7px;margin-right:5px;border:solid #6c8070;border-width:1.5px 1.5px 0 0;transform:rotate(45deg)}
.settings-sheet .settings-link[data-action=exitRound] {color:#813924}
@media (hover:hover) {#body .settings-sheet button:hover {background:#eaece1}}
@media (prefers-reduced-motion:no-preference) {.preference i::before {transition:transform .13s ease-out}}
@media (orientation:landscape) and (max-height:560px) {
  @container (min-width:410px) {
    .settings-sheet {grid-template-columns:1.25fr 1fr;gap:18px;align-items:start}
    .settings-links {border-top:0;border-left:1px solid #cdd5c5;padding-left:12px}
    .volume-group {gap:6px;padding:9px 12px 6px}
  }
}

/* Only the fields scroll on a short screen; the submit action stays reachable. */
#body:has(#authForm) {display:flex;flex-direction:column;overflow:hidden}
#body #codeStatus {grid-column:1/-1;margin:0;color:#255344;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
#body #codeStatus:empty {margin:0;height:0}
#body #codeStatus[data-error=true] {color:#8f362e}
.auth-heading {flex:none;margin:0 0 12px}
.auth-heading .seg {display:grid;grid-template-columns:1fr 1fr;margin:0;gap:0;border-bottom:1px solid var(--rule)}
#body .auth-heading .seg button {
  border:0;border-bottom:2px solid transparent;border-radius:0;
  background:none;color:var(--subtle-ink);padding:5px 14px;box-shadow:none;
}
#body .auth-heading .seg button.current {border-bottom-color:var(--jade);color:var(--jade)}
#authForm {display:flex;flex-direction:column;min-height:0;margin:0}
.auth-fields {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-height:0;overflow:auto;padding:2px 3px 4px;scrollbar-width:thin}
#authForm label {min-width:0;gap:5px;margin:0}
.auth-verify {display:grid;align-items:end;gap:8px;grid-template-columns:minmax(0,1fr) auto}
#authForm [data-action=requestCode] {font-size:14px;min-height:40px}
.auth-footer {flex:none;border-top:1px solid #d5d9cb;margin-top:14px;padding-top:12px;display:grid;gap:11px}
.auth-footer p {margin:0}
#authForm .auth-footer .primary {min-height:42px;font-size:17px}
#authForm [data-action=forgot] {justify-self:center;border:0;background:none;color:var(--jade);text-decoration:underline;text-underline-offset:3px;min-height:30px;padding:2px 10px}
@container (min-width:400px) {
  #authForm[data-signup=true] .auth-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
  .auth-email,.auth-verify {grid-column:1/-1}
}

/* Keep the illustrated outcome clear of both the board drawing and the seats. */
/* Give the rays their own space on both sides of the cat. */
.sunlit-portrait {
  position:relative;display:grid;place-items:center;isolation:isolate;flex:none;
}
.sunlit-portrait .sunrays {
  position:absolute;z-index:0;pointer-events:none;
  width:100%;height:100%;object-fit:fill;opacity:.94;
  mask-image:radial-gradient(ellipse closest-side,#000 50%,transparent 100%);
}
.sunlit-portrait i {position:relative;z-index:1}
.settlement-portrait {
  --portrait-size:min(13vh,24vw,108px);
  width:calc(var(--portrait-size) * 1.95);height:calc(var(--portrait-size) * 1.65);
}
.settlement-portrait .portrait {width:var(--portrait-size);height:var(--portrait-size)}
.call-portrait {
  --call-size:clamp(68px,14vmin,112px);
  width:min(100%,calc(var(--call-size) * 1.74));height:calc(var(--call-size) * 1.34);
}
@keyframes settlement-light {from{opacity:.76}to{opacity:1}}
@media (prefers-reduced-motion:no-preference) {
  #stage[data-scene=result] .settlement-portrait .sunrays,
  #roundCall:not([hidden]) .sunrays {animation:settlement-light 3.5s ease-in-out infinite alternate}
}
#stage:is(.ending,[data-scene=result]) .felt {filter:brightness(.53) saturate(.72)}
#stage:is(.ending,[data-scene=result]) .glow {background:linear-gradient(0deg,#31190740,transparent 35%)}
#stage.ending .game :is(.middle,.roomtag) {visibility:hidden}
#roundCall {
  box-sizing:border-box;top:47%;isolation:isolate;
  display:grid;justify-items:center;align-content:center;
  width:clamp(118px,36vw,196px);gap:2px;padding:9px 10px 11px;
  background:#f7f2e4;border:1px solid #b7aa89;border-radius:14px;
  box-shadow:none;color:#244437;text-shadow:none;white-space:normal;text-align:center;
}
#roundCall[hidden] {display:none}
#roundCall .call-cat {width:var(--call-size)}
#roundCall b {color:#264a3b;font-size:clamp(21px,3.5vmin,31px);letter-spacing:.04em}
#roundCall small {max-width:100%;background:none;border:0;border-radius:0;color:#44584b;font-size:clamp(12px,2vmin,16px);font-weight:400;line-height:1.25;overflow-wrap:anywhere;padding:0}
@media (max-height:560px) and (orientation:landscape) {
  .settlement-portrait {--portrait-size:46px}
  #box {max-height:calc(100dvh - 12px)}
  #box .modhead {min-height:52px;padding:6px 16px}
  #body {padding:9px 16px 10px}
  .auth-heading {margin:0 0 6px}
  .auth-fields {gap:8px}
  .auth-footer {margin-top:6px;padding-top:6px;gap:10px}
  #moves button {min-height:32px;border-width:4px 8px;padding:2px}
  #roundCall {width:auto;min-width:142px;max-width:36vw;grid-template-columns:auto minmax(0,1fr);column-gap:8px;padding:6px 12px}
  #roundCall .call-portrait {grid-column:1;grid-row:1/3;--call-size:48px;width:78px;height:62px}
  #roundCall b,#roundCall small {grid-column:2;align-self:center}
}
