/* Profile, public member wall, members directory — mobile-first layouts */

/* ----- Your Profile (Index) ----- */
.profile-shell {
  max-width: 1180px;
  margin: 16px auto;
  padding: 12px clamp(10px, 4vw, 20px);
  color: #e6ebff;
  box-sizing: border-box;
  width: 100%;
}

.profile-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
  justify-items: center;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #111826 50%, #0b1324 100%);
  border: 1px solid #23314d;
  border-radius: 20px;
  padding: clamp(16px, 4vw, 24px);
  margin-bottom: 20px;
}

@media (min-width: 576px) {
  .profile-hero {
    grid-template-columns: minmax(120px, 160px) 1fr;
    gap: 20px;
    align-items: start;
    justify-items: stretch;
    text-align: left;
  }
}

@media (min-width: 992px) {
  .profile-hero {
    grid-template-columns: 200px 1fr;
    gap: 24px;
  }
}

.avatar-xl {
  width: min(200px, 72vw);
  height: min(200px, 72vw);
  max-width: 100%;
  object-fit: cover;
  border-radius: 20px;
  border: 2px solid #2f6bed;
  box-shadow: 0 8px 32px rgba(47, 107, 237, 0.25);
}

@media (min-width: 576px) {
  .avatar-xl {
    width: 140px;
    height: 140px;
  }
}

@media (min-width: 992px) {
  .avatar-xl {
    width: 200px;
    height: 200px;
  }
}

.hero-title {
  font-size: clamp(1.2rem, 4.5vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hero-sub {
  color: #93a2c8;
  margin-bottom: 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  justify-content: center;
}

@media (min-width: 576px) {
  .stat-pills {
    justify-content: flex-start;
    gap: 10px;
  }
}

.stat-pill {
  background: #16203a;
  border: 1px solid #2a3a63;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  max-width: 100%;
}

.stat-pill strong {
  color: #7ab8ff;
}

.grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  }
}

.card-x {
  background: #111826;
  border: 1px solid #23314d;
  border-radius: 16px;
  padding: clamp(14px, 3vw, 18px);
}

.card-x h2 {
  font-size: clamp(1rem, 3vw, 1.15rem);
  margin: 0 0 12px;
  color: #cfe0ff;
}

.muted {
  color: #93a2c8;
  font-size: 0.92rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.profile-shell input[type="text"],
.profile-shell textarea {
  background: #0b1324;
  border: 1px solid #223055;
  border-radius: 8px;
  padding: 10px;
  color: #e6ebff;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-shell textarea {
  min-height: 100px;
  resize: vertical;
}

/* Scoped buttons — do not override Bootstrap site-wide */
.profile-shell .profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2f6bed;
  border: 0;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  box-sizing: border-box;
}

.profile-shell .profile-btn-ghost {
  background: #23314d;
}

.profile-shell .profile-btn-outline {
  background: transparent;
  border: 1px solid #2f6bed;
  color: #7ab8ff;
}

.profile-shell .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  flex-direction: column;
  align-items: stretch;
}

@media (min-width: 576px) {
  .profile-shell .actions {
    flex-direction: row;
    align-items: center;
  }
}

.profile-shell .actions .profile-btn,
.profile-shell .actions .profile-btn-outline,
.profile-shell .actions .profile-btn-ghost {
  width: 100%;
}

@media (min-width: 576px) {
  .profile-shell .actions .profile-btn,
  .profile-shell .actions .profile-btn-outline,
  .profile-shell .actions .profile-btn-ghost {
    width: auto;
  }
}

.profile-shell .feature-row .actions .profile-btn,
.profile-shell .feature-row .actions .profile-btn-outline,
.profile-shell .feature-row .actions .profile-btn-ghost {
  width: auto;
}

.profile-shell .feature-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #1e2a44;
}

.profile-shell .feature-row:last-child {
  border-bottom: 0;
}

@media (min-width: 640px) {
  .profile-shell .feature-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
  }
}

.profile-shell .feature-row .actions {
  margin-top: 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

@media (min-width: 640px) {
  .profile-shell .feature-row .actions {
    width: auto;
    justify-content: flex-end;
  }
}

.profile-shell .feature-row-actions {
  text-align: left;
  width: 100%;
}

@media (min-width: 640px) {
  .profile-shell .feature-row-actions {
    text-align: right;
    width: auto;
  }
}

.profile-shell .profile-btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.profile-shell .profile-btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

.profile-shell .profile-btn-outline-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #f0f4ff;
}

