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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

h2 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.generation-table {
    width: 100%;
    border-collapse: collapse;
}

.generation-table tr {
    border-bottom: 1px solid #eee;
}

.generation-table td {
    padding: 12px 8px;
    vertical-align: middle;
}

.generation-table td:first-child {
    width: 40%;
    font-weight: 500;
    color: #555;
}

.number-input {
    width: 60px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-size: 16px;
}

.number-input:focus {
    outline: none;
    border-color: #667eea;
}

.number-input.error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-left: 10px;
    display: none;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.results-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #667eea;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.no-results, .no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.history-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.history-content {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    background: #fafafa;
}

.history-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.history-item:last-child {
    border-bottom: none;
}

.show_history_btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    width: auto;
    padding: 8px 16px;
    font-size: 12px;
}

.show_history_btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-container, .history-container {
    animation: fadeIn 0.5s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .generation-table td:first-child {
        width: 60%;
    }
    
    .results-table {
        font-size: 12px;
    }
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.history-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #667eea;
    position: sticky;
    top: 0;
}

.history-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.history-content {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    background: #fafafa;
}