@keyframes page-load-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 99999;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

#page-loader.htmx-request {
    opacity: 1;
}

#page-loader::after {
    content: '';
    display: block;
    height: 100%;
    width: 30%;
    background: #ff3333;
    animation: page-load-slide 0.8s ease-in-out infinite;
}

@keyframes loaderPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.5); opacity: 0.3; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes loaderRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(90deg); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loader-square {
    position: relative;
    display: inline-block;
    min-width: 24px;
    min-height: 24px;
}

.loader-square::before,
.loader-square::after {
    content: '';
    position: absolute;
    border: 2px solid;
}

.loader-square::before {
    width: 100%;
    height: 100%;
    border-color: #ff3333;
    animation: loaderRotate 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-square::after {
    width: 60%;
    height: 60%;
    border-color: rgba(255, 51, 51, 0.4);
    animation: loaderPulse 0.8s ease-in-out infinite;
}

@keyframes card-reveal {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.anime-card-reveal {
    animation: card-reveal 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: calc(min(var(--i, 0), 8) * 30ms);
}

@keyframes skeleton-pulse {
    0%, 100% { background-color: rgba(255, 255, 255, 0.03); }
    50% { background-color: rgba(255, 255, 255, 0.08); }
}

.poster-skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.poster-loading {
    opacity: 0;
}

#anime-grid,
#profile-lists {
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.view-switching {
    opacity: 0 !important;
    filter: brightness(0) !important;
}

.view-switching .anime-card-reveal {
    animation: none !important;
}

.view-switching .poster-skeleton {
    animation: none !important;
    background-color: transparent !important;
}

.view-switching .poster-loading {
    opacity: 1 !important;
}

.anime-card {
    animation: none;
}

.anime-card .card-poster {
    transition: opacity 0.3s ease, transform 0.5s ease-out;
}

.anime-card:hover .card-poster {
    transform: scale(1.08);
}

.anime-card .card-overlay {
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.anime-card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.25);
}

.anime-card .status-badge {
    transform: translateY(0);
}

#anime-grid:not(.anime-container-list):not(.anime-container-grid),
#profile-lists:not(.anime-container-list):not(.anime-container-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.anime-container-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .anime-container-grid { gap: 1rem; }
}

@media (min-width: 768px) {
    .anime-container-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .anime-container-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
}

@media (min-width: 1280px) {
    .anime-container-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}


.anime-container-grid .anime-card-reveal {
    height: 100%;
    min-width: 0;
}

.anime-container-grid .anime-view-list {
    display: none;
}

.anime-container-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.anime-container-list .anime-view-grid {
    display: none;
}

@media (min-width: 640px) {
    .anime-container-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .anime-container-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .anime-container-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


.anime-container-list .load-more-sentinel {
    grid-column: 1 / -1;
    width: 100%;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #000;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

*::-webkit-scrollbar-button {
    display: none;
}

*::-webkit-scrollbar-corner {
    background: #000;
}

@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.2) #000;
    }
}

@media (max-width: 1279px) {
    * {
        scrollbar-width: none;
    }
    *::-webkit-scrollbar {
        display: none;
    }
}

