.header-notifications { grid-area: notifications; position: relative; min-width: 0; }
.notifications-menu { position: relative; }
.notifications-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.notifications-trigger::-webkit-details-marker { display: none; }
.notifications-trigger > svg { width: 20px; height: 20px; }
.notifications-trigger:hover, .notifications-menu[open] > .notifications-trigger {
  border-color: var(--nav-hover-edge, var(--line));
  background: var(--nav-hover, var(--surface));
}
.notifications-trigger:focus-visible, .notifications-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.notifications-badge {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 3px;
  border: 2px solid var(--paper);
  border-radius: 12px;
  background: #a73335;
  color: #fff;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.notifications-panel {
  position: absolute;
  z-index: 24;
  top: calc(100% + 6px);
  right: 0;
  width: min(400px, calc(100vw - 40px));
  max-height: min(600px, calc(100dvh - var(--site-header-height, 100px) - 30px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 40px rgb(0 0 0 / .12);
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}
.notifications-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.notifications-heading h2 { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.025em; }
.notifications-heading { flex-wrap: wrap; gap: 4px 12px; }
.notifications-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; margin-left: auto; }
.notifications-heading-actions [data-notifications-clear] { color: var(--muted); }
.notifications-heading-actions button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.notifications-heading button, .notifications-more, .notifications-retry {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.notifications-heading button { min-height: 32px; padding: 5px 0 5px 5px; white-space: nowrap; }
.notifications-panel button:disabled { opacity: .55; cursor: default; }
.notifications-status { margin: 0; padding: 12px 15px; color: var(--muted); font-size: 12px; }
.notifications-status:empty { display: none; }
.notifications-state { padding: 23px 18px; color: var(--muted); }
.notifications-state p { margin: 0; font-size: 13px; }
.notifications-state a { display: inline-block; color: var(--accent); text-underline-offset: 3px; }
.notifications-list { margin: 0; padding: 0; list-style: none; }
.notification-item + .notification-item { border-top: 1px solid var(--line); }
.notification-item > a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 6px; align-items: start; gap: 12px; padding: 16px; color: inherit; text-decoration: none; }
.notification-item > a:hover { background: var(--surface); }
.notification-item.is-unread { background: color-mix(in srgb, var(--ink) 3%, var(--paper)); }
.notification-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.notification-initial { display: grid; place-items: center; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; }
.notification-copy { min-width: 0; overflow-wrap: anywhere; }
.notification-copy > span { display: block; }
.notification-copy strong { font-weight: 600; }
.notification-copy time { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.notification-dot { width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--accent); }
.notifications-more { display: block; width: calc(100% - 20px); min-height: 38px; margin: 4px 10px; padding: 8px; }
.notifications-more:hover, .notifications-retry:hover { background: var(--surface); }
.notifications-retry { min-height: 36px; padding: 8px 12px; border: 1px solid var(--line); }
.notifications-links { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; }
.notifications-links a { color: var(--muted); text-decoration: none; }
.notifications-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.notifications-links { flex-wrap: wrap; gap: 8px 14px; }
.notifications-links a { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 28px; color: var(--ink); font-weight: 500; }
.game-invitation-toast { position: fixed; z-index: 120; right: 20px; bottom: 24px; width: min(380px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 12px 40px rgb(0 0 0 / .16); font: 14px/1.45 var(--sans, Helvetica, sans-serif); }
.game-invitation-toast p { margin: 0 0 10px; color: var(--muted); }
.game-invitation-toast .game-invitation-toast-title { padding-right: 24px; color: var(--ink); font-size: 16px; }
.game-invitation-dismiss { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font: 22px/1 sans-serif; }
.game-invitation-toast-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.game-invitation-toast-actions button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); font: inherit; }
.game-invitation-toast-actions [data-invitation-accept] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.game-invitation-toast-actions a { margin-left: 2px; color: var(--muted); font-size: 12px; text-underline-offset: 3px; }
.game-invitation-toast button:disabled { opacity: .55; cursor: default; }
.game-invitation-toast :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.game-invitation-toast .game-invitation-toast-status { margin: 10px 0 0; font-size: 12px; }
.game-invitation-toast-status:empty { display: none; }
@media (max-width: 639px) {
  .header-notifications, .notifications-menu { position: static; }
  .notifications-panel { right: 0; width: min(370px, calc(100vw - 40px)); }
  .game-invitation-toast { right: 16px; bottom: 16px; }
}
