/* ===== SHARED ACTIVITY ENGINE · RUN 4 ===== */

body.activity-mode .top-bar,
body.activity-mode .bottom-nav {
    display: none;
}

body.activity-mode .app-main {
    padding-top: var(--safe-top);
    padding-bottom: calc(var(--safe-bottom) + 24px);
}

.activity-page {
    min-height: calc(100dvh - var(--safe-top));
}

.activity-shell {
    width: min(100%, 720px);
    margin: 0 auto;
}

.activity-header {
    position: sticky;
    z-index: 45;
    top: 0;

    min-height: 70px;
    padding: 10px 18px 9px;

    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;

    background: rgba(10, 13, 19, .92);
    border-bottom: 1px solid rgba(255, 255, 255, .04);

    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.activity-back {
    width: 40px;
    height: 40px;
    padding: 0;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
    color: var(--text);
}

.activity-back:active {
    transform: scale(.96);
}

.activity-back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.activity-heading {
    min-width: 0;
}

.activity-heading .eyebrow {
    margin-bottom: 4px;
}

.activity-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    line-height: 1.05;
    font-weight: 760;
    letter-spacing: -.55px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-header-space {
    width: 40px;
    height: 40px;
}

.activity-selector {
    position: sticky;
    z-index: 40;
    top: 70px;

    display: flex;
    gap: 7px;

    padding: 9px 18px 10px;
    overflow-x: auto;

    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;

    background: rgba(10, 13, 19, .91);
    border-bottom: 1px solid rgba(255, 255, 255, .035);

    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.activity-selector::-webkit-scrollbar {
    display: none;
}

.activity-selector button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;

    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 999px;
    background: rgba(255, 255, 255, .025);
    color: var(--muted);

    font-size: 11px;
    font-weight: 680;
    white-space: nowrap;
}

.activity-selector button[aria-selected="true"] {
    border-color: rgba(252, 153, 0, .40);
    background: rgba(252, 153, 0, .12);
    color: var(--accent);
}

.activity-selector button:active {
    transform: scale(.97);
}

.activity-grid {
    padding: 18px 18px 8px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 10px;
}

.activity-card {
    min-width: 0;
}

.activity-grid .normal-card.recently-viewed .normal-cover {
    border-color: rgba(252, 153, 0, .68);
    box-shadow:
        0 0 0 1px rgba(252, 153, 0, .18),
        0 8px 24px rgba(252, 153, 0, .05);
}

.activity-skeleton-card {
    min-width: 0;
}

.activity-skeleton-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
}

.activity-skeleton-line {
    height: 9px;
    margin: 8px 2px 0;
    border-radius: 999px;
}

.activity-skeleton-line.short {
    width: 62%;
    margin-top: 6px;
}

.activity-state {
    margin: 24px 18px 0;
    padding: 24px 18px;

    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 16px;
    background: rgba(255, 255, 255, .018);

    text-align: center;
}

.activity-state strong,
.activity-state span {
    display: block;
}

.activity-state strong {
    color: var(--text);
    font-size: 13px;
}

.activity-state span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.activity-retry {
    margin-top: 14px;
    min-height: 36px;
    padding: 0 15px;

    border: 1px solid rgba(252, 153, 0, .26);
    border-radius: 999px;
    background: rgba(252, 153, 0, .10);
    color: var(--accent);

    font-size: 11px;
    font-weight: 700;
}

.trending-activity-card {
    margin-top: 9px;
}

@media (max-width: 390px) {
    .activity-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .activity-selector,
    .activity-grid {
        padding-left: 14px;
        padding-right: 14px;
    }

    .activity-grid {
        gap: 16px 9px;
    }
}

/* ===== EXPLORE ACTIVITY ===== */
.activity-grid.is-explore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
}

.explore-activity-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 15px;
    background: rgba(255,255,255,.018);
    color: var(--text);
}

.activity-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0a0d13;
}

.activity-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.activity-explore-caption {
    margin: 0;
    padding: 9px 10px 11px;
    min-height: 48px;
    color: rgba(255,255,255,.86);
    font-size: 11px;
    line-height: 1.42;
    font-weight: 620;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.explore-activity-card.recently-viewed .activity-cover {
    box-shadow: inset 0 0 0 1px rgba(252,153,0,.55);
}


/* Explore Activity has no VIP/category selector */
.activity-selector[hidden] {
    display: none !important;
}
