body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
    background-color: #f0f0f0;
    /* Prevent horizontal scrollbars caused by potentially wide canvas initially */
    overflow-x: hidden;
}

h1 {
    color: #333;
    text-align: center; /* Center heading text */
}

p {
    color: #555;
    margin-bottom: 20px;
    text-align: center;
    max-width: 90%; /* Allow text to wrap better on small screens */
}

#canvas-container {
    border: 1px solid #ccc;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.1);
    /* --- Responsive changes --- */
    width: 95%; /* Use percentage width */
    max-width: 800px; /* Max width for large screens (adjust as needed) */
    margin-left: auto; /* Center the container */
    margin-right: auto; /* Center the container */
    /* Maintain aspect ratio container (optional, helps prevent layout shifts) */
    /* aspect-ratio: 8 / 5; /* COLS / ROWS */
    line-height: 0; /* Prevent extra space below canvas */
}

canvas {
    /* --- Responsive changes --- */
    display: block; /* Removes extra space below canvas */
    width: 100%; /* Make canvas fill its container horizontally */
    height: auto; /* Maintain aspect ratio */
}