/* profile.html — page composition only */

/* ---- header card ---- */
.profile-head { display: grid; gap: var(--sp-4); padding: var(--sp-5); }
.profile-head__who { display: flex; gap: var(--sp-4); align-items: center; min-width: 0; }
.profile-head .avatar--2xl { flex: none; width: 88px; height: 88px; font-size: var(--fs-2xl); --ring-color: var(--surface-1); }
.profile-head__id { display: grid; gap: var(--sp-2); min-width: 0; }
.profile-head__name { font-size: var(--fs-xl); line-height: 1.1; overflow-wrap: anywhere; }
.profile-head__handle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: 0; }
.profile-head__handle .username { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.profile-head__tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
.profile-head__tags .flair { display: inline-flex; align-items: center; gap: 4px; }
.profile-head__bio { margin: 0; font-size: var(--fs-base); color: var(--text); max-width: 60ch; }
.profile-head__fav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: 0; }
.profile-head__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
@media (min-width: 600px) {
  .profile-head { padding: var(--sp-6); grid-template-columns: 1fr auto; align-items: start; column-gap: var(--sp-6); }
  .profile-head__who { grid-column: 1; }
  .profile-head__actions { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .profile-head__bio, .profile-head__fav { grid-column: 1 / -1; }
  .profile-head .avatar--2xl { width: 112px; height: 112px; font-size: var(--fs-3xl); }
  .profile-head__name { font-size: var(--fs-2xl); }
}

/* ---- shortcuts ---- */
.shortcut { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.shortcut__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.shortcut__text b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.shortcut__text small { font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.shortcut__go { flex: none; color: var(--text-muted); }

/* ---- level ladder ---- */
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); grid-template-columns: 1fr; counter-reset: none; }
.ladder__step {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "lv name pts" "lv state state" "dm dm dm";
  align-items: center; column-gap: var(--sp-3); row-gap: 2px; min-width: 0;
  padding: var(--sp-3); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-1);
  color: var(--text-muted);
}
.ladder__step > .level { grid-area: lv; }
.ladder__name { grid-area: name; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-strong); }
.ladder__pts { grid-area: pts; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: right; }
.ladder__state { grid-area: state; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.ladder__state .icon { width: 14px; height: 14px; color: var(--success); }
.ladder__state--you { color: var(--text-strong); }
.ladder__dm { grid-area: dm; display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-2); padding: 4px 8px; width: fit-content; max-width: 100%;
  border-radius: var(--r-xs); background: var(--yellow); color: var(--on-yellow); font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.ladder__dm .icon { width: 14px; height: 14px; flex: none; }
.ladder__step.is-done .ladder__name { color: var(--text); }
.ladder__step.is-current { border-color: var(--yellow); box-shadow: inset var(--bw-accent) 0 0 var(--yellow); background: var(--surface-1); color: var(--text); }
.ladder__step:not(.is-done):not(.is-current) .level { opacity: .7; }
@media (min-width: 600px) {
  .ladder { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .ladder { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
  .ladder__step { grid-template-columns: 1fr; grid-template-areas: "lv" "name" "pts" "state" "dm"; justify-items: start; row-gap: 4px; border-radius: 0; margin-left: -1px; padding: var(--sp-3); }
  .ladder__step:first-child { border-radius: var(--r-md) 0 0 var(--r-md); margin-left: 0; }
  .ladder__step:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
  .ladder__pts { text-align: left; }
  .ladder__step.is-current { box-shadow: inset 0 var(--bw-accent) 0 var(--yellow); z-index: 1; }
}
/* main column is ~1032px at 1440 with the sidebar; keep 3-up there so the DM note fits */
@media (min-width: 1200px) and (max-width: 1439px) { .ladder { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .ladder__step, .ladder__step:first-child, .ladder__step:last-child { border-radius: var(--r-md); margin-left: 0; grid-template-columns: auto 1fr auto; grid-template-areas: "lv name pts" "lv state state" "dm dm dm"; }
  .ladder__step.is-current { box-shadow: inset var(--bw-accent) 0 0 var(--yellow); } }
@media (min-width: 1440px) { .ladder { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .ladder__step, .ladder__step:first-child, .ladder__step:last-child { border-radius: var(--r-md); margin-left: 0; grid-template-columns: auto 1fr auto; grid-template-areas: "lv name pts" "lv state state" "dm dm dm"; }
  .ladder__step.is-current { box-shadow: inset var(--bw-accent) 0 0 var(--yellow); } }

/* ---- points breakdown ---- */
.pts-break { display: grid; gap: var(--sp-3); padding-top: var(--sp-4); border-top: var(--bw) solid var(--border-subtle); }
.pts-break__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.pts-break__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.pts-break__list li { display: grid; grid-template-columns: minmax(104px, 150px) 1fr 40px; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); }
.pts-break__list li > b { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.pts-break__list .progress { width: 100%; }

/* ---- stats ---- */
.stats .stat-tile__sub .icon { width: 14px; height: 14px; vertical-align: -2px; color: var(--red-text); }

/* ---- activity + settings ---- */
.profile-cols { display: grid; gap: var(--sp-8); align-items: start; }
@media (min-width: 1440px) { .profile-cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sp-6); } }
@media (min-width: 900px) and (max-width: 1199px) { .profile-cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sp-6); } }
.settings { display: grid; gap: var(--sp-5); }
.settings__group { display: grid; gap: var(--sp-2); }
.settings__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); letter-spacing: .02em; }
.settings__switches { display: grid; gap: var(--sp-1); }
.settings__switches .switch { min-height: 44px; }
.settings .segmented__btn .icon { width: 16px; height: 16px; margin-right: 6px; }

.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) and (max-width: 1439px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
