/* =========================================================
   TIENHUB — MINI GAME PAGE
   Bám theo giao diện trang chủ TienHub
========================================================= */

.mini-page {
    min-height: calc(100vh - var(--nav-height));
}

.mini-hero-wrap {
    width: min(100%, var(--content));
    margin: 0 auto;
    padding: 12px 18px 0;
}

.mini-hero {
    position: relative;
    width: 100%;
    height: 250px;

    overflow: hidden;

    border: 1px solid rgba(24, 188, 239, .38);
    border-radius: 18px;

    background: #081c2b;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .18);

    isolation: isolate;
}

.mini-hero img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    /*
     * The WEBP itself contains the cat-only animation.
     * The room, text, monitor and background remain static.
     */
    transform: none !important;
    animation: none !important;

    will-change: auto;
}

.mini-catalog-section {
    margin-top: 14px;
    padding-bottom: 32px;
}

.mini-catalog-heading {
    margin-bottom: 14px;
}

.mini-catalog-heading .section-title-group {
    gap: 13px;
}

.mini-catalog-heading h2 {
    margin: 0;
}

.mini-catalog-subtitle {
    margin: 5px 0 0;

    color: #8097a4;

    font-size: 11px;
    line-height: 1.3;
}

.mini-count {
    color: #7edfff;

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

.mini-catalog-grid {
    min-height: 366px;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    grid-auto-rows: minmax(0, 1fr);

    gap: 14px 18px;
}

.mini-catalog-grid .mini-card {
    min-height: 0;
}

.mini-card-slot-empty {
    min-width: 0;
    visibility: hidden;
}

.mini-pagination {
    display: none;

    align-items: center;
    justify-content: center;

    gap: 7px;

    margin-top: 18px;
}

.mini-pagination.is-visible {
    display: flex;
}

.mini-page-arrow,
.mini-page-number {
    min-width: 34px;
    height: 34px;

    display: inline-grid;
    place-items: center;

    border: 1px solid rgba(33, 172, 222, .34);
    border-radius: 8px;

    background: rgba(5, 29, 43, .9);

    color: #ccebf4;

    font-size: 12px;
    font-weight: 750;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.mini-page-arrow {
    font-size: 20px;
    line-height: 1;
}

.mini-page-arrow:hover:not(:disabled),
.mini-page-number:hover {
    border-color: rgba(35, 211, 255, .75);
    background: rgba(7, 70, 94, .9);
    color: #ffffff;
}

.mini-page-arrow:disabled {
    opacity: .32;
    cursor: default;
}

.mini-page-number.active {
    border-color: rgba(35, 211, 255, .85);
    background: linear-gradient(
        145deg,
        #0d7ea5,
        #07546f
    );
    color: #ffffff;
}

@media (max-width: 1050px) {

    .mini-catalog-grid {
        gap: 12px;
    }
}

@media (max-width: 820px) {

    .mini-hero {
        height: 220px;
        border-radius: 14px;
    }

    .mini-catalog-grid {
        min-height: 0;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
    }

    .mini-card-slot-empty {
        display: none;
    }
}

@media (max-width: 560px) {

    .mini-hero-wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    .mini-hero {
        height: 190px;
        border-radius: 12px;
    }

    .mini-catalog-grid {
        grid-template-columns: 1fr;
    }

    .mini-catalog-heading {
        align-items: flex-start;
    }
}


/* =========================================================
   MINI GAME — MICRO INTERACTIONS
========================================================= */

.mini-catalog-section {
    animation: miniContentIn .42s cubic-bezier(.22, .8, .28, 1) both;
}

.mini-card {
    transform: translateY(0);
    transition:
        transform .22s cubic-bezier(.22, .8, .28, 1),
        border-color .22s ease,
        box-shadow .22s ease,
        background .22s ease;
    will-change: transform;
}

.mini-card:hover {
    transform: translateY(-4px);
    border-color: rgba(35, 211, 255, .55);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, .22),
        0 0 18px rgba(28, 192, 238, .08);
}

.mini-card:nth-child(1) { animation-delay: .03s; }
.mini-card:nth-child(2) { animation-delay: .06s; }
.mini-card:nth-child(3) { animation-delay: .09s; }
.mini-card:nth-child(4) { animation-delay: .12s; }
.mini-card:nth-child(5) { animation-delay: .15s; }
.mini-card:nth-child(6) { animation-delay: .18s; }

@keyframes miniContentIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*
 * Khi JS thêm .page-leaving vào body, trang cũ
 * mờ + trượt nhẹ trước khi điều hướng.
 */
body.page-leaving {
    pointer-events: none;
    animation: pageLeave .20s ease forwards;
}

@keyframes pageLeave {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-catalog-section,
    .mini-card,
    body.page-leaving {
        animation: none;
        transition: none;
    }

    .mini-card:hover {
        transform: none;
    }
}


/* ---------------------------------------------------------
   Sleeping cat — subtle independent motion
   The cat is a clipped duplicate of the same hero image,
   so no extra asset is required and the original artwork
   stays visually identical.
--------------------------------------------------------- */


