/* Enhanced Victory and Defeat Screen Styles */

/* Celebration Effects */
.celebration-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.consolation-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Enhanced Animation Containers */
.victory-animation-enhanced,
.defeat-animation-enhanced {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    z-index: 2;
    min-height: 80px;
}

/* Mobile optimization for victory screen */
@media (max-height: 700px) {
    .victory-animation-enhanced,
    .defeat-animation-enhanced {
        min-height: 60px;
        margin-bottom: 5px;
    }
}

.laurel-crown {
    font-size: 1.5rem;
    margin-bottom: -5px;
    z-index: 3;
    animation: crownFloat 2s ease-in-out infinite;
}

.modest-crown {
    font-size: 1.2rem;
    margin-bottom: -5px;
    z-index: 3;
    animation: modestFloat 3s ease-in-out infinite;
}

/* Mobile crown sizes */
@media (max-height: 700px) {
    .laurel-crown {
        font-size: 1.2rem;
    }
    
    .modest-crown {
        font-size: 1rem;
    }
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0px) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

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

/* Avatar Circles */
.winner-avatar-circle,
.defeat-winner-circle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 5px 0;
    /* Remove background gradient to eliminate extra space */
    background: transparent;
    box-shadow: none;
}

.winner-avatar-circle .winner-avatar,
.defeat-winner-circle .winner-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.defeat-winner-circle .winner-avatar {
    border: 3px solid #4a90e2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
}

/* Mobile avatar sizes */
@media (max-height: 700px) {
    .winner-avatar-circle,
    .defeat-winner-circle {
        width: 45px;
        height: 45px;
        margin: 2px 0;
    }
    
    .winner-avatar-circle .winner-avatar,
    .defeat-winner-circle .winner-avatar {
        width: 45px;
        height: 45px;
        border-width: 2px;
    }
}

.winner-avatar-circle {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.2);
    animation: victoryGlow 2s ease-in-out infinite;
}

.defeat-winner-circle {
    background: linear-gradient(45deg, #4a90e2, #357abd, #4a90e2);
    box-shadow: 
        0 0 15px rgba(74, 144, 226, 0.4),
        0 0 30px rgba(74, 144, 226, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.1);
    animation: modestGlow 3s ease-in-out infinite;
}

@keyframes victoryGlow {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.6),
            0 0 60px rgba(255, 215, 0, 0.4),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 0.8),
            0 0 80px rgba(255, 215, 0, 0.6),
            inset 0 0 25px rgba(255, 255, 255, 0.3);
    }
}

@keyframes modestGlow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(74, 144, 226, 0.4),
            0 0 40px rgba(74, 144, 226, 0.2),
            inset 0 0 15px rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 25px rgba(74, 144, 226, 0.5),
            0 0 50px rgba(74, 144, 226, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.15);
    }
}

/* Old winner-avatar styles removed - now handled by container styles */

/* Sparkles Effect */
.victory-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.victory-sparkles::before,
.victory-sparkles::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

.victory-sparkles::before {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.victory-sparkles::after {
    bottom: 15%;
    right: 25%;
    animation-delay: 0.7s;
}

.modest-sparkles::before,
.modest-sparkles::after {
    content: '⭐';
    position: absolute;
    font-size: 1rem;
    animation: modestSparkle 2s ease-in-out infinite;
}

.modest-sparkles::before {
    top: 15%;
    left: 25%;
    animation-delay: 0s;
}

.modest-sparkles::after {
    bottom: 20%;
    right: 30%;
    animation-delay: 1s;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

@keyframes modestSparkle {
    0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
    50% { opacity: 0.7; transform: scale(0.8) rotate(90deg); }
}

/* Winner Title */
.winner-title {
    font-size: 1rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-top: 5px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* Enhanced Score Display */
.enhanced-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.vs-divider {
    font-size: 1.5rem;
    font-weight: bold;
    color: #888;
    padding: 0 10px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.winner-score {
    color: #ffd700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: scoreGlow 2s ease-in-out infinite;
}

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

/* Enhanced Reward Display */
.enhanced-reward {
    margin: 30px 0;
}

.reward-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.reward-icon {
    font-size: 2.5rem;
    animation: rewardBounce 2s ease-in-out infinite;
}

@keyframes rewardBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.reward-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.reward-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4caf50;
}

.reward-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.reward-motivation {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    margin-top: 5px;
}

/* Enhanced Consolation Display */
.enhanced-consolation {
    margin: 30px 0;
}

.consolation-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1), rgba(244, 67, 54, 0.05));
    border: 2px solid rgba(244, 67, 54, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.consolation-icon {
    font-size: 2.5rem;
    animation: consolationPulse 2s ease-in-out infinite;
}

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

.consolation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.consolation-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ff6b6b;
}

.consolation-motivation {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    margin-top: 5px;
}

/* Enhanced Buttons */
.enhanced-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.enhanced-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.enhanced-btn:hover::before {
    left: 100%;
}

.enhanced-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Victory Title Enhancement */
.victory-title {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: victoryTitleGlow 2s ease-in-out infinite;
}

.defeat-title {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

@keyframes victoryTitleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Fireworks Animation */
.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1s ease-out forwards;
}

@keyframes fireworkExplode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(var(--end-x, 0), var(--end-y, 0)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x, 0), var(--end-y, 0)) scale(1.5);
    }
}