body {
    overflow-y: scroll;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    width: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/contain no-repeat;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

input[type="search"]::-webkit-search-cancel-button:hover {
    opacity: 1;
}

input[type="search"]::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.nav-desktop {
    position: relative;
    overflow: visible;
}

.nav-desktop .notifications-wrapper {
    position: static;
}

.nav-desktop .notifications-dropdown {
    left: 0;
    right: 0;
    width: auto;
}

.nav-side-left,
.nav-side-right {
    will-change: width, opacity;
}


.nav-link.active {
    color: #ff3333;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-6 {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    padding-right: 48px;
}

.custom-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.custom-select option {
    background: #0a0a0a;
    color: white;
    padding: 12px;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.drag-scroll {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    scroll-behavior: smooth;
}

.drag-scroll.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.drag-scroll a,
.drag-scroll img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.custom-combo {
    position: relative;
}

.custom-combo-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.custom-combo-trigger:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.custom-combo.open .custom-combo-trigger {
    border-color: rgba(255,255,255,0.3);
}

.custom-combo-value {
    flex: 1;
    font-size: 13px;
    color: white;
}

.custom-combo-placeholder {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.custom-combo-arrow {
    margin-left: 8px;
    transition: transform 0.3s;
    color: rgba(255,255,255,0.6);
}

.custom-combo.open .custom-combo-arrow {
    transform: rotate(180deg);
}

.custom-combo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.2);
    border-top: none;
    z-index: 100;
    overscroll-behavior: contain;
}

.custom-combo-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

.custom-combo-option:hover {
    background: rgba(255,255,255,0.1);
}

.custom-combo-option.selected {
    background: rgba(255,255,255,0.15);
    color: white;
}

.anime-list-combo .custom-combo-trigger {
    min-height: auto;
    padding: 16px 24px;
    background: #0a0a0a;
    border: 2px solid rgba(255,255,255,0.2);
}

.anime-list-combo .custom-combo-trigger:hover {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.4);
}

.anime-list-combo.open .custom-combo-trigger {
    border-color: white;
    background: #1a1a1a;
}

