﻿/* UI组件样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    text-align: center;
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-left: 4px solid #047857;
}

.message.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-left: 4px solid #b91c1c;
}

.message.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-left: 4px solid #1d4ed8;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 排行榜排名样式 */
.rank-1 {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.rank-2 {
    color: #d1d5db;
    text-shadow: 0 0 8px rgba(209, 213, 219, 0.3);
}

.rank-3 {
    color: #b45309;
    text-shadow: 0 0 6px rgba(180, 83, 9, 0.3);
}

/* 分数动画 */
.score-popup {
    position: absolute;
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    color: #10b981;
    pointer-events: none;
    z-index: 15;
    animation: scoreFloat 1s ease-out forwards;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(1.2);
    }
}

/* 连击特效 */
.combo-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    pointer-events: none;
    z-index: 25;
    animation: comboPulse 0.5s ease-out forwards;
}

@keyframes comboPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 子弹轨迹 */
.bullet-trail {
    position: absolute;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.8) 0%, transparent 100%);
    height: 2px;
    transform-origin: left center;
    pointer-events: none;
    z-index: 5;
}

/* 游戏结束动画 */
.game-over-animation {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 星星背景 */
.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: var(--min-opacity); }
    50% { opacity: var(--max-opacity); }
}

/* 响应式调整 */
@media (max-width: 640px) {
    .game-btn {
        @apply py-3 px-6 text-sm;
    }
    
    .modal-content {
        @apply mx-2 p-6;
    }
    
    .game-status-bar {
        @apply p-2;
    }
    
    .status-items {
        @apply gap-2;
    }
    
    .status-item {
        @apply px-3 py-1;
    }
}

/* 平板设备 */
@media (min-width: 641px) and (max-width: 1024px) {
    .modal-content {
        @apply max-w-md;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .game-btn {
        @apply py-4 px-8 text-lg;
        min-height: 50px;
    }
    
    .pause-btn {
        @apply p-5;
    }
    
    .name-input {
        @apply py-3 text-lg;
    }
    
    .submit-btn {
        @apply py-3 px-6;
    }
}