:root {
  color-scheme: dark;
  --page: #091e1b;
  --deep: #081916;
  --paper: #fbf2dc;
  --cream: #f5e9c7;
  --tan: #d6b876;
  --ink: #182b25;
  --green: #aad5b5;
  --felt: #164c3b;
  --dim: #a8c0b2;
  --line: #d7dbb733;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", Palatino, Georgia, serif;
  --sans: system-ui, "PingFang SC", "Microsoft Yahei", sans-serif;
  font-family: var(--sans);
  color: var(--cream);
  background: var(--page);
  font-size: 15px;
  overflow-wrap: anywhere;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100svh;
  background: radial-gradient(ellipse at 60% 0%, #1b382a, transparent 52%), var(--page);
  -webkit-tap-highlight-color: transparent;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom);
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .47; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid #f6d175;
  outline-offset: 3px;
}
button, a, img { -webkit-user-drag: none; }
button { -webkit-appearance: none; appearance: none; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.masthead {
  width: min(calc(100% - 32px), 1150px);
  margin: 0 auto;
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.local-brand { display: flex; align-items: center; gap: .65rem; margin-right: auto; text-decoration: none; }
.local-brand span { display: grid; line-height: 1.2; }
.local-brand img { border-radius: 8px; }
.local-brand small { color: var(--dim); }
.masthead > button:not(.xgh-native-control) {
  border: 1px solid var(--line);
  background: #18382d;
  color: var(--cream);
  border-radius: 8px;
  padding: .42em .66em;
}
#surface {
  width: min(calc(100% - 32px), 1150px);
  margin-inline: auto;
  padding-bottom: 20px;
  min-width: 0;
}
.hero {
  min-height: 286px;
  display: grid;
  grid-template-columns: 1fr .72fr;
  align-items: center;
  padding: 28px 6%;
  position: relative;
  overflow: hidden;
  border-radius: 18px 18px 30px 30px;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 73% 92%, #101e17 0%, #1a4634 38%, transparent 67%),
    repeating-linear-gradient(32deg, #e6f2be08 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 9% 12%, #59724a, #284d38 32%, #122a22 86%);
  box-shadow: inset 0 0 0 1px #b5a56a65, 0 16px 42px #0006;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12px;
  border: 1px solid #dcbf7455;
  border-radius: 12px 12px 24px 24px;
  pointer-events: none;
}
.hero-copy { z-index: 1; }
.hero h1 {
  font: 700 clamp(3.5rem, 8.4vw, 6.5rem)/.84 var(--serif);
  letter-spacing: -.057em;
  color: #fff3cc;
  text-shadow: 0 3px #173725, 0 7px 22px #05160c9c;
}
[lang="zh-CN"] .hero h1 { font-size: clamp(3.15rem, 8vw, 6rem); line-height: 1.06; letter-spacing: -.07em; }
.hero p {
  margin-top: 1.15rem;
  color: #efe1b7;
  font: 600 clamp(.87rem, 2.1vw, 1.18rem)/1.4 var(--serif);
  max-width: 24em;
}
.card-fan { height: 100%; position: relative; min-width: 0; pointer-events: none; }
.card-fan > div {
  position: absolute;
  width: clamp(78px, 12vw, 157px);
  left: 48%;
  top: 48%;
  transform-origin: 50% 76%;
  filter: drop-shadow(4px 9px 7px #031510b0);
  transform: translate(-50%, -45%) rotate(var(--r)) translateX(var(--x)) translateY(var(--y));
}
.card-fan > :nth-child(1) { --r: -27deg; --x: -57%; --y: 12%; }
.card-fan > :nth-child(2) { --r: -8deg; --x: -23%; --y: -8%; }
.card-fan > :nth-child(3) { --r: 16deg; --x: 18%; --y: -5%; }
.card-fan > :nth-child(4) { --r: 33deg; --x: 51%; --y: 8%; }

.lobby, .setup { padding-top: clamp(10px, 2.5vw, 27px); }
.lobby-toolbar, .session-top, .rail-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.lobby-toolbar { margin: 18px 0 10px; }
.filters {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 30px;
  background: #071612a6;
}
.filters button, .button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .52em .83em;
  min-height: 32px;
  background: #203d31;
  color: #f1e9ce;
  font-weight: 650;
  white-space: nowrap;
}
.filters button { border-radius: 30px; background: transparent; color: var(--dim); }
.filters [aria-pressed="true"] { color: var(--cream); background: #304d3a; }
.button:not(:disabled):hover, .filters button:hover { border-color: #e6c67d65; background: #375443; color: #fff4d5; }
.button.quiet { background: transparent; color: #d9e3cd; border-color: transparent; }
.button.quiet:not(:disabled):hover, .button.quiet[aria-pressed="true"] { background: #38523d; }
.button.primary, .button.accent { background: #ddbf7d; color: #202519; border-color: #f2d88e9c; }
.button.primary:not(:disabled):hover, .button.accent:not(:disabled):hover { color: #202519; background: #f6d794; }
.button.accent { background: #a7d2ad; border-color: #cbe8ba; }
.game-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.game-option {
  background: linear-gradient(145deg, #f3e5bf, #e3cea3);
  color: var(--ink);
  border-radius: 12px;
  min-width: 0;
  padding: 2px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 10px #0004;
  --stamp: #2f4e3d;
  --badge-bg: #c5d0ad;
}
.tone-ink { --stamp: #27372f; --badge-bg: #d1c6a9; }
.tone-rose { --stamp: #7a302c; --badge-bg: #e8b2a8; }
.tone-rust { --stamp: #9b391f; --badge-bg: #edc695; }
.tone-green { --stamp: #24563a; --badge-bg: #ced4a5; }
.game-open {
  color: inherit; border-radius: 10px; border: 0; background: transparent; text-align: left;
  display: grid; width: 100%; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center;
  padding: .72rem .55rem .72rem .7rem; min-height: 81px;
}
.game-open:hover { background: #fff8dc88; }
.game-open:active { background: #fff8dccc; }
.game-symbol {
  display: grid; place-content: center;
  inline-size: 42px; block-size: 52px;
  border: 1px solid #63452347; border-radius: 8px; background: var(--badge-bg);
  font: 2.05rem/1 var(--serif); color: var(--stamp);
  box-shadow: inset 0 0 0 3px #fff6d547;
}
.game-summary { display: grid; gap: 2px; min-width: 0; }
.game-summary strong { font: 700 1.11rem/1.08 var(--serif); }
.game-summary small { color: #434b39; font-size: .73rem; line-height: 1.29; }
.go { font-size: 1.25rem; color: #5f6246; }
.button.resume-button {
  background: #e0d5af;
  color: #2d4029;
  margin: -3px 5px 5px auto;
  min-height: 25px;
  font-size: .76rem;
}
.button.resume-button:hover { color: #532c13; background: #fff3cb; }

.setup { width: min(100%, 840px); margin-inline: auto; }
.crumb { margin-bottom: 7px; }
.setup-sheet {
  background: radial-gradient(ellipse at 0 18%, #fff8dc, transparent 72%), #ead7aa;
  color: var(--ink);
  border-radius: 20px;
  min-height: 260px;
  padding: clamp(17px, 5vw, 44px);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: clamp(14px,3vw,28px);
  align-items: start;
  box-shadow: 0 14px 36px #0005;
}
.setup-symbol {
  width: 100%;
  height: 124px;
  display: grid; place-content: center;
  border-radius: 12px;
  border: 1px solid #8c633b50;
  box-shadow: inset 0 0 0 5px #fff6d490;
  background: var(--badge-bg);
  color: var(--stamp);
  font: 4.5rem/1 var(--serif);
}
.setup h1, .setup h2, .panel-heading h2 { font: 700 clamp(1.6rem, 5vw, 3rem)/1.06 var(--serif); }
.setup-copy > p { margin: 9px 0 19px; font-size: .93rem; }
#settings { display: flex; flex-wrap: wrap; gap: 10px; }
#settings label, .display-options label { display: grid; gap: 4px; font-weight: 600; font-size: .82rem; }
select {
  padding: .55em .7em;
  color: #251f16;
  background: #f6ecce;
  border: 1px solid #8b774b78;
  border-radius: 6px;
  min-height: 36px;
}
.setup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.setup-actions .quiet { color: #263c2b; }
.setup-actions .quiet:hover { color: #1a261b !important; background: #d1d7ac !important; }
.setup-rules { padding: 19px 7px; line-height: 1.58; }
.setup-rules h2 { font-size: 1.35rem; margin-bottom: 7px; }
.muted-text { color: var(--dim); margin-top: 8px; }
.variant-results { margin: 8px 0 0; color: var(--dim); font-size: .87rem; }
.variant-results div { display: flex; flex-wrap: wrap; gap: 2px 6px; }
.variant-results dd { margin: 0; }

.session { width: min(100%, 1068px); margin-inline: auto; }
.session-top { padding: 8px 0; }
.session-top > div { display: flex; align-items: center; gap: 6px; }
.session-top h1 { font: 700 clamp(1.1rem, 4vw, 1.55rem)/1 var(--serif); color: #fff2cd; }
.rotation {
  display: none;
  background: #362d18;
  color: #f2db9c;
  border-radius: 7px;
  padding: .42em .65em;
  font-size: .79rem;
  margin-bottom: 7px;
}
.lesson {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin: 0 0 7px; padding: .3rem .55rem;
  background: #263c27; border-radius: 7px; color: #f2e8bb;
  font-size: .79rem;
}
.lesson > div { display: flex; align-items: center; gap: 8px; }
.lesson strong { color: #f8d484; }

.table-frame, .solitaire-felt { --card-width: clamp(44px, 6vw, 74px); }
.felt, .solitaire-felt {
  min-width: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #ac9a68;
  background:
    repeating-linear-gradient(25deg,#07271418 0 1px,transparent 1px 4px),
    repeating-linear-gradient(139deg,#d1e8c309 0 1px,transparent 1px 4px),
    radial-gradient(ellipse at 52% 48%, #24644d 0%, #184d3b 51%, #102f28 98%);
  box-shadow: inset 0 0 31px #030c0a73, 0 10px 23px #020c0784;
}
.felt {
  padding: 13px 13px 8px;
  min-height: clamp(240px, 41vh, 355px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2px;
}
.felt-rule {
  position: absolute; z-index: -1;
  inset: 6px;
  border: 1px solid #d6b66a47;
  border-radius: 9px;
}
.opponents { display: flex; gap: 8px; justify-content: center; align-items: start; min-width: 0; }
.seat {
  color: #f9e7ba; background: #0d2922ce;
  border: 1px solid #c6b67952;
  border-radius: 9px;
  min-height: 51px;
  flex: 0 1 180px;
  min-width: 0;
  max-width: 32%;
  padding: 4px 7px;
  display: flex; align-items: center; gap: 6px;
}
.seat.acting { border-color: #f4d88d; box-shadow: 0 0 12px #ffe2903a; }
.seat.folded { opacity: .56; }
.seat-label { min-width: 0; flex: 1; display: grid; gap: 1px; line-height: 1.1; }
.seat-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; }
.seat-label small { color: #b4c8a4; font-size: .72rem; }
.avatar {
  width: 27px; height: 32px; flex: 0 0 27px;
  display: grid; place-content: center;
  background: #bfc698; color: #2d503c; border-radius: 6px;
  font: 1.35rem/1 var(--serif);
}
.avatar.me { background: #e6c67e; color: #21392b; }
.back-stack { width: 36px; height: 36px; flex: 0 0 auto; position: relative; }
.back-stack .face { width: 24px; position: absolute; left: 4px; top: 1px; transform: rotate(-12deg); }
.back-stack .face:nth-child(2) { transform: translateX(7px) rotate(7deg); }
.back-stack strong {
  position: absolute; inset: auto 0 0 auto; min-width: 19px; text-align: center;
  padding: 1px 2px; font-size: .68rem; border-radius: 4px; color: #213825; background: #ede0af;
}
.seat > .mini-cards { flex: 1; flex-wrap: wrap; --mini: 17px; gap: 1px; }
.table-middle { min-width: 0; min-height: 106px; display: grid; align-items: center; justify-items: center; }
.table-facts { text-align: center; color: #decda4; font-size: .85rem; }
.table-facts strong { color: #fff0bb; }
.center-play, .community, .two-piles > div { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.center-play > small, .community > small, .two-piles small, .trick small { color: #e6dbb6; font-size: .73rem; }
.center-play .mini-cards { justify-content: center; flex-wrap: wrap; max-width: min(100%, 640px); }
.table-monogram { color: #e4d28655; font: 5.2rem/.85 var(--serif); }
.two-piles { display: flex; gap: 19px; padding: 5px 0; }
.two-piles .face, .community-cards > * { width: clamp(34px, 7.6vw, 66px); }
.community-cards { display: flex; gap: 4px; }
.pot { padding: .29em .7em; background: #102f26; border-radius: 30px; color: #ece0bd; font-size: .83rem; }
.pot strong { color: #f9d887; }
.tricks {
  gap: 3px 7px;
  width: min(100%, 610px);
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-template-rows: repeat(3,minmax(24px,auto));
}
.trick { display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; }
.trick .mini-cards, .trick small { grid-row: auto; }
.trick .mini-cards { max-width: 100%; flex-wrap: wrap; justify-content: center; --mini: clamp(23px,5vw,42px); }
.trick-0 { grid-area: 3 / 2; }
.trick-1 { grid-area: 2 / 1; }
.trick-2 { grid-area: 1 / 2; }
.trick-3 { grid-area: 2 / 3; }

.player-rail { padding: 4px 4px 1px; min-width: 0; }
.rail-tools { color: var(--cream); gap: 3px; }
.rail-tools > div { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rail-tools .avatar { width: 23px; height: 24px; flex-basis: 23px; font-size: 1.05rem; }
.rail-tools strong { white-space: nowrap; }
.rail-tools small { color: var(--dim); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: .8rem; }
.rail-tools .button { font-size: .81rem; padding: .35em .55em; }
.hand-window {
  --overlap: clamp(9px, 1.2vw, 18px);
  overflow: auto hidden; scrollbar-width: thin; scrollbar-color: #ad996c6b transparent;
  margin-top: -3px;
  min-width: 0;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding-block: 11px 3px;
}
.hand-window.batching, .hand-window.batching button { touch-action: none; }
.hand-cards { display: flex; width: max-content; min-width: min-content; margin-inline: auto; padding-inline: 4px; }
.hand-card, .tile, .inspect-grid button {
  width: var(--card-width); border: 0; background: none; color: inherit; padding: 0; position: relative;
  flex: 0 0 auto; display: block; border-radius: 5px;
}
.hand-card { transition: transform .12s ease; }
.hand-card + .hand-card { margin-left: calc(-1 * var(--overlap)); }
.hand-card.divided { margin-left: 4px; }
.hand-card:not([aria-disabled=true]):hover,
.hand-card[aria-pressed=true] { transform: translateY(-7px); z-index: 2; }
.hand-card[aria-pressed=true] .face, .tile.picked .face {
  box-shadow: 0 0 0 2px #ffd57c, 0 5px 8px #0008;
}
.hand-card.suggested .face { box-shadow: 0 0 0 2px #9de8a3, 0 3px 7px #0007; }
.hand-card.following .face { border-color: #b4dda7; background-color: #fff6dc; }
.hand-card.soft { opacity: .53; }
.wild-tag { position: absolute; z-index: 1; right: 3%; top: 3%; padding: 1px 3px; background: #8a2428; color: #fff3cb; border-radius: 3px; font-size: .62rem; }
.meld-mark { position: absolute; bottom: 2px; left: 10%; right: 10%; height: 2px; background: #438358; border-radius: 3px; }
.commands { min-height: 37px; margin-top: 4px; }
.moves, .waiting, .sol-commands { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: center; }
.moves .button.primary { min-width: 70px; }
.selection-note { color: #fbdd9c; font-size: .78rem; min-width: 0; align-self: center; }
.buried-selection { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; padding: 3px; }
.buried-selection button { border: 0; border-radius: 3px; background: #efdfb8; color: #263833;
  font-weight: 700; font-size: .76rem; padding: .2em .32em; white-space: nowrap; min-height: 24px; }
.buried-selection button.red { color: #973529; }
.bet-input { display: flex; gap: 4px; align-items: center; font-size: .76rem; }
.bet-input input { width: 77px; border-radius: 7px; border: 1px solid #decfa98c; background: #193b2f; color: #fff2c5; padding: .36em .48em; }
.waiting { color: var(--dim); font-size: .87rem; margin-top: 7px; }
.waiting i { width: 5px; height: 5px; background: #cdbd83; border-radius: 50%; }

.face, .vacancy {
  user-select: none; display: block;
  width: 100%; aspect-ratio: 5/7; position: relative;
  border-radius: 8%; overflow: hidden;
}
.face {
  container-type: inline-size;
  color: #122820;
  border: 1px solid #a984568c;
  background:
    repeating-linear-gradient(118deg,#4f300707 0 1px,transparent 1px 3px),
    radial-gradient(ellipse at 35% 20%, #fffaf0, #f3dfb9 130%);
  background-color: #faefd5;
  box-shadow: inset 0 0 0 1px #fffcdfbc, 0 2px 4px #0315105c;
}
.face.red { color: #9e301f; }
.corner {
  display: grid;
  justify-items: center;
  text-align: center;
  position: absolute; z-index: 1; left: 6%; top: 4%;
  font: bold clamp(.56rem, 24cqw, 1.75rem)/.93 var(--serif);
  min-width: 20%;
}
.corner span { font-size: .84em; }
.corner.opposite { inset: auto 6% 4% auto; transform: rotate(180deg); }
.pip, .ace, .joker, .court-rank {
  display: grid; place-content: center; text-align: center;
  position: absolute; inset: 22% 17%;
  font: 700 50cqw/.9 var(--serif);
}
.ace { font-size: 67cqw; }
.joker { font-size: 49cqw; }
.joker small { font: 700 20cqw/1 var(--serif); color: #895b31; }
.court-rank {
  inset: 17% 22%;
  border: 1px solid #aa7c49b5;
  color: #e7c68b;
  background: repeating-linear-gradient(32deg,#f8cb8f25 0 1px,transparent 1px 4px),
    linear-gradient(154deg,#163c32 0 49%,#8f4a31 50% 100%);
}
.court-rank.court-q { background-color: #8b3624; background-image: repeating-linear-gradient(122deg,#eab7792b 0 1px,transparent 1px 4px),linear-gradient(25deg,#365544 0 46%,#973b2b 47%); }
.court-art { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr; }
.court-art i {
  position: absolute; inset: 5% 10% 48%;
  background: #e2b77b;
  clip-path: polygon(8% 100%, 11% 77%, 33% 65%, 28% 45%, 22% 38%, 25% 16%, 36% 26%, 54% 6%, 69% 25%, 82% 16%, 78% 42%, 66% 51%, 70% 68%, 91% 81%, 94% 100%);
}
.court-q i { clip-path: polygon(4% 100%, 17% 74%, 30% 67%, 24% 51%, 27% 27%, 36% 40%, 47% 12%, 59% 36%, 79% 19%, 79% 49%, 74% 65%, 92% 84%, 96% 100%); }
.court-j i { clip-path: polygon(3% 98%, 12% 80%, 36% 63%, 37% 45%, 21% 31%, 33% 17%, 58% 21%, 84% 10%, 77% 41%, 67% 50%, 69% 68%, 91% 83%, 98% 98%); }
.court-art i:last-child { inset: 48% 10% 5%; transform: rotate(180deg); background: #ecce91; }
.court-art b { align-self: center; z-index: 1; font-size: 20cqw; padding: 1px; color: #f2ddb0; background: #203b31; }
.back {
  display: grid; place-content: center;
  background:
    repeating-linear-gradient(31deg,transparent 0 3px,#edb9652f 3px 4px),
    repeating-linear-gradient(-31deg,transparent 0 3px,#edb9652f 3px 4px),
    radial-gradient(ellipse,#396549,#214334);
  border: 1px solid #d1b373;
  box-shadow: inset 0 0 0 2px #31583f, inset 0 0 0 3px #b89d65, 0 2px 4px #051c14ad;
  color: #f2d78f;
  font: bold 38cqw/1 var(--serif);
}
.vacancy { display: grid; place-content: center; border: 1px dashed #e6ca8678; color: #eed99b84; font: 1.36rem/1 var(--serif); background: #082a2049; }
.mini-cards { --mini: clamp(25px, 4vw, 48px); display: flex; align-items: start; gap: 3px; min-width: 0; }
.mini-cards > .face { width: var(--mini); flex: 0 0 var(--mini); }
.high-contrast .face.red { color: #99131d; box-shadow: inset 0 0 0 2px #ab293a; }
.high-contrast .face.black { color: #000; box-shadow: inset 0 0 0 2px #304e41; }
.high-contrast .corner { font-size: max(.57rem, 31cqw); }

.solitaire-felt { padding: 10px 12px; }
.sol-top { display: grid; gap: 4px; grid-template-columns: auto 1fr auto; align-items: center; }
.sol-stock, .foundations { display: flex; gap: 5px; }
.sol-stock .stock small { position: absolute; right: 2px; bottom: 3px; padding: 1px 4px; border-radius: 4px; background: #e3c784; color: #16261b; font-size: .68rem; font-weight: 700; }
.tile:disabled { opacity: .6; }
.tile { touch-action: none; }
.sol-moves { color: #ebdcae; margin-inline: 4px; text-align: center; font-size: .86rem; }
.empty-runs { font: .9rem var(--serif); color: #e6cb8a; }
.column-window { margin-top: 11px; overflow: hidden auto; min-height: clamp(218px, 46vh, 404px); max-height: 52vh; touch-action: pan-y; }
.columns {
  --gap: 5px;
  --lift: clamp(15px, 2.45vw, 25px);
  display: grid; gap: var(--gap); grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  margin-inline: auto;
  width: min(100%, 850px);
  min-height: max(185px, calc(var(--max) * var(--lift) + 54px));
  align-items: start;
}
.column {
  --card-width: min(100%, 78px);
  position: relative;
  margin-inline: auto;
  width: min(100%, 78px);
  min-height: max(70px, calc((var(--length) - 1) * var(--lift) + min(95px,12vw)));
}
.column-card { position: absolute; top: calc(var(--lift) * var(--step)); width: 100%; }
.column-card .tile { width: 100%; }
.column .corner { font-size: clamp(.58rem, 27cqw, 1.3rem); }
.column .corner.opposite { visibility: hidden; }
.column:has(.tile.picked) .column-card:has(.tile.picked) ~ .column-card .face { border-color: #ffd57c; }
.destination, .drag-target { outline: 2px solid #b9efaa; border-radius: 6px; outline-offset: 1px; }
.sol-commands { justify-content: flex-start; padding-top: 7px; }
.sol-commands small { font-size: .75rem; color: #ece4c0; margin-left: auto; }
.drag-ghost { position: fixed; z-index: 1100; opacity: .94; pointer-events: none; transform: translate(-50%,-35%) rotate(-4deg); }
.drag-ghost > div { position: absolute; width: 100%; top: calc(var(--i) * 14px); }

#panel {
  width: min(calc(100% - 18px), 600px); max-height: min(88dvh, 750px);
  border-radius: 18px; border: 1px solid #b9a675; padding: 0;
  background: radial-gradient(ellipse at 20% 0%, #314e38, #162d25 72%);
  color: var(--cream);
  box-shadow: 0 15px 45px #000a; overscroll-behavior: contain;
  touch-action: pan-y;
}
#panel::backdrop { background: #03120fc9; }
#panel-content { padding: clamp(14px, 4vw, 24px); line-height: 1.55; }
#panel-content p { margin: .45rem 0 .7rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.panel-heading h2 { font-size: clamp(1.35rem, 5vw, 2.1rem); }
.panel-heading button { border: 1px solid #f1e2ab3d; border-radius: 8px; width: 35px; height: 35px; color: var(--cream); background: #1d3b2d; font-size: 1.3rem; }
.panel-actions { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 10px; }
.display-options { display: grid; gap: 10px; width: min(100%, 270px); margin: 9px 0; }
.display-options label:first-child { display: flex; }
.display-options input { accent-color: #d0bd78; }
.result-main { font: 700 2.2rem/1.1 var(--serif); color: #f5d989; }
.result-main small { font-size: .85rem; }
.lead-result { font: 700 1.2rem/1.45 var(--serif); color: #f5d989; }
.score-grid { margin: 8px 0; }
.score-row { display: grid; grid-template-columns: 1fr 52px 51px; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 3px; }
.score-row b { text-align: right; }
.score-row span { color: #b9d5ab; }
.detail-row { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 3px 0; }
.detail-row > .mini-cards { grid-column: 1 / -1; }
.review-log { padding: 0; margin: 7px 0 0; list-style: none; }
.review-log li { min-height: 33px; display: flex; align-items: center; gap: 7px; padding-block: 3px; border-bottom: 1px solid var(--line); }
.review-log li b { color: var(--tan); min-width: 2.2ch; }
.review-log .mini-cards { --mini: 26px; flex-wrap: wrap; }
.inspect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 7px; }
.inspect-grid section { border-radius: 5px; padding: 4px; background: #0d251d; }
.inspect-grid section div { display: flex; flex-wrap: wrap; gap: 2px; }
.inspect-grid .back, .inspect-grid button { width: 26px; }
.notice {
  position: fixed; z-index: 200; pointer-events: none;
  right: max(9px, env(safe-area-inset-right)); bottom: max(11px, env(safe-area-inset-bottom));
  padding: .48em .75em; max-width: min(calc(100% - 18px), 420px);
  color: #f9edca; background: #20372a; border: 1px solid #d5bb78;
  box-shadow: 0 4px 14px #0006; border-radius: 7px; opacity: 0;
  transform: translateY(8px); transition: opacity .15s ease, transform .15s ease;
}
.notice.visible { opacity: 1; transform: none; }
@media (max-width: 900px) {
  .game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) and (orientation: portrait) {
  :root { font-size: 14px; }
  #surface, .masthead { width: calc(100% - 16px); }
  .masthead { min-height: 54px; }
  .hero { min-height: 166px; padding: 19px 6%; grid-template-columns: 1fr .53fr; }
  .hero h1 { font-size: clamp(2.95rem,11.8vw,4.5rem); }
  [lang="zh-CN"] .hero h1 { font-size: clamp(2.55rem,10.4vw,4.2rem); }
  .hero p { margin-top: .55rem; max-width: 13em; }
  .hero::before { inset: 6px; }
  .card-fan { transform: scale(.9); }
  .card-fan > div { width: clamp(58px, 17vw, 85px); left: 42%; }
  .lobby-toolbar { margin: 12px 0 8px; }
  .lobby-toolbar > .button { padding-inline: .24rem; }
  .filters button { padding-inline: .5rem; font-size: .79rem; }
  .game-list { gap: 6px; }
  .game-open { grid-template-columns: auto 1fr; gap: 6px; padding: .42rem .38rem; min-height: 71px; }
  .game-symbol { width: 32px; height: 41px; font-size: 1.65rem; }
  .game-summary strong { font-size: .99rem; }
  .game-summary small { font-size: .68rem; }
  .go { display: none; }
  .setup-sheet { grid-template-columns: 54px 1fr; }
  .setup-symbol { height: 76px; font-size: 2.7rem; }
  .rotation { display: block; }
  .felt { min-height: max(240px, min(60svh, calc(100svh - 288px))); padding: 8px 6px; }
  .mode-dou.felt, .mode-gin.felt { min-height: max(225px, min(56svh, calc(100svh - 337px))); }
  .opponents { gap: 2px; }
  .seat { padding: 3px; gap: 3px; max-width: 33%; }
  .seat .avatar { display: none; }
  .seat-label strong { font-size: .83rem; }
  .seat-label small { font-size: .67rem; }
  .back-stack { transform: scale(.9); transform-origin: right; width: 30px; }
  .table-frame { --card-width: clamp(40px, 12.5vw, 54px); }
  .hand-window { --overlap: 11px; }
  .mode-dou + .player-rail .hand-cards {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr)) var(--card-width);
    grid-auto-flow: row;
    row-gap: 8px;
    width: min(100%, calc(10 * var(--card-width) - 9 * var(--overlap) + 8px));
    min-width: 0;
  }
  .mode-dou + .player-rail .hand-card { margin-left: 0; }
  .mode-gin + .player-rail .hand-cards {
    display: grid; grid-template-rows: auto auto; grid-auto-flow: column; gap: 5px 0; padding-right: 7px;
  }
  .mode-gin + .player-rail .hand-card { margin-left: 0; margin-right: -9px; }
  .rail-tools small { font-size: .73rem; }
  .solitaire-felt { padding: 7px 5px; --card-width: clamp(26px, 10vw, 46px); }
  .sol-stock, .foundations { gap: 3px; }
  .columns { --gap: 3px; }
  .sol-commands small { margin-left: 0; }
  .sol-commands .button { padding-inline: .45em; }
  .sol-moves { font-size: .74rem; }
}
@media (max-height: 570px) and (orientation: landscape) and (pointer: coarse) {
  :root { font-size: 13px; }
  #surface, .masthead { width: calc(100% - 16px); }
  #surface { padding-bottom: 4px; }
  .masthead { min-height: 44px; }
  .session-top { padding: 2px 0; }
  .session-top .button, .rail-tools .button { min-height: 25px; padding-block: .25em; }
  .felt { padding: 4px 7px 4px; min-height: max(134px, calc(100svh - 218px)); }
  .felt-rule { inset: 3px; }
  .table-middle { min-height: 62px; }
  .seat { min-height: 33px; padding: 2px 4px; }
  .seat .avatar { height: 22px; width: 22px; flex-basis: 22px; }
  .back-stack { width: 28px; height: 24px; }
  .back-stack .face { width: 16px; }
  .table-facts { font-size: .77rem; }
  .two-piles .face, .community-cards > *, .trick .mini-cards { --mini: 22px; }
  .two-piles .face, .community-cards > * { width: 32px; }
  .tricks { grid-template-rows: repeat(3,minmax(14px,auto)); gap: 0 4px; }
  .table-monogram { font-size: 3rem; }
  .player-rail { padding-block: 2px 0; }
  .rail-tools .avatar { height: 19px; }
  .table-frame { --card-width: clamp(34px, 10vh, 49px); }
  .hand-window { padding-top: 10px; --overlap: 12px; }
  .commands { min-height: 29px; margin-top: 0; }
  .commands .button { min-height: 27px; padding-block: .27em; }
  .solitaire-felt { padding: 4px 7px; --card-width: min(10vh, 44px); }
  .sol-top { min-height: 36px; }
  .column-window { min-height: 0; max-height: max(62px, calc(100svh - 177px)); margin-top: 4px; }
  .columns { --gap: 5px; --lift: clamp(11px, 4vh, 16px); min-height: max(115px, calc(var(--max) * var(--lift) + 36px)); }
  .column { --card-width: min(100%, 51px); width: var(--card-width); }
  .sol-commands { padding-top: 4px; }
  .sol-commands .button { min-height: 25px; padding-block: .23em; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
