/* ============================================ */
/* FLOATING PARTICIPANTS */
/* ============================================ */

.floating-participants-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: none;
    padding: 0 var(--spacing-lg);
}

.floating-participants {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xl);
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.floating-participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    opacity: 0;
    animation: slideInFromTop 0.8s ease-out forwards, gentleBob 4s ease-in-out infinite;
    z-index: 15; /* Higher than crowd participants */
    animation-delay: var(--animation-delay, 0s);
    transform: translateY(-50px);
}

/* Staggered entrance timing for quiz show effect */
.floating-participant.position-1 {
    --animation-delay: 0s;
}

.floating-participant.position-2 {
    --animation-delay: 0.2s;
}

.floating-participant.position-3 {
    --animation-delay: 0.4s;
}

.floating-participant.position-4 {
    --animation-delay: 0.6s;
}

.participant-avatar {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
    background: var(--bg-secondary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.participant-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.4);
}

.participant-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.participant-rank {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 32px;
    height: 32px;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
    transition: transform 0.3s ease;
}

/* 1st Place - Gold */
.participant-rank.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
    animation: goldGlow 2s ease-in-out infinite alternate;
}

/* 2nd Place - Silver */
.participant-rank.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.6);
}

/* 3rd Place - Bronze */
.participant-rank.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.6);
}

/* 4th Place - Default */
.participant-rank.rank-4 {
    background: linear-gradient(135deg, #6B73FF, #4F46E5);
    box-shadow: 0 4px 16px rgba(107, 115, 255, 0.6);
}

/* Hover effects for all ranks */
.participant-rank:hover {
    transform: scale(1.1);
    cursor: pointer;
}

.participant-rank.rank-1:hover {
    animation-play-state: paused;
    transform: scale(1.15);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 1);
}

.participant-rank.rank-2:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(192, 192, 192, 0.8);
}

.participant-rank.rank-3:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(205, 127, 50, 0.8);
}

.participant-rank.rank-4:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(107, 115, 255, 0.8);
}

.participant-info {
    text-align: center;
    background: rgba(var(--bg-secondary-rgb), 0.9);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.participant-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.participant-score {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

.platform-badge {
    background: rgba(var(--bg-secondary-rgb), 0.9);
    padding: 6px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.platform-badge .platform-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.platform-badge .platform-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ============================================ */
/* CROWD PARTICIPANTS (AUDIENCE) */
/* ============================================ */

.crowd-participant {
    position: absolute;
    opacity: 0;
    animation: crowdFadeIn 0.8s ease-out forwards, gentleBob 4s ease-in-out infinite;
    z-index: 1; /* Much lower than podium participants (z-index: 15) */
}

.crowd-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(var(--primary-rgb), 0.5);
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.crowd-avatar:hover {
    transform: scale(1.2);
    border-color: var(--primary-color);
    z-index: 15;
}

.crowd-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crowd-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

/* Tight arc positioning for crowd participants - stream-friendly */
.crowd-position-1 { top: 20%; left: 25%; }
.crowd-position-2 { top: 15%; left: 35%; }
.crowd-position-3 { top: 12%; left: 45%; }
.crowd-position-4 { top: 12%; right: 45%; }
.crowd-position-5 { top: 15%; right: 35%; }
.crowd-position-6 { top: 20%; right: 25%; }
.crowd-position-7 { top: 85%; left: 30%; }
.crowd-position-8 { top: 85%; left: 40%; }
.crowd-position-9 { top: 85%; right: 40%; }
.crowd-position-10 { top: 85%; right: 30%; }
.crowd-position-11 { top: 25%; left: 15%; }
.crowd-position-12 { top: 30%; left: 20%; }
.crowd-position-13 { top: 25%; right: 15%; }
.crowd-position-14 { top: 30%; right: 20%; }
.crowd-position-15 { top: 80%; left: 20%; }
.crowd-position-16 { top: 80%; right: 20%; }

/* Instructions Phase Styles */
.instructions-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.instructions-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    animation: slideInDown 1s ease-out;
}

.instructions-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 1s ease-out 0.3s both;
}

.instructions-rules {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.instructions-rules h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
}

.instructions-rules ul {
    list-style: none;
    padding: 0;
}

.instructions-rules li {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-lg);
    position: relative;
}

.instructions-rules li::before {
    content: '🎯';
    position: absolute;
    left: 0;
    top: 0;
}

.instructions-countdown {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    animation: fadeInUp 1s ease-out 0.9s both;
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gentleBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes goldGlow {
    0% {
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 6px 24px rgba(255, 215, 0, 0.9);
        transform: scale(1.05);
    }
}

@keyframes crowdFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .podium-area.active {
        height: 200px; /* Slightly smaller on mobile */
    }
    
    .floating-participants-container {
        padding: 0 var(--spacing-md);
    }
    
    .floating-participants {
        gap: var(--spacing-md);
    }
    
    .participant-avatar {
        width: 50px;
        height: 50px;
    }
    
    .participant-rank {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        top: -12px;
        right: -12px;
        border: 2px solid white;
    }
    
    .participant-name {
        font-size: 0.8rem;
    }
    
    .participant-score {
        font-size: 0.7rem;
    }
    
    .crowd-avatar {
        width: 40px;
        height: 40px;
    }
    
    .instructions-title {
        font-size: 2rem;
    }
    
    .instructions-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .floating-participants {
        gap: var(--spacing-sm);
    }
    
    .participant-avatar {
        width: 45px;
        height: 45px;
    }
    
    .participant-rank {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
        top: -10px;
        right: -10px;
        border: 2px solid white;
    }
    
    .participant-info {
        padding: var(--spacing-xs);
    }
    
    .participant-name {
        font-size: 0.75rem;
    }
    
    .participant-score {
        font-size: 0.65rem;
    }
    
    .crowd-avatar {
        width: 36px;
        height: 36px;
    }
}
