/* ===== Base Styles ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: url("images/background.png");
  background-repeat: repeat;
  background-position: top left;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
}

/* ===== Wider container ===== */
.container {
  width: 66.66vw;  /* two-thirds of viewport width */
  max-width: 900px;
  padding: 24px;
  margin: 0 auto;  /* center horizontally */
}

.card {
  background: white;
  border-radius: 24px;
  padding: 32px 28px 36px;
  box-shadow: 0 20px 45px rgba(0,0,0,0.18);
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 400px at top center, rgba(255,255,255,0.35), transparent 60%);
  pointer-events: none;
}

.button {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.65));
  border: 1px solid rgba(255,255,255,0.8);
  transition: transform .2s ease, box-shadow .2s ease;
  color: #111827;
  cursor: pointer;
}

.button:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 28px rgba(0,0,0,0.25); }

h1 { font-size:1.9rem; font-weight:800; line-height:1.2; margin-bottom:10px; color:#111827; }
p.subtext { font-size:1.05rem; color:#4b5563; margin-bottom:22px; }

/* ===== Magic Image Container ===== */
.magic-image-wrap {
  display: flex;
  flex-direction: column;  /* STACK vertically */
  justify-content: center;
  align-items: center;
  overflow: visible;
  height: auto;   /* allow container to grow naturally */
  opacity: 0;
  margin-top: 20px;
  transition: opacity 0.6s ease;
}

/* Ensure all children stack correctly and centered */
.magic-image-wrap > * {
  display: block;
  width: 100%;
  max-width: 500px;   /* limits image/button width */
  text-align: center;
  margin-top: 20px;   /* spacing between items */
}

.magic-image-wrap img {
  border-radius:16px;
  transform: scale(0);
  -webkit-transform: scale(0);
  transition: transform 0.6s ease;
  z-index:1;
  position:relative;
  overflow:hidden;
  cursor:pointer;
}

.magic-image-wrap.expanded { opacity:1; }

/* Pop bounce animation */
@keyframes popBounce {
  0%   { transform: scale(0); -webkit-transform: scale(0); }
  60%  { transform: scale(1.2); -webkit-transform: scale(1.2); }
  80%  { transform: scale(0.95); -webkit-transform: scale(0.95); }
  100% { transform: scale(1); -webkit-transform: scale(1); }
}

/* Rainbow shimmer overlay */
.magic-image-wrap img::after {
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    45deg,
    rgba(255,0,0,0.3), rgba(255,154,0,0.3), rgba(208,222,33,0.3),
    rgba(79,220,74,0.3), rgba(63,218,216,0.3), rgba(47,201,226,0.3),
    rgba(28,127,238,0.3), rgba(95,21,242,0.3), rgba(186,12,248,0.3),
    rgba(251,7,217,0.3)
  );
  background-size:200% 200%;
  pointer-events:none;
  opacity:0;
  transition: opacity 0.3s ease;
  border-radius:16px;
  mix-blend-mode:screen;
}

.magic-image-wrap img:hover::after {
  opacity:1;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Sparkles */
.sparkles { position:absolute; top:50%; left:50%; width:300px; height:300px; pointer-events:none; transform:translate(-50%, -50%); z-index:0; overflow:visible; }
.sparkle { position:absolute; width:6px; height:6px; background:gold; border-radius:50%; opacity:0.9; }

/* ===== Second magic button ===== */
#moreMagicBtn {
  display:inline-block;
  padding:12px 18px;
  border-radius:999px;
  text-decoration:none;
  font-weight:600;
  box-shadow:0 10px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.65));
  border:1px solid rgba(255,255,255,0.8);
  transition: transform .2s ease, box-shadow .2s ease;
  color:#111827;
  cursor:pointer;
}

#moreMagicBtn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:0 14px 28px rgba(0,0,0,0.25);
}

/* ===== Next magic image ===== */
#nextImage {
  border-radius:16px;
  display:block;
  opacity:0;
  transform: scale(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#nextImage.visible {
  opacity:1;
  transform: scale(1);
}

/* ===== Footer / CC ===== */
footer { text-align:center; margin-top:22px; font-size:0.9rem; color:#fff; text-shadow:0 0 4px rgba(0,0,0,0.7); }
footer a { display:inline-flex; align-items:center; gap:8px; color:#fff; text-decoration:none; font-weight:bold; }
footer a img { filter: brightness(1.2); }
