:root {
    --wrapper-width: 500px;
    --primary-color: rgb(31, 192, 163);
    --primary-600: #1fc0a3;
    --text-color: #333;
    --muted-color: #999;
    --bg-header-bg: #D3FFF7;
    --bg-page: #fafafa;
    --bg-card: #fff;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
    --header-height: 52px;
    --header-menu-height: 40px
}
/*
@font-face {
    font-family: Viga;
    src: url(../fonts/viga-regular.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    font-size-adjust: .5;
    ascent-override: 90%;
    descent-override: 20%;
    line-gap-override: 0%
} */

* {
    box-sizing: border-box
}

html {
    height: 100%;
    width: 100vw;
    max-width: var(--wrapper-width);
    margin: 0 auto
}

body {
    margin: 0;
    font-family: Viga, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
    color: var(--text-color);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    width: 100vw;
    max-width: var(--wrapper-width)
}

body.is-modal-open {
    overflow: hidden
}

a {
    text-decoration: none;
    color: var(--primary-color)
}

.wrapper {
    width: 100vw;
    max-width: var(--wrapper-width);
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background-color: #d3fff7
}

.header {
    position: sticky;
    top: -1px;
    z-index: 50;
    height: 52px;
    background: var(--bg-header-bg);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
    color: #fff
}

.logo-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffb266, var(--primary-color));
    position: relative;
    box-shadow: inset 0 0 0 2px #ffffff8c
}

.logo-img {
    width: 32px;
    height: 20px;
    object-fit: cover;
    display: block
}

.logo-text {
    font-size: 16px;
    letter-spacing: .2px;
    color: var(--primary-color)
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px
}

.icon-btn {
    background: transparent;
    border: 0;
    color: #fff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    padding: 0
}

.icon-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain
}

.header-menu {
    background-color: var(--bg-header-bg);
    position: absolute;
    width: 100%;
    margin: 0 -12px;
    top: var(--header-height);
    z-index: 50;
    transition: all .3s ease;
    height: var(--header-menu-height)
}

.open-header-menu {
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 5px #1fc0a33b;
    padding-bottom: 10px;
    height: 180px !important
}

.header-menu-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    overflow: hidden
}

.header-menu-dropdown {
    width: 66px;
    height: 40px;
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -2px 0 4.5px #1fc0a326;
    background-color: var(--bg-header-bg)
}

.header-menu-dropdown-btn {
    cursor: pointer;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    transform: rotate(270deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%
}

.header-menu-dropdown img {
    width: 15px;
    height: 15px;
    object-fit: contain
}

.header-menu-category-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 4px;
    width: 100%
}

.header-menu-category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
}

.header-menu-category-item img {
    width: 28px;
    height: 28px;
    object-fit: contain
}

.header-menu-category-item span {
    font-size: 12px;
    color: var(--primary-color)
}

.drawer {
    position: fixed;
    inset: 0;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease
}

.drawer.open {
    opacity: 1;
    pointer-events: auto
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: #0000;
    transition: background-color .24s ease
}

.drawer.open .drawer-backdrop {
    background: #00000059
}

.drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 76%;
    max-width: 320px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: 16px 12px;
    overflow-y: auto;
    transform: translate(-100%);
    transition: transform .24s cubic-bezier(.22, .61, .36, 1);
    will-change: transform
}

.drawer.open .drawer-panel {
    transform: translate(0)
}

.drawer-title {
    font-weight: 700;
    margin: 6px 6px 12px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.drawer-title .icon-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer
}

.drawer-title .icon-btn:hover {
    background: #ff99331a
}

.drawer-title .icon-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain
}

.search-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-color);
    border-radius: 8px;
    outline: none
}

.search-input::placeholder {
    color: #999
}

.search-input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px #f933
}

.search-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color .2s ease
}

.search-btn:hover {
    background: #e68a2e
}

.search-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1)
}

main {
    padding-top: var(--header-menu-height);
    min-height: 90vh
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    padding: 10px 8px;
    border-radius: 12px
}

.nav-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block
}

.nav-item a:active {
    background: #f4f4f4
}

.section {
    padding: 6px 12px
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
        text-transform: capitalize;
    margin: 2px 0 10px
}

.section-title .left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 24px
}

.section-title small a {
    color: #999;
    text-decoration: none
}

.section-title .left img {
    width: 20px;
    height: 20px;
    object-fit: contain
}

.ad-box {
    position: relative;
    background: #f5f5f5b3;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: start;
    flex-direction: column;
    color: var(--muted-color);
    font-size: 14px;
    width: 300px;
    min-height: 90px;
    height: 200px;
    margin: 0 auto
}

.ad-box:before {
    content: "Advertisement";
    width: 100%;
    height: 10px;
    font-size: 10px;
    line-height: 10px;
    z-index: 0;
    left: 0;
    background: var(--primary-color);
    text-align: center;
    color: #fff;
    border-top-right-radius: var(--radius-sm);
    border-top-left-radius: var(--radius-sm);
    padding: 2px 0
}

.ad-box ins {
    width: 100%
}

.card {
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.card-media {
    width: 100%;
    height: 70px;
    background: #f0f0f0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm)
}

.card-body {
    padding: 3px
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color)
}

.card-desc {
    display: none;
    font-size: 11px;
    color: #666;
    margin: 0;
    height: 28px;
    overflow: hidden;
    line-height: 14px
}

.more-games-btn {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: 0;
    padding: 16px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all .2s ease;
    margin: 20px 0
}

