.serie-page {
    width: 100%;
}

.serie-container {
    width: min(calc(100% - 48px), 1800px);
    margin: 0 auto;
    padding: 28px 0 30px;
}

.serie-topbar {
    min-height: 48px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.serie-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8793a3;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.serie-back:hover {
    color: #a78bfa;
}

.cycle-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cycle-selector {
    height: 40px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    background: #101720;
    border: 1px solid #263140;
    border-radius: 8px;
    color: #788596;
}

.cycle-selector select {
    height: 38px;
    min-width: 145px;
    padding: 0 30px 0 9px;
    outline: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: #dce2e9;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.cycle-selector i {
    font-size: 12px;
}

.btn-new-cycle {
    height: 40px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    background: #101720;
    border: 1px solid #263140;
    border-radius: 8px;
    color: #8d99a8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-new-cycle:hover {
    color: #ffffff;
    border-color: #8b5cf6;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 18px;
}

.serie-hero {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    background: #0e141b;
    border: 1px solid #222c38;
    border-radius: 14px;
}

.serie-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.serie-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( 90deg, rgba(8, 12, 17, 0.98) 0%, rgba(8, 12, 17, 0.94) 45%, rgba(8, 12, 17, 0.55) 78%, rgba(8, 12, 17, 0.35) 100%), linear-gradient( 0deg, rgba(8, 12, 17, 0.75), transparent 55%);
}

