* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-info {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 1.1rem;
}

.weighings-left {
    color: #28a745;
}

.game-status {
    color: #17a2b8;
}

.balls-container {
    padding: 30px;
}

.balls-container h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.balls-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3498db, #2980b9);
    border: 3px solid #2c3e50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.ball:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.ball.selected {
    background: linear-gradient(145deg, #f39c12, #e67e22);
    border-color: #d68910;
    transform: scale(1.05);
}

.ball.different {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    animation: pulse 1s infinite;
}

.ball.correct-guess {
    background: linear-gradient(145deg, #27ae60, #229954);
    animation: celebrate 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes celebrate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.1); }
    75% { transform: rotate(-5deg) scale(1.1); }
}

.scale-container {
    padding: 30px;
    background: #f8f9fa;
}

.scale-container h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.3rem;
}

.scale {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.scale-pan {
    width: 200px;
    height: 120px;
    background: linear-gradient(145deg, #ecf0f1, #bdc3c7);
    border: 3px solid #95a5a6;
    border-radius: 15px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.scale-pan.tilted-left {
    transform: rotate(-5deg);
    background: linear-gradient(145deg, #e8f5e8, #c8e6c9);
}

.scale-pan.tilted-right {
    transform: rotate(5deg);
    background: linear-gradient(145deg, #e8f5e8, #c8e6c9);
}

.pan-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    color: #2c3e50;
}

.balls-in-pan {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 10px;
    gap: 5px;
}

.balls-in-pan .ball {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
}

.scale-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scale-indicator {
    font-size: 3rem;
    transition: transform 0.3s ease;
}

.scale-indicator.left-heavy {
    transform: rotate(-15deg);
}

.scale-indicator.right-heavy {
    transform: rotate(15deg);
}

.weigh-button {
    background: linear-gradient(145deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.weigh-button:hover {
    background: linear-gradient(145deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.weigh-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.result-container {
    padding: 20px 30px;
    text-align: center;
}

.result-message {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-message.failure {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.result-message.info {
    background: #cce7ff;
    color: #004085;
    border: 2px solid #b3d7ff;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
}

.control-button {
    background: linear-gradient(145deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.control-button:hover {
    background: linear-gradient(145deg, #5a6268, #495057);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.instructions, .strategy-guide {
    padding: 30px;
    background: #ffffff;
}

.instructions h3, .strategy-guide h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.instructions ol {
    margin-left: 20px;
    line-height: 1.6;
    color: #34495e;
}

.instructions li {
    margin-bottom: 8px;
}

.strategy-guide p {
    color: #34495e;
    line-height: 1.6;
}

/* Drag and drop styles */
.ball.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

.scale-pan.drag-over {
    background: linear-gradient(145deg, #fff3cd, #ffeaa7);
    border-color: #f39c12;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .balls-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .ball {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .scale {
        flex-direction: column;
        gap: 15px;
    }
    
    .scale-pan {
        width: 250px;
        height: 80px;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}