.notifications-bell-root {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 60;
}

.notifications-bell-root[hidden] {
    display: none;
}

.notifications-bell-button {
    position: relative;
    width: 42px;
    height: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(219, 39, 119, 0.14)),
        rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.notifications-bell-button:hover {
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.34), rgba(219, 39, 119, 0.22)),
        rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        0 16px 42px rgba(124, 58, 237, 0.18);
    transform: translateY(-1px);
}

/* Host pages (e.g. profile) use broad `button { padding; border-radius; … }` rules that can
   distort the bell. This selector beats generic `button` from page CSS. */
.notifications-bell-root button.notifications-bell-button {
    position: relative;
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(219, 39, 119, 0.14)),
        rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.notifications-bell-root button.notifications-bell-button:hover {
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.34), rgba(219, 39, 119, 0.22)),
        rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        0 16px 42px rgba(124, 58, 237, 0.18);
    transform: translateY(-1px);
}

.notifications-bell-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.notifications-bell-svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
    filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.38));
}

.notifications-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #f43f5e, #db2777);
    box-shadow: 0 0 0 2px rgba(15, 15, 28, 0.95);
    font-size: 0.68rem;
    font-weight: 700;
}

.notifications-badge[hidden] {
    display: none;
}

.notifications-panel {
    position: fixed;
    top: clamp(64px, 12vh, 72px);
    right: 10px;
    z-index: 1000;
    width: min(300px, calc(100vw - 20px));
    max-height: min(360px, 50vh);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 15% 0%, rgba(124, 58, 237, 0.22), transparent 32%),
        rgba(12, 12, 24, 0.96);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
}

.notifications-panel[hidden] {
    display: none;
}

.notifications-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notifications-panel-header strong {
    color: #fff;
    font-size: 0.9rem;
}

.notifications-mark-read {
    border: 0;
    padding: 5px 8px;
    border-radius: 999px;
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.12);
    cursor: pointer;
    font-size: 0.75rem;
}

.notifications-list {
    max-height: min(292px, calc(50vh - 56px));
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #fff;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.notification-item.unread {
    background: rgba(168, 85, 247, 0.1);
}

.notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.notification-item.unread .notification-dot {
    background: #c084fc;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.76);
}

.notification-content {
    min-width: 0;
}

.notification-title {
    margin-bottom: 3px;
    font-weight: 700;
    line-height: 1.22;
    font-size: 0.88rem;
}

.notification-body,
.notification-time,
.notifications-empty {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

.notification-time {
    margin-top: 4px;
}

.notification-type {
    align-self: start;
    padding: 3px 6px;
    border-radius: 999px;
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.14);
    font-size: 0.65rem;
    font-weight: 700;
    white-space: normal;
    max-width: 5.5rem;
    text-align: center;
    line-height: 1.2;
}

.notification-item-friend {
    cursor: default;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    border-left: 3px solid rgba(34, 211, 238, 0.45);
    padding: 10px 10px 10px 11px;
    background: linear-gradient(
        100deg,
        rgba(34, 211, 238, 0.07) 0%,
        rgba(124, 58, 237, 0.06) 35%,
        transparent 65%
    );
}

.notification-item-friend.unread {
    background: linear-gradient(
        100deg,
        rgba(34, 211, 238, 0.14) 0%,
        rgba(168, 85, 247, 0.12) 40%,
        rgba(15, 15, 28, 0.4) 100%
    );
}

.notification-item-friend .notification-content {
    cursor: default;
}

.notification-friend-avatar-shell {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.65), rgba(124, 58, 237, 0.7));
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 0 22px rgba(34, 211, 238, 0.18),
        0 6px 20px rgba(124, 58, 237, 0.12);
    align-self: start;
    margin-top: 1px;
}

a.notification-friend-avatar-shell.notification-friend-profile-link {
    display: block;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

a.notification-friend-avatar-shell.notification-friend-profile-link:hover {
    transform: scale(1.04);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 0 28px rgba(34, 211, 238, 0.28),
        0 8px 26px rgba(124, 58, 237, 0.2);
}

a.notification-friend-profile-link.notification-title {
    display: block;
    color: #fff;
    text-decoration: none;
    transition: color 160ms ease;
}

a.notification-friend-profile-link.notification-title:hover {
    color: #22d3ee;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.notification-friend-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.notification-friend-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.notification-friend-btn {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 8px;
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.notification-friend-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.notification-friend-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
}

.notification-friend-btn.primary {
    border: 1px solid transparent;
    color: #f8fafc;
    background: linear-gradient(135deg, #0891b2 0%, #7c3aed 55%, #c026d3 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 4px 18px rgba(34, 211, 238, 0.22),
        0 8px 28px rgba(124, 58, 237, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.notification-friend-btn.primary:hover:not(:disabled) {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.16) inset,
        0 6px 24px rgba(34, 211, 238, 0.32),
        0 10px 36px rgba(124, 58, 237, 0.25);
}

.notification-friend-btn.danger {
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.18);
    text-transform: uppercase;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
}

.notification-friend-btn.danger:hover:not(:disabled) {
    background: rgba(127, 29, 29, 0.28);
    border-color: rgba(248, 113, 113, 0.5);
}

.notifications-empty,
.notifications-loading {
    padding: 14px 12px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

.notifications-loading {
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
}

.notification-item-friend-resolved .notification-body {
    color: rgba(226, 232, 240, 0.95);
    font-weight: 700;
}

@media (min-width: 561px) and (max-width: 1200px) {
    .notifications-panel {
        width: min(272px, calc(100vw - 16px));
        right: 8px;
    }
}

@media (max-width: 560px) {
    .notifications-panel {
        top: 76px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: min(300px, calc(100vw - 16px));
        max-height: min(340px, 48vh);
    }

    .notifications-list {
        max-height: min(272px, calc(48vh - 56px));
    }
}
