/**
 * Free Mini Games - Loading Indicator Fix
 * 解决游戏加载指示器不消失的问题
 * 2024-04-02
 */

/* 游戏加载指示器样式美化 */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-indicator i {
    color: #0078D7;
    margin-bottom: 15px;
    animation: spin 1.2s linear infinite;
}

.loading-indicator p {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

/* 改进加载完成后的隐藏效果 */
.loading-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 当游戏加载完成时隐藏指示器 */
.game-frame.loaded .loading-indicator {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 加载过渡动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-frame iframe {
    animation: fadeIn 0.5s ease-in-out;
}

/* 确保游戏内容显示 */
.game-frame iframe {
    opacity: 1 !important;
    z-index: 2 !important;
}

/* 修复game-frame和loading-indicator的层级关系 */
.game-frame {
    position: relative;
}

.game-frame .loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
} 