/* ═══════════════════════════════════════════════
   DXRP — Profile Page Styles
   ═══════════════════════════════════════════════ */

/* Force [hidden] to win over .profile-gate/.profile-loading display:flex */
[hidden]{display:none !important}

.profile-page{background:var(--bg)}
.profile-main{min-height:calc(100vh - var(--nav-h));display:block}

/* ── Gate screens ─────────────────────────────── */
.profile-gate{
  min-height:calc(100vh - var(--nav-h));
  display:flex;align-items:center;justify-content:center;
  padding:40px 24px;text-align:center;
}
.gate-inner{max-width:440px}
.gate-icon{font-size:3rem;margin-bottom:20px;opacity:.7}
.gate-inner h2{font-size:1.6rem;font-weight:800;margin-bottom:10px;color:var(--text)}
.gate-inner p{color:var(--muted);font-size:.95rem;margin-bottom:24px;line-height:1.6}

.btn-steam-lg{padding:12px 22px;font-size:1rem;font-weight:700}

/* ── Profile hero ─────────────────────────────── */
.profile-hero{
  background:linear-gradient(160deg,rgba(225,29,72,0.08) 0%,transparent 60%);
  border-bottom:1px solid var(--border);padding:48px 0 44px;
}
.profile-header{
  display:flex;align-items:center;gap:24px;flex-wrap:wrap;
}
.profile-avatar-wrap{position:relative;flex-shrink:0}
.profile-avatar{
  width:96px;height:96px;border-radius:50%;object-fit:cover;
  border:3px solid rgba(225,29,72,0.45);
  box-shadow:0 0 0 6px rgba(225,29,72,0.1);
}
.profile-avatar-placeholder{
  width:96px;height:96px;border-radius:50%;
  background:var(--accent-soft);border:3px solid rgba(225,29,72,0.45);
  color:var(--accent);font-size:2.2rem;font-weight:800;
  display:flex;align-items:center;justify-content:center;
}
.profile-online-dot{
  position:absolute;bottom:4px;right:4px;
  width:16px;height:16px;border-radius:50%;
  background:var(--green,#22c55e);border:2px solid var(--bg);
  box-shadow:0 0 0 2px rgba(34,197,94,0.25);
}

.profile-meta{flex:1;min-width:240px;display:flex;flex-direction:column;gap:8px}
.profile-name{font-size:1.8rem;font-weight:900;color:var(--text);margin:0;line-height:1.1}

/* Editable title */
.profile-title-line{display:flex;align-items:center;gap:8px;min-height:24px}
.profile-title-view{
  display:inline-flex;align-items:center;gap:8px;
  cursor:pointer;border-radius:6px;padding:2px 8px;margin-left:-8px;
  color:var(--sub);font-size:.92rem;font-weight:500;
  transition:background-color .15s ease, color .15s ease;
  outline:none;
}
.profile-title-view:hover,
.profile-title-view:focus-visible{
  background:var(--accent-soft);color:var(--accent-h);
}
.profile-title-view:focus-visible{box-shadow:0 0 0 2px rgba(225,29,72,0.4)}
.profile-title-text.empty{font-style:italic;opacity:.7}
.profile-title-pencil{font-size:.82rem;opacity:.6}
.profile-title-view:hover .profile-title-pencil{opacity:1}

/* Badges row */
.profile-badges{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:4px;
}
.profile-job{
  display:inline-block;padding:3px 10px;border-radius:5px;
  background:var(--accent-soft);border:1px solid rgba(225,29,72,0.25);
  color:var(--accent-h);font-size:.76rem;font-weight:700;
  text-transform:uppercase;letter-spacing:.06em;
}
.profile-gang{
  --gang-color:var(--accent);
  display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:5px;
  background:color-mix(in srgb,var(--gang-color) 12%,transparent);
  border:1px solid color-mix(in srgb,var(--gang-color) 35%,transparent);
  color:var(--gang-color);font-size:.76rem;font-weight:700;
  text-transform:uppercase;letter-spacing:.06em;text-decoration:none;
  transition:transform .15s ease;
}
.profile-gang:hover{transform:translateY(-1px)}
.profile-since{font-size:.8rem;color:var(--muted)}

.profile-actions{margin-left:auto;display:flex;gap:10px;align-items:center}
.btn-logout{
  padding:8px 16px;border-radius:8px;border:1px solid var(--border);
  background:transparent;color:var(--muted);font-size:.82rem;font-weight:500;
  cursor:pointer;transition:all .2s var(--ease);text-decoration:none;
}
.btn-logout:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}

