/* ================= 全局重置 ================= */
* { box-sizing: border-box; user-select: none; -webkit-user-drag: none; }
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; background-color: #F4F9FF; 
    font-family: 'Helvetica Neue', Helvetica, 'Microsoft YaHei', sans-serif;
}

/* ================= 丝滑 UI 入场动画 ================= */
@keyframes popIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ================= 高级白蓝科技背景 ================= */
#game-container {
    position: relative; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #FFFFFF 0%, #E6F2FF 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    overflow: hidden;
}
.bg-grid {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 116, 217, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 116, 217, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite; z-index: 1;
}
@keyframes gridMove { 0% { transform: translateY(0); } 100% { transform: translateY(40px); } }

/* ================= UI 元素 ================= */
#marquee {
    position: absolute; top: 20px; width: 85%; max-width: 800px;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px);
    color: #0074D9; padding: 12px 25px; border-radius: 30px; 
    box-shadow: 0 5px 15px rgba(0, 116, 217, 0.1);
    white-space: nowrap; overflow: hidden; display: none; z-index: 100;
    font-weight: bold; font-size: 18px; border: 2px solid #B3D4FF;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#marquee span { display: inline-block; padding-left: 100%; animation: marquee 15s linear infinite; }
@keyframes marquee { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }

#danmaku-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; overflow: hidden; }
.danmaku {
    position: absolute; white-space: nowrap; font-size: 28px; font-weight: 900;
    color: #0074D9; 
    text-shadow: 2px 2px 0 #FFF, -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 0 5px 10px rgba(0,116,217,0.2);
    animation: fly linear forwards;
}
@keyframes fly { from { transform: translateX(100vw); } to { transform: translateX(-100vw); } }

/* ================= 立绘与动画 ================= */
#sprite-container {
    position: absolute; bottom: 25%; height: 60vh;
    display: flex; justify-content: center; align-items: flex-end; z-index: 80;
}
.sprite {
    max-height: 100%; max-width: 90vw; border-radius: 15px;
    filter: drop-shadow(0 15px 30px rgba(0, 116, 217, 0.2));
    animation: breathe 4s ease-in-out infinite;
    transition: transform 0.1s;
}
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-15px) scale(1.02); filter: drop-shadow(0 20px 40px rgba(0, 116, 217, 0.3)); } }

.jelly-anim { animation: jelly 0.8s cubic-bezier(0.25, 1, 0.5, 1) !important; }
@keyframes jelly { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(1.3, 0.7); } 50% { transform: scale(0.8, 1.2); } 70% { transform: scale(1.1, 0.9); } }

.shake-anim { animation: severe-shake 0.5s cubic-bezier(.36,.07,.19,.97) both !important; }
@keyframes severe-shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    10%, 90% { transform: translate3d(-10px, 10px, 0) rotate(-2deg); }
    20%, 80% { transform: translate3d(20px, -15px, 0) rotate(3deg); }
    30%, 50%, 70% { transform: translate3d(-25px, 20px, 0) rotate(-4deg); }
    40%, 60% { transform: translate3d(25px, -20px, 0) rotate(4deg); }
}

#flash-bang {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 900; opacity: 0; pointer-events: none;
}
.flash-anim { animation: flash 0.8s ease-out forwards; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ================= 高级白蓝玻璃对话框 ================= */
#dialogue-area {
    position: relative; width: 90%; max-width: 1000px; height: 200px;
    margin-bottom: 40px; z-index: 200; cursor: pointer; display: none;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#dialogue-box {
    position: absolute; bottom: 0; width: 100%; height: 180px;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 2px solid #81D4FA; border-radius: 15px;
    padding: 35px 45px; box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 116, 217, 0.15), inset 0 0 20px rgba(255,255,255,0.8);
}
#name-tag {
    position: absolute; top: -25px; left: -10px;
    background: linear-gradient(135deg, #00BFFF, #0074D9); color: #FFF;
    font-size: 24px; font-weight: 900; padding: 10px 40px;
    border-radius: 5px 25px 25px 5px; box-shadow: 0 5px 15px rgba(0, 116, 217, 0.3);
    border: 2px solid #FFF;
}
#text-content { font-size: 26px; color: #003366; line-height: 1.6; font-weight: bold; }
#next-indicator {
    position: absolute; bottom: 20px; right: 30px;
    color: #0074D9; font-size: 28px; animation: bounce-down 1s infinite; display: none;
}
@keyframes bounce-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ================= 选项层与按钮 ================= */
#choice-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(244, 249, 255, 0.85); backdrop-filter: blur(8px); z-index: 300;
    animation: fadeIn 0.3s ease-out forwards;
}
.choice-btn {
    background: #FFF; color: #0074D9;
    border: 2px solid #0074D9; font-size: 24px; font-weight: 900;
    padding: 18px 50px; margin: 15px; border-radius: 8px;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 5px 15px rgba(0, 116, 217, 0.1); width: 350px;
    pointer-events: auto; text-transform: uppercase; letter-spacing: 2px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}
.choice-btn:nth-child(1) { animation-delay: 0.1s; }
.choice-btn:nth-child(2) { animation-delay: 0.2s; }
.choice-btn:nth-child(3) { animation-delay: 0.3s; }

