.watchlist-page {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 60px;
}

.watchlist-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.section-label {
    display: block;
    margin-bottom: 6px;
    color: #63a6f5;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.watchlist-header h1 {
    margin: 0;
    color: #f4f7fa;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.watchlist-header p {
    margin: 9px 0 0;
    color: #8ea0b1;
    font-size: 0.95rem;
}

.watchlist-header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.watchlist-count {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #8091a2;
}

.watchlist-count strong {
    color: #f4f7fa;
    font-size: 1.8rem;
}

.watchlist-count span {
    font-size: 0.85rem;
}

.random-button {
    display: inline-flex;
    height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid #35659b;
    border-radius: 8px;
    background: #17304a;
    color: #dcecff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.random-button:hover {
    border-color: #4e8bd0;
    background: #1d3d5e;
    transform: translateY(-1px);
}

.random-button i {
    color: #74b3fa;
}

.watchlist-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

.watchlist-search {
    position: relative;
    width: min(400px, 100%);
}

.watchlist-search i {
    position: absolute;
    top: 50%;
    left: 15px;
    color: #64788c;
    transform: translateY(-50%);
    pointer-events: none;
}

.watchlist-search input {
    width: 100%;
    height: 42px;
    padding: 0 15px 0 42px;
    border: 1px solid #253342;
    border-radius: 8px;
    outline: none;
    background: #0d1319;
    color: #edf3f8;
    font: inherit;
}

.watchlist-search input::placeholder {
    color: #607386;
}

.watchlist-search input:focus {
    border-color: #4e86c8;
}

.priority-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.priority-filter {
    display: inline-flex;
    height: 36px;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid #263442;
    border-radius: 7px;
    background: #0d141b;
    color: #8497a9;
    font: inherit;
    font-size: 0.76rem;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.priority-filter span {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #151f29;
    color: #9badbd;
    font-size: 0.68rem;
    text-align: center;
}

.priority-filter:hover,
.priority-filter.active {
    border-color: #3e6e9e;
    background: #122236;
    color: #d9eaff;
}

.priority-filter.active span {
    background: #1d3b5a;
    color: #8ec2ff;
}

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.watchlist-card {
    min-width: 0;
}

.watchlist-card[hidden] {
    display: none;
}

.watchlist-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border: 1px solid #263442;
    border-radius: 11px;
    background: #0b1117;
    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.watchlist-card:hover .watchlist-poster {
    border-color: #3d5871;
    transform: translateY(-2px);
}

.watchlist-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.watchlist-card:hover .watchlist-poster img {
    transform: scale(1.025);
}

.poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c131a;
    color: #29435e;
    font-size: 2.8rem;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
}

.watchlist-poster > .priority-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(7px);
}

.priority-badge.important {
    border-color: rgba(232, 83, 83, 0.4);
    background: rgba(116, 25, 25, 0.88);
    color: #ffaaaa;
}

.priority-badge.high {
    border-color: rgba(224, 145, 59, 0.4);
    background: rgba(106, 61, 19, 0.88);
    color: #ffc37f;
}

.priority-badge.medium {
    border-color: rgba(202, 175, 63, 0.35);
    background: rgba(91, 78, 20, 0.88);
    color: #ead77b;
}

.priority-badge.low {
    border-color: rgba(79, 139, 199, 0.35);
    background: rgba(24, 61, 96, 0.88);
    color: #8dc4f7;
}

.watchlist-card-content {
    padding: 11px 2px 0;
}

