/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主体样式 */
body {
    overflow: hidden;
    position: relative;
    width: 100vw;
    height: 100vh;
    /* 背景渐变效果，从暗蓝色到黑色，10秒完成一次 */
    background: linear-gradient(45deg, #0f3278, #000000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Arial', sans-serif;
}

/* 背景渐变动画 */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 英雄选择界面 */
.hero-selection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    text-align: center;
}

.hero-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 80%;
    max-width: 300px;
}

.hero-btn {
    padding: 1rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* 游戏容器 */
.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 星星容器 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 星星样式 */
.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 闪烁的星星 */
.twinkle {
    animation: twinkle 1.5s infinite alternate ease-in-out;
    box-shadow: 0 0 2px 1px rgba(255, 255, 255, 0.5);
}

/* 更快的闪烁星星 */
.twinkle-fast {
    animation: twinkle 0.8s infinite alternate ease-in-out;
    box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.7);
}

/* 星星闪烁动画 */
@keyframes twinkle {
    0% {
        opacity: 0.1;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 小狗样式 */
.dog {
    position: absolute;
    z-index: 10;
    transition: transform 0.05s ease-out;
    transform-origin: center;
    will-change: transform;
}

/* 小狗图片 - 调整大小的地方 */
#dog-img {
    width: 80px; /* 在这里调整狗的大小 */
    height: auto;
    display: block;
    position: relative;
    z-index: 11;
}

/* 狗周围的光晕效果 */
.glow-effect {
    position: absolute;
    width: 120px; /* 比狗的宽度大约1.5倍 */
    height: 120px; /* 比狗的高度大约1.5倍 */
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* 爱心碎片样式 */
.heart-particle {
    position: absolute;
    width: 10px; /* 爱心碎片较大 */
    height: 10px;
    background-color: #ff69b4;
    transform: rotate(45deg);
    z-index: 1;
}

/* 爱心形状 */
.heart-particle:before,
.heart-particle:after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: inherit;
    border-radius: 50%;
}

.heart-particle:before {
    top: -7.5px;
    left: 0;
}

.heart-particle:after {
    top: 0;
    left: -7.5px;
}

/* 暴躁模式UI样式 */
.rage-meter {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 10px;
}

.rage-label {
    color: white;
    margin-right: 5px;
    font-size: 14px;
}

.rage-bar-container {
    width: 100px;
    height: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.rage-bar {
    width: 100%;
    height: 100%;
    background-color: #ff3333;
    transition: width 0.3s ease;
}

.countdown {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 20;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.fuji-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
}

.fuji-img {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url('fuji.png');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    pointer-events: auto;
    cursor: pointer;
    animation: pulse 1s infinite alternate;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    z-index: 25;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* 温柔模式UI样式 */
.question-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    z-index: 20;
    max-width: 80%;
    text-align: center;
}

.question {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.feedback {
    color: white;
    margin-top: 15px;
    font-size: 1.2rem;
    min-height: 24px;
}

/* LOVE矩阵雨效果 */
.love-matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* 改为透明背景 */
    overflow: hidden;
    z-index: 50; /* 调整为比游戏界面元素高但比模态元素低的层级 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* 初始不可见 */
    transition: opacity 2s ease; /* 渐变出现效果 */
    pointer-events: none; /* 不拦截鼠标事件，允许点击底层元素 */
}

.love-matrix.visible {
    opacity: 1; /* 可见状态 */
}

.love-letter {
    position: absolute;
    color: #ff69b4;
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 105, 180, 0.7);
    opacity: 0.8;
    will-change: transform;
    animation: flicker 2s infinite alternate-reverse;
    pointer-events: none; /* 确保字母不会拦截点击事件 */
}

@keyframes flicker {
    0% {
        opacity: 0.5;
        text-shadow: 0 0 5px rgba(255, 105, 180, 0.4);
    }
    25% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.6;
        text-shadow: 0 0 7px rgba(255, 105, 180, 0.8);
    }
    75% {
        opacity: 0.7;
    }
    100% {
        opacity: 0.9;
        text-shadow: 0 0 10px rgba(255, 105, 180, 1);
    }
}

.heart-message {
    position: relative;
    z-index: 210;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* 初始不可见 */
    transition: opacity 2s ease, transform 1.5s ease; /* 渐变出现效果和缩放效果 */
    transform: scale(0.8);
}

.heart-message.visible {
    opacity: 1; /* 可见状态 */
    transform: scale(1);
}

.heart-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,105,180,0.7) 25%, rgba(255,20,147,0.5) 65%);
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.9;
    animation: pulse-heart 2s infinite alternate;
    box-shadow: 0 0 25px rgba(255, 105, 180, 0.8), 
                0 0 45px rgba(255, 20, 147, 0.6), 
                0 0 65px rgba(255, 20, 147, 0.4);
}

