.profile {
  padding: 130px 24px 80px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  gap: 24px;
  max-width: 1140px;
  margin: 0 auto;
  align-items: flex-start;
}

/* ── Sidebar ── */
.profile-sidebar {
  position: sticky;
  top: 100px;
  width: 260px;
  flex-shrink: 0;
}

.profile-sidebar-card {
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.sidebar-accent {
  height: 4px;
  background: linear-gradient(90deg, #FF4D6A, #FF7A8F);
}

.sidebar-avatar-wrapper {
  display: flex;
  justify-content: center;
  padding: 28px 24px 0;
}

.sidebar-avatar-ring {
  position: absolute;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF4D6A, #FF7A8F, rgba(255,77,106,0.2));
  margin-top: -3px;
}

.avatar-wrapper {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  overflow: hidden;
  background: #101012;
  border: 3px solid #1c1c20;
  z-index: 1;
  cursor: pointer;
  transition: border-color 0.2s;
}

.avatar-wrapper:hover {
  border-color: #FF4D6A;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.avatar-input-hidden {
  display: none;
}

.sidebar-name {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin: 16px 0 2px;
  background: linear-gradient(135deg, #fff 60%, rgba(255,255,255,0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-tg {
  text-align: center;
  font-size: 13px;
  color: #FF7A8F;
  font-weight: 600;
  margin-bottom: 14px;
}

.sidebar-badges {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 0 24px;
  flex-wrap: wrap;
}

.sd-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sd-badge-role {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

.sd-badge-uid {
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.sidebar-stats {
  padding: 18px 24px 0;
}

.sidebar-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-stat-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  margin-top: 6px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-logout:hover {
  color: #FF453A;
  background: rgba(255,69,58,0.06);
}

/* ── Main Content ── */
.profile-main {
  flex: 1;
  min-width: 0;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  background: rgba(22,22,26,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.profile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-tab:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}

.profile-tab.active {
  color: #fff;
  background: rgba(255,77,106,0.12);
}

.profile-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 12px;
}

.empty-state-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Configs ── */
.configs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-item {
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}

.config-item:hover {
  border-color: rgba(255,77,106,0.15);
}

.config-item-name {
  font-size: 14px;
  font-weight: 600;
}

.config-item-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.config-item-actions {
  display: flex;
  gap: 6px;
}

.config-del-btn {
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.2);
  color: #FF453A;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.config-del-btn:hover {
  background: rgba(255,69,58,0.2);
  border-color: rgba(255,69,58,0.4);
}

.config-apply-btn {
  background: rgba(52,199,89,0.1);
  border: 1px solid rgba(52,199,89,0.2);
  color: #34C759;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.config-apply-btn:hover {
  background: rgba(52,199,89,0.2);
  border-color: rgba(52,199,89,0.4);
}

.config-dl-btn {
  background: rgba(0,122,255,0.1);
  border: 1px solid rgba(0,122,255,0.2);
  color: #007AFF;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.config-dl-btn:hover {
  background: rgba(0,122,255,0.2);
  border-color: rgba(0,122,255,0.4);
}

/* ── Friends ── */
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.friend-item,
.request-item {
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s;
}

.friend-item:hover,
.request-item:hover {
  border-color: rgba(255,77,106,0.12);
}

.friend-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.friend-name {
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.friend-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.friend-status-online {
  background: #30d158;
  box-shadow: 0 0 6px rgba(48,209,88,0.5);
}

.friend-status-offline {
  background: #545458;
}

.friend-game-status {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-unfriend-btn {
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.2);
  color: #FF453A;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.friend-unfriend-btn:hover {
  background: rgba(255,69,58,0.2);
  border-color: rgba(255,69,58,0.4);
}

.btn-friend-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255,77,106,0.1);
  color: #FF4D6A;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-friend-add:hover {
  background: rgba(255,77,106,0.2);
}

/* ── Requests ── */
.requests-block {
  margin-top: 20px;
}

.requests-block-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  margin-top: 18px;
}

.requests-block-title:first-child {
  margin-top: 0;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.request-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.request-accept-btn {
  background: rgba(48,209,88,0.1);
  border: 1px solid rgba(48,209,88,0.2);
  color: #30d158;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.request-accept-btn:hover {
  background: rgba(48,209,88,0.2);
  border-color: rgba(48,209,88,0.4);
}

.request-reject-btn {
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.2);
  color: #FF453A;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.request-reject-btn:hover {
  background: rgba(255,69,58,0.2);
  border-color: rgba(255,69,58,0.4);
}

.request-cancel-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.request-cancel-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  position: relative;
  animation: modalIn 0.2s cubic-bezier(0.16,1,0.3,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

.modal-input {
  width: 100%;
  background: #1c1c20;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-input:focus {
  border-color: #FF4D6A;
}

.modal-input::placeholder {
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-actions .btn {
  padding: 10px 24px;
  font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .profile {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-sidebar {
    position: static;
    width: 100%;
  }
  .profile-sidebar-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px;
    gap: 12px;
  }
  .sidebar-accent {
    display: none;
  }
  .sidebar-avatar-wrapper {
    padding: 0;
    flex-shrink: 0;
  }
  .sidebar-avatar-ring {
    display: none;
  }
  .avatar-wrapper {
    width: 72px;
    height: 72px;
  }
  .sidebar-name {
    font-size: 18px;
    margin: 0;
    text-align: left;
    width: auto;
  }
  .sidebar-tg {
    text-align: left;
    margin-bottom: 0;
    width: 100%;
  }
  .sidebar-badges {
    padding: 0;
    order: 10;
  }
  .sidebar-stats {
    display: none;
  }
  .sidebar-logout {
    margin-top: 0;
    width: auto;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    margin-left: auto;
  }
  .sidebar-logout:hover {
    background: rgba(255,69,58,0.1);
  }
}

@media (max-width: 600px) {
  .profile {
    padding: 110px 16px 60px;
  }
  .profile-tab {
    font-size: 13px;
    padding: 8px 12px;
  }
  .profile-tab span {
    display: none;
  }
  .profile-tab svg {
    width: 18px;
    height: 18px;
  }
  .config-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .config-item-actions {
    align-self: flex-end;
  }
}
