* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a1a;
    color: #f0f0f5;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* HEADER */
.header {
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(12px);
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 107, 107, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ff6b6b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.2);
}

.logo span {
    -webkit-text-fill-color: #fff;
    background: none;
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav__link {
    font-size: 14px;
    font-weight: 600;
    color: #b0b0c0;
    transition: color 0.3s, border-bottom 0.3s;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.nav__link:hover,
.nav__link.active {
    color: #fff;
    border-bottom-color: #ff6b6b;
}

/* Правый блок (для входа/профиля) */
.header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================
   ВЫПАДАЮЩЕЕ МЕНЮ (CSS-only)
   ========================================== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__checkbox {
    display: none;
}

.dropdown__trigger {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 30px;
    padding: 8px 16px 8px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, box-shadow 0.3s;
    font-family: inherit;
    user-select: none;
}

.dropdown__trigger:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.dropdown__arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.dropdown__checkbox:checked ~ .dropdown__trigger .dropdown__arrow {
    transform: rotate(180deg);
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 999;
}

.dropdown__checkbox:checked ~ .dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #d0d0dd;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.dropdown__item:hover {
    background: rgba(255, 107, 107, 0.08);
    color: #fff;
}

.dropdown__item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown__item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown__icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

/* ===== Оверлей – затемняет фон и закрывает меню при клике ===== */
.dropdown__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    display: none;
    background: rgba(0, 0, 0, 0.3);
    cursor: default;
}

.dropdown__checkbox:checked ~ .dropdown__overlay {
    display: block;
}

/* ===== Адаптивность для мобильных ===== */
@media (max-width: 768px) {
    .dropdown__trigger {
        padding: 6px 12px 6px 16px;
        font-size: 13px;
    }
    .dropdown__menu {
        right: -10px;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .dropdown__trigger {
        padding: 4px 10px 4px 12px;
        font-size: 12px;
    }
    .dropdown__menu {
        min-width: 140px;
        right: -6px;
    }
    .dropdown__item {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* HERO */
.hero {
    padding: 60px 0 30px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 107, 107, 0.08) 0%, transparent 70%);
}

.hero__title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 60%, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: fadeInDown 0.8s ease;
}

.hero__subtitle {
    font-size: 20px;
    color: #b0b0c0;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* FILTER */
.filter-section {
    padding: 10px 0 25px;
}

.filter__wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    padding: 14px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.filter__label {
    font-weight: 600;
    font-size: 15px;
    color: #d0d0dd;
    letter-spacing: 0.3px;
}

.filter__form select {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 40px 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b0b0c0' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filter__form select:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.filter__form select option {
    background: #1a1a2e;
}

.filter__reset {
    font-size: 14px;
    color: #ff6b6b;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    transition: background 0.3s;
}

.filter__reset:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* GRID */
.anime-grid {
    padding: 10px 0 40px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 28px;
}

.anime-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: cardAppear 0.6s ease forwards;
}

/* Каскадная задержка */
.anime-card:nth-child(1) { animation-delay: 0.05s; }
.anime-card:nth-child(2) { animation-delay: 0.10s; }
.anime-card:nth-child(3) { animation-delay: 0.15s; }
.anime-card:nth-child(4) { animation-delay: 0.20s; }
.anime-card:nth-child(5) { animation-delay: 0.25s; }
.anime-card:nth-child(6) { animation-delay: 0.30s; }
.anime-card:nth-child(7) { animation-delay: 0.35s; }
.anime-card:nth-child(8) { animation-delay: 0.40s; }
.anime-card:nth-child(9) { animation-delay: 0.45s; }
.anime-card:nth-child(10) { animation-delay: 0.50s; }
.anime-card:nth-child(11) { animation-delay: 0.55s; }
.anime-card:nth-child(12) { animation-delay: 0.60s; }

.anime-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
}

.anime-card__link {
    display: block;
}

.anime-card__poster {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #161622;
}

.anime-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.anime-card:hover .anime-card__poster img {
    transform: scale(1.05);
}

