* {
    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;
}

.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: 5rem;
    object-fit: fill;
    display: block;
    border-radius: 0.75rem;
}

.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: 60%;
    position: relative;
    overflow: hidden;
}

.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列布局 */
}