/* ══════════════════════════════════════════════════════════
   NOVA Support Pool — Profile / Ich Screen  (Part E)
   ══════════════════════════════════════════════════════════ */

/* ── Page shell ───────────────────────────────────────────── */
#screen-profile { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.profile-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: calc(var(--nav-height) + var(--space-4));
}

/* ── Hero ─────────────────────────────────────────────────── */
.profile-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-4) var(--space-6);
  text-align: center;
  overflow: visible;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--rank-color, #7c3aed) 30%, transparent) 0%,
    color-mix(in srgb, var(--rank-color, #06b6d4) 15%, transparent) 60%,
    transparent 100%
  );
  animation: hero-drift 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes hero-drift {
  from { opacity: 0.55; filter: hue-rotate(0deg); }
  to   { opacity: 0.75; filter: hue-rotate(20deg); }
}
.profile-hero > * { position: relative; }

.profile-avatar-wrap {
  position: relative;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
  overflow: visible;
}

.profile-rank-ring {
  position: absolute;
  inset: -5px;
  border-radius: var(--radius-full);
  background: conic-gradient(var(--rank-color, #7c3aed) 0deg, transparent 270deg);
  z-index: 0;
  opacity: 0.85;
}
.profile-rank-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-base);
}

/* Rank-based static ring variants */
.profile-avatar-wrap[data-rank="0"] .profile-rank-ring {
  background: conic-gradient(#94a3b8 0deg, transparent 200deg);
}
.profile-avatar-wrap[data-rank="1"] .profile-rank-ring {
  background: conic-gradient(#22d3ee 0deg, #06b6d4 90deg, transparent 240deg);
}
.profile-avatar-wrap[data-rank="2"] .profile-rank-ring {
  background: conic-gradient(#7c3aed 0deg, #a855f7 120deg, transparent 270deg);
}
.profile-avatar-wrap[data-rank="3"] .profile-rank-ring {
  background: conic-gradient(#f59e0b 0deg, #fbbf24 120deg, #f59e0b 240deg, transparent 300deg);
}
.profile-avatar-wrap[data-rank="4"] .profile-rank-ring {
  background: conic-gradient(#f43f5e 0deg, #fb7185 90deg, #f43f5e 180deg, #fb7185 270deg, #f43f5e 360deg);
  opacity: 1;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: var(--weight-black);
  color: #fff;
  font-family: var(--font-display);
  box-shadow: 0 0 0 3px var(--bg-elevated);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.profile-rank-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 30px; height: 30px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 2px solid var(--border-subtle);
  z-index: 2;
}

.profile-name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  font-family: var(--font-display);
  color: var(--text-primary);
}
.profile-handle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}
.profile-rank-label {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
}

/* ── Stats grid ───────────────────────────────────────────── */
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-4);
}
.profile-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}
.profile-stat-card__val {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  font-family: var(--font-display);
  color: var(--accent-primary);
}
.profile-stat-card__label {
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Section wrapper ──────────────────────────────────────── */
.profile-section {
  padding: 0 var(--space-4) var(--space-4);
}
.profile-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.profile-section__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.profile-section__sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Balance band ─────────────────────────────────────────── */
.profile-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}
.profile-balance-row__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}
.profile-balance-row__val {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  font-family: var(--font-display);
  color: var(--text-secondary);
}
.profile-balance-row__val.pos { color: var(--accent-success); }
.profile-balance-row__val.neg { color: var(--accent-danger); }

/* ── Streak badge ─────────────────────────────────────────── */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  background: var(--accent-warning-soft);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent-warning);
}
/* Larger verified badge for profile hero name */
.verified-badge--lg {
  margin-left: 6px;
  vertical-align: middle;
}

.streak-record-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
}

/* ── Flames row ───────────────────────────────────────────── */
.flame-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-1);
}
.flame-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.flame-day__icon {
  font-size: 22px;
  opacity: 0.15;
  transition: opacity var(--duration-fast), transform var(--duration-fast) var(--ease-spring);
  filter: grayscale(1);
}
.flame-day--active .flame-day__icon {
  opacity: 1;
  filter: none;
  transform: scale(1.15);
}
.flame-day__label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
}

/* ── Rank progress ────────────────────────────────────────── */
.rank-progress-bar {
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.rank-progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width var(--duration-slow) var(--ease-out);
}

/* ── Actions ──────────────────────────────────────────────── */
.profile-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.profile-actions-row { display: flex; gap: var(--space-2); }

/* ── Notifications ────────────────────────────────────────── */
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent-danger); color: #fff;
  font-size: 10px; font-weight: var(--weight-bold);
  border-radius: var(--radius-full); margin-inline-start: var(--space-2);
}

.notif-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  position: relative;
  animation: slide-up var(--duration-base) var(--ease-out) both;
  transition: opacity 0.25s, transform 0.25s;
}
.notif-card + .notif-card { margin-top: var(--space-2); }
.notif-card--unread {
  border-color: rgba(124, 58, 237, 0.3);
  background: var(--accent-primary-soft);
}

.notif-card__icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.notif-card__body { flex: 1; min-width: 0; }
.notif-card__sender {
  font-size: var(--text-sm); font-weight: var(--weight-bold);
  color: var(--accent-secondary); margin-bottom: 2px;
}
.notif-card__quote {
  font-size: var(--text-xs); color: var(--text-tertiary);
  background: var(--bg-glass); padding: 2px 8px;
  border-inline-start: 2px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-1); font-style: italic;
}
.notif-card__text  { font-size: var(--text-sm); color: var(--text-primary); line-height: var(--leading-snug); }
.notif-card__time  { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-1); }
.notif-card__del {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); border: none; background: none;
  cursor: pointer; color: var(--text-tertiary);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.notif-card__del:hover { background: var(--accent-danger-soft); color: var(--accent-danger); }

/* ── Empty state ──────────────────────────────────────────── */
.profile-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3); padding: var(--space-8) 0; text-align: center;
}
.profile-empty__icon { font-size: 36px; opacity: 0.4; }
.profile-empty__text { font-size: var(--text-sm); color: var(--text-tertiary); }

/* ── Rank Progress Row (Part H) ────────────────────────────── */
.profile-rank-progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-4, 12px);
  margin-top: var(--space-2, 6px);
}

.profile-rank-next {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ── Weekly Reset Chip (Profile Hero) ─────────────────── */
.profile-weekly-chip {
  margin-top: 8px;
  padding: 4px 12px;
  background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Profile Leaderboard Mini-List ─── */
.profile-lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-glass);
}
.profile-lb-row--me {
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25);
}
.profile-lb-row__pos {
  width: 28px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.profile-lb-row__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: var(--weight-bold); color: #fff;
  flex-shrink: 0;
}
.profile-lb-row__name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-lb-row__score {
  font-weight: var(--weight-bold);
  font-family: var(--font-display);
  color: var(--accent-primary);
  font-size: var(--text-sm);
  flex-shrink: 0;
}