.anime-card__rating {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    padding: 4px 12px 4px 8px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.anime-card__rating::before {
    content: "⭐";
    font-size: 14px;
}

.anime-card__title {
    padding: 14px 12px 18px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: #f0f0f5;
    line-height: 1.3;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #b0b0c0;
    font-size: 18px;
}

/* BOOKMARK BANNER */
.bookmark-banner {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(255, 215, 0, 0.05));
    border-top: 1px solid rgba(255, 107, 107, 0.1);
    border-bottom: 1px solid rgba(255, 107, 107, 0.1);
    padding: 24px 0;
    margin: 20px 0 40px;
    border-radius: 16px;
}

.bookmark-banner__text {
    text-align: center;
    font-size: 16px;
    color: #c0c0d0;
}

.bookmark-banner__text strong {
    color: #fff;
    font-weight: 700;
}

.bookmark-banner__text kbd {
    background: rgba(255, 215, 0, 0.15);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.2);
    font-weight: 600;
}

/* DETAIL PAGE */
.anime-detail {
    padding: 40px 0 60px;
}

.detail__wrapper {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.detail__poster {
    flex: 0 0 320px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.3s;
}

.detail__poster:hover {
    transform: scale(1.02);
}

.detail__poster img {
    width: 100%;
    display: block;
}

.detail__info {
    flex: 1;
}

.detail__title {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 60%, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #c0c0d0;
}

.detail__rating {
    color: #ffd700;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail__rating::before {
    content: "⭐";
}

.detail__age {
    background: rgba(255, 107, 107, 0.15);
    padding: 2px 14px;
    border-radius: 30px;
    font-weight: 600;
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.detail__episodes {
    background: rgba(255, 215, 0, 0.08);
    padding: 2px 14px;
    border-radius: 30px;
    font-weight: 600;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.detail__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 14px;
    color: #d0d0dd;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s, border-color 0.3s;
}

.genre-tag:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
}

.detail__description {
    font-size: 17px;
    color: #d0d0dd;
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 720px;
}

.btn {
    display: inline-block;
    padding: 14px 44px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    box-shadow: 0 6px 24px rgba(255, 107, 107, 0.35);
}

.btn-primary:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

/* FOOTER */
.footer {
    background: rgba(10, 10, 26, 0.8);
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    color: #808090;
    font-size: 14px;
}

/* ERROR 404 */
.error-404 {
    padding: 80px 0;
    text-align: center;
}

.error-404 h1 {
    font-size: 48px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-404 p {
    font-size: 18px;
    color: #b0b0c0;
    margin-bottom: 30px;
}

/* ==========================================
   КАСТОМНЫЙ СКРОЛЛ (приглушённый)
   ========================================== */

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: #0a0a1a;
    border-radius: 4px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: #2a2a3e;
    border-radius: 4px;
    border: 1px solid #1a1a2e;
    transition: background 0.3s;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
    background: #4a4a5e;
}

html, body, * {
    scrollbar-width: thin;
    scrollbar-color: #2a2a3e #0a0a1a;
}

html {
    scroll-behavior: smooth;
}

/* ==========================================
   АНИМАЦИИ
   ========================================== */

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   АДАПТИВНОСТЬ (без menu-toggle)
   ========================================== */

@media (max-width: 992px) {
    .detail__wrapper {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    .detail__poster {
        flex: 0 0 auto;
        max-width: 280px;
        width: 100%;
    }
    .detail__info {
        text-align: center;
    }
    .detail__meta {
        justify-content: center;
    }
    .detail__genres {
        justify-content: center;
    }
    .detail__description {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .nav__list {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }
    .header__inner {
        flex-wrap: wrap;
    }
    .header__right {
        margin-left: auto;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 18px;
    }
    .hero__title {
        font-size: 32px;
    }
    .hero__subtitle {
        font-size: 17px;
    }
    .detail__title {
        font-size: 30px;
    }
    .dropdown__trigger {
        padding: 6px 12px 6px 16px;
        font-size: 13px;
    }
    .dropdown__menu {
        right: -10px;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 14px;
    }
    .anime-card__title {
        font-size: 13px;
        padding: 10px 8px 14px;
        min-height: 54px;
    }
    .filter__wrapper {
        padding: 12px 16px;
        gap: 12px;
    }
    .bookmark-banner__text {
        font-size: 14px;
    }
    .dropdown__trigger {
        padding: 4px 10px 4px 12px;
        font-size: 12px;
    }
    .dropdown__menu {
        min-width: 140px;
        right: -6px;
    }
    .dropdown__item {
        padding: 8px 16px;
        font-size: 13px;
    }
}