.desktop-mode-switch {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dcbf7673;
  border-radius: 10px;
  background: #071e1a;
}
.desktop-mode-switch button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #d6e4dd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.desktop-mode-switch button:hover { background: #244b40; }
.desktop-mode-switch button:disabled { cursor: not-allowed; opacity: .62; }
.desktop-mode-switch .pro-purchase-button { border-color: #9ad0be; color: #b0e5d5; }
.desktop-mode-switch .pro-purchase-button:hover { background: #245d50; }
.desktop-mode-switch button.is-selected {
  background: #dfc17a;
  color: #172b23;
  border-color: #f4dca2;
}
.desktop-mode-switch button:focus-visible { outline: 2px solid #fff4cf; outline-offset: 2px; }

/* The recovered mobile stylesheet also contains older, absolute-positioned
   desktop rules. Use one flow layout for both paid desktop game modes. */
html.desktop-app body { height: auto; min-height: 100dvh; padding: 18px; overflow: auto; }
.desktop-app .app-shell {
  display: flex; flex-direction: column; gap: 10px;
  width: min(1240px, 100%); height: auto; min-height: 0; max-height: none;
  margin: 0 auto; padding: 0 20px 12px;
  border: 1px solid #dcbf7633; border-radius: 22px;
}
.desktop-app .app-shell > header {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: center; gap: 18px; height: auto; min-height: 82px; padding: 12px 0;
}
.desktop-app .header-title { min-width: 0; }
.desktop-app h1 { font-size: 25px; }
.desktop-app .pro-kicker { font-size: 9px; margin: 0 0 4px; }
.desktop-app .header-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px;
}
.desktop-app .header-actions .text-button,
.desktop-app .header-actions .pc-guide-link {
  width: auto; min-height: 30px; padding: 6px 9px;
  font-size: 12px; white-space: nowrap; line-height: 1.3;
}
.desktop-app .header-actions .header-info-link,
.desktop-app .header-actions .pro-guide-link,
.desktop-app .header-actions .yaku-header-link,
.desktop-app .header-actions .dictionary-link {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.25;
}
.desktop-app .yaku-catalog-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.desktop-app .yaku-catalog-switches .yaku-mode-button {
  min-height: 40px; padding: 7px 16px; font-size: 16px;
}
.desktop-app .yaku-catalog-switches .yaku-mode-button.is-selected {
  background: #dfc17a; border-color: #f4dca2; color: #172b23;
}
.desktop-app .yaku-catalog-switches .yaku-mode-button:focus-visible {
  outline: 2px solid #fff4cf; outline-offset: 2px;
}
.desktop-app .status-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  height: auto; min-height: 42px; padding: 4px 0;
}
.desktop-app .status-bar > div { display: flex; align-items: center; gap: 8px; width: auto; }
.desktop-app .status-bar > p {
  flex: 1 1 220px; width: auto; max-width: none; margin: 0;
  font-size: 13px; line-height: 1.5; text-align: right;
}
.desktop-app .pro-indicators { min-height: 54px; height: auto; margin: 0; padding: 7px 12px; }
.desktop-app .app-shell .table {
  display: grid; grid-template-columns: minmax(230px, .85fr) minmax(0, 2fr);
  grid-template-rows: auto auto;
  grid-template-areas: "rules opponents" "rules player";
  gap: 12px; width: 100%; height: auto; min-height: 0; padding: 14px;
}
.desktop-app .app-shell .opponents {
  grid-area: opponents; display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; position: static; inset: auto; width: auto; height: auto;
}
.desktop-app .app-shell .opponent,
.desktop-app .app-shell .opponent:first-child,
.desktop-app .app-shell .player-river {
  position: static; inset: auto; transform: none; width: auto; height: auto;
  min-height: 100px; margin: 0; padding: 12px; gap: 8px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto;
  justify-self: stretch; align-self: stretch; max-width: none;
}
.desktop-app .app-shell .opponent,
.desktop-app .app-shell .opponent:first-child { grid-area: auto; }
.desktop-app .app-shell .player-river { grid-area: player; }
.desktop-app .app-shell .avatar { position: static; width: 44px; height: 34px; font-size: 11px; }
.desktop-app .app-shell .seat-info { min-height: 34px; gap: 8px; }
.desktop-app .app-shell .score-value { font-size: 18px; }
.desktop-app .app-shell .seat-points-label,
.desktop-app .app-shell .player-river strong { font-size: 13px; }
.desktop-app .app-shell .river {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-content: flex-start;
  gap: 3px; width: auto; min-height: 38px; height: auto;
}
.desktop-app .app-shell .cpu-melds { grid-column: 1 / -1; margin: 0; }
.desktop-app .app-shell .cpu-melds:empty { display: none; }
.desktop-app .app-shell .rules-card {
  grid-area: rules; position: static; inset: auto; transform: none;
  display: block; width: auto; height: auto; margin: 0; padding: 14px;
  min-height: 0; max-height: 260px; overflow-y: auto; scrollbar-width: thin;
}
.desktop-app .rules-card p { margin: 0 0 9px; font-size: 12px; line-height: 1.5; }
.desktop-app .app-shell:not(.pro-app) .rules-card .rules-points { color: #fff; }
.desktop-app .rules-card .rules-label { color: #dfc17a; font-size: 15px; }
.desktop-app .rules-card .rules-game-meta { display: block; }
.desktop-app .rules-card .rules-game-meta span { display: block; white-space: normal; }
.desktop-app .rules-card .rules-summary strong,
.desktop-app .rules-card .rules-summary span { font-size: 12px; line-height: 1.5; }
.desktop-app .rules-card .rules-list { display: block; gap: 0; margin: 10px 0; }
.desktop-app .rules-card .rules-list > div {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 6px;
  margin: 0 0 8px; font-size: 12px; line-height: 1.5;
  min-height: 0; padding: 0; align-items: start;
}
.desktop-app .rules-card .rules-list dt,
.desktop-app .rules-card .rules-list dd { margin: 0; padding: 0; font-size: 12px; line-height: 1.5; }
.desktop-app .rules-card .rules-list dt { white-space: nowrap; }
.desktop-app .rules-card .rules-note { margin-bottom: 0; font-size: 11px; }
.desktop-app .app-shell .hand-area {
  position: static; display: flex; flex-direction: column; gap: 8px;
  width: 100%; height: auto; min-height: 0; margin: 0; padding: 12px 16px; overflow: visible;
}
.desktop-app .app-shell .hand-heading { min-height: 22px; margin: 0; font-size: 13px; }
.desktop-app .app-shell .hand { width: 100%; min-height: 66px; margin: 0; justify-content: center; gap: 7px; }
.desktop-app .app-shell .hand .tile { width: 48px; height: 66px; flex-shrink: 0; }
.desktop-app .app-shell .discard-guide { margin: 0; min-height: 24px; font-size: 12px; }
.desktop-app .app-shell .match-start-actions { display: flex; justify-content: center; gap: 12px; }
.desktop-app .app-shell .match-start-actions button { min-height: 38px; padding: 8px 24px; font-size: 14px; }
.desktop-app .app-shell .public-footer { height: auto; min-height: 20px; margin: 0; padding: 2px 0; font-size: 11px; }
.desktop-app .app-shell .open-melds:empty { display: none; }
@media (max-width: 1050px) {
  html.desktop-app body { padding: 10px; }
  .desktop-app .app-shell { padding: 0 14px 10px; }
  .desktop-app h1 { font-size: 22px; }
  .desktop-app .app-shell .table { grid-template-columns: minmax(210px, .85fr) minmax(0, 2fr); }
}

.desktop-app .app-shell .table { margin-top: 0; }
