/* CSS样式开始 */
/* 通用和背景 */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0c0d12;
    color: #fff;
}

/* 游戏容器 */
.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* iframe游戏区域 */
#game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 10;
    display: none;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.6s ease;
}

#game-iframe.active {
    display: block;
    transform: scale(1);
    opacity: 1;
}

/* 预加载界面 */
.pre-game-area {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.pre-game-area h1 {
    font-size: 2.5rem;
    color: #4CAF50;
    text-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
    margin-bottom: 20px;
}

.pre-game-area p {
    font-size: 1.2rem;
    color: #b0bec5;
    max-width: 600px;
}

.pre-game-logo {
    /* 容器基本样式 */
    display: flex; /* 使用 Flexbox 布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    width: 160px; /* 宽度占满父容器 */
    height: 160px;
}

.pre-game-logo img {
    /* 图片样式 */
    max-width: 80%; /* 限制图片最大宽度为容器的80% */
    max-height: 80%; /* 限制图片最大高度为容器的80% */
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease-in-out;
    transform: scale(1.1);
    animation: pulse 2s infinite; /* 添加一个名为 pulse 的动画，持续2秒，无限次重复 */
    opacity: 0; /* 初始透明度为0 */
    animation-fill-mode: forwards; /* 动画结束后保持最后一帧的状态 */
    animation-delay: 0.5s; /* 动画延迟0.5秒开始 */
    animation-timing-function: ease-out;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-play-state: running;
    animation-name: pulse;
}

/* 关键帧动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    50% {
        transform: scale(1.05); /* 放大到1.05倍 */
        opacity: 1; /* 变为完全不透明 */
    }
    100% {
        transform: scale(1); /* 恢复到原始大小 */
        opacity: 1;
    }
}

/* Play Now 按钮 */
.play-button {
    margin-top: 40px;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, #4CAF50, #2E7D32);
    border: none;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.play-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(76, 175, 80, 0.8);
}

.play-button:active {
    transform: scale(0.95);
}

/* 加载指示器 */
.loader-container {
    display: none; /* 初始隐藏 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 13, 18, 0.9);
    z-index: 25;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.loader {
    border: 8px solid #333;
    border-top: 8px solid #4CAF50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

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

.loader-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #e0e0e0;
}

/* 导航按钮（左上角） */
.nav-buttons {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 30;
    display: flex;
    gap: 15px;
    transition: opacity 0.3s ease;
}

/* 加载时隐藏导航按钮 */
.loader-active .nav-buttons {
    opacity: 0;
}

.nav-button {
    width: 45px;
    height: 45px;
    background-color: rgba(30, 30, 30, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.2rem;
    text-decoration: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-button:hover {
    background-color: rgba(60, 60, 60, 0.9);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* 移动端兼容性 */
@media (max-width: 768px) {
    .pre-game-area h1 {
        font-size: 1.8rem;
    }

    .pre-game-area p {
        font-size: 1rem;
    }

    .play-button {
        font-size: 1.2rem;
        padding: 12px 30px;
    }

    .nav-buttons {
        top: 15px;
        left: 15px;
        gap: 10px;
    }

    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}