/* Root and resets */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

:root {
  /* font settings */
  --font-family: "Fredoka", sans-serif;
  font-size: 16px;

  /* color */
  --clr-primary: #845ec2;
  --clr-secondary: #b39cd0;
  --clr-light: #fbeaff;
  --clr-mint: #00c9a7;
}

/* Layout */
body {
  font-family: var(--font-family);
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--clr-primary) 0%,
    var(--clr-secondary) 30%,
    var(--clr-light) 60%,
    var(--clr-mint) 100%
  );
  min-height: 100vh;
}

/* Typography */
h1 {
  margin: 2rem 0;
  font-size: clamp(3rem, 6vw, 6rem);
}

.intro-text {
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 2rem;
  padding: 0 2rem;
}

/* Components */
.joke-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.joke-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

label {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
}

select {
  font-family: var(--font-family);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  border: none;
  text-align: center;
  padding: 0.5rem;
  border-radius: 1rem;
}

.joke-btn {
  font-family: var(--font-family);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  width: fit-content;
  margin: 0 auto;

  background: var(--clr-primary);
  color: white;
  cursor: pointer;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.joke-card {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  margin-top: 1.5rem;
  width: 20rem;
  min-height: 8.75rem;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.joke-card.visible {
  opacity: 1;
  pointer-events: auto;
}

.joke-text {
  font-size: clamp(1.5rem, 3vw, 1.8rem);
}

.joke-setup {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: 0.75rem;
}

.joke-delivery {
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  font-weight: 500;
}

/* Animation */
@keyframes scaleFadeSlideInUp {
  0% {
    transform: scale(0.5) translateY(300%);
    opacity: 0;
  }
  30% {
    transform: scale(0.7) translateY(0);
    opacity: 0.7;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.scaleFadeSlideInUp {
  animation: scaleFadeSlideInUp 1s ease-in-out 1;
}

/* Media Queries */
@media (min-width: 1024px) {
  h1 {
    margin-top: 6rem;
  }

  .intro-text {
    margin-bottom: 4rem;
  }

  .joke-section {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 8rem;
  }

  .joke-controls {
    gap: 2.5rem;
  }

  .joke-btn:hover {
    background-color: var(--clr-mint);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  }

  .joke-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  }
}
