/* 游戏房间等待界面样式 */

#room-view {
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
}

#room-view.active {
    display: flex !important;
    flex-direction: column;
}

/* 背景视频 */
.room-bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.9;
}

/* 视频遮罩层 */
.room-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0.7) 0%,
        rgba(10, 10, 10, 0.85) 50%,
        rgba(10, 10, 10, 0.9) 100%
    );
    z-index: -1;
}

.room-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: rgba(26, 26, 26, 0.9);
    border: 2px solid var(--accent-gold);
    margin-bottom: 30px;
    gap: 10px;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    animation: slideDown 0.6s ease-out;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-header h2 {
    flex: 1 1 100%;
    text-align: center;
    color: var(--accent-gold);
    font-size: 32px;
    margin: 0;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow: 0 0 10px var(--accent-gold);
    }
    50% {
        text-shadow: 0 0 20px var(--accent-gold), 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

.room-header p {
    flex: 1 1 100%;
    text-align: center;
    margin: 0;
    animation: fadeIn 1s ease-out 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.room-header button {
    transition: all 0.3s ease;
}

.room-header button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}

.room-header #leave-room-btn {
    flex: 0 0 auto;
    align-self: flex-start;
}

#room-view .settings-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    font-size: 48px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

#room-view .settings-icon:hover {
    transform: rotate(90deg) scale(1.1);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8));
}



.room-content {
    background-color: rgba(26, 26, 26, 0.9);
    border: 2px solid var(--accent-gold);
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    grid-auto-rows: 1fr;
}

.player-slot {
    background-color: var(--bg-darker);
    border: 2px solid var(--border-color);
    padding: 30px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: slotAppear 0.6s ease-out;
    animation-fill-mode: both;
}

.player-slot:nth-child(1) { animation-delay: 0.5s; }
.player-slot:nth-child(2) { animation-delay: 0.6s; }
.player-slot:nth-child(3) { animation-delay: 0.7s; }
.player-slot:nth-child(4) { animation-delay: 0.8s; }

@keyframes slotAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.player-slot::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(212, 175, 55, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.player-slot:hover::before {
    left: 100%;
}

.player-slot.filled {
    border-color: var(--accent-gold);
    animation: playerJoin 0.5s ease-out;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

@keyframes playerJoin {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.player-slot.host {
    border-color: var(--accent-red);
    box-shadow: 0 0 15px var(--accent-red);
    animation: hostGlow 2s ease-in-out infinite;
}

@keyframes hostGlow {
    0%, 100% {
        box-shadow: 0 0 15px var(--accent-red);
    }
    50% {
        box-shadow: 0 0 25px var(--accent-red), 0 0 35px rgba(139, 0, 0, 0.5);
    }
}

.slot-empty {
    color: var(--text-secondary);
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.slot-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.slot-player .avatar {
    width: 80px;
    height: 80px;
}

.slot-player .nickname {
    font-size: 18px;
    color: var(--accent-gold);
    font-weight: bold;
}

.slot-player .host-badge {
    background-color: var(--accent-red);
    color: var(--accent-gold);
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.slot-player .kick-btn {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 12px;
}

.room-actions {
    display: flex;
    justify-content: center;
    animation: fadeInUp 1s ease-out 1s both;
}

#start-game-btn {
    font-size: 20px;
    padding: 15px 40px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#start-game-btn:not(:disabled) {
    animation: buttonReady 1.5s ease-in-out infinite;
}

@keyframes buttonReady {
    0%, 100% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 30px rgba(212, 175, 55, 0.3);
    }
}

#start-game-btn:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#start-game-btn:not(:disabled):hover::before {
    width: 300px;
    height: 300px;
}

#start-game-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
}


/* 可点击的玩家样式 */
.clickable-player {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-player:hover {
    transform: scale(1.05);
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
}

.clickable-player:hover .avatar {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}
