/* Bildirim zili ve paneli.
   Zil, tema anahtarıyla aynı malzemeyi (kenarlık, köşe, alt raf) paylaşan
   38×38 bir eylem düğmesidir; rozet okunmamış sayısını taşır. Panel masaüstünde
   zile hizalı bir açılır karttır. Dar ekranda zil kutusu statik konuma geçer;
   panel başlığın içerik kutusuna hizalanır, böylece ekrandan taşmaz. */

.notifications {
  position: relative;
  display: inline-flex;
}

.notifications-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #ffffffcc;
  border-radius: 10px;
  background: #ffffffa6;
  color: #514068;
  box-shadow: 0 3px 0 #c9bcdd;
  transition: background 200ms ease, color 200ms ease, box-shadow 220ms ease, transform 220ms cubic-bezier(.22,1,.36,1);
}

.notifications-bell:hover {
  background: #ffffffc9;
  color: #4a3a63;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #c9bcdd, 0 6px 16px #85709326;
}

.notifications-bell:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #c9bcdd;
}

.notifications-bell:focus-visible {
  outline: 3px solid #67468d;
  outline-offset: 3px;
}

.notifications-bell[aria-expanded="true"] {
  background: #ffffffd9;
}

.notifications-bell > svg {
  width: 18px;
  height: 18px;
}

.notifications-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fffefa;
  border-radius: 9px;
  background: #ffdb60;
  color: #40345d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 2 * var(--page-gutter)));
  max-height: min(430px, calc(100dvh - 130px));
  overflow: hidden;
  border: 1px solid #e4d8ef;
  border-radius: 14px;
  background: #fffefa;
  color: #42345e;
  box-shadow: 0 20px 60px #2c174c2e, 0 3px 0 #d9c9ea;
  animation: notifications-in 190ms cubic-bezier(.22,1,.36,1) both;
}

@keyframes notifications-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #efe6f6;
}

.notifications-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.2px;
  line-height: 1.2;
}

.notifications-mark {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #65478b;
  font-size: 11px;
  font-weight: 800;
  transition: background-color 160ms, color 160ms;
}

.notifications-mark:hover {
  background: #f0e8f7;
  color: #4c2f70;
}

.notifications-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.notifications-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: inherit;
  text-align: left;
  transition: background-color 160ms;
}

.notifications-item:hover {
  background: #f6effa;
}

.notifications-item.is-unread {
  background: #fdf4e0;
  box-shadow: inset 3px 0 0 #e0a63a;
}

.notifications-item.is-unread:hover {
  background: #fbedcf;
}

.notifications-item__dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: transparent;
}

.notifications-item.is-unread .notifications-item__dot {
  background: #e0a63a;
}

.notifications-item__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notifications-item__line {
  font-size: 12px;
  line-height: 1.45;
  color: #6b5b7b;
}

.notifications-item__line b {
  color: #40345d;
  font-weight: 900;
}

.notifications-item__topic {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  color: #7b5fa5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-item__time {
  font-size: 11px;
  line-height: 1.4;
  color: #7f6d8c;
}

.notifications-note {
  margin: 0;
  padding: 26px 18px;
  color: #7f6d8c;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* Dar ekran: panel zil kutusuna değil başlığın içerik kutusuna hizalanır;
   620 px altında ayrıca iki yandan gutter kadar içeri çekilir, bu yüzden taşmaz. */
@media (max-width: 700px) {
  .notifications {
    position: static;
  }

  .notifications-panel {
    left: auto;
    right: 0;
    top: calc(100% + 6px);
    width: min(420px, 100%);
    max-height: min(60dvh, 430px);
  }
}

/* Çok dar ekranda zil yeri açarken hesap düğmesi yalnız kafa simgesine döner;
   oyuncu adı aynı bağlantının title/aria-label'ında kalır. Böylece dört eylem
   (tema, zil, hesap, menü) tek satıra sığar ve üst bar taşmaz. Girişsizde zil
   olmadığı için mevcut hesap ölçüsü aynen korunur. */
@media (max-width: 620px) {
  .notifications-panel {
    right: var(--page-gutter);
    width: min(420px, calc(100% - 2 * var(--page-gutter)));
  }

  .site-header .notifications + .site-header__account .account-trigger {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding-inline: 0;
    gap: 0;
    justify-content: center;
  }

  .site-header .notifications + .site-header__account .account-trigger > span:not([class]) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell:not(.motion-enabled) .notifications-bell {
    transition: none;
    transform: none !important;
  }

  .app-shell:not(.motion-enabled) .notifications-panel {
    animation: none;
  }
}
