/* screen-profile.css — owner: js/screens/profile.js
   Only .scr-profile-* names live here. .card, .btn, .tile, .chip, .ring and .bar come
   from components.css and are never redefined — where a control needs to look different
   (the goal tiles, the danger button) the change is scoped to a .scr-profile-* class
   sitting alongside the shared one. Colours are tokens only.

   The screen runs under the normal chrome, so the last section clears the bottom nav. */

.scr-profile{
  display:flex; flex-direction:column; gap:var(--sp-5);
  padding-block:var(--sp-4) var(--sp-7);
}

.scr-profile-title{ line-height:1.2; }
.scr-profile-title:focus{ outline:none; }

.scr-profile-section{ display:flex; flex-direction:column; gap:var(--sp-2); }
.scr-profile-legend{ padding-inline:var(--sp-1); }

/* ================================================================== head === */

.scr-profile-head{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center; gap:var(--sp-4);
}
.scr-profile-head-ring{
  --ring-size:84px; --ring-w:4px;
  position:relative; flex:0 0 auto;
  width:var(--ring-size); height:var(--ring-size);
}
.scr-profile-head-avatar{
  position:absolute; inset:0;
  display:grid; place-items:center;
  font-size:38px; line-height:1;
}
.scr-profile-head-level{
  position:absolute; left:50%; bottom:-7px;
  transform:translateX(-50%);
  padding:2px 9px;
  font-size:11px; font-weight:800; letter-spacing:.04em; white-space:nowrap;
  color:var(--surface); background:var(--brand);
  border-radius:var(--r-pill);
}
.scr-profile-head-copy{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.scr-profile-head-name{ line-height:1.2; overflow-wrap:anywhere; }
.scr-profile-head-lvl{ margin-top:var(--sp-1); }
.scr-profile-head-chips{ margin-top:var(--sp-2); flex-wrap:wrap; }

/* ============================================================== switcher === */

.scr-profile-list{ padding:var(--sp-1) var(--sp-3); }

.scr-profile-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center; gap:var(--sp-3);
  width:100%; min-height:64px;
  padding:var(--sp-2) 0;
  text-align:left; color:var(--ink);
  -webkit-tap-highlight-color:transparent;
}
.scr-profile-row + .scr-profile-row{ border-top:2px solid var(--line); }
.scr-profile-row:active{ background:var(--brand-soft); }

.scr-profile-row-avatar{
  display:grid; place-items:center;
  width:48px; height:48px;
  font-size:24px; line-height:1;
  background:var(--brand-soft); border-radius:var(--r-pill);
}
.scr-profile-row-copy{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.scr-profile-row-name{
  font-size:16px; font-weight:800; line-height:1.25; overflow-wrap:anywhere;
}
.scr-profile-row-sub{ font-size:13px; font-weight:700; color:var(--ink-soft); line-height:1.3; }
.scr-profile-row-mark{
  display:inline-flex; align-items:center; gap:4px;
  font-size:12px; font-weight:800; letter-spacing:.02em;
  color:var(--ink-soft); white-space:nowrap;
}
/* A locked climber is marked on the row itself, so a child sees the lock before
   tapping rather than being stopped by a dialog they did not expect. */
.scr-profile-row-lock{ font-size:13px; line-height:1; }
.scr-profile-row.is-active .scr-profile-row-avatar{
  background:var(--surface);
  box-shadow:0 0 0 3px var(--brand);
}
.scr-profile-row.is-active .scr-profile-row-mark{ color:var(--ok); }

.scr-profile-add .scr-profile-row-avatar{
  color:var(--brand-dark);
  background:var(--surface);
  border:2px dashed var(--line);
  font-size:22px; font-weight:800;
}
.scr-profile-add .scr-profile-row-name{ color:var(--brand-dark); }

/* ============================================================ daily goal === */

.scr-profile-goals{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:var(--sp-2);
}
.scr-profile-goal{ min-height:64px; padding:var(--sp-2) var(--sp-1); gap:0; }
.scr-profile-goal-num{ font-size:20px; font-weight:800; line-height:1.1; }
.scr-profile-goal-unit{
  font-size:11px; font-weight:800; letter-spacing:.08em; color:var(--ink-soft);
}
/* Never colour alone: the chosen goal also carries a tick (and aria-pressed). */
.scr-profile-goal.is-selected::after{
  content:'\2713';
  position:absolute; top:3px; right:6px;
  font-size:12px; font-weight:800; line-height:1;
  color:var(--brand-dark);
}
.scr-profile-goal-line{ line-height:1.35; }

/* =========================================================== danger zone === */

.scr-profile-danger{ border-color:var(--bad-soft); }
.scr-profile-danger-btn{
  --btn-fg:var(--bad);
  border-color:var(--bad-soft);
}

/* ============================================================ parent note === */

.scr-profile-parent{
  display:flex; flex-direction:column; gap:var(--sp-3);
  background:var(--brand-soft); border-color:var(--brand-soft);
}
.scr-profile-parent-title{ display:flex; align-items:center; gap:var(--sp-2); }
.scr-profile-parent p{ line-height:1.5; color:var(--ink); }

/* ================================================================ narrow === */

@media (max-width:340px){
  .scr-profile-head{ gap:var(--sp-3); }
  .scr-profile-head-ring{ --ring-size:72px; }
  .scr-profile-head-avatar{ font-size:32px; }
  .scr-profile-goals{ gap:var(--sp-1); }
  .scr-profile-list{ padding-inline:var(--sp-2); }
}
