/* 
 * layout.css
 * 包含页面布局、游戏卡片样式、响应式设计等
 */

/* 页面加载指示器样式 */
.page-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    z-index: 9999;
    transition: width 0.3s ease-out, opacity 0.3s ease;
}

/* 内容过渡效果 */
main {
    transition: opacity 0.3s ease;
}

/* 游戏卡片样式 */
.game-card {
    transition: transform 0.3s ease;
    position: relative;
    margin-bottom: 1.5rem;
}

.game-card a {
    position: relative;
    display: block;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-preview {
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #111827;
    position: relative !important; /* 强制相对定位 */
}

.game-preview img, .game-preview video {
    transition: transform 0.3s ease;
    width: 100%;
    display: block;
}

.game-card:hover .game-preview img,
.game-card:hover .game-preview video {
    transform: scale(1.05);
}

/* 视频相关样式 */
.game-preview video {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-preview video {
    opacity: 1;
}

/* 悬停时显示的游戏名称 */
.game-hover-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
    color: white;
    padding: 20px 10px 10px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.game-card:hover .game-hover-title {
    opacity: 1;
}

/* 游戏标识样式 */
.featured-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 0 0 8px 0; /* 只有右下角是圆角 */
    background-color: #ff6b2b; /* 橙色背景 */
    color: white; /* 白色文字 */
    font-size: 0.85rem;
    font-weight: bold;
    position: absolute;
    top: 0;
    left: 0;
    text-transform: uppercase; /* 文本转为大写 */
    z-index: 20; /* 增加z-index确保在最上层 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Arial', sans-serif;
    line-height: 1;
    pointer-events: none; /* 确保标识不会阻碍点击 */
}

/* 在游戏卡片中的位置 */
.game-card .featured-badge {
    /* 重置之前的transform */
    transform: none;
}

/* 游戏悬停标题中不再需要特殊处理标识 */
.game-hover-title .featured-badge {
    display: none; /* 隐藏标题中的标识，只保留左上角的标识 */
}

/* 标记当前游戏样式 */
.current-game-marker {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #ff4757;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
    font-weight: bold;
}

/* 信息区块布局 */
.game-how-to-play, .game-faq, .game-features, .game-also-like {
    background-color: rgba(31, 41, 55, 0.3);
    backdrop-filter: blur(8px);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* 文本区域样式 */
.prose {
    max-width: none;
    overflow: visible;
    min-height: fit-content;
    height: auto;
    color: #a0aec0;
    font-weight: 400;
}

/* 游戏视频容器 */
.gameplay-video-container {
    position: relative;
    width: 80%;
    max-width: 560px;
    margin: 0 auto;
    padding-top: 45%;
    overflow: hidden;
    border-radius: 0.5rem;
}

.gameplay-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 游戏卡片播放按钮 */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s ease;
}

.play-button:hover {
    background-color: rgba(99, 102, 241, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 游戏侧边栏 */
.games-sidebar {
    padding: 1.5rem;
    background-color: rgba(31, 41, 55, 0.3);
    backdrop-filter: blur(8px);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.games-sidebar h3 {
    margin-bottom: 0.5rem; /* Reduce space after heading */
}

.games-sidebar .space-y-6 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Add smaller gap between game cards */
}

.games-sidebar .game-card {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .games-sidebar {
        margin-top: 2rem;
    }
}