/* Mahjong table: Harana Table at night, plum-night default with a
   capiz-day light variant. Every class is prefixed, so nothing here
   leaks into the rest of the app. Tiles are original SVG art (see
   the tiles module); no image, no font, no outside request. The
   table wraps at narrow widths: the middle row centres first, the
   seats stack below, and the discard pool takes the full width, so
   the table fits a 390px phone with no horizontal scroll. */
.mj-table {
  background: linear-gradient(180deg, #5a2d4d 0%, #3d2238 100%);
  border: 2px solid #efa93b;
  border-radius: 12px;
  padding: 12px;
  color: #fff8ef;
  max-width: 900px;
  margin: 0 auto;
}
html[data-theme="light"] .mj-table {
  background: linear-gradient(180deg, #fff7ea 0%, #f6ead2 100%);
  color: #3d2238;
  border-color: #b57f2e;
}
.mj-topbar { font-size: 14px; margin-bottom: 10px; }
.mj-seat-row { margin-bottom: 10px; }
.mj-seat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
}
html[data-theme="light"] .mj-seat { background: rgba(61, 34, 56, .06); border-color: rgba(61, 34, 56, .25); }
.mj-seat.mj-current { border-color: #efa93b; box-shadow: 0 0 0 2px #efa93b inset; }
.mj-seat-name { font-weight: bold; margin-bottom: 4px; }
.mj-meld { display: inline-flex; gap: 2px; padding: 2px 4px; border-radius: 6px; background: rgba(255, 255, 255, .15); margin: 2px; }
html[data-theme="light"] .mj-meld { background: rgba(61, 34, 56, .08); }
.mj-flowers { font-size: 13px; font-style: italic; }
.mj-discards { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.mj-middle { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.mj-side { flex: 1 1 180px; }
.mj-centre { flex: 2 1 220px; }
.mj-pool-label { font-size: 13px; font-weight: bold; margin-bottom: 4px; }
.mj-pool { display: flex; flex-wrap: wrap; gap: 2px; }
.mj-status { font-size: 15px; font-weight: bold; margin: 10px 0; }
.mj-hand { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.mj-tile-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.mj-tile-btn:focus-visible, .mj-tile-btn.mj-hinted { outline: 3px solid #efa93b; outline-offset: 1px; }
.mj-tile-btn.mj-hinted { border-color: #efa93b; }
.mj-tile-static { display: inline-block; }
.mj-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.mj-win-hand { width: 100%; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.mj-scores { font-size: 14px; margin: 0 0 10px; }
.mj-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.mj-controls label { font-size: 14px; }
.mj-controls select { padding: 6px; border-radius: 8px; }
.mj-help { margin-bottom: 10px; font-size: 14px; }
.mj-help summary { cursor: pointer; font-weight: bold; }
.mj-reactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Large-tile mode: hand tiles grow, everything else stays put. */
.mj-table.mj-large .mj-hand svg { width: 72px; height: 101px; }
@media (max-width: 600px) {
  .mj-middle { flex-direction: column; }
  .mj-side, .mj-centre { flex-basis: 100%; }
  .mj-centre { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .mj-table * { transition: none !important; }
}
