/* ── Page layout ──────────────────────────────────────────── */
.player-page {
  padding: 40px 40px 72px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ── Back link ────────────────────────────────────────────── */
.player-back {
  margin-bottom: 28px;
}

.player-back a {
  font-family: 'Philosopher', serif;
  font-size: 13px;
  color: var(--text3);
  transition: color 0.2s;
}

.player-back a:hover {
  color: var(--accent);
}

/* ── Player header ────────────────────────────────────────── */
.player-header {
  margin-bottom: 48px;
}

.player-name {
  font-family: 'Dominican SC', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: normal;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 8px;
}

.player-since {
  font-family: 'Philosopher', serif;
  font-size: 13px;
  color: var(--text3);
}

/* ── Section header ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Philosopher Bold', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Section spacing ──────────────────────────────────────── */
.stats-section {
  margin-bottom: 52px;
}

/* ── Stat cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.stat-card:hover {
  background: var(--surface-h);
  border-color: var(--border-a);
}

.stat-card-type {
  font-family: 'Philosopher Bold', serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.stat-card-rating {
  font-family: 'Dominican SC', serif;
  font-size: 2.8rem;
  font-weight: normal;
  color: var(--text);
  line-height: 1;
}

.stat-card-label {
  font-family: 'Philosopher', serif;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}

.stat-card-row {
  display: flex;
  align-items: center;
  background: rgba(255, 238, 205, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 0;
  margin-bottom: 10px;
}

.stat-card-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-card-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.stat-val {
  font-family: 'Philosopher Bold', serif;
  font-size: 16px;
  color: var(--text);
}

.stat-lbl {
  font-family: 'Philosopher', serif;
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-card-games {
  font-family: 'Philosopher', serif;
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}

/* ── Recent games table ───────────────────────────────────── */
.table-wrap {
  background: rgba(16, 14, 11, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: 'Philosopher', serif;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

thead th {
  padding: 14px 12px;
  font-family: 'Philosopher Bold', serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 238, 205, 0.05);
  transition: background 0.15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 12px;
  font-size: 13px;
  color: var(--text2);
  text-align: left;
  vertical-align: middle;
}

.game-row-win  { background: rgba(80, 140, 60, 0.05); }
.game-row-loss { background: rgba(160, 60, 50, 0.05); }
.game-row-extra { display: none; }

/* ── Show more ────────────────────────────────────────────── */
.show-more-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.btn-show-more {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text3);
  font-family: 'Philosopher', serif;
  font-size: 13px;
  padding: 9px 24px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-show-more:hover {
  border-color: var(--accent);
  color: var(--text2);
}

/* ── Result badge ─────────────────────────────────────────── */
.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-family: 'Philosopher Bold', serif;
  font-size: 13px;
}

.result-win {
  background: rgba(80, 160, 60, 0.16);
  color: #72c256;
  border: 1px solid rgba(80, 160, 60, 0.28);
}

.result-loss {
  background: rgba(180, 60, 50, 0.16);
  color: #d46055;
  border: 1px solid rgba(180, 60, 50, 0.28);
}

/* ── Rating delta ─────────────────────────────────────────── */
.delta {
  font-family: 'Philosopher Bold', serif;
  font-size: 13px;
}

.delta.positive { color: #72c256; }
.delta.negative { color: #d46055; }

/* ── Misc ─────────────────────────────────────────────────── */
.game-date { color: var(--text3); font-size: 12px; }
.muted     { color: var(--text3); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--text3);
  font-family: 'Philosopher', serif;
  font-size: 14px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .player-page {
    padding: 24px 16px 52px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 18px 14px 16px;
  }

  .stat-card-rating {
    font-size: 2.2rem;
  }

  thead th,
  tbody td {
    padding: 10px 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
