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

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: Arial, sans-serif;
    justify-content: center;
    align-items: center;
    background: #e0e0e0;
}

header {
    background: #333;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 20px;
    width: 100%;
}

.container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    gap: 10px;
}

.sidebar {
    width: 200px;
    background: #222;
    color: white;
    padding: 20px;
    text-align: center;
    min-height: 400px;
}

.grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    background: #ccc;
    padding: 10px;
    border-radius: 10px;
}

.grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.row {
    display: flex;
    flex: 1;
}

.cell {
    background-color: #f5f5f5;
    border: 1px solid #bbb;
    flex: 1;
    aspect-ratio: 1 / 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.cell:hover {
    background-color: #d1d1d1;
    cursor: pointer;
    transform: scale(1.05);
}

.cell.active {
    background-color: #007bff;
    border-color: #0056b3;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 5px;
    }
    .sidebar {
        width: 100%;
        min-height: auto;
        padding: 10px;
    }
    .grid-container {
        width: min(95vw, 400px);
        height: min(95vw, 400px);
    }
}

#color-picker {
    width: 100%;
    height: 40px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    outline: none;
    background: #fff;
    border-radius: 5px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#color-picker:hover {
    transform: scale(1.05);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
