/* Base layout */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #d4fc79, #96e6a1);
  color: #222;
  text-align: center;
  padding: 50px;
  min-height: 100vh;
  margin: 0;
}

/* Heading */
h1 {
  font-size: 2.5em;
  margin-bottom: 0.2em; /* reduce bottom margin */
}

h2 {
  font-size: 1.5em;
  margin-top: 0;         /* remove top margin */
  margin-bottom: 1em;    /* adjust as needed */
  color: #333;
}

/* Container to align image and fact side by side */
.fact-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap; /* Wraps on smaller screens */
  margin-bottom: 30px;
}

/* Messi Image */
.messi-photo {
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
}

.messi-photo:hover {
  transform: scale(1.05);
}

/* Fact box */
#messiFact {
  font-size: 1.5em;
  padding: 20px;
  max-width: 400px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  flex: 1;
  min-width: 250px;
}

/* Spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1c92d2;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  display: none;
  margin: 20px auto;
}

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

/* Button */
button {
  background-color: #1c92d2;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

button:hover {
  background-color: #f2fcfe;
  color: #1c92d2;
  border: 1px solid #1c92d2;
}

/* Responsive layout */
@media (max-width: 600px) {
  .fact-container {
    flex-direction: column;
  }

  h1 {
    font-size: 2em;
  }

  #messiFact {
    font-size: 1.2em;
    padding: 16px;
  }

  .messi-photo {
    max-width: 90%;
  }
}
