/* Spotter Ranking page — XP details, mirrors UI/Components/XP/XPDetailView.swift. */

.sr-page {
  padding-top: 8px;
  padding-bottom: 64px;
}

.sr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}
.sr-header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.sr-back {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: background-color 0.15s var(--ease);
}
.sr-back:hover { background: color-mix(in srgb, var(--unique) 12%, var(--surface)); color: var(--unique); }

/* ----- Hero ----- */
.sr-hero {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 14%, var(--surface-raised)),
    var(--surface-raised));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.sr-hero-img {
  width: 168px;
  height: 168px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(11, 37, 69, 0.25));
}
.sr-hero-meta { display: flex; flex-direction: column; gap: 4px; }
.sr-hero-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sr-hero-sub {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sr-hero-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.sr-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
}
.sr-stat-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 16px;
}
.sr-hero-stats .sr-stat:nth-child(2) .sr-stat-icon {
  background: color-mix(in srgb, var(--unique) 16%, transparent);
  color: var(--unique);
}
.sr-stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sr-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.sr-stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}
.sr-stat-sub {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Progress to next level */
.sr-next {
  width: 100%;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sr-next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}
.sr-next-row-sm { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sr-next-label { font-weight: 600; color: var(--text); }
.sr-next-need { color: var(--text-muted); }
.sr-next-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.sr-next-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--unique)));
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}
.sr-next-max {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  justify-content: center;
}

/* ----- Sections ----- */
.sr-section { margin-top: 28px; }
.sr-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sr-section-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 16px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.sr-section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sr-section-sub {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Earn XP list */
.sr-earn {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sr-earn-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.sr-earn-row:last-child { border-bottom: 0; }
.sr-earn-iconwrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.sr-earn-body { flex: 1; min-width: 0; }
.sr-earn-title { font-size: 16px; font-weight: 600; color: var(--text); }
.sr-earn-desc  { margin-top: 2px; font-size: 14px; color: var(--text-muted); line-height: 1.4; }
.sr-earn-points {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, black);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

/* All levels list */
.sr-levels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sr-level {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.sr-level-current {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-raised));
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.sr-level-upcoming { opacity: 0.7; }
.sr-level-upcoming .sr-level-imgwrap img { opacity: 0.45; filter: grayscale(0.3); }

.sr-level-imgwrap {
  position: relative;
  width: 60px; height: 60px;
  flex-shrink: 0;
}
.sr-level-imgwrap img { width: 100%; height: 100%; object-fit: contain; }
.sr-level-check {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11px;
  border: 2px solid var(--surface-raised);
}

.sr-level-body { flex: 1; min-width: 0; }
.sr-level-title-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.sr-level-current-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.sr-level-meta {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.sr-level-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .sr-hero          { padding: 24px 18px 20px; }
  .sr-hero-img      { width: 140px; height: 140px; }
  .sr-hero-title    { font-size: 24px; }
  .sr-hero-stats    { grid-template-columns: 1fr; }
  .sr-stat-value    { font-size: 20px; }
  .sr-section-title { font-size: 18px; }
  .sr-earn-iconwrap { width: 44px; height: 44px; font-size: 16px; }
  .sr-level-imgwrap { width: 52px; height: 52px; }
}
