/* ============================================
   CSS 变量 - 主题色配置
   修改这里的颜色值即可全局更新网站主题
   ============================================ */
:root {
    /* 主色调 - 紫色主题 */
    --primary-color: #e742ed;
    --accent-color: #e742ed;
    --accent-hover: #c31dd9;
    --highlight-color: #ff6b9d;
    
    /* 背景色 */
    --bg-primary: #e742ed;
    --bg-secondary: #e742ed;
    --bg-header: #e742ed;
    --bg-header-menu: #e742ed;
    --bg-module: #f3e8ff;
    --bg-tag: #f3e8ff;
    --bg-tag-hover: #e9d5ff;
    
    /* 文字颜色 */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #4b5563;
    --text-light: #d1d5db;
    --text-white: #ffffff;
    
    /* 边框颜色 */
    --border-color: #e5e7eb;
    --border-light: #bdc3c7;
    
    /* 阴影颜色 */
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    /* 紫色主题专属变量 */
    --purple-glow: #e742ed;
    --purple-light: #f3e8ff;
}

/* ============================================
   游戏列表样式
   ============================================ */
.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: var(--bg-primary);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.games li:hover {
    border-color: var(--accent-color);
}

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

.games .icon {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-tag);
    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: var(--text-primary);
    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: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

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

.main-section h2 a {
    color: var(--text-primary);
    text-decoration: none;
}

.main-section h2 a:hover {
    color: var(--accent-color);
}

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

.btn-primary {
    display: inline-block;
    padding: 8px 24px;
    background: var(--text-primary);
    color: var(--text-white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: var(--bg-header-menu);
}

#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: var(--bg-tag);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.footer-content .tags a:hover {
    background: var(--bg-tag-hover);
}

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

.copyright {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.copyright p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.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 .backgroundDarken {
    padding: 40px 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.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: var(--text-white);
    margin-bottom: 0;
}

.game-detail-header .icon {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid var(--text-white);
    box-shadow: 0 4px 20px var(--shadow-color);
    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: var(--text-white);
    text-shadow: 0 2px 10px var(--shadow-color);
}

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

.play-btn {
    display: inline-block !important;
    padding: 12px 40px !important;
    background: var(--accent-color) !important;
    color: var(--text-white) !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 15px var(--purple-glow) !important;
    border: none !important;
    cursor: pointer !important;
}

.play-btn:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px var(--purple-glow) !important;
}

/* 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: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.2s;
}

.mobile-menu a:hover,
.mobile-menu a:active {
    color: var(--text-white);
}

.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;
    }
}