.more-games-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px #9996
}

.more-games-btn:active {
    transform: translateY(0)
}

.more-games-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none
}

.footer {
    border-top: 2px solid #fff;
    margin-top: auto;
    color: var(--primary-color);
    font-size: 11px;
    padding: 10px
}

.footer-links {
    display: grid;
    grid-auto-flow: column;
    justify-content: space-around;
    gap: 8px;
    padding-bottom: 10px
}

.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    text-align: center
}

.copyright {
    text-align: center;
    color: #999
}

@media (max-width: 360px) {
    .categories {
        grid-template-columns: repeat(3, 1fr)
    }
}

.cookie-banner {
    position: fixed;
    left: 50%;
    transform: translate(-50%);
    bottom: 12px;
    width: calc(100% - 24px);
    max-width: 500px;
    background: #fff;
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 12px;
    z-index: 50;
    display: none
}

.cookie-row {
    display: flex;
    align-items: center;
    gap: 10px
}

.cookie-text {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    flex: 1
}

.cookie-actions {
    display: flex;
    gap: 8px
}

.cookie-btn {
    background: var(--primary-color);
    color: #fff;
    border: 0;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer
}

.cookie-link {
    background: transparent;
    color: var(--primary-color);
    border: 0;
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer
}

.star {
    width: 13px;
    height: 13px;
    object-fit: contain
}

.star.empty {
    opacity: .3
}

img {
    max-width: 100%;
    height: auto
}

.game-card {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #f8f8f8;
    position: relative
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

.home-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.cat-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    border-radius: 12px;
    padding: 10px 16px;
    color: #fff;
    text-decoration: none;
    background-size: cover;
    background-position: center;
    overflow: hidden
}

.cat-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0000001a, #0000008c)
}

.cat-name {
    position: relative;
    z-index: 1;
    font-size: 16px;
    line-height: 16px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6)
}

.cat-arrow {
    position: relative;
    z-index: 1;
    place-items: center
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md)
}

@keyframes loading {
    0% {
        background-position: 200% 0
    }

    to {
        background-position: -200% 0
    }
}

.overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--header-height);
    background: #0000008c;
    display: none;
    z-index: 40;
    opacity: 0;
    transition: opacity .18s ease
}

.overlay.show {
    width: var(--wrapper-width);
    margin: 0 auto;
    display: block;
    opacity: 1
}

.search-modal {
    overflow: auto;
    width: 100%;
    height: calc(100vh - var(--header-height));
    max-width: var(--wrapper-width);
    margin: 0 auto;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-height);
    background: var(--bg-header-bg);
    color: #fff;
    box-shadow: var(--shadow-sm);
    padding: 12px;
    display: none;
    z-index: 51;
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    padding-bottom: 120px;
}

.search-modal.show {
    display: block;
    opacity: 1;
    transform: none;
    pointer-events: auto
}

.search-modal.closing {
    pointer-events: none
}

.search-bar-box {
    display: flex;
    align-items: center;
    gap: 10px
}

.search-bar-close {
    width: 34px;
    height: 34px;
    background-color: var(--primary-color);
    transform: rotate(270deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%
}

.search-bar {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid #fff
}

.search-input-large {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-color);
    outline: none;
    font-size: 14px
}

.search-input-large::placeholder {
    color: #999
}

.search-submit {
    background: transparent;
    border: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center
}

.search-submit img {
    width: 18px;
    height: 18px
}

.chips {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap
}

.chips .chip {
    background: #fff;
    color: var(--primary-color);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px
}

.hot-title {
    margin: 8px 0 10px;
    font-size: 18px;
    color: var(--primary-color)
}

.hot-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px
}

.hot-grid .hot-item {
    width: 100%;
    border-radius: 10px
}

.hot-item-inner {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 4px;
    min-width: 0
}

.hot-item-overlay {
    width: 140px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    aspect-ratio: 4 / 2;
    flex: 0 0 140px
}

.hot-item-title {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    overflow: hidden;
    align-items: center;
}

.hot-item-title-text {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px
}

.hot-item-title-text-title {
    font-size: 14px;
    color: var(--text-color);
    line-height: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    /* white-space: nowrap; */
    min-width: 0;
    max-width: 100%;
    font-weight: 700;
    margin: 0
}

.hot-item-title-desc {
    padding-top: 10px;
    font-size: 12px;
    color: #999;
    line-height: 14px;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2
}

.search-close {
    position: fixed;
    left: 50%;
    transform: translate(-50%);
    bottom: 72px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: 0;
    display: none;
    z-index: 42;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform-origin: center;
    transition: opacity .18s ease, transform .18s ease
}

.search-close.show {
    display: grid;
    place-items: center;
    opacity: 1
}

@keyframes popInScale {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(.06)
    }

    60% {
        opacity: 1;
        transform: translateY(2px) scale(1)
    }

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

@keyframes popOutScale {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1)
    }

    to {
        opacity: 0;
        transform: translateY(-6px) scale(.86)
    }
}

.search-modal.show {
    animation: popInScale .32s cubic-bezier(.22, .72, .23, 1)
}

.search-modal.closing {
    animation: popOutScale .18s ease forwards
}

.loading {
    width: 90vw;
    max-width: var(--wrapper-width);
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px
}

.loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.back-to-top-btn-box {
    width: 10%;
    max-width: 500px;
    position: fixed;
    bottom: 172px;
    right: 20px
}

.back-to-top {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: 0;
    box-shadow: var(--shadow-sm);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10
}