/* Mobile is a card table, not a dashboard. Desktop keeps its existing layout. */
.mobile-status,
.mobile-self,
#mobile-bid-status {
  display: none;
}
#score-summary {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.mobile-layout #table-view {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.mobile-layout .table-header {
  grid-column: 1;
  grid-row: 1;
  height: auto;
  min-height: 44px;
  gap: 8px;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0
    max(8px, env(safe-area-inset-left));
}
.mobile-layout .table-wordmark span {
  font-size: 16px;
}
.mobile-layout .table-wordmark .table-emblem {
  width: 20px;
  height: 26px;
  font-size: 22px;
}
.mobile-layout .table-location {
  flex: 0 1 150px;
  font-size: 11px;
}
.mobile-layout .mobile-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}
.mobile-layout .mobile-status .trump-indicator {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
}
.mobile-layout .compact-score {
  width: auto;
  flex-shrink: 0;
}
.mobile-layout #score-summary {
  min-height: 44px;
  gap: 4px;
  font-size: 11px;
  align-items: center;
}
.mobile-layout #score-summary > b {
  font-size: 22px;
}
.mobile-layout .score-goal {
  display: none;
}
.mobile-layout #score-provisional {
  font-size: 9px;
}
.mobile-layout #mobile-signals {
  min-height: 44px;
  padding: 0;
  max-width: 100px;
  border: 0;
  background: none;
  color: #e0d4ac;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-layout .table-tools #table-log-toggle {
  display: none;
}
.mobile-layout .table-topline {
  display: none;
}
.mobile-layout #connection-banner {
  grid-column: 1;
  grid-row: 2;
}
.mobile-layout .table-playarea {
  grid-column: 1;
  grid-row: 3;
}
.mobile-layout .table-playarea .arena {
  margin: 0 max(6px, env(safe-area-inset-right)) 0
    max(6px, env(safe-area-inset-left));
}
.mobile-layout .felt-ring {
  inset: 12px 4%;
  border-radius: 24px;
  opacity: 0.35;
}
.mobile-layout .felt-ring.inner,
.mobile-layout #point-pile,
.mobile-layout .escape-effect {
  display: none;
}
.mobile-layout .play-cluster > small:empty {
  display: none;
}
.mobile-layout #center-bid {
  width: 65%;
}
.mobile-layout #center-bid h2,
.mobile-layout #bid-description {
  display: none;
}
.mobile-layout #mobile-bid-status {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #d9dfc5;
}

