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

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #74ebd5, #9face6);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.container {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  width: 420px;
  height: 360px;
}

h1 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #333;
}

.color-preview {
  padding: 40px;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 20px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
}

.color-preview p {
  font-size: 20px;
  font-weight: bold;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

button {
  padding: 15px;
  font-size: 15px;
  border: none;
  background: #4caf50;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

button:hover {
  background: #26732a;
}

#copyMsg {
  margin-top: 10px;
  font-size: 14px;
  color: #333;
}

.dark-mode {
  background: #333;
  color: white;
}

.dark-mode .container {
  background: #999;
}

.dark-mode .color-preview {
  background: #222;
  color: #fff;
}

/* ✅ Responsive Design */
@media (max-width: 430px) {
  .container {
    width: 90%;
    height: auto;
    padding: 20px;
  }

  h1 {
    font-size: 18px;
  }

  .color-preview {
    padding: 30px;
    font-size: 16px;
  }

  .buttons {
    grid-template-columns: 1fr; /* stack buttons vertically */
  }

  button {
    padding: 12px;
    font-size: 14px;
  }
}

/* ✅ Responsive for 240px */
@media (max-width: 240px) {
  .container {
    width: 95%;
    padding: 15px;
  }

  h1 {
    font-size: 16px;
  }

  .color-preview {
    padding: 20px;
    font-size: 14px;
  }

  .buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  button {
    padding: 10px;
    font-size: 12px;
  }

  #copyMsg {
    font-size: 12px;
  }
}
