.mj-games {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 24px 0 22px;
  border-bottom: 1px solid var(--line, #2b2c36);
  padding-bottom: 12px;
}
.mj-game-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #203b36;
  border: 1px solid #42655a;
  color: #c5e6d5;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 18px;
}
.mj-game-tab span {
  font-size: 13px;
  font-weight: 700;
}
.mj-more {
  font-size: 12px;
  color: var(--muted, #9297aa);
}
.mj-table {
  border: 1px solid #395b50;
  border-radius: 16px;
  padding: 26px;
  background: radial-gradient(
    ellipse at 50% 30%,
    #23473e 0,
    #172f2c 55%,
    #142724 100%
  );
  box-shadow:
    inset 0 0 55px #081b1c60,
    0 15px 35px #0002;
  color: #e8eee8;
}
.mj-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.mj-table h2 {
  font-size: 22px;
  margin: 8px 0 0;
}
.mj-table .eyebrow {
  color: #9fbfb0;
  font-size: 9px;
}
.mj-winds {
  display: flex;
  gap: 20px;
}
.mj-winds span,
.mj-stats span {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #9fb4aa;
}
.mj-winds b {
  font-size: 13px;
  color: #e2eee5;
  letter-spacing: 0;
}
.mj-middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 174px;
  gap: 24px;
  margin: 20px 0;
}
.mj-middle > div:first-child {
  min-width: 100px;
}
.mj-middle p {
  font-size: 13px;
  line-height: 1.7;
  color: #b3c8bd;
  margin: 12px 0 0;
}
.mj-centre-mark {
  font: 58px serif;
  color: #739d8329;
  user-select: none;
  letter-spacing: 10px;
}
.mj-stats {
  display: grid;
  gap: 17px;
  text-align: right;
}
.mj-stats b {
  color: #e2eee5;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}
.mj-hand {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  margin: 12px 0 30px;
  max-width: 1000px;
}
.mj-tile {
  display: block;
  min-width: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: 0 3px 0 #0c1f1d66;
  position: relative;
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
  padding: 0;
  line-height: 0;
  overflow: hidden;
}
.mj-tile-art {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 45 / 67.317;
  object-fit: contain;
  user-select: none;
}
.mj-hand button {
  cursor: pointer;
  appearance: none;
}
.mj-tile.selected {
  transform: translateY(-12px);
  border-color: #edc57a;
  box-shadow:
    0 0 0 2px #edc57a,
    0 7px 20px #0005;
}
.mj-hand button:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 12px #0005;
}
.mj-hand button.selected:hover {
  transform: translateY(-12px);
}
.mj-tile:focus-visible {
  outline: 3px solid #ffd990;
  outline-offset: 3px;
}
.mj-drawn {
  margin-left: 6px;
}
.mj-preview-hand {
  pointer-events: none;
}
.mj-indicator {
  width: 44px;
  margin-top: 12px;
}
.mj-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 260px;
}
.mj-melds {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 16px 0;
}
.mj-melds small {
  display: block;
  color: #b5c7bb;
  font-size: 10px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.mj-melds > div > div {
  display: flex;
  gap: 3px;
}
.mj-melds .mj-tile {
  width: clamp(28px, 4vw, 45px);
}
.mj-actions {
  border-top: 1px solid #58827355;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.mj-actions strong {
  font-size: 14px;
}
.mj-actions p {
  font-size: 12px;
  line-height: 1.5;
  color: #acc3b5;
  margin: 7px 0 0;
}
.mj-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.mj-actions .button {
  white-space: nowrap;
  font-size: 12px;
  padding: 12px 15px;
}
.mj-actions .text-button {
  font-size: 11px;
  color: #b7cbbf;
  white-space: nowrap;
}
.mj-winning {
  border-top: 1px solid #58827355;
  margin-top: 22px;
  padding-top: 22px;
}
.mj-score {
  display: flex;
  align-items: center;
  gap: 30px;
}
.mj-score-total {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}
.mj-score-total > span {
  font-size: 13px;
  color: #e9cb8b;
}
.mj-score-total > strong {
  font-size: 30px;
  color: #f0d99b;
  line-height: 1.3;
}
.mj-score-total > small {
  font-size: 11px;
  color: #a2b9aa;
}
.mj-yaku {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mj-yaku > span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}
.mj-yaku b {
  color: #ccdfcf;
  font-weight: 500;
}
.mj-yaku > small {
  border-top: 1px solid #58827355;
  padding-top: 10px;
  font-size: 10px;
  color: #a2b9aa;
}
.mj-discards {
  border-top: 1px solid #58827355;
  margin-top: 22px;
  padding-top: 16px;
}
.mj-discards summary {
  font-size: 12px;
  color: #adc5b6;
  cursor: pointer;
}
.mj-discards > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}
.mj-discards .mj-tile {
  width: 30px;
  border-radius: 3px;
}
.mj-rules {
  border: 1px solid var(--line, #2b2c36);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 24px;
}
.mj-rules summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.mj-rules p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted, #9297aa);
  max-width: 900px;
}
.mj-rules a {
  color: #add2c0;
}
.mj-rules .game-help {
  max-width: 900px;
}
.mj-rules .game-help h3,
.mj-rules .climb-pool-title {
  font-size: 14px;
  margin: 22px 0 10px;
}
.mj-rules .game-help h4 {
  font-size: 12px;
  margin: 16px 0 8px;
}
.mj-rules .game-help ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
.mj-rules .game-help li {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted, #9297aa);
  margin: 8px 0;
}
.mj-rules .game-help strong {
  color: var(--text, #eeeef0);
  font-weight: 600;
}
.game-formula {
  font-variant-numeric: tabular-nums;
}
.mj-discards > .mj-discard-head {
  margin-top: 0;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #adc5b6;
}
.mj-discard-head h3 {
  font-size: 13px;
  margin: 0;
  color: #d7e8dc;
}
.mj-discards > p {
  font-size: 12px;
  color: #adc5b6;
  margin-bottom: 0;
}
.mj-history {
  border: 1px solid var(--line, #2b2c36);
  border-radius: 12px;
  margin-top: 24px;
  padding: 20px;
}
.mj-history .section-head {
  margin: 0;
  gap: 16px;
  align-items: center;
}
.mj-history h2 {
  font-size: 18px;
  margin: 0;
}
.mj-history p {
  font-size: 12px;
  color: var(--muted, #9297aa);
  line-height: 1.6;
}
.mj-history .button {
  font-size: 11px;
  padding: 10px 13px;
  white-space: nowrap;
}
.mj-history-entry {
  border-top: 1px solid var(--line, #2b2c36);
  margin-top: 14px;
  padding-top: 14px;
}
.mj-history-entry summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}
.mj-history-entry summary > span:first-child {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}
.mj-history-entry summary small {
  font-size: 10px;
  color: var(--muted, #9297aa);
}
.mj-history-status {
  font-size: 10px;
  border: 1px solid #4d655b;
  padding: 4px 8px;
  border-radius: 12px;
}
.mj-history-detail {
  padding: 12px 0 0;
}
.mj-history-tiles,
.mj-history-discards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0;
}
.mj-history-tiles .mj-tile {
  width: 42px;
}
.mj-history-discards .mj-tile {
  width: 30px;
}
.mj-history-dora {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted, #9297aa);
  margin: 14px 0;
}
.mj-history-dora .mj-tile {
  width: 32px;
}
.mj-history-detail h3 {
  font-size: 12px;
  margin: 16px 0 0;
}
.mj-history .mj-score {
  padding: 14px;
  background: #18332c;
  border-radius: 8px;
}
.mj-history .toolbar {
  margin-top: 20px;
  gap: 12px;
  font-size: 12px;
}
@media (max-width: 850px) {
  .mj-history-entry summary {
    gap: 8px;
  }
  .mj-history {
    padding: 16px;
  }
  .mj-history .section-head {
    flex-wrap: wrap;
  }
}
@media (max-width: 1150px) {
  .mj-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .mj-action-buttons {
    justify-content: flex-start;
    flex-shrink: 1;
  }
  .mj-table {
    padding: 22px;
  }
  .mj-winds {
    gap: 14px;
  }
  .mj-hand {
    gap: 4px;
  }
}
@media (max-width: 850px) {
  .mj-hand {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px 7px;
    max-width: 540px;
    margin-top: 20px;
  }
  .mj-drawn {
    margin-left: 6px;
  }
  .mj-table-head {
    flex-direction: column;
  }
  .mj-winds {
    gap: 24px;
  }
  .mj-table h2 {
    font-size: 21px;
  }
  .mj-middle {
    min-height: 130px;
    margin: 20px 0;
  }
  .mj-centre-mark {
    font-size: 42px;
  }
  .mj-stats b {
    font-size: 15px;
  }
}
@media (max-width: 480px) {
  .mj-table {
    padding: 16px 12px;
  }
  .mj-more {
    font-size: 10px;
  }
  .mj-games {
    gap: 15px;
  }
  .mj-table h2 {
    font-size: 19px;
  }
  .mj-centre-mark {
    display: none;
  }
  .mj-score {
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }
  .mj-yaku {
    width: 100%;
  }
  .mj-score-total > strong {
    font-size: 26px;
  }
  .mj-actions .button {
    font-size: 11px;
    padding: 10px 12px;
  }
  .mj-action-buttons {
    gap: 8px;
  }
  .mj-hand {
    gap: 12px 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mj-tile {
    transition: none;
  }
}
