html, body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent browser scroll */
    width: 100vw;
    height: 100vh;
}

body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column; /* Set body as flex column */
    background-color: #f0f0f0;
}

.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1));
    text-align: center;
    max-width: unset;
    width: calc(100vw - 40px);
    flex-grow: 1; /* Allow container to grow vertically */
    display: flex;
    flex-direction: column;
}

h1 {
    color: #333;
    font-size: 1.6em; /* Further reduced font size for H1 */
    margin-bottom: 2px;
}

h2 {
    color: #555;
    font-size: 1.0em; /* Further reduced font size for H2 */
    margin-top: 2px;
    margin-bottom: 10px;
}

.controls {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    border: 1px solid #ddd;
    padding: 3px;
    border-radius: 4px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.2);
}

.color-swatch.selected {
    border: 3px solid #3498db;
    box-shadow: 0 0 5px #3498db;
}

.controls button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 1em;
}

.controls button:hover {
    opacity: 0.9;
}

.zoom-controls {
    display: flex;
    gap: 5px;
}

.zoom-controls button {
    width: 35px;
    height: 35px;
    padding: 0;
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-area {
    position: relative;
    flex-grow: 1;
    border: 1px solid #ccc;
    background-color: #ffffff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#perlerCanvas {
    display: block;
    cursor: grab;
    touch-action: none;
}

#perlerCanvas.panning {
    cursor: grabbing;
}

#miniMapCanvas {
    position: absolute;
    bottom: 45px; /* Increased bottom margin for miniMap */
    right: 10px;
    border: 1px solid #999;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 10;
}