/* ── Stats grid ───────────────────────────────── */
.profile-stats-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:14px;margin-top:40px;
}
.stat-card{
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--r);padding:18px 14px;text-align:center;
  transition:border-color .2s var(--ease), transform .15s var(--ease);
}
.stat-card:hover{border-color:var(--border-h);transform:translateY(-1px)}
.stat-card-icon{font-size:1.4rem;margin-bottom:8px;opacity:.85}
.stat-card-val{
  font-size:1.5rem;font-weight:800;color:var(--text);
  font-family:var(--font);margin-bottom:3px;line-height:1.1;
  word-break:break-word;
}
.stat-card-val.small{font-size:.88rem;font-weight:600;color:var(--sub);letter-spacing:0}
.stat-card-val.accent{color:var(--accent)}
.stat-card-val.gold{color:var(--gold,#f59e0b)}
.stat-card-lbl{font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-weight:600}

/* ── Body (bio + two-column grid) ─────────────── */
.profile-body{padding:40px 24px 64px;display:flex;flex-direction:column;gap:40px}

/* Bio */
.profile-bio-wrap{
  background:var(--card);border:1px solid var(--border);border-radius:var(--r);
  padding:22px 22px 18px;display:flex;flex-direction:column;gap:10px;
}
.profile-bio-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:2px;
}
.profile-bio-head h2{
  font-size:1.05rem;font-weight:700;color:var(--sub);margin:0;
  display:flex;align-items:center;gap:8px;
}
.profile-bio-view{
  margin:0;font-size:.95rem;line-height:1.65;color:var(--text);white-space:pre-line;
}
.profile-bio-view.empty{color:var(--muted);font-style:italic}

/* Inline edit forms */
.profile-inline-form{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;width:100%;
}
.profile-inline-form.vertical{flex-direction:column;align-items:stretch;gap:10px}
.profile-inline-form input[type=text],
.profile-inline-form textarea{
  flex:1;min-width:0;padding:8px 12px;border-radius:8px;
  border:1px solid var(--border);background:var(--surface);color:var(--text);
  font-family:inherit;font-size:.95rem;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.profile-inline-form textarea{resize:vertical;min-height:72px;line-height:1.5}
.profile-inline-form input[type=text]:focus,
.profile-inline-form textarea:focus{
  outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(225,29,72,0.18);
}
.profile-inline-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
.profile-inline-count{font-size:.78rem;color:var(--muted);font-variant-numeric:tabular-nums}
.profile-inline-actions{display:flex;gap:8px}

/* Buttons */
.btn-inline-edit{
  padding:6px 12px;border-radius:7px;border:1px solid var(--border);
  background:transparent;color:var(--sub);font-size:.82rem;font-weight:600;
  cursor:pointer;transition:all .15s ease;
}
.btn-inline-edit:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}

.btn-inline-save{
  padding:8px 14px;border-radius:7px;border:1px solid var(--accent);
  background:var(--accent);color:#fff;font-size:.82rem;font-weight:700;
  cursor:pointer;transition:all .15s ease;
}
.btn-inline-save:hover{background:var(--accent-h);border-color:var(--accent-h)}

.btn-inline-cancel{
  padding:8px 14px;border-radius:7px;border:1px solid var(--border);
  background:transparent;color:var(--muted);font-size:.82rem;font-weight:600;
  cursor:pointer;transition:all .15s ease;
}
.btn-inline-cancel:hover{border-color:var(--border-h);color:var(--sub)}

/* Save status */
.profile-save-status{
  min-height:1em;font-size:.82rem;color:var(--muted);
  transition:color .15s ease;
}
.profile-save-status.is-pending{color:var(--muted)}
.profile-save-status.is-ok{color:var(--green,#22c55e);font-weight:600}
.profile-save-status.is-err{color:var(--accent);font-weight:600}

/* ── Two-column grid ──────────────────────────── */
.profile-grid-2{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:28px;
}

/* ── Sessions + kills lists ───────────────────── */
.profile-sessions h2{
  font-size:1.05rem;font-weight:700;margin:0 0 14px;
  display:flex;align-items:center;gap:8px;color:var(--sub);
}
.sessions-list{display:flex;flex-direction:column;gap:8px}
.session-row{
  display:flex;align-items:center;justify-content:space-between;
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--r);padding:12px 14px;gap:14px;
  transition:border-color .15s ease;
}
.session-row:hover{border-color:var(--border-h)}
.session-date{font-size:.82rem;color:var(--muted);white-space:nowrap}
.session-dur{
  font-size:.88rem;font-weight:600;color:var(--sub);
  background:var(--surface);padding:3px 10px;border-radius:5px;
  font-variant-numeric:tabular-nums;
}
.sessions-empty{color:var(--muted);font-size:.88rem;font-style:italic;padding:12px 0;margin:0}

/* Kill rows */
.kill-row{gap:12px}
.kill-row-left{
  display:flex;align-items:center;gap:8px;min-width:0;flex:1;
}
.kill-avatar{
  width:24px;height:24px;border-radius:50%;object-fit:cover;flex-shrink:0;
  border:1px solid var(--border);
}
.kill-victim{
  font-size:.88rem;font-weight:600;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.kill-weapon{
  font-size:.76rem;font-weight:600;color:var(--accent-h);
  background:var(--accent-soft);padding:2px 8px;border-radius:4px;
  text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;
}

/* ── Loading state ────────────────────────────── */
.profile-loading{
  min-height:calc(100vh - var(--nav-h));
  display:flex;align-items:center;justify-content:center;
  flex-direction:column;gap:12px;color:var(--muted);
}
.loading-spinner{
  width:32px;height:32px;border:3px solid var(--border);
  border-top-color:var(--accent);border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Responsive ───────────────────────────────── */
@media(max-width:700px){
  .profile-header{flex-direction:column;align-items:flex-start;gap:16px}
  .profile-actions{margin-left:0}
  .profile-name{font-size:1.4rem}
  .profile-avatar,.profile-avatar-placeholder{width:80px;height:80px}
  .profile-stats-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .stat-card{padding:14px 10px}
  .stat-card-val{font-size:1.2rem}
  .stat-card-val.small{font-size:.78rem}
  .session-row{flex-wrap:wrap;gap:8px}
  .kill-row{flex-direction:column;align-items:flex-start}
  .profile-grid-2{grid-template-columns:1fr;gap:24px}
  .profile-body{padding:32px 16px 48px;gap:28px}
  .profile-hero{padding:36px 0 32px}
}
