/* ==================== games.css ==================== */
/* 游戏卡片、游戏分类、游戏中心样式 */
/* 包含：热门游戏、奖金池、中奖滚动、游戏分类网格、游戏内容区域（游戏中心） */

/* ==================== 热门游戏 ==================== */
.hot-games-section {
    padding: 15px;
    background: #2a2d4a;
    margin-top: 2px;
    margin-bottom: 2px;
}

.hot-games-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.hot-games-title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-right: 3px;
}

/* 奖金池样式 */
.jackpot-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    overflow: visible;
}

.jackpot-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    /* 根据GIF图片实际比例设置，确保定位准确 */
    aspect-ratio: 800 / 200; /* 假设GIF是800x200，根据实际情况调整 */
}

.jackpot-image {
    width: 100%;
    height: auto;
    display: block;
}

/* 数字覆盖层 - 纯色无发光 */
.jackpot-number-overlay {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(14px, 3vw, 24px);
    font-weight: 900;
    /* 纯色文字 */
    color: #FFD700;
    font-family: 'Arial Black', 'Impact', sans-serif;
    /* 无发光效果 */
    filter: none;
    animation: number-scale 2s ease-in-out infinite;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    letter-spacing: 2px;
    line-height: 1;
    width: auto;
    min-width: 0;
}

