@import url('site-toast.css');

/* Выпадающее меню по кнопке профиля в шапке (все страницы, кроме онлайн-партий). */

button.header-profile-chip {
  font: inherit;
  font-family: inherit;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: inherit;
}

button.header-profile-chip:focus-visible {
  outline: 2px solid rgba(100, 181, 246, 0.75);
  outline-offset: 2px;
}

#profile-menu-sheet[hidden] {
  display: none !important;
}

#profile-menu-sheet {
  --profile-menu-dialog-in: 0.44s;
  --profile-menu-dialog-delay: 0s;
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(78px, 12vw, 102px) clamp(10px, 3vw, 22px) 16px 16px;
  box-sizing: border-box;
}

/* Затемнение как у модалки настроек комнаты, без backdrop-filter (страница не размывается) */
.profile-menu-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: default;
  background-color: rgba(0, 0, 0, 0.42);
}

/* Scale от правого верхнего угла — без translateY */
@keyframes profile-menu-dialog-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.profile-menu-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  max-width: min(640px, calc(100vw - 20px));
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  color: #e8eaf0;
  transform-origin: top right;
}

/* Панели как лист настроек комнаты (.room-settings-sheet), без размытия подложки */
.profile-menu-card {
  box-sizing: border-box;
  align-self: stretch;
  border-radius: 30px;
  overflow: hidden;
  background: rgba(30, 30, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

#profile-menu-sheet:not([hidden]) .profile-menu-dialog {
  animation: profile-menu-dialog-in var(--profile-menu-dialog-in)
    cubic-bezier(0.16, 1, 0.3, 1) var(--profile-menu-dialog-delay) both;
}

/* Пока идёт появление, не ловим клики */
#profile-menu-sheet:not([hidden])
  .profile-menu-dialog:not(.profile-menu-dialog--ready) {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #profile-menu-sheet:not([hidden]) .profile-menu-dialog {
    animation: none;
    transform: none;
  }
}

@media (max-width: 520px) {
  .profile-menu-dialog {
    flex-direction: column;
    align-items: stretch;
    max-height: min(560px, calc(100vh - 96px));
    overflow-y: auto;
  }
}

/* ——— Левая карточка: уведомления ——— */
.profile-menu-notifications {
  width: min(300px, 42vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 520px) {
  .profile-menu-notifications {
    width: 100%;
    max-height: min(220px, 38vh);
  }
}

.profile-menu-notif-title {
  flex-shrink: 0;
  padding: 18px 14px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  /* уже w900; +0.03em обводка визуально утолщает глифы */
  -webkit-text-stroke: 0.03em rgba(0, 0, 0, 0.42);
  paint-order: stroke fill;
}

.profile-menu-notif-msg {
  flex-shrink: 0;
  margin: 0 12px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.profile-menu-notif-msg.ok {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.profile-menu-notif-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.profile-menu-notif-section {
  margin: 10px 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.profile-menu-notif-section:first-child {
  margin-top: 0;
}

.profile-menu-notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-menu-notif-empty {
  margin: 12px 0 0;
  padding: 14px 8px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

.pm-notif-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pm-notif-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a1e;
}

.pm-notif-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.pm-notif-nick {
  display: block;
  font-weight: 700;
  font-size: 0.84rem;
  color: #e8eaf0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-notif-sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(200, 210, 230, 0.75);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-notif-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pm-notif-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.pm-notif-btn--ok {
  background: linear-gradient(145deg, #22c55e, #16a34a);
  color: #fff;
}

.pm-notif-btn--no {
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(230, 235, 245, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pm-notif-btn--no:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.profile-menu-notifications .cosmetic-title-line {
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  margin-top: 0;
  line-height: 1.1;
}

/* ——— Правая карточка: меню ——— */
.profile-menu-panel {
  position: relative;
  width: min(288px, calc(100vw - 32px));
  flex-shrink: 0;
  padding: 12px;
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .profile-menu-panel {
    width: 100%;
  }
}

.profile-menu-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-menu-profile-row:hover {
  border-color: rgba(100, 181, 246, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.profile-menu-profile-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.profile-menu-profile-nick {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-profile-row .cosmetic-nick-stack {
  flex: 1;
  min-width: 0;
  align-items: flex-start;
}

.profile-menu-profile-row .cosmetic-title-line {
  font-size: 0.48rem;
  letter-spacing: 0.09em;
  margin-top: 0;
  line-height: 1.1;
}

.profile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.profile-menu-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-menu-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(245, 247, 252, 0.95);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-menu-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: rgba(180, 195, 220, 0.95);
}

.profile-menu-item-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.profile-menu-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-menu-item:hover {
  border-color: rgba(100, 181, 246, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.profile-menu-item:hover .profile-menu-item-icon {
  color: rgba(190, 218, 252, 0.98);
}

.profile-menu-item:focus-visible {
  outline: 2px solid rgba(100, 181, 246, 0.65);
  outline-offset: 2px;
}

.profile-menu-item--link {
  justify-content: flex-start;
}

.profile-menu-item--placeholder {
  opacity: 0.62;
  cursor: default;
}

.profile-menu-item--placeholder:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

#profile-menu-logout.profile-menu-item {
  color: rgba(200, 120, 120, 0.95);
  background: transparent;
  border: 1px solid rgba(90, 24, 24, 0.55);
}

#profile-menu-logout.profile-menu-item:hover .profile-menu-item-icon {
  color: rgba(232, 180, 180, 0.98);
}

#profile-menu-logout .profile-menu-item-icon {
  color: rgba(200, 120, 120, 0.95);
}

#profile-menu-logout.profile-menu-item:hover {
  color: rgba(232, 180, 180, 0.98);
  border-color: rgba(127, 29, 29, 0.65);
  background: rgba(127, 29, 29, 0.2);
}

#profile-menu-logout.profile-menu-item:focus-visible {
  outline: 2px solid rgba(185, 28, 28, 0.55);
  outline-offset: 2px;
}
