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

:root {
  --bg-top: #0f172a;
  --bg-bottom: #2e1065;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --text: #f1f5f9;
  --muted: #a1a1aa;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(900px 600px at 70% 10%, #4c1d95, var(--bg-top)) ,
              linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  padding: 1.5rem;
}

.app {
  width: 100%;
  max-width: 620px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0abfc;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.card h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  margin-top: 0.45rem;
  font-size: 0.95rem;
}

.joke-box {
  margin: 2rem 0 1.8rem;
  padding: 1.8rem 1.5rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border);
  border-radius: 1rem;
}

.joke {
  font-size: 1.15rem;
  line-height: 1.6;
  transition: opacity 0.2s;
}

.joke-box.loading .joke {
  opacity: 0.35;
}

.joke-box.loading::before {
  content: "";
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.source {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  padding: 0.85rem 2.2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.45);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(139, 92, 246, 0.55);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .card {
    padding: 1.8rem 1.2rem;
  }
}