body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f2f5;
    color: #1c1e21;
    margin: 0;
    padding: 1rem;
}

h1 {
    margin: 0;
}

.subtitle {
    margin-top: 0.5rem;
    color: #606770;
}

#main-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    align-items: flex-start;
}

#grid-canvas {
    border: 2px solid #ccd0d5;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background-color: #fff;
}

#grid-canvas.disabled {
    cursor: not-allowed;
}

#controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: #1c1e21;
}

#color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin: auto;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.4);
    transform: scale(1.1);
}

#cooldown-container {
    margin-top: 20px;
    width: 100%;
    height: 40px;
    background-color: #e9ebee;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#cooldown-timer {
    font-size: 1em;
    font-weight: bold;
    color: #4b4f56;
    z-index: 2;
    position: relative;
}

#cooldown-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #007bff;
    transform: translateX(-100%);
    transition: transform 1s linear;
    z-index: -1;
}

#cooldown-timer.active::before {
    transform: translateX(0);
}

