.games {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .games {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .games {
        grid-template-columns: repeat(4, 1fr);
    }
}

.games li {
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.games li:hover {
    border-color: #dc2626;
}

.games li a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.games .icon {
    position: relative;
    aspect-ratio: 16/9;
    background: #f3f4f6;
    overflow: hidden;
}

.games .icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.games .clamp {
    display: none;
}

.games .name-container {
    padding: 10px 12px;
}

.games .name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-section {
    margin-bottom: 32px;
}

.main-section h1,
.main-section h2,
.main-section .h1,
.main-section .h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.games-special {
    display: grid !important;
}

.main-section h2 a {
    color: #1f2937;
    text-decoration: none;
}

.main-section h2 a:hover {
    color: #dc2626;
}

.btn-container {
    text-align: center;
    margin-top: 16px;
}

.btn-primary {
    display: inline-block;
    padding: 8px 24px;
    background: #1f2937;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #374151;
}

#div-gpt-ad-content,
#div-gpt-ad-button {
    margin: 20px 0;
    text-align: center;
}

.footer-content {
    margin-top: 16px;
}

.footer-content .tags ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-content .tags li {
    display: inline-flex;
}

.footer-content .tags a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #4b5563;
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.footer-content .tags a:hover {
    background: #e5e7eb;
}

.footer-content .tags img {
    height: 16px;
    margin-right: 6px;
}

.copyright {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.copyright p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.backToTop {
    z-index: 50;
}

/* Game detail page styles */
.game .background {
    position: relative;
    height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.game .background::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.game-detail-header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #fff;
    margin-bottom: 0;
}

.game-detail-header .icon {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.game-detail-header .icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-detail-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.play-btn-container {
    margin-top: 0;
}

.play-btn {
    display: inline-block;
    padding: 12px 40px;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.play-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

/* Mobile menu styles */
.mobile-menu {
    position: relative;
    z-index: 40;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.mobile-menu ul {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 16px;
    gap: 16px;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-menu ul::-webkit-scrollbar {
    display: none;
}

.mobile-menu li {
    flex-shrink: 0;
}

.mobile-menu a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.2s;
}

.mobile-menu a:hover,
.mobile-menu a:active {
    color: #fff;
}

.mobile-menu img {
    height: 18px;
    width: auto;
}

/* Fix flex layout issues when mobile menu expands */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
    overflow: hidden;
}

.app-container > div:last-child {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
    overflow: hidden;
}

.app-container > div:last-child > header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
}

.app-container > div:last-child > main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Ensure game detail background stays visible */
.game {
    width: 100%;
}

.game .background {
    min-height: 200px;
    flex-shrink: 0;
}

@media (max-width: 1023px) {
    .lg\:ml-64 {
        margin-left: 0;
    }
    
    .game .background {
        height: 250px;
    }
    
    .game-detail-header .icon {
        width: 100px;
        height: 100px;
    }
    
    .game-detail-header h1 {
        font-size: 22px;
    }
    
    .play-btn {
        padding: 10px 30px;
        font-size: 14px;
    }
}