body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    padding: 20px;
    margin: 0;
    line-height: 1.6;
}

h1 {
    text-align: center;
    color: #444;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 300;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.series-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.series-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.series-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.series-card h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.series-display {
    font-size: 1.2em;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: center;
}

.series-number {
    font-weight: bold;
    color: #2d3748;
    padding: 2px 4px;
    background-color: #e2e8f0;
    border-radius: 4px;
    margin: 0 2px;
}

.answer-input {
    width: 60px;
    height: 35px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    color: #2d3748;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.answer-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.answer-input:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

button {
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn {
    background-color: #48bb78;
    color: white;
}

.submit-btn:hover:not(:disabled) {
    background-color: #38a169;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.show-rule-btn {
    background-color: #4299e1;
    color: white;
}

.show-rule-btn:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
}

.new-series-container {
    text-align: center;
    margin-top: 40px;
}

.new-series-btn {
    background-color: #ed8936;
    color: white;
    padding: 12px 24px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.new-series-btn:hover {
    background-color: #dd6b20;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.result-container {
    margin-top: 10px;
    text-align: center;
}

.result-message {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    display: inline-block;
}

.result-correct {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.result-incorrect {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.result-error {
    background-color: #fef5e7;
    color: #744210;
    border: 1px solid #f6e05e;
}

.rule-display {
    margin-top: 15px;
    padding: 12px;
    background-color: #f7fafc;
    border-left: 4px solid #4299e1;
    border-radius: 4px;
    font-size: 0.9em;
    color: #4a5568;
}

/* Responsive design */
@media (max-width: 768px) {
    .series-container {
        gap: 15px;
        padding: 0 10px;
        max-width: 100%;
    }
    
    .series-card {
        padding: 15px;
    }
    
    .series-display {
        font-size: 1.1em;
    }
    
    .answer-input {
        width: 50px;
        height: 30px;
        font-size: 1em;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .series-container {
        gap: 10px;
    }
    
    .series-card {
        padding: 12px;
    }
    
    .series-display {
        font-size: 1em;
        line-height: 1.6;
    }
    
    .answer-input {
        width: 45px;
        height: 28px;
        font-size: 0.9em;
    }
    
    .button-container {
        gap: 8px;
    }
    
    button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .new-series-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
}