.heart-shape:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -60%);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 30 C50 30 37 0 18 0 C0 0 0 18 0 18 C0 35 20 50 50 80 C80 50 100 35 100 18 C100 18 100 0 82 0 C63 0 50 30 50 30 Z" fill="rgba(255,20,147,0.95)"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 0 8px rgba(255, 105, 180, 0.8));
}

/* 添加一个额外的装饰层，增强立体感 */
.heart-shape:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    transform: translate(-50%, -60%);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 30 C50 30 37 0 18 0 C0 0 0 18 0 18 C0 35 20 50 50 80 C80 50 100 35 100 18 C100 18 100 0 82 0 C63 0 50 30 50 30 Z" fill="rgba(255,255,255,0.3)"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: blur(3px);
    opacity: 0.7;
    animation: heart-glow 3s infinite alternate;
}

@keyframes heart-glow {
    0% {
        opacity: 0.3;
        filter: blur(3px);
    }
    50% {
        opacity: 0.7;
        filter: blur(2px);
    }
    100% {
        opacity: 0.5;
        filter: blur(4px);
    }
}

@keyframes pulse-heart {
    0% {
        transform: scale(1);
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.6), 
                    0 0 40px rgba(255, 20, 147, 0.4), 
                    0 0 60px rgba(255, 20, 147, 0.2);
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8; 
    }
    100% {
        transform: scale(1.1);
        opacity: 0.9;
        box-shadow: 0 0 30px rgba(255, 105, 180, 0.8), 
                    0 0 50px rgba(255, 20, 147, 0.6), 
                    0 0 70px rgba(255, 20, 147, 0.4);
    }
}

.heart-text {
    position: relative;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                 0 0 20px rgba(255, 105, 180, 0.6);
    z-index: 211;
    padding: 0 20px;
    animation: text-glow 2s infinite alternate;
    margin-top: 25px; /* 向下调整文字位置，使其与心形更协调 */
    letter-spacing: 2px; /* 增加字间距 */
}

@keyframes text-glow {
    0% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.6),
                     0 0 10px rgba(255, 105, 180, 0.4);
    }
    50% {
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
                     0 0 15px rgba(255, 105, 180, 0.6),
                     0 0 25px rgba(255, 20, 147, 0.4);
    }
    100% {
        text-shadow: 0 0 12px rgba(255, 255, 255, 1),
                     0 0 20px rgba(255, 105, 180, 0.8),
                     0 0 30px rgba(255, 20, 147, 0.6);
    }
}

/* 烟花特效容器 */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 45; /* 位于游戏界面之上，但在LOVE矩阵雨之下 */
    pointer-events: none; /* 不拦截鼠标事件 */
    overflow: hidden;
}

/* 烟花粒子基础样式 */
.firework {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.8);
    will-change: transform, opacity;
}

/* 烟花爆炸点 */
.explosion-point {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.8),
                0 0 40px 10px rgba(255, 200, 200, 0.6);
    transform: scale(0);
    opacity: 0;
    animation: explosion-flash 0.8s ease-out forwards;
}

@keyframes explosion-flash {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    20% {
        transform: scale(4);
        opacity: 0.9;
    }
    40% {
        transform: scale(2);
        opacity: 0.8;
    }
    60% {
        transform: scale(3);
        opacity: 0.6;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 烟花爆炸波纹 */
.explosion-wave {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,200,255,0.15) 30%, rgba(200,100,255,0.1) 60%, transparent 70%);
    box-shadow: 0 0 30px 5px rgba(255, 150, 220, 0.3);
    transform: translate(-50%, -50%) scale(0);
    animation: explosion-wave 1.5s ease-out forwards;
    border: none;
}

@keyframes explosion-wave {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
        background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, rgba(255,200,255,0.4) 30%, rgba(200,100,255,0.3) 60%, transparent 70%);
        box-shadow: 0 0 40px 10px rgba(255, 150, 220, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.5);
    }
    50% {
        opacity: 0.6;
        background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,200,255,0.25) 30%, rgba(200,100,255,0.2) 60%, transparent 70%);
        box-shadow: 0 0 30px 5px rgba(255, 150, 220, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
    100% {
        transform: translate(-50%, -50%) scale(10);
        opacity: 0;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,200,255,0.08) 20%, rgba(200,100,255,0.05) 40%, transparent 60%);
        box-shadow: 0 0 20px 2px rgba(255, 150, 220, 0.1), inset 0 0 8px rgba(255, 255, 255, 0.1);
    }
}

/* 烟花爆炸文字 */
.explosion-text {
    position: absolute;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px #fff, 
                 0 0 20px #ff8, 
                 0 0 30px #f84, 
                 0 0 40px #f44;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    animation: explosion-text 2s ease-out forwards;
    white-space: nowrap;
}

@keyframes explosion-text {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
} 