@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@400;500&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: #050d1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 30px 20px;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 8vw, 5rem);
  font-weight: 800;
  color: #ffd60a;
  letter-spacing: 2px;
}

.subtitle {
  color: #8899aa;
  font-size: 1rem;
  margin-top: -10px;
}

#joke-box {
  background: #0d1f35;
  border-radius: 16px;
  padding: 60px 40px;
  max-width: 700px;
  width: 90%;
  text-align: center;
  border: 1.5px solid #1a3a5c;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  perspective: 1000px;
}

#joke-box:hover {
  box-shadow: 0 0 30px rgba(255, 214, 10, 0.25), 0 0 60px rgba(255, 214, 10, 0.1);
  border-color: #ffd60a;
}

#card-inner {
  position: relative;
  width: 100%;
  min-height: 120px;
  height: auto;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}
#card-front,
#card-back {
    padding: 10px;
}

#card-inner.flipped {
  transform: rotateY(180deg);
}

#card-front, #card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#card-front {
  color: #e0eaf5;
  font-size: 1.25rem;
  line-height: 1.7;
}

#card-back {
  transform: rotateY(180deg);
  color: #ffd60a;
  font-size: 1.1rem;
  font-weight: 500;
}

#joke-btn {
  background-color: #60c8ff;
  color: #050d1a;
  border: none;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#joke-btn:hover {
  background-color: #90d8ff;
  transform: scale(1.05);
}

#joke-btn:active {
  transform: scale(0.97);
}

#reveal-btn {
  margin-top: 20px;
  background: transparent;
  color: #ffd60a;
  border: 1.5px solid #ffd60a;
  padding: 10px 28px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s ease;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#reveal-btn:hover {
  background: rgba(255, 214, 10, 0.1);
}

/* =========================
   Tablet (768px and below)
========================= */
@media (max-width: 768px) {

  body {
    margin-top: 0;
    padding: 30px 20px;
    justify-content: center;
  }

  h1 {
    font-size: 3rem;
    text-align: center;
  }

  .subtitle {
    font-size: 0.95rem;
    text-align: center;
  }

  #joke-box {
    padding: 40px 25px;
    width: 95%;
  }

  #card-inner {
    height: 160px;
  }

  #card-front,
  #card-back {
    font-size: 1.1rem;
    line-height: 1.6;
  }

  #joke-btn,
  #reveal-btn {
    width: 100%;
    max-width: 320px;
  }
}

/* =========================
   Mobile (480px and below)
========================= */
@media (max-width: 480px) {

  body {
    padding: 20px 15px;
    gap: 15px;
  }

  h1 {
    font-size: 2.2rem;
    letter-spacing: 1px;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-top: 0;
  }

  #joke-box {
    padding: 30px 20px;
    border-radius: 14px;
  }

  #card-inner {
    height: 190px;
  }

  #card-front,
  #card-back {
    font-size: 1rem;
    line-height: 1.5;
  }

  #joke-btn,
  #reveal-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
  }
}
#joke-text,
#answer-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
}