/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主题颜色变量 - 根据图片调整为深色主题 */
:root {
    --bg-main: #181a1b; /* 主背景色 - 非常深的接近黑色的灰色 */
    --bg-sidebar: #202324; /* 侧边栏背景色 - 稍浅的深灰色 */
    --bg-element: #2c2f30; /* 元素背景色 (如卡片) - 深灰色 */
    --text-primary: #d1d1d1; /* 主要文字颜色 - 浅灰色 */
    --text-secondary: #ababab; /* 次要文字颜色 - 中灰色 */
    --accent-purple: #8c52ff; /* 强调色 - 紫色 (如图片中的 Crazy Games logo 和按钮) */
    --accent-blue: #00aaff; /* 强调色 - 蓝色 (备用或链接) */
    --border-color: #35393a; /* 边框颜色 */
    --header-height: 65px; /* 头部高度，用于计算侧边栏top值 */
}

body {
    font-family: 'Arial', sans-serif; /* 字体：Arial 或无衬线字体 */
    line-height: 1.6; /*行高 */
    color: var(--text-primary); /* 文字颜色 */
    background-color: var(--bg-main); /* 背景颜色 */
    padding-top: var(--header-height); /* 为固定头部预留空间 */
}

/* Header Styles */
/* 头部样式 */
header {
    background-color: var(--bg-sidebar); /* 背景颜色 */
    color: var(--text-primary); /* 文字颜色 */
    padding: 0 20px; /* 内边距 (上下0，左右20px) */
    display: flex; /* 使用flex布局 */
    justify-content: space-between; /* 两端对齐 */
    align-items: center; /* 垂直居中 */
    border-bottom: 1px solid var(--border-color); /* 底部边框 */
    height: var(--header-height); /* 固定高度 */
    position: fixed; /* 固定在视口顶部 */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /*确保在最上层 */
}

.logo-container {
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
}

.retro-logo { /* 根据图片调整为 Crazy Games 样式 */
    font-family: 'Arial', sans-serif; /* 字体，图片中看起来不是像素字体 */
    font-size: 24px; /* Logo字号 */
    font-weight: bold;
    color: var(--accent-purple); /* Logo颜色 */
    /* text-shadow: 3px 3px 0 var(--text-dark-on-light); 移除像素阴影 */
    letter-spacing: 1px; /* 字间距 */
}

.language-selector { 
    display: flex; /* 重新显示语言选择器 */
    align-items: center; /* 垂直居中按钮 */
    gap: 5px; /* 按钮之间的间距 */
}

/* 语言按钮新样式，融入头部 */
.lang-btn {
    background-color: transparent; /* 透明背景 */
    color: var(--text-secondary); /* 文字颜色 */
    border: 1px solid var(--border-color); /* 边框颜色与搜索框一致 */
    padding: 6px 10px; /* 内边距调整 */
    border-radius: 4px; /* 圆角 */
    cursor: pointer; /* 鼠标指针 */
    font-size: 13px; /* 字体大小 */
    transition: background-color 0.2s, color 0.2s, border-color 0.2s; /* 过渡效果 */
}

.lang-btn:hover {
    background-color: var(--bg-element); /* 悬停背景色 */
    color: var(--text-primary); /* 悬停文字颜色 */
    border-color: var(--accent-purple); /* 悬停边框颜色 */
}

.lang-btn.active {
    background-color: var(--accent-purple); /* 激活背景色 */
    color: white; /* 激活文字颜色 */
    border-color: var(--accent-purple); /* 激活边框颜色 */
}

/* 搜索框样式 - 根据图片顶部中间的搜索框添加 */
.search-bar {
    flex-grow: 1; /* 占据剩余空间 */
    display: flex;
    justify-content: center; /* 居中搜索框容器 */
    align-items: center;
    padding: 0 20px; /* 左右留一些间距 */
}

.search-bar input[type="text"] {
    background-color: var(--bg-main); /* 输入框背景 */
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px; /* 圆角 */
    padding: 8px 15px;
    font-size: 14px;
    width: 100%; /* 宽度 */
    max-width: 400px; /* 最大宽度 */
    outline: none; /* 移除默认的焦点轮廓 */
}

.search-bar input[type="text"]::placeholder {
    color: var(--text-secondary);
}

