/* Countdown pages — shared by listing and individual show pages */

body.countdown-page {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

/* ─── Page header ─── */

.countdown-page .page-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    position: relative;
    z-index: 2;
}

.countdown-page .back-link {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent-tertiary) !important;
    opacity: 0.7;
    margin-bottom: 0.75rem;
    transition: opacity 0.3s ease;
    text-shadow: none !important;
}

.countdown-page .back-link:hover {
    opacity: 1;
    color: var(--accent-primary) !important;
}

.countdown-page .page-header h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #a09eff 0%, #ff8ecf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-page .page-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 0.4rem;
}

/* ─── Listing grid ─── */

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    position: relative;
    z-index: 2;
}

/* ─── Card ─── */

.countdown-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, rgba(191, 170, 255, 0.06) 0%, rgba(255, 142, 207, 0.06) 100%);
    border: 1px solid rgba(255, 142, 207, 0.15);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    text-decoration: none !important;
    color: inherit !important;
}

.countdown-card:hover {
    border-color: rgba(255, 142, 207, 0.45);
    background: linear-gradient(160deg, rgba(191, 170, 255, 0.12) 0%, rgba(255, 142, 207, 0.12) 100%);
    transform: translateY(-3px);
    box-shadow:
        0 8px 32px rgba(255, 142, 207, 0.1),
        0 0 0 1px rgba(255, 142, 207, 0.08);
}

.card-cover-wrap {
    position: relative;
    overflow: hidden;
}

.card-cover {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.countdown-card:hover .card-cover {
    transform: scale(1.04);
}

.card-cover-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
}

.card-episode-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(24, 24, 37, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(191, 170, 255, 0.25);
    border-radius: 50px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}

.card-body {
    padding: 0.75rem 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-title-romaji {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.card-genre {
    font-size: 0.6rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.card-score {
    font-size: 0.68rem;
    color: var(--accent-primary);
    margin-left: auto;
    white-space: nowrap;
    font-weight: 600;
}

/* ─── Timer (shared between listing cards and detail page) ─── */

.timer {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.timer-segment {
    background: rgba(191, 170, 255, 0.06);
    border: 1px solid rgba(191, 170, 255, 0.12);
    border-radius: 8px;
    padding: 0.3rem 0.4rem;
    text-align: center;
    min-width: 44px;
    flex: 1;
}

.timer-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.timer-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    opacity: 0.45;
    font-weight: 500;
}

.timer-aired {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    text-align: center;
    padding: 0.6rem 0;
    opacity: 0.6;
}

/* ─── Show detail page ─── */

.show-detail {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    position: relative;
    z-index: 2;
}

.show-banner-wrap {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 14px;
    overflow: hidden;
}

.show-banner {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.show-banner-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
}

.show-header {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.show-cover {
    width: 120px;
    min-width: 120px;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.show-info {
    flex: 1;
    min-width: 0;
}

.show-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.show-title-romaji {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.4;
    margin-bottom: 0.65rem;
    font-weight: 400;
}

.show-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.show-tag {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--accent-tertiary);
    background: rgba(191, 170, 255, 0.08);
    border: 1px solid rgba(191, 170, 255, 0.18);
    border-radius: 50px;
    padding: 0.2rem 0.55rem;
}

/* Large timer for detail page */
.show-detail .timer {
    margin: 1.5rem 0;
}

.show-detail .timer-segment {
    padding: 0.7rem 0.5rem;
    min-width: 68px;
    background: rgba(191, 170, 255, 0.08);
    border-color: rgba(191, 170, 255, 0.15);
}

.show-detail .timer-value {
    font-size: 2rem;
}

.show-detail .timer-label {
    font-size: 0.6rem;
}

.show-episode-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.show-links {
    text-align: center;
    margin-top: 1rem;
}

.show-anilist-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(191, 170, 255, 0.1) 0%, rgba(255, 142, 207, 0.1) 100%);
    border: 1px solid rgba(255, 142, 207, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    text-shadow: none !important;
}

.show-anilist-link:hover {
    background: linear-gradient(135deg, rgba(191, 170, 255, 0.2) 0%, rgba(255, 142, 207, 0.2) 100%);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 142, 207, 0.12);
}

/* ─── Footer ─── */

.countdown-page .footer {
    position: relative;
    padding: 2rem;
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
    .countdown-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1rem;
        padding: 0 1rem 3rem;
    }

    .countdown-page .page-header h2 {
        font-size: 1.6rem;
    }

    .show-detail .timer-value {
        font-size: 1.5rem;
    }

    .show-detail .timer-segment {
        min-width: 56px;
    }
}

@media (max-width: 480px) {
    .countdown-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem 3rem;
    }

    .card-cover {
        height: 120px;
    }

    .show-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .show-cover {
        width: 100px;
        min-width: 100px;
    }

    .show-tags {
        justify-content: center;
    }

    .show-banner {
        height: 150px;
    }

    .show-detail .timer-value {
        font-size: 1.2rem;
    }

    .show-detail .timer-segment {
        min-width: 46px;
        padding: 0.5rem 0.3rem;
    }

    .show-title {
        font-size: 1.25rem;
    }
}
