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

header {
  text-align: center;
  margin-bottom: 20px;
}

.title {
  font-size: 36px;
  color: #333;
}

#wrapper {
  display: flex;
  align-items: center;
  padding: 20px;
  background-color: #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

#paintField {
  border: 2px solid #333;
  background-color: #fff;
  cursor: crosshair;
  margin: 0 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#left-controls, #right-controls {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

#bottom-controls {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.control {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  background-color: #4caf50;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border-radius: 5px;
  text-align: center;
}

.control:hover {
  background-color: #45a049;
}

.control:active {
  background-color: #3e8e41;
  transform: scale(0.95);
}

.control:disabled {
  background-color: #9e9e9e;
  cursor: not-allowed;
}

.control.small {
  width: 60px;
  height: 60px;
  padding: 0;
  font-size: 20px;
}


/* Основные стили для обёртки и входного файла */
.file-upload-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 400px;
}

/* Скрытый инпут, занимающий всю область контейнера */
.file-upload-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Стили для кнопки */
.file-upload-label {
  display: inline-block;
  background-color: #009688;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
  transition: background-color 0.3s ease;
  position: relative; /* Дополнительное позиционирование */
  z-index: 1; /* Поверх скрытого инпута */
  pointer-events: none; /* Отключение событий для метки */
}

/* Включение событий для скрытого инпута */
.file-upload-input:hover + .file-upload-label {
  background-color: #00796b;
}

.file-upload-input:active + .file-upload-label {
  background-color: #004d40;
}

.file-upload-name {
  display: inline-block;
  margin-left: 10px;
  font-size: 16px;
  color: #666;
  z-index: 1; /* Поверх скрытого инпута */
}


#happy {
  background-color: #ffeb3b;
  color: #333;
}

#happy:hover {
  background-color: #fdd835;
}

#happy:active {
  background-color: #fbc02d;
}

#sad {
  background-color: #2196f3;
}

#sad:hover {
  background-color: #1e88e5;
}

#sad:active {
  background-color: #1976d2;
}

#angry {
  background-color: #f44336;
}

#angry:hover {
  background-color: #e53935;
}

#angry:active {
  background-color: #d32f2f;
}

#surprised {
  background-color: #ff9800;
}

#surprised:hover {
  background-color: #fb8c00;
}

#surprised:active {
  background-color: #f57c00;
}

#save {
  background-color: #673ab7;
}

#save:hover {
  background-color: #5e35b1;
}

#save:active {
  background-color: #512da8;
}

#load {
  background-color: #009688;
}

#load:hover {
  background-color: #00897b;
}

#load:active {
  background-color: #00796b;
}

#colorPicker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease;
}

#colorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
}

#colorPicker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

#colorPicker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

#colorPicker:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

#colorPicker:active {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

/* Media Queries */
@media (max-width: 768px) {
  .title {
    font-size: 28px;
  }

  #wrapper {
    flex-direction: column;
    padding: 10px;
  }

  #paintField {
    width: 90vw;
    max-width: 400px;
    height: 90vw;
    max-height: 400px;
    margin: 10px 0;
  }

  #left-controls, #right-controls {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
  }

  #bottom-controls {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .control {
    padding: 8px 16px;
    font-size: 14px;
  }

  .control.small {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .file-upload-wrapper {
    max-width: 300px;
  }

  .file-upload-label {
    padding: 8px 16px;
    font-size: 14px;
  }

  .file-upload-name {
    font-size: 12px;
  }

  #colorPicker {
    width: 50px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 24px;
  }

  #paintField {
    width: 80vw;
    height: 80vw;
  }

  .control {
    padding: 6px 12px;
    font-size: 12px;
  }

  .control.small {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .file-upload-wrapper {
    max-width: 250px;
  }

  .file-upload-label {
    padding: 6px 12px;
    font-size: 12px;
  }

  .file-upload-name {
    font-size: 10px;
  }

  #colorPicker {
    width: 40px;
    height: 30px;
  }
}






