/* Inter лежит локально (public/fonts): раньше шрифт тянулся с Google Fonts —
   лишняя внешняя зависимость и уходящий наружу IP посетителя. Вариативный
   файл покрывает все нужные насыщенности (400–700). */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-opsz-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-cyrillic-opsz-normal.woff2') format('woff2-variations');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px 10px;
}

/* Логотип 4xa.ru: три бейджа — «4» (Фантастическая четвёрка), «X» (Люди Икс),
   «A» (Мстители). Файл public/img/logo.svg — собственная стилизация, не
   официальные эмблемы (они — товарные знаки Marvel). */
.logo {
    display: block;
    margin: 0 auto 10px;
    width: 216px;
    height: 72px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    color: rgba(237, 29, 36, 0.9);
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-container {
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.progress-stats {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 500;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: rgba(237, 29, 36, 0.8);
    height: 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.filters {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.reset-link {
    background: none;
    border: none;
    color: rgba(237, 29, 36, 0.7);
    font-size: 0.7rem;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
    border-bottom: 1px dotted rgba(237, 29, 36, 0.5);
    padding: 0;
}

.reset-link:hover {
    color: rgba(237, 29, 36, 1);
    border-bottom-color: rgba(237, 29, 36, 0.8);
}

.filter-btn,
.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active,
.control-btn:hover,
.control-btn.active {
    background: rgba(237, 29, 36, 0.6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(237, 29, 36, 0.3);
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    max-width: 1600px;
    margin: 0 auto;
}

.phase-section {
    grid-column: 1 / -1;
    margin: 25px 0 15px 0;
}

.phase-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(237, 29, 36, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: center;
    position: relative;
}

.phase-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: rgba(237, 29, 36, 0.8);
}

.phase-count {
    display: block;
    margin-top: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: none;
    color: rgba(255, 255, 255, 0.45);
}

.movie-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 2/3;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4);
}

.movie-card:focus-visible {
    outline: 2px solid rgba(237, 29, 36, 0.9);
    outline-offset: 2px;
}

/* Невышедшие: приглушённый постер, бейдж «Скоро», клик не работает */
.movie-card.upcoming {
    cursor: default;
}

.movie-card.upcoming .movie-poster {
    opacity: 0.55;
}

.soon-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Подпись карточки видна всегда (на десктопе детали — по наведению):
   глубокий градиент перекрывает низ постера, текст с тенью читается на любом арте */
.movie-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    padding: 36px 12px 10px;
    background: linear-gradient(180deg, transparent 0%, rgba(8, 10, 22, 0.55) 45%, rgba(8, 10, 22, 0.94) 100%);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.2px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    transition: opacity 0.2s ease;
}

.movie-caption-year {
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

.movie-card:hover .movie-caption {
    opacity: 0;
}

/* У просмотренных подпись и инфо-панель уходят в зелёный тон */
.movie-card.watched .movie-caption {
    background: linear-gradient(180deg, transparent 0%, rgba(14, 58, 35, 0.6) 45%, rgba(14, 58, 35, 0.95) 100%);
}


.movie-card:hover .movie-poster {
    background: linear-gradient(135deg, #ff4757, #ffa502);
}

.movie-card:hover .movie-info {
    transform: translateY(0);
    opacity: 1;
}

.movie-card.watched {
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.6);
}

/* Зелёная полупрозрачная подложка поверх постера — просмотренное видно сразу.
   При наведении гаснет, чтобы постер показывался в нормальных цветах. */
.movie-card.watched::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(39, 174, 96, 0.18), rgba(39, 174, 96, 0.42));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.movie-card.watched:hover::before {
    opacity: 0;
}

.movie-card.watched::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 2;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    border-radius: 15px;
}

.movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    backdrop-filter: blur(10px);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.movie-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.2;
    color: #fff;
}

