/* ball_sort_puzzle.css */
.game-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Styling for the tubes */
.tube {
    width: 60px;
    height: 280px;
    border: 3px solid #007F73;
    border-radius: 0 0 30px 30px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    align-items: center;
    background-color: rgba(200, 230, 255, 0.4);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tube:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tube.selected-tube {
    border: 3px solid #FF6B9C;
    box-shadow: 0 0 15px rgba(255, 107, 156, 0.6);
}

/* Glass reflection effect */
.glass-reflection {
    position: absolute;
    top: 0;
    left: 10px;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0));
    border-radius: 0 0 25px 25px;
    pointer-events: none;
}

/* Styling for the balls */
.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 3px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    position: relative;
    box-shadow: inset 0 -4px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

/* Ball shine effect */
.shine {
    position: absolute;
    top: 8px;
    left: 15px;
    width: 15px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transform: rotate(40deg);
    pointer-events: none;
}

/* Ball colors with improved visibility */
.ball[data-color="red"] { 
    background: radial-gradient(circle at 30% 30%, #FF5C5C, #CC0000); 
}
.ball[data-color="blue"] { 
    background: radial-gradient(circle at 30% 30%, #5C86FF, #0000CC); 
}
.ball[data-color="green"] { 
    background: radial-gradient(circle at 30% 30%, #5CFF7F, #00CC33); 
}
.ball[data-color="yellow"] { 
    background: radial-gradient(circle at 30% 30%, #FFFF5C, #CCCC00); 
}
.ball[data-color="purple"] { 
    background: radial-gradient(circle at 30% 30%, #C45CFF, #6600CC); 
}
.ball[data-color="orange"] { 
    background: radial-gradient(circle at 30% 30%, #FFAD5C, #CC6600); 
}
.ball[data-color="pink"] { 
    background: radial-gradient(circle at 30% 30%, #FF9CCC, #FF4499); 
}

/* Animation for tube receiving a ball */
.tube-receive-animation {
    animation: tubeReceive 0.3s ease;
}

@keyframes tubeReceive {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Game stats section */
.game-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.move-counter {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FF6B9C;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* Victory message */
.victory-message {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: 3px solid #FFD700;
    animation: popIn 0.5s ease-out;
    max-width: 90%;
    margin: 20px auto;
}

.victory-message h3 {
    color: #FF6B9C;
    font-size: 2rem;
    margin-bottom: 10px;
}

.victory-message p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Confetti animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 20px;
    opacity: 0.7;
    animation: confetti-fall 5s linear forwards;
    transform: rotate(0deg);
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive adjustments for medium screens and below */
@media (max-width: 992px) {
    .game-container {
        gap: 15px;
        padding: 15px;
    }
    .tube {
        width: 50px;
        height: 240px;
    }
    .ball {
        width: 40px;
        height: 40px;
    }
    .move-counter {
        font-size: 1.3rem;
    }
}

/* Improved responsive layout for small screens */
@media (max-width: 768px) {
    .game-container {
        gap: 10px;
        padding: 10px 5px;
    }
    .tube {
        width: 38px;
        height: 200px;
    }
    .ball {
        width: 32px;
        height: 32px;
    }
    .button-85 {
        padding: 12px 20px;
        font-size: 1rem;
    }
    .move-counter {
        font-size: 1.1rem;
    }
    .victory-message h3 {
        font-size: 1.5rem;
    }
    .victory-message p {
        font-size: 1rem;
    }
}

/* Even smaller screens (mobile phones) */
@media (max-width: 480px) {
    .game-container {
        gap: 8px;
        padding: 5px 2px;
    }
    .tube {
        width: 32px;
        height: 160px;
    }
    .ball {
        width: 28px;
        height: 28px;
    }
    .shine {
        width: 10px;
        height: 5px;
        top: 5px;
        left: 10px;
    }
    .button-85 {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    h2 {
        font-size: 1.8rem !important;
    }
}