/* Resetting some default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #333;
  text-align: center;
}

/* Container for all elements */
.container {
  max-width: 800px;
  width: 100%;
  text-align: center;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.meme-item {
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.meme-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meme-item:hover {
  transform: scale(1.05);
}

.editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  width: 100%;
  text-align: center;
}

textarea {
  width: 100%;
  max-width: 500px;
  height: 120px;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 5px;
  resize: none;
  margin-bottom: 15px;
}

button {
  background-color: #4CAF50;
  color: white;
  font-size: 16px;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 200px;
}

button:hover {
  background-color: #45a049;
}

button:disabled {
  background-color: #bdbdbd;
  cursor: not-allowed;
}

canvas {
  background-color: #f4f4f4;
  border-radius: 10px;
  margin-top: 20px;
  border: 2px solid #ccc;
}

.download {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .meme-item {
    width: 100px;
    height: 100px;
  }

  button {
    width: 150px;
  }
}

@media (max-width: 480px) {
  .meme-item {
    width: 80px;
    height: 80px;
  }

  button {
    width: 130px;
  }

  textarea {
    max-width: 90%;
  }

  .container {
    width: 100%;
    padding: 10px;
  }

  canvas {
    width: 100%;
  }
}