/* 头部右侧按钮 - 根据图片添加 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* 调整整体右侧元素的间距 */
}

.header-actions .icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px; /* 图标大小 */
    cursor: pointer;
}

.header-actions .login-btn {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

/* Main Content Layout */
/* 主内容布局 */
main {
    /* 移除Grid布局，因为侧边栏将使用fixed定位 */
    /* display: grid; */
    /* grid-template-columns: 200px 1fr 300px; */
    /* gap: 1rem; */
    padding: 20px; /* 主内容区域的内边距 */
    /* max-width: 1600px; */ /* 可以移除或调整 */
    /* margin: 0 auto; */ /* 如果需要居中，但通常全宽 */
}

/* Left Sidebar - Game Links */
/* 左侧边栏 - 游戏链接 */
.game-links {
    background-color: var(--bg-sidebar); /* 背景颜色 */
    padding: 20px 15px; /* 内边距 */
    width: 250px; /* 左侧边栏宽度，根据图片调整 */
    position: fixed; /* 固定定位 */
    left: 0; /* 靠左 */
    top: var(--header-height); /* 在头部下方 */
    height: calc(100vh - var(--header-height)); /* 高度占满剩余视口 */
    overflow-y: auto; /* 内容超出时显示滚动条 */
    border-right: 1px solid var(--border-color);
    scrollbar-width: none; /* Firefox - 隐藏滚动条 */
    -ms-overflow-style: none;  /* IE and Edge - 隐藏滚动条 */
}

/* Webkit (Chrome, Safari, Edge) - 隐藏滚动条 */
.game-links::-webkit-scrollbar {
    display: none;
}

.game-links h2 {
    color: var(--text-primary); /* 标题颜色 */
    margin-bottom: 15px; /* 下外边距 */
    font-size: 16px; /* 标题字号 */
    padding-bottom: 10px; /* 下内边距 */
    border-bottom: 1px solid var(--border-color); /* 下划线 */
    font-weight: normal;
}

.game-links ul {
    list-style: none; /* 无列表样式 */
    padding: 0;
    margin: 0;
}

.game-links li {
    /* display: flex;  移除flex，让图标和文字自然排列 */
    /* align-items: center; */
    margin-bottom: 0; /* 移除单个li的底部外边距，由a标签控制 */
}

.game-links a {
    display: flex; /* 使用flex让图标和文字在同一行 */
    align-items: center; /* 垂直居中图标和文字 */
    gap: 10px; /* 图标与文字间距 */
    font-size: 14px; /* 字号 */
    padding: 10px 15px; /* 内边距，增大点击区域 */
    border-radius: 4px; /* 圆角 */
    transition: background-color 0.2s, color 0.2s; /* 过渡效果 */
    color: var(--text-secondary); /* 文字颜色 */
    text-decoration: none; /* 无下划线 */
    font-weight: bold;
}

.game-links a:hover,
.game-links li.active a { /* 假设有激活状态 */
    background-color: var(--accent-purple); /* 悬停/激活背景 */
    color: white; /* 悬停/激活文字 */
}

.game-links hr { /* 分隔线，根据图片，左侧导航似乎有分组 */
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 15px 0; /* 上下外边距 */
}

/* Main Game Section */
/* 主游戏区域 */
.main-game {
    background-color: var(--bg-main); /* 背景颜色，与body一致或稍有区别 */
    border-radius: 8px; /* 圆角 */
    /* box-shadow: 0 2px 10px var(--shadow-color-general); */ /* 移除或调整阴影 */
    overflow: hidden; /* 隐藏溢出内容 */
    /* border: 1px solid var(--accent-vibrant-green); */ /* 移除边框 */
    margin-left: 250px; /* 左外边距 = 左侧边栏宽度 (确保与 .game-links width 一致) */
    margin-right: 270px; /* 右外边距 = 右侧边栏宽度 + gap (例如 250px + 20px) */
    padding: 20px; /* 为内部元素提供一些间距 */
}

.game-container {
    position: relative; /* 相对定位 */
    width: 100%; /* 宽度100% */
    /* height: 600px;  由padding-top控制宽高比 */
    padding-top: 56.25%; /* 16:9 宽高比 */
    background-color: #000; /* iframe加载前背景 */
    border-radius: 8px;
}

.game-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* 宽度100% */
    height: 100%; /* 高度100% */
    border: none; /* 无边框 */
}

