/* screen-welcome.css — owner: js/screens/welcome.js
   Only .scr-welcome-* names live here; shared classes (.btn, .tile, .bubble) are styled
   in components.css and are never redefined. Every colour is a token from base.css.

   The route runs under body.in-lesson, so there is no top bar and no bottom nav: this
   file owns the full viewport, including the safe-area insets that the chrome usually
   handles. Layout is one column — step chrome, step body, action button pinned low —
   and the whole thing has to survive a 320px phone with nothing under 56px tall. */

.scr-welcome{
  display:flex;
  flex-direction:column;
  min-height:100dvh;
  padding-top:env(safe-area-inset-top);
  padding-bottom:env(safe-area-inset-bottom);
}

/* ================================================================= chrome === */

.scr-welcome-top{
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--sp-3);
  min-height:56px;
  padding-top:var(--sp-2);
}

/* Keeps the dots optically centred when there is no back arrow. */
.scr-welcome-spacer{ flex:0 0 auto; width:44px; height:44px; }

.scr-welcome-dots{ display:flex; align-items:center; gap:var(--sp-2); }
.scr-welcome-dot{
  display:block; width:10px; height:10px;
  background:var(--line); border-radius:var(--r-pill);
  transition:width .2s ease-out, background-color .2s ease-out;
}
.scr-welcome-dot.is-on{ width:26px; background:var(--brand); }

/* ================================================================== steps === */

.scr-welcome-step{
  flex:1 1 auto;
  display:flex; flex-direction:column; gap:var(--sp-4);
  width:100%; max-width:var(--shell);
  margin-inline:auto;
  padding:var(--sp-3) var(--sp-4) var(--sp-5);
}

/* Vertically centres the hello step's contents without pulling the button up. */
.scr-welcome-fill{ margin-block:auto; }

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

/* The action button always sits at the bottom of the step, at thumb height. */
.scr-welcome-actions{
  margin-top:auto;
  padding-top:var(--sp-3);
  display:flex; flex-direction:column; gap:var(--sp-3);
}

/* =============================================================== step one === */

.scr-welcome-hero{
  display:flex; justify-content:center;
  padding-block:var(--sp-2);
}
/* mascot.js emits .mochi-say.is-top: bubble above, Mochi below. welcome.js tags that
   bubble with a screen-local class so the greeting gets a comfortable measure here
   without this file ever restyling the shared .bubble. */
.scr-welcome-bubble{ max-width:19ch; text-align:center; }

/* =============================================================== step two === */

.scr-welcome-field{
  display:flex; flex-direction:column; gap:var(--sp-2);
}
.scr-welcome-field > .t-cap{ padding-inline:var(--sp-1); }

.scr-welcome-name{
  width:100%; min-height:56px;
  padding:0 var(--sp-4);
  font-family:inherit; font-size:18px; font-weight:700; text-align:center;
  color:var(--ink);
  background:var(--surface);
  border:2px solid var(--line); border-radius:var(--r-md);
  -webkit-appearance:none; appearance:none;
}
.scr-welcome-name::placeholder{ color:var(--ink-soft); font-weight:600; opacity:1; }
.scr-welcome-name:focus{ border-color:var(--brand); }

.scr-welcome-avatars{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:var(--sp-2);
}
.scr-welcome-avatar{
  min-height:64px;
  aspect-ratio:1 / 1;
  padding:var(--sp-1);
}
.scr-welcome-avatar-glyph{ font-size:30px; line-height:1; }
/* Never colour alone: the chosen face also carries a tick (and aria-pressed). */
.scr-welcome-avatar.is-selected::after{
  content:'\2713';
  position:absolute; top:3px; right:6px;
  font-size:13px; font-weight:800; line-height:1;
  color:var(--brand-dark);
}

/* ============================================================= step three === */

.scr-welcome-tracks{ display:grid; gap:var(--sp-3); }

.scr-welcome-track{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center; gap:var(--sp-4);
  min-height:112px;
  padding:var(--sp-4);
  text-align:left;
}
.scr-welcome-track-icon{ font-size:44px; line-height:1; }
.scr-welcome-track-copy{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.scr-welcome-track-name{ font-size:19px; font-weight:800; line-height:1.2; }
.scr-welcome-track-ages{
  font-size:11px; font-weight:800; letter-spacing:.10em; text-transform:uppercase;
  color:var(--brand-dark);
}
.scr-welcome-track-desc{
  margin-top:var(--sp-1);
  font-size:14px; font-weight:600; line-height:1.35; color:var(--ink-soft);
}

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

@media (max-width:340px){
  .scr-welcome-avatars{ gap:var(--sp-1); }
  .scr-welcome-track{ gap:var(--sp-3); padding:var(--sp-3); }
  .scr-welcome-track-icon{ font-size:38px; }
}

/* Taller phones and tablets: let the hello step breathe a little more. */
@media (min-height:700px){
  .scr-welcome-hero{ padding-block:var(--sp-4); }
}

/* ================================================================= picker === */

/* Step 0 — shown only on a device that already has climbers but none signed in.
   Rows are .tile (components.css owns the pressable look); only the layout inside
   them belongs to this file. */

.scr-welcome-pick{
  display:flex; flex-direction:column; gap:var(--sp-4);
  justify-content:center;
}
.scr-welcome-pick-head{
  display:flex; flex-direction:column; align-items:center; gap:var(--sp-2);
}
.scr-welcome-pick-list{
  display:flex; flex-direction:column; gap:var(--sp-3);
}
.scr-welcome-pick-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center; gap:var(--sp-4);
  min-height:76px;
  padding:var(--sp-3) var(--sp-4);
  text-align:left;
}
.scr-welcome-pick-avatar{
  display:grid; place-items:center;
  width:48px; height:48px;
  font-size:34px; line-height:1;
}
.scr-welcome-pick-copy{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.scr-welcome-pick-name{
  font-size:19px; font-weight:800; line-height:1.2; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.scr-welcome-pick-sub{
  font-size:13px; font-weight:700; line-height:1.2; color:var(--ink-soft);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* Adding a climber is a different kind of action from being one: dashed, not solid. */
.scr-welcome-pick-add{
  border-style:dashed;
}
.scr-welcome-pick-add .scr-welcome-pick-avatar{ color:var(--ink-soft); }

@media (max-width:359px){
  .scr-welcome-pick-row{ gap:var(--sp-3); min-height:68px; }
  .scr-welcome-pick-avatar{ width:40px; height:40px; font-size:28px; }
  .scr-welcome-pick-name{ font-size:17px; }
}

/* A locked climber wears the padlock on their row: being stopped by a dialog you
   did not see coming is worse than seeing the lock and choosing the row anyway. */
.scr-welcome-pick-row{ grid-template-columns:auto minmax(0,1fr) auto; }
.scr-welcome-pick-lock{ font-size:18px; line-height:1; }

/* The "bring a climber over from the old tablet" door. Quiet on purpose: it is the
   right answer for a minority of arrivals and the wrong one for everybody else. */
.scr-welcome-claim{ margin-top:var(--sp-2); font-size:14px; }
