/* ================= 基础重置与白粉主题变量 ================= */
:root {
    --primary-pink: #ffb6c1;
    --deep-pink: #ff8da1;
    --light-pink: #fff0f5;
    --text-dark: #4a4a4a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f8f8f8;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

/* 游戏主容器 */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 182, 193, 0.4);
    transition: filter 0.3s;
}

/* 梦幻白粉渐变背景 */
#bg-gradient {
    position: absolute;
    inset: -10%;
    background: linear-gradient(135deg, #ffffff 0%, #fff0f5 50%, #ffe4e1 100%);
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.camera-zoom-bg { transform: scale(1.15); }

/* 动态樱花特效 */
#sakura-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.sakura-petal {
    position: absolute;
    background: linear-gradient(135deg, #ffc0cb, #ffb6c1);
    border-radius: 150% 0 150% 0;
    box-shadow: 0 0 5px rgba(255,182,193,0.5);
    animation: fall linear infinite;
}
@keyframes fall {
    0% { transform: translateY(-10vh) rotate(0deg) scale(0.5); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(360deg) scale(1.2); opacity: 0; }
}

/* ================= 画面特效与镜头语言 ================= */
.shake-anim { animation: screenShake 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-6px, -6px) rotate(-1.5deg); }
    20%, 40%, 60%, 80% { transform: translate(6px, 6px) rotate(1.5deg); }
}

#flash-overlay {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 90;
}
.flash-anim { animation: flashEffect 0.6s ease-out; }
@keyframes flashEffect { 0% { opacity: 1; } 100% { opacity: 0; } }

#action-lines {
    position: absolute;
    inset: -50%;
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0deg 3deg,
        rgba(255, 141, 161, 0.15) 3deg 4deg,
        transparent 4deg 8deg,
        rgba(255, 141, 161, 0.08) 8deg 9deg
    );
    opacity: 0;
    pointer-events: none;
    z-index: 85;
    mix-blend-mode: multiply;
}
.action-lines-anim { animation: actionLinesFade 0.5s ease-out; }
@keyframes actionLinesFade {
    0% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1); }
}

/* 点击波纹小玩意 */
.click-ripple {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--deep-pink);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: rippleAnim 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}
@keyframes rippleAnim {
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; border-width: 0; }
}

/* 飘浮爱心小玩意 */
.floating-heart {
    position: absolute;
    color: #ff6b81;
    font-size: 2rem;
    pointer-events: none;
    z-index: 85;
    opacity: 0;
    animation: floatUpHeart 1.5s ease-out forwards;
    text-shadow: 0 0 10px rgba(255, 107, 129, 0.5);
}
@keyframes floatUpHeart {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    100% { transform: translateY(-150px) scale(1.5); opacity: 0; }
}

