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

body {
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: #f4f5f8;
  color: #17181c;
}

.container {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 60px 0;
}

header {
  margin-bottom: 30px;
}

h1 {
  font-size: 42px;
  margin-bottom: 8px;
}

header p,
.section-title p {
  color: #6d7078;
}

.color-panel,
.palette-section,
.saved-palettes {
  background: white;
  border: 1px solid #e4e5e9;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(20, 20, 30, 0.05);
}

.palette-section,
.saved-palettes {
  margin-top: 22px;
}

.color-preview {
  height: 240px;
  border-radius: 15px;
  background: #6C63FF;
  margin-bottom: 22px;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

input[type="color"] {
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.picker-row span,
.value-box span {
  display: block;
  font-size: 13px;
  color: #777a82;
  margin-bottom: 5px;
}

.picker-row strong {
  font-size: 18px;
}

.values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.value-box {
  border: 1px solid #e5e6ea;
  border-radius: 12px;
  padding: 15px;
}

.value-box strong {
  display: block;
  margin-bottom: 13px;
  font-size: 16px;
}

button {
  border: 0;
  border-radius: 9px;
  padding: 9px 13px;
  background: #17181c;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.random-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 15px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h2 {
  margin-bottom: 5px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  overflow: hidden;
  border-radius: 12px;
}

.palette-color {
  min-height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.palette-color:hover {
  filter: brightness(1.08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.preset-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preset {
  width: 100%;
  overflow: hidden;
  border: 1px solid #e5e6ea;
  border-radius: 15px;
  background: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preset:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(20, 20, 30, 0.08);
}

.preset-colors {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px;
  overflow: hidden;
}

.preset-colors span {
  flex: 1;
  min-width: 0;
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  color: white;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.preset-colors span:hover {
  filter: brightness(1.08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.preset-info {
  padding: 16px;
}

.preset h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.preset p {
  color: #777a82;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 650px) {
  .container {
    padding: 35px 0;
  }

  h1 {
    font-size: 34px;
  }

  .color-preview {
    height: 190px;
  }

  .values,
  .palette {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .palette-color {
    min-height: 90px;
  }

  .preset-colors {
    gap: 6px;
    padding: 8px;
  }

  .preset-colors span {
    height: 110px;
    padding: 8px;
    font-size: 11px;
  }
}