/* ============================================
   game-category.css - Style cho trang danh mục game
   Tách riêng từ game-category.php
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 50px;
}

body {
    font-family: 'Roboto', 'Noto Sans', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 1.4rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ===== Header ===== */
.cat-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    padding: 0.24rem 0.3rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    color: #fff;
}

.cat-back {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.cat-back:hover {
    background: rgba(255, 255, 255, 0.4);
}

.cat-back:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.45);
}

.cat-back svg {
    width: 0.24rem;
    height: 0.24rem;
    stroke: #fff;
    display: block;
}

.cat-icon {
    width: 0.6rem;
    height: 0.6rem;
    margin-left: 0.2rem;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    padding: 0.06rem;
    flex-shrink: 0;
}

.cat-title {
    font-size: 0.34rem;
    font-weight: 700;
    color: #fff;
    margin-left: 0.16rem;
    flex: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ===== Grid list ===== */
.cat-list {
    list-style: none;
    padding: 0.24rem 0.2rem;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: flex-start;
    background: #fff;
}

.cat-list li {
    width: calc((100% - 0.4rem) / 3);
    background: #fff;
    border-radius: 0.12rem;
    padding: 0.18rem 0.1rem;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    animation: fadeIn 0.3s ease-out backwards;
}

.cat-list li:hover {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.cat-list li:active {
    transform: scale(0.96);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cat-list li img {
    width: 0.7rem;
    height: 0.7rem;
    object-fit: cover;
    border-radius: 0.1rem;
    margin: 0 auto 0.12rem;
    background: #f5f5f5;
}

.cat-list li p {
    font-size: 0.22rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin: 0;
}

.cat-list li p span {
    display: block;
    font-size: 0.18rem;
    color: #999;
    font-weight: 400;
    margin-top: 0.04rem;
}

/* Stagger animation */
.cat-list li:nth-child(1)  { animation-delay: 0.04s; }
.cat-list li:nth-child(2)  { animation-delay: 0.08s; }
.cat-list li:nth-child(3)  { animation-delay: 0.12s; }
.cat-list li:nth-child(4)  { animation-delay: 0.16s; }
.cat-list li:nth-child(5)  { animation-delay: 0.20s; }
.cat-list li:nth-child(6)  { animation-delay: 0.24s; }
.cat-list li:nth-child(7)  { animation-delay: 0.28s; }
.cat-list li:nth-child(8)  { animation-delay: 0.32s; }
.cat-list li:nth-child(9)  { animation-delay: 0.36s; }
.cat-list li:nth-child(10) { animation-delay: 0.40s; }
.cat-list li:nth-child(11) { animation-delay: 0.44s; }
.cat-list li:nth-child(12) { animation-delay: 0.48s; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Empty ===== */
.cat-empty {
    padding: 1rem 0.3rem;
    text-align: center;
    color: #999;
    font-size: 0.28rem;
    width: 100% !important;
}

/* ===== Footer ===== */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.footer-nav > div {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.16rem 0;
}

.footer-nav li {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.06rem;
}

.footer-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.06rem;
}

.footer-link img {
    width: 0.5rem;
    height: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-link.active img,
.footer-link:hover img {
    opacity: 1;
}

.footer-link span {
    font-size: 0.22rem;
    color: #999;
    line-height: 1;
}

.footer-link.active span {
    color: #FF4757;
    font-weight: 600;
}

.footer-nav > p {
    height: 0.36rem;
    background: #fff;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 320px) {
    html {
        font-size: 40px;
    }
}

/* ===== Loading ===== */
.cat-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 0.4rem;
    color: #999;
    font-size: 0.26rem;
}
