.human-play-app {
  width: 100%;
  min-height: 100vh;
  overflow: auto;
}

.human-table-stage {
  --own-hand-panel-bottom: 22px;
  --bottom-seat-gap: 20px;
  --bottom-seat-baseline: 220px;
  /* A twelve-card committed play is 274px wide (54 + 11 * 20).  These
     anchors keep the four play lanes in separate table quadrants without
     pushing the side lanes through the centre of the table. */
  --human-opposed-play-offset: clamp(148px, 11vw, 160px);
  --human-side-play-inset: clamp(168px, 13vw, 188px);
  min-height: max(760px, calc(546px + var(--own-hand-panel-height, 0px)));
  background:
    radial-gradient(ellipse at 50% 43%, rgba(50, 186, 122, 0.5), transparent 46%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.045), transparent 30%),
    linear-gradient(150deg, #08734a, #034830 72%, #033c2d);
}

.table-status-zone,
.table-battle-zone,
.table-hand-zone {
  display: contents;
}

.human-topbar {
  min-height: 62px;
  position: absolute;
  z-index: 45;
  top: 14px;
  right: 24px;
  left: 24px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  pointer-events: none;
}

.human-topbar > * {
  pointer-events: auto;
}

.human-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-brand-lockup {
  width: 330px;
  height: 44px;
  margin: 34px 0 0 20px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* Operator wordmark. The upstream build shipped a vendor logo image here, but
   that logo is explicitly outside the project's Apache-2.0 grant, so a
   white-label deployment replaces it with plain text driven by BATTLE_BRAND_NAME. */
.brand-wordmark {
  display: inline-block;
  color: var(--gold);
  font-family: var(--mono, monospace);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.table-brand-lockup .brand-wordmark {
  font-size: 19px;
  opacity: 0.94;
}

.page-boot-content .brand-wordmark {
  margin: 28px 0 12px;
  font-size: 32px;
}

.table-brand-lockup img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.94;
  filter: drop-shadow(0 2px 5px rgba(0, 25, 17, 0.24));
}

.back-to-spectator,
.topbar-review-link {
  width: max-content;
  height: 44px;
  padding: 0 15px 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(2, 43, 30, 0.78);
  box-shadow: 0 8px 24px rgba(0, 23, 16, 0.26);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.back-to-spectator[hidden],
.topbar-review-link[hidden] {
  display: none;
}

.back-to-spectator:hover,
.topbar-review-link:hover {
  border-color: rgba(141, 240, 189, 0.5);
  color: var(--mint);
}

.topbar-review-link {
  padding-left: 13px;
  border-color: rgba(230, 199, 125, 0.36);
  color: var(--gold);
}

.human-topbar-actions svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.room-identity {
  min-width: 350px;
  height: 52px;
  padding: 7px 20px 7px 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(2, 47, 33, 0.74);
  box-shadow: 0 10px 30px rgba(0, 23, 16, 0.24);
  backdrop-filter: blur(12px);
}

.room-identity > div {
  min-width: 0;
}

.room-identity strong,
.room-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-identity strong {
  font-size: 15px;
}

.room-identity small {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.connection-chip {
  /* The top bar is a three-column grid, but showing the room identity makes four
     children, so the chip was auto-placed into row 2 column 1 -- directly under
     the centred .room-status-strip.  Measured overlap was 38% in the lobby and
     76% in play, and because the strip paints a blurred translucent background
     the two texts blended into visible garbage.  Pin it to the right of row 2,
     clear of the strip. */
  grid-column: 3;
  justify-self: end;
  width: max-content;
  height: 36px;
  margin-left: auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(2, 43, 30, 0.78);
  font-size: 11px;
}

.connection-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #70847b;
}

.connection-chip[data-state="online"] {
  color: var(--mint);
}

.connection-chip[data-state="online"] i {
  background: var(--mint);
  box-shadow: 0 0 9px rgba(141, 240, 189, 0.78);
}

.connection-chip[data-state="reconnecting"] {
  color: var(--gold);
}

.connection-chip[data-state="reconnecting"] i {
  background: var(--gold);
}

.connection-chip[data-state="offline"] {
  color: #ff98a3;
}

.connection-chip[data-state="offline"] i {
  background: #ff7180;
}

.room-status-strip {
  height: 36px;
  position: absolute;
  z-index: 36;
  top: 77px;
  left: 50%;
  padding: 0 8px 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(2, 42, 29, 0.72);
  backdrop-filter: blur(10px);
  font-size: 11px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.room-status-strip > b {
  height: 22px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #063829;
  background: var(--mint);
  font-size: 10px;
}

.room-status-strip > button,
.room-status-strip > a {
  height: 26px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  text-decoration: none;
}

.room-status-strip > button:hover,
.room-status-strip > a:hover {
  background: rgba(141, 240, 189, 0.1);
}

.room-status-strip > .latest-replay-link {
  border: 1px solid rgba(141, 240, 189, 0.34);
  color: var(--mint);
}

.room-status-strip > .latest-replay-link[hidden] {
  display: none;
}

.room-status-strip svg {
  width: 14px;
  height: 14px;
}

.rule-badge-strip {
  width: 246px;
  position: absolute;
  z-index: 34;
  top: 210px;
  left: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
}

.guandan-level-hud {
  min-width: 210px;
  position: absolute;
  z-index: 35;
  top: 124px;
  left: 30px;
  padding: 9px 10px;
  border: 1px solid rgba(230, 199, 125, 0.34);
  border-radius: 14px;
  color: var(--cream);
  background: rgba(2, 42, 29, 0.82);
  box-shadow: 0 8px 24px rgba(0, 22, 15, 0.22);
  backdrop-filter: blur(10px);
}

.guandan-level-hud > strong {
  display: block;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.guandan-level-hud > div {
  margin-top: 7px;
  display: flex;
  gap: 6px;
}

.guandan-level-hud span {
  min-width: 82px;
  height: 29px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #87a99a;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
}

.guandan-level-hud span b {
  color: #a4bbb0;
  font-family: var(--mono);
  font-size: 15px;
}

.guandan-level-hud span.active {
  border-color: rgba(141, 240, 189, 0.54);
  color: #073b2c;
  background: var(--mint);
}

.guandan-level-hud span.active b {
  color: #073b2c;
}

.rule-badge-strip span {
  min-height: 23px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(230, 199, 125, 0.25);
  border-radius: 999px;
  color: #e9dba8;
  background: rgba(3, 48, 34, 0.72);
  box-shadow: 0 4px 12px rgba(0, 23, 16, 0.16);
  font-size: 9px;
  white-space: nowrap;
}

.doudizhu-status-panel {
  width: min(720px, calc(100vw - 64px));
  position: absolute;
  z-index: 34;
  top: 120px;
  left: 50%;
  box-sizing: border-box;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 6px;
  border: 1px solid rgba(230, 199, 125, 0.28);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(2, 43, 30, 0.82);
  box-shadow: 0 10px 28px rgba(0, 23, 16, 0.22);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.doudizhu-status-panel[hidden],
.doudizhu-bottom-row[hidden] {
  display: none;
}

.doudizhu-status-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.doudizhu-status-grid span {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 7px;
  font-size: 9px;
}

.doudizhu-status-grid b {
  overflow: hidden;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doudizhu-status-panel > p {
  min-width: 0;
  margin: 0;
  padding-top: 6px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #91b6a5;
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doudizhu-status-panel > .doudizhu-multiplier-trail {
  color: var(--mint);
}

.doudizhu-bottom-row {
  margin: 0;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.doudizhu-bottom-row > span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.doudizhu-bottom-cards {
  display: flex;
  gap: 4px;
}

.doudizhu-bottom-cards .playing-card.table {
  width: 34px;
  height: 47px;
  border-radius: 4px;
}

.doudizhu-bottom-cards .playing-card.table .card-corner {
  top: 2px;
  left: 2px;
}

.doudizhu-bottom-cards .playing-card.table .card-corner b {
  font-size: 11px;
}

.doudizhu-bottom-cards .playing-card.table .card-corner i {
  font-size: 8px;
}

.doudizhu-bottom-cards .playing-card.table em {
  right: 2px;
  bottom: 2px;
  font-size: 17px;
}

.connection-freeze {
  position: absolute;
  z-index: 60;
  top: 122px;
  left: 50%;
  padding: 9px 15px;
  border: 1px solid rgba(255, 152, 163, 0.5);
  border-radius: 999px;
  color: #ffd8dc;
  background: rgba(91, 23, 32, 0.92);
  box-shadow: 0 9px 28px rgba(31, 4, 8, 0.34);
  font-size: 11px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.connection-frozen .own-hand-panel,
.connection-frozen .human-room-controls {
  filter: saturate(0.55);
}

.human-seat-layer {
  position: absolute;
  z-index: 8;
  inset: 0;
  pointer-events: none;
}

.human-seat {
  width: 330px;
  height: 152px;
  position: absolute;
  z-index: 9;
  pointer-events: none;
}

/* The shared spectator stylesheet also owns .seat-* geometry. Keep the
   interactive table's compact seat boxes authoritative at the higher scope. */
.human-table-stage[data-game] .human-seat {
  width: 330px;
  height: 152px;
}

.human-seat .player-tag,
.human-seat .seat-target {
  pointer-events: auto;
}

.human-seat .player-tag {
  width: 112px;
  min-width: 0;
  height: 90px;
  padding: 4px 5px 6px;
  position: absolute;
  inset: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  border-color: transparent;
  border-radius: 12px;
  background: rgba(2, 45, 32, 0.72);
  box-shadow: none;
  transform: none;
}

.human-seat .seat-number {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  font-size: 17px;
}

.human-seat .player-tag > div {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.human-seat .player-name {
  display: block;
  overflow: hidden;
  font-size: 11px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-seat .player-role {
  display: block;
  margin-top: 0;
  overflow: hidden;
  color: #a8c8ba;
  font-size: 8px;
  line-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-seat .hand-count {
  font-size: 13px;
}

.human-seat.viewer-seat .player-tag {
  border-color: rgba(141, 240, 189, 0.65);
  box-shadow:
    0 0 0 3px rgba(141, 240, 189, 0.08),
    0 8px 24px rgba(0, 22, 15, 0.3);
}

.human-seat.current-actor .player-tag {
  border-color: rgba(255, 213, 103, 0.82);
  box-shadow:
    0 0 0 4px rgba(255, 207, 86, 0.08),
    0 0 26px rgba(255, 207, 86, 0.14);
}

.human-seat.kind-open .player-tag {
  border-style: dashed;
  color: #d8eadf;
  background: rgba(2, 42, 29, 0.58);
}

.seat-target {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 6;
  inset: 0;
  border-radius: inherit;
  background: transparent;
}

.seat-target:not(:disabled):hover {
  background: rgba(141, 240, 189, 0.08);
  box-shadow: inset 0 0 0 1px rgba(141, 240, 189, 0.36);
}

.seat-target:disabled {
  pointer-events: none;
}

.ready-mark {
  min-width: 34px;
  height: 19px;
  position: absolute;
  top: 5px;
  right: 1px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.ready-mark.ready {
  border-color: rgba(141, 240, 189, 0.45);
  color: var(--mint);
}

.ready-mark.finish-place {
  min-width: 40px;
  padding: 0 7px;
  border-color: rgba(230, 199, 125, 0.72);
  color: #4d3506;
  background: #f1d68f;
  font-size: 9px;
}

/* The host played this seat's turn for it after the budget expired. Warm and
   neutral rather than alarming: the table continues, nothing was lost. */
.ready-mark.auto-played {
  min-width: 40px;
  padding: 0 7px;
  border-color: rgba(230, 199, 125, 0.62);
  color: #6b4a08;
  background: rgba(241, 214, 143, 0.34);
  font-size: 9px;
}

.opponent-hand {
  width: 166px;
  height: 68px;
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-left: 39px;
  opacity: 0.82;
  overflow: hidden;
}

.opponent-hand .card-back {
  width: 48px;
  height: 68px;
  margin-left: -39px;
  border-width: 1px;
}

.opponent-hand-count {
  position: absolute;
  z-index: 3;
  right: 3px;
  bottom: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--cream);
  background: rgba(1, 27, 19, 0.88);
  font-family: var(--mono);
  font-size: 9px;
}

/* Spectators use the replay hand renderer. The outer hand-zone only positions
   the hand; the inner .hand-layout/.meld-stack rules come from styles.css so
   all four seats share the same arranged-card geometry as replay. */
.spectator-hand {
  position: absolute;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.spectator-hand .hand-layout {
  pointer-events: none;
}

.human-seat .seat-play-area {
  min-width: 174px;
  min-height: 94px;
  position: absolute;
  z-index: 2;
  inset: auto;
  padding: 0;
  transform: none;
}

.human-seat .play-cards {
  --played-card-width: 54px;
  --played-card-height: 76px;
  --played-card-reveal: 20px;
  min-height: var(--played-card-height);
  margin: 0;
  padding-left: 0;
}

.human-seat .play-cards > * {
  margin-left: calc(var(--played-card-reveal) - var(--played-card-width));
}

.human-seat .play-cards > :first-child {
  margin-left: 0;
}

.human-seat .play-cards .playing-card.table {
  width: var(--played-card-width);
  height: var(--played-card-height);
  border-radius: 5px;
}

.human-seat .play-cards .playing-card.table .card-corner {
  top: 3px;
  left: 3px;
}

.human-seat .play-cards .playing-card.table .card-corner b {
  font-size: 17px;
}

.human-seat .play-cards .playing-card.table .card-corner i {
  font-size: 13px;
}

.human-seat .play-cards .playing-card.table em {
  right: 3px;
  bottom: 3px;
  font-size: 27px;
}

.human-seat .play-cards .playing-card.table.joker .card-corner b {
  font-size: 12px;
}

.human-seat .play-label {
  display: none;
  font-size: 34px;
}

.human-seat.passed .play-label {
  display: block;
}

.human-table-stage[data-game] .human-seat.seat-bottom {
  bottom: max(
    var(--bottom-seat-baseline),
    calc(var(--own-hand-panel-height, 0px) + var(--own-hand-panel-bottom) + var(--bottom-seat-gap))
  );
  left: 50%;
  transform: translateX(-50%);
}

.human-seat.seat-bottom .player-tag {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.human-table-stage.own-hand-visible:not(.spectator-view) .human-seat.seat-bottom .player-tag {
  display: none;
}

.human-seat.seat-bottom .opponent-hand {
  display: none;
}

.human-seat.seat-bottom .spectator-hand {
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
}

.human-table-stage[data-game] .human-seat.seat-bottom .seat-play-area {
  bottom: 64px;
  left: calc(50% + var(--human-opposed-play-offset));
  transform: translateX(-50%);
}

.human-table-stage[data-game] .human-seat.seat-top {
  top: 122px;
  left: 50%;
  transform: translateX(-50%);
}

.human-seat.seat-top .player-tag {
  top: 57px;
  left: calc(50% + 150px);
  transform: none;
}

.human-seat.seat-top .opponent-hand {
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
}

.human-seat.seat-top .spectator-hand {
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
}

.human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
  top: 135px;
  left: calc(50% - var(--human-opposed-play-offset));
  transform: translateX(-50%);
}

.human-table-stage[data-game] .human-seat.seat-left {
  top: 46%;
  left: 26px;
  transform: translateY(-50%);
}

.human-seat.seat-left .player-tag {
  top: 0;
  left: 0;
}

.human-seat.seat-left .opponent-hand {
  top: 96px;
  left: 0;
}

.human-seat.seat-left .spectator-hand {
  top: 96px;
  left: 0;
}

.human-seat.seat-left .seat-play-area {
  top: 158px;
  left: var(--human-side-play-inset);
}

.human-table-stage[data-game] .human-seat.seat-right {
  top: 46%;
  right: 26px;
  transform: translateY(-50%);
}

.human-seat.seat-right .player-tag {
  top: 0;
  right: 0;
}

.human-seat.seat-right .opponent-hand {
  top: 96px;
  right: 0;
}

.human-seat.seat-right .spectator-hand {
  top: 96px;
  right: 0;
}

.human-seat.seat-right .seat-play-area {
  top: -100px;
  right: var(--human-side-play-inset);
}

.human-turn-countdown {
  width: 62px;
  height: 62px;
  position: absolute;
  z-index: 11;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
}

.human-turn-countdown[hidden] {
  display: none;
}

/* The replay clock is intentionally large. Live play uses the same visual
   language at identity-badge scale so the timer cannot cover a hand or the
   committed-action lane. */
.human-turn-countdown::before,
.human-turn-countdown::after {
  width: 20px;
  height: 14px;
  top: 0;
  border-width: 3px;
  border-bottom-width: 2px;
}

.human-turn-countdown::before {
  left: 4px;
}

.human-turn-countdown::after {
  right: 4px;
}

.human-turn-countdown .turn-clock-face {
  width: 54px;
  height: 54px;
  box-sizing: border-box;
  border-width: 5px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.9),
    inset 0 -5px 8px rgba(142, 62, 34, 0.12),
    0 0 0 2px rgba(125, 38, 24, 0.2),
    0 4px 7px rgba(46, 14, 6, 0.3);
}

.human-turn-countdown .turn-clock-face::before,
.human-turn-countdown .turn-clock-face::after {
  width: 10px;
  height: 6px;
  bottom: -9px;
}

.human-turn-countdown .turn-clock-face::before {
  left: 4px;
}

.human-turn-countdown .turn-clock-face::after {
  right: 4px;
}

.human-turn-countdown .turn-countdown-value {
  color: #321008;
  font-size: 28px;
  font-weight: 950;
  -webkit-text-stroke: 0.8px #321008;
  text-shadow: 0 1px 1px rgba(44, 9, 4, 0.28);
}

.human-turn-countdown.elapsed {
  opacity: 1;
  filter: drop-shadow(0 4px 6px rgba(28, 12, 2, 0.28));
}

.human-turn-countdown.frozen {
  filter: grayscale(0.8) saturate(0.4);
}

.human-seat .player-tag > .human-turn-countdown {
  top: 14px;
  right: -70px;
  bottom: auto;
  left: auto;
}

.human-seat.seat-right .player-tag > .human-turn-countdown {
  right: auto;
  left: -70px;
}

.human-table-center {
  top: 45%;
}

.room-failure-panel {
  position: absolute;
  z-index: 20;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  padding: 22px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: var(--felt-deep);
  color: var(--cream);
  text-align: center;
}
.room-failure-panel[hidden] { display: none; }
.room-failure-panel strong { font-size: 22px; }
.room-failure-panel p { min-height: 48px; line-height: 1.5; }
.room-failure-panel > div { display: flex; justify-content: center; gap: 12px; }
.room-failure-panel button {
  min-height: 48px;
  min-width: 140px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--felt);
  color: var(--cream);
  font: inherit;
}
.room-failure-panel #retryRoomButton { background: var(--gold); color: var(--ink); }
.room-failure-panel button:not(:disabled) { cursor: pointer; }
.room-failure-panel button:hover:not(:disabled) { filter: brightness(1.1); }
.room-failure-panel button:active:not(:disabled) { filter: brightness(.92); }
.room-failure-panel button:disabled { opacity: .55; }
.room-failure-panel button:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

.lobby-help {
  width: min(430px, calc(100vw - 32px));
  position: absolute;
  z-index: 20;
  top: 46%;
  left: 50%;
  box-sizing: border-box;
  padding: 18px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(2, 45, 31, 0.5);
  text-align: center;
  backdrop-filter: blur(6px);
  transform: translate(-50%, -50%);
}

.lobby-help strong,
.lobby-help span {
  display: block;
}

.lobby-help strong {
  margin-bottom: 7px;
  color: var(--cream);
  font-size: 19px;
}

.lobby-help span {
  font-size: 12px;
  line-height: 1.6;
}

.human-room-controls {
  position: static;
  z-index: 1;
  margin-top: 15px;
  display: flex;
  justify-content: center;
}

.ready-button {
  min-width: 164px;
  height: 52px;
  padding: 0 18px 0 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(141, 240, 189, 0.52);
  border-radius: 999px;
  color: #063829;
  background: var(--mint);
  box-shadow: 0 9px 25px rgba(0, 28, 19, 0.34);
  font-size: 14px;
  font-weight: 750;
}

.ready-button:hover:not(:disabled) {
  background: #b0fbd7;
}

.ready-button.ready {
  border-color: rgba(230, 199, 125, 0.62);
  color: #4d3506;
  background: #f1d68f;
}

.ready-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--mint);
  background: #073a2b;
  font-size: 20px;
}

.ready-button.ready .ready-icon {
  color: var(--gold);
  background: #4d3506;
}

.own-hand-panel {
  width: var(--own-hand-panel-width, 760px);
  min-width: min(760px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  min-height: 214px;
  position: absolute;
  z-index: 28;
  bottom: var(--own-hand-panel-bottom);
  left: 50%;
  padding: 12px 13px 12px 16px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 196px;
  align-items: stretch;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(141, 240, 189, 0.04), transparent 30%),
    rgba(2, 39, 28, 0.92);
  box-shadow: 0 16px 44px rgba(0, 20, 14, 0.38);
  backdrop-filter: blur(13px);
  transform: translateX(-50%);
}

.own-hand-workspace {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.hand-scroll-hint {
  display: none;
}

.arrange-toolbar {
  min-height: 37px;
  padding: 0 8px 5px 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.arrange-toolbar > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.arrange-toolbar > div {
  display: flex;
  gap: 4px;
}

.arrange-toolbar button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  white-space: nowrap;
}

.arrange-toolbar button[aria-pressed="true"] {
  border-color: rgba(141, 240, 189, 0.52);
  color: #063829;
  background: var(--mint);
}

.arrange-toolbar button[aria-pressed="true"][data-variant-count]::after {
  min-width: 26px;
  margin-left: 6px;
  padding: 2px 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #dffdeb;
  background: rgba(4, 62, 44, 0.78);
  font-family: var(--mono);
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1;
  content: attr(data-variant-count);
}

.arrange-toolbar > .arrange-fixed-mode {
  min-height: 26px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(141, 240, 189, 0.48);
  border-radius: 999px;
  color: #063829;
  background: var(--mint);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.arrange-toolbar > small {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: #77998a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-hand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px 5px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.own-seat-identity {
  display: grid;
  grid-template-columns: 42px minmax(88px, 1fr) 62px;
  align-items: center;
  column-gap: 10px;
}

.own-seat-copy {
  min-width: 88px;
}

.own-seat-identity .own-turn-countdown {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  inset: auto;
  justify-self: end;
}

.own-finish-badge {
  min-width: 40px;
  min-height: 22px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(230, 199, 125, 0.72);
  border-radius: 999px;
  color: #4d3506;
  background: #f1d68f;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.own-finish-badge[hidden] {
  display: none;
}

.own-seat-identity .seat-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #173b30;
  background: var(--cream);
  font-family: var(--display);
  font-size: 16px;
}

.own-seat-identity strong,
.own-seat-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-seat-identity strong {
  color: var(--cream);
  font-size: 13px;
}

.own-seat-identity small {
  margin-top: 3px;
  color: #a8c8ba;
  font-size: 9px;
}

.own-hand-copy > .own-hand-remaining {
  color: var(--cream);
  font-size: 10px;
  font-weight: 600;
}

.own-hand-copy b {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}

.own-hand-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

.own-hand-list {
  --own-hand-natural-step: 75px;
  --own-hand-card-width: 74px;
  --own-hand-card-height: 108px;
  --own-hand-rank-reveal: 28px;
  --own-hand-min-step: 26px;
  --own-hand-group-step: var(--own-hand-natural-step);
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 164px;
  padding: 18px 12px 4px 20px;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  user-select: none;
  -webkit-user-select: none;
}

.own-meld-stack {
  width: var(--own-hand-group-step);
  min-width: var(--own-hand-group-step);
  position: relative;
  display: flex;
  flex: 0 0 var(--own-hand-group-step);
  flex-direction: column;
  align-items: flex-start;
  filter: drop-shadow(0 4px 5px rgba(0, 20, 14, 0.22));
}

.own-meld-stack:last-child {
  width: var(--own-hand-card-width);
  min-width: var(--own-hand-card-width);
  flex-basis: var(--own-hand-card-width);
}

.own-hand-list.wrapped-layout .own-meld-stack.row-end {
  width: var(--own-hand-card-width);
  min-width: var(--own-hand-card-width);
  flex-basis: var(--own-hand-card-width);
}

.own-meld-stack .hand-card-button,
.own-meld-stack .hand-card-button:last-child {
  width: 74px;
  height: var(--own-hand-card-height);
  flex: 0 0 var(--own-hand-card-height);
}

.own-meld-stack .hand-card-button + .hand-card-button {
  margin-top: calc(var(--own-hand-rank-reveal) - var(--own-hand-card-height));
}

.own-hand-list.fallback-layout {
  --own-hand-natural-step: 42px;
  gap: 0;
}

.own-hand-list.fallback-layout .own-meld-stack {
  width: var(--own-hand-group-step);
  min-width: var(--own-hand-group-step);
  flex-basis: var(--own-hand-group-step);
}

.own-hand-list.fallback-layout .own-meld-stack:last-child {
  width: var(--own-hand-card-width);
  min-width: var(--own-hand-card-width);
  flex-basis: var(--own-hand-card-width);
}

.own-hand-list.wrapped-layout {
  width: 100%;
  height: auto;
  min-height: 164px;
  flex-wrap: wrap;
  align-content: flex-start;
  row-gap: 14px;
}

.hand-card-button {
  width: 42px;
  height: var(--own-hand-card-height);
  flex: 0 0 42px;
  position: relative;
  overflow: visible;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  transition: filter 130ms ease;
}

.hand-card-button:last-child {
  width: 74px;
  flex-basis: 74px;
}

.hand-card-button:hover:not(:disabled) {
  z-index: auto;
  filter: brightness(1.08) drop-shadow(0 0 5px rgba(141, 240, 189, 0.42));
  transform: none;
}

.hand-card-button.selected {
  z-index: auto;
  filter: drop-shadow(0 0 8px rgba(141, 240, 189, 0.7));
  transform: none;
}

.own-hand-list.sweep-selecting .hand-card-button:hover:not(:disabled),
.own-hand-list.sweep-selecting .hand-card-button.selected {
  z-index: auto;
  transform: none;
  transition: none;
}

.hand-card-button.selected::after {
  content: "\2713";
  width: 24px;
  height: 24px;
  position: absolute;
  z-index: 5;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  border: 2px solid #e9fff4;
  border-radius: 50%;
  color: #063a2a;
  background: var(--mint);
  box-shadow: 0 3px 8px rgba(0, 26, 18, 0.36);
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
}

.hand-card-button:disabled {
  opacity: 0.9;
}

.hand-card-button .playing-card.hand {
  width: 74px;
  height: var(--own-hand-card-height);
  display: block;
  pointer-events: none;
}

.hand-card-button .playing-card.hand .card-corner b {
  font-size: 21px;
}

.hand-card-button .playing-card.hand .card-corner i {
  font-size: 16px;
}

.hand-card-button .playing-card.hand em {
  font-size: 38px;
}

.hand-card-button .playing-card.hand.joker .card-corner b {
  font-size: 14px;
}

.hand-card-button .card-level-mark {
  width: 20px;
  height: 20px;
  top: 4px;
  right: 4px;
  bottom: auto;
  left: auto;
  font-size: 13px;
}

.human-seat .playing-card.table .card-level-mark {
  width: 20px;
  height: 20px;
  top: auto;
  right: 4px;
  bottom: 4px;
  left: auto;
  font-size: 13px;
}

.action-dock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
  padding-left: 13px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.turn-hint {
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.action-dock > .play-action-buttons {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 7px;
}

.phase-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.phase-action-buttons button {
  min-height: 43px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.phase-action-secondary {
  border: 1px solid rgba(230, 199, 125, 0.42);
  color: var(--gold);
  background: rgba(230, 199, 125, 0.06);
}

.phase-action-primary {
  border: 1px solid rgba(141, 240, 189, 0.45);
  color: #063829;
  background: var(--mint);
}

.phase-action-primary:hover:not(:disabled) {
  background: #b0fbd7;
}

.pass-button,
.play-button {
  height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
}

.pass-button {
  border: 1px solid rgba(230, 199, 125, 0.42);
  color: var(--gold);
  background: rgba(230, 199, 125, 0.06);
  font-family: var(--serif);
}

.play-button {
  color: #063829;
  background: var(--mint);
}

.play-button:hover:not(:disabled) {
  background: #b0fbd7;
}

.action-dock.pending .turn-hint {
  color: var(--gold);
}

.result-banner {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  position: absolute;
  z-index: 41;
  top: 45%;
  left: 50%;
  overflow-y: auto;
  padding: 20px 26px;
  border: 1px solid rgba(230, 199, 125, 0.5);
  border-radius: 20px;
  color: var(--gold);
  background: rgba(3, 40, 29, 0.94);
  box-shadow: 0 20px 65px rgba(0, 20, 13, 0.46);
  backdrop-filter: blur(14px);
  text-align: center;
  transform: translate(-50%, -50%);
}

.result-banner > small,
.result-headline > strong,
.result-headline > span {
  display: block;
}

.result-headline > strong {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 23px;
}

.result-headline > span {
  width: max-content;
  margin: 9px auto 0;
  padding: 5px 11px;
  border: 1px solid rgba(141, 240, 189, 0.34);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(141, 240, 189, 0.07);
  font-size: 11px;
  font-weight: 750;
}

.result-round-meta {
  width: max-content;
  max-width: 100%;
  margin: 10px auto 0;
  color: #a9cbbd;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

.result-detail-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  text-align: left;
}

.result-detail-grid > section {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(0, 24, 17, 0.32);
}

.result-detail-grid h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.result-finish-order,
.result-seat-scores {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  list-style: none;
}

.result-finish-order li,
.result-seat-scores li {
  min-width: 0;
  min-height: 31px;
  padding: 5px 8px;
  display: grid;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
}

.result-finish-order li {
  grid-template-columns: 42px 54px minmax(0, 1fr);
}

.result-finish-order li > span {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 800;
}

.result-finish-order li > b,
.result-seat-scores li > b {
  font-family: var(--mono);
  font-size: 11px;
}

.result-finish-order li > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-seat-scores li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.result-seat-scores li > span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-seat-scores li.positive > b {
  color: var(--mint);
}

.result-seat-scores li.negative > b {
  color: #ff98a3;
}

.result-ready-button {
  min-width: 170px;
  height: 44px;
  margin: 16px auto 0;
  padding: 0 18px;
  border: 1px solid rgba(141, 240, 189, 0.52);
  border-radius: 999px;
  color: #063829;
  background: var(--mint);
  font-size: 13px;
  font-weight: 750;
}

.result-replay-link {
  width: max-content;
  min-height: 40px;
  margin: 16px auto 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(141, 240, 189, 0.48);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(141, 240, 189, 0.08);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.result-replay-link:hover {
  background: rgba(141, 240, 189, 0.16);
}

.result-replay-link[hidden] {
  display: none;
}

.result-replay-link:not([hidden]) + .result-ready-button {
  margin-top: 8px;
}

.result-ready-button.ready {
  border-color: rgba(230, 199, 125, 0.52);
  color: #4d3506;
  background: #f1d68f;
}

.series-result-overlay {
  position: absolute;
  z-index: 82;
  inset: 0;
  padding: 82px 116px 54px;
  display: grid;
  place-items: center;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 204, 91, 0.24), transparent 32%),
    linear-gradient(135deg, rgba(52, 7, 8, 0.96), rgba(4, 37, 29, 0.98) 48%, rgba(4, 25, 39, 0.98));
  backdrop-filter: blur(10px);
}

.series-result-overlay[hidden] {
  display: none;
}

.series-result-shell {
  width: min(1280px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 28px 34px 24px;
  border: 1px solid rgba(245, 211, 126, 0.54);
  border-radius: 28px;
  background: rgba(4, 28, 22, 0.78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  scrollbar-width: thin;
}

.series-result-header {
  text-align: center;
}

.series-result-header small {
  color: #f7d88c;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.series-result-header h1 {
  margin: 5px 0 2px;
  color: #fff2bf;
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  text-shadow: 0 5px 22px rgba(246, 174, 45, 0.42);
}

.series-result-header p,
.series-result-meta {
  margin: 8px 0 0;
  color: #dcbf7b;
  font-weight: 750;
}

.series-last-round-meta {
  width: min(620px, 100%);
  margin: 14px auto 0;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(245, 211, 126, 0.28);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.series-last-round-meta[hidden] {
  display: none;
}

.series-last-round-meta > strong {
  color: var(--mint);
  font-size: 15px;
}

.series-last-round-meta.lost > strong {
  color: #f2b2a9;
}

.series-last-round-meta > span {
  color: var(--cream);
  font-size: 12px;
}

.series-last-round-meta > small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 750;
}

.series-team-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.series-versus {
  display: grid;
  place-items: center;
  color: rgba(255, 241, 193, 0.68);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
}

.series-team-card {
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
}

.series-team-card.winner {
  border: 1px solid rgba(255, 204, 91, 0.72);
  background: linear-gradient(145deg, rgba(173, 39, 35, 0.9), rgba(93, 20, 19, 0.88));
  box-shadow: inset 0 0 32px rgba(255, 192, 75, 0.16);
}

.series-team-card.loser {
  border: 1px solid rgba(114, 173, 218, 0.54);
  background: linear-gradient(145deg, rgba(31, 87, 134, 0.84), rgba(18, 48, 78, 0.88));
}

.series-team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.series-team-heading span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.series-team-heading strong {
  color: #fff1b0;
  font-size: 16px;
}

.series-player-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.series-player-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(0, 12, 10, 0.22);
}

.series-player-card > div span,
.series-player-card > div strong {
  display: block;
}

.series-player-card > div span {
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--mono);
  font-size: 10px;
}

.series-player-card > div strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-player-card dl {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  font-size: 11px;
}

.series-player-card dt {
  color: rgba(255, 255, 255, 0.68);
}

.series-player-card dd {
  margin: 0;
  color: #fff3bd;
  font-family: var(--mono);
  font-weight: 900;
}

.series-result-meta {
  text-align: center;
  font-size: 12px;
}

.series-result-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.series-result-actions button {
  min-width: 150px;
  height: 44px;
  border: 1px solid rgba(230, 199, 125, 0.48);
  border-radius: 999px;
  color: #f6d989;
  background: rgba(230, 199, 125, 0.08);
  font-weight: 800;
}

.series-result-actions button.primary {
  color: #4b3103;
  background: linear-gradient(180deg, #ffe5a2, #e9b94f);
}

.series-result-actions button.ready {
  color: #063829;
  background: var(--mint);
}

.series-replay-list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.series-replay-list[hidden] {
  display: none;
}

.series-replay-list a {
  padding: 7px 11px;
  border: 1px solid rgba(141, 240, 189, 0.3);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(141, 240, 189, 0.06);
  font-size: 10px;
  text-decoration: none;
}

@media (max-aspect-ratio: 4 / 3) {
  :where(html:not(.fixed-aspect-table)) .series-result-overlay {
    padding-inline: 54px;
  }
}

.result-banner > small {
  color: var(--muted);
  font-size: 11px;
}

.entry-panel {
  width: min(510px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  position: fixed;
  z-index: 70;
  top: 50%;
  left: 50%;
  overflow-y: auto;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(141, 240, 189, 0.06), transparent 27%),
    #071d16;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.54);
  scrollbar-color: rgba(141, 240, 189, 0.22) transparent;
  scrollbar-width: thin;
  transform: translate(-50%, -50%);
}

.entry-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.entry-brand h1,
.entry-brand small {
  margin: 0;
  display: block;
}

.entry-brand small {
  margin-bottom: 5px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.entry-brand h1 {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.2;
}

.entry-panel > p {
  margin: 17px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.recent-table-card {
  min-height: 72px;
  margin: 0 0 14px;
  padding: 11px 12px 11px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(230, 199, 125, 0.34);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(230, 199, 125, 0.11), rgba(141, 240, 189, 0.06));
}

.recent-table-card[hidden] {
  display: none;
}

.recent-table-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.recent-table-card small {
  color: var(--gold);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.recent-table-card strong {
  color: var(--cream);
  font-size: 17px;
}

.recent-table-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-table-card button {
  min-width: 112px;
  min-height: 46px;
  padding-inline: 16px;
  border-radius: 12px;
  color: #063829;
  background: var(--mint);
  font-size: 14px;
  font-weight: 800;
}

.entry-tabs {
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.entry-tabs button {
  height: 40px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.entry-tabs button[aria-selected="true"] {
  color: #063829;
  background: var(--mint);
}

.entry-form {
  margin-top: 18px;
}

.fixed-game-identity {
  margin: 0 0 15px;
  padding: 13px 2px;
  display: grid;
  grid-template-columns: auto 1px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  border-block: 1px solid rgba(141, 240, 189, 0.18);
}

.fixed-game-brand {
  min-width: 86px;
}

.fixed-game-origin,
.fixed-game-model {
  display: block;
}

.fixed-game-origin {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.fixed-game-model {
  margin-top: 2px;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.05;
}

.fixed-game-divider {
  width: 1px;
  height: 34px;
  background: rgba(230, 199, 125, 0.28);
}

.fixed-game-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.fixed-game-name {
  color: var(--cream);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.fixed-game-native {
  color: var(--mint);
  font-size: 11px;
}

.fixed-game-seats {
  padding: 5px 9px;
  border: 1px solid rgba(141, 240, 189, 0.2);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(141, 240, 189, 0.06);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.human-game-switch,
.human-slot-switch {
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.human-game-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.human-game-switch legend,
.human-slot-switch legend,
.entry-field > span {
  margin-bottom: 8px;
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.human-game-switch legend {
  grid-column: 1 / -1;
}

.human-game-switch input,
.human-slot-switch input {
  position: absolute;
  opacity: 0;
}

.human-game-switch label {
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
}

.human-game-switch label strong {
  color: var(--cream);
  font-size: 14px;
}

.human-game-switch label small {
  font-size: 10px;
}

.human-game-switch input:checked + label,
.human-slot-switch input:checked + label {
  border-color: rgba(141, 240, 189, 0.48);
  color: var(--mint);
  background: rgba(141, 240, 189, 0.065);
}

.human-slot-switch > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.human-slot-switch label {
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 12px;
}

.entry-field {
  margin-top: 13px;
  display: block;
}

.entry-field > span small {
  color: #708f81;
}

.entry-field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  color: var(--cream);
  background: #0a291f;
  font-size: 14px;
}

.entry-field input::placeholder {
  color: #708b7f;
}

.entry-submit {
  width: 100%;
  height: 52px;
  margin-top: 18px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 11px;
  color: #063829;
  background: var(--mint);
  font-size: 15px;
  font-weight: 750;
}

.entry-submit:hover:not(:disabled) {
  background: #b0fbd7;
}

/* Secondary entry action: watch a table without taking a seat. Quieter than
   the primary submit so it does not compete with joining. */
.entry-secondary {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  padding: 0 17px;
  border: 1px solid rgba(141, 240, 189, 0.34);
  border-radius: 11px;
  color: var(--mint);
  background: rgba(141, 240, 189, 0.08);
  font-size: 13px;
  font-weight: 650;
}

.entry-secondary:hover:not(:disabled) {
  background: rgba(141, 240, 189, 0.16);
}

.entry-secondary:disabled {
  opacity: 0.55;
}

.join-note {
  margin: 12px 1px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.action-dialog {
  width: min(540px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  color: var(--white);
  background: #071d16;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.56);
}

.action-dialog::backdrop {
  background: rgba(0, 17, 11, 0.66);
  backdrop-filter: blur(4px);
}

.action-dialog > form {
  padding: 20px;
}

.action-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.action-dialog header small,
.action-dialog header strong {
  display: block;
}

.action-dialog header small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.action-dialog header strong {
  font-size: 18px;
}

.action-dialog header > button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 23px;
}

.action-choice-list {
  margin-top: 17px;
  display: grid;
  gap: 8px;
}

.action-choice-list button {
  min-height: 54px;
  padding: 9px 13px;
  border: 1px solid rgba(141, 240, 189, 0.22);
  border-radius: 11px;
  color: var(--cream);
  background: rgba(141, 240, 189, 0.04);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.action-choice-list button:hover {
  border-color: rgba(141, 240, 189, 0.55);
  background: rgba(141, 240, 189, 0.1);
}

.dialog-cancel {
  width: 100%;
  height: 42px;
  margin-top: 13px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
}

.rules-dialog {
  width: min(700px, calc(100vw - 32px));
}

.rules-dialog-body {
  max-height: min(60vh, 520px);
  margin-top: 18px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  scrollbar-color: rgba(141, 240, 189, 0.24) transparent;
  scrollbar-width: thin;
}

.rules-dialog-body section {
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.rules-dialog-body h2,
.rules-dialog-body p {
  margin: 0;
}

.rules-dialog-body h2 {
  color: var(--gold);
  font-size: 13px;
}

.rules-dialog-body p {
  margin-top: 7px;
  color: #c0d9ce;
  font-size: 11px;
  line-height: 1.7;
}

.rules-dialog-body .rules-note {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 10px 13px;
  border: 1px solid rgba(141, 240, 189, 0.22);
  border-radius: 11px;
  color: var(--mint);
  background: rgba(141, 240, 189, 0.05);
}

.human-toast-stack {
  z-index: 130;
  bottom: 24px;
}

.human-toast-stack .toast {
  font-size: 12px;
}

@media (max-width: 1280px), (max-height: 820px) {
  :where(html:not(.fixed-aspect-table)) .human-table-stage {
    --own-hand-panel-bottom: 16px;
    --bottom-seat-baseline: 192px;
    min-height: max(680px, calc(490px + var(--own-hand-panel-height, 0px)));
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-top {
    top: 122px;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-left,
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-right {
    top: 45%;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-left {
    left: 18px;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-right {
    right: 18px;
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-panel {
    min-height: 190px;
    grid-template-columns: 80px minmax(0, 1fr) 174px;
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-list {
    --own-hand-natural-step: 66px;
    --own-hand-card-width: 65px;
    --own-hand-card-height: 94px;
    --own-hand-rank-reveal: 26px;
    height: auto;
    min-height: 136px;
    padding-top: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-list.wrapped-layout {
    min-height: 136px;
  }
  :where(html:not(.fixed-aspect-table)) .hand-card-button {
    width: 36px;
    height: var(--own-hand-card-height);
    flex-basis: 36px;
  }
  :where(html:not(.fixed-aspect-table)) .hand-card-button:last-child {
    width: 65px;
    flex-basis: 65px;
  }
  :where(html:not(.fixed-aspect-table)) .hand-card-button .playing-card.hand {
    width: 65px;
    height: var(--own-hand-card-height);
  }
  :where(html:not(.fixed-aspect-table)) .own-meld-stack {
    width: var(--own-hand-group-step);
    min-width: var(--own-hand-group-step);
    flex-basis: var(--own-hand-group-step);
  }
  :where(html:not(.fixed-aspect-table)) .own-meld-stack:last-child {
    width: var(--own-hand-card-width);
    min-width: var(--own-hand-card-width);
    flex-basis: var(--own-hand-card-width);
  }
  :where(html:not(.fixed-aspect-table)) .own-meld-stack .hand-card-button {
    width: 65px;
    height: var(--own-hand-card-height);
    flex: 0 0 var(--own-hand-card-height);
  }
  :where(html:not(.fixed-aspect-table)) .own-meld-stack .hand-card-button + .hand-card-button {
    margin-top: calc(var(--own-hand-rank-reveal) - var(--own-hand-card-height));
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-list.fallback-layout {
    --own-hand-natural-step: 36px;
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-list.fallback-layout .own-meld-stack {
    width: var(--own-hand-group-step);
    min-width: var(--own-hand-group-step);
    flex-basis: var(--own-hand-group-step);
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-list.fallback-layout .own-meld-stack:last-child {
    width: var(--own-hand-card-width);
    min-width: var(--own-hand-card-width);
    flex-basis: var(--own-hand-card-width);
  }
  :where(html:not(.fixed-aspect-table)) .arrange-toolbar > small {
    display: none;
  }

}

@media (max-width: 1024px) {
  :where(html:not(.fixed-aspect-table)) .human-play-app {
    overflow-x: hidden;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage.table-stage {
    width: 100vw;
    min-width: 0;
  }
  :where(html:not(.fixed-aspect-table)) .human-seat.seat-left .seat-play-area {
    top: 140px;
    left: 0;
  }
  :where(html:not(.fixed-aspect-table)) .human-seat.seat-right .seat-play-area {
    top: 140px;
    right: 0;
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-panel {
    left: 12px;
    width: var(--own-hand-panel-width, 760px);
    max-width: calc(100vw - 24px);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .result-banner {
    left: 12px;
    width: calc(100vw - 24px);
    transform: translateY(-50%);
  }
}

@media (max-width: 760px) {
  :where(html:not(.fixed-aspect-table)) .human-table-stage.table-stage {
    --bottom-seat-baseline: 42px;
    --bottom-seat-gap: 26px;
    height: max(100vh, calc(1120px + var(--own-hand-panel-height, 0px)));
    min-height: calc(1120px + var(--own-hand-panel-height, 0px));
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat {
    width: min(330px, calc(100vw - 24px));
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat .player-tag {
    width: 100%;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-left {
    top: 390px;
    left: 12px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-right {
    top: 650px;
    right: 12px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-seat.seat-left .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-seat.seat-right .seat-play-area {
    top: 140px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-top .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-bottom .seat-play-area {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .human-topbar {
    right: 14px;
    left: 14px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage[data-game] .human-seat.seat-top {
    top: 180px;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-center {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .back-to-spectator span,
  :where(html:not(.fixed-aspect-table)) .topbar-review-link span,
  :where(html:not(.fixed-aspect-table)) .connection-chip span {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .back-to-spectator,
  :where(html:not(.fixed-aspect-table)) .topbar-review-link {
    width: 42px;
    padding: 0;
    justify-content: center;
  }
  :where(html:not(.fixed-aspect-table)) .room-identity {
    min-width: 0;
    padding-right: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .room-status-strip {
    width: calc(100vw - 24px);
    height: 32px;
    min-height: 32px;
    padding: 4px;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    font-size: 9px;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .room-status-strip > * {
    flex: 0 0 auto;
  }
  :where(html:not(.fixed-aspect-table)) .room-status-strip > button,
  :where(html:not(.fixed-aspect-table)) .room-status-strip > a {
    height: 22px;
    padding: 0 5px;
    font-size: 9px;
  }
  :where(html:not(.fixed-aspect-table)) #copyTableBtn {
    width: 24px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }
  :where(html:not(.fixed-aspect-table)) #copyTableBtn svg {
    width: 12px;
    height: 12px;
    color: var(--cream);
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-panel {
    left: 12px;
    width: calc(100vw - 24px);
    min-width: 0;
    max-width: calc(100vw - 24px);
    grid-template-columns: minmax(0, 1fr);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .own-hand-copy {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-table-stage.own-hand-visible:not(.spectator-view) .human-seat.seat-bottom .player-tag {
    display: flex;
  }
  :where(html:not(.fixed-aspect-table)) .action-dock {
    padding: 8px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
  }
  :where(html:not(.fixed-aspect-table)) .rule-badge-strip {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .guandan-level-hud {
    width: calc(100vw - 24px);
    min-width: 0;
    top: 116px;
    left: 12px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .guandan-level-hud > strong {
    flex: 1 1 auto;
    font-size: 10px;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .guandan-level-hud > div {
    flex: 0 0 auto;
    margin-top: 0;
    gap: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .guandan-level-hud span {
    min-width: 70px;
    height: 25px;
    padding: 0 6px;
  }
  :where(html:not(.fixed-aspect-table)) .doudizhu-status-panel {
    width: calc(100vw - 24px);
    top: 158px;
    left: 12px;
    display: block;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .doudizhu-status-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  :where(html:not(.fixed-aspect-table)) .doudizhu-status-panel > p {
    margin-top: 8px;
    padding-top: 7px;
  }
  :where(html:not(.fixed-aspect-table)) .doudizhu-status-panel > .doudizhu-multiplier-trail {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
  }
  :where(html:not(.fixed-aspect-table)) .doudizhu-bottom-row {
    margin-top: 8px;
    padding-top: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .connection-freeze {
    max-width: calc(100vw - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  :where(html:not(.fixed-aspect-table)) .arrange-toolbar {
    height: auto;
    flex-wrap: wrap;
    overflow: visible;
  }
  :where(html:not(.fixed-aspect-table)) .arrange-toolbar > div {
    flex-wrap: wrap;
  }
  :where(html:not(.fixed-aspect-table)) .result-detail-grid {
    grid-template-columns: 1fr;
  }
  :where(html:not(.fixed-aspect-table)) .rules-dialog-body {
    grid-template-columns: 1fr;
  }
  :where(html:not(.fixed-aspect-table)) .rules-dialog-body .rules-note {
    grid-column: 1;
  }
}

/* Initial boot and room restoration share an unscaled, accessible status view. */
.page-boot-status { display: none; }
html[data-page-boot="loading"] .human-play-app,
html[data-page-boot="restoring"] .human-play-app,
html[data-page-boot="error"] .human-play-app { visibility: hidden; }
html[data-page-boot="loading"] .page-boot-status,
html[data-page-boot="restoring"] .page-boot-status,
html[data-page-boot="error"] .page-boot-status {
  visibility: visible; /* Status stays visible inside the hidden fullscreen app. */
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--cream);
  background: var(--felt-deep);
}
.page-boot-content { max-width: 420px; text-align: center; }
.page-boot-content img { max-width: 100%; object-fit: contain; }
.page-boot-content strong { display: block; margin: 28px 0 12px; font-size: 32px; }
.page-boot-content p { margin: 12px 0; color: var(--muted); line-height: 1.6; }
.page-boot-loading, .page-boot-restoring, .page-boot-error { display: none; }
html[data-page-boot="loading"] .page-boot-loading,
html[data-page-boot="restoring"] .page-boot-restoring,
html[data-page-boot="error"] .page-boot-error { display: block; }
.page-boot-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.page-boot-retry:hover { background: var(--cream); }
.page-boot-retry:focus-visible { outline: 3px solid var(--cream); outline-offset: 4px; }
.page-boot-noscript { margin: 24px; color: var(--cream); line-height: 1.6; }
.entry-panel > .entry-restore-message { color: var(--hand-warning); }

/* Keep the fixed viewport authoritative after the legacy compact media rules. */
.human-fixed-viewport {
  overflow: hidden;
}

.human-fixed-viewport .human-play-app {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.human-fixed-viewport .own-hand-panel {
  grid-template-columns: 232px minmax(0, 1fr) 196px;
}

.human-fixed-viewport .human-table-stage {
  width: 1600px;
  height: 900px;
  min-width: 1600px;
  min-height: 900px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(var(--human-table-scale, 1));
  transform-origin: center center;
}

.human-fixed-viewport .human-table-stage[data-game] .human-seat.seat-left .seat-play-area {
  top: 0;
  left: 260px;
  right: auto;
  transform: none;
}

.human-fixed-viewport .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
  top: 0;
  right: 260px;
  left: auto;
  transform: none;
}

.human-fixed-viewport .human-seat.seat-top .opponent-hand,
.human-fixed-viewport .human-seat.seat-top .spectator-hand {
  left: calc(50% - 100px);
  right: auto;
  transform: translateX(-50%);
}

.human-fixed-viewport .human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
  top: 135px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.human-fixed-viewport .human-table-stage[data-game] .human-seat.seat-bottom .seat-play-area {
  bottom: 0;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

/* A spectator sees the complete public hands, so give those seats the same
   working canvas as the replay template. Player mode keeps the compact
   interactive seat boxes above. */
.human-fixed-viewport .human-table-stage.spectator-view .human-seat.seat-top {
  width: 960px;
  height: 282px;
}

.human-fixed-viewport .human-table-stage.spectator-view .human-seat.seat-bottom {
  width: 1040px;
  height: 310px;
}

.human-fixed-viewport .human-table-stage.spectator-view .human-seat.seat-left,
.human-fixed-viewport .human-table-stage.spectator-view .human-seat.seat-right {
  width: 350px;
  height: 620px;
}

/* The replay page animates committed actions and its clock as independent
   visual layers. Live human seats use the same classes/animations, while the
   clock is deliberately placed in the empty lane beside each identity pill
   instead of over a hand or a played card. */
.human-seat.play-entering .play-cards {
  transform-origin: 50% 50%;
  will-change: opacity, transform, filter;
  animation: played-action-arrive 580ms cubic-bezier(0.15, 0.86, 0.24, 1.18) both;
}

.human-seat.play-entering.passed .play-label {
  transform-origin: 50% 50%;
  will-change: opacity, transform, filter;
  animation: played-pass-arrive 520ms cubic-bezier(0.15, 0.86, 0.24, 1.14) both;
}

/* Match replay semantics: once a seat owns the next decision, its previous
   trick is no longer part of the active table. The new turn clock occupies
   that visual layer instead. */
.human-fixed-viewport .human-seat.current-actor .play-label,
.human-fixed-viewport .human-seat.current-actor .play-cards {
  display: none;
}

/* The arranged replay hand needs a real hand-zone in live spectator mode;
   these anchors keep its four compact layouts away from the identity pills
   and the independent play lanes at the fixed 1600x900 scale. */
.human-fixed-viewport .human-seat.seat-top .spectator-hand {
  top: 64px;
  left: calc(50% - 100px);
  right: auto;
  height: 214px;
  margin-top: 0;
  padding: 4px 0;
  transform: translateX(-50%);
}

.human-fixed-viewport .human-seat.seat-bottom .spectator-hand {
  bottom: 70px;
  left: calc(50% - 260px);
  top: auto;
  height: 242px;
  margin-top: 0;
  padding: 4px 0;
  transform: translateX(-50%);
}

.human-fixed-viewport .human-seat.seat-left .spectator-hand {
  top: 67px;
  left: 10px;
  width: 100%;
  height: 538px;
  margin-top: 0;
  padding: 8px 14px;
}

.human-fixed-viewport .human-seat.seat-right .spectator-hand {
  top: 67px;
  right: 10px;
  left: auto;
  width: 100%;
  height: 538px;
  margin-top: 0;
  padding: 8px 14px;
}

/* Solo product readability pass. The full arena keeps its original compact
   density; only the standalone single-human product receives these larger
   identity and status controls. */
.solo-player-arena .room-identity {
  min-width: 420px;
  height: 64px;
  padding: 8px 24px 8px 10px;
  gap: 14px;
}

.solo-player-arena .room-identity strong {
  font-size: 22px;
}

.solo-player-arena .room-identity small {
  margin-top: 4px;
  font-size: 14px;
}

.solo-player-arena .connection-chip {
  height: 42px;
  padding: 0 16px;
  font-size: 15px;
}

.solo-player-arena .solo-topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.solo-player-arena .solo-topbar-tools .connection-chip {
  margin-left: 0;
}

.solo-player-arena .solo-language-switch {
  height: 42px;
  padding: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(2, 43, 30, 0.82);
  box-shadow: 0 8px 24px rgba(0, 23, 16, 0.2);
}

.solo-player-arena .solo-language-switch button {
  min-width: 52px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.solo-player-arena .solo-language-switch button:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
}

.solo-player-arena .solo-language-switch button.active {
  color: #073b2c;
  background: var(--mint);
}

.solo-player-arena .room-status-strip {
  height: 48px;
  top: 86px;
  padding: 0 11px 0 16px;
  gap: 12px;
  font-size: 16px;
}

.solo-player-arena .room-status-strip > b {
  height: 30px;
  padding: 0 11px;
  font-size: 14px;
}

.solo-player-arena .room-status-strip > button,
.solo-player-arena .room-status-strip > a {
  min-height: 31px;
  padding: 0 11px;
  font-size: 14px;
}

.solo-player-arena .guandan-level-hud {
  min-width: 286px;
  top: 137px;
  padding: 13px 14px;
  border-radius: 17px;
}

.solo-player-arena .guandan-level-hud > strong {
  font-size: 19px;
}

.solo-player-arena .guandan-level-hud > div {
  margin-top: 10px;
  gap: 8px;
}

.solo-player-arena .guandan-level-hud span {
  min-width: 119px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.solo-player-arena .guandan-level-hud span b {
  font-size: 19px;
}

.solo-player-arena .rule-badge-strip {
  width: 338px;
  top: 245px;
  gap: 7px;
}

.solo-player-arena .rule-badge-strip span {
  min-height: 30px;
  padding: 0 11px;
  font-size: 13px;
}

.solo-player-arena .human-table-stage[data-game] .human-seat {
  width: 370px;
  height: 180px;
}

.solo-player-arena .human-seat .player-tag {
  width: 178px;
  height: 116px;
  padding: 7px 8px 8px;
  gap: 3px;
  border-radius: 15px;
}

.solo-player-arena .human-seat .seat-number {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  font-size: 21px;
}

.solo-player-arena .human-seat .player-name {
  font-size: 18px;
  line-height: 21px;
}

.solo-player-arena .human-seat .player-role {
  font-size: 13px;
  line-height: 17px;
}

.solo-player-arena .human-seat .hand-count {
  font-size: 16px;
}

.solo-player-arena .ready-mark {
  min-width: 44px;
  height: 24px;
  top: 7px;
  right: 5px;
  padding: 0 6px;
  font-size: 10px;
}

.solo-player-arena .opponent-hand {
  width: 190px;
  height: 78px;
  padding-left: 44px;
}

.solo-player-arena .opponent-hand .card-back {
  width: 55px;
  height: 78px;
  margin-left: -44px;
}

.solo-player-arena .opponent-hand-count {
  padding: 4px 8px;
  font-size: 13px;
}

.solo-player-arena .human-seat.seat-left .opponent-hand,
.solo-player-arena .human-seat.seat-right .opponent-hand {
  top: 116px;
}

.solo-player-arena .human-seat.seat-top .opponent-hand {
  top: 73px;
}

.solo-player-arena .own-hand-panel {
  grid-template-columns: 270px minmax(0, 1fr) 220px;
  min-height: 236px;
  padding: 15px 16px 15px 19px;
  gap: 12px;
}

.solo-player-arena .own-seat-identity {
  grid-template-columns: 50px minmax(118px, 1fr) 68px;
  column-gap: 12px;
}

.solo-player-arena .own-seat-copy {
  min-width: 118px;
}

.solo-player-arena .own-seat-identity .seat-number {
  width: 50px;
  height: 50px;
  font-size: 20px;
}

.solo-player-arena .own-seat-identity strong {
  font-size: 19px;
}

.solo-player-arena .own-seat-identity small {
  font-size: 14px;
}

.solo-player-arena .own-hand-copy > .own-hand-remaining {
  font-size: 14px;
}

.solo-player-arena .own-hand-copy b {
  font-size: 12px;
}

.solo-player-arena .own-hand-copy .turn-countdown-value {
  color: #321008;
  font-size: 28px;
  font-weight: 950;
  -webkit-text-stroke: 0.8px #321008;
  text-shadow: 0 1px 1px rgba(44, 9, 4, 0.28);
}

.solo-player-arena .arrange-toolbar {
  min-height: 50px;
  padding: 0 10px 7px 6px;
  gap: 10px;
}

.solo-player-arena .arrange-toolbar > span {
  font-size: 14px;
}

.solo-player-arena .arrange-toolbar > div {
  gap: 6px;
}

.solo-player-arena .arrange-toolbar button,
.solo-player-arena .arrange-toolbar > .arrange-fixed-mode {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.solo-player-arena .arrange-toolbar > small {
  font-size: 11px;
}

/* Solo entry keeps both create and resume paths readable at the fixed table
   scale.  The two tabs are intentionally equal-width so neither disappears
   when Chinese or English labels are active. */
.solo-player-arena .entry-panel {
  width: min(600px, calc(100vw - 40px));
  padding: 31px;
}

.solo-player-arena .entry-brand h1 {
  font-size: 29px;
}

.solo-player-arena .entry-brand small {
  font-size: 11px;
}

.solo-player-arena .entry-panel > p {
  margin: 20px 0;
  font-size: 15px;
}

.solo-player-arena .entry-tabs button {
  height: 50px;
  padding-inline: 12px;
  font-size: 16px;
}

.solo-player-arena .fixed-game-identity {
  min-height: 70px;
  padding-block: 15px;
  gap: 18px;
}

.solo-player-arena .fixed-game-origin {
  font-size: 10px;
}

.solo-player-arena .fixed-game-model {
  font-size: 22px;
}

.solo-player-arena .fixed-game-name {
  font-size: 16px;
}

.solo-player-arena .fixed-game-native {
  font-size: 13px;
}

.solo-player-arena .fixed-game-seats {
  padding: 6px 11px;
  font-size: 12px;
}

.solo-player-arena .human-game-switch legend,
.solo-player-arena .human-slot-switch legend,
.solo-player-arena .entry-field > span {
  font-size: 14px;
}

.solo-player-arena .human-game-switch label {
  height: 70px;
}

.solo-player-arena .human-game-switch label strong {
  font-size: 17px;
}

.solo-player-arena .human-game-switch label small,
.solo-player-arena .join-note {
  font-size: 13px;
}

.solo-player-arena .entry-field input {
  height: 56px;
  font-size: 17px;
}

.solo-player-arena .entry-submit {
  height: 60px;
  font-size: 18px;
}

/* A round result is a compact acknowledgement, not a second dashboard.  The
   table already shows team levels in the persistent level HUD, so the modal
   retains only finish order and the next-round control. */
.solo-player-arena .result-banner {
  width: min(500px, calc(100vw - 40px));
  max-height: min(320px, calc(100vh - 48px));
  top: 45%;
  padding: 14px 18px;
  border-radius: 16px;
}

.solo-player-arena .result-headline > strong {
  margin-top: 4px;
  font-size: 20px;
}

.solo-player-arena .result-headline > span,
.solo-player-arena .result-round-meta {
  margin-top: 6px;
}

.solo-player-arena .result-round-meta {
  margin-top: 9px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 3px 12px;
  border: 1px solid rgba(141, 240, 189, 0.22);
  border-radius: 12px;
  background: rgba(141, 240, 189, 0.055);
}

.solo-player-arena .result-round-meta[hidden] {
  display: none;
}

.solo-player-arena .result-round-meta > strong {
  grid-row: 1 / 3;
  color: var(--mint);
  font-size: 20px;
  white-space: nowrap;
}

.solo-player-arena .result-round-meta.lost > strong {
  color: #f2b2a9;
}

.solo-player-arena .result-round-meta > span {
  color: var(--cream);
  font-size: 12px;
}

.solo-player-arena .result-round-meta > small {
  grid-row: 1 / 3;
  grid-column: 3;
  color: var(--gold);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.solo-player-arena .result-detail-grid {
  margin-top: 9px;
  grid-template-columns: 1fr;
}

.solo-player-arena .result-detail-grid > section {
  padding: 9px;
}

.solo-player-arena .result-detail-grid h2 {
  margin-bottom: 6px;
}

.solo-player-arena .result-finish-order {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.solo-player-arena .result-finish-order li {
  min-height: 27px;
  padding: 4px 7px;
  grid-template-columns: 38px 48px minmax(0, 1fr);
  gap: 5px;
}

.solo-player-arena .result-ready-button {
  height: 40px;
  margin-top: 10px;
}

/* Settlement is a separate read-only presentation state.  Do not inherit the
   replay renderer's 88x124 side cards or 108x152 bottom cards: those sizes are
   designed for a full-screen spectator canvas and overflow the compact human
   table.  All four seats use exactly the same footprint as committed cards. */
.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand {
  overflow: visible;
}

/* Give settlement its own four clear reveal lanes.  The normal player-mode
   baselines reserve space for the interactive hand panel (which is hidden at
   settlement) and otherwise put the top/bottom hands underneath the compact
   result card. */
.solo-player-arena .round-terminal.human-table-stage[data-game] .human-seat.seat-top {
  top: 76px;
}

.solo-player-arena .round-terminal.human-table-stage[data-game] .human-seat.seat-bottom {
  bottom: 0;
}

.solo-player-arena .round-terminal .human-seat.seat-bottom .spectator-hand {
  left: 50%;
  transform: translateX(-50%);
}

.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand .playing-card.hand {
  width: 54px;
  height: 76px;
  border-radius: 5px;
}

.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand .playing-card.hand .card-corner {
  top: 3px;
  left: 3px;
}

.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand .playing-card.hand .card-corner b {
  font-size: 17px;
}

.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand .playing-card.hand .card-corner i {
  font-size: 13px;
}

.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand .playing-card.hand em {
  right: 3px;
  bottom: 3px;
  font-size: 27px;
}

.solo-player-arena .round-terminal .human-seat.terminal-reveal .spectator-hand .playing-card.hand.joker .card-corner b {
  font-size: 12px;
}

/* Top and bottom keep Pailemen-style vertical meld columns, but use one fixed
   20px rank reveal regardless of group size or density. */
.solo-player-arena .round-terminal .human-seat:is(.seat-top, .seat-bottom) .spectator-hand .meld-stack,
.solo-player-arena .round-terminal .human-seat:is(.seat-top, .seat-bottom) .spectator-hand .hand-layout.dense .meld-stack,
.solo-player-arena .round-terminal .human-seat:is(.seat-top, .seat-bottom) .spectator-hand .hand-layout.very-dense .meld-stack,
.solo-player-arena .round-terminal .human-seat:is(.seat-top, .seat-bottom) .spectator-hand .meld-stack:has(.playing-card.joker),
.solo-player-arena .round-terminal .human-seat:is(.seat-top, .seat-bottom) .spectator-hand .meld-stack:has(.playing-card.level-card) {
  width: 54px;
  min-width: 54px;
  flex: 0 0 54px;
}

.solo-player-arena .round-terminal .human-seat:is(.seat-top, .seat-bottom) .spectator-hand .meld-stack .playing-card + .playing-card {
  margin-top: -56px !important;
}

/* Left and right retain horizontal meld rows.  The previous 72/88px cards
   sat under the identity box and were visibly larger than every table card. */
.solo-player-arena .round-terminal .human-seat:is(.seat-left, .seat-right) .spectator-hand {
  top: 98px;
  margin-top: 0;
  padding-top: 24px;
}

.solo-player-arena .round-terminal .human-seat:is(.seat-left, .seat-right) .spectator-hand .meld-stack,
.solo-player-arena .round-terminal .human-seat:is(.seat-left, .seat-right) .spectator-hand .hand-layout.dense .meld-stack,
.solo-player-arena .round-terminal .human-seat:is(.seat-left, .seat-right) .spectator-hand .hand-layout.very-dense .meld-stack {
  max-height: 28px;
  flex: 1 1 28px;
}

.solo-player-arena .round-terminal .human-seat:is(.seat-left, .seat-right) .spectator-hand .meld-stack:last-child {
  height: 76px;
  min-height: 76px;
  max-height: 76px;
  flex: 0 0 76px;
}

.solo-player-arena .round-terminal .human-seat:is(.seat-left, .seat-right) .spectator-hand .meld-stack .playing-card + .playing-card {
  margin-top: 0 !important;
  margin-left: -34px !important;
}

.solo-player-arena .terminal-hand-count {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 14px;
  padding: 3px 8px;
  border: 1px solid rgba(141, 240, 189, 0.35);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(1, 35, 25, 0.94);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.solo-player-arena .round-terminal .human-seat.seat-right .terminal-hand-count {
  right: 14px;
  left: auto;
}

/* Solo phone layout */
@media (max-width: 760px) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena {
    min-width: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-play-app {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-hand-panel-bottom: max(8px, env(safe-area-inset-bottom));
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    position: fixed;
    inset: 0;
    transform: none;
    transform-origin: center;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar {
    min-height: 54px;
    top: max(8px, env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    grid-template-areas:
      "brand tools"
      "room room";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar-actions {
    min-width: 0;
    grid-area: brand;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-brand-lockup {
    width: min(202px, 54vw);
    height: 38px;
    margin: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-topbar-tools {
    grid-area: tools;
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-language-switch {
    height: 48px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-language-switch button {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0 8px;
    font-size: 12px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .connection-chip {
    width: auto;
    min-width: 76px;
    height: 44px;
    padding: 0 10px;
    justify-content: center;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .connection-chip span {
    display: inline;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-identity {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 6px 12px 6px 7px;
    grid-area: room;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-identity strong {
    font-size: 16px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-identity small {
    margin-top: 1px;
    font-size: 11px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-panel {
    width: calc(100% - 24px);
    max-height: calc(100% - 112px - env(safe-area-inset-bottom));
    top: calc(max(8px, env(safe-area-inset-top)) + 64px);
    right: 12px;
    bottom: auto;
    left: 12px;
    padding: 20px;
    border-radius: 20px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-brand {
    gap: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-brand h1 {
    font-size: clamp(23px, 7vw, 28px);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-brand small {
    font-size: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-panel > p {
    margin: 14px 0 16px;
    font-size: 14px;
    line-height: 1.55;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-tabs button {
    min-height: 48px;
    height: auto;
    padding: 8px;
    font-size: 15px;
    line-height: 1.2;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-form {
    margin-top: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-identity {
    min-height: 64px;
    margin-bottom: 14px;
    padding: 12px 0;
    grid-template-columns: auto 1px minmax(0, 1fr);
    gap: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-brand {
    min-width: 76px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-model {
    font-size: 20px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-title {
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-name {
    font-size: 15px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-native {
    font-size: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-seats {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-field input {
    height: 52px;
    font-size: 16px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-submit {
    min-height: 54px;
    height: auto;
    font-size: 16px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip {
    width: calc(100% - 16px);
    height: 46px;
    min-height: 46px;
    top: calc(max(8px, env(safe-area-inset-top)) + 110px);
    left: 8px;
    padding: 4px 6px;
    justify-content: space-between;
    gap: 4px;
    font-size: 10px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip > button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip > a {
    min-width: 42px;
    min-height: 44px;
    padding: 0 7px;
    font-size: 10px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    width: calc(100% - 16px);
    min-width: 0;
    top: calc(max(8px, env(safe-area-inset-top)) + 162px);
    left: 8px;
    padding: 8px 10px;
    flex-direction: row;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > strong {
    font-size: 13px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > div {
    margin-top: 0;
    gap: 5px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud span {
    min-width: 72px;
    height: 30px;
    padding: 0 7px;
    font-size: 11px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud span b {
    font-size: 15px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .rule-badge-strip {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-center {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat {
    width: 152px;
    height: 112px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag {
    width: 102px;
    height: 78px;
    padding: 4px 5px;
    border-radius: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .seat-number {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 16px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-name {
    font-size: 13px;
    line-height: 15px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-role,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .hand-count {
    font-size: 10px;
    line-height: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top {
    top: 222px;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-top .player-tag {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left {
    top: 322px;
    left: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    top: 322px;
    right: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-left .player-tag {
    top: 0;
    left: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-right .player-tag {
    top: 0;
    right: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .opponent-hand {
    width: 102px;
    height: 48px;
    padding-left: 27px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .opponent-hand .card-back {
    width: 34px;
    height: 48px;
    margin-left: -27px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-top .opponent-hand {
    top: 69px;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-left .opponent-hand,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-right .opponent-hand {
    top: 69px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .seat-play-area {
    min-width: 112px;
    min-height: 66px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards {
    --played-card-width: 42px;
    --played-card-height: 59px;
    --played-card-reveal: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
    top: 112px;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area {
    top: 104px;
    left: 34px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    top: 104px;
    right: 34px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-bottom {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel {
    width: calc(100% - 16px);
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: min(350px, 45vh);
    grid-template-columns: minmax(0, 1fr);
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    padding: 9px;
    gap: 6px;
    overflow: hidden;
    border-radius: 16px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy {
    display: flex;
    min-height: 34px;
    padding: 0 4px 6px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity {
    grid-template-columns: 32px minmax(70px, 1fr) 42px;
    column-gap: 7px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity .seat-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity strong {
    font-size: 13px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity small {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy > .own-hand-remaining {
    font-size: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy > b {
    font-size: 11px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar {
    min-height: 48px;
    padding: 0 0 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar::-webkit-scrollbar {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > span,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > small {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > div {
    min-width: max-content;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > .arrange-fixed-mode {
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll::-webkit-scrollbar {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-scroll-hint {
    min-height: 22px;
    position: absolute;
    z-index: 4;
    right: 7px;
    bottom: 4px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(141, 240, 189, 0.24);
    border-radius: 999px;
    color: #b8d9ca;
    background: rgba(2, 43, 30, 0.9);
    box-shadow: 0 3px 10px rgba(0, 20, 14, 0.22);
    font-size: 9px;
    pointer-events: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-scroll-hint[hidden] {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list {
    --own-hand-natural-step: 58px;
    --own-hand-card-width: 58px;
    --own-hand-card-height: 84px;
    --own-hand-rank-reveal: 23px;
    min-width: max-content;
    min-height: 124px;
    padding: 12px 8px 3px;
    justify-content: flex-start;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:last-child,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-card-button .playing-card.hand {
    width: 58px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    min-height: 54px;
    padding: 7px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .turn-hint {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .play-action-buttons button {
    min-width: 72px;
    min-height: 46px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .lobby-help {
    width: calc(100% - 24px);
    top: 54%;
    padding: 18px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .ready-button {
    min-height: 52px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .result-banner {
    width: calc(100% - 24px);
    max-height: calc(100% - 120px);
    padding: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .result-finish-order {
    grid-template-columns: minmax(0, 1fr);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena dialog.action-dialog {
    width: calc(100% - 24px);
    max-height: calc(100% - 32px);
    margin: auto;
  }
}

@media (max-width: 760px) and (orientation: landscape),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-play-app {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-hand-panel-block-size: 184px;
    --mobile-status-zone-size: 104px;
    --mobile-hand-panel-bottom: max(8px, env(safe-area-inset-bottom));
    --mobile-safe-left: max(8px, env(safe-area-inset-left));
    --mobile-safe-right: max(8px, env(safe-area-inset-right));
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    position: fixed;
    inset: 0;
    padding: 0 var(--mobile-safe-right) var(--mobile-hand-panel-bottom) var(--mobile-safe-left);
    display: grid;
    grid-template-rows: var(--mobile-status-zone-size) minmax(0, 1fr) var(--mobile-hand-panel-block-size);
    box-sizing: border-box;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-status-zone,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-battle-zone,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-hand-zone {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: block;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-status-zone { grid-row: 1; z-index: 40; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-battle-zone { grid-row: 2; z-index: 8; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-hand-zone { grid-row: 3; z-index: 28; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar {
    width: clamp(148px, 22vw, 180px);
    min-height: 0;
    top: 12px;
    right: auto;
    left: max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-areas: none;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-brand-lockup {
    width: 100%;
    max-width: 180px;
    height: 36px;
    margin: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-topbar-tools {
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-language-switch {
    height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-language-switch button {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding-inline: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .connection-chip {
    width: auto;
    min-width: 76px;
    height: 44px;
    padding: 0 10px;
    justify-content: center;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .connection-chip span {
    display: inline;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-panel {
    width: min(560px, calc(100% - 184px - var(--mobile-safe-left) - var(--mobile-safe-right)));
    max-height: calc(100% - 24px);
    top: 12px;
    right: max(12px, env(safe-area-inset-right));
    left: auto;
    padding: 16px 20px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-brand h1 {
    font-size: 24px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-panel > p {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-tabs button {
    min-height: 44px;
    height: 44px;
    font-size: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-form {
    margin-top: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-identity {
    min-height: 46px;
    margin-bottom: 7px;
    padding-block: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .fixed-game-seats {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-field > span {
    margin-bottom: 4px;
    font-size: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-field input {
    height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-submit {
    min-height: 48px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) {
    width: auto;
    height: 44px;
    min-height: 44px;
    top: 8px;
    right: 0;
    left: 0;
    grid-template-areas: none;
    grid-template-columns: minmax(120px, 0.8fr) minmax(210px, 1.25fr) auto;
    gap: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar-actions,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-identity,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .solo-topbar-tools {
    grid-area: auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .table-brand-lockup {
    width: min(180px, 24vw);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 5px 10px 5px 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity strong {
    font-size: 15px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity small {
    margin-top: 0;
    font-size: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena #copyTableBtn {
    width: 44px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena #copyTableBtn svg {
    width: 14px;
    height: 14px;
    color: var(--cream);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip {
    width: min(236px, 38%);
    height: 44px;
    min-height: 44px;
    top: 60px;
    left: 0;
    padding: 4px 6px;
    justify-content: space-between;
    gap: 4px;
    overflow: hidden;
    font-size: 10px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip > button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip > a {
    min-width: 44px;
    min-height: 44px;
    padding: 0 6px;
    font-size: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip #phaseText {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    width: auto;
    min-width: 0;
    top: 60px;
    right: 0;
    left: 258px;
    padding: 5px 8px;
    display: flex;
    flex-direction: row;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > strong {
    font-size: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > div {
    margin-top: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud span {
    min-width: 66px;
    height: 30px;
    padding: 0 6px;
    font-size: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    top: 2px;
    width: 134px;
    height: calc(100% - 4px);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top {
    left: calc(50% - 67px);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left {
    left: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    right: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag {
    width: 134px;
    height: 36px;
    box-sizing: border-box;
    padding: 4px 50px 4px 6px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .seat-number {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag > div {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-name {
    font-size: 12px;
    line-height: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .hand-count {
    flex: 0 0 auto;
    font-size: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .ready-mark {
    min-width: 34px;
    right: 4px;
    padding: 0 4px;
    font-size: 9px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-role {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat.seat-top .player-tag {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .opponent-hand {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    width: 134px;
    height: 44px;
    min-width: 0;
    min-height: 0;
    position: absolute;
    top: 34px;
    bottom: auto;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area {
    right: auto;
    left: 0;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    right: 0;
    left: auto;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards {
    --played-card-width: 32px;
    --played-card-height: 44px;
    --played-card-reveal: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-bottom {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .rule-badge-strip,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-center {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    height: var(--mobile-hand-panel-block-size);
    max-height: var(--mobile-hand-panel-block-size);
    position: absolute;
    inset: 0;
    padding: 6px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 48px;
    gap: 4px;
    overflow: hidden;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy {
    width: 108px;
    min-height: 28px;
    position: absolute;
    z-index: 3;
    bottom: 10px;
    left: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    border: 0;
    pointer-events: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy > .own-hand-remaining,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy > b {
    min-width: 0;
    padding: 3px 5px;
    overflow: hidden;
    border: 1px solid rgba(141, 240, 189, 0.18);
    border-radius: 999px;
    background: rgba(1, 45, 31, 0.82);
    font-size: 9px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy > .own-hand-remaining {
    flex: 1 1 auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy > b {
    flex: 0 0 auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace {
    min-height: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar {
    height: 44px;
    min-height: 44px;
    padding: 0 0 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > span,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > small {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > div {
    min-width: max-content;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > .arrange-fixed-mode {
    min-height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list {
    --own-hand-natural-step: 54px;
    --own-hand-card-width: 54px;
    --own-hand-card-height: 58px;
    --own-hand-rank-reveal: 18px;
    min-width: max-content;
    min-height: 76px;
    padding: 4px 8px 2px;
    justify-content: flex-start;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:last-child,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-card-button .playing-card.hand {
    width: 54px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    height: 48px;
    min-height: 48px;
    padding: 2px 0 0;
    padding-left: 116px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .turn-hint {
    min-width: 0;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .play-action-buttons button {
    min-width: 72px;
    min-height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-scroll-hint {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .table-battle-zone > .human-seat-layer {
    position: absolute;
    inset: 0;
  }
}

@media (max-width: 1024px) and (max-height: 375px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-status-zone-size: 96px;
    --mobile-hand-panel-block-size: 168px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    top: 52px;
  }
}

@media (max-width: 760px) and (max-height: 340px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-status-zone-size: 92px;
    --mobile-hand-panel-block-size: 140px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) {
    top: 2px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    top: 46px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list {
    --own-hand-card-height: 50px;
    min-height: 60px;
  }
}

@media (max-width: 760px) and (max-height: 680px) and (orientation: portrait) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-hand-panel-block-size: 224px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .entry-panel {
    max-height: calc(100% - 80px - env(safe-area-inset-bottom));
    padding-block: 16px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top {
    top: 222px;
    left: calc(50% - 76px);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    top: 270px;
    height: 70px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag {
    width: 94px;
    height: 64px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .seat-number {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .opponent-hand {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
    position: fixed;
    top: auto;
    bottom: calc(var(--mobile-hand-panel-block-size) + var(--mobile-hand-panel-bottom));
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    position: fixed;
    top: auto;
    bottom: 298px;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area {
    right: auto;
    left: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    right: 8px;
    left: auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel {
    max-height: var(--mobile-hand-panel-block-size);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar {
    min-height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar > .arrange-fixed-mode {
    min-height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list {
    --own-hand-card-height: 72px;
    --own-hand-rank-reveal: 20px;
    min-height: 100px;
    padding-top: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    min-height: 48px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .play-action-buttons button {
    min-height: 44px;
  }
}

/* Playable mobile layout. Phone play is a touch workspace, not a scaled
   desktop canvas: cards get a full-height runway and actions stay inside the
   panel in both orientations. */
html[data-locale="en"] .solo-player-arena .arrange-toolbar > small {
  display: none;
}

html[data-locale="en"] .solo-player-arena .turn-hint {
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel {
    height: min(360px, 44dvh);
    max-height: min(360px, 44dvh);
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr) 54px;
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy {
    width: auto;
    height: 44px;
    min-height: 44px;
    position: static;
    grid-row: 1;
    padding: 0 4px 5px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace {
    min-height: 0;
    grid-row: 2;
    overflow: hidden;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    min-height: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    width: max-content;
    min-width: max-content;
    min-height: 150px;
    flex-wrap: nowrap;
    align-content: normal;
    row-gap: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list {
    --own-hand-natural-step: 59px;
    --own-hand-card-height: 82px;
    --own-hand-rank-reveal: 20px;
  }
/* Only the exposed rank strip of an overlapped card owns its hit box.  The
     full card remains visible, but can no longer cover the tap target above
     it in the same stack. */
    :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:not(:last-child) {
    height: var(--own-hand-rank-reveal);
    flex-basis: var(--own-hand-rank-reveal);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button + .hand-card-button {
    margin-top: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    width: auto;
    height: 54px;
    min-height: 54px;
    grid-row: 3;
    padding: 0;
    border-left: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .turn-hint,
  :where(html:not(.fixed-aspect-table)) html[data-locale="en"] .solo-player-arena .turn-hint {
    font-size: 11px;
  }
}

@media (max-width: 760px) and (orientation: landscape),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-status-zone-size: 88px;
    --mobile-hand-panel-block-size: 190px;
    --mobile-action-dock-width: 176px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage:not(.own-hand-visible) {
    --mobile-hand-panel-block-size: 0px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) {
    top: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    top: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip {
    width: min(320px, 52%);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    left: calc(min(320px, 52%) + 8px);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel {
    height: var(--mobile-hand-panel-block-size);
    max-height: var(--mobile-hand-panel-block-size);
    grid-template-columns: minmax(0, 1fr) var(--mobile-action-dock-width);
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy {
    width: calc(var(--mobile-action-dock-width) - 12px);
    height: 34px;
    min-height: 34px;
    position: absolute;
    z-index: 4;
    top: 7px;
    right: 6px;
    bottom: auto;
    left: auto;
    padding: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace {
    min-height: 0;
    grid-column: 1;
    grid-row: 1;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    min-height: 124px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    --own-hand-natural-step: 59px;
    --own-hand-card-width: 56px;
    --own-hand-card-height: 74px;
    --own-hand-rank-reveal: 18px;
    width: max-content;
    min-width: max-content;
    min-height: 128px;
    padding: 2px 8px;
    flex-wrap: nowrap;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:last-child,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-card-button .playing-card.hand {
    width: 56px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:not(:last-child) {
    height: var(--own-hand-rank-reveal);
    flex-basis: var(--own-hand-rank-reveal);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button + .hand-card-button {
    margin-top: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    width: auto;
    height: auto;
    min-height: 0;
    grid-column: 2;
    grid-row: 1;
    padding: 42px 0 0 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .turn-hint,
  :where(html:not(.fixed-aspect-table)) html[data-locale="en"] .solo-player-arena .turn-hint {
    min-height: 0;
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock > .play-action-buttons {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .play-action-buttons button {
    min-width: 0;
    width: 100%;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .lobby-help {
    top: 50%;
    transform: translateY(-50%);
  }
}

@media (max-width: 760px) and (max-height: 340px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage {
    --mobile-status-zone-size: 84px;
    --mobile-hand-panel-block-size: 156px;
    --mobile-action-dock-width: 140px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) {
    height: 40px;
    min-height: 40px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    top: 40px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > strong {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    height: 70px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag {
    height: 30px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    height: 40px;
    top: 30px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards {
    --played-card-width: 30px;
    --played-card-height: 40px;
    --played-card-reveal: 9px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    min-height: 142px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    --own-hand-card-height: 70px;
    --own-hand-rank-reveal: 17px;
    min-height: 126px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    padding-top: 36px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .turn-hint {
    display: none;
  }
}

@media (max-width: 760px) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .series-result-overlay {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .series-result-shell {
    padding: 18px 14px;
    border-radius: 18px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .series-result-header h1 {
    font-size: 36px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .series-last-round-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    text-align: left;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .series-last-round-meta > span {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Short portrait play workspace */
@media (max-width: 480px) and (max-height: 680px) and (orientation: portrait) {
/* The round strip already carries the active level. Removing the duplicated
     level card leaves one uninterrupted lane for opponents and their plays. */
    :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    width: 100px;
    height: 88px;
    top: 166px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top {
    left: calc(50% - 50px);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left {
    left: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    right: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag {
    width: 100px;
    height: 44px;
    padding: 4px 32px 4px 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .seat-number {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 14px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-name {
    font-size: 11px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag > div {
    min-width: 0;
    flex: 1;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-role {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .ready-mark {
    min-width: 30px;
    height: 20px;
    top: 2px;
    right: 2px;
    padding: 0 3px;
    font-size: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    width: 100px;
    height: 44px;
    min-width: 0;
    min-height: 0;
    position: fixed;
    top: 210px;
    bottom: auto;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
    left: calc(50% - 50px);
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area {
    left: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    right: 4px;
    left: auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards {
    --played-card-width: 32px;
    --played-card-height: 44px;
    --played-card-reveal: 10px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards[data-card-count="8"],
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards[data-card-count="9"],
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards[data-card-count="10"],
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards[data-card-count="11"],
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .play-cards[data-card-count="12"] {
    --played-card-reveal: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel {
    height: 300px;
    max-height: 300px;
    grid-template-rows: minmax(0, 1fr) 54px;
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace {
    grid-row: 1;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock {
    grid-row: 2;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    min-height: 150px;
  }
}

/* Keep Safari's changing visual viewport authoritative after every mobile
   height override above. Older browsers retain the 100vh/100% fallback. */
@supports (height: 100dvh) {
  .human-fixed-viewport .human-play-app {
    height: 100dvh;
  }

  .human-fixed-viewport.solo-player-arena .human-table-stage {
    height: 100dvh;
  }
}

/* Mobile usability release */
.arrange-toolbar {
  position: relative;
  overflow: visible;
}

.arrange-menu-button {
  min-width: 190px;
  min-height: 40px;
  padding: 0 12px;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(141, 240, 189, 0.34);
  border-radius: 12px;
  color: var(--cream);
  background: rgba(4, 62, 44, 0.74);
  text-align: left;
}

.arrange-menu-button > span {
  color: var(--muted);
  font-size: 11px;
}

.arrange-menu-button > b {
  overflow: hidden;
  color: var(--cream);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrange-menu-button > i {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--mint);
  border-bottom: 2px solid var(--mint);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}

.arrange-toolbar.menu-open .arrange-menu-button > i {
  transform: translateY(2px) rotate(225deg);
}

.arrange-toolbar #guandanArrangeControls[hidden] {
  display: none;
}

.arrange-toolbar.menu-open #guandanArrangeControls {
  width: min(320px, calc(100vw - 32px));
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(141, 240, 189, 0.28);
  border-radius: 14px;
  background: #02271c;
  box-shadow: 0 14px 32px rgba(0, 18, 12, 0.46);
}

.arrange-toolbar.menu-open #guandanArrangeControls button {
  min-height: 44px;
  border-radius: 10px;
  font-size: 12px;
}

@media (max-width: 760px) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) {
    width: calc(100% - 16px);
    height: 44px;
    min-height: 44px;
    top: 4px;
    right: 8px;
    left: 8px;
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .human-topbar-actions {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .solo-topbar-tools {
    grid-area: auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity {
    width: 100%;
    height: 44px;
    min-width: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .solo-topbar-tools {
    min-width: 0;
    gap: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .connection-chip {
    min-width: 68px;
    padding-inline: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip {
    width: calc(100% - 16px);
    height: 44px;
    min-height: 44px;
    top: 52px;
    left: 8px;
    padding: 0 5px;
    gap: 3px;
    overflow: hidden;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip > button,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip > a {
    min-width: 44px;
    min-height: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar:not([hidden]) {
    height: 44px;
    min-height: 44px;
    padding: 0 0 4px;
    display: flex;
    overflow: visible;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-menu-button {
    width: min(230px, 100%);
    min-width: 0;
    min-height: 44px;
    touch-action: manipulation;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar.menu-open #guandanArrangeControls {
    top: 46px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    gap: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack {
    width: max-content;
    min-width: max-content;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: flex-start;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack:last-child {
    width: max-content;
    min-width: max-content;
    flex-basis: auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button {
    width: 44px;
    min-width: 44px;
    height: var(--own-hand-card-height);
    flex: 0 0 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:not(:last-child) {
    height: var(--own-hand-card-height);
    flex-basis: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:last-child {
    width: var(--own-hand-card-width);
    min-width: var(--own-hand-card-width);
    height: var(--own-hand-card-height);
    flex-basis: var(--own-hand-card-width);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button + .hand-card-button {
    margin-top: 0;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    width: calc((100% - 16px) / 3);
    height: 88px;
    top: 104px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-top {
    left: calc((100% - ((100% - 16px) / 3)) / 2);
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-left {
    left: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-table-stage[data-game] .human-seat.seat-right {
    right: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag {
    width: 100%;
    height: 44px;
    padding: 4px 32px 4px 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-role {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    width: calc((100% - 16px) / 3);
    height: 44px;
    min-width: 0;
    min-height: 0;
    position: fixed;
    top: 148px;
    bottom: auto;
    transform: none;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-top .seat-play-area {
    left: calc((100% - ((100% - 16px) / 3)) / 2);
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-left .seat-play-area {
    left: 4px;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.seat-right .seat-play-area {
    right: 4px;
    left: auto;
  }
}

@media (max-width: 760px) and (orientation: landscape),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .room-status-strip {
    top: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll {
    min-height: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    gap: 8px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack {
    width: max-content;
    min-width: max-content;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: flex-start;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack:last-child {
    width: max-content;
    min-width: max-content;
    flex-basis: auto;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button {
    width: 44px;
    min-width: 44px;
    height: var(--own-hand-card-height);
    flex: 0 0 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:not(:last-child) {
    height: var(--own-hand-card-height);
    flex-basis: 44px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button:last-child {
    width: var(--own-hand-card-width);
    min-width: var(--own-hand-card-width);
    height: var(--own-hand-card-height);
    flex-basis: var(--own-hand-card-width);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack .hand-card-button + .hand-card-button {
    margin-top: 0;
  }
}

@media (max-width: 380px) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity {
    grid-template-columns: minmax(0, 1fr);
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .room-identity .game-chip {
    display: none;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .connection-chip {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-topbar:has(.room-identity:not([hidden])) .connection-chip span {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Hand experience · canonical final overrides (2026-10-03).
   Existing felt/card tokens remain the visual source of truth. */
.solo-player-arena {
  --hand-feedback: var(--cream);
  --hand-warning: #ffcf9d;
  --hand-focus: var(--gold);
  --scroll-thumb: #8cb39c;
  --scroll-track: #153d2c;
}
.solo-player-arena * {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.solo-player-arena *::-webkit-scrollbar { width: 7px; height: 7px; }
.solo-player-arena *::-webkit-scrollbar-track { background: var(--scroll-track); }
.solo-player-arena *::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 6px; }
.solo-player-arena *::-webkit-scrollbar-thumb:hover { background: var(--cream); }
.solo-player-arena *::-webkit-scrollbar-thumb:active { background: var(--gold); }
.solo-player-arena button:focus-visible {
  outline: 3px solid var(--hand-focus);
  outline-offset: 3px;
}
.solo-player-arena .own-hand-workspace { position: relative; }
.solo-player-arena .hand-tools {
  position: absolute;
  z-index: 6;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
}
.solo-player-arena .hand-tools button {
  min-width: 54px;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--cream);
  background: var(--felt-deep);
  font-size: 12px;
}
.solo-player-arena .hand-tools button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--gold);
}
.solo-player-arena .hand-tools button:disabled { opacity: .45; }
.solo-player-arena .arrange-toolbar {
  min-height: 44px;
  padding-right: 128px;
  margin-bottom: 6px;
}
.solo-player-arena .arrange-menu-button { min-height: 44px; }
.solo-player-arena .own-hand-scroll {
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.solo-player-arena .own-hand-scroll::-webkit-scrollbar { display: block; height: 7px; }
.solo-player-arena .own-hand-list { padding-bottom: 48px; }
.solo-player-arena .own-meld-stack { padding-bottom: 44px; }
.solo-player-arena .select-group-button {
  position: absolute;
  bottom: 0;
  left: 0;
  width: min(100%, 74px);
  min-width: 44px;
  height: 44px;
  padding: 0 3px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}
.solo-player-arena .select-group-button::before { content: "+ "; }
.solo-player-arena .select-group-button[aria-pressed="true"] {
  color: var(--gold);
  background: #173c2c;
}
.solo-player-arena .select-group-button[aria-pressed="true"]::before { content: "✓ "; }
.solo-player-arena .select-group-button:disabled { opacity: .45; }
.solo-player-arena .hand-card-button.selected {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  filter: none;
}
.solo-player-arena .hand-card-button.selected::after {
  background: var(--gold);
  color: var(--ink);
  box-shadow: none;
}
.solo-player-arena .swipe-selection-enabled .own-hand-scroll,
.solo-player-arena .swipe-selection-enabled .own-hand-list { touch-action: none; }
.solo-player-arena .action-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.solo-player-arena .action-context .turn-hint {
  display: block;
  min-height: 0;
  font-size: 13px;
  color: var(--cream);
  text-align: left;
}
.solo-player-arena #selectionStatus {
  display: block;
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.solo-player-arena #selectionStatus[data-kind="invalid"] { color: var(--hand-warning); }
.solo-player-arena #selectionStatus[data-kind="valid"],
.solo-player-arena #selectionStatus[data-kind="ambiguous"] { color: var(--gold); }
.solo-player-arena .play-action-buttons button { min-height: 48px; }
.solo-player-arena .own-turn .play-button:not(:disabled) {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--gold);
}
.solo-player-arena .human-seat[data-relation="partner"] .seat-number {
  color: var(--ink);
  background: var(--mint);
}
.solo-player-arena .rule-badge-strip { display: none; }
.solo-player-arena .human-seat.current-actor .player-tag {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}
@media (max-width: 760px),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar {
    position: relative;
    width: auto;
    top: auto;
    bottom: auto;
    left: auto;
    height: 44px;
    padding: 0 128px 0 0;
    margin: 0 0 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-menu-button { width: 100%; min-width: 0; padding-inline: 10px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-menu-button b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-tools { top: 0; right: 0; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace { overflow: visible; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout {
    min-height: 132px;
    padding: 10px 6px 4px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-meld-stack { padding-bottom: 44px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .select-group-button { width: 100%; max-width: none; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock { padding-left: 0; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-context .turn-hint { font-size: 11px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena #selectionStatus { min-height: 32px; font-size: 11px; line-height: 1.4; }
}
@media (max-width: 760px) and (orientation: portrait) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock { grid-template-columns: minmax(0, 1fr) 162px; gap: 8px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-context { max-height: 54px; gap: 2px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll { height: calc(100% - 48px); }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .player-tag { padding-right: 30px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .human-seat .seat-number { width: 25px; height: 25px; flex-basis: 25px; font-size: 14px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud {
    display: block;
    width: 206px;
    height: 34px;
    min-height: 0;
    top: 216px;
    left: calc(50% - 103px);
    padding: 0;
    border: 0;
    background: transparent;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > strong { display: none; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > div { display: flex; gap: 6px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud > div > span {
    width: 100px;
    height: 32px;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .guandan-level-hud b { font-size: 16px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-card-button.selected { transform: translateY(-5px); }
}
@media (max-width: 480px) and (max-height: 680px) and (orientation: portrait) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel { grid-template-rows: 32px minmax(0, 1fr) 54px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy { display: flex; height: 32px; min-height: 32px; grid-row: 1; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace { grid-row: 2; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock { grid-row: 3; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-remaining { display: none; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-turn-countdown { transform: scale(.75); }
}
@media (max-width: 760px) and (orientation: landscape),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout { min-height: 120px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll { min-height: 0; height: calc(100% - 48px); }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock { padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .solo-player-arena .hand-card-button,
  .solo-player-arena .play-entering * { animation: none !important; transition: none !important; }
  .solo-player-arena .hand-card-button.selected { transform: none; }
}
@media (forced-colors: active) {
  .solo-player-arena * { scrollbar-color: auto; }
  .solo-player-arena .hand-card-button.selected { outline-color: Highlight; }
  .solo-player-arena button:focus-visible { outline-color: Highlight; }
}

/* Commercial table study: one fixed 16:9 canvas on desktop and phone.
   Extend the canonical hand layer; spectator and replay layouts are unchanged. */
.solo-player-arena .own-hand-panel {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 64px auto 44px;
  min-height: 0;
  padding: 8px 16px;
  gap: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.solo-player-arena .own-hand-panel > .action-dock {
  grid-row: 1;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 224px;
  width: min(760px, 100%);
  min-height: 64px;
  height: auto;
  margin: 0 auto;
  padding: 0;
  align-items: center;
  gap: 12px;
  border: 0;
}
.solo-player-arena .action-context { grid-column: 2; }
.solo-player-arena .action-dock > .play-action-buttons { grid-column: 3; }
.solo-player-arena .action-dock .own-turn-countdown {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1;
  width: 56px;
  height: 56px;
  margin: 0;
  transform: none;
}
.solo-player-arena .human-turn-countdown.urgent .turn-clock-face {
  outline: 3px solid var(--hand-warning);
  outline-offset: 3px;
}
.solo-player-arena .action-dock .turn-countdown-value { font-size: 26px; }
.solo-player-arena .own-hand-workspace { grid-row: 2; }
.solo-player-arena .own-hand-workspace > .own-hand-scroll { order: 1; }
.solo-player-arena .own-hand-workspace > .arrange-toolbar { order: 2; margin: 0; }
.solo-player-arena .own-hand-workspace > .hand-tools { top: auto; bottom: 0; }
.solo-player-arena .arrange-toolbar:not([hidden]) { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.solo-player-arena .arrange-toolbar > small { display: none; }
.solo-player-arena .rank-display-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--cream);
  background: var(--felt-deep);
}
.solo-player-arena .rank-display-button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: var(--felt-deep); }
.solo-player-arena .rank-display-button:hover:not(:disabled) { background: var(--felt); }
.solo-player-arena .rank-display-button:disabled { opacity: .45; }
.solo-player-arena .own-hand-list { align-items: flex-end; padding-bottom: 8px; }
.solo-player-arena .own-hand-copy {
  grid-row: 3;
  display: flex;
  width: auto;
  position: static;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 0;
  border: 0;
}
.solo-player-arena .own-seat-identity { grid-template-columns: 40px minmax(0, 1fr); }
.solo-player-arena .own-seat-identity .seat-number { width: 40px; height: 40px; }
.solo-player-arena .own-seat-identity strong { font-size: 16px; }
.solo-player-arena .own-seat-identity small { font-size: 12px; }
.solo-player-arena .own-hand-copy > .own-hand-remaining { display: block; }
.solo-player-arena .arrange-toolbar.menu-open #guandanArrangeControls { top: auto; bottom: 48px; }

html.fixed-aspect-table .human-play-app {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  background: var(--felt-deep);
}
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage {
  width: 1600px;
  height: 900px;
  min-width: 1600px;
  min-height: 900px;
  border-radius: 24px;
  outline: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
/* Children use authored canvas pixels, never a second viewport-size response. */
html.fixed-aspect-table .own-hand-panel { min-width: 760px; max-width: 1552px; }
html.fixed-aspect-table .entry-panel { width: 600px; max-height: 856px; }
html.fixed-aspect-table .lobby-help { width: 430px; }
html.fixed-aspect-table .result-banner { width: 500px; max-height: 320px; }
html.fixed-aspect-table .arrange-toolbar.menu-open #guandanArrangeControls { width: 320px; }
html.fixed-aspect-table .series-result-shell { width: 700px; }
html.fixed-aspect-table .series-replay-list { max-height: 520px; }
html.fixed-aspect-table .solo-player-arena .own-hand-panel { grid-template-rows: 80px auto 44px; }
html.fixed-aspect-table .solo-player-arena .own-hand-panel > .action-dock { min-height: 80px; grid-template-columns: 72px minmax(0, 1fr) 280px; }
html.fixed-aspect-table .solo-player-arena .action-dock .own-turn-countdown { width: 64px; height: 64px; }
html.fixed-aspect-table .solo-player-arena .play-action-buttons button { min-height: 72px; font-size: 20px; }
html.fixed-aspect-table .solo-player-arena .arrange-toolbar:not([hidden]) { padding-right: 144px; }
html.fixed-aspect-table .solo-player-arena #guandanArrangeControls:not([hidden]) {
  position: static;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 1 1 0;
  width: auto;
  max-width: 560px;
  min-width: 0;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
html.fixed-aspect-table .solo-player-arena #guandanArrangeControls button { min-width: 0; min-height: 44px; padding: 4px 8px; white-space: normal; }
/* Portrait keeps the fixed 1600x900 stage, so it renders at ~0.23x: measured
   play buttons of 57x14 and a hint control of 14x9.  Nothing can be resized into
   usability at that scale, so portrait states the tradeoff instead of pretending
   the table is playable.  It sits above the shrunken table band and never
   intercepts input. */
html.fixed-aspect-table .landscape-hint {
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 32px));
  margin: 0;
  padding: 16px 18px;
  border: 1px solid rgba(230, 199, 125, 0.4);
  border-radius: 16px;
  background: rgba(2, 42, 29, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  color: var(--cream);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  pointer-events: none;
  z-index: 60;
}
html.fixed-aspect-table .landscape-hint b {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
}
html.fixed-aspect-table .landscape-hint span { display: block; color: var(--muted); }
html.fixed-aspect-table .landscape-hint[hidden] { display: none; }

@media (max-width: 760px) and (orientation: portrait) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel { grid-template-rows: 32px 64px minmax(0, 1fr); padding: 6px; gap: 4px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy { grid-row: 1; min-height: 32px; height: 32px; gap: 8px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel > .action-dock {
    grid-row: 2;
    grid-template-columns: 44px minmax(0, 1fr) 146px;
    min-height: 64px;
    gap: 6px;
    padding: 0;
  }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock .own-turn-countdown { width: 40px; height: 40px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock .turn-countdown-value { font-size: 23px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace { grid-row: 3; min-height: 0; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll { min-height: 0; height: calc(100% - 48px); }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-toolbar:not([hidden]) { padding-right: 114px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-menu-button { width: auto; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) 12px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-menu-button > span { display: none; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .rank-display-button { width: 76px; padding: 0 4px; font-size: 11px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-tools button { min-width: 50px; max-width: 54px; padding: 0 6px; white-space: normal; line-height: 1.2; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout { align-items: flex-start; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity { display: grid; grid-template-columns: 25px minmax(0, 1fr); }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity .seat-number { width: 25px; height: 25px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-seat-identity strong { font-size: 12px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-context .turn-hint { white-space: normal; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena #selectionStatus { font-size: 10px; }
}
@media (max-width: 760px) and (orientation: landscape),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel { grid-template-columns: minmax(0, 1fr) 176px; grid-template-rows: minmax(0, 1fr); padding: 6px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-workspace { grid-column: 1; grid-row: 1; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-panel > .action-dock { grid-column: 2; grid-row: 1; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 64px 48px; align-content: start; width: 100%; gap: 6px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock .own-turn-countdown { width: 40px; height: 40px; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .action-dock > .play-action-buttons { grid-column: 1 / -1; grid-row: 2; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-copy { display: none; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-scroll { min-height: 0; height: calc(100% - 48px); }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list,
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .own-hand-list.wrapped-layout { align-items: flex-start; }
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .arrange-menu-button { width: auto; }
}

/* Table detail refinement: original palette, stable physical-card hitboxes. */
.solo-player-arena .own-hand-list .playing-card.hand:not(.joker) .card-corner {
  top: 2px;
  left: 5px;
  gap: 2px;
  align-items: center;
}
.solo-player-arena .own-hand-list .playing-card.hand:not(.joker) .card-corner b {
  font-size: 24px;
  line-height: 24px;
  font-weight: 800;
}
.solo-player-arena .own-hand-list .playing-card.hand:not(.joker) .card-corner i {
  font-size: 19px;
  line-height: 24px;
}
.solo-player-arena .playing-card .joker-face-label {
  position: absolute;
  inset: 30% 3px 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
  pointer-events: none;
}
.solo-player-arena .playing-card .joker-artwork {
  position: absolute;
  top: 28px;
  left: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 31px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.solo-player-arena .playing-card.joker-small .joker-artwork {
  filter: grayscale(1);
}
.solo-player-arena .play-cards .playing-card.table .joker-artwork {
  top: 19px;
  height: calc(100% - 22px);
}
.solo-player-arena .playing-card.joker-labelled .card-corner {
  top: 2px;
  left: 5px;
  width: calc(100% - 10px);
  align-items: flex-start;
  transform: none;
}
.solo-player-arena .own-hand-list .playing-card.hand.joker-labelled .card-corner b {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
}
.solo-player-arena .play-cards .playing-card.table.joker-labelled .card-corner b {
  font-family: Arial, sans-serif;
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0;
}
html[lang="en"] .solo-player-arena .own-hand-list .playing-card.hand.joker-labelled .card-corner b {
  font-size: 12px;
}
.solo-player-arena .play-cards .playing-card.table .joker-face-label {
  font-size: 14px;
  letter-spacing: 0;
}
html[lang="en"] .solo-player-arena .own-hand-list .joker-face-label {
  font-size: min(18px, calc(var(--own-hand-card-width, 74px) * .22));
  letter-spacing: 0;
}
.solo-player-arena .hand-card-button.selected {
  transform: none;
  z-index: auto;
  filter: none;
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.solo-player-arena .hand-card-button.selected .playing-card.hand {
  background: color-mix(in srgb, var(--gold) 30%, var(--paper));
  border-color: var(--gold);
}
.solo-player-arena .hand-card-button.selected::after {
  width: 22px;
  height: 22px;
  top: 2px;
  right: 2px;
  border: 1px solid var(--ink);
  font-size: 14px;
}
.solo-player-arena .live-identity .player-tag {
  width: 190px;
  height: 94px;
  padding: 10px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto 26px;
  align-items: center;
  justify-content: start;
  gap: 2px 10px;
  border-radius: 14px;
}
.solo-player-arena .live-identity .seat-number {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  font-size: 22px;
}
.solo-player-arena .live-identity .player-tag > .player-identity {
  grid-column: 2;
  grid-row: 1;
  text-align: left;
}
.solo-player-arena .live-identity .player-name { font-size: 18px; line-height: 22px; }
.solo-player-arena .live-identity .player-role { font-size: 12px; line-height: 18px; }
.solo-player-arena .live-identity .ready-mark {
  grid-column: 2;
  grid-row: 2;
  position: static;
  justify-self: start;
  height: 26px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--cream);
  background: transparent;
  font-size: 18px;
  line-height: 26px;
  font-variant-numeric: tabular-nums;
}
.solo-player-arena .live-identity .ready-mark.finish-place { color: var(--gold); }
.solo-player-arena .human-seat.live-identity:is(.seat-left, .seat-right) .opponent-hand { top: 102px; }

/* Live table polish reuses the fixed canvas and the existing hand-fit metrics. */
html.fixed-aspect-table .solo-player-arena .own-hand-list {
  --own-hand-natural-step: 85px;
  --own-hand-card-width: 84px;
  --own-hand-card-height: 122px;
  --own-hand-rank-reveal: 28px;
}
html.fixed-aspect-table .solo-player-arena .own-meld-stack .hand-card-button,
html.fixed-aspect-table .solo-player-arena .own-meld-stack .hand-card-button:last-child,
html.fixed-aspect-table .solo-player-arena .hand-card-button .playing-card.hand {
  width: var(--own-hand-card-width);
  height: var(--own-hand-card-height);
}
.solo-player-arena .live-identity .seat-avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  pointer-events: none;
  user-select: none;
}
.solo-player-arena .live-identity .has-avatar .seat-number {
  width: 20px;
  height: 20px;
  position: relative;
  top: 2px;
  left: 4px;
  align-self: end;
  justify-self: end;
  border: 1px solid var(--felt-deep);
  border-radius: 50%;
  font-size: 12px;
}
.solo-player-arena .live-identity .ready-mark.low-card-count {
  padding: 0 7px;
  border: 1px solid var(--hand-warning);
  border-radius: 6px;
  color: var(--hand-warning);
  background: var(--felt-deep);
  font-weight: 800;
}
.solo-player-arena .select-group-button {
  width: min(100%, var(--own-hand-card-width, 74px));
  min-width: 54px;
  padding: 0 2px;
  color: var(--cream);
  font-size: 12px;
  white-space: nowrap;
}
.solo-player-arena .select-group-button::before,
.solo-player-arena .select-group-button[aria-pressed="true"]::before { content: none; }
.solo-player-arena .select-group-button[aria-pressed="true"] {
  color: var(--gold);
  outline: 1px solid var(--gold);
  outline-offset: -1px;
}
.solo-player-arena .live-identity .seat-play-area.has-played-cards {
  width: max-content;
  max-width: 368px;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--felt-deep);
}
/* Twelve-card fans occupy at most 368px; keep side plays above the action rail
   and outside the centered play lane. Spectator/terminal/PASS lanes are intact. */
.human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-left .seat-play-area.has-played-cards {
  top: -64px;
  left: 208px;
}
.human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-right .seat-play-area.has-played-cards {
  top: -64px;
  right: 208px;
}
.solo-player-arena .live-identity .play-cards {
  --played-card-width: 60px;
  --played-card-height: 86px;
  --played-card-reveal: 26px;
}
.solo-player-arena .live-identity .play-cards .playing-card.table {
  width: 60px;
  height: 86px;
}
.solo-player-arena .live-identity .play-cards .playing-card.table:not(.joker) .card-corner b { font-size: 20px; }
.solo-player-arena .live-identity .play-cards .playing-card.table .card-corner i { font-size: 15px; }
.solo-player-arena .live-identity .play-label {
  font-size: 18px;
  line-height: 24px;
  color: var(--cream);
}
.solo-player-arena .live-identity .has-played-cards .play-label {
  display: block;
  position: static;
  transform: none;
  margin-bottom: 6px;
  font-family: inherit;
  letter-spacing: 0;
  text-shadow: none;
}
.solo-player-arena .live-identity .play-cards .playing-card.table.joker-labelled .card-corner b { font-size: 12px; }

/* Stable commercial play lanes: independent of measured hand content height.
   Only live fixed solo tables opt in; replay, spectators and settlement retain
   their canonical geometry. All coordinates are authored canvas pixels. */
html.fixed-aspect-table .solo-player-arena .own-hand-panel {
  width: calc(100% - 224px);
  height: 374px;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}
html.fixed-aspect-table .solo-player-arena .own-hand-panel > .action-dock {
  position: absolute;
  top: -104px;
  right: 0;
  width: 480px;
  height: 104px;
  min-height: 104px;
  margin: 0;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: 24px 72px;
  gap: 8px 12px;
}
html.fixed-aspect-table .solo-player-arena .action-dock .action-context {
  grid-column: 2;
  grid-row: 1;
  flex-direction: row;
  justify-content: flex-end;
  gap: 12px;
}
html.fixed-aspect-table .solo-player-arena .action-dock .turn-hint {
  font-size: 14px;
}
html.fixed-aspect-table .solo-player-arena .action-dock #selectionStatus {
  font-size: 12px;
}
html.fixed-aspect-table .solo-player-arena .action-dock > .play-action-buttons {
  grid-column: 2;
  grid-row: 2;
}
html.fixed-aspect-table .solo-player-arena .action-dock .own-turn-countdown {
  grid-row: 2;
}
html.fixed-aspect-table .solo-player-arena .own-hand-workspace {
  grid-row: 1;
  min-height: 0;
}
html.fixed-aspect-table .solo-player-arena .own-hand-scroll {
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
}
html.fixed-aspect-table .solo-player-arena .own-hand-list {
  height: 100%;
  min-height: 0;
  align-items: flex-end;
}
html.fixed-aspect-table .solo-player-arena .own-hand-copy {
  position: absolute;
  bottom: 8px;
  left: 16px;
  height: 44px;
  gap: 8px;
}
html.fixed-aspect-table .solo-player-arena .own-hand-copy .own-seat-copy {
  min-width: 0;
  max-width: 80px;
}
html.fixed-aspect-table .solo-player-arena .own-seat-identity {
  gap: 8px;
}
html.fixed-aspect-table .solo-player-arena .own-hand-copy #selectedCount {
  display: none;
}
html.fixed-aspect-table .solo-player-arena .arrange-toolbar:not([hidden]) {
  padding-left: 240px;
}
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-bottom {
  top: 338px;
  bottom: auto;
  height: 144px;
}
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-bottom .seat-play-area {
  top: 0;
  bottom: auto;
}
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-top .seat-play-area {
  top: 56px;
}
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity:is(.seat-left, .seat-right) {
  top: 300px;
  transform: none;
}
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity .opponent-hand {
  display: none;
}
/* Exposed strips are the actual buttons. The full decorative surface keeps its
   height but ignores pointer events; keyboard/semantic clicks cannot hit a
   different card underneath the centre of a covered button. */
html.fixed-aspect-table .solo-player-arena .own-meld-stack .hand-card-button:not(:last-child) {
  height: var(--own-hand-stack-reveal, var(--own-hand-rank-reveal));
  flex-basis: var(--own-hand-stack-reveal, var(--own-hand-rank-reveal));
}
html.fixed-aspect-table .solo-player-arena .own-meld-stack .hand-card-button + .hand-card-button {
  margin-top: 0;
}

/* Confirmed table feedback: public referee context, not a client rule engine.
   The upper-right context lane leaves the centre clear for committed cards. */
.solo-player-arena .current-trick-context {
  position: absolute;
  top: 132px;
  right: 30px;
  width: 350px;
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 12px;
  padding: 5px 14px;
  border-radius: 8px;
  color: var(--cream);
  background: var(--felt-deep);
  font-size: 14px;
  line-height: 20px;
  pointer-events: none;
}
.solo-player-arena .current-trick-context[hidden] { display: none; }
.solo-player-arena .current-trick-context > strong { color: var(--gold); font-size: 14px; }
.solo-player-arena .current-trick-context > small { flex-basis: 100%; text-align: center; color: var(--cream); font-size: 12px; line-height: 16px; }
.solo-player-arena .live-identity .seat-play-area.response-target {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.solo-player-arena .live-identity .seat-play-area.previous-play { opacity: .72; }
.solo-player-arena .response-target-badge {
  display: block;
  position: static;
  width: max-content;
  margin: 6px auto 0;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  line-height: 16px;
  white-space: nowrap;
}
.solo-player-arena .own-meld-stack:is(.logical-start, .logical-continuation)::before {
  content: "";
  position: absolute;
  bottom: 45px;
  left: 0;
  width: var(--own-hand-group-step, 85px);
  height: 3px;
  background: var(--line);
  pointer-events: none;
}
.solo-player-arena .own-meld-stack.logical-end::before { width: var(--own-hand-card-width); }
.solo-player-arena .own-meld-stack.logical-selected::before { background: var(--gold); }
.solo-player-arena .group-continuation-label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--own-hand-card-width);
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--cream);
  font-size: 12px;
  pointer-events: none;
}
.solo-player-arena .select-group-button {
  border: 1px solid var(--line);
  color: var(--cream);
  background: var(--felt-deep);
  font-weight: 650;
}
.solo-player-arena .select-group-button:hover:not(:disabled) { border-color: var(--gold); }
.solo-player-arena .select-group-button[aria-pressed="mixed"] { color: var(--gold); border-color: var(--gold); border-style: dashed; }
html.fixed-aspect-table .solo-player-arena .arrange-toolbar:not([hidden]) { padding-right: 220px; gap: 6px; }
html.fixed-aspect-table .solo-player-arena .arrange-toolbar button {
  min-height: 44px;
  color: var(--cream);
  border-color: var(--line);
  background: var(--felt-deep);
  font-size: 13px;
  padding-inline: 12px;
}
html.fixed-aspect-table .solo-player-arena .arrange-toolbar button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 750;
}
html.fixed-aspect-table .solo-player-arena .hand-tools { gap: 6px; }
html.fixed-aspect-table .solo-player-arena .hand-tools button:not(:disabled) { color: var(--cream); border-color: var(--line); background: var(--felt-deep); }
html.fixed-aspect-table .solo-player-arena .hand-tools #tableSoundButton { width: 88px; padding-inline: 6px; font-size: 12px; white-space: nowrap; }
html.fixed-aspect-table .solo-player-arena .hand-tools button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
html.fixed-aspect-table .solo-player-arena .action-dock #selectionStatus { color: var(--cream); white-space: nowrap; }
html.fixed-aspect-table .solo-player-arena .action-dock #selectionStatus[data-kind="invalid"] { color: var(--hand-warning); }
html.fixed-aspect-table .solo-player-arena .action-dock .action-context { gap: 8px; }
.solo-player-arena .human-seat.play-entering .play-cards { animation: confirmed-card-enter 180ms cubic-bezier(.22, 1, .36, 1); }
.solo-player-arena .human-seat.play-entering.passed .play-label { animation: confirmed-turn-cue 180ms ease-out; }
.solo-player-arena .seat-bottom.play-entering .play-cards { --play-enter-x: 0px; --play-enter-y: 24px; }
.solo-player-arena .seat-top.play-entering .play-cards { --play-enter-x: 0px; --play-enter-y: -18px; }
.solo-player-arena .seat-left.play-entering .play-cards { --play-enter-x: -18px; --play-enter-y: 0px; }
.solo-player-arena .seat-right.play-entering .play-cards { --play-enter-x: 18px; --play-enter-y: 0px; }
.solo-player-arena .turn-arrived .play-action-buttons { animation: confirmed-turn-cue 220ms ease-out; }
@keyframes confirmed-card-enter {
  from { opacity: .35; transform: translate(var(--play-enter-x, 0px), var(--play-enter-y, 14px)); }
  to { opacity: 1; transform: translate(0, 0); }
}
@keyframes confirmed-turn-cue { from { opacity: .65; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .solo-player-arena .human-seat.play-entering .play-cards,
  .solo-player-arena .human-seat.play-entering.passed .play-label,
  .solo-player-arena .turn-arrived .play-action-buttons { animation: none !important; }
}
@media (forced-colors: active) {
  .solo-player-arena .live-identity .seat-play-area.response-target { outline: 2px solid Highlight; }
  .solo-player-arena .live-identity .seat-play-area.previous-play { opacity: 1; }
  .solo-player-arena .response-target-badge { background: Highlight; color: HighlightText; }
}

/* Approved in-game experience polish */
html.fixed-aspect-table .solo-player-arena .own-hand-panel > .action-dock {
  right: 170px;
  width: 420px;
  top: -132px;
  height: 132px;
  min-height: 132px;
  grid-template-columns: 68px minmax(0, 1fr);
  grid-template-rows: 64px 60px;
  gap: 8px 14px;
}
html.fixed-aspect-table .solo-player-arena .action-dock .action-context {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-left: 0;
  gap: 2px;
  min-width: 0;
}
html.fixed-aspect-table .solo-player-arena .action-dock .turn-hint {
  font-size: 16px;
  line-height: 20px;
  color: var(--cream);
}
html.fixed-aspect-table .solo-player-arena .action-dock #selectionStatus {
  min-height: 0;
  flex-shrink: 0;
  font-size: 15px;
  line-height: 20px;
  white-space: normal;
  overflow-wrap: anywhere;
}
html.fixed-aspect-table .solo-player-arena .action-dock .action-context:has(#reconcileActionButton:not([hidden])) { padding-left: 88px; }
html.fixed-aspect-table .solo-player-arena .action-dock #selectionStatus:is([data-kind="invalid"], [data-kind="error"]) { color: var(--hand-warning); }
html.fixed-aspect-table .solo-player-arena .action-dock > .play-action-buttons {
  grid-template-columns: .8fr 1.2fr;
  gap: 16px;
}
html.fixed-aspect-table .solo-player-arena .play-action-buttons button {
  min-height: 60px;
  height: 60px;
  border-radius: 999px;
  font-size: 20px;
}
html.fixed-aspect-table .solo-player-arena .play-button:not(:disabled) {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
html.fixed-aspect-table .solo-player-arena .play-button:hover:not(:disabled) { background: color-mix(in srgb, var(--gold) 82%, var(--paper)); }
html.fixed-aspect-table .solo-player-arena .pass-button:not(:disabled) {
  color: var(--cream);
  border-color: var(--line);
  background: var(--felt-deep);
}
html.fixed-aspect-table .solo-player-arena .pass-button:hover:not(:disabled) { border-color: var(--cream); }
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-bottom {
  top: 400px;
  left: calc(50% - 190px);
}
/* Keep even a twelve-card own fan above expanded first-column hand stacks.
   These are display sizes only; physical card identities and requests stay intact. */
html.fixed-aspect-table .solo-player-arena .seat-bottom .seat-play-area.has-played-cards { padding: 4px 10px; max-width: 312px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards {
  --played-card-width: 48px;
  --played-card-height: 66px;
  --played-card-reveal: 22px;
}
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards .playing-card.table { width: 48px; height: 66px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards .playing-card.table:not(.joker) .card-corner b { font-size: 18px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards .playing-card.table .card-corner i { font-size: 13px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .has-played-cards .play-label { font-size: 16px; line-height: 20px; margin-bottom: 4px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .response-target-badge { margin-top: 4px; padding: 0 6px; font-size: 10px; line-height: 12px; }
html.fixed-aspect-table .solo-player-arena .hand-spread .own-hand-list { --own-hand-rank-reveal: 42px; }
/* Leave a full gap beside the largest twelve-card teammate fan. */
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .player-tag { left: 385px; }
.solo-player-arena .live-identity.current-actor .player-tag {
  border-color: var(--mint);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 60%, transparent);
}
.solo-player-arena .seat-turn-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 18px;
  white-space: nowrap;
}
.solo-player-arena #fullscreenButton {
  min-width: 72px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--cream);
  background: var(--felt-deep);
  font-family: inherit;
  font-size: 14px;
}
.solo-player-arena #fullscreenButton:hover:not(:disabled) { border-color: var(--cream); }
.solo-player-arena #fullscreenButton[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.solo-player-arena #fullscreenButton:disabled { opacity: .5; }
html.fixed-aspect-table #humanPlayApp:fullscreen,
html.fixed-aspect-table #humanPlayApp:-webkit-full-screen { width: 100%; height: 100%; background: var(--felt-deep); }
html.fixed-aspect-table .solo-player-arena .arrange-toolbar:not([hidden]) { padding-right: 340px; }
html.fixed-aspect-table .solo-player-arena .hand-tools #handSpreadButton { width: 110px; padding-inline: 8px; font-size: 13px; white-space: nowrap; }
html.fixed-aspect-table .solo-player-arena #reconcileActionButton {
  position: absolute;
  top: 0;
  left: 0;
  width: 76px;
  height: 40px;
  min-height: 40px;
  padding: 2px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gold);
  background: var(--felt-deep);
}
html.fixed-aspect-table .solo-player-arena #reconcileActionButton[hidden] { display: none; }
html.fixed-aspect-table .solo-player-arena #reconcileActionButton:hover:not(:disabled) { background: var(--felt); }
html.fixed-aspect-table .solo-player-arena .result-banner { width: 620px; max-height: 470px; padding: 24px; }
html.fixed-aspect-table .solo-player-arena .result-headline > strong { font-size: 26px; line-height: 34px; }
html.fixed-aspect-table .solo-player-arena .result-round-meta { width: 100%; padding: 14px; }
html.fixed-aspect-table .solo-player-arena .result-round-meta > strong { font-size: 26px; }
html.fixed-aspect-table .solo-player-arena .result-ready-button {
  min-height: 64px;
  width: 100%;
  margin-top: 18px;
  color: var(--ink);
  background: var(--gold);
  font-size: 20px;
}
html.fixed-aspect-table .solo-player-arena .result-ready-button:hover:not(:disabled) { background: color-mix(in srgb, var(--gold) 82%, var(--paper)); }
.solo-player-arena :is(#fullscreenButton, #handSpreadButton, #reconcileActionButton):focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.solo-player-arena :is(#fullscreenButton, #handSpreadButton, #reconcileActionButton):not(:disabled) { cursor: pointer; }
.solo-player-arena :is(#fullscreenButton, #handSpreadButton, #reconcileActionButton):active:not(:disabled) { filter: brightness(.92); }
@media (forced-colors: active) {
  .solo-player-arena .live-identity.current-actor .player-tag { outline: 2px solid Highlight; }
  .solo-player-arena .seat-turn-label { background: Highlight; color: HighlightText; }
}

/* Commercial flow polish */
/* Compact scoreboard remains outside the left public-play lane (x=240). */
html.fixed-aspect-table .solo-player-arena .guandan-level-hud { width: 200px; min-width: 0; top: 152px; }
html.fixed-aspect-table .solo-player-arena .guandan-level-hud > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}
html.fixed-aspect-table .solo-player-arena .guandan-level-hud > div > span {
  min-width: 0;
  padding: 0 6px;
}
html.fixed-aspect-table .solo-player-arena .live-identity .play-cards {
  --played-card-width: 68px;
  --played-card-height: 96px;
  --played-card-reveal: 24px;
}
html.fixed-aspect-table .solo-player-arena .live-identity .play-cards .playing-card.table {
  width: var(--played-card-width);
  height: var(--played-card-height);
}
html.fixed-aspect-table .solo-player-arena .live-identity .play-cards .playing-card.table:not(.joker) .card-corner b { font-size: 22px; }
html.fixed-aspect-table .solo-player-arena .live-identity .play-cards .playing-card.table .card-corner i { font-size: 17px; }
html.fixed-aspect-table .solo-player-arena .live-identity .seat-play-area.has-played-cards { max-width: 368px; }
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity:is(.seat-left, .seat-right) .seat-play-area.has-played-cards { top: -108px; }
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game] .human-seat.live-identity.seat-bottom { top: 374px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .seat-play-area.has-played-cards { max-width: 336px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards {
  --played-card-width: 60px;
  --played-card-height: 82px;
  --played-card-reveal: 22px;
}
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards .playing-card.table { width: 60px; height: 82px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards .playing-card.table:not(.joker) .card-corner b { font-size: 20px; }
html.fixed-aspect-table .solo-player-arena .seat-bottom .play-cards .playing-card.table .card-corner i { font-size: 15px; }
/* Explicit left-hand controls mirror the own-play lane, not the seats or hand. */
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-control-side="left"] .own-hand-panel > .action-dock { left: 170px; right: auto; }
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage[data-game][data-control-side="left"] .human-seat.live-identity.seat-bottom { left: calc(50% + 200px); }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-control-size="large"] .own-hand-panel > .action-dock {
  width: 460px;
  right: 86px;
  top: -178px;
  height: 178px;
  min-height: 178px;
  grid-template-rows: 64px 106px;
}
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-control-size="large"][data-control-side="left"] .own-hand-panel > .action-dock { left: 86px; right: auto; }
/* The whole stage is scaled to fit (0.42x on an 844x390 landscape phone), so a
   declared height shrinks with it: this tier used to declare 84px and render at
   35px, below a comfortable touch target, despite the settings copy promising
   "large buttons on landscape phones".  106px declared renders at ~44px there. */
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-control-size="large"] .play-action-buttons button { min-height: 106px; height: 106px; font-size: 28px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-control-size="large"] .table-reading-tools .hint-button { min-width: 106px; min-height: 106px; height: 106px; font-size: 20px; padding: 0 20px; }
/* Short-landscape geometry belongs to table-frame, not independent CSS media
   queries. Explicit spread wins and remains a second, wider view of the stack. */
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .own-hand-list { --own-hand-rank-reveal: 40px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape] .hand-spread .own-hand-list { --own-hand-rank-reveal: 42px; }
html.fixed-aspect-table .solo-player-arena .arrange-toolbar:not([hidden]) { padding-right: 390px; gap: 10px; }

/* Continuous logical groups and reserved clock lanes. Keep the existing maximum
   hand envelope; long combinations compress their exposed strips, not membership. */
html.fixed-aspect-table .solo-player-arena .own-hand-list { --own-hand-stack-max-height: 248px; }
html.fixed-aspect-table .solo-player-arena .own-hand-copy { height: 64px; bottom: 0; }
.own-clock-slot { position: relative; flex: 0 0 72px; width: 72px; height: 64px; }
.own-clock-slot > .own-turn-countdown {
  position: absolute;
  inset: 0 auto auto 4px;
  width: 64px;
  height: 64px;
  margin: 0;
  transform: none;
}
html.fixed-aspect-table .solo-player-arena .arrange-toolbar:not([hidden]) { padding-left: 320px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-control-size] .own-hand-panel > .action-dock { grid-template-columns: minmax(0, 1fr); }
html.fixed-aspect-table .solo-player-arena .action-dock :is(.action-context, .play-action-buttons) { grid-column: 1; }
/* Below the identity panel, away from inward committed-card fans. Includes space
   for alarm ears/feet; no larger z-index or masking is used to hide collisions. */
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity .player-tag > .human-turn-countdown {
  top: 110px;
  left: 10px;
  right: auto;
  bottom: auto;
}
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-right .player-tag > .human-turn-countdown {
  left: auto;
  right: 10px;
}
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .player-tag > .human-turn-countdown {
  top: -78px;
}
html.fixed-aspect-table .solo-player-arena #guandanArrangeControls:not([hidden]) { gap: 8px; max-width: 536px; }
/* Center one caption, or the complete two-line scheme caption, in the same
   fixed button box. An absent scheme must not generate an empty second line. */
html.fixed-aspect-table .solo-player-arena #guandanArrangeControls button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 44px;
  padding: 3px 4px;
  font-size: 12px;
  line-height: 18px;
}
html.fixed-aspect-table .solo-player-arena #guandanArrangeControls button::after {
  content: none;
  display: block;
  height: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 14px;
  white-space: nowrap;
}
html.fixed-aspect-table .solo-player-arena #guandanArrangeControls button[data-variant-count]::after { content: attr(data-variant-count); }
html.fixed-aspect-table .solo-player-arena #arrangeHint {
  display: block;
  position: absolute;
  left: 240px;
  bottom: -19px;
  width: 580px;
  height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.fixed-aspect-table .solo-player-arena .arrange-toolbar .arrange-group-label,
html.fixed-aspect-table .solo-player-arena .hand-tools .hand-tool-group-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
html.fixed-aspect-table .solo-player-arena .hand-tools {
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
html.fixed-aspect-table .solo-player-arena .hand-tools button:not(:disabled) { background: transparent; }
html.fixed-aspect-table .solo-player-arena .hand-tools button:hover:not(:disabled) { background: var(--felt-deep); border-color: var(--cream); }
html.fixed-aspect-table .solo-player-arena .hand-tools #handSpreadButton { width: 110px; }
.solo-player-arena .table-reading-tools {
  position: absolute;
  top: 98px;
  left: 30px;
  display: flex;
  gap: 10px;
}
.solo-player-arena .table-reading-tools button {
  min-width: 132px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  background: var(--felt-deep);
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 20px;
}
.solo-player-arena .table-reading-tools button:hover:not(:disabled) { border-color: var(--cream); }
.solo-player-arena .table-reading-tools button[hidden] { display: none; }
.solo-player-arena .table-reading-tools button:not(:disabled) { cursor: pointer; }
.solo-player-arena .table-reading-tools button:active:not(:disabled) { filter: brightness(.92); }
.solo-player-arena .table-reading-tools button:disabled { opacity: .5; }
.solo-player-arena .table-preferences-dialog,
.solo-player-arena .trick-history-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow: auto;
  color: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--felt-deep);
  font-family: inherit;
}
.solo-player-arena .table-preferences-dialog { width: min(540px, calc(100vw - 32px)); }
.solo-player-arena :is(.table-preferences-dialog, .trick-history-dialog)::backdrop { background: rgba(5, 30, 23, .76); }
.solo-player-arena .table-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0; }
.solo-player-arena .table-dialog-heading h2 { margin: 0; color: var(--cream); font-size: 24px; line-height: 32px; }
.solo-player-arena .table-dialog-heading p { margin: 6px 0 0; color: var(--gold); font-size: 15px; }
.solo-player-arena .table-dialog-note { margin: 16px 0 20px; color: var(--muted); font-size: 15px; line-height: 23px; }
.solo-player-arena :is(.table-dialog-heading, .control-preset-options) button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  background: var(--felt);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}
.solo-player-arena :is(.table-dialog-heading, .control-preset-options) button:hover:not(:disabled) { border-color: var(--cream); }
.solo-player-arena :is(.table-dialog-heading, .control-preset-options) button:active:not(:disabled) { filter: brightness(.92); }
.solo-player-arena .control-preset-options button:disabled { opacity: .5; cursor: default; }
.solo-player-arena .control-preset-options button[aria-pressed="true"] { color: var(--ink); border-color: var(--gold); background: var(--gold); }
.solo-player-arena .table-preferences-dialog fieldset { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.solo-player-arena .table-preferences-dialog legend { margin-bottom: 10px; font-size: 16px; font-weight: 700; }
.solo-player-arena .control-preset-options { display: flex; flex-wrap: wrap; gap: 10px; }
.solo-player-arena .table-preferences-dialog fieldset small { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 22px; }
.solo-player-arena #trickHistoryEmpty { color: var(--muted); font-size: 15px; line-height: 23px; }
.solo-player-arena .trick-history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.solo-player-arena .trick-history-list li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.solo-player-arena .trick-history-seat { align-self: start; padding-top: 2px; font-size: 15px; line-height: 22px; }
.solo-player-arena .trick-history-type { display: block; margin-bottom: 8px; font-size: 15px; line-height: 22px; color: var(--gold); }
.solo-player-arena .trick-history-cards { display: flex; padding: 2px 3px 8px; overflow-x: auto; overflow-y: hidden; }
.solo-player-arena .trick-history-cards .playing-card.table { flex: 0 0 54px; width: 54px; height: 78px; margin-left: -14px; }
.solo-player-arena .trick-history-cards .playing-card.table:first-child { margin-left: 0; }
.solo-player-arena .trick-history-cards .card-corner { top: 3px; left: 5px; }
.solo-player-arena .trick-history-cards .card-corner b { font-size: 20px; }
.solo-player-arena .trick-history-cards .card-corner i { font-size: 16px; }
.solo-player-arena .trick-history-cards .playing-card.table.joker-labelled .card-corner b { font-size: 11px; }
.solo-player-arena .trick-flow-cue {
  position: absolute;
  left: 50%;
  top: 344px;
  transform: translateX(-50%);
  z-index: 8;
  padding: 5px 14px;
  border-radius: 8px;
  color: var(--cream);
  background: var(--felt-deep);
  font-size: 16px;
  line-height: 24px;
  pointer-events: none;
}
.solo-player-arena .trick-flow-cue[hidden] { display: none; }
.solo-player-arena .trick-motion-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.solo-player-arena .trick-collected-cards {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: confirmed-trick-collect 180ms cubic-bezier(.22, 1, .36, 1) both;
  pointer-events: none;
}
.solo-player-arena .trick-collected-cards > .playing-card.table { flex: 0 0 var(--collected-card-width); width: var(--collected-card-width); height: var(--collected-card-height); margin-left: var(--collected-card-overlap); }
.solo-player-arena .trick-collected-cards > .playing-card.table:first-child { margin-left: 0; }
.solo-player-arena .human-seat.play-entering .play-cards.confirmed-flight { animation: confirmed-seat-flight 220ms cubic-bezier(.22, 1, .36, 1); }
@keyframes confirmed-seat-flight {
  from { opacity: .25; transform: translate(var(--flight-x, 0px), var(--flight-y, 0px)) scale(.8); }
  to { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes confirmed-trick-collect {
  from { opacity: .55; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(.84); }
}
@media (max-width: 600px) {
  .solo-player-arena :is(.table-preferences-dialog, .trick-history-dialog) { padding: 18px; }
  .solo-player-arena .trick-history-list li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .solo-player-arena .human-seat.play-entering .play-cards.confirmed-flight,
  .solo-player-arena .trick-collected-cards { animation: none !important; }
  .solo-player-arena .trick-motion-layer { display: none; }
}
@media (forced-colors: active) {
  .solo-player-arena .control-preset-options button[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* Preparation only: a seated player can start without changing the live lanes. */
html.fixed-aspect-table .solo-lobby .table-center { display: none; }
html.fixed-aspect-table .solo-lobby .lobby-help {
  width: 560px;
  top: 460px;
  padding: 20px 24px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  backdrop-filter: none;
}
html.fixed-aspect-table .solo-lobby .lobby-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2em;
}
html.fixed-aspect-table .solo-lobby #lobbyTitle {
  margin-bottom: 12px;
  font-size: 40px;
  line-height: 1.2;
  font-weight: 800;
}
html.fixed-aspect-table .solo-lobby .lobby-introduction {
  margin: 0 0 18px;
  color: var(--cream);
  font-size: 19px;
  line-height: 28px;
}
html.fixed-aspect-table .solo-lobby #lobbyHelpText {
  min-height: 50px;
  font-size: 17px;
  line-height: 25px;
}
html.fixed-aspect-table .solo-lobby .has-error #lobbyHelpText { color: var(--hand-warning); }
html.fixed-aspect-table .solo-lobby .human-room-controls { margin-top: 6px; }
html.fixed-aspect-table .solo-lobby .ready-button {
  width: 320px;
  height: 80px;
  padding: 0 24px;
  justify-content: center;
  gap: 14px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--felt-shadow) 70%, transparent);
  font-size: 26px;
  font-weight: 800;
}
html.fixed-aspect-table .solo-lobby .ready-button > span { font-size: inherit; line-height: 1.2; }
html.fixed-aspect-table .solo-lobby .ready-button .ready-icon { display: none; }
html.fixed-aspect-table .solo-lobby .ready-button:hover:not(:disabled) { background: color-mix(in srgb, var(--gold) 82%, var(--paper)); }
html.fixed-aspect-table .solo-lobby .ready-button:active:not(:disabled) { filter: brightness(.94); }
html.fixed-aspect-table .solo-lobby .ready-button:focus-visible { outline: 3px solid var(--cream); outline-offset: 5px; }
html.fixed-aspect-table .solo-lobby .ready-button:disabled { opacity: .65; box-shadow: none; }
html.fixed-aspect-table .solo-lobby .ready-button.ready { border-color: var(--mint); color: var(--cream); background: var(--felt-deep); font-size: 21px; }
html.fixed-aspect-table .human-table-stage.solo-lobby[data-game] .human-seat {
  width: 250px;
  height: 112px;
  margin: 0;
  transform: none;
}
html.fixed-aspect-table .human-table-stage.solo-lobby[data-game] .human-seat.seat-top { top: 205px; left: 675px; right: auto; bottom: auto; }
html.fixed-aspect-table .human-table-stage.solo-lobby[data-game] .human-seat.seat-bottom { top: 670px; left: 675px; right: auto; bottom: auto; }
html.fixed-aspect-table .human-table-stage.solo-lobby[data-game] .human-seat.seat-left { top: 410px; left: 220px; right: auto; bottom: auto; }
html.fixed-aspect-table .human-table-stage.solo-lobby[data-game] .human-seat.seat-right { top: 410px; right: 220px; left: auto; bottom: auto; }
html.fixed-aspect-table .solo-lobby .human-seat .player-tag {
  width: 250px;
  height: 112px;
  padding: 18px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: 48px 22px;
  column-gap: 15px;
  row-gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--felt-deep);
  box-shadow: none;
  inset: 0;
  transform: none;
}
html.fixed-aspect-table .solo-lobby .human-seat[data-relation="partner"] .player-tag { border-color: color-mix(in srgb, var(--mint) 60%, var(--felt-deep)); }
html.fixed-aspect-table .solo-lobby .human-seat .seat-avatar {
  width: 64px;
  height: 72px;
  grid-column: 1;
  grid-row: 1 / 3;
  object-fit: cover;
  border-radius: 9px;
}
html.fixed-aspect-table .solo-lobby .human-seat .seat-number {
  width: 56px;
  height: 56px;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 22px;
}
html.fixed-aspect-table .solo-lobby .has-avatar .seat-number {
  width: 22px;
  height: 22px;
  position: absolute;
  left: 65px;
  top: auto;
  bottom: 15px;
  font-size: 12px;
}
html.fixed-aspect-table .solo-lobby .human-seat .player-identity { grid-column: 2; grid-row: 1; text-align: left; align-self: center; }
html.fixed-aspect-table .solo-lobby .human-seat .player-name { font-size: 20px; line-height: 25px; }
html.fixed-aspect-table .solo-lobby .human-seat .player-role { margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 18px; }
html.fixed-aspect-table .solo-lobby .human-seat .ready-mark {
  min-width: 0;
  width: auto;
  height: 22px;
  position: static;
  grid-column: 2;
  grid-row: 2;
  display: block;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}
html.fixed-aspect-table .solo-lobby .human-seat .ready-mark.ready { color: var(--mint); }

/* Table hardening: reserve geometry, not z-index masks. Compact teammate
   identity sits below the status strip and above the right fan's card faces.
   The teammate's clock occupies its own hidden-while-active play lane. */
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .player-tag {
  top: 18px;
  height: 80px;
  min-height: 80px;
  padding: 8px 12px;
}
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .player-name { font-size: 16px; line-height: 20px; }
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .player-role { line-height: 14px; }
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .ready-mark { height: 20px; font-size: 14px; line-height: 20px; }
html.fixed-aspect-table .solo-player-arena .human-seat.live-identity.seat-top .player-tag > .human-turn-countdown {
  top: 6px;
  left: -82px;
  right: auto;
}
html.fixed-aspect-table .solo-player-arena .play-button:disabled {
  background: var(--felt-deep);
  color: var(--muted);
  border-color: var(--line);
  opacity: .65;
  box-shadow: none;
}
.solo-player-arena .expand-hand-button {
  position: relative;
  z-index: 8;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 100px;
  width: 100px;
  min-height: 64px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--felt-deep);
  color: var(--cream);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}
.solo-player-arena .expand-hand-button .own-hand-remaining { display: block; color: var(--cream); }
.solo-player-arena .expand-hand-caption { color: var(--gold); font-size: 12px; line-height: 14px; white-space: normal; }
.solo-player-arena .expand-hand-button:hover:not(:disabled) { border-color: var(--gold); }
.solo-player-arena .expand-hand-button:disabled { opacity: .45; }
/* 36px more footer height is balanced by 36px less stacked-card envelope.
   Full-card selection is provided by the unscaled native picker below. */
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .own-hand-list {
  --own-hand-stack-max-height: 212px;
}
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .arrange-toolbar:not([hidden]) {
  min-height: 80px;
  padding-block: 0;
}
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] #guandanArrangeControls button,
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] #rankDisplayButton,
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .hand-tools button {
  height: 80px;
  min-height: 80px;
  min-width: 80px;
}
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .hand-tools .hand-tool-group-label { display: none; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .own-hand-copy { height: 80px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .expand-hand-button { min-height: 80px; }
.solo-player-arena .expanded-hand-dialog {
  width: min(740px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  color: var(--cream);
  background: var(--felt-deep);
}
.solo-player-arena .expanded-hand-dialog[open] { display: flex; flex-direction: column; }
.solo-player-arena .expanded-hand-dialog > .expanded-hand-heading,
.solo-player-arena .expanded-hand-dialog > .expanded-hand-footer { flex: 0 0 auto; padding: 12px 16px; }
.solo-player-arena .expanded-hand-dialog header { align-items: center; }
.solo-player-arena .expanded-hand-dialog header > button { width: 44px; height: 44px; }
.solo-player-arena #expandedHandStatus { flex: 0 0 auto; margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: 13px; }
.solo-player-arena .expanded-hand-groups { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; min-height: 0; overflow-y: auto; padding: 0 16px; overscroll-behavior: contain; }
.solo-player-arena .expanded-hand-group { flex: 0 1 var(--expanded-group-width); min-width: 180px; max-width: 100%; padding: 8px 0 12px; border-top: 1px solid var(--line); }
.solo-player-arena .expanded-group-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.solo-player-arena .expanded-group-heading strong { font-size: 13px; color: var(--muted); }
.solo-player-arena .expanded-group-select,
.solo-player-arena .expanded-hand-footer button { min-height: 44px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--felt); color: var(--cream); font: inherit; font-size: 14px; }
.solo-player-arena .expanded-group-select[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.solo-player-arena .expanded-group-select[aria-pressed="mixed"] { border-style: dashed; border-color: var(--gold); }
.solo-player-arena .expanded-group-cards { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px; }
.solo-player-arena .expanded-hand-card {
  position: relative;
  flex: 0 0 60px;
  width: 60px;
  min-height: 86px;
  height: 86px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
}
.solo-player-arena .expanded-hand-card .playing-card.hand { display: block; width: 60px; height: 86px; margin: 0; pointer-events: none; }
.solo-player-arena .expanded-hand-card .card-corner b { font-size: 22px; }
.solo-player-arena .expanded-hand-card .card-corner i { font-size: 15px; }
.solo-player-arena .expanded-hand-card .playing-card em { font-size: 30px; }
.solo-player-arena .expanded-hand-card .playing-card.joker .card-corner b { font-size: 14px; line-height: 20px; letter-spacing: 0; }
.solo-player-arena .expanded-hand-card .joker-artwork { top: 22px; height: calc(100% - 25px); }
.solo-player-arena .expanded-hand-card .card-level-mark { width: 16px; height: 16px; font-size: 10px; }
.solo-player-arena .expanded-hand-card:hover { outline: 2px solid var(--cream); outline-offset: 1px; }
.solo-player-arena .expanded-hand-card.selected { outline: 3px solid var(--gold); outline-offset: 1px; }
.solo-player-arena .expanded-hand-card.selected::after { content: "✓"; position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 14px; font-weight: 800; text-align: center; line-height: 20px; }
.solo-player-arena :is(.expanded-hand-card, .expanded-group-select, .expanded-hand-footer button, .expand-hand-button):focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.solo-player-arena .expanded-hand-footer { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); }
.solo-player-arena .expanded-hand-footer button { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.solo-player-arena :is(.expanded-group-select, .expanded-hand-footer button):hover { border-color: var(--cream); }

/* Five verified fixes: keep the table uniformly scaled, tools outside it. */
html.fixed-aspect-table .human-fixed-viewport.solo-player-arena .human-table-stage {
  left: calc(50% - var(--mobile-tools-rail, 0px) / 2);
}
.solo-player-arena .mobile-table-tools {
  position: fixed;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 80;
  min-height: 44px;
  width: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--cream);
  background: var(--felt);
  font: 650 13px/18px system-ui, sans-serif;
  cursor: pointer;
}
.solo-player-arena .mobile-table-tools[hidden] { display: none; }
@media (orientation: landscape) {
  .solo-player-arena .mobile-table-tools { top: calc(50% - 22px); bottom: auto; }
}
.solo-player-arena .mobile-table-tools:hover { border-color: var(--cream); }
.solo-player-arena .mobile-table-tools:active { filter: brightness(.92); }
.solo-player-arena .mobile-table-tools:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
.solo-player-arena .table-tools-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.solo-player-arena .table-preferences-dialog,
.solo-player-arena .trick-history-dialog { overflow: hidden; padding: 0; }
.solo-player-arena .table-preferences-dialog[open],
.solo-player-arena .trick-history-dialog[open] { display: flex; flex-direction: column; }
.solo-player-arena :is(.table-preferences-dialog, .trick-history-dialog) > .table-dialog-heading { flex: 0 0 auto; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.solo-player-arena .table-controls-body { min-height: 0; overflow-y: auto; padding: 0 24px 24px; overscroll-behavior: contain; }
.solo-player-arena .trick-history-body { min-height: 0; overflow-y: auto; padding: 0 24px 24px; overscroll-behavior: contain; }
.solo-player-arena .storage-notice { color: var(--hand-warning); font-size: 14px; line-height: 22px; }
.solo-player-arena #tableToolsArrange .control-preset-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.solo-player-arena #tableToolsArrange button[data-variant-count]::after { content: attr(data-variant-count); display: block; font-size: 13px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] #guandanArrangeControls button,
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] #rankDisplayButton,
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .hand-tools button,
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .expand-hand-button { font-size: 20px; line-height: 25px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] #guandanArrangeControls button::after { font-size: 17px; line-height: 22px; height: 22px; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .expand-hand-caption { font-size: 20px; line-height: 25px; }
/* English captions may wrap rather than disappear beyond a narrow pill. */
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .hand-tools button { white-space: normal; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .hand-tools #tableSoundButton { font-size: 20px; white-space: normal; }
html.fixed-aspect-table .solo-player-arena .human-table-stage[data-short-landscape="true"] .expand-hand-button { width: 120px; }
.solo-player-arena .rules-dialog {
  max-height: calc(100dvh - 32px);
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: hidden;
}
.solo-player-arena .rules-dialog[open] { display: flex; flex-direction: column; }
.solo-player-arena .rules-dialog :is(.rules-dialog-heading, .rules-dialog-footer) { flex: 0 0 auto; margin: 0; padding: 12px 16px; }
.solo-player-arena .rules-dialog .rules-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; max-height: none; margin: 0; padding: 0 16px 12px; overscroll-behavior: contain; }
.solo-player-arena .rules-dialog header > button { width: 44px; min-height: 44px; }
.solo-player-arena .rules-dialog .rules-dialog-footer { border-top: 1px solid var(--line); }
.solo-player-arena .rules-dialog .dialog-cancel { min-height: 44px; margin: 0; }
.solo-player-arena .rules-dialog-body h2 { font-size: 15px; }
.solo-player-arena .rules-dialog-body p { font-size: 14px; color: var(--cream); }
@media (max-width: 600px) {
  .solo-player-arena .rules-dialog .rules-dialog-body { grid-template-columns: minmax(0, 1fr); }
}

/* --- AI coach ------------------------------------------------------------ */
/* Advisory only: the panel never submits an action, and it is cleared the
   moment the decision it was computed for is replaced. */
/* The control lives in the hand-tool row, not beside the play buttons: the
   action dock is a fixed two-column/two-row grid re-tuned by a dozen contextual
   rules, so a third button there wraps out of the dock and lands on top of the
   hand.  Measured before the move: hint button spanned y 485-537 while the dock
   ended at 504 and the hand workspace started at 504, so the button's centre
   resolved to #ownHand and every real click was swallowed. */
.solo-player-arena .table-reading-tools .hint-button {
  min-width: 62px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(230, 199, 125, 0.5);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(2, 43, 30, 0.78);
  font-family: var(--serif);
  font-weight: 700;
  cursor: pointer;
}

.solo-player-arena .table-reading-tools .hint-button:hover:not(:disabled),
.solo-player-arena .table-reading-tools .hint-button[aria-expanded="true"] {
  border-color: rgba(230, 199, 125, 0.8);
  background: rgba(230, 199, 125, 0.2);
}

.solo-player-arena .table-reading-tools .hint-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* Top-layer dialog, matching .action-dialog's treatment.  As an in-flow panel it
   started at y=518 in a 900px viewport, covered the player's own hand and had its
   last lines clipped off-screen. */
.hint-dialog {
  /* Right-anchored and lightly dimmed on purpose: coaching is only useful if you
     can still see your own hand and the trick you are answering.  A centred
     dialog with a heavy blur hid both. */
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  overflow-y: auto;
  margin: 96px 24px auto auto;
  padding: 18px 20px;
  border: 1px solid rgba(230, 199, 125, 0.3);
  border-radius: 22px;
  color: var(--cream, #f3ead6);
  background: #071d16;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.56);
  font-size: 13px;
  line-height: 1.65;
}

.hint-dialog::backdrop {
  background: rgba(0, 17, 11, 0.28);
}

.hint-dialog header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.hint-dialog header small {
  display: block;
  color: var(--gold);
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hint-dialog header strong {
  font-family: var(--serif);
  font-size: 16px;
}

.hint-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-dialog .hint-apply {
  border-color: rgba(126, 231, 190, 0.5);
  color: #063829;
  background: var(--mint, #7ee7be);
  font-weight: 800;
}

.hint-dialog .hint-apply:hover {
  background: #96f0cc;
}

.hint-dialog header button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 15px;
  color: var(--muted, #a9b6ae);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

/* Touch targets: the dialog's own controls must stay comfortably tappable. */
@media (pointer: coarse) {
  .hint-dialog header button { padding: 11px 18px; font-size: 14px; }
}

.hint-status {
  margin: 0;
  color: var(--muted, #a9b6ae);
  font-size: 12px;
}

.hint-primary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
  border-radius: 11px;
  background: rgba(230, 199, 125, 0.09);
}

/* The card list is long; let it wrap as a whole instead of squeezing "推荐"
   into a vertical stack and breaking "红桃J" across lines. */
.hint-dialog .hint-primary-label { flex: 0 0 auto; white-space: nowrap; }
.hint-dialog .hint-primary strong { flex: 1 1 60%; min-width: 0; }

.hint-primary-label {
  color: var(--gold);
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.hint-primary strong {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.02em;
}

.hint-score {
  margin-left: auto;
  color: var(--muted, #a9b6ae);
  font-family: var(--mono, monospace);
  font-size: 11px;
}

.hint-reasons,
.hint-situation,
.hint-avoid,
.hint-alternatives ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.hint-reasons li,
.hint-situation li,
.hint-avoid li,
.hint-alternatives li {
  margin: 2px 0;
}

.hint-situation li { color: var(--muted, #a9b6ae); }

.hint-avoid li { color: #f0b7a4; }

.hint-subhead {
  display: block;
  margin: 10px 0 4px;
  color: var(--gold);
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hint-alternatives li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hint-scope {
  margin: 10px 0 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(230, 199, 125, 0.1);
  color: var(--gold);
  font-size: 11px;
  line-height: 1.5;
}

.hint-note {
  margin: 10px 0 0;
  color: var(--muted, #a9b6ae);
  font-size: 11px;
  font-style: italic;
}

@media (max-width: 600px) {
  .hint-dialog { padding: 13px 14px; }
  .hint-primary { flex-wrap: wrap; }
  .hint-primary strong { font-size: 16px; }
}

/* --- Responsive (non-fixed-aspect) geometry fixes ------------------------- */
/* This geometry is the authored mobile layout, but it had never rendered: the page
   pinned html.fixed-aspect-table, so nothing under 761px ever reached it.  Making
   the class runtime-selected exposed these defects.  Scoped with the same media
   queries the responsive rules use, and carrying .human-fixed-viewport to match
   their specificity -- without it the base absolute positions win. */
@media (max-width: 760px),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  /* The hint control sits in the reading-tools group, where the base rules size it
     as a text pill; on touch it needs the same 44px floor as its neighbours. */
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .table-reading-tools .hint-button {
    min-height: 44px;
    height: 44px;
  }

  /* That swipe caption is a transient label, not a control: it was painted across
     the very buttons it describes. */
  :where(html:not(.fixed-aspect-table)) .solo-player-arena .hand-scroll-hint {
    display: none;
  }
}

/* Portrait: the whole band from y=98 to the level HUD at y=216 is occupied -- seat
   chips, then the opponent card backs, then the HUD -- so a 44px reading-tools row
   placed anywhere in it ends up buried under one of them (verified: at y=98 it sat
   under the seat chips, at y=164 under the card backs).  The first genuinely empty
   band is the felt below the HUD. */
@media (max-width: 760px) and (orientation: portrait) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .table-reading-tools {
    top: 262px;
  }

  /* The hand tools and the arrange toolbar are two sibling rows that both landed in
     the same 44px band, so 选牌/展开叠牌 sat under 牌型分组.  Give the tools their
     own band above the toolbar.  Portrait has the vertical room; landscape does
     not, so landscape keeps the single row. */
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .hand-tools {
    bottom: 52px;
  }
}

/* Landscape: the action dock sits over the right end of the hand panel, so the
   rightmost rank groups were under it.  Reserve the dock's width inside the
   scrolling hand instead. */
@media (max-width: 760px) and (orientation: landscape),
  (min-width: 761px) and (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .table-reading-tools {
    top: 164px;
  }
  /* The action dock is a grid sibling of the hand inside .own-hand-panel, so the
     two must not overlap -- yet the trailing rank group's count badge sat under
     不出/出牌 whenever the hand had enough groups to reach the right edge.  That
     is the classic grid-item overflow: a column with the default `min-width: auto`
     refuses to shrink below its content, so the hand spilled across into the dock
     column.  Let the column shrink and let the hand scroll inside it.  (Narrowing
     the panel is not a fix: the dock is positioned relative to the panel, so it
     simply follows the narrowing and lands on the hand again.) */
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .own-hand-workspace,
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .own-hand-list {
    min-width: 0;
  }
  /* The panel's grid already gives the dock its own 224px column and the hand a
     minmax(0,1fr) column, so the hand must not paint outside its column -- yet the
     trailing rank group's count badge bled through the translucent 不出/出牌 pills.
     min-width alone only lets the column shrink; it does not clip, so the overflow
     still painted over the neighbouring column.  Clip it, and let the hand scroll
     inside the column instead of spilling across. */
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .own-hand-workspace {
    overflow: hidden;
  }
  :where(html:not(.fixed-aspect-table)) .human-fixed-viewport.solo-player-arena .own-hand-list {
    overflow-x: auto;
    max-width: 100%;
  }
}