.watchlist-card-content h2 {
    margin: 0;
    overflow: hidden;
    color: #edf2f7;
    font-size: 0.93rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watchlist-meta {
    display: flex;
    gap: 7px;
    margin-top: 5px;
    color: #74889b;
    font-size: 0.73rem;
}

.watchlist-meta span + span::before {
    content: "·";
    margin-right: 7px;
    color: #43586d;
}

.watchlist-note {
    display: -webkit-box;
    margin: 9px 0 0;
    overflow: hidden;
    color: #9aabba;
    font-size: 0.77rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.watchlist-added {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 9px;
    color: #596d80;
    font-size: 0.68rem;
}

.watchlist-added i {
    font-size: 0.65rem;
}

.watchlist-empty,
.watchlist-empty-search {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #718497;
    text-align: center;
}

.watchlist-empty {
    display: flex;
    min-height: 450px;
}

.watchlist-empty-search {
    display: none;
    min-height: 250px;
}

.watchlist-empty i,
.watchlist-empty-search > i {
    margin-bottom: 13px;
    color: #31506e;
    font-size: 2.8rem;
}

.watchlist-empty h2,
.watchlist-empty-search h2 {
    margin: 0;
    color: #dce5ed;
}

.watchlist-empty p,
.watchlist-empty-search p {
    margin: 8px 0 0;
}

body.modal-open {
    overflow: hidden;
}

.random-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.random-modal.open {
    display: flex;
}

.random-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 9, 0.82);
    backdrop-filter: blur(8px);
}

.random-modal-content {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    overflow: hidden;
    border: 1px solid #304151;
    border-radius: 14px;
    background: #0d141b;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
}

.random-modal-close {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: rgba(7, 12, 17, 0.75);
    color: #d9e4ed;
    cursor: pointer;
    backdrop-filter: blur(7px);
}

.random-modal-close:hover {
    background: #192632;
}

.random-hero {
    position: relative;
    height: 210px;
    background-position: center;
    background-size: cover;
}

.random-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(5, 8, 12, 0.12),
        #0d141b 100%
    );
}

.random-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(8, 13, 18, 0.55),
        transparent 65%
    );
}

.random-selection-label {
    position: absolute;
    z-index: 2;
    top: 25px;
    left: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8dc0fa;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
}

.random-body {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    padding: 0 28px 28px;
}

.random-poster {
    position: relative;
    margin-top: -75px;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border: 2px solid #253544;
    border-radius: 10px;
    background: #0b1117;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.random-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.random-info {
    min-width: 0;
}

.random-info > .priority-badge {
    margin-bottom: 9px;
}

.random-info h2 {
    margin: 0;
    color: #f4f7fa;
    font-size: 1.6rem;
    line-height: 1.15;
}

.random-meta {
    margin-top: 8px;
    color: #8295a7;
    font-size: 0.82rem;
}

.random-note {
    margin: 17px 0 0;
    padding: 12px 14px;
    border-left: 2px solid #426d99;
    border-radius: 0 6px 6px 0;
    background: #101a23;
    color: #a8b7c5;
    font-size: 0.82rem;
    line-height: 1.5;
}

.random-actions {
    display: flex;
    margin-top: 20px;
}

.random-again {
    display: inline-flex;
    height: 39px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid #315b85;
    border-radius: 7px;
    background: #13283c;
    color: #cfe5fb;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.random-again:hover {
    background: #193652;
}

@media (max-width: 1200px) {
    .watchlist-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .watchlist-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .priority-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .watchlist-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .watchlist-page {
        width: min(100% - 24px, 1500px);
        padding-top: 24px;
    }

    .watchlist-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .watchlist-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .watchlist-search {
        width: 100%;
    }

    .priority-filters {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .priority-filter {
        flex: 0 0 auto;
    }

    .watchlist-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 13px;
    }

    .random-modal {
        padding: 12px;
    }

    .random-hero {
        height: 180px;
    }

    .random-body {
        grid-template-columns: 115px minmax(0, 1fr);
        gap: 17px;
        padding: 0 18px 20px;
    }

    .random-poster {
        margin-top: -50px;
    }

    .random-info h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .watchlist-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .random-button {
        width: 100%;
    }

    .watchlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .watchlist-added {
        display: none;
    }

    .random-hero {
        height: 145px;
    }

    .random-selection-label {
        top: 20px;
        left: 18px;
    }

    .random-body {
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 14px;
        padding: 0 15px 18px;
    }

    .random-poster {
        margin-top: -35px;
    }

    .random-info h2 {
        font-size: 1.05rem;
    }

    .random-meta {
        font-size: 0.72rem;
    }

    .random-note {
        grid-column: 1 / -1;
    }
}