/* ================= 趣味弹窗与弹幕系统 ================= */
#popup-container {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    z-index: 80;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.sys-popup {
    background: rgba(255, 255, 255, 0.95);
    border-left: 5px solid var(--deep-pink);
    color: var(--text-dark);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.5);
    animation: popupSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, popupFadeOut 0.4s 2.5s forwards;
}
@keyframes popupSlideIn { 0% { transform: translateY(-20px) scale(0.8); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes popupFadeOut { 0% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

#danmaku-container {
    position: absolute;
    top: 15%;
    width: 100%;
    height: 40%;
    z-index: 70;
    pointer-events: none;
    overflow: hidden;
}
.danmaku-item {
    position: absolute;
    right: -100%;
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4), 0 0 5px var(--deep-pink);
    white-space: nowrap;
    animation: danmakuMove 4s linear forwards;
}
/* 黄金VIP弹幕特效 */
.vip-danmaku {
    color: #ffd700;
    font-size: 1.5rem;
    text-shadow: 0 0 10px #ff8c00, 1px 1px 3px #000;
    z-index: 75;
}
@keyframes danmakuMove { 0% { right: -20%; } 100% { right: 120%; } }

/* ================= UI 界面 ================= */
#start-screen {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(15px);
    transition: opacity 0.6s ease;
}
.title {
    font-size: 4rem;
    color: var(--deep-pink);
    text-shadow: 2px 2px 0 #fff, 0 0 20px rgba(255, 182, 193, 0.8);
    margin-bottom: 10px;
    letter-spacing: 4px;
    text-align: center;
    line-height: 1.2;
    font-weight: 900;
    animation: floatTitle 3s ease-in-out infinite alternate;
    cursor: pointer; /* 提示可点击 */
}
@keyframes floatTitle { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }
.subtitle { color: #888; font-size: 1.1rem; margin-bottom: 60px; font-weight: bold; }
.btn {
    width: 75%;
    padding: 18px 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--deep-pink);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-pink);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 12px 0;
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.3);
}
.btn:active { background: var(--primary-pink); color: #fff; transform: scale(0.92); }
#btn-easter-egg { border-color: #ff4d4d; color: #ff4d4d; }

/* 立绘展示区 */
#character-layer {
    position: absolute;
    bottom: 24%;
    left: 50%;
    transform: translateX(-50%) translateY(30px) scale(0.95);
    width: 95%;
    height: 68%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 8;
}
#character-layer.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    animation: floatBreathe 3.5s ease-in-out infinite alternate;
}
@keyframes floatBreathe { 0% { transform: translateX(-50%) translateY(0); } 100% { transform: translateX(-50%) translateY(10px); } }

/* 立绘图片 (加入戳一戳动画) */
#character-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(255, 182, 193, 0.6));
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto; /* 允许点击立绘 */
    cursor: pointer;
}
.camera-zoom-img { transform: scale(1.15); }
.poke-anim { animation: pokeBounce 0.3s ease; }
@keyframes pokeBounce {
    50% { filter: drop-shadow(0 20px 30px rgba(255, 182, 193, 0.9)) brightness(1.1); padding-bottom: 15px; }
}

/* 对话框 */
#dialogue-box {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    width: 94%;
    height: 24%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 2px solid #fff;
    padding: 40px 25px 15px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.8);
    display: none;
    cursor: pointer;
    z-index: 10;
}
/* 名字框流光特效 */
#name-tag {
    position: absolute;
    top: -20px;
    left: 20px;
    background: linear-gradient(135deg, var(--deep-pink), var(--primary-pink));
    color: #fff;
    padding: 6px 30px;
    font-size: 1.2rem;
    font-weight: 900;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.6);
    border: 3px solid #fff;
    overflow: hidden;
}
#name-tag::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
    transform: skewX(-20deg);
    animation: nameShine 3s infinite;
}
@keyframes nameShine { 0% { left: -100%; } 20%, 100% { left: 200%; } }

#text-content {
    color: var(--text-dark);
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: bold;
    height: 100%;
    overflow-y: auto;
}
/* 打字机光标特效 */
.typing-cursor {
    color: var(--deep-pink);
    animation: blinkCursor 0.8s infinite;
}
@keyframes blinkCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* 旋转跳跃的指示器 */
.next-indicator {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: var(--deep-pink);
    font-size: 1.5rem;
    animation: bounceSpin 2s infinite ease-in-out;
}
@keyframes bounceSpin {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(5px) rotate(180deg); }
}

/* 选项界面 */
#choice-screen {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}
.choice-btn {
    width: 85%;
    padding: 20px;
    margin: 12px 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--deep-pink);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--primary-pink);
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 8px 20px rgba(255, 182, 193, 0.4);
    transition: all 0.2s;
}
.choice-btn:active { background: var(--primary-pink); color: #fff; transform: scale(0.95); }

/* 隐藏彩蛋终极弹窗 */
#easter-egg-popup {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    color: #ff0000;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: 900;
    z-index: 200;
    text-shadow: 0 0 30px #ff0000;
    text-align: center;
    animation: jumpscareShake 0.1s infinite;
}