.serie-hero-content {
    position: relative;
    z-index: 1;
    min-height: 400px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.serie-poster {
    width: 205px;
    aspect-ratio: 2 / 3;
    flex-shrink: 0;
    overflow: hidden;
    background: #151d26;
    border: 1px solid #313c4b;
    border-radius: 11px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.serie-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.serie-main-info {
    width: min(100%, 720px);
    min-width: 0;
}

.serie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.serie-tags span {
    padding: 6px 10px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 999px;
    color: #b9a4fb;
    font-size: 12px;
    font-weight: 700;
}

.serie-main-info h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(44px, 4vw, 64px);
    line-height: 1;
    letter-spacing: -2px;
}

.serie-creator {
    margin: 12px 0 0;
    color: #9aa5b4;
    font-size: 15px;
}

.serie-platforms {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.serie-platforms a {
    min-height: 38px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 23, 32, 0.85);
    border: 1px solid #2a3544;
    border-radius: 8px;
    color: #aab4c1;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.serie-platforms img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.hero-progress-row {
    margin-top: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.hero-progress-row>div {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.hero-progress-row strong {
    color: #f5f7fa;
    font-size: 18px;
}

.hero-progress-row span {
    color: #8995a4;
    font-size: 13px;
}

.hero-percent {
    color: #a78bfa !important;
}

.hero-progress {
    height: 7px;
    margin-top: 9px;
    overflow: hidden;
    background: #252e3a;
    border-radius: 999px;
}

.hero-progress span {
    height: 100%;
    display: block;
    background: #8b5cf6;
    border-radius: inherit;
}

.next-panel,
.info-panel {
    background: #101720;
    border: 1px solid #222c38;
    border-radius: 14px;
}

.next-panel {
    min-height: 400px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section-label {
    display: block;
    color: #9b6cff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.next-panel h2 {
    width: 100%;
    margin: 12px 0 4px;
    color: #ffffff;
    font-size: 30px;
}

.next-title {
    width: 100%;
    color: #d9dee5;
    font-size: 16px;
}

.next-meta {
    width: 100%;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.next-meta span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #8692a1;
    font-size: 13px;
}

.next-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 20px;
    display: block;
    object-fit: cover;
    border-radius: 9px;
}

.btn-watch-next {
    width: 100%;
    min-height: 46px;
    margin-top: 30px;
    padding: 0 14px;
    background: #8b5cf6;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-watch-next:hover {
    background: #7c4ff0;
}

.next-paused {
    width: 100%;
    margin-top: 30px;
    padding: 13px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    color: #f0b94e;
    font-size: 13px;
    text-align: center;
}

.cycle-finished {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.cycle-finished>i {
    margin-bottom: 18px;
    color: #3ddc84;
    font-size: 42px;
}

.cycle-finished h2 {
    margin-top: 8px;
}

.info-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1.15fr 0.8fr 1.15fr;
    gap: 18px;
}

.info-panel {
    padding: 22px;
}

.panel-heading {
    margin-bottom: 17px;
}

.panel-heading h2 {
    margin: 6px 0 0;
    color: #f5f7fa;
    font-size: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat-card {
    min-width: 0;
    min-height: 105px;
    padding: 15px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    background: #0c1219;
    border: 1px solid #202a36;
    border-radius: 9px;
}

.stat-card i {
    margin-bottom: 10px;
    color: #8b5cf6;
    font-size: 16px;
}

.stat-card strong {
    color: #f5f7fa;
    font-size: 16px;
}

.stat-card span {
    margin-top: 4px;
    color: #778393;
    font-size: 11px;
}

.pause-panel p,
.synopsis-panel>p {
    color: #8c98a8;
    font-size: 14px;
    line-height: 1.7;
}

.pause-panel p {
    margin: 0 0 16px;
}

.pause-panel p strong {
    color: #d9dee5;
}

.pause-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pause-form input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    outline: 0;
    background: #0b1117;
    border: 1px solid #293543;
    border-radius: 8px;
    color: #ffffff;
    color-scheme: dark;
    font-family: inherit;
    font-size: 13px;
}

.pause-form input:focus {
    border-color: #8b5cf6;
}

.btn-pause,
.btn-resume {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.btn-pause {
    background: #2b202d;
    color: #eba1ff;
}

.btn-resume {
    background: #123322;
    color: #71dda2;
}

.btn-pause:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.synopsis-panel>p {
    margin: 0;
}

.content-section {
    margin-top: 42px;
}

.content-heading {
    margin-bottom: 16px;
}

.content-heading h2 {
    margin: 6px 0 0;
    color: #f8fafc;
    font-size: 26px;
}

.serie-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.serie-badge {
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #101720;
    border: 1px solid #2a3442;
    border-radius: 999px;
    color: #dce1e7;
    font-size: 13px;
}

.serie-badge small {
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.badge-rare {
    border-color: #21b784;
}

.badge-epique {
    border-color: #3b82f6;
}

.badge-legendaire {
    border-color: #8b5cf6;
}

.badge-mythique {
    border-color: #f97346;
}

.badge-unique {
    border-color: #ef4444;
}

.actors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.actor-card {
    padding: 10px;
    background: #101720;
    border: 1px solid #222c38;
    border-radius: 10px;
}

.actor-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #171f29;
    border-radius: 8px;
}

.actor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.actor-photo i {
    color: #637081;
    font-size: 28px;
}

.actor-card strong {
    display: block;
    overflow: hidden;
    color: #f0f3f7;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.actor-card span {
    display: block;
    margin-top: 4px;
    color: #748091;
    font-size: 11px;
}

.seasons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.season-card {
    overflow: hidden;
    background: #101720;
    border: 1px solid #222c38;
    border-radius: 12px;
}

.season-card summary {
    list-style: none;
    cursor: pointer;
}

.season-card summary::-webkit-details-marker {
    display: none;
}

.season-summary {
    min-height: 88px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.season-poster {
    width: 48px;
    align-self: stretch;
    flex-shrink: 0;
    overflow: hidden;
    background: #171f29;
    border-radius: 6px;
}

.season-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.season-info {
    min-width: 160px;
    display: flex;
    flex-direction: column;
}

.season-info strong {
    color: #f5f7fa;
    font-size: 17px;
}

.season-info span {
    margin-top: 5px;
    color: #7b8797;
    font-size: 12px;
}

.season-progress-area {
    max-width: 400px;
    margin-left: auto;
    flex: 1;
}

.season-progress-area>strong {
    display: block;
    margin-bottom: 6px;
    color: #a78bfa;
    font-size: 12px;
    text-align: right;
}

.season-progress {
    height: 5px;
    overflow: hidden;
    background: #242e3a;
    border-radius: 999px;
}

.season-progress span {
    height: 100%;
    display: block;
    background: #8b5cf6;
    border-radius: inherit;
}

.season-chevron {
    margin-left: 10px;
    color: #748091;
    font-size: 13px;
    transition: transform 0.2s ease;
}

.season-card[open] .season-chevron {
    transform: rotate(180deg);
}

.season-body {
    padding: 0 16px 16px;
}

.season-synopsis {
    margin: 0 0 14px;
    padding: 14px;
    background: #0c1219;
    border-radius: 8px;
    color: #8995a5;
    font-size: 13px;
    line-height: 1.7;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
    gap: 10px;
}

.episode-card {
    min-width: 0;
    min-height: 112px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: #0c1219;
    border: 1px solid #202a36;
    border-radius: 9px;
}

.episode-seen {
    background: #0d1519;
}

.episode-number {
    width: 58px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-right: 1px solid #222d39;
}

.episode-number span {
    color: #6e7a8a;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
}

.episode-number strong {
    margin-top: 3px;
    color: #a78bfa;
    font-size: 22px;
}

.episode-image {
    width: 150px;
    flex-shrink: 0;
    overflow: hidden;
}

.episode-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.episode-content {
    min-width: 0;
    padding: 14px;
    flex: 1;
}

.episode-title {
    display: block;
    overflow: hidden;
    color: #f2f5f8;
    font-size: 15px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.episode-meta {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.episode-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7c8898;
    font-size: 11px;
}

.watch-history {
    width: fit-content;
    margin-top: 10px;
    padding: 6px 9px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    color: #66cf93;
    font-size: 11px;
}

.watch-history i {
    margin-right: 4px;
}

.watch-history strong {
    color: #85e1aa;
}

.episode-actions {
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.status-seen,
.status-unseen {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.status-seen {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.status-unseen {
    background: rgba(139, 92, 246, 0.12);
    color: #aa88ff;
}

.btn-edit-watch {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #17202a;
    border: 1px solid #2d3948;
    border-radius: 8px;
    color: #8d99a8;
    cursor: pointer;
}

.btn-edit-watch:hover {
    color: #ffffff;
    border-color: #8b5cf6;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 9, 0.82);
    backdrop-filter: blur(6px);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    padding: 26px;
    background: #111820;
    border: 1px solid #2b3644;
    border-radius: 13px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.modal-dialog h2 {
    margin: 8px 0 20px;
    color: #ffffff;
    font-size: 24px;
}

.edit-watch-subtitle {
    margin: -12px 0 20px;
    color: #8793a2;
    font-size: 13px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 7px;
    background: #19212b;
    color: #818d9c;
    cursor: pointer;
}

.modal-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-fields label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.modal-fields label span {
    color: #8c98a7;
    font-size: 12px;
    font-weight: 700;
}

.modal-fields input {
    width: 100%;
    height: 43px;
    padding: 0 11px;
    outline: 0;
    background: #0b1117;
    border: 1px solid #293543;
    border-radius: 8px;
    color: #ffffff;
    color-scheme: dark;
    font-family: inherit;
    font-size: 13px;
}

.modal-fields input:focus {
    border-color: #8b5cf6;
}

.modal-actions {
    margin-top: 18px;
    display: flex;
    gap: 9px;
}

.btn-now,
.btn-confirm,
.btn-save,
.btn-delete-watch {
    min-height: 43px;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.btn-now {
    padding: 0 14px;
    background: #1a232d;
    color: #a1acb9;
}

.btn-confirm {
    padding: 0 18px;
    flex: 1;
    background: #8b5cf6;
    color: #ffffff;
}

.btn-save {
    width: 100%;
    margin-top: 18px;
    background: #8b5cf6;
    color: #ffffff;
}

.btn-delete-watch {
    width: 100%;
    margin-top: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #f87171;
}

.btn-delete-watch:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-now:disabled,
.btn-confirm:disabled,
.btn-save:disabled,
.btn-delete-watch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-message {
    display: none;
    margin-top: 13px;
    padding: 11px 12px;
    border-radius: 7px;
    font-size: 12px;
}

.modal-message.success,
.modal-message.error {
    display: block;
}

.modal-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.modal-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.modal-open {
    overflow: hidden;
}

@media (max-width: 1250px) {
    .hero-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
    .info-layout {
        grid-template-columns: 1fr 1fr;
    }
    .synopsis-panel {
        grid-column: 1 / -1;
    }
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 950px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }
    .next-panel {
        min-height: 0;
    }
    .next-image {
        max-width: 500px;
    }
    .btn-watch-next {
        margin-top: 22px;
    }
    .serie-hero-content {
        min-height: 360px;
    }
    .info-layout {
        grid-template-columns: 1fr;
    }
    .synopsis-panel {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .serie-container {
        width: calc(100% - 26px);
        padding-top: 18px;
    }
    .serie-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .cycle-bar {
        width: 100%;
    }
    .cycle-selector {
        flex: 1;
    }
    .cycle-selector select {
        width: 100%;
    }
    .serie-hero-content {
        min-height: 0;
        padding: 180px 18px 22px;
        align-items: flex-end;
    }
    .serie-hero-overlay {
        background: linear-gradient( 0deg, rgba(8, 12, 17, 0.99) 0%, rgba(8, 12, 17, 0.94) 60%, rgba(8, 12, 17, 0.28) 100%);
    }
    .serie-poster {
        width: 125px;
    }
    .serie-main-info h1 {
        font-size: 38px;
    }
    .serie-platforms a span {
        display: none;
    }
    .serie-platforms a {
        width: 38px;
        padding: 6px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .season-progress-area {
        display: none;
    }
    .episodes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .cycle-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .btn-new-cycle {
        width: 100%;
        justify-content: center;
    }
    .serie-hero-content {
        padding: 155px 15px 18px;
        align-items: flex-start;
        flex-direction: column;
    }
    .serie-poster {
        width: 105px;
    }
    .serie-main-info {
        width: 100%;
    }
    .serie-main-info h1 {
        font-size: 34px;
        letter-spacing: -1px;
    }
    .hero-progress-row {
        margin-top: 24px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .modal-fields {
        grid-template-columns: 1fr;
    }
    .modal-actions {
        flex-direction: column;
    }
    .btn-now,
    .btn-confirm {
        width: 100%;
    }
    .season-poster {
        display: none;
    }
    .season-info {
        min-width: 0;
        flex: 1;
    }
    .episode-card {
        min-height: 100px;
    }
    .episode-number {
        width: 48px;
    }
    .episode-number strong {
        font-size: 19px;
    }
    .episode-image {
        width: 95px;
    }
    .episode-content {
        padding: 11px;
    }
    .episode-title {
        font-size: 13px;
    }
    .episode-meta {
        gap: 7px;
    }
    .episode-meta span {
        font-size: 9px;
    }
    .watch-history {
        font-size: 9px;
    }
    .episode-actions {
        padding: 0 8px;
        flex-direction: column;
        justify-content: center;
    }
    .status-seen,
    .status-unseen {
        padding: 5px 7px;
        font-size: 8px;
    }
    .btn-edit-watch {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 400px) {
    .episode-image {
        display: none;
    }
    .stat-card {
        min-height: 95px;
        padding: 12px;
    }
    .stat-card strong {
        font-size: 14px;
    }
}