.user-profile-inline {
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin: 2rem auto;
  max-width: 800px;
  width: 90%;
  overflow: hidden;
  color: var(--text-color);
  border: 2px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-profile-inline:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 1.25rem 1.5rem;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  position: relative;
}

.avatar-section {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-container {
  width: 100px;
  height: 100px;
  border: 4px solid transparent;
  border-radius: 50%;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
  background: var(--card-bg) no-repeat center;
  background-size: 70px;
  transition: all 0.3s ease-in-out;
}

.user-avatar-container.online {
  box-shadow: 0 0 12px #28a745;
  border-color: #28a745;
}

.info-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-section h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.8rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.user-device-category {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.25rem;
}

.user-role {
  display: inline-block;
  align-self: flex-start;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  line-height: 1.4;
  margin-top: 0.25rem;
}

.header-stats-section {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
}

.header-stats-section > div {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: white;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.header-stats-section > div:hover {
  background: rgba(255, 255, 255, 0.25);
}

.user-stats-page {
  padding: 1.25rem;
}

.user-stats-page h3 {
  color: var(--accent-color);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.user-bio {
  font-size: 1rem;
  line-height: 1.5;
  background: rgba(var(--card-bg-rgb), 0.5);
  margin: 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.user-badges-container {
  margin: 1.25rem;
  background: rgba(var(--card-bg-rgb), 0.5);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.user-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
  padding: 1rem;
}

.user-badges.expanded {
  max-height: 300px;
  overflow-y: auto;
}

.badge {
  width: 60px;
  height: 60px;
  transition: transform 0.3s;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--card-bg-rgb), 0.8);
}

.badge img {
  width: 80%;
  height: auto;
  object-fit: contain;
}

.badge:hover {
  transform: scale(1.1);
  border-color: var(--accent-color);
  cursor: pointer;
}

.badge-button-container {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(var(--border-color-rgb), 0.3);
  background-color: rgba(var(--card-bg-rgb), 0.3);
}

.profile-badge-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  font-weight: 500;
  min-width: 140px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.profile-badge-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

.session-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  background: rgba(var(--card-bg-rgb), 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.active-session {
  border-left: 3px solid #28a745;
}

.session-item h4 {
  color: var(--accent-color);
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
  grid-column: 1 / -1;
}

.active-session-indicator {
  display: inline-block;
  color: #28a745;
  font-weight: 600;
  font-style: italic;
}

.session-detail-item {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.session-detail-label {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  display: block;
}

.session-detail-value {
  color: var(--text-color);
  background: rgba(var(--card-bg-rgb), 0.7);
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  display: block;
  word-break: break-word;
}

.session-extra-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  background-color: rgba(var(--primary-color-rgb), 0.05);
  border-radius: 6px;
  padding: 0.75rem;
  border-left: 3px solid var(--primary-color);
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.session-extra-stats p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.session-extra-stats .extra-label {
  font-weight: 600;
  flex: 1;
}

.session-extra-stats .extra-value {
  font-weight: 500;
  color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  min-width: 40px;
  text-align: center;
  word-break: normal;
}

.profile-page-buttons {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(var(--card-bg-rgb), 0.7);
}

#back-to-profile-btn {
  background: var(--primary-color);
  flex: 0 0 auto;
  margin-right: auto;
}

#back-to-profile-btn:hover {
  background-color: var(--accent-color);
}

.profile-page-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  min-width: 130px;
  text-align: center;
  font-weight: 500;
  flex: 1;
}

.profile-page-button.active {
  background-color: var(--accent-color);
}

.profile-page-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

.profile-stats-group {
  margin-bottom: 1.5rem;
  background: rgba(var(--card-bg-rgb), 0.5);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dotted var(--border-color);
}

.profile-stat-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-stat-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-color);
}

.profile-stat-value {
  font-weight: 500;
  color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.1);
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  min-width: 70px;
  text-align: center;
}

.profile-fish-stat {
  background-color: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
}

