@font-face {
    font-family: 'Oswald';
    src: url('../fonts/oswald.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:root {
    --bg-main: #101010;
    --bg-block: #181818;
    --border-color: #2a2a2a;
    --text-main: #777777;
    --accent-title: #ffd100;
    --accent-text: #ffffff;

    --font-main: 'Oswald', sans-serif;
    --radius: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-title);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: 0.5px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('../images/pattern.webp');
    background-repeat: repeat;
    opacity: 0.03;
    z-index: -2;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent-text);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--accent-title);
}

button {
    font-family: var(--font-main);
    letter-spacing: 0.5px;
}

.content-box {
    background: var(--bg-block);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
}

.header {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.header__logo {
    pointer-events: auto;
}

.header__logo-img {
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.page-main {
    flex-grow: 1;
    width: 100%;
    padding-top: 100px;
    padding-bottom: 50px;
}

.home-search-block {
    position: relative;
    max-width: 800px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-bar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    transition: 0.3s;
}

.search-bar:focus-within {
    border-color: var(--accent-title);
}

.search-bar input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 5px;
    font-family: var(--font-main);
    font-size: 20px;
    outline: none;
}

.search-bar input::placeholder {
    color: #555;
}

.btn--icon {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 10px;
    transition: 0.2s;
}

.btn--icon:hover,
.btn--icon.active {
    color: var(--accent-title);
}

.filter-panel {
    background: transparent;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    opacity: 0;
    visibility: hidden;
    height: 0;
    transition: 0.3s ease;
    overflow: hidden;
}

.filter-panel.active {
    opacity: 1;
    visibility: visible;
    height: auto;
    padding-top: 15px;
    overflow: visible;
}

.filter-group {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.filter-group label {
    color: var(--accent-text);
    font-size: 16px;
    white-space: nowrap;
}

.filter-group select {
    width: 100%;
    background: transparent;
    color: #fff;
    border: none;
    padding: 8px 0;
    font-family: var(--font-main);
    font-size: 16px;
    outline: none;
    cursor: pointer;
}

.filter-group select option {
    background: var(--bg-block);
    color: #fff;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

.card {
    background: var(--bg-block);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-title);
}

.card__poster-wrap,
.series-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    width: 100%;
    overflow: hidden;
}

.card__poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__info {
    padding: 15px;
}

.card__status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 2px;
    font-weight: bold;
    background: var(--bg-block);
    color: var(--text-main);
}

.card__status[data-status="Онгоинг"] {
    background: var(--accent-title);
    color: #000;
}

.card__status[data-status="Анонс"] {
    background: #00c0ff;
    color: #000;
}

.card__status[data-status="Завершён"] {
    background: #444;
    color: #fff;
}

.card__title-ru {
    font-size: 16px;
    color: var(--accent-text);
    text-transform: uppercase;
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 4px;
}

.card__title-en {
    font-size: 14px;
    color: var(--text-main);
}

.btn {
    background: var(--bg-block);
    border: 1px solid var(--border-color);
    color: #fff;
    cursor: pointer;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 16px;
    transition: 0.2s;
}

.btn:hover {
    border-color: var(--accent-title);
    color: var(--accent-title);
}

.btn--primary {
    display: block;
    margin: 0 auto;
}

.hero-bg {
    display: none;
}

.series-page.has-cover {
    padding-top: 100px;
}

@media (min-width: 768px) {
    .hero-bg {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 600px;
        z-index: -1;
        overflow: hidden;
        pointer-events: none;
    }

    .hero-bg picture img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top;
        opacity: 0.7;
    }

    .hero-bg::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, transparent 30%, var(--bg-main) 100%);
    }

    .series-page.has-cover {
        padding-top: 320px;
    }
}

.series-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 900px) {
    .series-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        align-items: start;
    }
}

.series-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.series-poster {
    border-radius: var(--radius);
    margin-bottom: 25px;
    object-fit: cover;
    display: block;
    width: 100%;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    flex: 1 1 auto;
    text-align: center;
    background: transparent;
    color: var(--accent-title);
    border: 1px solid var(--accent-title);
    padding: 3px 10px;
    font-size: 14px;
    border-radius: 2px;
    text-transform: uppercase;
}

.meta-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.meta-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.meta-list span.val {
    color: var(--accent-text);
    text-align: right;
    word-break: break-word;
}

.team-title {
    font-size: 20px;
    color: var(--accent-title);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.team-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-main);
    font-size: 16px;
}

.team-row svg {
    width: 18px;
    height: 18px;
    fill: var(--accent-text);
    flex-shrink: 0;
    margin-top: 3px;
}

.team-row span {
    color: var(--accent-text);
}

.series-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.breadcrumbs {
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #555;
}

.series-title {
    font-size: 38px;
    margin-bottom: 5px;
    line-height: 1.1;
    color: var(--accent-text);
    text-transform: uppercase;
}

.series-subtitle {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 25px;
    text-transform: uppercase;
}

.series-desc {
    position: relative;
    padding: 15px 20px;
    font-style: italic;
    color: var(--text-main);
    border-left: 2px solid var(--accent-title);
    background: rgba(255, 255, 255, 0.03);
    font-size: 16px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .series-desc {
        font-size: 18px;
    }
}

.ranks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 15px;
    list-style: none;
}

.ranks-list li {
    background: #111;
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.ranks-list li img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.player-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-ep {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 15px;
    font-family: var(--font-main);
    font-size: 16px;
    border-radius: 2px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-kodik {
    background: rgba(255, 209, 0, 0.1);
    border-color: var(--accent-title);
    color: var(--accent-title);
}

.btn-ep:hover,
.btn-ep.active {
    background: var(--accent-title);
    color: #000;
    border-color: var(--accent-title);
}

.player-container {
    aspect-ratio: 16/9;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.player-container iframe {
    width: 100%;
    height: 100%;
}

.footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-block);
    padding: 40px 0;
    margin-top: 60px;
}

.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.footer__title {
    font-size: 24px;
    color: var(--accent-title);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.footer__desc {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 10px;
    max-width: 500px;
}

.footer__socials {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.footer__socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 4px;
    transition: 0.2s;
}

.footer__socials a:hover {
    border-color: var(--accent-title);
    transform: translateY(-3px);
}

.footer__socials img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: invert(1);
    opacity: 0.7;
    transition: 0.2s;
}

.footer__socials a:hover img {
    opacity: 1;
}

.btn-up {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-title);
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 24px;
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.btn-up.visible {
    opacity: 1;
    pointer-events: auto;
}

.btn-up:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    gap: 40px;
}

@media (min-width: 768px) {
    .error-container {
        flex-direction: row;
        text-align: left;
    }
}

.error-code {
    font-size: 100px;
    color: var(--accent-title);
    line-height: 1;
    margin-bottom: 10px;
}

.error-text {
    font-size: 32px;
    color: var(--accent-text);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.error-image img {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}