:root {
  --bg: #0b0f19;
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.18);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.70);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh; /* better mobile viewport handling */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(124, 58, 237, 0.35), transparent 55%),
    radial-gradient(1000px 700px at 80% 70%, rgba(59, 130, 246, 0.30), transparent 55%),
    var(--bg);
}

main {
  width: min(920px, 92vw);
  padding: 28px 18px 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center; /* ensures perfect horizontal centering */
}

.kicker {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

.card {
  margin: 0 auto;
  width: 100%;
  max-width: 560px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(14px, 3.5vw, 20px); /* responsive padding */
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden; /* prevents any child overflow on small screens */
}

.square {
  width: 100%;
  max-width: 360px; /* caps size on desktop */
  aspect-ratio: 1 / 1;
  margin: 16px auto;
  border-radius: 18px;
  overflow: hidden; /* clips the image to the rounded square */
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
}

.square img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.square .fallback {
  padding: 22px;
  color: var(--muted);
  font-size: 14px;
}

blockquote {
  margin: 0;
  padding: 0 12px 10px;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.5;
  color: var(--text);
}

blockquote p {
  margin: 0;
}

.byline {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.tip {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.pill {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.reroll {
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.reroll:hover {
  background: rgba(255, 255, 255, 0.14);
}

.reroll:active {
  transform: scale(0.96);
}

.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}