/* One action rail, then one broad hand. Personal identity sits beside the hand. */
.mobile-layout .hand-dock {
  position: relative;
  grid-column: 1;
  grid-row: 4;
  grid-template-columns: 56px minmax(0, 1fr) auto 32px;
  grid-template-rows: 44px 100px;
  align-content: start;
  align-items: center;
  gap: 0 6px;
  border-left: 0;
  border-top: 1px solid #d9dfc81c;
  padding: 3px max(8px, env(safe-area-inset-right))
    max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  --card-w: 60px;
  --card-h: 84px;
}
.mobile-layout .mobile-self {
  display: flex;
  grid-column: 1;
  grid-row: 1/3;
  align-self: end;
  justify-content: center;
  padding-bottom: 5px;
}
.mobile-layout .mobile-self .seat.you {
  position: static;
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  width: 56px;
  max-width: 56px;
}
.mobile-layout .mobile-self .seat.you .seat-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  font-size: 23px;
}
.mobile-layout .mobile-self .seat.you .seat-avatar:after {
  display: none;
}
.mobile-layout .mobile-self .seat.you .seat-name {
  font-size: 12px;
  max-width: 56px;
}
.mobile-layout .mobile-self .seat.you .seat-badge {
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}
.mobile-layout .instruction-copy {
  grid-column: 2;
  grid-row: 1;
  text-align: left;
}
.mobile-layout .instruction-copy h2 {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.mobile-layout .instruction-copy p {
  display: none;
}
.mobile-layout .clock {
  grid-column: 4;
  grid-row: 1;
  width: 30px;
  height: 30px;
}
.mobile-layout .clock > span {
  font-size: 13px;
}
.mobile-layout .hand-actions {
  grid-column: 3;
  grid-row: 1;
  width: auto;
  gap: 6px;
  margin: 0;
  align-items: center;
}
.mobile-layout .hand-dock[data-actions="false"] .hand-actions {
  display: none;
}
.mobile-layout .hand-actions .button {
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
}
.mobile-layout #hand-hint {
  min-width: 56px;
}
.mobile-layout #hand-clear {
  min-width: 44px;
  padding: 0 6px;
}
.mobile-layout #hand-confirm {
  min-width: 78px;
  flex: initial;
}
.mobile-layout .hand-scroll {
  grid-column: 2/-1;
  grid-row: 2;
  width: 100%;
  height: 100px;
  min-height: 0;
  padding: 14px 2px 2px;
}
.mobile-layout .hand {
  min-height: 84px;
  gap: 8px;
}
.mobile-layout .hand-bottom {
  display: none;
}
.mobile-layout .hand .poker-card.selected,
.mobile-layout .hand .poker-card.selectable.selected:not(:disabled):hover {
  transform: translateY(-10px);
}
.mobile-layout #mobile-bidding {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: calc(
    100vw - 190px - env(safe-area-inset-left) - env(safe-area-inset-right)
  );
}
.mobile-layout #bid-pass {
  min-width: 62px;
  min-height: 44px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid #bbcaa555;
  border-radius: 8px;
  background: #163b2b;
  color: #e3e9d7;
  font-size: 14px;
  flex-shrink: 0;
}
.mobile-layout #mobile-bidding[data-choices="false"] #bid-pass {
  background: var(--gold);
  border-color: var(--gold);
  color: #243b2b;
}
.mobile-layout #bid-options {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 6px;
  margin: 0;
  padding: 0;
  max-height: 44px;
  overflow: auto;
  scrollbar-width: none;
}
.mobile-layout .bid-option {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-width: 62px;
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  border-radius: 8px;
}
.mobile-layout .bid-option b {
  font-size: 18px;
}
.mobile-layout .bid-option small {
  font-size: 11px;
}
.mobile-layout .hand-folded .hand-dock {
  grid-template-rows: 52px;
  grid-template-columns: 72px minmax(0, 1fr) auto 32px;
}
.mobile-layout .hand-folded .mobile-self {
  grid-row: 1;
  align-self: center;
  padding: 0;
}
.mobile-layout .hand-folded .mobile-self .seat.you {
  display: grid;
  grid-template-columns: 30px 1fr;
  width: 72px;
  max-width: 72px;
  text-align: left;
}
.mobile-layout .hand-folded .mobile-self .seat-avatar {
  width: 28px;
  height: 28px;
  font-size: 18px;
  grid-row: 1/3;
}
.mobile-layout .hand-folded .mobile-self .seat-name {
  font-size: 11px;
  max-width: 39px;
}
.mobile-layout .hand-folded .mobile-self .seat-badge {
  white-space: nowrap;
  overflow: hidden;
  max-width: 39px;
  text-align: left;
}
.mobile-layout .table-view[data-phase="lobby"] .hand-dock,
.mobile-layout .table-view[data-phase="finished"] .hand-dock {
  display: none;
}

/* Native top layer escapes the arena's isolation/overflow. Only fields scroll;
   the title and confirmation row cannot disappear behind the hand or keyboard. */
