/* ============================================================
   Аккаунт: профиль, статистика, аватарки
   ============================================================ */

/* ---------- Аватарки (используются и за столом мафии) ---------- */
.avatar-image{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.avatar-letter{width:100%;height:100%;display:grid;place-items:center;border-radius:inherit;background:var(--accent-soft);color:var(--accent-ink);font-weight:700}

/* ---------- Профиль ---------- */
.profile-page{padding:28px 0 60px}
.profile-loading,.stats-empty{padding:40px 0;color:var(--muted);font-size:15px}
.profile-card{padding:28px;border-radius:var(--r-xl);background:var(--surface);box-shadow:var(--shadow-sm)}
.profile-head{display:grid;grid-template-columns:auto 1fr auto;gap:28px;align-items:start}
.avatar-block{display:flex;flex-direction:column;align-items:center;gap:10px}
.avatar-large{width:132px;height:132px;border-radius:32px;overflow:hidden;background:var(--surface-2);font-size:44px}
.avatar-actions{display:flex;flex-direction:column;align-items:center;gap:6px}
.avatar-upload{cursor:pointer;font-size:13px;height:36px;padding:0 14px}
.profile-main{min-width:0}
.profile-main h1{font-size:clamp(26px,3vw,36px)}
.profile-email{margin-top:4px;color:var(--muted);font-size:14px}
.profile-about{margin-top:12px;max-width:560px;color:var(--text);font-size:15px;line-height:1.6;white-space:pre-wrap}
.profile-edit{margin-top:14px;max-width:560px}
.profile-edit textarea{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--ink);font:inherit;font-size:15px;resize:vertical;outline:0}
.profile-edit textarea:focus{border-color:var(--accent);background:#fff;box-shadow:0 0 0 4px var(--accent-soft)}
.edit-actions{display:flex;align-items:center;gap:14px;margin-top:10px}
.about-counter{color:var(--faint);font-size:13px}
.profile-buttons{display:flex;align-items:center;gap:12px;margin-top:18px}
.profile-totals{display:flex;gap:10px}
.profile-totals article{min-width:104px;padding:16px;border-radius:var(--r);background:var(--surface-2);text-align:center}
.profile-totals b{display:block;font-size:26px;font-weight:800}
.profile-totals span{color:var(--muted);font-size:13px}
.profile-missing{padding:60px 0;text-align:center}
.profile-missing h1{font-size:32px}
.profile-missing p{margin:12px 0 22px;color:var(--muted)}

.stats-section{padding-top:36px}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.stat-card{padding:18px;border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm)}
.stat-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:12px}
.stat-head h3{font-size:17px}
.stat-games{color:var(--muted);font-size:13px}
.stat-bar{height:8px;border-radius:4px;background:var(--surface-3);overflow:hidden}
.stat-bar i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--green),#5fd08a)}
.stat-numbers{display:flex;align-items:center;gap:14px;margin-top:12px;color:var(--muted);font-size:13px}
.stat-numbers b{color:var(--ink);font-weight:700}
.stat-numbers strong{margin-left:auto;color:var(--green-ink);font-size:16px}
.stat-win b{color:var(--green-ink)}
.stat-loss b{color:var(--coral-ink)}

/* ---------- Диалог входа ---------- */
.auth-perks{margin:18px 0 0;padding:16px 16px 16px 34px;border-radius:14px;background:var(--accent-softer);color:var(--text);font-size:14px;line-height:1.6}
.auth-perks li{margin:2px 0}
.auth-hint{margin-top:16px;padding-top:16px;border-top:1px solid var(--line);text-align:center}
.auth-hint p{margin-top:8px;color:var(--muted);font-size:13px;line-height:1.5}
.register-button{width:100%;justify-content:center}

/* ---------- Профиль в шапке ---------- */
.header-account{display:inline-flex;align-items:center;gap:9px;padding:4px 14px 4px 4px;border:1px solid var(--line);border-radius:var(--r-pill);background:#fff;color:var(--ink);text-decoration:none;font-size:14px;font-weight:600;cursor:pointer;transition:border-color .15s}
.header-account:hover{border-color:var(--line-strong)}
.header-account .avatar-slot{width:30px;height:30px;border-radius:50%;overflow:hidden;flex:0 0 auto;font-size:13px}

@media(max-width:900px){
  .profile-head{grid-template-columns:auto 1fr;gap:20px}
  .profile-totals{grid-column:1/-1}
}
@media(max-width:640px){
  .profile-card{padding:20px}
  .profile-head{grid-template-columns:1fr;justify-items:center;text-align:center}
  .profile-main{width:100%}
  .profile-about{margin-inline:auto}
  .profile-buttons{justify-content:center}
  .profile-totals{width:100%}
  .profile-totals article{flex:1;min-width:0}
  .avatar-large{width:110px;height:110px;border-radius:28px}
}

/* ---------- Страницы подтверждения почты и смены пароля ---------- */
.account-page{display:grid;place-items:center;min-height:60vh;padding:48px 0}
.account-card{width:min(520px,100%);padding:36px;border-radius:var(--r-xl);background:var(--surface);box-shadow:var(--shadow-sm);text-align:center}
.account-status{display:inline-block;margin-bottom:14px;padding:6px 14px;border-radius:var(--r-pill);background:var(--surface-2);color:var(--muted);font-size:13px;font-weight:700}
.account-status.ok{background:var(--green-soft);color:var(--green-ink)}
.account-status.error{background:var(--coral-soft);color:var(--coral-ink)}
.account-card h1{font-size:clamp(24px,3vw,32px)}
.account-card>p{margin:12px auto 24px;max-width:400px;color:var(--muted);font-size:15px;line-height:1.6}
.account-form{display:flex;flex-direction:column;gap:14px;text-align:left}
.account-form .field-label input{height:48px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font-size:15px;outline:0}
.account-form .field-label input:focus{border-color:var(--accent);background:#fff;box-shadow:0 0 0 4px var(--accent-soft)}
.account-form button{justify-content:center;min-height:50px}
