body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f2f2f2;
  text-align: center;
}

.container {
  background-color: #fff;
  padding: 30px 20px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
}

.logo-block {
  margin-bottom: 20px;
}

.logo {
  max-width: 696px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

h1 {
  font-size: 20px;
  margin-bottom: 20px;
}

.upload-form {
  max-width: 50%;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  padding: 15px 20px;
  border: 2px dashed #999;
  border-radius: 10px;
  box-sizing: border-box;
}

/* Hide native file input */
.upload-form input[type="file"] {
  display: none;
}

/* Styled file input label */
.file-input-label {
  flex: 1;
  padding: 10px 15px;
  background-color: #eee;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  color: #555;
  font-weight: bold;
  user-select: none;
  border: 1px solid #ccc;
  transition: background-color 0.3s ease;
}

.file-input-label:hover {
  background-color: #ddd;
}

/* Upload button */
.upload-btn {
  flex-shrink: 0;
  padding: 10px 25px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.upload-btn:hover {
  background-color: #222;
}

.image-block {
  margin-top: 20px;
}

.preview {
  max-width: 696px;
  width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

#palette {
  display: flex;
  justify-content: center; /* center palette */
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: nowrap; /* keep on one line */
  overflow-x: auto; /* allow horizontal scroll on small screens */
}

.color-box {
  width: 60px;
  height: 60px;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  padding-bottom: 4px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
  flex-shrink: 0; /* prevent shrinking */
}

textarea#hexOutput {
  width: 90%;
  height: 50px;
  margin: 10px auto;
  display: block;
  font-size: 14px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 10px;
  resize: none;
}

.btn-group {
  display: inline-flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.btn-group button {
  background-color: #444;
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-group button:hover {
  background-color: #222;
}

@media screen and (max-width: 600px) {
  .color-box {
    width: 50px;
    height: 50px;
    font-size: 9px;
  }

  .upload-form {
    max-width: 90%;
    padding: 10px 15px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .file-input-label {
    flex: 1 1 100%;
  }

  .upload-btn {
    flex: 1 1 100%;
  }

  h1 {
    font-size: 16px;
  }

  button {
    width: 100%;
  }
}
