@media (max-width: 767px) {
  #kt_app_content_container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  #kt_app_content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.profile-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bs-heading-color);
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.profile-compact {
  background: var(--bs-body-bg);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
}

.profile-header-compact {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--bs-secondary-bg) 0%, var(--bs-body-bg) 100%);
  border-bottom: 1px solid var(--bs-border-color);
  position: relative;
}

.profile-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

  /* =========================
   Mobile/Tablet: layout centralizado
  ========================= */
  @media (max-width: 991.98px) {

    .profile-header-compact {
      flex-direction: column;
      text-align: center;
      align-items: center;
      gap: 1rem;
    }

    .profile-header-left {
      flex-direction: column;
      align-items: center;
      text-align: center;
      width: 100%;
    }

    .profile-name-row {
      justify-content: center;
    }

    .profile-username-compact {
      justify-content: center;
    }

    .profile-location-compact {
      justify-content: center;
    }

    .profile-stats-compact {
      justify-content: center;
      width: 100%;
    }

    .profile-header-right,
    .profile-bio-inline {
      width: 100%;
    }

    .profile-bio-compact,
    .profile-bio-inline {
      text-align: left;
    }

    .profile-bio-compact h5 {
      justify-content: flex-start;
    }

    .profile-edit-btn-compact {
      position: static;
      width: 100%;
      display: flex;
      justify-content: center;
      order: 3;
      margin-top: 0.5rem;
    }
  }

  /* =========================
    Desktop header grid
  ========================= */
  @media (min-width: 992px) {

    .profile-header-grid {
      display: grid;
      grid-template-columns: 1fr 1.6fr;
      grid-template-rows: auto 1fr;
      grid-template-areas:
        "left edit"
        "left right";
      gap: 1.5rem 2rem;
      align-items: start;
    }

    .profile-header-left {
      grid-area: left;
      display: flex;
      align-items: center;
      gap: 1.5rem;
      min-width: 0;
    }

    .profile-header-right {
      grid-area: right;
      min-width: 0;
    }

    .profile-edit-btn-compact {
      grid-area: edit;
      position: static;
      justify-self: end;
      align-self: start;
      margin: 0;
      z-index: 2;
    }

    .profile-bio-inline {
      margin: 0;
      min-height: 120px;
      padding: 1.25rem 1.25rem;
      background: var(--bs-tertiary-bg);
      border-left: 4px solid var(--bs-primary);
      border-top: none;
    }
  }

  .profile-avatar-compact {
    width: 100px;
    height: 100px;
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    border: 4px solid var(--bs-body-bg);
    box-shadow: var(--bs-box-shadow-sm);
    flex-shrink: 0;
    background: var(--bs-body-bg);
  }

  .profile-avatar-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  @media (max-width: 768px) {
    .profile-avatar-compact {
      width: 90px;
      height: 90px;
      border-width: 3px;
    }
  }

  .profile-info-compact {
    flex: 1;
    min-width: 0;
  }

  .profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
  }

  .profile-name-compact {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-heading-color);
    margin: 0;
    line-height: 1.2;
  }

  .profile-username-compact {
    font-size: 0.95rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .verified-compact {
    color: var(--bs-success);
    font-size: 1rem;
  }

  .profile-location-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .profile-location-compact i {
    color: var(--bs-primary);
  }

  .profile-stats-compact {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
  }

  @media (max-width: 768px) {
    .profile-stats-compact {
      justify-content: center;
      gap: 1.5rem;
      margin-top: 1rem;
      width: 100%;
    }
  }

  @media (max-width: 480px) {
    .profile-stats-compact {
      gap: 1rem;
    }
  }

  .stat-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 60px;
  }

  .stat-value-compact {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--bs-primary);
    line-height: 1;
  }

  .stat-label-compact {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
  }

  .profile-edit-btn-compact {
    position: absolute;
    top: 0rem;
    right: 1.25rem;
  }

  @media (max-width: 768px) {
    .profile-edit-btn-compact {
      position: static;
      margin-top: 1rem;
      width: 100%;
      display: flex;
      justify-content: center;
      order: 3;
    }
  }

  .edit-btn-compact {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-primary);
    color: var(--bs-primary);
    padding: 0.375rem 0.875rem;
    border-radius: var(--bs-border-radius);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.1);
  }

  .edit-btn-compact:hover {
    background: var(--bs-primary);
    color: var(--bs-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.2);
    border-color: var(--bs-primary);
  }

  .profile-content-compact {
    padding: 1.5rem;
  }

  @media (max-width: 768px) {
    .profile-content-compact {
      padding: 1.25rem 1rem;
    }
  }

  .profile-bio-compact {
    color: var(--bs-body-color);
    font-size: 0.925rem;
    line-height: 1.6;
    background: var(--bs-tertiary-bg);
    padding: 1.25rem;
    border-radius: var(--bs-border-radius);
    border-left: 4px solid var(--bs-primary);
  }

  .profile-bio-compact h5 {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
  }

/* =========================
   Profile Quiz Tabs
========================= */

.profile-tabs {
    border-bottom: none;
    gap: 0.5rem;
}

.profile-tabs .nav-link {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    background-color: #f5f7fa;
    transition: all 0.25s ease;
}

.profile-tabs .nav-link:hover {
    background-color: #eef1f5;
    color: #212529;
}

.profile-tabs .nav-link.active {
    background-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.profile-tabs .nav-link.active:hover {
    color: #fff;
}

@media (max-width: 576px) {
  .profile-tabs {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
    gap: 0.5rem;
  }

  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-tabs .nav-link {
    white-space: normal;
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
    padding: 0.55rem 0.9rem;
  }
}

/* =========================
   Medals Tab (Grid + Pagination)
========================= */
.medals-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.9rem;
}

.medal-card {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}

.medal-card:hover {
  transform: translateY(-3px);
  background: var(--bs-secondary-bg);
}

.medal-card-body {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.medal-card-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.6rem;
}

.medal-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bs-heading-color);
  line-height: 1.2;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .medals-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 992px) {
  .medals-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .medals-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
  }
  .medal-card-body {
    padding: 0.75rem 0.4rem;
  }
  .medal-card-icon { width: 42px; height: 42px; }
  .medal-card-name { font-size: 0.75rem; }
}
@media (max-width: 480px) {
  .medals-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
  }
  .medal-card-body { padding: 0.8rem 0.5rem; }
  .medal-card-icon { width: 40px; height: 40px; }
  .medal-card-name { font-size: 0.72rem; }
}