* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #718096;
    font-weight: 300;
}

.content {
    display: grid;
    gap: 30px;
}

.theory-section,
.practice-section,
.exercise-section,
.stats-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theory-section:hover,
.practice-section:hover,
.exercise-section:hover,
.stats-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theory-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.theory-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    transition: transform 0.3s ease;
}

.theory-card:hover {
    transform: translateX(5px);
}

.theory-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.theory-card p {
    margin-bottom: 10px;
    color: #4a5568;
}

.theory-card ul {
    list-style: none;
    padding-left: 0;
}

.theory-card li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.theory-card li:last-child {
    border-bottom: none;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95rem;
}

.control-group input,
.control-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.round-btn,
.exercise-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-self: end;
}

.round-btn:hover,
.exercise-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.round-btn:active,
.exercise-btn:active {
    transform: translateY(0);
}

.result-section {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #68d391;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-display {
    display: grid;
    gap: 15px;
}

.original-number,
.rounded-number {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.label {
    font-weight: 500;
    color: #4a5568;
}

.value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.explanation {
    background: #edf2f7;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    font-style: italic;
    color: #4a5568;
}

.exercise-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.exercise-display {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.exercise-task h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.exercise-task p {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 500;
}

.answer-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.answer-input label {
    font-weight: 500;
    color: #4a5568;
}

.answer-input input {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.answer-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.exercise-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 500;
}

.exercise-result.correct {
    background: #f0fff4;
    border: 2px solid #68d391;
    color: #22543d;
}

.exercise-result.incorrect {
    background: #fed7d7;
    border: 2px solid #fc8181;
    color: #742a2a;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    color: #718096;
    font-weight: 300;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .theory-cards {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .exercise-controls {
        flex-direction: column;
    }
    
    .exercise-controls button {
        width: 100%;
    }
}

/* Анимации для интерактивности */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.round-btn:focus,
.exercise-btn:focus {
    animation: pulse 0.3s ease;
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
} 