/*!
 * Person Picker Rock Paper Scissors Multiplayer Styles (https://personpicker.com)
 * Copyright 2024 - Licensed under AGPLv3 (https://www.gnu.org/licenses/agpl-3.0.en.html)
 */

/* Additional styles for multiplayer version */
.player-choice-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.choice-btn {
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.choice-btn:hover {
    transform: scale(1.1);
}

.choice-btn:active {
    transform: scale(0.95);
}

.choice-btn.selected {
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.match-container {
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.match-title {
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: var(--primary-color);
}

.waiting-message {
    text-align: center;
    margin: 20px 0;
    font-style: italic;
    color: var(--secondary-color);
}

/* Tournament Animation Styles (from single-player version) */
.round {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    width: 100%;
}

.match {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px 50px 10px;
    padding: 15px;
    background-color: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    min-width: 200px;
    border: 2px solid transparent;
}

.match:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.player {
    display: flex;
    align-items: center;
    margin: 8px 0;
    justify-content: space-between;
    width: 100%;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.player-name {
    font-weight: 500;
    color: var(--primary-color);
}

.choice {
    font-size: 28px;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.choice.winner {
    transform: scale(1.3);
    box-shadow: 0 0 20px var(--accent-color);
    background: linear-gradient(135deg, var(--success-color), var(--accent-color));
    animation: winnerPulse 1s ease-in-out;
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1.3); }
    50% { transform: scale(1.4); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

.bouncing {
    animation: bounce 0.8s ease-in-out infinite;
}

.match-result {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.match-result.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

.final-match {
    border: 3px solid var(--accent-color);
    padding: 25px;
    animation: finalMatchPulse 2s infinite;
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
}

@keyframes finalMatchPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 190, 178, 0.7);
        border-color: var(--accent-color);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(139, 190, 178, 0);
        border-color: var(--secondary-color);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 190, 178, 0);
        border-color: var(--accent-color);
    }
}

.countdown {
    font-size: 56px;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    margin: 20px 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: countdownPulse 1s ease-in-out;
}

.countdown.show {
    opacity: 1;
}

@keyframes countdownPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.final-result {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.final-result.show {
    opacity: 1;
    animation: finalResultAppear 1s ease-out;
}

@keyframes finalResultAppear {
    0% { transform: translateY(20px) scale(0.9); opacity: 0; }
    60% { transform: translateY(-5px) scale(1.05); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.bye-match {
    opacity: 0.8;
    background: linear-gradient(135deg, rgba(76, 217, 100, 0.1) 0%, rgba(139, 190, 178, 0.1) 100%);
    border-color: rgba(76, 217, 100, 0.3);
}

.bye-player {
    font-style: italic;
    color: var(--secondary-color);
    opacity: 0.7;
}

/* Choice animation for reveals */
.choice-reveal {
    animation: choiceReveal 0.6s ease-out;
}

@keyframes choiceReveal {
    0% { transform: scale(0.5) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Tournament bracket styling improvements */
#tournament {
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4f8 100%);
    border-radius: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Player highlighting during their turn */
.player.active-player {
    background-color: rgba(139, 190, 178, 0.1);
    border-left: 4px solid var(--accent-color);
}

/* Tie animation */
.tie-animation {
    animation: tieShake 0.5s ease-in-out;
}

@keyframes tieShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Choice made indicator */
.choice-made {
    animation: choiceMade 0.5s ease-out;
}

@keyframes choiceMade {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}
