/* One mobile layout layer; desktop sizes and game rules remain untouched. */
#table-menu,
#hand-fold {
  display: none;
}
button.play-cluster {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  pointer-events: auto;
  touch-action: manipulation;
}
button.play-cluster:active:not(:disabled) {
  transform: translate(-50%, -50%);
}
button.play-cluster .mini-hand {
  pointer-events: none;
}
body.modal-open {
  overflow: hidden;
}
#mobile-log-host .timeline-panel {
  position: static;
  height: min(62dvh, 560px);
  padding: 0;
}
#mobile-log-host .timeline-heading {
  display: none;
}
.mobile-menu-actions {
  gap: 10px;
}
.mobile-menu-actions .button {
  min-height: 48px;
  text-align: left;
  justify-content: flex-start;
}
#room-share {
  margin-top: 10px;
}

.mobile-layout #table-view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  --card-w: 64px;
  --card-h: 88px;
}
.mobile-layout .table-header {
  grid-row: 1;
  min-height: 48px;
  height: auto;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0
    max(8px, env(safe-area-inset-left));
  gap: 8px;
}
.mobile-layout .table-wordmark {
  gap: 5px;
  flex-shrink: 0;
}
.mobile-layout .table-wordmark span {
  font-size: 18px;
  letter-spacing: 1px;
}
.mobile-layout .table-wordmark small {
  display: none;
}
.mobile-layout .table-wordmark .table-emblem {
  width: 23px;
  height: 30px;
  font-size: 24px;
}
.mobile-layout .table-location {
  flex: 1;
  min-width: 0;
  max-width: none;
  font-size: 11px;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
}
.mobile-layout #table-location {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-layout #table-invite {
  display: none;
}
.mobile-layout .table-tools {
  gap: 0;
}
.mobile-layout .table-tools #table-account,
.mobile-layout .table-tools #table-rules,
.mobile-layout .table-tools [data-help],
.mobile-layout #table-sound {
  display: none;
}
.mobile-layout .table-tools #table-menu,
.mobile-layout .table-tools #table-log-toggle {
  display: block;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  font-size: 24px;
  padding: 0;
  color: #e0e7d3;
}
.mobile-layout #connection-banner {
  grid-row: 2;
  padding: 6px 12px;
  font-size: 12px;
}
.mobile-layout .table-topline {
  grid-row: 3;
  min-height: 0;
  padding: 5px 10px 7px;
  gap: 5px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.mobile-layout .table-topline .trump-indicator {
  grid-row: 1;
  grid-column: 1;
  font-size: 13px;
  padding: 5px 7px;
  border-width: 1px;
  letter-spacing: 0;
}
.mobile-layout .table-topline .rules-line {
  grid-row: 2;
  grid-column: 1/-1;
  font-size: 10px;
  gap: 8px;
}
.mobile-layout .rules-line span + span:before {
  margin-right: 8px;
}
.mobile-layout .table-topline .compact-score {
  grid-row: 1;
  grid-column: 2;
  font-size: 11px;
  gap: 4px;
  justify-self: end;
}
.mobile-layout .compact-score > b {
  font-size: 26px;
}
.mobile-layout .score-meter {
  display: none;
}
.mobile-layout #score-provisional {
  font-size: 10px;
}
.mobile-layout .table-playarea {
  grid-row: 4;
  display: block;
  min-height: 0;
  overflow: auto;
  padding: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
}
.mobile-layout .table-playarea .timeline {
  display: none;
}
.mobile-layout .table-playarea .arena {
  height: 100%;
  min-height: 320px;
  margin: 0 8px;
}
.mobile-layout .table-playarea .arena[data-many="true"] {
  min-height: 440px;
}
.mobile-layout .seat {
  min-width: 0;
  max-width: 72px;
  gap: 2px;
}
.mobile-layout .seat-avatar {
  width: 36px;
  height: 36px;
  font-size: 20px;
}
.mobile-layout .seat-name,
.mobile-layout .arena[data-many="true"] .seat-name {
  font-size: 12px;
  max-width: 68px;
}
.mobile-layout .seat-name small {
  display: none;
}
.mobile-layout .seat-badge {
  font-size: 10px;
  white-space: nowrap;
}
.mobile-layout .top-seat {
  display: flex;
  flex-direction: column;
}
.mobile-layout .seat.you {
  min-width: 170px;
  max-width: 260px;
  flex-direction: row;
  gap: 8px;
}
.mobile-layout .seat.you .seat-avatar {
  width: 46px;
  height: 46px;
  font-size: 23px;
}
.mobile-layout .seat.you .seat-name {
  font-size: 16px;
  max-width: 105px;
}
.mobile-layout .seat.you .seat-badge {
  font-size: 11px;
}
.mobile-layout .arena[data-many="true"] .seat-avatar {
  width: 32px;
  height: 32px;
  font-size: 18px;
}
.mobile-layout .arena[data-many="true"] .seat.you .seat-avatar {
  width: 42px;
  height: 42px;
  font-size: 22px;
}
.mobile-layout .arena[data-many="true"] .seat-name {
  max-width: 54px;
}
.mobile-layout .arena[data-many="true"] .seat.you .seat-name {
  max-width: 100px;
}
.mobile-layout .play-cluster {
  gap: 5px;
  max-width: 84px;
}
.mobile-layout .play-cluster .poker-card {
  --card-w: 37px;
  --card-h: 53px;
}
.mobile-layout .play-cluster .poker-card:not(:last-child) {
  margin-right: -22px;
}
.mobile-layout .play-cluster .card-corner {
  font-size: 13px;
  left: 2px;
  top: 3px;
}
.mobile-layout .play-cluster .card-corner span:last-child {
  font-size: 11px;
}
.mobile-layout .play-cluster .card-symbol {
  font-size: 21px;
  right: 3px;
  bottom: 4px;
}
.mobile-layout .play-cluster .point-mark {
  font-size: 6px;
  min-width: 15px;
}
.mobile-layout .play-cluster > small {
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
  max-width: 80px;
  text-align: center;
}
.mobile-layout .arena[data-many="true"] .play-cluster {
  max-width: 66px;
}
.mobile-layout .arena[data-many="true"] .play-cluster .poker-card {
  --card-w: 34px;
  --card-h: 48px;
}
.mobile-layout .play-cluster.leading > small {
  padding: 2px 3px;
}
.mobile-layout .play-cluster .joker-icon {
  width: 25px;
  height: 30px;
  bottom: 7px;
}
.mobile-layout .point-pile {
  width: 132px;
  gap: 8px;
  padding-bottom: 15px;
}
.mobile-layout .pile-stack {
  width: 35px;
  height: 50px;
}
.mobile-layout .pile-stack .poker-card {
  --card-w: 30px;
  --card-h: 44px;
}
.mobile-layout .pile-stack .card-corner {
  font-size: 11px;
}
.mobile-layout .pile-stack .card-corner span:last-child {
  font-size: 9px;
}
.mobile-layout .pile-stack .card-symbol {
  font-size: 18px;
}
.mobile-layout .pile-stack .point-mark {
  font-size: 5px;
  min-width: 13px;
}
.mobile-layout .empty-pile {
  width: 30px;
  height: 44px;
  font-size: 15px;
}
.mobile-layout .pile-label > small {
  font-size: 10px;
}
.mobile-layout .pile-label > strong {
  font-size: 28px;
}
.mobile-layout .pile-escaped {
  font-size: 9px;
}
.mobile-layout .arena[data-many="true"] .point-pile {
  width: 90px;
  padding-bottom: 12px;
  justify-content: center;
}
.mobile-layout .arena[data-many="true"] .pile-stack {
  display: none;
}
.mobile-layout .arena[data-many="true"] .pile-label {
  align-items: center;
}
.mobile-layout .arena[data-many="true"] .pile-escaped {
  font-size: 8px;
}
.mobile-layout .center-panel {
  width: 76%;
}
.mobile-layout .center-panel h2 {
  font-size: 23px;
  margin-top: 8px;
}
.mobile-layout .center-panel p {
  font-size: 12px;
  line-height: 1.5;
}
.mobile-layout .center-panel .overline {
  display: none;
}
.mobile-layout .center-actions {
  gap: 8px;
}
.mobile-layout .center-panel .button,
.mobile-layout #bid-pass,
.mobile-layout .bid-option {
  min-height: 44px;
  font-size: 13px;
}
.mobile-layout .call-fields {
  max-height: 170px;
  overflow: auto;
  overscroll-behavior: contain;
}
.mobile-layout .call-fields[data-many="true"] {
  max-height: 190px;
}
.mobile-layout .call-field {
  padding: 8px;
}
.mobile-layout .call-field small {
  display: none;
}
.mobile-layout .call-field legend {
  font-size: 11px;
}
.mobile-layout .call-selects select {
  font-size: 16px;
  min-height: 44px;
  flex: 1;
  width: 0;
}
.mobile-layout .bid-options {
  max-height: 140px;
  overflow: auto;
}
.mobile-layout .reveal-note {
  top: 4px;
  padding: 8px 10px;
  width: max-content;
  max-width: 92%;
}
.mobile-layout .reveal-note strong {
  font-size: 14px;
}
.mobile-layout .reveal-note small {
  font-size: 10px;
}
.mobile-layout .table-under {
  grid-row: 5;
  min-height: 0;
  padding: 0 10px;
  gap: 8px;
}
.mobile-layout .secret-label {
  display: none;
}
.mobile-layout #secret-content {
  max-height: 44px;
  white-space: nowrap;
  overflow: auto;
  scrollbar-width: none;
}
.mobile-layout .secret-card {
  margin-right: 10px;
}
.mobile-layout .secret-card b {
  font-size: 16px;
}
.mobile-layout .secret-card small {
  font-size: 10px;
}
.mobile-layout #table-history,
.mobile-layout #table-result {
  min-height: 44px;
  flex-shrink: 0;
  font-size: 11px;
}
.mobile-layout .hand-dock {
  grid-row: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 4px 8px;
  padding: 8px max(10px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  min-width: 0;
  border-top: 1px solid #d9dfc833;
}
.mobile-layout .turn-instruction {
  display: contents;
}
.mobile-layout .instruction-copy {
  grid-row: 1;
  grid-column: 1;
  display: block;
  min-width: 0;
}
.mobile-layout .step-label {
  display: none;
}
.mobile-layout .instruction-copy h2 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}
.mobile-layout .instruction-copy p {
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}
.mobile-layout .clock {
  grid-row: 1;
  grid-column: 2;
  width: 38px;
  height: 38px;
  align-self: center;
}
.mobile-layout .clock > span {
  font-size: 15px;
}
.mobile-layout .hand-caption {
  grid-row: 2;
  grid-column: 1/-1;
  display: flex;
  gap: 4px;
  margin: 0;
  min-width: 0;
}
.mobile-layout .hand-tabs {
  flex: 1;
  min-width: 0;
  overflow: auto;
  white-space: nowrap;
  scrollbar-width: none;
  gap: 0;
}
.mobile-layout .hand-tabs button {
  min-height: 44px;
  padding: 0 8px;
  font-size: 12px;
  flex-shrink: 0;
}
.mobile-layout .hand-tabs small {
  font-size: 10px;
}
.mobile-layout #hand-summary {
  display: none;
}
.mobile-layout #hand-fold,
.mobile-layout #hand-select-mode {
  display: block;
  min-height: 44px;
  min-width: 44px;
  padding: 0 7px;
  font-size: 11px;
  flex-shrink: 0;
}
.mobile-layout #hand-fold {
  color: #d4dfbd;
}
.mobile-layout .hand-scroll {
  grid-row: 3;
  grid-column: 1/-1;
  min-height: 114px;
  height: 114px;
  padding: 20px 2px 6px;
  overscroll-behavior-x: contain;
  -webkit-touch-callout: none;
}
.mobile-layout .hand {
  min-height: 88px;
  gap: 8px;
}
.mobile-layout .hand .poker-card {
  touch-action: pan-x pan-y pinch-zoom;
}
.mobile-layout .hand-scroll.select-mode .poker-card {
  touch-action: none;
}
.mobile-layout .hand .card-corner {
  font-size: 20px;
  left: 3px;
}
.mobile-layout .hand .card-corner span:last-child {
  font-size: 16px;
}
.mobile-layout .hand .joker .card-corner {
  font-size: 13px;
}
.mobile-layout .hand .joker-icon {
  width: 37px;
  height: 44px;
}
.mobile-layout .hand-bottom {
  grid-row: 4;
  grid-column: 1/-1;
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
}
.mobile-layout .hand-bottom > span:last-child {
  display: none;
}
.mobile-layout .hand-actions {
  grid-row: 5;
  grid-column: 1/-1;
  display: flex;
  gap: 8px;
  width: 100%;
  margin: 2px 0 0;
}
.mobile-layout .hand-actions .button {
  min-height: 46px;
  font-size: 14px;
  padding: 0 14px;
}
.mobile-layout #hand-confirm {
  flex: 1;
  min-width: 100px;
}
.mobile-layout #hand-hint {
  min-width: 88px;
}
.mobile-layout #hand-clear {
  min-width: 56px;
}
.mobile-layout .table-view.hand-folded .hand-scroll,
.mobile-layout .table-view.hand-folded .hand-bottom,
.mobile-layout .table-view.hand-folded .instruction-copy p {
  display: none;
}
.mobile-layout .table-view[data-phase="lobby"] .hand-caption,
.mobile-layout .table-view[data-phase="lobby"] .hand-scroll,
.mobile-layout .table-view[data-phase="lobby"] .hand-bottom,
.mobile-layout .table-view[data-phase="finished"] .hand-caption,
.mobile-layout .table-view[data-phase="finished"] .hand-scroll,
.mobile-layout .table-view[data-phase="finished"] .hand-bottom {
  display: none;
}
.mobile-layout dialog[open] {
  position: fixed;
  inset: auto 0 var(--keyboard-inset, 0px);
  margin: 0 auto;
  width: 100%;
  max-width: 700px;
  max-height: min(92dvh, calc(var(--visible-height, 100dvh) - 12px));
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior: contain;
}
.mobile-layout .dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  padding: 18px 20px;
}
.mobile-layout .dialog-head h2 {
  font-size: 23px;
  padding-right: 32px;
}
.mobile-layout .dialog-head > button {
  width: 44px;
  height: 44px;
  right: 10px;
  top: 10px;
}
.mobile-layout .dialog-body {
  padding: 18px 20px;
  gap: 15px;
}
.mobile-layout .dialog-foot {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  padding: 14px 20px;
  z-index: 2;
}
.mobile-layout dialog input,
.mobile-layout dialog select {
  font-size: 16px;
  min-height: 44px;
  min-width: 0;
}
.mobile-layout dialog .button,
.mobile-layout .choice-row button,
.mobile-layout .account-avatar-area label {
  min-height: 44px;
  font-size: 14px;
}
.mobile-layout #mobile-log-host .timeline-panel {
  height: min(62dvh, calc(var(--visible-height, 100dvh) - 150px));
}
.mobile-layout #log-dialog {
  background: var(--scene-panel, #18382e);
  color: #dce4cc;
}
.mobile-layout #log-dialog .dialog-head {
  background: #18382e;
  color: #dce4cc;
}
.mobile-layout #log-dialog .dialog-head > button {
  color: #dce4cc;
}
.mobile-layout .log-row {
  grid-template-columns: 70px 1fr;
}
.mobile-layout .log-row > span {
  font-size: 13px;
}
.mobile-layout .log-row time {
  font-size: 10px;
}
.mobile-layout #log-latest {
  min-height: 44px;
}
.mobile-layout .history-cards {
  flex-wrap: wrap;
  gap: 5px;
}
.mobile-layout .home-nav button,
.mobile-layout .home-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.mobile-layout #toast {
  bottom: max(12px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 24px);
  font-size: 13px;
  z-index: 100;
}
@media (max-height: 650px) {
  .mobile-layout .instruction-copy:not(.invalid) p {
    display: none;
  }
  .mobile-layout .hand-dock {
    padding-top: 5px;
    gap: 2px 6px;
  }
  .mobile-layout .table-topline .rules-line {
    display: none;
  }
}