.profile-shell .profile-btn-danger {
  background: #cc4b4b;
  border: 0;
  color: #fff;
}

.profile-shell .profile-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-shell .tier-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #1e2a44;
  opacity: 0.55;
}

.profile-shell .tier-row.current {
  opacity: 1;
  border-left: 3px solid #2f6bed;
  padding-left: 10px;
}

.profile-shell .pill {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #2a3a63;
  background: #16203a;
  color: #cfe0ff;
  font-size: 12px;
}

.profile-shell .kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 8px;
  margin: 6px 0;
  font-size: 0.92rem;
}

@media (min-width: 520px) {
  .profile-shell .kv {
    grid-template-columns: minmax(100px, 160px) 1fr;
    align-items: baseline;
  }
}

.profile-shell .kv .k {
  color: #93a2c8;
}

.profile-shell .kv span:last-child {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.k-badge {
  background: #1a2440;
  border: 1px solid #2a3a63;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  display: inline-block;
  margin: 4px 4px 0 0;
  max-width: 100%;
  word-break: break-word;
}

.k-badge.locked {
  opacity: 0.45;
  filter: grayscale(0.3);
}

/* Gallery: fluid tiles */
.profile-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-gallery-item {
  flex: 1 1 min(160px, calc(50% - 8px));
  min-width: 0;
  max-width: min(200px, 100%);
}

.profile-gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #23314d;
}

/* ----- Public member profile ----- */
.pub-shell {
  max-width: 800px;
  margin: 16px auto;
  padding: 12px clamp(10px, 4vw, 16px);
  color: #e6ebff;
  box-sizing: border-box;
  width: 100%;
}

.pub-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  justify-items: center;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #111826 100%);
  border: 1px solid #23314d;
  border-radius: 20px;
  padding: clamp(16px, 4vw, 20px);
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .pub-hero {
    grid-template-columns: 100px 1fr;
    justify-items: stretch;
    text-align: left;
    align-items: start;
    gap: 18px;
  }
}

@media (min-width: 768px) {
  .pub-hero {
    grid-template-columns: 120px 1fr;
    gap: 20px;
  }
}

.pub-hero img {
  width: min(120px, 40vw);
  height: min(120px, 40vw);
  max-width: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid #2f6bed;
}

@media (min-width: 480px) {
  .pub-hero img {
    width: 100px;
    height: 100px;
  }
}

@media (min-width: 768px) {
  .pub-hero img {
    width: 120px;
    height: 120px;
  }
}

.wall {
  background: #111826;
  border: 1px solid #23314d;
  border-radius: 16px;
  padding: clamp(14px, 3vw, 18px);
}

.wall-item {
  border-bottom: 1px solid #1e2a44;
  padding: 12px 0;
}

.wall-item:last-child {
  border-bottom: 0;
}

.wall-body a.wall-mention {
  color: #7ab8ff;
  text-decoration: none;
}

.wall-body a.wall-mention:hover {
  text-decoration: underline;
}

textarea.wall-ta {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  background: #0b1324;
  border: 1px solid #223055;
  color: #e6ebff;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.9rem;
}

.comment-block {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid #2a3a63;
}

/* ----- Members directory ----- */
.members-shell {
  max-width: 1100px;
  margin: 16px auto;
  padding: 12px clamp(10px, 4vw, 16px);
  color: #e6ebff;
  box-sizing: border-box;
  width: 100%;
}

.members-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.members-search-row input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
  background: #0b1324;
  border-color: #23314d;
  color: #e6ebff;
}

.member-card {
  background: #111826;
  border: 1px solid #23314d;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

@media (min-width: 400px) {
  .member-card {
    grid-template-columns: 72px 1fr;
    gap: 14px;
    padding: 16px;
  }
}

.member-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}

@media (min-width: 400px) {
  .member-card img {
    width: 72px;
    height: 72px;
  }
}

.member-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 520px) {
  .member-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  }
}

/* ----- Leaderboard ----- */
.leaderboard-shell {
  max-width: 900px;
  margin: 0 auto;
  padding-left: clamp(10px, 4vw, 16px);
  padding-right: clamp(10px, 4vw, 16px);
  color: #e6ebff;
  box-sizing: border-box;
  width: 100%;
}

.leaderboard-shell .table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Share links on public / elite promo */
.pub-shell code {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  font-size: clamp(0.75rem, 2.8vw, 0.9rem);
}

.pub-hero h1 {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.profile-shell code {
  word-break: break-all;
  max-width: 100%;
  font-size: clamp(0.75rem, 2.8vw, 0.95rem);
}
