/* profile page styles — uses CSS variables from base.css */

.profile-page {
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.profile-id {
  min-width: 0;
}

.profile-name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.profile-since {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stats grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-stat-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.profile-stat-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.profile-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Shared card wrapper for chart / badges */
.profile-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.profile-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.profile-card-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.profile-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Weekly XP chart */
.weekly-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 132px;
  padding-top: 8px;
}

.chart-goal-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed var(--border-strong);
  z-index: 0;
}

.chart-col {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.bar-track {
  flex: 1;
  width: 100%;
  max-width: 26px;
  display: flex;
  align-items: flex-end;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
}

.bar-fill {
  width: 100%;
  min-height: 0;
  background: var(--blue);
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}

.bar-fill-goal-met {
  background: var(--green);
}

.chart-col-today .chart-day-label {
  color: var(--blue);
  font-weight: 800;
}

.chart-day-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Badges preview */
.badges-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.badge-preview-item {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.badges-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 14px;
}

.profile-settings-btn {
  margin-top: 4px;
}

@media (min-width: 560px) {
  .profile-page {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
}
