.binge-history-page {
    width: 100%;
}

.binge-history-container {
    width: calc(100% - 48px);
    max-width: 2100px;
    margin: 0 auto;
    padding: 45px 0 90px;
}

.history-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
}

.history-back {
    margin-bottom: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8390a0;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.history-back:hover {
    color: #ffffff;
}

.history-eyebrow {
    display: block;
    color: #9b6cff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1.6px;
}

.history-heading h1 {
    margin: 8px 0 0;
    color: #ffffff;
    font-size: clamp(44px, 5vw, 66px);
    line-height: 1;
    letter-spacing: -2px;
}

.history-heading p {
    margin: 10px 0 0;
    color: #7e8b9b;
    font-size: 16px;
}

.history-tools {
    margin-top: 34px;
    padding: 15px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 15px;
    background: #101720;
    border: 1px solid #26313f;
    border-radius: 14px;
}

.history-search {
    position: relative;
    min-width: 0;
}

.history-search>i {
    position: absolute;
    top: 50%;
    left: 17px;
    transform: translateY(-50%);
    color: #718092;
    font-size: 15px;
    pointer-events: none;
}

.history-search input {
    width: 100%;
    height: 52px;
    padding: 0 50px 0 46px;
    outline: 0;
    background: #0a1016;
    border: 1px solid #293542;
    border-radius: 9px;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
}

.history-search input::placeholder {
    color: #687586;
}

.history-search input:focus {
    border-color: #8b5cf6;
}

.history-search button {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #7b8898;
    cursor: pointer;
}

.history-search button.visible {
    display: flex;
}

.history-search button:hover {
    background: #17202a;
    color: #ffffff;
}

.history-filters {
    display: flex;
    align-items: center;
    gap: 9px;
}

.history-filter {
    display: flex;
    align-items: center;
    gap: 9px;
}

.history-filter label {
    color: #7d8a9a;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.history-filter select {
    height: 52px;
    padding: 0 38px 0 14px;
    outline: 0;
    background: #0a1016;
    border: 1px solid #293542;
    border-radius: 9px;
    color: #ffffff;
    color-scheme: dark;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.history-direction {
    height: 52px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0a1016;
    border: 1px solid #293542;
    border-radius: 9px;
    color: #929eac;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.history-direction:hover {
    border-color: #8b5cf6;
    color: #ffffff;
}

.history-result-line {
    min-height: 49px;
    display: flex;
    align-items: center;
}

.history-result-line span {
    color: #788596;
    font-size: 13px;
    font-weight: 700;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.history-card {
    min-width: 0;
    overflow: hidden;
    background: #101720;
    border: 1px solid #26313f;
    border-radius: 13px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.history-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.2);
}

.history-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #080d12;
}

.history-card-image>img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #080d12;
    transition: transform 0.3s ease;
}

.history-card:hover .history-card-image>img {
    transform: none;
}

.history-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #505d6c;
    font-size: 32px;
}

.history-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( to top, rgba(8, 13, 18, 0.95), rgba(8, 13, 18, 0.05) 65%);
}

.history-card-id {
    position: absolute;
    z-index: 2;
    top: 9px;
    left: 9px;
    padding: 5px 7px;
    background: rgba(7, 11, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 5px;
    color: #c7ced7;
    font-size: 10px;
    font-weight: 900;
    backdrop-filter: blur(5px);
}

.history-multiverse {
    position: absolute;
    z-index: 2;
    top: 9px;
    right: 9px;
    padding: 5px 7px;
    background: rgba(139, 92, 246, 0.87);
    border-radius: 5px;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
}

.history-multiverse i {
    margin-right: 3px;
}

.history-card-main {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.history-card-main strong {
    color: #ffffff;
    font-size: 29px;
}

.history-card-main span {
    color: #a4aebb;
    font-size: 10px;
}

.history-card-content {
    padding: 16px;
}

.history-card-content h2 {
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 19px;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-card-date {
    margin-top: 7px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: #8390a0;
    font-size: 11px;
}

.history-card-date i {
    color: #9b6cff;
}

.history-card-date span {
    color: #4f5b69;
}

.history-card-series {
    min-height: 31px;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.history-card-series span {
    max-width: 100%;
    padding: 4px 6px;
    overflow: hidden;
    background: #0b1219;
    border: 1px solid #27323f;
    border-radius: 5px;
    color: #8b97a6;
    font-size: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-card-stats {
    margin-top: 14px;
    padding-top: 13px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    border-top: 1px solid #27313d;
}

.history-card-stats>div {
    min-width: 0;
}

.history-card-stats i {
    display: block;
    margin-bottom: 5px;
    color: #9b6cff;
    font-size: 11px;
}

.history-card-stats span {
    display: block;
    color: #697687;
    font-size: 8px;
    text-transform: uppercase;
}

.history-card-stats strong {
    margin-top: 3px;
    display: block;
    overflow: hidden;
    color: #dce1e7;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-loading,
.history-end,
.history-empty {
    display: none;
}

.history-loading.visible {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #8c99a8;
    font-size: 13px;
}

.history-loading i {
    color: #9b6cff;
}

.history-end.visible {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #687687;
    font-size: 12px;
}

.history-end i {
    color: #4bc77b;
}

.history-empty.visible {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.history-empty>i {
    color: #8b5cf6;
    font-size: 30px;
}

.history-empty strong {
    color: #ffffff;
    font-size: 20px;
}

.history-empty span {
    color: #788596;
    font-size: 13px;
}

@media (min-width: 2400px) {
    .history-grid {
        grid-template-columns: repeat( auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 900px) {
    .history-tools {
        grid-template-columns: 1fr;
    }
    .history-filters {
        justify-content: flex-end;
    }
}

@media (max-width: 650px) {
    .binge-history-container {
        width: calc(100% - 24px);
        padding: 32px 0 60px;
    }
    .history-heading h1 {
        font-size: 41px;
    }
    .history-tools {
        padding: 11px;
    }
    .history-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .history-filter select,
    .history-direction {
        width: 100%;
    }
    .history-grid {
        grid-template-columns: repeat( auto-fill, minmax(min(100%, 260px), 1fr));
        gap: 12px;
    }
}

@media (max-width: 450px) {
    .history-filters {
        grid-template-columns: 1fr;
    }
    .history-grid {
        grid-template-columns: 1fr;
    }
}