.mobile-layout #call-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  inset: calc(var(--viewport-top, 0px) + 8px)
    max(8px, env(safe-area-inset-right)) calc(var(--keyboard-inset, 0px) + 8px)
    max(8px, env(safe-area-inset-left));
  margin: auto;
  width: min(92vw, 520px);
  max-width: calc(
    100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px
  );
  height: fit-content;
  max-height: min(300px, calc(var(--visible-height, 100dvh) - 16px));
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #f5f0e4;
  color: #263e2e;
  animation: none;
}
#call-dialog::backdrop {
  background: #071b1580;
  backdrop-filter: none;
}
.call-dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 40px;
  border-bottom: 1px solid #29412e22;
}
.call-dialog-head h2 {
  flex: 1;
  font-size: 17px;
  margin: 0;
  letter-spacing: 0;
}
.call-dialog-head button {
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #425b46;
  font-size: 12px;
}
#call-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #81612d;
}
#mobile-call-host {
  display: grid;
  min-height: 0;
}
.mobile-layout #call-dialog #center-call {
  position: static;
  transform: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: none;
  box-shadow: none;
}
.mobile-layout #call-dialog #center-call > h2,
.mobile-layout #call-dialog #center-call > .overline {
  display: none;
}
.mobile-layout #call-dialog #call-note {
  grid-row: 1;
  text-align: left;
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #52664f;
}
.mobile-layout #call-dialog #call-fields {
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  gap: 8px;
  margin: 0;
  padding: 6px 12px 10px;
  align-content: start;
}
.mobile-layout #call-dialog .call-field {
  display: block;
  padding: 6px;
  margin: 0;
  background: #e9ede0;
  border-color: #b7c5ae;
}
.mobile-layout #call-dialog .call-field legend {
  font-size: 11px;
  color: #4a6245;
}
.mobile-layout #call-dialog .call-selects select {
  min-height: 40px;
  width: 0;
  flex: 1;
  padding: 4px;
  font-size: 16px;
  color: #263e2e;
  background: #fffdf4;
  border-color: #a7b799;
}
.mobile-layout #call-dialog .center-actions {
  grid-row: 3;
  display: flex;
  flex-wrap: nowrap;
  padding: 8px 12px;
  margin: 0;
  gap: 8px;
  background: #f5f0e4;
  border-top: 1px solid #29412e22;
}
.mobile-layout #call-dialog .center-actions .button {
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
}
.mobile-layout #call-dialog #call-solo {
  color: #425b46;
  border-color: #b7c5ae;
}
.mobile-layout #call-dialog .dialog-error {
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
}
@media (min-width: 600px) {
  .mobile-layout #call-dialog #call-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-height: 280px) {
  .mobile-layout #call-dialog #call-note {
    display: none;
  }
}

