.app-shell {
    transition: opacity 0.18s ease;
}

body[data-app-ready="false"] .app-shell {
    visibility: hidden;
    opacity: 0;
}

body[data-app-ready="true"] .app-shell {
    visibility: visible;
    opacity: 1;
}

.app-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 12000;
    overflow: hidden auto;
    background: var(--gradient-hero);
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

body[data-app-ready="true"] .app-loading-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-block {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(19, 38, 54, 0.72);
    border: 1px solid rgba(110, 154, 186, 0.14);
}

.skeleton-block::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: trendingSkeletonPulse 1.35s ease-in-out infinite;
}

.trending-skeleton-header {
    padding: 30px 0 16px;
    display: grid;
    gap: 18px;
}

.skeleton-logo {
    width: 240px;
    height: 26px;
}

.trending-skeleton-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skeleton-pill {
    width: 140px;
    height: 40px;
}

.trending-skeleton-content {
    display: grid;
    gap: 16px;
    padding-top: 30px;
}

.skeleton-title {
    width: min(540px, 86vw);
    height: 52px;
}

.skeleton-subtitle {
    width: min(640px, 92vw);
    height: 18px;
}

.skeleton-tabs {
    margin-top: 6px;
    width: min(540px, 92vw);
    height: 64px;
    border-radius: 999px;
}

.skeleton-grid {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.skeleton-card {
    height: 240px;
    border-radius: 24px;
}

.page-header {
    padding: 54px 0 24px;
    text-align: center;
}

.page-header-topline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.page-title {
    font-size: clamp(2.3rem, 6vw, 4rem);
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 14px;
}

.page-subtitle {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-dim);
    font-size: 1.05rem;
}

.page-language-slot .language-dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.tabs-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.hot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.hot-column {
    padding: 28px;
    border-radius: 24px;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
}

.rank-list {
    list-style: none;
}

.rank-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(110, 154, 186, 0.1);
}

.rank-item:last-child {
    border-bottom: 0;
}

.rank-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-weight: 800;
}

.rank-item:nth-child(1) .rank-number {
    background: rgba(34, 199, 168, 0.16);
    color: var(--primary);
}

.rank-item:nth-child(2) .rank-number,
.rank-item:nth-child(3) .rank-number {
    background: rgba(77, 163, 255, 0.14);
    color: var(--secondary);
}

.rank-symbol {
    font-weight: 800;
    color: var(--text);
    font-size: 1.05rem;
}

.rank-count {
    color: var(--text-dim);
    font-size: 0.86rem;
}

.date-selector-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.date-select {
    min-width: 260px;
    padding: 12px 42px 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(7, 17, 26, 0.82);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23A9B8C7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.rec-card {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    overflow: hidden;
}

.badge {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-top {
    background: rgba(34, 199, 168, 0.14);
    color: var(--primary);
}

.badge-watch {
    background: rgba(77, 163, 255, 0.14);
    color: var(--secondary);
}

.rec-symbol {
    display: block;
    padding-right: 96px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.rec-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-item {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(7, 17, 26, 0.56);
    border: 1px solid rgba(110, 154, 186, 0.12);
}

.stat-label {
    color: var(--text-faint);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-val {
    font-weight: 800;
    color: var(--text);
}

.upside {
    color: var(--success);
}

.rec-reason {
    color: var(--text-dim);
    padding-top: 16px;
    border-top: 1px solid rgba(110, 154, 186, 0.1);
}

@media (max-width: 900px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }

    .hot-grid,
    .rec-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .trending-skeleton-header {
        padding-top: 24px;
    }

    .skeleton-logo {
        width: min(250px, 68vw);
    }

    .skeleton-pill {
        width: min(140px, 30vw);
    }

    .skeleton-title {
        height: 44px;
    }

    .skeleton-tabs {
        height: 58px;
    }

    .skeleton-card {
        height: 210px;
    }

    header {
        display: flex;
        grid-template-columns: none;
        grid-template-areas: none;
        flex-direction: column;
        align-items: stretch;
        row-gap: 10px;
        column-gap: 0;
        padding-bottom: 8px;
    }

    #nav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 0;
        border: 0;
        background: transparent;
        border-radius: 0;
    }

    #nav-links a {
        padding: 8px 12px;
    }

    .tabs {
        width: 100%;
        justify-content: center;
    }

    .page-header {
        padding-top: 36px;
    }

    .page-header-topline {
        justify-content: space-between;
        text-align: left;
    }

    .page-title {
        margin-bottom: 0;
    }

    .tab-btn {
        flex: 1;
        padding-inline: 12px;
    }

    .date-select {
        width: 100%;
        min-width: 0;
    }

    .rec-stats {
        grid-template-columns: 1fr;
    }
}

@keyframes trendingSkeletonPulse {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}