.fullscreen-btn {
    position: absolute; /* 绝对定位 */
    bottom: 10px; /* 距底部1rem */
    right: 10px; /* 距右侧1rem */
    background-color: rgba(0,0,0,0.5); /* 背景颜色 */
    color: white; /* 文字颜色 */
    border: none; /* 无边框 */
    padding: 8px 12px; /* 内边距 */
    border-radius: 4px; /* 圆角 */
    cursor: pointer; /* 鼠标指针：手型 */
    transition: background-color 0.3s; /* 过渡效果 */
    font-size: 13px;
}

.fullscreen-btn:hover {
    background-color: rgba(0,0,0,0.8); /* 悬停背景 */
}

/* Game Information Section */
/* 游戏信息区域 */
.game-info {
    padding: 20px 0 0 0; /* 内边距，顶部20px，其他0 */
    color: var(--text-primary);
}

.game-info h2 { /* 游戏主标题，如 Chicken Clicker */
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 22px;
    border-bottom: none !important; /* 移除之前的边框 */
    padding-bottom: 0;
}

/* 游戏信息下方的一行图标按钮 */
.game-actions-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.game-actions-bar .action-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-actions-bar .action-btn:hover {
    background-color: var(--bg-element);
    color: var(--text-primary);
}

.game-screenshots {
    display: flex; /* 使用flex布局 */
    gap: 10px; /* 图片间距 */
    margin-bottom: 20px; /* 下外边距 */
    /* overflow-x: auto;  如果需要滚动条 */
}

.game-screenshots img {
    width: calc(33.333% - 7px); /* 图片宽度，适应3列并考虑gap */
    height: auto; /* 图片高度 */
    object-fit: cover; /* 图片裁剪方式 */
    border-radius: 4px; /* 圆角 */
    border: 1px solid var(--border-color);
}


/* 内容区块的通用样式调整 */
.game-features, .game-description, .how-to-play, .game-tips, .player-reviews, .why-section, .game-updates, .faq {
    margin-bottom: 20px;
    background-color: var(--bg-element); /* 背景色 */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.game-features h3, .game-description h3, .how-to-play h3, .game-tips h3, 
.player-reviews h3, .why-section h3, .game-updates h3, .faq h3, .faq-item h4 {
    color: var(--text-primary); /* 标题颜色 */
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.game-features ul, .how-to-play ul, .game-tips ul, .game-updates ul {
    list-style-type: disc; /* 使用实心圆点 */
    padding-left: 20px;
    color: var(--text-secondary);
}

.game-features li, .how-to-play li, .game-tips li, .game-updates li {
    margin-bottom: 8px;
}

.review {
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--bg-main); /* 评论背景稍有不同 */
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.review p {
    font-style: normal; /* 移除斜体 */
    margin-bottom: 5px;
    color: var(--text-primary);
}

.review span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

.why-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.why-item {
    background-color: var(--bg-main); /* 背景 */
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.why-item h4 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 8px;
    border-bottom: none; /* 移除内部标题的下划线 */
    padding-bottom: 0;
}

.faq-item {
    background-color: transparent; /* FAQ项背景透明，由父级.faq控制 */
    padding: 0;
    border: none; /* 移除单个FAQ项的边框 */
    margin-bottom: 15px;
}

.faq-item h4 {
    /* 样式已在上面定义 */
    cursor: pointer;
}
.faq-item p {
    color: var(--text-secondary);
    padding-left: 20px; /* 对应有图标时的缩进 */
}

/* Right Sidebar - Mini Games */
/* 右侧边栏 - 小游戏列表 */
.mini-games {
    background-color: var(--bg-sidebar); /* 背景颜色 */
    padding: 15px;
    width: 250px; /* 右侧边栏宽度 */
    position: fixed; /* 固定定位 */
    right: 0; /* 靠右 */
    top: var(--header-height); /* 在头部下方 */
    height: calc(100vh - var(--header-height)); /* 高度占满剩余视口 */
    overflow-y: auto; /* 内容超出时显示滚动条 */
    border-left: 1px solid var(--border-color);
    scrollbar-width: none; /* Firefox - 隐藏滚动条 */
    -ms-overflow-style: none;  /* IE and Edge - 隐藏滚动条 */
}

/* Webkit (Chrome, Safari, Edge) - 隐藏滚动条 */
.mini-games::-webkit-scrollbar {
    display: none;
}

.mini-games h2 {
    font-size: 16px; /* 标题字号 */
    margin-bottom: 15px; /* 下外边距 */
    color: var(--text-primary); /* 标题颜色 */
    text-align: left; /* 文本左对齐 */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-weight: normal;
}

.mini-game-grid {
    display: grid; /* 使用Grid布局 */
    grid-template-columns: repeat(2, 1fr); /* 右侧边栏小游戏固定为两列 */
    gap: 10px; /* 网格间距 */
}

/* 中间区域的小游戏网格标题 */
.central-mini-games-section h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 15px;
    text-align: left; 
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    font-weight: bold;
}

/* 中间区域小游戏网格容器 specific styles */
.central-mini-games-section .sub-mini-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* 中间区域小游戏列数，卡片稍大 */
    gap: 15px; /* 中间区域小游戏间距稍大 */
}