/* Progress, history and hand controls stay available, collapsed in More. */
.mobile-layout .mobile-menu-actions {
  display: grid;
}
.mobile-layout .mobile-menu-actions details {
  border-bottom: 1px solid #29412e22;
  padding: 0 0 8px;
}
.mobile-layout .mobile-menu-actions summary {
  min-height: 44px;
  padding: 12px 4px;
  font-size: 15px;
  cursor: pointer;
  color: #29412e;
}
.mobile-layout .mobile-menu-actions details > p {
  margin: 6px 4px 16px;
  font-size: 13px;
}
.mobile-layout #mobile-score-host {
  padding: 0 12px 18px;
}
.mobile-layout #mobile-score-host .score-scale {
  width: 100%;
}
.mobile-layout #mobile-score-host .score-mark {
  color: #52654f;
  font-size: 12px;
}
.mobile-layout #mobile-score-host .score-mark.is-target {
  color: #795023;
}
.mobile-layout #mobile-score-host .score-meter {
  background: #d4dccb;
}
.mobile-layout .mobile-menu-actions .table-under {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4px;
  gap: 8px;
  border: 0;
}
.mobile-layout .mobile-menu-actions #secret-content {
  display: block;
  max-height: none;
  white-space: normal;
  color: #29412e;
  font-size: 13px;
}
.mobile-layout .mobile-menu-actions .secret-card {
  display: inline-flex;
  margin: 4px 10px 4px 0;
  color: #29412e;
}
.mobile-layout .mobile-menu-actions .secret-card small {
  color: #52654f;
  font-size: 12px;
}
.mobile-layout .mobile-menu-actions #table-history,
.mobile-layout .mobile-menu-actions #table-result {
  color: #29412e;
  text-align: left;
  font-size: 14px;
}
.mobile-layout .mobile-menu-actions .hand-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
}
.mobile-layout .mobile-menu-actions .hand-tabs {
  flex: 1 1 100%;
}
.mobile-layout .mobile-menu-actions .hand-tabs button,
.mobile-layout .mobile-menu-actions #hand-fold,
.mobile-layout .mobile-menu-actions #hand-select-mode {
  color: #29412e;
  min-height: 44px;
  font-size: 13px;
}
@media (max-width: 480px) {
  .mobile-layout .table-location {
    display: none;
  }
  .mobile-layout .mobile-status {
    gap: 7px;
  }
  .mobile-layout .hand-dock:has(.instruction-copy.invalid) {
    grid-template-rows: auto 44px 100px;
  }
  .mobile-layout .instruction-copy.invalid {
    grid-column: 2/-1;
    padding-top: 5px;
  }
  .mobile-layout .instruction-copy.invalid h2 {
    display: none;
  }
  .mobile-layout .instruction-copy.invalid p {
    display: block;
    margin: 0;
    font-size: 12px;
  }
  .mobile-layout .hand-dock:has(.instruction-copy.invalid) .hand-actions,
  .mobile-layout .hand-dock:has(.instruction-copy.invalid) .clock {
    grid-row: 2;
  }
  .mobile-layout .hand-dock:has(.instruction-copy.invalid) .hand-scroll {
    grid-row: 3;
  }
  .mobile-layout .hand-dock:has(.instruction-copy.invalid) .mobile-self {
    grid-row: 1/4;
  }
}

/* Wide, shallow arena: every opponent stays in view. No side hand pane. */
html.mobile-layout {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.mobile-layout #table-view {
  top: var(--viewport-top, 0px);
  height: var(--visible-height, 100dvh);
}
.mobile-landscape .table-header {
  min-height: 40px;
  gap: 6px;
}
.mobile-landscape .table-wordmark span {
  font-size: 15px;
}
.mobile-landscape .table-wordmark .table-emblem {
  width: 18px;
  height: 22px;
  font-size: 20px;
}
.mobile-landscape .table-location {
  font-size: 10px;
}
.mobile-landscape .table-tools #table-menu {
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.mobile-landscape #score-summary,
.mobile-landscape #mobile-signals {
  min-height: 40px;
}
.mobile-landscape #score-summary > b {
  font-size: 20px;
}
.mobile-landscape .hand-actions .button,
.mobile-landscape #bid-pass,
.mobile-landscape .bid-option {
  min-height: 40px;
}
.mobile-landscape #bid-options {
  max-height: 40px;
}
.mobile-landscape .instruction-copy h2 {
  font-size: 12px;
}
.mobile-landscape .clock {
  width: 28px;
  height: 28px;
}
.mobile-landscape .mobile-self .seat.you {
  width: 48px;
  max-width: 48px;
}
.mobile-landscape .mobile-self .seat.you .seat-avatar {
  width: 34px;
  height: 34px;
  font-size: 20px;
}
.mobile-landscape .mobile-self .seat.you .seat-name {
  font-size: 11px;
  max-width: 48px;
}
.mobile-landscape .mobile-self .seat.you .seat-badge {
  font-size: 9px;
}
.mobile-landscape .hand .poker-card.selected,
.mobile-landscape .hand .poker-card.selectable.selected:not(:disabled):hover {
  transform: translateY(-8px);
}
.mobile-landscape .table-playarea {
  overflow: hidden;
}
.mobile-landscape .table-playarea .arena,
.mobile-landscape .table-playarea .arena[data-many="true"] {
  min-height: 0;
  height: 100%;
}
.mobile-landscape .hand-dock {
  --card-w: 48px;
  --card-h: 64px;
  grid-template-columns: 48px minmax(0, 1fr) auto 28px;
  grid-template-rows: 40px 76px;
  column-gap: 4px;
}
.mobile-landscape .hand-scroll {
  height: 76px;
  padding-top: 10px;
}
.mobile-landscape .hand {
  min-height: 64px;
}
.mobile-landscape .hand .card-corner {
  font-size: 17px;
}
.mobile-landscape .hand .card-corner span:last-child {
  font-size: 14px;
}
.mobile-landscape .hand .card-symbol {
  font-size: 25px;
}
.mobile-landscape .instruction-copy.invalid h2 {
  display: none;
}
.mobile-landscape .instruction-copy.invalid p {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  max-height: 42px;
  overflow: auto;
}
.mobile-landscape .arena .seat,
.mobile-landscape .arena .seat.top-seat {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 1px 5px;
  align-items: center;
  text-align: left;
  width: 86px;
  max-width: 86px;
  min-width: 0;
}
.mobile-landscape .arena .seat-avatar {
  width: 30px;
  height: 30px;
  font-size: 18px;
  grid-row: 1/3;
}
.mobile-landscape .arena .seat-name {
  font-size: 12px;
  max-width: 51px;
}
.mobile-landscape .arena .seat-badge {
  font-size: 10px;
  max-width: 51px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}
