/* Compact anime details card shown below the main content. */
body.anime-detail-page .anime-extra-grid > .anime-theme-panel {
    width: min(100%, 350px);
    max-width: 350px;
    justify-self: start;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.anime-detail-page .anime-detail-card > .anime-theme-panel {
    width: 100%;
    max-width: none;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.anime-detail-page .theme-details-card {
    min-height: 0;
    width: 100%;
    padding: 18px 16px;
    overflow: hidden;
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(12, 13, 16, .88);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

body.anime-detail-page .theme-details-head { display: none; }

body.anime-detail-page .theme-details-card .theme-info-grid {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

body.anime-detail-page .theme-primary-facts {
    display: grid;
    gap: 14px;
}

body.anime-detail-page .theme-stack-item {
    display: grid;
    gap: 4px;
}

body.anime-detail-page .theme-stack-item span,
body.anime-detail-page .theme-card-section h3 {
    margin: 0;
    color: rgba(255, 255, 255, .43);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

body.anime-detail-page .theme-stack-item strong {
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    line-height: 1.35;
}

body.anime-detail-page .theme-card-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .065);
}

body.anime-detail-page .theme-card-section h3 { margin-bottom: 10px; }

body.anime-detail-page .theme-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

body.anime-detail-page .theme-tag-list a {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 999px;
    color: rgba(255, 255, 255, .7);
    background: rgba(255, 255, 255, .055);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

body.anime-detail-page .theme-tag-list a:hover,
body.anime-detail-page .theme-tag-list a:focus-visible {
    color: #fff;
    background: rgba(var(--anime-accent-rgb), .13);
    border-color: rgba(var(--anime-accent-rgb), .28);
}

body.anime-detail-page .theme-alt-list,
body.anime-detail-page .theme-compact-details {
    display: grid;
    gap: 8px;
}

body.anime-detail-page .theme-alt-title {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: rgba(255, 255, 255, .6);
    font-size: 11px;
    line-height: 1.45;
}

body.anime-detail-page .theme-alt-title span {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, .38);
    font-weight: 900;
}

body.anime-detail-page .theme-alt-title strong {
    min-width: 0;
    color: rgba(255, 255, 255, .66);
    font-weight: 650;
    overflow-wrap: anywhere;
}

body.anime-detail-page .theme-empty-copy {
    margin: 0;
    color: rgba(255, 255, 255, .42);
    font-size: 11px;
}

@media (max-width: 640px) {
    body.anime-detail-page .anime-extra-grid > .anime-theme-panel {
        width: 100%;
        max-width: none;
    }

    body.anime-detail-page .theme-details-card { padding: 17px 15px; }
}

/* Desktop: details remain under the poster while episodes start beside them. */
@media (min-width: 901px) {
    body.anime-detail-page .anime-extra-grid {
        width: calc(100% - 80px);
        max-width: none;
        grid-template-columns: 220px minmax(0, 1fr);
        column-gap: clamp(72px, 5vw, 96px);
        row-gap: 44px;
        align-items: start;
    }

    body.anime-detail-page .anime-extra-grid > .anime-theme-panel {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: none;
    }

    body.anime-detail-page .anime-extra-grid > .anime-comments-panel {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    body.anime-detail-page .anime-extra-grid > .anime-seasons-panel {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
    }
}

@media (max-width: 900px) {
    body.anime-detail-page .anime-extra-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.anime-detail-page .anime-extra-grid > .anime-theme-panel { order: 1; }
    body.anime-detail-page .anime-extra-grid > .anime-comments-panel { order: 2; }
    body.anime-detail-page .anime-extra-grid > .anime-seasons-panel { order: 3; }
}

/* Keep the poster clean: no light outline, only depth from its shadow. */
body.anime-detail-page .anime-poster {
    border: 0;
    outline: 0;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .44);
}

body.anime-detail-page .anime-poster-actions .anime-side-watch img {
    display: block;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0);
}

body.anime-detail-page .anime-poster-actions .anime-side-watch.is-waiting {
    color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .075);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

body.anime-detail-page .anime-poster-actions .anime-side-watch.is-waiting img {
    display: none;
}

body.anime-detail-page .anime-poster-actions .anime-side-watch.is-waiting:hover,
body.anime-detail-page .anime-poster-actions .anime-side-watch.is-waiting:focus-visible {
    color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .075);
    box-shadow: none;
    filter: none;
}
