.profile-page {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.profile-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.profile-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ── Player header card ── */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--accent-border);
  flex-shrink: 0;
}

.player-info { flex: 1; min-width: 0; }

.player-info h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-badges {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.level-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 600;
  white-space: nowrap;
}

.level-badge.warfare {
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  border-color: rgba(167,139,250,0.3);
}

.level-badge.ranked {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  border-color: rgba(251,191,36,0.3);
}

.player-meta {
  margin-top: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.player-id-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.id-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.id-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.btn-unlink {
  font-size: 0.68rem;
  color: var(--danger);
  background: none;
  border: 1px solid rgba(255,77,109,0.3);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-unlink:hover { background: rgba(255,77,109,0.1); }

/* ── Quick row ── */
.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.quick-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quick-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.quick-value.accent  { color: var(--accent); }
.quick-value.success { color: var(--success); }
.quick-value.ranked  { color: #fbbf24; }

.quick-sub {
  font-size: 0.63rem;
  color: var(--text-muted);
}

/* ── Section header ── */
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.25rem 0 0.65rem;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-hover); }

.stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.stat-value.accent  { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.danger  { color: var(--danger); }
.stat-value.yellow  { color: #fbbf24; }
.stat-value.purple  { color: #a78bfa; }

.stat-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

.diff-row {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.diff-pill {
  font-size: 0.58rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--bg-input);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Score row ── */
.score-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 60px;
}

.score-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.score-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.15rem;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.6s ease;
}

.score-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

/* ── Stash ── */
.stash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.stash-net {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stash-net-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.stash-bar {
  height: 5px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-bottom: 0.6rem;
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.stash-bar-liquid { background: var(--accent); }
.stash-bar-fixed  { background: #a78bfa; }
.stash-bar-coll   { background: var(--success); }

.stash-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stash-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.stash-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── Link / Login forms ── */
.center-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  max-width: 460px;
}

.center-card h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.center-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.center-card p code {
  background: var(--bg-input);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-size: 0.73rem;
  color: var(--accent);
  font-family: monospace;
}

.link-input-row {
  display: flex;
  gap: 0.5rem;
}

.link-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.15s;
}
.link-input:focus { border-color: var(--accent-border); }

.btn-link {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-link:hover    { opacity: 0.85; }
.btn-link:disabled { opacity: 0.45; cursor: not-allowed; }

.hint {
  margin-top: 0.7rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}
.hint code {
  color: var(--accent);
  background: var(--bg-input);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.error-msg {
  font-size: 0.73rem;
  color: var(--danger);
  margin-top: 0.5rem;
}

.loading-msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 2rem 0;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .profile-page { padding: 1rem; }
  .quick-row { grid-template-columns: 1fr 1fr; }
  .player-id-area { display: none; }
}
