/* Custom hover effect for navigation */

.hover-bg-light:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Search input focus styling */
.form-control:focus {
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3) !important;
    border-color: #80bdff !important;
}

/* Game table font sizing */
.game-table {
    font-size: 1.05rem;
    border-collapse: collapse;

}

/* Arrow animations and styling */
.arrow {
    color: black;
    font-weight: bold;
    margin-left: 5px;
    display: inline-block;
    font-size: 1.2em;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

/* Background colors for game results */
.green-bg {
    background: linear-gradient(135deg, #90EE90, #7FDD7F) !important;
    color: black !important;
    position: relative;
}

.green-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s ease-in-out;
}

.yellow-bg {
    background: linear-gradient(135deg, #FFFFC5, #F0F0A8) !important;
    color: black !important;
    position: relative;
}

.yellow-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s ease-in-out 0.2s;
}

.red-bg {
    background: linear-gradient(135deg, #FFCCCB, #FFB3B1) !important;
    color: black !important;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Game table specific styling that can't be replaced with Bootstrap */
.game-table td {
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
    line-height: 2rem;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
    color: black !important;
    box-sizing: border-box;
    border: 1px solid #000000;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.game-table th {
    border: 1px solid #000000;
    backface-visibility: hidden;
    transform: translateZ(0);
    
}

.game-table td:empty {
    background-color: #fff;
}

.game-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Search suggestions - specific positioning that can't be done with Bootstrap alone */
.suggestions-list {
    top: 100%;
    left: -10px;
    width: calc(100% + 20px);
    display: none;
}

.suggestions-list:not(:empty) {
    display: block;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .arrow {
        margin-left: 0px;
    }
    
    .game-table th, .game-table td {
        padding: 8px 3px !important;
        font-size: 0.85rem !important;
        border: 1px solid #000 !important;
        line-height: 1.2 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .game-table th {
        font-size: 0.8rem !important;
    }
    
    .game-table td:nth-child(2) {
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
        font-size: 0.75rem !important;
    }
    
    .game-table td:nth-child(3) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.8rem !important;
    }
    
    .game-table td:nth-child(4),
    .game-table td:nth-child(8) {
        white-space: nowrap;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 480px) {
    .game-table th, .game-table td {
        padding: 6px 2px !important;
        font-size: 0.75rem !important;
    }
    
    .game-table th {
        font-size: 0.7rem !important;
    }
        
    .game-table td:nth-child(2) {
        font-size: 0.65rem !important;
    }
    
    .game-table td:nth-child(3),
    .game-table td:nth-child(4),
    .game-table td:nth-child(8) {
        font-size: 0.7rem !important;
    }
}

@keyframes confetti-animation {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
}



/* Cool Congratulations Container Styles */
.congrats-container {
    position: relative;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 40px 40px 30px 40px; /* Reduced from 80px 60px */
    max-width: 500px; /* Reduced from 700px */
    width: 95%;
    margin: 0 auto;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 215, 0, 0.3);
    animation: containerFloat 6s ease-in-out infinite, victoryPulse 4s ease-in-out infinite;
    overflow: hidden;
}

.congrats-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 215, 0, 0.4),
        transparent,
        rgba(255, 165, 0, 0.3),
        transparent
    );
    animation: rotate 8s linear infinite;
    z-index: -1;
}

.congrats-container::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(20, 25, 35, 0.85);
    border-radius: 22px;
    z-index: -1;
}

.congrats-container h1 {
    font-size: 2.8rem; /* Reduced from 3.5rem */
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700, #ffb347, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px; /* Reduced from 24px */
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    animation: titlePulse 3s ease-in-out infinite, bounce 2s ease-in-out infinite;
    letter-spacing: -2px;
}

.congrats-container h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem; /* Reduced from 1.4rem */
    font-weight: 600;
    margin-bottom: 20px; /* Reduced from 32px */
    animation: fadeInUp 1s ease-out 0.3s both;
    line-height: 1.4;
}

.congrats-container p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem; /* Reduced from 1.3rem */
    margin-bottom: 20px; /* Reduced from 32px */
    margin-top: 20px; /* Reduced from 32px */
    animation: fadeInUp 1s ease-out 0.7s both;
    line-height: 1.5; /* Reduced from 1.6 */
}

.congrats-container .player-name {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 1.4rem; /* Reduced from 1.6rem */
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    padding: 4px 0; /* Reduced from 8px */
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    margin-bottom: 20px; /* Reduced from 24px */
}

.congrats-container .player-name:hover {
    color: #ffd700;
    border-bottom-color: rgba(255, 215, 0, 0.8);
    transform: translateY(-2px);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* CONSISTENT IMAGE STYLING FOR BOTH PAGES */
.congrats-container .player-image,
.failure-container .player-image {
    width: 200px; 
    height: 200px; 
    transform: scale(0.8); 
    object-position: center 6%;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    margin: 15px auto; /* Reduced from 8px auto */
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: imageGlow 2s ease-in-out infinite alternate;
}

.congrats-container .player-image {
    animation: victoryImageGlow 2s ease-in-out infinite alternate, victoryBounce 3s ease-in-out infinite;
}

/* Button styling for success page */
.congrats-success-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.btn-success-custom {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #20c997, #28a745);
    color: white;
}

/* Victory Animations */
@keyframes victoryPulse {
    0%, 100% { 
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 215, 0, 0.3);
    }
    50% { 
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 215, 0, 0.5);
    }
}