/* Additional particle effects */
.celebration-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: celebrationFloat 3s ease-out forwards;
}

@keyframes celebrationFloat {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(360deg);
    }
}

/* Loading Button Styles */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    opacity: 0.8;
    cursor: not-allowed !important;
    pointer-events: none;
}

.loading:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive Design */
@media (max-width: 480px) {
    .winner-avatar-circle,
    .defeat-winner-circle {
        width: 70px;
        height: 70px;
    }
    
    .winner-avatar {
        width: 60px;
        height: 60px;
    }
    
    .laurel-crown, .modest-crown {
        font-size: 1.5rem;
    }
    
    .enhanced-score {
        flex-direction: column;
        gap: 10px;
    }
    
    .vs-divider {
        transform: rotate(90deg);
        font-size: 1.2rem;
    }
    
    .reward-container, .consolation-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .victory-animation-enhanced,
    .defeat-animation-enhanced {
        min-height: 100px;
    }
}
/* Desktop Victory Screen - ensure buttons are above navigation */
@media (min-height: 700px) {
    .result-actions {
        position: fixed !important;
        bottom: 100px !important; /* Higher for desktop */
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        max-width: 400px !important;
        background: var(--primary-bg) !important;
        padding: 15px 20px !important;
        border-radius: 15px !important;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.4) !important;
        z-index: 100 !important;
        display: flex !important;
        gap: 15px !important;
    }
    
    .result-actions .action-btn {
        padding: 12px 20px !important;
        font-size: 1rem !important;
        min-width: 140px !important;
    }
    
    .result-container {
        padding-bottom: 180px !important; /* More space for desktop */
    }
}

/* Large Desktop Screens */
@media (min-height: 900px) {
    .result-actions {
        bottom: 120px !important; /* Even higher for large screens */
    }
    
    .result-container {
        padding-bottom: 200px !important;
    }
}

/* Mobile Victory Screen Optimization */
@media (max-height: 700px) {
    .result-screen {
        padding: 10px;
        overflow-y: auto;
    }
    
    .result-container {
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        padding: 10px;
    }
    
    .result-title {
        font-size: 1.8rem !important;
        margin: 10px 0 !important;
    }
    
    .final-score {
        margin: 15px 0 !important;
        padding: 10px !important;
    }
    
    .score-item {
        font-size: 0.9rem !important;
    }
    
    .score-value {
        font-size: 1.2rem !important;
    }
    
    .reward-info,
    .consolation-info {
        margin: 15px 0 !important;
        padding: 10px !important;
    }
    
    .reward-container,
    .consolation-container {
        gap: 10px !important;
    }
    
    .reward-icon,
    .consolation-icon {
        font-size: 1.5rem !important;
    }
    
    .reward-title,
    .consolation-title {
        font-size: 1rem !important;
    }
    
    .reward-amount {
        font-size: 1.2rem !important;
    }
    
    .result-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        position: fixed !important;
        bottom: 80px !important; /* Above bottom navigation (70px + 10px margin) */
        left: 10px !important;
        right: 10px !important;
        background: var(--primary-bg) !important;
        padding: 10px !important;
        border-radius: 15px !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
        z-index: 100 !important;
        margin: 0 !important;
    }
    
    .result-actions .action-btn {
        flex: 1 !important;
        padding: 12px 8px !important;
        font-size: 0.9rem !important;
    }
    
    /* Add bottom padding to container to account for fixed buttons and navigation */
    .result-container {
        padding-bottom: 150px !important; /* Space for buttons (60px) + navigation (70px) + margins (20px) */
    }
}

