body,
h1,
input,
form,
footer {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Great Vibes", cursive;
  background-color: #fdf6e3;
  color: #4b3e2a;
  line-height: 1.8;
  padding: 4rem;
  max-width: 1000px;
  margin: 0 auto;
  font-size: 1.3rem;
  background-image: url("https://www.transparenttextures.com/patterns/cream-paper.png");
  background-repeat: repeat, repeat;
  background-size: auto, 300px;
  background-blend-mode: multiply;
}

header {
  text-align: center;
  padding: 2rem;
  margin-bottom: 1rem;
  background: none;
}

header h1 {
  font-family: "Great Vibes", cursive;
  font-size: 3rem;
  color: #4b3e2d;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 2px;
  margin: 0 auto;
  max-width: 90%;
  padding-bottom: 0.5rem;
  border-bottom: 2px dashed #c1b49a;
  transition: all 0.3s ease-in-out;
}

header h1:hover {
  text-shadow: 0 0 8px rgba(255, 237, 193, 0.6);
  transform: scale(1.02);
  transition: all 0.3s ease-in-out;
}

form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid #b79d78;
  background-color: #fffef8;
  border-radius: 8px;
  font-size: 1.5rem;
  font-family: "Great Vibes", cursive;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease;
}

input[type="text"]:disabled {
  background-color: #e8e3d7;
  cursor: not-allowed;
}

input[type="submit"] {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(to bottom, #e2bfa3, #c49675);
  color: #3e2c1c;
  border: 2px solid #a07550;
  border-radius: 8px;
  font-family: "Great Vibes", cursive;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease-in-out;
  user-select: none;
  will-change: transform;
}

input[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(to bottom, #caa588, #b17e5d);
  transform: scale(1.05);
  animation: bounce 0.3s;
}

input[type="submit"]:disabled {
  background: #d2b48c;
  cursor: not-allowed;
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(1.1);
  }
}

main div {
  margin-top: 1rem;
  padding: 2rem;
  background-color: #fdf3d2;
  border: 1px solid #d2b48c;
  border-radius: 20px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05), 0 10px 25px rgba(0, 0, 0, 0.1);
  font-family: "Great Vibes", cursive;
  font-size: 1.8rem;
  white-space: pre-line;
  position: relative;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 1s forwards;
  transition: opacity 0.5s ease;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

main div::before,
main div::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle at bottom right,
    rgba(0, 0, 0, 0.05),
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
}

main div::before {
  top: 0;
  left: 0;
  transform: rotate(-45deg);
}

main div::after {
  bottom: 0;
  right: 0;
  transform: rotate(45deg);
}

#copy-btn {
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  font-family: "Great Vibes", cursive;
  font-size: 1.3rem;
  color: #3e2c1c;
  border: 2px solid #a07550;
  background: linear-gradient(to bottom, #e2bfa3, #c49675);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background 0.3s ease;
  user-select: none;
}

#copy-btn:hover {
  background: linear-gradient(to bottom, #caa588, #b17e5d);
  transform: scale(1.05);
}

#copy-btn:active {
  transform: scale(0.95);
}

footer {
  text-align: center;
  font-size: 1.2rem;
  color: #7c6a4a;
  margin-top: 4rem;
  border-top: 1px solid #d4c5a2;
  padding-top: 1.5rem;
  font-family: "Great Vibes", cursive;
}

footer a {
  color: #7c6a4a;
  text-decoration: none;
  font-weight: bold;
}

footer a:hover {
  text-decoration: underline;
}

.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #c49675;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  body {
    padding: 2rem;
    font-size: 1.1rem;
  }

  header h1 {
    font-size: 2.5rem;
  }

  input[type="text"],
  input[type="submit"] {
    font-size: 1.2rem;
  }

  main div {
    font-size: 1.6rem;
    padding: 2rem;
  }

  form {
    flex-direction: column;
    gap: 1rem;
  }

  input[type="submit"],
  input[type="text"] {
    width: 100%;
    box-sizing: border-box;
  }
}