.anime-list-combo .custom-combo-value {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.anime-list-combo .custom-combo-dropdown {
    background: #0a0a0a;
    border: 2px solid rgba(255,255,255,0.2);
    border-top: none;
    max-height: none;
    overflow-y: visible;
}

.anime-list-combo .custom-combo-option {
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.multi-select {
    position: relative;
    z-index: auto;
}

.multi-select.open {
    z-index: 100;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.multi-select-trigger:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.multi-select.open .multi-select-trigger {
    border-color: rgba(255,255,255,0.3);
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.15);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.multi-select-tag-remove {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.multi-select-tag-remove:hover {
    opacity: 1;
}

.multi-select-placeholder {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.multi-select-arrow {
    margin-left: 8px;
    transition: transform 0.3s;
    color: rgba(255,255,255,0.6);
}

.multi-select.open .multi-select-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.2);
    border-top: none;
    z-index: 1000;
    overscroll-behavior: contain;
}

.multi-select-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multi-select-option:hover {
    background: rgba(255,255,255,0.1);
}

.multi-select-option.selected {
    background: rgba(255,255,255,0.15);
}

.multi-select-option-check {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.multi-select-option.selected .multi-select-option-check {
    background: white;
    border-color: white;
}

.multi-select-option.selected .multi-select-option-check svg {
    display: block;
}

.multi-select-option-check svg {
    display: none;
    width: 12px;
    height: 12px;
    stroke: black;
}


.filter-content {
    position: relative;
    z-index: 20;
}

.filter-row {
    position: relative;
    z-index: 30;
}

.filter-row:nth-child(1) {
    z-index: 40;
}

.filter-row:nth-child(2) {
    z-index: 35;
}

.filter-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ff3333;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
}

.nav-logo {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.nav-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-inline {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0;
}

.nav-search-inline.active {
    width: 280px;
    opacity: 1;
    margin-right: 12px;
}

.nav-search-inline input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 16px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}

.nav-search-inline input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.nav-search-inline input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.search-results-dropdown.active {
    max-height: 480px;
    opacity: 1;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: white;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 48px;
    height: 68px;
    min-width: 48px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: white;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-no-results {
    padding: 24px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    z-index: 100;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notifications-header span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
}

.notifications-header button {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}

.notifications-header button:hover {
    color: white;
}

.notification-item.unread {
    background: rgba(255, 51, 51, 0.05);
}

.notification-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    position: relative;
}

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

.notification-link {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.notification-poster {
    flex-shrink: 0;
    width: 40px;
    height: 56px;
    overflow: hidden;
}

.notification-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-preview {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    border-left: 2px solid rgba(255, 51, 51, 0.2);
    padding-left: 8px;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications-filters {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notifications-filters button {
    flex: 1;
    padding: 10px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.notifications-filters button:hover {
    color: rgba(255, 255, 255, 0.7);
}

.notifications-filters button.active {
    color: white;
    border-bottom-color: #ff3333;
}

.notification-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.notification-mark-read {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    z-index: 2;
}

.notification-mark-read:hover {
    color: #22c55e;
}

.notification-mark-read svg {
    width: 14px;
    height: 14px;
}

.notifications-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: rgba(255, 255, 255, 0.3);
    gap: 12px;
}

.notifications-empty svg {
    width: 32px;
    height: 32px;
}

.notifications-empty span {
    font-size: 13px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    background: #f33;
    color: white;
    font-size: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    z-index: 10;
}

.notification-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 4px;
    background: rgba(255, 51, 51, 0.2);
    color: #ff3333;
    font-size: 10px;
    font-weight: 600;
    border-radius: 0;
}

.notification-badge.hidden {
    display: none;
}

.bottom-nav {
    position: fixed;
    bottom: 8px;
    left: 8px;
    right: 8px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    padding-bottom: env(safe-area-inset-bottom, 0);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding-top: 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: white;
}

.bottom-nav-item.active svg {
    color: #ff3333;
}

@media (max-width: 1279px) {
    .nav {
        pointer-events: none;
    }

    .nav .nav-right-actions,
    .nav .nav-mobile-left {
        pointer-events: auto;
    }

    .bottom-nav {
        display: flex;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background: rgba(0, 0, 0, 0.6);
        will-change: transform;
    }

    body:has(.player-section--modal) .bottom-nav {
        display: none !important;
    }

    body:has(.player-section--modal) {
        padding-bottom: 0 !important;
    }

    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }

    .nav-search-inline.active {
        width: 200px;
    }

    .search-results-dropdown {
        position: fixed;
        left: 8px;
        right: 8px;
        top: 70px;
        width: auto;
        max-height: calc(100dvh - 90px);
    }

    .search-results-dropdown.active {
        max-height: calc(100dvh - 90px);
    }

    .search-result-item {
        gap: 14px;
        padding: 14px 16px;
    }

    .search-result-image {
        width: 56px;
        height: 78px;
    }

    .search-result-title {
        font-size: 15px;
        white-space: normal;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-result-meta {
        font-size: 12px;
        margin-top: 2px;
    }

    .search-no-results {
        padding: 32px 16px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .notifications-dropdown {
        position: fixed;
        left: 8px;
        right: 8px;
        width: auto;
        top: 70px;
        bottom: auto;
        max-height: calc(100dvh - 90px);
        border-radius: 0;
    }

    .nav-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .filter-row {
        grid-template-columns: 1fr !important;
    }
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dropdown-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-4px); }
}

.dropdown-enter {
    animation: dropdown-in 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.dropdown-leave {
    animation: dropdown-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.filter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    padding: 24px;
}

.filter-modal {
    width: 100%;
    max-width: 340px;
    max-height: 70vh;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.filter-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.5rem !important;
    }

    .nav-container {
        height: 64px !important;
    }

    .nav-right-actions {
        gap: 8px !important;
    }

    .nav-right-actions > .nav-search-wrapper > button,
    .nav-mobile-left > button,
    .nav-mobile-left > div > button {
        width: 36px;
        height: 36px;
        font-size: 10px;
    }

    .filter-content {
        padding: 12px;
    }

    .filter-row {
        gap: 8px;
    }

    .multi-select-trigger,
    .custom-combo-trigger {
        min-height: 44px;
        padding: 10px 12px;
    }

    .custom-select {
        padding: 12px;
        font-size: 14px;
    }

    .search-results-dropdown {
        top: 58px;
    }

    .search-results-dropdown.active {
        max-height: calc(100dvh - 78px);
    }

}



.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: block;
}

.htmx-request.htmx-indicator {
    display: block;
}

[x-cloak] {
    display: none !important;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.rating-slider-container {
    position: relative;
    padding-bottom: 14px;
}

.rating-slider-track {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.rating-slider-ticks {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.rating-tick {
    width: 1px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
}

.rating-tick-major {
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.rating-slider {
    position: relative;
    width: 100%;
    z-index: 2;
}

input.rating-slider::-webkit-slider-track {
    background: transparent;
    height: 1px;
}

input.rating-slider::-moz-range-track {
    background: transparent;
    height: 1px;
}

input.rating-slider::-webkit-slider-thumb {
    margin-top: -8px;
}

input.rating-slider::-moz-range-progress {
    background: transparent;
    height: 1px;
}

.active-filters-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.active-filters-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.active-filters-pill .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
    cursor: pointer;
}

.active-filters-pill .remove-btn:hover {
    opacity: 1;
}

/* ========================================
   Auth Styles
   ======================================== */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 6rem 1.5rem 4rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.3s;
    outline: none;
}

.auth-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-input {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.auth-password-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.verify-code-input {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5em;
    padding: 1rem;
}

.auth-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #ff3333;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
}

.auth-btn:hover {
    background: #cc2929;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn-telegram {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border: 1px solid rgba(42, 171, 238, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.auth-btn-telegram:hover {
    background: rgba(42, 171, 238, 0.1);
    border-color: rgba(42, 171, 238, 0.5);
    color: white;
}

.auth-btn-telegram svg {
    color: #2AABEE;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.auth-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.3s;
}

.auth-link:hover {
    color: white;
}

.auth-link.inline {
    display: inline;
    color: #ff3333;
}

.auth-link.inline:hover {
    color: white;
}

.auth-error {
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid rgba(255, 51, 51, 0.3);
    color: #ff6666;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
}

.auth-success {
    background: rgba(51, 255, 51, 0.1);
    border: 1px solid rgba(51, 255, 51, 0.3);
    color: #66ff66;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
}

.auth-field-error {
    color: #ff6666;
    font-size: 0.75rem;
    margin-top: 0.375rem;
}

.auth-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: #ff3333;
    margin-top: 2px;
    cursor: pointer;
}

.auth-resend {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.auth-modal {
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-modal-close {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.auth-modal-close:hover {
    color: white;
}

.auth-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.terms-content h2 {
    color: white;
}

.terms-content p {
    line-height: 1.6;
}

/* ========================================
   User Avatar
   ======================================== */

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: linear-gradient(135deg, #ff3333, #cc2929);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    user-select: none;
    transition: transform 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

.user-avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

/* ========================================
   Profile Styles
   ======================================== */

.profile-tabs-wrap {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

@media (max-width: 639px) {
    .profile-tabs-wrap {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 0.375rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .profile-tabs-wrap::-webkit-scrollbar {
        display: none;
    }
}

.profile-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .profile-tab {
        flex-shrink: 1;
    }
}

.profile-tab:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.profile-tab.active {
    color: white;
    border-color: #ff3333;
    background: rgba(255, 51, 51, 0.08);
}

.profile-tab-count {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.125rem 0.5rem;
    min-width: 1.25rem;
    text-align: center;
}

.profile-tab.active .profile-tab-count {
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 51, 51, 0.15);
}

/* ========================================
   Player Timeline Tooltip
   ======================================== */

.player-bar-tooltip {
    position: absolute;
    bottom: 100%;
    margin-bottom: 6px;
    padding: 3px 7px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    transform: translateX(-50%);
    z-index: 20;
}

.player-bar-progress:hover .player-bar-tooltip {
    opacity: 1;
}

/* ========================================
   Player Fullscreen
   ======================================== */

#player-container:fullscreen,
#player-container:-webkit-full-screen {
    background: #000;
}

#player-container:fullscreen .player-layout,
#player-container:-webkit-full-screen .player-layout {
    max-width: none;
    padding-right: 0;
    height: 100%;
}

#player-container:fullscreen .player-main,
#player-container:-webkit-full-screen .player-main {
    height: 100%;
}

#player-container:fullscreen .player-custom,
#player-container:-webkit-full-screen .player-custom {
    height: 100%;
}

#player-container:fullscreen .player-video-wrap,
#player-container:-webkit-full-screen .player-video-wrap {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
}

#player-container:fullscreen .player-video,
#player-container:-webkit-full-screen .player-video {
    object-fit: contain;
}

#player-container:fullscreen .player-sidebar,
#player-container:fullscreen .player-sidebar-toggle,
#player-container:-webkit-full-screen .player-sidebar,
#player-container:-webkit-full-screen .player-sidebar-toggle {
    display: none !important;
}

/* ========================================
   Player Settings Menu
   ======================================== */

.player-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 30;
    transition: background 0.25s ease;
    pointer-events: none;
}

