/* 排球大作战 - 样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    user-select: none;
}

/* 标题动画 */
.game-title {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
    }
    to {
        text-shadow: 0 0 30px rgba(234, 179, 8, 0.6), 0 0 60px rgba(234, 179, 8, 0.4);
    }
}

/* 菜单按钮动画 */
.menu-btn {
    position: relative;
    overflow: hidden;
}

.menu-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

/* 游戏画布 */
#gameCanvas {
    border-radius: 0 0 12px 12px;
    display: block;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* 弹窗动画 */
.animate-bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* 分数闪烁 */
.score-flash {
    animation: scoreFlash 0.3s ease-out;
}

@keyframes scoreFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); color: #fbbf24; }
    100% { transform: scale(1); }
}

/* 暂停遮罩 */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 0 0 12px 12px;
}

.pause-text {
    color: white;
    font-size: 48px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pausePulse 1.5s ease-in-out infinite;
}

@keyframes pausePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 粒子效果 */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFade 0.8s ease-out forwards;
}

@keyframes particleFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}

footer {
    color: #6b7280;
    font-size: 0.75rem;
}

footer a:hover {
    text-decoration: underline;
}

/* AI训练面板 */
#ai-train-panel {
    animation: panelSlideIn 0.3s ease-out;
}

@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.speed-btn {
    transition: all 0.2s ease;
}

.speed-btn:hover {
    transform: scale(1.05);
}

/* AI标签脉冲动画 */
.ai-pulse {
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.6); }
}

/* 策略条动画 */
#left-ai-strategy div div,
#right-ai-strategy div div {
    transition: width 0.5s ease-out;
}

/* 训练进度闪烁 */
@keyframes trainBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#train-generation {
    animation: trainBlink 1.5s ease-in-out infinite;
    color: #c084fc;
}