html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#webgl {
    display: block;
    width: 100%;
    height: 100%;
    background-color: black;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font: 18px sans-serif;
    z-index: 10;
    pointer-events: none;
}

#vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(
        ellipse 98% 62% at 50% 50%,
        transparent 55%,
        rgba(0, 1, 49, 0.6) 100%
    );
}

/* ★ 音乐控制按钮 */
#musicBtn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 20;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

#musicBtn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

#musicBtn.playing {
    border-color: rgba(255, 200, 80, 0.6);
    animation: musicPulse 2s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 80, 0.3); }
    50%      { box-shadow: 0 0 12px 4px rgba(255, 200, 80, 0.15); }
}

/* ==================== 开场标题屏 ==================== */
@font-face {
    font-family: "TitleFont";
    src: url("https://thelittleprince.oss-cn-beijing.aliyuncs.com/tittle.ttf") format("truetype");
}
@font-face {
    font-family: "GoFont";
    src: url("https://thelittleprince.oss-cn-beijing.aliyuncs.com/go.TTF") format("truetype");
}

#titleScreen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: background-color 2.5s ease;
    cursor: pointer;
}

#titleScreen .title-main {
    font-family: "TitleFont", serif;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(36px, 7vw, 90px);
    letter-spacing: 0.08em;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2.5s ease, transform 2.5s ease;
}
#titleScreen.revealed .title-main {
    opacity: 1;
    transform: translateY(0);
}

#titleScreen .title-sub {
    font-family: "GoFont", sans-serif;
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(14px, 2.2vw, 26px);
    letter-spacing: 0.15em;
    margin-top: 32px;
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 3.0s ease 0.8s, transform 3.0s ease 0.8s;
    animation: breathe 3s ease-in-out infinite 3.5s;
}
#titleScreen.revealed .title-sub {
    opacity: 1;
    transform: translateY(0);
}

@keyframes breathe {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 0.9; }
}

/* ========== 单击：黑底 2.5 秒渐隐，文字留着 ========== */
#titleScreen.bg-clear {
    background-color: rgba(0, 0, 0, 0);
    pointer-events: none;
    cursor: default;
}

/* ========== 双击模型后：文字 1.8 秒渐隐 ========== */
#titleScreen.text-hide .title-main {
    opacity: 0 !important;
    transition: opacity 1.8s ease !important;
}
#titleScreen.text-hide .title-sub {
    opacity: 0 !important;
    transition: opacity 1.8s ease !important;
    animation: none !important;
}