@keyframes number-scale {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.win-marquee-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 56px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.win-marquee-row {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.win-marquee-content {
    display: flex;
    animation: marquee-scroll 25s linear infinite;
}

.win-marquee-row:nth-child(2) .win-marquee-content {
    animation: marquee-scroll 30s linear infinite;
    animation-delay: -15s;
}

@keyframes marquee-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.win-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #1a1c2e;
    border-radius: 16px;
    margin-right: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-size: 12px;
}

.vip-badge-marquee {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

.vip-badge-marquee.vip1 { background: #9e9e9e; }
.vip-badge-marquee.vip2 { background: #4CAF50; }
.vip-badge-marquee.vip3 { background: #4fc3f7; }
.vip-badge-marquee.vip4 { background: #ba68c8; }
.vip-badge-marquee.vip5 { background: #ff9800; }
.vip-badge-marquee.vip6 { background: linear-gradient(135deg, #ff6b6b, #ffd700); }

.win-username {
    color: #ccc;
}

.win-platform {
    color: #888;
}

.win-amount {
    color: #4CAF50;
    font-weight: bold;
}

.hot-game-card {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
}

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

.hot-game-icon {
    width: 100%;
    max-width: 60px;
    height: 60px;
    background: transparent;
    display: block;
    object-fit: cover;
    margin: 0 auto;
    border-radius: 12px;
}

.hot-game-name {
    padding: 8px 5px;
    text-align: center;
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* ==================== 游戏分类网格（首页） ==================== */
.category-games-title {
    display: flex;
    align-items: center;
    padding: 15px 15px 2px 15px;
    background: #2a2d4a;
    gap: 10px;
}

.category-games-title > span {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.game-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 10px;
    padding: 2px 15px 15px 15px;
    background: #2a2d4a;
}

.category-item {
    background: #1a1c2e;
    border: 1px solid #3d4166;
    border-radius: 10px;
    padding: 0;
    text-align: center;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 120px;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.category-item.tall {
    grid-row: span 2;
    min-height: 160px !important;
    height: 160px !important;
}

.category-item.tall .category-image {
    flex: none;
    width: 70%;
    height: auto;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0 0 10px 10px;
}

.category-item.wide {
    grid-column: span 2;
    min-height: 110px;
    flex-direction: row;
    align-items: flex-start;
}

.category-item.wide .category-text-wrapper {
    display: flex;
    flex-direction: column;
    padding: 10px 0 0 10px;
}

.category-item.wide .category-name {
    padding: 0;
    text-align: left;
}

.category-item.wide .category-desc {
    padding: 2px 0 0;
    text-align: left;
}

.category-item.wide .category-image-wide {
    flex: none;
    width: 30%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0 10px 10px 0;
    margin-left: auto;
}

.category-item:not(.tall):not(.wide):not(.short) {
    min-height: 80px !important;
    height: 80px !important;
}

.category-item.horizontal {
    flex-direction: row;
    align-items: flex-start;
}

.category-text-wrapper {
    display: flex;
    flex-direction: column;
    padding: 10px 0 0 10px;
}

.category-item.horizontal .category-name {
    padding: 0;
    text-align: left;
}

.category-item.horizontal .category-desc {
    padding: 2px 0 0;
    text-align: left;
}

.category-item.horizontal .category-image,
.category-item.horizontal .category-image-short {
    flex: none;
    width: 50%;
    height: 100%;
    border-radius: 0 10px 10px 0;
    margin-left: auto;
}

.category-item.short {
    min-height: 80px !important;
    height: 80px !important;
}

.category-image {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 0 0 10px 10px;
}

.category-image-short {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 0 0 10px 10px;
}

.category-name {
    font-size: 15px;
    font-weight: bold;
    padding: 8px 0 4px;
    color: #fff;
}

.category-item.tall .category-name {
    font-size: 18px;
    padding: 10px 0 6px;
}

.category-item.short .category-name {
    font-size: 13px;
    padding: 6px 0 3px;
}

.category-desc {
    font-size: 11px;
    color: #888;
    padding: 0 0 2px;
    text-align: left;
}

.category-item.tall .category-desc {
    font-size: 12px;
    padding: 0 0 4px;
    text-align: center;
}

.category-item.horizontal .category-desc {
    padding: 2px 0 0 10px;
    text-align: left;
}

.category-item.short .category-desc {
    font-size: 10px;
}

/* ==================== 游戏内容区域（游戏中心） ==================== */
.game-content {
    display: flex;
    height: calc(100vh - 120px);
    overflow: hidden;
}

/* 左侧子分类列表 */
.subcategory-sidebar {
    width: 57px;
    background: #1a1c2e;
    border-right: 1px solid #3d4166;
    overflow-y: auto;
    flex-shrink: 0;
    height: 100%;
}

.subcategory-item {
    padding: 8px 2px;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid #3d4166;
    transition: all 0.3s;
    font-size: 9px;
    word-break: break-all;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #aaa;
}

.subcategory-icon {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.subcategory-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.subcategory-name {
    font-size: 8px;
    line-height: 1.2;
}

.subcategory-item:hover {
    background: #3d4166;
    color: #fff;
}

.subcategory-item.active {
    background: #4CAF50;
    color: white;
    font-weight: bold;
}

/* 右侧游戏网格 */
.games-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    height: 100%;
    background: #2a2d4a;
}

/* 搜索框 */
.search-box {
    position: relative;
    position: sticky;
    top: 0;
    background: #2a2d4a;
    padding: 8px 0;
    z-index: 10;
    margin-bottom: 8px;
}

.search-input {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 1.5px solid #3d4166;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
    outline: none;
    height: 36px;
    box-sizing: border-box;
    background: #1a1c2e;
    color: #fff;
}

.search-input::placeholder {
    color: #888;
}

.search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #4CAF50;
    font-weight: 500;
    pointer-events: none;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.game-card {
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

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

/* 收藏按钮 */
.game-card-favorite {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.game-card-favorite:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.game-card-favorite svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.game-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-width: 100%;
}

.game-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card-icon span {
    font-size: 32px;
}

.game-card-name {
    font-size: 12px;
    color: #eee;
    word-break: break-word;
    line-height: 1.3;
}

/* ==================== 游戏iframe容器 ==================== */
.game-frame-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* 确保iframe容器在最顶层 */
.game-frame-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.game-frame-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.game-frame-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-frame-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.game-frame-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
}

.game-frame-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-frame-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.game-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #000;
}

/* 移动端竖屏适配 - 限制最大宽度 */
@media (max-width: 768px) {
    .game-frame-container {
        background: #000;
    }
    
    .game-frame {
        max-width: 100%;
        margin: 0 auto;
    }
}

/* 横屏提示 - 在桌面端显示竖屏效果 */
@media (min-width: 769px) {
    .game-frame {
        max-width: 450px; /* 模拟手机竖屏宽度 */
        margin: 0 auto;
        border-left: 2px solid #333;
        border-right: 2px solid #333;
    }
}

/* 游戏加载动画 */
.game-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 全屏模式样式 */
.game-frame-container:fullscreen {
    background: #000;
}

.game-frame-container:fullscreen .game-frame-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-frame-container:fullscreen:hover .game-frame-header {
    opacity: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .game-frame-header {
        padding: 8px 12px;
    }
    
    .game-frame-back-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .game-frame-title {
        font-size: 14px;
    }
    
    .game-frame-fullscreen-btn {
        width: 36px;
        height: 36px;
    }
}
