.bubble-header {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition:
        width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-radius 0.28s ease,
        padding 0.28s ease,
        box-shadow 0.28s ease,
        background-color 0.28s ease;
    cursor: pointer;
    overflow: hidden;
    touch-action: none;
    box-sizing: border-box;
}

.bubble-header.expanded {
    width: min(320px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 12px;
    cursor: default;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.bubble-header.is-positioning {
    transition: none !important;
}

.bubble-toggle {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: transparent;
    cursor: grab;
    touch-action: none;
}

.bubble-toggle:active {
    cursor: grabbing;
}

.bubble-header.is-dragging .bubble-toggle {
    cursor: grabbing;
}

.bubble-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

.bubble-header.expanded .bubble-toggle {
    width: 36px;
    height: 36px;
    min-height: 36px;
    align-self: flex-end;
    margin-right: 4px;
    margin-bottom: 6px;
    border-radius: 50%;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.bubble-icon {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.bubble-header.expanded .bubble-icon {
    font-size: 18px;
}

.bubble-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.expanded .bubble-nav {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    overflow-y: auto;
    scrollbar-width: thin;
}

@keyframes bubble-item-in {
    0% {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scale(.94);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.bubble-header.expanded:not(.snapping) .bubble-nav a {
    opacity: 0;
    will-change: transform, opacity;
    animation: bubble-item-in 180ms cubic-bezier(.2, .7, .3, 1) forwards;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(1) {
    animation-delay: 20ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(2) {
    animation-delay: 40ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(3) {
    animation-delay: 60ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(4) {
    animation-delay: 80ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(5) {
    animation-delay: 100ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(6) {
    animation-delay: 120ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(7) {
    animation-delay: 140ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(8) {
    animation-delay: 160ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(9) {
    animation-delay: 180ms;
}

.bubble-header.expanded:not(.snapping) .bubble-nav a:nth-child(10) {
    animation-delay: 200ms;
}

@keyframes bubble-item-snap {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate3d(48px, -24px, 0) scale(.3) rotate(8deg);
    }
}

.bubble-header.snapping .bubble-nav {
    display: flex;

}

.bubble-header.snapping .bubble-nav a {
    will-change: transform, opacity;
    animation: bubble-item-snap 320ms cubic-bezier(.4, 0, .7, .3) forwards;
    pointer-events: none;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(1) {
    animation-delay: 0ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(2) {
    animation-delay: 18ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(3) {
    animation-delay: 36ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(4) {
    animation-delay: 54ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(5) {
    animation-delay: 72ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(6) {
    animation-delay: 90ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(7) {
    animation-delay: 108ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(8) {
    animation-delay: 126ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(9) {
    animation-delay: 144ms;
}

.bubble-header.snapping .bubble-nav a:nth-last-child(10) {
    animation-delay: 162ms;
}

.bubble-nav a {
    color: white;
    text-decoration: none;
    padding: 11px 13px;
    margin: 3px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bubble-nav a:hover,
.bubble-nav a:focus-visible {
    background-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

@media (max-width: 420px) {
    .bubble-header {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .bubble-header.expanded {
        width: min(320px, calc(100vw - 32px));
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        padding: 10px;
    }

    .bubble-nav a {
        padding: 10px 12px;
        font-size: 0.92rem;
    }
}

.head {
    display: none;
}

.search-header {
    transition: transform 0.24s ease;
}

.search-header.hidden {
    transform: translateY(-100%);
}

.search-header .logo {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.search-header .logo i {
    margin-right: 8px;
}

.search-header .anime-search-form {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.head .search-form {
    position: relative;
}

.search-header .anime-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: none;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.search-header .anime-search-input:focus {
    background-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

.search-header .anime-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-header .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
}

body {
    padding-top: 60px;
}

body.download-page-no-search {
    padding-top: 0;
}

body.mobile-download-page {
    padding-top: 0;
}

body.mobile-download-page .search-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
}

.anime-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 2000;
    display: grid;
    gap: 2px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(10, 10, 14, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.anime-search-suggestions[hidden] {
    display: none;
}

.anime-search-suggestion {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 6px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
}

.anime-search-suggestion:hover,
.anime-search-suggestion.active {
    background: rgba(255, 255, 255, 0.12);
}

.anime-search-suggestion img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.anime-search-suggestion-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.anime-search-suggestion-meta {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-search-suggestions {
    min-width: 280px;
}

@media (max-width: 768px) {
    .search-header {
        padding: 10px;
    }

    .search-header .logo {
        font-size: 18px;
    }

    body {
        padding-top: 52px;
    }

    body.download-page-no-search {
        padding-top: 0;
    }

    body.mobile-download-page {
        padding-top: 0;
    }

    body.mobile-download-page .search-header {
        min-height: 56px;
    }
}

.share-banner {
    position: fixed;
    left: 50%;
    bottom: 108px;
    transform: translate(-50%, 120%);
    opacity: 0;
    pointer-events: none;
    width: min(92vw, 760px);
    background: rgba(12, 12, 12, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.share-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.share-banner-content {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.share-banner-content i {
    color: #4ade80;
    font-size: 1rem;
    flex-shrink: 0;
}

.share-banner-content p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
}

.share-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.share-banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: #22c55e;
    color: #04120a;
    font-weight: 600;
    font-size: 0.86rem;
    padding: 0.45rem 0.95rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.share-banner-btn:hover {
    background: #4ade80;
}

.share-banner-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
}

.share-banner-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.discord-banner {
    background: rgba(16, 18, 32, 0.96);
    border-color: rgba(88, 101, 242, 0.42);
}

.discord-banner .share-banner-content i {
    color: #5865f2;
}

.discord-banner .share-banner-btn {
    background: #5865f2;
    color: #ffffff;
}

.discord-banner .share-banner-btn:hover {
    background: #4752c4;
}

.telegram-banner {
    background: rgba(8, 22, 34, 0.96);
    border-color: rgba(34, 158, 217, 0.42);
}

.telegram-banner .share-banner-content i {
    color: #229ed9;
}

.telegram-banner .share-banner-btn {
    background: #229ed9;
    color: #ffffff;
}

.telegram-banner .share-banner-btn:hover {
    background: #1a8ac0;
}

@media (max-width: 768px) {
    .share-banner {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        bottom: 88px;
        transform: translateY(120%);
        padding: 0.75rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .share-banner.is-visible {
        transform: translateY(0);
    }

    .share-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
