.ranking-page {
  width: 100%;
  max-width: none;
}

.ranking-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.ranking-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hub-ink);
}

.ranking-lead {
  margin: 0;
  color: var(--hub-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 42rem;
}

.ranking-status {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hub-muted);
}

.ranking-status.is-error {
  color: #dc2626;
}

.ranking-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.ranking-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 5.5rem;
  padding: 14px 16px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-md);
  background: var(--hub-surface);
  box-sizing: border-box;
}

.ranking-summary-card.is-you {
  border-color: color-mix(in srgb, var(--hub-accent) 35%, var(--hub-border));
  background: color-mix(in srgb, var(--hub-accent) 8%, var(--hub-surface));
}

.ranking-summary-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--hub-ink);
}

.ranking-summary-meta {
  margin: 0;
  font-size: 13px;
  color: var(--hub-muted);
}

.ranking-summary-meta strong {
  color: var(--hub-ink);
}

.ranking-games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.ranking-game-section {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  height: 100%;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-md);
  background: var(--hub-surface);
  overflow: hidden;
  box-sizing: border-box;
}

.ranking-game-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 3.75rem;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hub-border);
  background: var(--hub-surface-muted);
  box-sizing: border-box;
}

.ranking-game-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--hub-ink);
}

.ranking-your-rank {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--hub-muted);
}

.ranking-your-rank strong {
  color: var(--hub-accent);
}

.ranking-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 16rem;
  overflow: auto;
}

.ranking-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.ranking-table th,
.ranking-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--hub-border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1) {
  width: 14%;
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
  width: 20%;
}

.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) {
  width: 20%;
}

.ranking-table th:nth-child(4),
.ranking-table td:nth-child(4) {
  width: 18%;
}

.ranking-table th:nth-child(5),
.ranking-table td:nth-child(5) {
  width: 28%;
}

.ranking-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hub-muted);
}

.ranking-table tbody tr:last-child td {
  border-bottom: none;
}

.ranking-table tbody tr.is-you {
  background: color-mix(in srgb, var(--hub-accent) 10%, var(--hub-surface));
}

.ranking-table tbody tr.is-you td {
  font-weight: 700;
  color: var(--hub-ink);
}

.ranking-name-cell {
  font-weight: 650;
  color: var(--hub-ink);
}

.ranking-you-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--hub-accent) 14%, var(--hub-surface));
  color: var(--hub-accent);
}

.ranking-empty-game {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
  margin: 0;
  padding: 16px;
  font-size: 13px;
  color: var(--hub-muted);
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .ranking-summary,
  .ranking-games {
    grid-template-columns: 1fr;
  }
}
