/* Use the current Interface V6 wide-layout poster column in short landscape. */
@media (min-width: 700px) and (max-height: 430px) and (orientation: landscape) {
  .main-screen .wp-standard-main-composition {
    --wp-main-landscape-poster-size: 420px !important;
  }
}

/* Blind-draw inputs remain touch-sized even in the compact shared card layout. */
#oldMaidLeavePanel:not([hidden]) {
  position: absolute;
  z-index: 30;
  inset: 8px;
  box-sizing: border-box;
  padding: 20px;
  overflow-y: auto;
  color: #f8fafc;
  background: #0b2929;
  border: 1px solid #8aa7a5;
  border-radius: 16px;
}
#oldMaidLeavePanel h2 { margin: 0 0 12px; }
#oldMaidLeavePanel p { line-height: 1.5; }
#oldMaidLeavePanel > div { display: grid; gap: 12px; }
#oldMaidLeavePanel button,
body[data-wp-card-game="old-maid"] .result-actions button {
  min-height: 52px;
  width: 100%;
  white-space: normal;
  border: 1px solid var(--wp-ui-border, rgba(255,255,255,.16));
  border-radius: 14px;
  background: var(--wp-ui-control, #f8fafc);
  color: var(--wp-ui-control-text, #176a9d);
  font: 800 16px/1.25 system-ui, sans-serif;
  padding: 8px 12px;
  cursor: pointer;
}
#oldMaidLeavePanel .primary-btn,
body[data-wp-card-game="old-maid"] .result-actions .primary-btn {
  background: var(--wp-ui-primary, #f5c84c);
  color: var(--wp-ui-primary-text, #1f2937);
}
#oldMaidLeavePanel button:focus-visible,
body[data-wp-card-game="old-maid"] .result-actions button:focus-visible {
  outline: 3px solid #63e6be;
  outline-offset: 2px;
}
body[data-wp-card-game="old-maid"] #cardGameCenter .playing-card.is-face-down {
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}
body[data-wp-card-game="old-maid"] #cardGameHand .playing-card {
  cursor: default;
  box-sizing: border-box;
  transform: none;
}
@media (min-width: 700px) and (max-height: 430px) and (orientation: landscape) {
  body[data-wp-card-game="old-maid"] #cardGameBoard {
    grid-template-columns: 135px minmax(0, 1fr);
  }
  /* All three opponent summaries are strategic state, not decorative overflow.
     Fit the complete stack into the fixed short-landscape row so neither RTL
     nor LTR players need to scroll before choosing a hidden card. */
  body[data-wp-card-game="old-maid"] .card-opponents {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 3px;
    overflow: hidden;
  }
  body[data-wp-card-game="old-maid"] .opponent-card {
    box-sizing: border-box;
    min-height: 0;
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.05;
  }
  body[data-wp-card-game="old-maid"] .opponent-card strong {
    font-size: 12px;
    line-height: 1.05;
  }
  body[data-wp-card-game="old-maid"] .opponent-card span {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.05;
    white-space: nowrap;
  }
  body[data-wp-card-game="old-maid"] #cardGameTable {
    justify-content: flex-start;
  }
  body[data-wp-card-game="old-maid"] #cardGameCenter {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 3px;
  }
  body[data-wp-card-game="old-maid"] #cardGameCenter > .card-table-label {
    display: none; /* The same game name remains in the Battle header. */
  }
  body[data-wp-card-game="old-maid"] #cardGameCenter > .table-row {
    order: -1;
    min-height: 50px;
    flex-shrink: 0;
  }
  body[data-wp-card-game="old-maid"] #cardGameCenter > .card-old-maid-risk,
  body[data-wp-card-game="old-maid"] #cardGameCenter > .card-old-maid-draw-cue {
    padding: 2px 6px;
    font-size: 11px;
  }
}