.profile-fish-heading {
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.profile-fish-list {
  list-style-type: none;
  padding: 0;
  margin: 0.75rem 0 0.25rem;
}

.profile-fish-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background-color: rgba(var(--accent-color-rgb), 0.05);
  margin-bottom: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  border: 1px solid rgba(var(--border-color-rgb), 0.5);
  transition: transform 0.2s;
}

.profile-fish-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-fish-item:last-child {
  margin-bottom: 0;
}

.profile-fish-icon {
  margin-right: 0.5rem;
}

.profile-fish-name {
  flex: 1;
}

.profile-fish-count {
  justify-self: end;
  font-weight: 500;
  color: var(--accent-color);
  background-color: rgba(var(--accent-color-rgb), 0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  min-width: 40px;
  text-align: center;
}

.user-join-date::before {
  content: '🗓️';
  margin-right: 4px;
}

.user-pixels::before {
  content: '✨';
  margin-right: 4px;
}

.user-likes::before {
  content: '❤️';
  margin-right: 4px;
}

.recent-sessions-list {
  max-height: none;
  overflow: visible;
}

@media (min-width: 768px) {
  .session-item {
    grid-template-columns: 1fr 1fr;
  }
  
  .session-item h4 {
    grid-column: 1 / -1;
  }
  
  .session-extra-stats {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .avatar-section {
    margin: 0 auto;
  }
  
  .user-avatar-container {
    width: 80px;
    height: 80px;
    background-size: 56px;
  }
  
  .info-section {
    align-items: center;
  }
  
  .info-section h2 {
    font-size: 1.4rem;
  }
  
  .user-role {
    font-size: 0.9rem;
  }
  
  .header-stats-section {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    width: 100%;
  }
  
  .header-stats-section > div {
    flex: 0 0 auto;
    text-align: center;
  }
  
  .user-badges-container {
    margin: 1rem;
  }
  
  .user-badges {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0.75rem;
  }
  
  .user-badges.expanded {
    max-height: 400px;
  }
  
  .badge {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
  }
  
  .badge-button-container {
    padding: 0.75rem;
  }
  
  .profile-badge-button {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 1rem;
    font-size: 1rem;
  }
  
  .session-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.875rem;
  }
  
  .session-item h4 {
    font-size: 1rem;
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
  }
  
  .session-detail-item {
    margin-bottom: 0.4rem;
  }
  
  .session-detail-label {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }
  
  .session-detail-value {
    padding: 0.4rem;
    font-size: 0.9rem;
  }
  
  .session-extra-stats {
    grid-template-columns: 1fr;
    padding: 0.6rem;
    margin-top: 0.4rem;
    gap: 0.4rem;
  }
  
  .session-extra-stats p {
    justify-content: space-between;
  }
  
  .session-extra-stats .extra-label {
    font-size: 0.85rem;
  }
  
  .session-extra-stats .extra-value {
    font-size: 0.85rem;
    padding: 0.15rem 0.4rem;
  }

  .profile-page-buttons {
    flex-wrap: wrap;
  }

  .profile-page-button {
    min-width: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    flex: 1 0 calc(50% - 0.5rem);
  }

  #back-to-profile-btn {
    flex: 1 0 100%;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .user-badges-container {
    margin: 0.75rem;
  }
  
  .user-badges {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0.5rem;
  }
  
  .badge-button-container {
    padding: 0.5rem;
  }
  
  .profile-badge-button {
    min-width: 150px;
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
  }
  
  .header-stats-section > div {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
  
  .session-item {
    padding: 0.75rem;
  }
  
  .session-detail-value {
    font-size: 0.85rem;
  }
  
  .session-extra-stats .extra-value {
    min-width: 35px;
  }
  
  .session-extra-stats p:last-child {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .session-extra-stats p:last-child .extra-value {
    align-self: flex-start;
    margin-top: 0.2rem;
  }
  
  .profile-page-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}