/* ==========================================================================
   7. TRANG 4: PHÒNG TRẬN ĐẤU & NỘP CODE (CUSTOM MATCH ROOM)
   ========================================================================== */
.match-room-desktop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.match-room-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.match-room-titles {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-heading);
}

.room-badge-stage {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
}

.match-room-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BẢNG ĐIỀU HÀNH 2 ĐỘI & TỶ SỐ BO5 */
.match-teams-score-board {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 18px 28px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  margin-bottom: 20px;
}

.match-team-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-team-col.blue {
  align-items: flex-end;
  text-align: right;
}

.team-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-circle-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-circle-avatar.red { background: #ef4444; }
.team-circle-avatar.blue { background: #3b82f6; }

.team-col-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
}

.team-col-sid {
  font-size: 12px;
  color: var(--text-muted);
}

.team-status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.piece-count-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.piece-count-badge.red {
  background: var(--red-team-light);
  color: var(--red-team);
}

.piece-count-badge.blue {
  background: var(--blue-team-light);
  color: var(--blue-team);
}

.submission-state-badge {
  font-size: 11px;
  background: #f1f5f9;
  color: var(--text-body);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.submission-state-badge.ready {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.15);
}

.submission-state-badge.error {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5;
}

.match-center-score-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.center-score-number {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

.center-round-step {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-blue);
  margin-top: 2px;
  margin-bottom: 8px;
}

.round-step-pills-row {
  display: flex;
  gap: 6px;
}

.step-pill {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--text-muted);
}

.step-pill.current {
  background: var(--primary-blue);
  color: #ffffff;
}

.step-pill.passed {
  background: var(--green-status-light);
  color: var(--green-status);
}

/* BỐ CỤC 2 CỘT: BÀN CỜ 9×9 & PHÒNG NỘP CODE */
.match-arena-2col-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: start;
}

.board-card {
  padding: 20px 24px;
}

.board-top-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.board-title-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.5px;
}

.board-legend-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* BÀN CỜ 9x9 */
.board-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.chessboard-9x9 {
  display: grid;
  grid-template-columns: repeat(9, 44px);
  grid-template-rows: repeat(9, 44px);
  gap: 2px;
  background: #cbd5e1;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #94a3b8;
}

.board-cell {
  background: #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
}

.board-cell.cell-alt {
  background: #f8fafc;
}

.board-cell.cell-target-red {
  background: #fee2e2;
  border: 1.5px dashed #ef4444;
}

.board-cell.cell-target-blue {
  background: #dbeafe;
  border: 1.5px dashed #3b82f6;
}

.board-cell.cell-clash {
  animation: flashClash 0.6s ease-out;
  background: #fef08a !important;
}

@keyframes flashClash {
  0% { transform: scale(1.15); background: #facc15; }
  100% { transform: scale(1); background: #ffffff; }
}

/* QUÂN CỜ TRÊN BÀN */
.board-piece {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  color: #ffffff;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.board-piece.piece-red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1.5px solid #b91c1c;
}

.board-piece.piece-blue {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: 1.5px solid #1d4ed8;
}

/* BÌNH LUẬN TRỰC TIẾP */
.live-commentary-ticker {
  background: var(--bg-subtle);
  border: 1px solid var(--border-divider);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-body);
  line-height: 1.45;
  margin-bottom: 12px;
}

.replay-controls-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.playback-step-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
