body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header {
    width: 95%;
    padding: 30px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 15px;
}

p {
    margin: 15px 0 25px;
}

input[type="text"] {
    margin: 10px 0 15px;
    padding: 15px;
    width: 100%;
    max-width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    padding: 15px 20px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

label {
    margin: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: large;
}

input[type="checkbox"] {
    margin-left: 10px;
}

.main {
    width: 90%;
}

.loading {
    font-size: 18px;
    color: #3498db;
    font-weight: bold;
    margin-bottom: 20px;
}

#patternGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0 100px;
    justify-items: center;
}

canvas {
    border: 2px solid #3498db;
    border-radius: 8px;
    background-color: #ecf0f1;
    margin: 10px;
    transition: transform 0.3s;
}

canvas:hover {
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}