/* Part of Survival Language — see index.html for load order.
   Junior profile screen (js/screens.settings.js renderJuniorProfile()) — the
   kid-facing "Профиль" nav tab. Deliberately its own file/screen rather than
   a kid-mode branch inside renderSettings(): the adult Settings screen (a
   dense form list — rename, birthdate, PIN, security question, family) stays
   completely untouched, and this is a different composition — a big
   celebratory hero card up top (avatar, name, streak, XP), a couple of fun
   shortcuts, and the "grown-up" stuff (family, leaving kid mode, logging
   out) folded away behind one "Для родителей" reveal instead of leading
   with a wall of settings fields. */

  .profile-hero{
    position:relative; overflow:hidden; text-align:center;
    margin-top:6px; padding:var(--space-8) var(--space-6);
    border-radius:var(--radius-lg); color:#fff;
    background:linear-gradient(135deg, var(--hero-a), var(--hero-b));
    box-shadow:0 14px 28px -14px color-mix(in srgb, var(--hero-a) 55%, transparent);
  }
  .profile-hero::before{
    content:""; position:absolute; width:180px; height:180px; border-radius:50%;
    background:rgba(255,255,255,.10); top:-70px; right:-55px; pointer-events:none;
  }
  .profile-hero-avatar{ position:relative; z-index:1; display:flex; justify-content:center; margin-bottom:var(--space-4); }
  /* Round 4 (real-code pass of the profile-screen redesign, Sept 10) — the avatar
     itself is now directly tappable: a pencil badge opens the same photo picker
     the "Фото и аватарка" tile below opens (two doors, one action — Sofia:
     "нажми на фото, чтобы сменить" is the standard gesture, no need to hunt for
     a link further down). A second badge shows the chosen companion as a small
     corner icon whenever a real photo is set — companion and photo are separate,
     independently-stored choices (js/store.js avatarHtml()), so when both exist
     the photo wins the big circle and the companion still needs to be visible
     *somewhere* on this card, not just implied. */
  .profile-hero-avatar-wrap{ position:relative; display:inline-flex; }
  .profile-hero-avatar-wrap .avatar-frame,
  .profile-hero-avatar-wrap .who-avatar{ display:flex; }
  .avatar-edit-badge{
    position:absolute; right:-2px; bottom:-2px; width:30px; height:30px; border-radius:50%;
    background:var(--surface); color:var(--hero-a); display:flex; align-items:center; justify-content:center;
    border:2px solid var(--surface); box-shadow:0 4px 10px rgba(0,0,0,.22); flex:none;
  }
  .avatar-edit-badge svg{ width:15px; height:15px; }
  .hero-companion-badge{
    position:absolute; left:-2px; bottom:-2px; width:28px; height:28px; border-radius:50%;
    background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:15px;
    border:2px solid var(--surface); box-shadow:0 3px 8px rgba(0,0,0,.2); flex:none;
  }

  /* Language marker — a placeholder for when the course covers more than
     Georgian, not a real switcher yet (there's nothing else to pick today, so
     nothing here toggles). The flag sits on its own translucent plate: on its
     own the emoji read like a stray sticker against the hero gradient, Sofia
     asked for "небольшую полупрозрачную подложку". */
  .hero-lang-chip{
    position:relative; z-index:1; display:inline-flex; align-items:center; gap:6px;
    background:rgba(255,255,255,.16); border:1.5px solid rgba(255,255,255,.3); border-radius:999px;
    padding:5px 12px 5px 6px; font-size:12.5px; font-weight:700; color:#fff; margin:-2px 0 var(--space-4);
  }
  .hero-lang-chip .flag{
    font-size:12px; line-height:1; display:inline-flex; align-items:center; justify-content:center;
    width:20px; height:20px; border-radius:6px; background:rgba(255,255,255,.32);
  }
  .profile-hero-name{
    position:relative; z-index:1; font-family:'Unbounded',sans-serif; font-weight:800;
    font-size:22px; line-height:1.2; margin-bottom:var(--space-6);
  }
  .profile-hero-stats{ position:relative; z-index:1; display:flex; gap:var(--space-3); }
  .profile-stat{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
    background:rgba(255,255,255,.14); border:1.5px solid rgba(255,255,255,.28);
    border-radius:var(--radius-md); padding:var(--space-3) var(--space-2);
  }
  .profile-stat:hover{ background:rgba(255,255,255,.2); }
  .profile-stat-icon{ width:22px; height:22px; }
  .profile-stat-icon svg{ width:100%; height:100%; display:block; }
  .profile-stat-num{ font-family:'Unbounded',sans-serif; font-variant-numeric:tabular-nums; font-weight:800; font-size:22px; line-height:1.2; }
  .profile-stat-label{ font-size:11px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:rgba(255,255,255,.85); }

  /* п.37: заголовок секции (Семья / Достижения / Язык и т.п. на странице
     профиля) — обычный регистр вместо капса. */
  .profile-section-label{
    font-size:12.5px; font-weight:700;
    color:var(--ink-faint); margin:var(--space-6) 0 var(--space-2);
  }
  /* Photo actions reuse the same .link-btn text-link style Settings already
     uses for choosePhoto/chooseFromGallery/removePhoto — kept as plain links
     here too rather than inventing a second button style. Now lives inside
     the "Фото и аватарка" tile's reveal (see .pick-tile-reveal below) rather
     than its own always-visible section. */
  .profile-photo-actions{ display:flex; flex-wrap:wrap; gap:var(--space-2) var(--space-4); }

  /* ---- "Фото и аватарка" / "Герой" tiles ----
     Replaced the old plain .link-btn rows (Sofia: "в детском профиле мы
     забыли дать возможность выбрать аватарку" — a text link using the exact
     same style as every adult settings link was easy to miss). Two rounds of
     visual iteration on the mockup landed here:
     round 1 — solid vivid tint fills (same 19° gradient technique as the
       Games-hub tiles, css/games.css .g-tint-*), lightened ~20% toward white
       after the first pass lost the dragon/owl/panda/unicorn emoji against a
       too-saturated field;
     round 2 (this pass) — Sofia: "верхние блоки очень конкурируют [с
       карточкой-героем], теряется иерархия" — moved off solid fills onto
       white/--surface with only a thin gradient ring, so the hero card stays
       the one saturated element on the screen and these read as its settings,
       not its rivals. The icon circle keeps a heavier ring of the same
       gradient so it still reads as "belonging" to its tile at a glance. */
  .pick-stack{ display:flex; flex-direction:column; gap:var(--space-3); margin:var(--space-2) 0 0; }
  .pick-tile{
    display:flex; align-items:center; gap:var(--space-4); width:100%; text-align:left;
    padding:var(--space-4); border-radius:var(--radius-lg); color:var(--ink); font-family:inherit;
    border:1.5px solid transparent; position:relative;
  }
  .pick-tile.t-avatar{
    background:linear-gradient(var(--surface),var(--surface)) padding-box,
               linear-gradient(19deg, #8B4169 0%, #E6337B 55%, #EDAC8C 100%) border-box;
  }
  .pick-tile.t-hero{
    background:linear-gradient(var(--surface),var(--surface)) padding-box,
               linear-gradient(19deg, #564B8B 0%, #7D65DC 55%, #41D4CB 100%) border-box;
  }
  .pick-tile-icon{
    flex:none; width:46px; height:46px; border-radius:50%; display:flex; align-items:center;
    justify-content:center; box-shadow:0 2px 6px rgba(20,38,47,.10); border:3px solid transparent;
    font-size:21px;
  }
  .pick-tile.t-avatar .pick-tile-icon{
    color:#8B4169;
    background:linear-gradient(var(--surface),var(--surface)) padding-box,
               linear-gradient(19deg, #8B4169 0%, #E6337B 55%, #EDAC8C 100%) border-box;
  }
  .pick-tile.t-hero .pick-tile-icon{
    background:linear-gradient(var(--surface),var(--surface)) padding-box,
               linear-gradient(19deg, #564B8B 0%, #7D65DC 55%, #41D4CB 100%) border-box;
  }
  .pick-tile-icon svg{ width:22px; height:22px; }
  .pick-tile-body{ min-width:0; flex:1; }
  .pick-tile .t-title{ display:block; font-weight:700; font-size:15px; }
  .pick-tile .t-sub{ display:block; font-size:12px; color:var(--ink-soft); margin-top:2px; }
  .pick-tile-chevron{ flex:none; color:var(--ink-faint); }
  /* Down = expands in place (avatar tile's reveal); right = navigates to
     another screen (hero tile → companion picker) — same down/up convention
     .parent-zone-toggle already uses just below, right added for navigation. */
  .pick-tile-chevron svg{ width:17px; height:17px; transition:transform .18s ease; }
  .pick-tile.t-hero .pick-tile-chevron svg{ transform:rotate(-90deg); }
  .pick-tile[aria-expanded="true"] .pick-tile-chevron svg{ transform:rotate(180deg); }
  .pick-tile-reveal{
    padding:var(--space-4) var(--space-2) 2px; margin-top:calc(-1 * var(--space-2));
  }

  /* ---- "Семья" strip — a read-only glance at who else shares this account,
     not the create/join/leave management panel (that stays inside "Для
     родителей", untouched). family_info only returns {name, isChild} per
     member today (js/screens.settings.js familyPanelHtml()) — no photo or
     companion — so each member here is an initials circle in a color derived
     from their name, same honesty as the who-avatar fallback everywhere else
     in the app. Section only renders once a family actually exists. */
  .family-strip{ display:flex; gap:var(--space-4); overflow-x:auto; padding:2px 2px var(--space-2); }
  .family-member{ flex:none; display:flex; flex-direction:column; align-items:center; gap:6px; width:60px; }
  .family-member-avatar{
    width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    color:#fff; font-family:'Unbounded',sans-serif; font-weight:800; font-size:18px;
    box-shadow:0 2px 6px rgba(20,38,47,.12);
  }
  .family-member-name{ font-size:11px; font-weight:700; color:var(--ink-soft); text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
  .family-member-role{ font-size:9.5px; color:var(--ink-faint); text-align:center; margin-top:-4px; }

  /* ---- "Для родителей" reveal ---- */
  .parent-zone{ margin-top:var(--space-6); }
  .parent-zone-toggle{
    width:100%; display:flex; align-items:center; gap:var(--space-3); text-align:left;
    background:var(--surface-2); border:1.5px solid var(--border); border-radius:var(--radius-md);
    padding:var(--space-4); color:var(--ink); transition:border-color .15s ease;
  }
  .parent-zone-toggle:hover{ border-color:var(--ink-faint); }
  .parent-zone-toggle-icon{ flex:none; width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--surface); color:var(--ink-faint); }
  .parent-zone-toggle-icon svg{ width:18px; height:18px; }
  .parent-zone-toggle-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
  .parent-zone-toggle-title{ font-size:14.5px; font-weight:700; }
  .parent-zone-toggle-hint{ font-size:12.5px; color:var(--ink-soft); }
  .parent-zone-toggle-chevron{ flex:none; width:18px; height:18px; color:var(--ink-faint); transition:transform .18s ease; }
  .parent-zone-toggle[aria-expanded="true"] .parent-zone-toggle-chevron{ transform:rotate(180deg); }
  .parent-zone-body{
    display:flex; flex-direction:column; gap:var(--space-6);
    margin-top:var(--space-4); padding:var(--space-6); border-radius:var(--radius-md);
    background:var(--surface-2); border:1.5px dashed var(--border);
  }
  .parent-zone-full-link{ align-self:flex-start; }

  /* ---- Adult profile bento dashboard (course ring + weekly activity + quick
     stats) — js/screens.settings.js profileBentoHtml(), prepended above the
     adult Settings form. Sofia found a fitness-app reference with this exact
     shape (donut progress, weekly bar chart, icon stat cards) and asked for
     something similar here; every number on these cards is real (see the
     comment above profileBentoHtml() in screens.settings.js for the source of
     each one) — no chart on this screen ever shows a made-up value. */
  .profile-bento{ display:flex; flex-direction:column; gap:var(--space-4); margin:var(--space-2) 0 var(--space-6); }
  /* п.39 (тени, раунд 2): border уже даёт карточке край — тень поверх него
     была лишней. Держится на разнице --surface/--bg (в тёмной теме разница
     ещё заметнее — см. комментарий в tokens.css про "real card separation"). */
  .bento-card{
    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
    padding:var(--space-6);
  }
  .bento-card-label{
    font-size:12.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
    color:var(--ink-faint); margin-bottom:var(--space-4);
  }

  .course-ring-card{ display:flex; flex-direction:column; align-items:center; text-align:center; }
  .course-ring-wrap{ position:relative; width:128px; height:128px; margin:0 auto; }
  .course-ring-svg{ display:block; }
  .course-ring-track{ stroke:var(--surface-2); }
  .course-ring-fill{ stroke:url(#course-ring-grad); stroke-linecap:round; transition:stroke-dashoffset .5s var(--ease-standard); }
  .course-ring-pct{
    position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
    font-family:'Unbounded',sans-serif; font-weight:800; font-size:24px; color:var(--ink);
  }
  .course-ring-caption{ margin-top:var(--space-3); font-size:13px; color:var(--ink-soft); }

  .profile-metrics-row{ display:grid; grid-template-columns:1fr 1fr; gap:var(--space-3); }
  .profile-metric-tile{
    display:flex; flex-direction:column; align-items:center; gap:4px; text-align:center;
    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
    padding:var(--space-4) var(--space-3);
  }
  .profile-metric-icon{ width:24px; height:24px; color:var(--hero-b-text); margin-bottom:2px; }
  .profile-metric-icon svg{ width:100%; height:100%; display:block; }
  .profile-metric-num{ font-family:'Unbounded',sans-serif; font-weight:800; font-size:20px; }
  .profile-metric-label{ font-size:12px; color:var(--ink-soft); }

  .weekly-headline{ display:flex; align-items:baseline; gap:6px; margin-bottom:var(--space-4); }
  .weekly-headline-num{ font-family:'Unbounded',sans-serif; font-weight:800; font-size:24px; }
  .weekly-headline-label{ font-size:13px; color:var(--ink-soft); }
  .weekly-bar-chart{ display:flex; align-items:flex-end; gap:var(--space-2); height:96px; }
  .weekly-bar-col{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; }
  .weekly-bar-track{
    flex:1; width:100%; max-width:28px; display:flex; align-items:flex-end;
    background:var(--surface-2); border-radius:999px; overflow:hidden;
  }
  .weekly-bar-fill{ width:100%; min-height:4px; border-radius:999px; background:linear-gradient(180deg, var(--hero-b), var(--hero-a)); }
  .weekly-bar-col.today .weekly-bar-fill{ background:linear-gradient(180deg, var(--accent-2), var(--accent)); }
  .weekly-bar-label{ font-size:11px; font-weight:700; color:var(--ink-faint); }
  .weekly-bar-col.today .weekly-bar-label{ color:var(--accent); }
