/* Header — profil dropdown menü */

.header-profile-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.header-profile-menu__trigger[aria-expanded="true"] {
  border-color: rgba(22, 119, 255, 0.45) !important;
  background: rgba(22, 119, 255, 0.14) !important;
  color: var(--site-accent-bright, #69b1ff) !important;
}

.header-profile-menu__panel {
  position: fixed;
  z-index: 120;
  width: min(17.5rem, calc(100vw - 1.5rem));
  padding: 0.375rem;
  border-radius: 1rem;
  border: 1px solid rgba(22, 119, 255, 0.22);
  background: var(--site-surface-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 48px -16px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  pointer-events: none;
}

.header-profile-menu__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.header-profile-menu__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(22, 119, 255, 0.12);
  margin-bottom: 0.25rem;
}

.header-profile-menu__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #e8f2fc;
  background: linear-gradient(145deg, rgba(22, 119, 255, 0.45) 0%, rgba(22, 119, 255, 0.35) 100%);
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.header-profile-menu__meta {
  min-width: 0;
  flex: 1;
}

.header-profile-menu__name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--site-text, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-profile-menu__coins {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--site-accent-bright, #69b1ff);
}

.header-profile-menu__list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.125rem 0;
}

.header-profile-menu__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--site-text-muted, #94a3b8);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.14s ease,
    color 0.14s ease;
}

.header-profile-menu__item svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.header-profile-menu__item:hover,
.header-profile-menu__item:focus-visible {
  background: rgba(22, 119, 255, 0.12);
  color: var(--site-text, #f1f5f9);
  outline: none;
}

.header-profile-menu__item--danger {
  color: #fca5a5;
}

.header-profile-menu__item--danger:hover,
.header-profile-menu__item--danger:focus-visible {
  background: rgba(244, 63, 94, 0.12);
  color: #fecdd3;
}

.header-profile-menu__divider {
  height: 1px;
  margin: 0.25rem 0.5rem;
  background: rgba(22, 119, 255, 0.12);
}

[data-theme="light"] .header-profile-menu__panel {
  border-color: rgba(22, 119, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 16px 40px -12px rgba(22, 119, 255, 0.2);
}

[data-theme="light"] .header-profile-menu__item--danger {
  color: #ff1e1e;
}

[data-theme="light"] .header-profile-menu__item--danger:hover {
  color: #e01a1a;
  background: rgba(254, 226, 226, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .header-profile-menu__panel {
    transition: none;
  }
}