.player-settings-backdrop.active {
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.player-settings-panel {
    position: absolute;
    bottom: 52px;
    right: 8px;
    width: 240px;
    background: rgba(12, 12, 12, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    z-index: 50;
    overflow: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.player-settings-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 14px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.player-settings-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.player-settings-item-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-settings-item-value {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
}

.player-settings-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.player-settings-back:hover {
    background: rgba(255, 255, 255, 0.04);
}

.player-settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: rgba(255, 255, 255, 0.65);
}

.player-settings-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.player-settings-option.active {
    color: #ff3333;
}

.player-settings-hotkey {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
}

.player-settings-hotkey-icon {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.player-settings-hotkey-key {
    display: inline-block;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 10px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.55);
    min-width: 42px;
    text-align: center;
    flex-shrink: 0;
}

.player-settings-hotkey-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   Settings Toggle
   ======================================== */

.settings-toggle-track {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
}

.settings-toggle-track.active {
    background: #ff3333;
    border-color: #ff3333;
}

.settings-toggle-thumb {
    width: 20px;
    height: 20px;
    background: white;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: transform 0.3s;
}

.settings-toggle-thumb.active {
    transform: translateX(20px);
}

/* ========================================
   Auth Responsive
   ======================================== */

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .verify-code-input {
        font-size: 1.25rem;
        letter-spacing: 0.3em;
    }

    .profile-tab {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ========================================
   Star Rating
   ======================================== */

.star-btn:hover svg {
    filter: drop-shadow(0 0 4px rgba(255, 51, 51, 0.4));
}

/* ========================================
   Comment Thread
   ======================================== */

.comment-thread + .comment-thread {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========================================
   Vote Buttons
   ======================================== */

.vote-btn {
    border: none;
    background: none;
    cursor: pointer;
    line-height: 1;
}

.vote-btn:active {
    transform: scale(0.9);
}

/* ========================================
   Reply Preview
   ======================================== */

.reply-preview {
    cursor: default;
    max-width: 100%;
}

.reply-preview p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   Screenshot Carousel (managed by Alpine.js)
   ======================================== */

/* ========================================
   Poster Watch Overlay
   ======================================== */

.poster-watch-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.poster-watch-badge {
    z-index: 1;
}

@media (hover: hover) {
    .poster-watch:hover .poster-watch-overlay {
        opacity: 1;
    }

    .poster-watch:hover img {
        transform: scale(1.05);
        transition: transform 0.4s;
    }
}

@media (hover: none) {
    .poster-watch:active .poster-watch-overlay {
        opacity: 1;
    }
}

@keyframes comment-highlight {
    0%, 100% { background-color: transparent; }
    25%, 75% { background-color: rgba(255, 51, 51, 0.1); }
}

.comment-highlight {
    animation: comment-highlight 2s ease-in-out;
}

.schedule-tabs,
.mobile-featured,
.recent-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.schedule-tabs::-webkit-scrollbar,
.mobile-featured::-webkit-scrollbar,
.recent-scroll::-webkit-scrollbar {
    display: none;
}