.choice-btn:hover { background: #0074D9; color: #FFF; transform: scale(1.05); box-shadow: 0 10px 25px rgba(0, 116, 217, 0.3); }
.choice-btn:active { transform: scale(0.95); }

/* ================= KTV 面板 ================= */
#ktv-layer {
    position: absolute; top: 15%; right: 5%; background: rgba(255, 255, 255, 0.95);
    border: 2px solid #00BFFF; border-radius: 15px; padding: 30px;
    color: #003366; font-size: 26px; font-weight: 900; display: none; z-index: 150;
    box-shadow: 0 15px 40px rgba(0, 116, 217, 0.2);
    backdrop-filter: blur(10px); transform: perspective(500px) rotateY(-10deg);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.ktv-line { margin: 12px 0; opacity: 0.4; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); color: #7F9EBA; }
.ktv-active { opacity: 1; color: #0074D9; text-shadow: 0 0 10px rgba(0,116,217,0.2); transform: scale(1.1) translateX(15px); }
.ktv-comment { font-size: 18px; color: #B3D4FF; font-weight: normal; }

/* ================= 浮层 ================= */
.overlay-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(230,242,255,0.98));
    backdrop-filter: blur(10px); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.title-text { color:#0074D9; font-size: 45px; text-shadow: 0 4px 10px rgba(0,116,217,0.2); margin-bottom: 10px; letter-spacing: 2px; }
.subtitle-text { color: #00BFFF; font-size: 20px; font-weight: bold; background: rgba(0,116,217,0.05); padding: 10px 20px; border-radius: 5px; margin-bottom: 40px; border: 1px solid #81D4FA; }
.end-box { background: rgba(255,255,255,0.95); padding: 50px; border-radius: 15px; border: 2px solid #00BFFF; box-shadow: 0 10px 40px rgba(0,116,217,0.2); animation: popIn 0.5s forwards; }

/* ================= 鼠标悬停陷阱 ================= */
#hover-trap { position: absolute; width: 350px; height: 450px; z-index: 250; display: none; }
.trap-hint {
    position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
    background: #0074D9; color: #FFF; padding: 10px 20px; border-radius: 5px;
    font-size: 22px; font-weight: bold; white-space: nowrap;
    animation: bounce-down 0.8s infinite, popIn 0.4s forwards; box-shadow: 0 5px 15px rgba(0,116,217,0.4);
}
.trap-hint::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border-width: 10px 10px 0; border-style: solid; border-color: #0074D9 transparent transparent transparent; }

/* ================= 核爆级彩蛋与蓝屏 ================= */
#easter-egg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 99999; display: none; flex-direction: column;
    justify-content: center; align-items: center; overflow: hidden;
}
.crt-scanline {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%; z-index: 10; pointer-events: none;
}
.fatal-error { color:#ff003c; font-size: 60px; font-weight: 900; z-index: 5; text-align: center; }
.glitch-text { position: relative; animation: glitch-skew 1s infinite linear alternate-reverse; }
.glitch-text::before, .glitch-text::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.glitch-text::before { left: 5px; text-shadow: -2px 0 #00E5FF; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim 5s infinite linear alternate-reverse; }
.glitch-text::after { left: -5px; text-shadow: -2px 0 #ff003c; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim2 5s infinite linear alternate-reverse; }

.glitch-img { max-height: 65vh; border: 10px solid #ff003c; box-shadow: 0 0 50px #ff003c; z-index: 5; animation: img-glitch 0.2s infinite; filter: contrast(1.5) saturate(2); }
@keyframes img-glitch { 0% { transform: translate(0); filter: hue-rotate(0deg); } 20% { transform: translate(-10px, 5px); filter: hue-rotate(90deg) invert(1); } 40% { transform: translate(10px, -5px); filter: hue-rotate(180deg); } 60% { transform: translate(-5px, 10px); filter: hue-rotate(270deg) invert(1); } 80% { transform: translate(5px, -10px); filter: hue-rotate(360deg); } 100% { transform: translate(0); } }
.panic-text { color: #fff; font-size: 45px; font-weight: 900; background: #ff003c; padding: 20px 40px; margin-top: 30px; z-index: 5; animation: severe-shake 0.1s infinite; box-shadow: 0 0 30px #ff003c; }

#bsod {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #0078D7; color: white; z-index: 100000; display: none;
    padding: 80px 10%; box-sizing: border-box; cursor: none;
}
.bsod-face { font-family: 'Segoe UI', Arial, sans-serif; font-size: 160px; margin:0; font-weight: 300; line-height: 1; }
.bsod-title { font-family: 'Segoe UI', Arial, sans-serif; font-size: 32px; font-weight: normal; margin-top: 30px; }
.bsod-desc { font-family: 'Segoe UI', Arial, sans-serif; font-size: 24px; margin-top: 40px; line-height: 1.8; }

/* ================= 粉兔男友终极彩蛋 ================= */
#fentu-easter-egg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #050505; z-index: 200000; display: none; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    animation: fadeIn 1s ease-out forwards;
}
.fentu-img {
    max-height: 55vh; border-radius: 15px; box-shadow: 0 15px 40px rgba(255, 105, 180, 0.4);
    border: 4px solid #FF69B4;
    animation: float-fentu 4s ease-in-out infinite, popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes float-fentu { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

#fentu-dialogue-box {
    position: relative; width: 85%; max-width: 800px;
    background: rgba(20, 5, 10, 0.8); border: 2px solid #FF69B4;
    border-radius: 15px; padding: 35px 45px; margin-top: 50px;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.2);
    opacity: 0; animation: popIn 0.6s 0.5s forwards; /* 延迟半秒弹出对话框 */
}
#fentu-name-tag {
    position: absolute; top: -25px; left: -10px;
    background: linear-gradient(135deg, #FF69B4, #FF1493); color: #FFF;
    font-size: 24px; font-weight: 900; padding: 10px 40px;
    border-radius: 5px 25px 25px 5px; box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
    border: 2px solid #FFF;
}
#fentu-text {
    font-size: 32px; color: #FFF; font-weight: bold; text-shadow: 0 2px 8px rgba(255,105,180,0.6);
    letter-spacing: 2px;
}