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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.game-container {
    width: 100%;
    max-width: 400px;
    min-height: 100vh;
    background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
    position: relative;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.ui-elements {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: bold;
}

.settings-btn {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.coins, .hearts {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 20px;
}

.level {
    background: rgba(255, 0, 0, 0.8);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
}

.bags-section {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
}

.bag {
    width: 70px;
    height: 90px;
    background: #e2e8f0;
    border-radius: 10px 10px 0 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.bag.completed {
    background: #48bb78;
}

.bag.empty {
    background: #4a5568;
}

.bag-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

.bottle-preview {
    width: 20px;
    height: 30px;
    border-radius: 3px;
    border: 2px solid white;
}

.bottle-preview.cyan {
    background: #00bcd4;
}

.bottle-preview.red {
    background: #f44336;
}

.video-icon {
    font-size: 16px;
    opacity: 0.7;
}

.bottles-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    align-content: center;
    min-height: 400px;
}

.bottle {
    width: 80px;
    height: 120px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #e2e8f0;
    border-radius: 15px 15px 25px 25px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    align-items: center;
    padding: 5px;
    margin: 0 auto;
}

.bottle:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.bottle.selected {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: translateY(-5px);
}

.bottle.completed {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    background: linear-gradient(135deg, #fff9c4, #f7fafc);
}

.bottle.completed::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #2d3748;
    border: 2px solid white;
}

.bottle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 15px;
    background: #e2e8f0;
    border-radius: 10px 10px 0 0;
    border: 2px solid #cbd5e0;
}

.water-layer {
    width: 100%;
    height: 20px;
    border-radius: 0 0 8px 8px;
    transition: all 0.5s ease;
    position: relative;
}

.water-layer:first-child {
    border-radius: 8px 8px 8px 8px;
}

.water-layer.red { background: linear-gradient(135deg, #ff6b6b, #ee5a52); }
.water-layer.blue { background: linear-gradient(135deg, #4ecdc4, #44a08d); }
.water-layer.green { background: linear-gradient(135deg, #4caf50, #2e7d32); }
.water-layer.yellow { background: linear-gradient(135deg, #fce38a, #f9ca24); }
.water-layer.purple { background: linear-gradient(135deg, #9c27b0, #7b1fa2); }
.water-layer.orange { background: linear-gradient(135deg, #ffb347, #ff8c42); }
.water-layer.cyan { background: linear-gradient(135deg, #00bcd4, #0097a7); }

.bottom-controls {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 15px;
    background: #4299e1;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.control-btn .icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.control-btn .video-icon {
    font-size: 10px;
    opacity: 0.7;
}

.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #48bb78;
    margin-bottom: 20px;
    font-size: 24px;
}

.modal-content p {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 16px;
}

#nextLevelBtn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#nextLevelBtn:hover {
    background: #38a169;
}

.pour-animation {
    animation: pour 0.8s ease-in-out;
}

@keyframes pour {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

.empty-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 24px;
    opacity: 0.5;
}

@media (max-width: 480px) {
    .bottles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .bottle {
        width: 70px;
        height: 100px;
    }
    
    .water-layer {
        height: 16px;
    }
}