/* style_title.css */
/* 职责：标题画面样式 (最终修正版 - 修复无法进入游戏的问题)。 */

/* --- 1. 场景容器 (核心修复) --- */
/* [修改] 加上 .active 类限制。只有当 JS 赋予 active 时，这里才显示为 flex */
/* 这样当 active 被移除时，style_base.css 的 display: none 才能生效 */
#scene-title.active {
    padding: 0;
    margin: 0;
    overflow: hidden;
    background-color: #000;
    display: flex; /* 仅在激活时显示 */
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

/* 如果没有 active，这里不应该有任何 display 属性干扰 */
#scene-title {
    /* 保持宽高占位，防止切换瞬间闪烁 (可选) */
    width: 100%;
    height: 100%;
}

.title-scene-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 1;
}

/* --- 2. 背景层 --- */
.title-background-effect {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--title-bg-image, url('images/bg/title_bg_steam.png'));
    background-size: cover;
    background-position: center;
    transform: scale(1.05); 
}

/* --- 3. 遮罩层 --- */
.title-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 70%, rgba(0,0,0,0.95) 100%);
    pointer-events: none;
}

/* --- 4. 内容区域 --- */
.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
    /* 勿用 42vh：vh 相对浏览器视口，手机地址栏下会把按钮推出 game-container */
    margin-top: auto;
    margin-bottom: 8%;
    padding-bottom: env(safe-area-inset-bottom, 0);
    pointer-events: none;
}

.title-fullscreen-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 40;
    pointer-events: auto;
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, 0.7);
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    cursor: pointer;
}
.title-fullscreen-btn.hidden {
    display: none !important;
}
.title-fullscreen-btn:active {
    transform: scale(0.97);
}

@media (max-height: 420px) {
    .title-logo-img {
        max-width: 62%;
    }
    .subtitle {
        margin-bottom: 0.75rem;
        letter-spacing: 0.4em;
        font-size: 0.9rem;
    }
    .title-button {
        padding: 0.85rem 2.8rem;
        font-size: 1.25rem;
    }
    .version-info {
        bottom: 0.4rem;
        font-size: 0.75rem;
    }
}

/* --- 5. 图片 Logo --- */
.title-logo-img {
    width: 900px;    
    max-width: 90%;  
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.8)); 
    animation: logo-breathe 4s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.8)); }
    50% { transform: scale(1.03); filter: drop-shadow(0 0 40px rgba(139, 92, 246, 1)); }
}

/* --- 6. 副标题 --- */
.subtitle {
    font-size: 1.1rem;
    color: #94a3b8; 
    font-weight: 300;
    letter-spacing: 0.8em; 
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,1); 
    margin-top: -1rem; 
    margin-bottom: 2rem;
}

/* --- 7. 按钮容器 --- */
.title-actions {
    position: relative;
}

/* --- 8. 按钮样式 --- */
.title-button {
    position: relative;
    background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: 2px solid #a78bfa;
    padding: 1.2rem 5rem;
    font-size: 1.6rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 20;
    pointer-events: auto; /* 确保可点击 */
}

.title-button:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.9), 
                0 0 30px rgba(139, 92, 246, 0.7);
}

.title-button:active {
    transform: translateY(1px);
}

/* 按钮扫光特效 */
.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: shine-sweep 4s infinite;
    pointer-events: none;
}

@keyframes shine-sweep {
    0% { left: -100%; }
    10% { left: 200%; }
    100% { left: 200%; }
}

/* --- 9. 版本信息 --- */
.version-info {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-family: monospace;
    z-index: 30;
}