@keyframes victoryBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(2deg); }
    50% { transform: scale(1.1) rotate(0deg); }
    75% { transform: scale(1.05) rotate(-2deg); }
}

/* Victory image glow override */
@keyframes victoryImageGlow {
    0% { 
        box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
        border-color: rgba(255, 215, 0, 0.5);
    }
    100% { 
        box-shadow: 0 8px 16px rgba(255, 215, 0, 0.7);
        border-color: rgba(255, 215, 0, 0.8);
    }
}

/* Responsive design for congrats container */
@media (max-width: 768px) {
    .congrats-container {
        padding: 30px 25px 25px 25px;
        margin: 15px;
        max-width: 90%;
    }
    
    .congrats-container h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .congrats-container h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .congrats-container p {
        font-size: 1rem;
        margin-bottom: 15px;
        margin-top: 15px;
    }
    
    .congrats-container .player-name {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    /* Consistent mobile image sizing */
    .congrats-container .player-image,
    .failure-container .player-image {
        width: 150px;
        height: 150px;
        margin: 10px auto;
    }

    .congrats-success-section {
        margin-top: 20px;
        padding-top: 15px;
    }
}

@media (max-width: 480px) {
    .congrats-container {
        padding: 25px 20px 20px 20px;
    }
    
    .congrats-container h1 {
        font-size: 1.8rem;
    }
    
    .congrats-container h2 {
        font-size: 1rem;
    }
    
    .congrats-container p {
        font-size: 0.9rem;
    }
    
    .congrats-container .player-name {
        font-size: 1.1rem;
    }

    .btn-success-custom {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.failure-container {
    position: relative;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 40px 30px 40px; /* Reduced from 80px 60px */
    max-width: 500px; /* Reduced from 700px */
    width: 95%;
    margin: 20px auto;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: containerFloat 6s ease-in-out infinite;
    overflow: hidden;
}

.failure-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 64, 129, 0.3),
        transparent,
        rgba(124, 58, 237, 0.3),
        transparent
    );
    animation: rotate 8s linear infinite;
    z-index: -1;
}

.failure-container::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(15, 15, 35, 0.8);
    border-radius: 22px;
    z-index: -1;
}

.failure-container h1 {
    font-size: 2.8rem; /* Reduced from 3.5rem */
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b6b, #ff4081, #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px; /* Reduced from 32px */
    text-shadow: 0 0 40px rgba(255, 64, 129, 0.5);
    animation: titlePulse 3s ease-in-out infinite;
    letter-spacing: -2px;
}

.failure-container p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem; /* Reduced from 1.3rem */
    margin-bottom: 20px; /* Reduced from 32px */
    animation: fadeInUp 1s ease-out 0.5s both;
    line-height: 1.5; /* Reduced from 1.6 */
}

.failure-container a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 1.4rem; /* Reduced from 1.6rem */
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    padding: 4px 0; /* Reduced from 8px */
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
}

.failure-container a:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

/* Improved image styling */
.failure-container .player-image {
    width: 200px; /* Reduced from 300px */
    height: 200px; /* Reduced from 300px */
    transform: scale(0.8); /* Reduced from 0.65 */
    object-position: center 10%;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    margin: 15px auto; /* Reduced from default */
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: imageGlow 2s ease-in-out infinite alternate;
}

/* Better button styling integrated into container */
.play-again-section {
    margin-top: 25px; /* Reduced spacing */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-play-again {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 200px; /* Slightly reduced */
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.btn-play-again:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: white;
}

/* Animations */
@keyframes containerFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

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

@keyframes titlePulse {
    0%, 100% { 
        text-shadow: 0 0 40px rgba(255, 64, 129, 0.5);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 60px rgba(255, 64, 129, 0.8);
        transform: scale(1.02);
    }
}

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

@keyframes imageGlow {
    0% { 
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
    100% { 
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.6);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .failure-container {
        padding: 30px 25px 25px 25px;
        margin: 15px;
        max-width: 90%;
    }
    
    .failure-container h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .failure-container p {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .failure-container a {
        font-size: 1.2rem;
    }
    
    .failure-container .player-image {
        width: 150px;
        height: 150px;
        margin: 10px auto;
    }

    .play-again-section {
        margin-top: 20px;
        padding-top: 15px;
    }
}

@media (max-width: 480px) {
    .failure-container {
        padding: 25px 20px 20px 20px;
    }
    
    .failure-container h1 {
        font-size: 1.8rem;
    }
    
    .failure-container p {
        font-size: 0.9rem;
    }
    
    .failure-container a {
        font-size: 1.1rem;
    }

    .btn-play-again {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}