/* =========================================================
   Account & Profile pages — extends auth.css
   Tokens match style.css: #0563bb primary, Open Sans / Raleway
   ========================================================= */

/* ----- Auth page wide variant ----- */
#auth.services .auth-card {
  position: relative;
}
.auth-card .field-help {
  font-size: 12.5px;
  color: #6c757d;
  margin-top: 4px;
}
.auth-card .field-error {
  color: #c0392b;
  font-size: 12.5px;
  margin-top: 4px;
  display: none;
}
.auth-card .field-success {
  color: #16a085;
  font-size: 12.5px;
  margin-top: 4px;
  display: none;
}
.auth-card .field-status.valid .field-success { display: block; }
.auth-card .field-status.invalid .field-error { display: block; }
.auth-card .field-status.valid .form-control { border-color: #16a085; }
.auth-card .field-status.invalid .form-control { border-color: #c0392b; }

.pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 4px;
}
.pw-strength span {
  height: 4px;
  flex: 1;
  background: #e2e7ee;
  border-radius: 2px;
  transition: background 0.2s;
}
.pw-strength[data-score="1"] span:nth-child(-n+1) { background: #c0392b; }
.pw-strength[data-score="2"] span:nth-child(-n+2) { background: #e67e22; }
.pw-strength[data-score="3"] span:nth-child(-n+3) { background: #f39c12; }
.pw-strength[data-score="4"] span { background: #27ae60; }
.pw-strength-label {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 6px;
}

/* OAuth divider + button */
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #adb5bd;
  font-size: 12.5px;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e7ee;
}
.btn-oauth {
  width: 100%;
  background: #fff;
  color: #45505b;
  border: 1px solid #d4dae3;
  padding: 11px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-oauth:hover { background: #f5f8fd; border-color: #0563bb; }
.btn-oauth:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-oauth img, .btn-oauth svg { width: 18px; height: 18px; }
.btn-oauth small {
  display: block;
  font-size: 11px;
  color: #adb5bd;
  font-weight: 400;
  margin-top: 2px;
}

.form-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #45505b; margin-bottom: 14px; }
.form-check input { margin: 0; }

.auth-link {
  color: #0563bb;
  font-weight: 600;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* ===== Settings page ===== */
.settings-shell {
  max-width: 980px;
  margin: 60px auto 80px;
  padding: 0 20px;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}
.settings-header h1 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: #173b6c;
  margin: 0;
}
.settings-header .me-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #6c757d;
}
.settings-header .me-summary .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: #e7f1fb; color: #0563bb;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; line-height: 1;
  font-family: "Raleway", sans-serif;
  overflow: hidden;
  flex-shrink: 0;
}
.settings-header .me-summary .avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e7ee;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.settings-tabs button {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: "Open Sans", sans-serif;
}
.settings-tabs button:hover { color: #0563bb; }
.settings-tabs button.active {
  color: #0563bb;
  border-bottom-color: #0563bb;
}

.settings-panel {
  display: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 90px 0 rgba(110, 123, 131, 0.1);
  padding: 28px 32px;
}
.settings-panel.active { display: block; }
.settings-panel h2 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #45505b;
  margin: 0 0 4px;
}
.settings-panel .panel-sub {
  color: #6c757d;
  font-size: 13.5px;
  margin: 0 0 22px;
}
.settings-section {
  border-top: 1px solid #f0f3f7;
  padding: 22px 0;
}
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.settings-section h3 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #173b6c;
  margin: 0 0 4px;
}
.settings-section .sect-sub {
  color: #6c757d;
  font-size: 13px;
  margin: 0 0 14px;
}

.settings-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.settings-row .form-group { flex: 1; min-width: 220px; margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; color: #45505b; margin-bottom: 6px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d4dae3;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Open Sans", sans-serif;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #0563bb;
  box-shadow: 0 0 0 3px rgba(5, 99, 187, 0.15);
}
.form-group .help { font-size: 12px; color: #6c757d; margin-top: 4px; }

.btn-primary-pill,
.btn-secondary-pill,
.btn-danger-pill {
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Open Sans", sans-serif;
}
.btn-primary-pill { background: #0563bb; color: #fff; }
.btn-primary-pill:hover { background: #044a8f; }
.btn-primary-pill:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary-pill { background: #f2f3f5; color: #45505b; }
.btn-secondary-pill:hover { background: #e7eaef; }
.btn-danger-pill { background: #fdecea; color: #c0392b; border: 1px solid #f8d7d3; }
.btn-danger-pill:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #f0f3f7;
}
.toggle-row:first-child { border-top: 0; }
.toggle-row .toggle-label { flex: 1; }
.toggle-row .toggle-label strong { color: #173b6c; font-size: 14px; display: block; }
.toggle-row .toggle-label small { color: #6c757d; font-size: 12.5px; display: block; margin-top: 2px; }

.toggle-switch {
  position: relative;
  width: 42px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute; inset: 0;
  background: #d4dae3;
  border-radius: 24px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-switch .slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .slider { background: #0563bb; }
.toggle-switch input:checked + .slider::before { transform: translateX(18px); }
.toggle-switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

.settings-radio {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 6px;
}
.settings-radio label {
  flex: 1; min-width: 140px;
  border: 1px solid #d4dae3;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: flex-start; gap: 10px;
}
.settings-radio label.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.settings-radio label:has(input:checked) {
  border-color: #0563bb;
  background: #f5f8fd;
  box-shadow: 0 0 0 3px rgba(5, 99, 187, 0.08);
}
.settings-radio label > div { flex: 1; }
.settings-radio label strong { display: block; font-size: 13.5px; color: #173b6c; }
.settings-radio label small { display: block; font-size: 12px; color: #6c757d; margin-top: 2px; }
.settings-radio input { margin: 2px 0 0; }

.avatar-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.avatar-preview {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #e7f1fb;
  color: #0563bb;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 32px; font-family: "Raleway", sans-serif;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.avatar-actions { display: flex; flex-direction: column; gap: 6px; }
.avatar-actions .help { font-size: 12px; color: #6c757d; }

.session-list { list-style: none; padding: 0; margin: 0; }
.session-list li {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid #f0f3f7;
  gap: 12px;
}
.session-list li:first-child { border-top: 0; }
.session-list .sess-info strong { display: block; font-size: 13.5px; color: #173b6c; }
.session-list .sess-info small { display: block; font-size: 12px; color: #6c757d; margin-top: 2px; }
.session-list .badge-current {
  background: #e7f1fb; color: #0563bb;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  display: inline-block; margin-left: 6px;
}

.alert-inline {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.alert-inline.success { background: #e8f7ee; color: #1e7e34; }
.alert-inline.error   { background: #fdecea; color: #c0392b; }
.alert-inline.info    { background: #e8f0fb; color: #0452a3; }

/* ===== Public profile ===== */
.profile-shell {
  max-width: 1100px;
  margin: 60px auto 80px;
  padding: 0 20px;
}
.profile-header-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 5px 90px 0 rgba(110, 123, 131, 0.1);
  padding: 32px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.profile-avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0563bb 0%, #067ded 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 44px; font-family: "Raleway", sans-serif;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta { flex: 1; min-width: 260px; }
.profile-meta h1 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #173b6c;
  margin: 0 0 4px;
}
.profile-meta .username {
  color: #6c757d; font-size: 14.5px; margin: 0 0 12px;
}
.profile-meta .username a { color: inherit; }
.profile-meta .bio { color: #45505b; line-height: 1.55; font-size: 14.5px; margin: 0 0 12px; }
.profile-meta .meta-row {
  display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: #6c757d;
}
.profile-meta .meta-row span i {
  color: #0563bb; margin-right: 4px;
}
.profile-edit-btn {
  align-self: flex-start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 90px 0 rgba(110, 123, 131, 0.06);
  padding: 18px;
  text-align: center;
}
.stat-card .stat-num {
  font-family: "Raleway", sans-serif;
  font-weight: 700; font-size: 26px; color: #173b6c;
  display: block; line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 12.5px; color: #6c757d;
  margin-top: 6px; text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.profile-section {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 5px 90px 0 rgba(110, 123, 131, 0.06);
  padding: 24px 28px;
  margin-bottom: 24px;
}
.profile-section h2 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #173b6c;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-section .sec-sub {
  color: #6c757d; font-size: 13px; margin: 0 0 18px;
}
.profile-section .view-all {
  font-size: 13px; color: #0563bb; font-weight: 600;
  text-decoration: none;
}
.profile-section .view-all:hover { text-decoration: underline; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.badge-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f8fd;
  border: 1px solid #e2e7ee;
  border-radius: 20px;
  padding: 6px 14px 6px 8px;
  font-size: 13px;
  color: #45505b;
  font-weight: 600;
  position: relative;
}
.badge-pill .badge-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #0563bb;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.badge-pill[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 0;
  transform: translateY(-6px);
  background: #173b6c;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  max-width: 240px;
  width: max-content;
  z-index: 5;
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.journal-card {
  border: 1px solid #e2e7ee;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}
.journal-card.locked {
  background: #f5f8fd;
  text-align: center;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  filter: blur(0);
}
.journal-card.locked .lock-bg {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #d4dae3;
  color: #6c757d;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin: 0 auto 8px;
}
.journal-card .route-name {
  font-family: "Raleway", sans-serif;
  font-weight: 700; font-size: 15px; color: #173b6c;
  display: flex; align-items: center; gap: 8px;
}
.journal-card .route-name .conquered {
  font-size: 11px;
  background: #f4b400;
  color: #fff;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.journal-card .route-meta {
  font-size: 12px; color: #6c757d;
}
.journal-card .route-stats {
  font-size: 12.5px; color: #45505b;
  margin-top: 4px;
}

.runs-list { list-style: none; padding: 0; margin: 0; }
.runs-list li {
  padding: 12px 0;
  border-top: 1px solid #f0f3f7;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.runs-list li:first-child { border-top: 0; }
.runs-list .run-title {
  font-family: "Raleway", sans-serif;
  font-weight: 700; color: #173b6c; font-size: 14.5px;
  text-decoration: none;
}
.runs-list .run-title:hover { color: #0563bb; }
.runs-list .run-meta {
  display: block; font-size: 12.5px; color: #6c757d; margin-top: 2px;
}
.runs-list .run-stats {
  font-size: 13px; color: #45505b; text-align: right;
}

.empty-state {
  text-align: center;
  padding: 30px 14px;
  color: #6c757d;
  font-size: 13.5px;
}
.empty-state i { font-size: 28px; color: #adb5bd; display: block; margin-bottom: 8px; }

/* The .auth-gate-* and .nav-user-block styles live in nav-user.js, which
   injects them into <head> on every page. Keeping them out of this stylesheet
   ensures non-account pages (which don't load account.css) still get them. */

/* Mobile / small screens */
@media (max-width: 640px) {
  .profile-header-card { padding: 22px; }
  .profile-meta h1 { font-size: 24px; }
  .profile-avatar { width: 88px; height: 88px; font-size: 32px; }
  .settings-shell { margin-top: 30px; }
  .settings-panel { padding: 20px; }
}

/* ── Profile: Game Stats grid ─────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafd;
  border: 1px solid #e4eaf1;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15,25,40,0.08);
  border-color: #cdd9e8;
  text-decoration: none;
  color: inherit;
}
.game-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e4eaf1;
  display: flex; align-items: center; justify-content: center;
  color: #0563bb; font-size: 22px;
  flex-shrink: 0;
}
.game-card-info {
  min-width: 0;
  flex: 1;
}
.game-card-label {
  font-size: 11px; font-weight: 700; color: #6c757d;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.game-card-value {
  font-family: "Poppins", sans-serif;
  font-size: 22px; font-weight: 700; color: #45505b;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.game-card-sub {
  font-size: 12px; color: #6c757d; margin-top: 4px;
}