.mobile-landscape .arena[data-many="true"] .seat {
  width: 64px;
  max-width: 64px;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 1px 4px;
}
.mobile-landscape .arena[data-many="true"] .seat-avatar {
  width: 26px;
  height: 26px;
  font-size: 16px;
}
.mobile-landscape .arena[data-many="true"] .seat-name {
  font-size: 11px;
  max-width: 36px;
}
.mobile-landscape .arena[data-many="true"] .seat-badge {
  font-size: 9px;
  max-width: 36px;
}
.mobile-landscape .play-cluster {
  gap: 2px;
}
.mobile-landscape .play-cluster .mini-hand {
  padding-left: 0;
}
.mobile-landscape .play-cluster .poker-card,
.mobile-landscape .arena[data-many="true"] .play-cluster .poker-card {
  --card-w: 30px;
  --card-h: 38px;
}
.mobile-landscape .play-cluster .poker-card:not(:last-child) {
  margin-right: -19px;
}
.mobile-landscape .play-cluster .card-corner {
  font-size: 12px;
  top: 2px;
}
.mobile-landscape .play-cluster .card-corner span:last-child {
  font-size: 10px;
}
.mobile-landscape .play-cluster .card-symbol {
  font-size: 17px;
}
.mobile-landscape .play-cluster > small {
  font-size: 10px;
  line-height: 12px;
  min-height: 12px;
  max-width: 42px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-landscape .play-cluster .joker-icon {
  width: 22px;
  height: 25px;
  bottom: 3px;
}
.mobile-landscape .center-message h2 {
  font-size: 18px;
}
.mobile-landscape .center-message p {
  display: none;
}
.mobile-landscape .arena[data-many="false"] .seat:not(.top-seat):not(.you) {
  width: 72px;
  max-width: 72px;
  grid-template-columns: 28px minmax(0, 1fr);
}
.mobile-landscape
  .arena[data-many="false"]
  .seat:not(.top-seat):not(.you)
  .seat-name,
.mobile-landscape
  .arena[data-many="false"]
  .seat:not(.top-seat):not(.you)
  .seat-badge {
  max-width: 39px;
}
.mobile-landscape .arena .seat.you .seat-avatar {
  width: 30px;
  height: 30px;
}
.mobile-landscape .arena .seat.you .seat-name {
  font-size: 12px;
}
@media (max-height: 300px) {
  .mobile-landscape .table-playarea {
    overflow: auto;
  }
  .mobile-landscape .table-playarea .arena,
  .mobile-landscape .table-playarea .arena[data-many="true"] {
    min-height: 140px;
  }
}
