/* Page-specific layout for records.html */

.rivalry-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.rivalry-vs-badge {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
  background: var(--starter-bg);
  padding: 6px 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rivalry-container {
  max-width: var(--content-max-width);
  margin: 0 auto 36px auto;
}

.rivalry-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rivalry-header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.rivalry-team-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-main);
}

.rivalry-owner-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rivalry-score-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
}

.rivalry-score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rivalry-score-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.rivalry-score-val {
  font-size: 1.3rem;
  font-weight: 900;
}

.num-high {
  color: #34d399;
}

.num-low {
  color: #f87171;
}

.num-equal {
  color: #ffffff;
}

.rivalry-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rivalry-stat-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.rivalry-stat-val {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-main);
}

.rivalry-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Leaderboards grid */
.records-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

@media (min-width: 960px) {
  .records-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.record-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.record-card-title {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent-color);
}

.record-card .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

.record-card .standings-table {
  min-width: 100%;
  width: 100%;
  table-layout: auto;
  font-size: 0.78rem;
}

.record-card .standings-table th,
.record-card .standings-table td {
  padding: 6px 6px;
  white-space: nowrap;
}

.record-card .standings-team-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.record-card .standings-team-owner {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* H2H Matrix Table */
.matrix-card {
  max-width: var(--content-max-width);
  margin: 14px auto 36px auto;
  padding: 16px;
  overflow: hidden;
}

.matrix-table {
  font-size: 0.78rem;
  border-collapse: collapse;
  width: 100%;
}

.matrix-cell {
  text-align: center;
  font-weight: 600;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-cell.self-cell {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.matrix-cell.is-winning {
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.matrix-cell.is-losing {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}