/* 单个小游戏样式 (通用) */
.mini-game {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden; /* 确保图片和标题在圆角内 */
    background-color: var(--bg-element); /* 背景色 */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid var(--border-color);
}

.mini-game:hover {
    transform: scale(1.03); /* 鼠标悬浮时轻微放大 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-purple);
}

.game-cover { /* 游戏封面容器样式 */
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio, or 100% for 1:1 */
}

.game-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持宽高比，裁剪多余部分 */
}

.game-title { /* 游戏标题样式 (位于封面上方) */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* background-color: rgba(0, 0, 0, 0.6); */ /* 背景颜色 (半透明黑色) - 用户注释掉了，保持 */
    color: #fff; /* 文字颜色 */
    padding: 6px 8px; /* 内边距 */
    font-size: 12px; /* 字体大小 */
    text-align: center; /* 文本居中 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer Styles */
/* 页脚样式 */
footer {
    background-color: var(--bg-sidebar); /* 背景颜色 */
    color: var(--text-secondary); /* 文字颜色 */
    padding: 20px; /* 内边距 */
    text-align: center; /* 文本居中 */
    border-top: 1px solid var(--border-color); /* 顶部边框 */
    margin-left: 250px; /* 左外边距 = 左侧边栏宽度 (确保与 .game-links width 一致) */
    margin-right: 250px; /* 右外边距 = 右侧边栏宽度 */
}

.footer-content {
    max-width: 1200px; /* 最大宽度 */
    margin: 0 auto; /* 水平居中 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.copyright p {
    margin: 5px 0;
    font-size: 0.9em;
}

.copyright a {
    color: var(--accent-blue); /* 链接颜色 */
    text-decoration: none;
}
.copyright a:hover {
    text-decoration: underline;
}

/* 移除旧的响应式规则中隐藏侧边栏的部分，因为现在是固定定位 */
@media (max-width: 992px) {
    /* .game-links, .mini-games { */
        /* display: none;  移除此隐藏规则 */
    /* } */
    /* 如果需要在小屏幕上隐藏固定侧边栏，可以重新添加，但通常固定侧边栏在小屏幕体验不佳，可能需要不同的布局策略 */
}


@media (max-width: 768px) {
    header {
        padding: 0 10px; /* 减小头部左右内边距 */
    }
    .retro-logo {
        font-size: 20px; /* 减小logo字号 */
    }
    .search-bar {
        padding: 0 10px; /* 减小搜索框间距 */
    }
    .search-bar input[type="text"] {
        font-size: 13px;
        padding: 6px 10px;
    }
    .header-actions .login-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    .header-actions .icon-btn {
        font-size: 18px;
    }

    /* 在小屏幕上，固定侧边栏可能会覆盖内容或使内容区域过窄 */
    /* 考虑在小屏幕上将固定侧边栏变为抽屉式或完全隐藏 */
    .game-links {
        width: 180px; /* 减小左侧边栏宽度 */
        font-size: 13px;
    }
    .game-links h2 {
        font-size: 14px;
    }
    .game-links a {
        font-size: 13px;
        padding: 8px 10px;
        gap: 8px;
    }

    .main-game {
        margin-left: 180px; /* 对应调整 */
        margin-right: 0; /* 在极小屏幕，右侧边栏可以考虑隐藏 */
        padding: 15px;
    }
    .mini-games {
        display: none; /* 小屏幕上隐藏右侧固定边栏 */
    }

    .game-info h2 {
        font-size: 20px;
    }
    .game-actions-bar {
        gap: 10px;
        flex-wrap: wrap; /* 允许换行 */
    }
    .game-actions-bar .action-btn {
        font-size: 12px;
        padding: 5px 8px;
    }

    .game-screenshots {
        flex-direction: column; /* 截图列改为单列 */
    }
    .game-screenshots img {
        width: 100%; /* 图片宽度占满 */
    }

    .central-mini-games-section h2 {
        font-size: 18px;
    }
    .central-mini-games-section .sub-mini-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    footer {
        margin-left: 180px; /* 对应调整 */
        margin-right: 0; /* 对应调整 */
        padding: 15px;
    }
}

@media (max-width: 480px) { /* 极小屏幕 */
    body {
        padding-top: 55px; /* 头部高度可能再次调整 */
    }
    header {
        height: 55px;
    }
    .retro-logo {
        display: none; /* 空间不足时隐藏logo文字，或用图标代替 */
    }
    .search-bar {
        padding: 0 5px; /* 进一步减小间距 */
    }
    .header-actions {
        gap: 8px;
    }

    .game-links {
        display: none; /* 极小屏幕完全隐藏左侧栏，或改为汉堡菜单 */
    }
    .main-game {
        margin-left: 0; /* 主内容区占满宽度 */
        padding: 10px;
    }
    footer {
        margin-left: 0;
    }
}

/* 移除旧的自定义变量的 !important 规则，因为我们已经重构了颜色方案 */
/* .game-links, .mini-games, .main-game, .game-features, .how-to-play, .player-reviews, .faq, .why-section, .why-item {
    border: none !important; 
}
.game-links h2, .mini-games h2, .game-info h2, .why-section h3 {
    border-bottom: none !important; 
}
.game-features, .how-to-play, .player-reviews, .faq, .why-section {
    color: var(--text-dark-on-light) !important; 
}
.game-description, .game-tips, .game-updates, .faq-item {
    color: var(--text-dark-on-light) !important; 
}
.game-features h3, .how-to-play h3, .player-reviews h3, .faq h3, .why-section h3, .game-description h3, .game-tips h3, .game-updates h3, .faq-item h4, .why-item h4 {
    color: var(--accent-vibrant-green) !important; 
}
.review p, .review span {
    color: var(--text-dark-on-light) !important; 
}
.why-item p {
    color: var(--text-dark-on-light) !important; 
} */


/* 新增的中间小游戏区域样式 */
.central-mini-games-section {
    padding: 20px 0; /* 上下内边距 */
    margin-bottom: 20px; /* 下外边距 */
    /* border-top: 1px solid var(--border-color-soft); 顶部边框 (注释掉，让页面更简洁) */
    /* border-bottom: 1px solid var(--border-color-soft); 底部边框 (注释掉) */
}

.central-mini-games-section h2 {
    font-size: 1.8em; /* 标题字号 */
    color: var(--accent-vibrant-green); /* 标题颜色：鲜绿色 */
    text-align: center; /* 文本居中 */
    margin-bottom: 20px; /* 下外边距 */
    font-family: 'Press Start 2P', cursive; /* 字体 */
}

/* 中间小游戏网格布局 */
.sub-mini-game-grid {
    /* 使用 Grid 布局 */
    display: grid;
    /* 列模板：默认为两列，主要影响右侧边栏。中间区域的 .sub-mini-game-grid 会被更具体的规则覆盖。 */
    grid-template-columns: repeat(2, 1fr); /* 右侧边栏小游戏固定为两列 */
    /* 间距 */
    gap: 10px;
}

/* 响应式调整：在中等屏幕上改为3列 */
@media (max-width: 1024px) {
    .sub-mini-game-grid {
        grid-template-columns: repeat(3, 1fr); /* 3列 */
    }
}

/* 响应式调整：在小屏幕上改为2列 */
@media (max-width: 600px) {
    .sub-mini-game-grid {
        grid-template-columns: repeat(2, 1fr); /* 2列 */
    }
    .central-mini-games-section h2 {
        font-size: 1.5em; /* 减小标题字号 */
    }
} 