/* Extra small screens */
@media (max-height: 600px) {
    .victory-animation-enhanced,
    .defeat-animation-enhanced {
        min-height: 40px;
        margin-bottom: 5px;
    }
    
    .winner-avatar-circle,
    .defeat-winner-circle {
        width: 40px;
        height: 40px;
    }
    
    .laurel-crown {
        font-size: 1rem;
    }
    
    .modest-crown {
        font-size: 0.9rem;
    }
    
    .result-title {
        font-size: 1.5rem !important;
        margin: 5px 0 !important;
    }
    
    .final-score {
        margin: 10px 0 !important;
        padding: 8px !important;
    }
    
    .reward-info,
    .consolation-info {
        margin: 10px 0 !important;
        padding: 8px !important;
    }
    
    .result-container {
        padding-bottom: 140px !important; /* Adjusted for smaller screens */
    }
    
    .result-actions {
        bottom: 75px !important; /* Above navigation */
        left: 5px !important;
        right: 5px !important;
        padding: 8px !important;
    }
    
    .result-actions .action-btn {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .victory-animation-enhanced,
    .defeat-animation-enhanced {
        display: none; /* Hide animation on very small landscape screens */
    }
    
    .result-title {
        font-size: 1.3rem !important;
        margin: 5px 0 !important;
    }
    
    .final-score {
        margin: 8px 0 !important;
        padding: 6px !important;
    }
    
    .reward-info,
    .consolation-info {
        margin: 8px 0 !important;
        padding: 6px !important;
    }
    
    .result-container {
        padding: 5px;
        padding-bottom: 120px !important; /* Space for buttons + navigation */
    }
    
    .result-actions {
        bottom: 65px !important; /* Above navigation */
        left: 2px !important;
        right: 2px !important;
        padding: 6px !important;
    }
    
    .result-actions .action-btn {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
    }
}/* M
obile-specific improvements for defeat screen */
@media (max-height: 700px) {
    .defeat-animation-enhanced {
        min-height: 60px !important;
        margin-bottom: 8px !important;
    }
    
    .defeat-winner-circle {
        width: 50px !important;
        height: 50px !important;
    }
    
    .winner-title {
        font-size: 0.9rem !important;
        margin: 5px 0 !important;
    }
    
    .defeat-title {
        font-size: 1.6rem !important;
        margin: 8px 0 !important;
    }
    
    .consolation-info {
        margin: 12px 0 !important;
        padding: 8px !important;
    }
    
    .consolation-container {
        gap: 8px !important;
    }
    
    .consolation-icon {
        font-size: 1.3rem !important;
    }
    
    .consolation-title {
        font-size: 0.95rem !important;
        margin-bottom: 3px !important;
    }
    
    .consolation-text {
        font-size: 0.85rem !important;
        margin-bottom: 2px !important;
    }
    
    .consolation-motivation {
        font-size: 0.8rem !important;
    }
}

/* Extra compact defeat screen */
@media (max-height: 600px) {
    .defeat-animation-enhanced {
        min-height: 45px !important;
        margin-bottom: 5px !important;
    }
    
    .defeat-winner-circle {
        width: 40px !important;
        height: 40px !important;
    }
    
    .defeat-title {
        font-size: 1.4rem !important;
        margin: 5px 0 !important;
    }
    
    .consolation-info {
        margin: 8px 0 !important;
        padding: 6px !important;
    }
}

/* Landscape defeat screen */
@media (max-height: 500px) and (orientation: landscape) {
    .defeat-animation-enhanced {
        display: none !important; /* Hide animation completely */
    }
    
    .defeat-title {
        font-size: 1.2rem !important;
        margin: 3px 0 !important;
    }
    
    .consolation-info {
        margin: 5px 0 !important;
        padding: 4px !important;
    }
    
    .consolation-container {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .consolation-content {
        text-align: left !important;
    }
}