/* Chinese / Hong Kong Mahjong 4-Player Table Styling */
.chinese-table {
  background: radial-gradient(circle at 50% 40%, #174233 0%, #0d281e 65%, #081a13 100%);
  border: 1px solid #2a5847;
  border-radius: 28px;
  box-shadow: var(--shadow), inset 0 2px 14px rgba(0, 0, 0, 0.4);
  padding: 24px;
  position: relative;
  overflow: hidden;
  color: #fff;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chinese-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.chinese-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin: 0 0 2px;
  font-weight: 700;
}

.chinese-header h2 {
  font: 700 24px/1 'Playfair Display', Georgia, serif;
  margin: 0;
  letter-spacing: -0.02em;
}

.chinese-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chinese-status-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #e5ede8;
}

.chinese-tabletop {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

/* Opponent Seats */
.chinese-opponents {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 12px;
}

.chinese-seat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.chinese-seat.active {
  border-color: var(--gold);
  background: rgba(201, 154, 69, 0.15);
  box-shadow: 0 0 20px rgba(201, 154, 69, 0.25);
}

.chinese-seat-top {
  grid-column: 2;
}

.chinese-seat-left {
  grid-column: 1;
  justify-self: start;
}

.chinese-seat-right {
  grid-column: 3;
  justify-self: end;
}

.seat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #234c3c;
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
}

.seat-info strong {
  display: block;
  font-size: 13px;
  color: #fff;
}

.seat-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* Table Discard Arena */
.chinese-discard-arena {
  width: min(520px, 95%);
  min-height: 170px;
  background: rgba(10, 28, 21, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, 0.45);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.discard-compass {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}

.wall-count {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.discard-tiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  max-width: 460px;
  margin-top: 14px;
}

/* Discard Tile */
.discard-tile {
  width: 32px;
  height: 42px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 2px 3px 0 rgba(0,0,0,0.3);
  user-select: none;
  animation: discardPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.discard-tile.last-discard {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

@keyframes discardPop {
  0% { transform: scale(0.6) translateY(-10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Melds area */
.chinese-melds-area {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  justify-content: center;
}

.meld-group {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Player Rack */
.chinese-player-rack-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chinese-hand {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

/* Chinese Tile Button */
.chinese-tile {
  width: 48px;
  height: 64px;
  border-radius: 7px;
  border: 1px solid #cfc8b9;
  background: linear-gradient(145deg, #fffefb, #eee9dd);
  box-shadow: 3px 4px 0 #d4cec1, 4px 6px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  cursor: pointer;
  position: relative;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  color: #17221d;
}

.chinese-tile:hover {
  transform: translateY(-8px);
  box-shadow: 3px 8px 0 #d4cec1, 6px 12px 18px rgba(0,0,0,0.3);
}

.chinese-tile.drawn-tile {
  margin-left: 12px;
  box-shadow: 0 0 0 2px var(--gold), 3px 4px 0 #d4cec1;
}

.chinese-tile .tile-corner {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.chinese-tile .chinese-glyph {
  font-size: 26px;
  line-height: 1;
  font-family: serif;
  margin: auto;
}

.chinese-tile .tile-sub {
  align-self: flex-end;
  font-size: 8px;
  font-weight: 700;
  color: #8b7158;
}

/* Interactive Claim Dialog */
.claim-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  background: rgba(18, 42, 33, 0.95);
  border: 1.5px solid var(--gold);
  border-radius: 20px;
  padding: 8px 16px;
  margin: 10px auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.16s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.claim-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.claim-btn.chow { background: #3b82f6; color: #fff; }
.claim-btn.pung { background: #10b981; color: #fff; }
.claim-btn.kong { background: #8b5cf6; color: #fff; }
.claim-btn.hu   { background: #ef4444; color: #fff; font-size: 14px; box-shadow: 0 0 14px rgba(239, 68, 68, 0.5); }
.claim-btn.riichi { background: linear-gradient(135deg, #b91c1c, #991b1b); color: #fff; border: 1px solid #f87171; box-shadow: 0 0 10px rgba(220, 38, 38, 0.45); }
.claim-btn.pass { background: rgba(255, 255, 255, 0.15); color: #fff; }

.claim-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Riichi HUD & Dora Indicator */
.riichi-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  background: rgba(12, 30, 22, 0.88);
  border: 1.5px solid rgba(201, 154, 69, 0.45);
  border-radius: 12px;
  padding: 6px 14px;
  margin-bottom: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.riichi-round {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.riichi-dora-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dora-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.dora-tile-mini {
  width: 26px;
  height: 34px;
  background: linear-gradient(145deg, #fffefb, #eee9dd);
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  color: #17221d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(201, 154, 69, 0.5);
}

.dora-tile-mini small {
  font-size: 7px;
  line-height: 1;
  color: #8b7158;
}

.riichi-stick-pot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #f2e3c6;
}

.riichi-stick {
  width: 36px;
  height: 7px;
  background: linear-gradient(180deg, #faf7f0, #dfd8c8);
  border: 1px solid #b8af9c;
  border-radius: 4px;
  position: relative;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.riichi-stick::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: #dc2626;
  border-radius: 50%;
}

.seat-score-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f3eedd;
  margin-top: 3px;
}

.seat-score-badge.riichi-active {
  background: rgba(220, 38, 38, 0.35);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Taiwanese 16-Tile Hand Compact Fit */
body.taiwanese-mode .chinese-hand .chinese-tile {
  width: 42px;
  height: 58px;
}

body.taiwanese-mode .chinese-hand .chinese-tile .chinese-glyph {
  font-size: 22px;
}

@media (max-width: 800px) {
  .chinese-table {
    padding: 12px;
    border-radius: 18px;
    min-height: 520px;
  }
  .chinese-tile {
    width: 38px;
    height: 52px;
    padding: 2px;
  }
  .chinese-tile .chinese-glyph {
    font-size: 20px;
  }
  .chinese-opponents {
    margin-bottom: 6px;
  }
  .chinese-seat {
    padding: 6px 10px;
    gap: 8px;
  }
  .seat-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .seat-info strong {
    font-size: 11px;
  }
  .seat-info span {
    font-size: 9px;
  }
  .claim-bar {
    padding: 6px 10px;
    gap: 6px;
  }
  .claim-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .riichi-hud {
    padding: 4px 8px;
  }
  .riichi-round {
    font-size: 9px;
  }
  .dora-tile-mini {
    width: 20px;
    height: 28px;
    font-size: 11px;
  }
  body.taiwanese-mode .chinese-hand .chinese-tile {
    width: 32px;
    height: 46px;
    padding: 1px;
  }
  body.taiwanese-mode .chinese-hand .chinese-tile .chinese-glyph {
    font-size: 16px;
  }
}
