* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    color: #eee;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 900px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 6px;
    color: #c9a0dc;
    text-shadow: 0 0 10px rgba(201, 160, 220, 0.4);
}

#instructions {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 12px;
}

#status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

#move-counter {
    font-size: 1rem;
    color: #aaa;
}

#reset-btn,
#play-again-btn {
    background: #4a2c6e;
    color: #eee;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

#reset-btn:hover,
#play-again-btn:hover {
    background: #6b3fa0;
}

#play-area {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    min-height: 420px;
}

.tube-rack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

#center-tube-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.target-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tube styles */
.tube {
    position: relative;
    border: 3px solid #556;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tube::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    height: 6px;
    border: 3px solid #556;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.tube:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(100, 60, 150, 0.3);
}

.tube.selected {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(200, 160, 255, 0.4);
    border-color: #c9a0dc;
}

.tube.selected::before {
    border-color: #c9a0dc;
}

.tube.completed {
    opacity: 0.7;
    cursor: default;
}

.tube.completed::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 10px;
    background: #8b5e3c;
    border-radius: 4px 4px 0 0;
    border: 2px solid #6b4e2c;
}

/* Small tubes */
.tube.small-tube {
    width: 50px;
    height: 160px;
}

/* Tall center tube */
.tube.tall-tube {
    width: 70px;
    height: 320px;
}

/* Liquid layer */
.liquid-layer {
    width: 100%;
    flex-shrink: 0;
    transition: height 0.3s ease;
}

.small-tube .liquid-layer {
    height: 40px;
}

.tall-tube .liquid-layer {
    height: 40px;
}

/* Pour animation */
.tube.pouring {
    animation: pour-tilt 0.4s ease;
}

@keyframes pour-tilt {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(-15deg); }
    70% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

/* Win overlay */
#win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#win-overlay.hidden {
    display: none;
}

#win-message {
    background: #2a1a3e;
    padding: 40px 60px;
    border-radius: 16px;
    border: 2px solid #c9a0dc;
    text-align: center;
}

#win-message h2 {
    font-size: 2rem;
    color: #c9a0dc;
    margin-bottom: 10px;
}

#win-message p {
    margin-bottom: 20px;
    color: #aaa;
}

/* Color classes */
.color-pink { background-color: #ff69b4; }
.color-lightblue { background-color: #87ceeb; }
.color-orange { background-color: #ffa500; }
.color-yellow { background-color: #ffd700; }
.color-purple { background-color: #9b59b6; }
.color-green { background-color: #2ecc71; }
.color-red { background-color: #e74c3c; }

/* Responsive */
@media (max-width: 600px) {
    #play-area {
        gap: 15px;
    }

    .tube.small-tube {
        width: 40px;
        height: 130px;
    }

    .small-tube .liquid-layer {
        height: 32px;
    }

    .tube.tall-tube {
        width: 56px;
        height: 260px;
    }

    .tall-tube .liquid-layer {
        height: 32px;
    }

    h1 {
        font-size: 1.5rem;
    }
}
