* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    font-size: 16px;
}


body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    /* 粉紫色背景闪动效果 */

}

/* 彩色渐变文字效果 - 更精确地应用于文本元素 */
.header h1, .header p, .header strong, .header h1 strong,
.ads-title, .tab, .game-name, .play-btn, .footer p,
.ad-item a, .game-info .game-name {
    text-transform: uppercase;
    background: linear-gradient(90deg, red, #0f0, #00f, red);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textFlow-2ef30229 3s linear infinite;
    /* 确保文字可读性 */
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255,255,255,0.3);
}

/* 文字流动动画 */
@keyframes textFlow-2ef30229 {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 1.25rem;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.header h1 {
    /* color: #ff0000; */
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
}

.header p {
    /* color: #999999; */
    font-size: 1.125rem;
    margin-bottom: 0.3125rem;
}

.ads {
    margin-bottom: 0.9375rem;
}

.ads-title {
    font-size: 0.875rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.ad-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.1875rem;
}

.ad-item {
    /* background-color: #2a2a2a; */
    /* border-radius: 10px; */
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ad-item:hover {
    transform: translateY(-0.125rem);
}

.ad-item img {
    width: 100%;
    height: 120px;
    object-fit: fill;
    display: block;
    border-radius: 0.75rem;
}

@media (max-width: 1000px) {
    .ad-item img {
        height: 80px;
    }
}

@media (max-width: 600px) {
    .ad-item img {
        height: 60px;
    }
}

@media (max-width: 450px) {
    .ad-item img {
        height: 40px;
    }
}

.ad-item p {
    margin: 0;
    padding: 0.3125rem;
    text-align: center;
    color: #ffffff;
    font-size: 0.75rem;
    /* background-color: rgba(0, 0, 0, 0.5); */
    font-weight: normal;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5rem 1.25rem;
    background-color: #333333;
    margin: 0 0.3125rem 0.625rem 0.3125rem;
    border-radius: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.tab:hover,
.tab.active {
    background-color: #0066cc;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.9375rem;
}

.game-item {
    background-color: #2a2a2a;
    border-radius: 0.3125rem;
    overflow: hidden;
    transition: transform 0.3s ease;
    position: relative;
}

.game-item:hover {
    transform: translateY(-0.3125rem);
}

.game-img {
    width: 100%;
    height: 0;
    padding-bottom: 90%;
    position: relative;
    overflow: hidden;
}
@media (max-width: 600px) {
    .game-img {
        padding-bottom: 70%;
    }
}
.game-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.game-info {
    padding: 0.625rem;
}

.game-name {
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-btn {
    display: block;
    width: 100%;
    padding: 0.375rem;
    background-color: #0066cc;
    color: #ffffff;
    border: none;
    border-radius: 0.1875rem;
    cursor: pointer;
    font-size: 0.75rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.play-btn:hover {
    background-color: #0052a3;
}

.footer {
    text-align: center;
    margin-top: 1.875rem;
    padding: 1.25rem;
    color: #666666;
    font-size: 0.875rem;
}

@media (max-width: 1200px) {
    :root {
        font-size: 15px;
    }
    .game-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 992px) {
    :root {
        font-size: 14px;
    }
    .game-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        font-size: 13px;
    }
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    /* 保持广告位4列布局 */
}

@media (max-width: 576px) {
    :root {
        font-size: 12px;
    }
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
    }
    /* 保持广告位4列布局 */
}

@media (max-width: 400px) {
    :root {
        font-size: 11px;
    }
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* 保持广告位4列布局 */
}