/* 游戏核心样式 */
/* 音符和游戏逻辑相关样式 */

/* 音符样式 */
.note {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 700;
    transition: transform 0.1s ease;
    animation: noteMove 3s linear;
    z-index: 5;
}

/* 红色音符（咚） */
.note.red {
    background: radial-gradient(circle, #FF6B6B 0%, #C8161D 100%);
    border: 3px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.8),
                inset 0 0 15px rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

/* 蓝色音符（锵） */
.note.blue {
    background: radial-gradient(circle, #4ECDC4 0%, #2C7A7B 100%);
    border: 3px solid #00D4FF;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.8),
                inset 0 0 15px rgba(0, 212, 255, 0.3);
    color: #FFFFFF;
}

/* 黄色音符（双击） */
.note.yellow {
    background: radial-gradient(circle, #FFD700 0%, #D4AF37 100%);
    border: 3px solid #FFF;
    box-shadow: 0 0 20px rgba(255, 215, 0, 1),
                inset 0 0 15px rgba(255, 255, 255, 0.4);
    color: #1C1C1C;
    animation: noteMove 3s linear, notePulse 0.5s ease-in-out infinite;
}

@keyframes notePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 长按音符 */
.note.long {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    background: radial-gradient(circle, #9B59B6 0%, #6C3483 100%);
    border: 4px solid #E74C3C;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.8);
}

/* 音符移动动画 */
@keyframes noteMove {
    from {
        right: -100px;
    }
    to {
        right: 100%;
    }
}

/* 判定文字 */
.judgment {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    font-weight: 700;
    pointer-events: none;
    z-index: 100;
    animation: judgmentFade 1s ease-out forwards;
}

.judgment.perfect {
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700;
}

.judgment.good {
    color: #4ECDC4;
    text-shadow: 0 0 10px #4ECDC4;
}

.judgment.ok {
    color: #FFA500;
    text-shadow: 0 0 10px #FFA500;
}

.judgment.miss {
    color: #E74C3C;
    text-shadow: 0 0 10px #E74C3C;
}

@keyframes judgmentFade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(0.8);
    }
}

/* 判定线上的判定文字 */
.judgment.hitline-judgment {
    position: absolute !important;
    font-size: 2em;
}

/* 分数弹出动画 */
.score-popup {
    animation: scorePopupFloat 0.8s ease-out forwards;
}

@keyframes scorePopupFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 连击文字 */
.combo-text {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4em;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 20px #FFD700, 0 0 40px #FFD700;
    pointer-events: none;
    z-index: 99;
    animation: comboScale 0.3s ease-out;
}

@keyframes comboScale {
    0% { transform: translateX(-50%) scale(0.8); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

/* 粒子特效 */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
}

.particle.gold {
    background: #FFD700;
    box-shadow: 0 0 10px #FFD700;
    animation: particleFloat 1s ease-out forwards;
}

.particle.red {
    background: #FF6B6B;
    box-shadow: 0 0 10px #FF6B6B;
    animation: particleFloat 1s ease-out forwards;
}

.particle.blue {
    background: #4ECDC4;
    box-shadow: 0 0 10px #4ECDC4;
    animation: particleFloat 1s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #FFD700;
    font-size: 1.2em;
    letter-spacing: 2px;
}

/* 暂停界面 */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    pointer-events: auto;
}

.pause-menu {
    background: rgba(28, 28, 28, 0.98);
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    min-width: 400px;
    position: relative;
    z-index: 99999;
    pointer-events: auto;
}

.pause-menu h2 {
    color: #FFD700;
    font-size: 2.5em;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

/* 暂停框中的打赏按钮 */
.pause-reward-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    margin: 15px 0 25px 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.1em;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.pause-reward-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    background: linear-gradient(135deg, #ff5252 0%, #ff6b6b 100%);
    border-color: #ff5252;
}

.pause-reward-btn i {
    font-size: 1.3em;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1);
    }
}

.pause-menu button,
.pause-menu .pause-btn {
    display: block;
    width: 100%;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #FF6B6B 0%, #C8161D 100%);
    border: 2px solid #FFD700;
    border-radius: 10px;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    position: relative;
    z-index: 99999;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.pause-menu button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(200, 22, 29, 0.5);
}

.pause-menu button:active {
    transform: translateY(-1px);
}

/* 手机端暂停框中的打赏区域 */
@media (max-width: 768px) {
    .pause-reward-section {
        margin: 10px 0 20px 0;
        padding: 10px;
    }
    
    .pause-reward-btn {
        padding: 10px 15px;
        font-size: 1em;
    }
    
    .pause-reward-btn i {
        font-size: 1.2em;
    }
}

/* 倒计时 */
.countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10em;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 30px #FFD700, 0 0 60px #FFD700;
    z-index: 2000;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* 房间信息 */
.room-info {
    background: rgba(28, 28, 28, 0.9);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.room-code-display {
    text-align: center;
    margin-bottom: 15px;
}

.room-code-display .label {
    color: #FFD700;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.room-code-display .code {
    font-size: 2em;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #FF6B6B 0%, #C8161D 100%);
    padding: 10px 30px;
    border-radius: 10px;
    display: inline-block;
    letter-spacing: 5px;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.player-item {
    background: rgba(44, 62, 80, 0.6);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-item.ready {
    border-color: #00A86B;
    background: rgba(0, 168, 107, 0.2);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #D4AF37 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1C1C1C;
}

.player-name {
    flex: 1;
    color: white;
}

.player-status {
    color: #00A86B;
    font-size: 0.9em;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(28, 28, 28, 0.95);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 300px;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-color: #00A86B;
}

.notification.error {
    border-color: #E74C3C;
}

.notification.info {
    border-color: #4ECDC4;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.5em;
}

.notification.success .notification-icon {
    color: #00A86B;
}

.notification.error .notification-icon {
    color: #E74C3C;
}

.notification.info .notification-icon {
    color: #4ECDC4;
}

.notification-text {
    color: white;
    flex: 1;
}

/* 特殊效果 */
.perfect-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 4px solid #FFD700;
    pointer-events: none;
    z-index: 80;
    animation: perfectRing 0.8s ease-out forwards;
}

@keyframes perfectRing {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 全连击特效 */
.full-combo-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    animation: fullComboFlash 1s ease-out;
}

@keyframes fullComboFlash {
    0%, 100% { background: transparent; }
    50% { background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%); }
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 淡入淡出 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