.movie-original-title {
    font-size: 0.75rem;
    font-weight: 400;
    margin-bottom: 4px;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.movie-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-phase {
    background: rgba(237, 29, 36, 0.7);
    color: #fff;
    font-weight: 600;
}

.badge-year {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.badge-duration {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.movie-type {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    z-index: 2;
}

/* Развилки: карточка-коллекция в гриде (веер постеров + прогресс ветки),
   по клику под рядом раскрывается панель со всеми фильмами.
   Акцентный цвет ветки приходит через --fork-accent. */
.fork-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid color-mix(in srgb, var(--fork-accent, #ed1d24) 45%, transparent);
}

.fork-card:hover {
    box-shadow: 0 10px 30px color-mix(in srgb, var(--fork-accent, #ed1d24) 35%, transparent);
}

.fork-card.fork-open {
    border-color: var(--fork-accent, #ed1d24);
}

.fork-card .fork-flag {
    background: var(--fork-accent, #ed1d24);
    color: #0f0f23;
    font-weight: 700;
    z-index: 3;
}

.fork-fan {
    position: relative;
    flex: 1;
    min-height: 0;
}

.fork-fan-poster {
    position: absolute;
    top: 14%;
    left: 50%;
    width: 56%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.fork-fan-0 {
    transform: translateX(-88%) rotate(-9deg);
}

.fork-fan-1 {
    transform: translateX(-50%);
    top: 10%;
    z-index: 2;
}

.fork-fan-2 {
    transform: translateX(-12%) rotate(9deg);
}

.fork-card-info {
    padding: 10px 12px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.fork-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    color: #fff;
}

.fork-card-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.fork-card-bar {
    height: 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    margin: 8px 0;
    overflow: hidden;
}

.fork-card-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--fork-accent, #ed1d24);
    transition: width 0.4s ease;
}

.fork-card-cta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fork-accent, #ed1d24);
}

.fork-panel {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--fork-accent, #ed1d24);
    border-radius: 15px;
    margin: 5px 0;
    padding-top: 14px;
}

.fork-note {
    padding: 0 20px 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
}


.fork-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    padding: 0 20px 20px;
}

.fork-reminder {
    grid-column: 1 / -1;
    margin: 5px 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--fork-accent, #ed1d24);
    border-radius: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* Планшеты */
@media (max-width: 1024px) {
    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .fork-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* Мобильные */
@media (max-width: 768px) {
    .movie-card:hover .movie-info,
    .movie-info {
        transform: translateY(0);
        opacity: 1;
        position: static;
        background: rgba(0, 0, 0, 0.8);
    }

    /* Инфо-панель и так видна всегда — отдельная подпись не нужна */
    .movie-caption {
        display: none;
    }

    /* На мобильных ховера нет — зелёный статус несёт постоянная инфо-панель */
    .movie-card.watched .movie-info {
        background: rgba(14, 58, 35, 0.85);
    }

    .title {
        font-size: 2rem;
    }

    .logo {
        width: 180px;
        height: 60px;
    }

    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fork-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 12px 12px;
    }

    .movie-info {
        padding: 8px;
    }

    .movie-title {
        font-size: 0.8rem;
    }

    .movie-original-title {
        font-size: 0.7rem;
    }

    .filters {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .phase-title {
        font-size: 1.2rem;
    }
}
.progress-hint {
    margin-top: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

/* «Дальше по порядку» — первый непросмотренный из вышедших */
.next-up {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    text-align: left;
}

/* Подсказка о недосмотренной развилке перед следующим фильмом:
   явный выбор — «Смотреть» или «Пропустить» */
.next-up-fork {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    text-align: left;
    border: 1px solid color-mix(in srgb, var(--fork-accent, #ed1d24) 45%, transparent);
    border-left: 3px solid var(--fork-accent, #ed1d24);
    border-radius: 10px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    line-height: 1.4;
}

.next-up-fork-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex: none;
}

.next-up-fork-btn {
    border: none;
    border-radius: 12px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--fork-accent, #ed1d24);
    color: #0f0f23;
    transition: filter 0.2s ease;
}

.next-up-fork-btn:hover {
    filter: brightness(1.15);
}

.next-up-fork-btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.7);
}

.next-up-fork-btn.ghost:hover {
    border-color: rgba(255, 255, 255, 0.5);
    filter: none;
}

.next-up:empty {
    display: none;
}

.next-up img {
    width: 34px;
    height: 51px;
    object-fit: cover;
    border-radius: 6px;
    flex: none;
}

.next-up-text {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
}

.next-up-text strong {
    color: #fff;
}

.next-up-btn {
    background: rgba(237, 29, 36, 0.7);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.next-up-btn:hover {
    background: rgba(237, 29, 36, 1);
}

.next-up-done {
    font-size: 0.85rem;
    color: #27ae60;
}

/* Текст «как смотреть» под гридом — статичный контент для людей и поисковиков.
   Карточки в общем стиле сайта: подложка как у .progress-container, красный
   акцент у заголовков как у .phase-title. */
.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-width: 1000px;
    margin: 50px auto 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.65;
}

.about-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 22px 24px;
    backdrop-filter: blur(10px);
}

.about-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    position: relative;
}

.about-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: rgba(237, 29, 36, 0.8);
}

.about-card p {
    margin-bottom: 12px;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-card strong {
    color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 900px) {
    .about {
        grid-template-columns: 1fr;
    }
}

/* Подвал с подписью разработчика — единый блок для всех наших проектов.
   Эталон: D:\www\credit-block.html. Оформление на currentColor,
   поэтому блок подхватывает цвет подвала и не требует своей палитры. */
.site-footer {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding-bottom: 10px;
    color: rgba(255, 255, 255, .65);
}

@media (max-width:639px){}
