/* Christmas background with star field */
html, body {
  height: 100%;
}
.xmas-bg {
  /* Light festive background: white so red flakes are visible */
  background: #ffffff;
  color: #111;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Canvas covers full viewport; stars drawn by JS */
#xmas-stars-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: block;
}

/* Keep main content above the canvas */
main.construccio-container {
  position: relative;
  z-index: 1;
}

/* Subtle vignette removed for light mode — keep content crisp on white */
.xmas-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Optional festive tint on headings */
.xmas-bg h1, .xmas-bg h2, .xmas-bg h3 {
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

/* Ensure footer remains readable */
.footer-construccio {
  z-index: 1;
  position: relative;
}

/* Popup styles */
.xmas-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}
.xmas-popup-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.xmas-popup {
  /* solid white popup with a subtle, visible snowflake pattern */
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><g fill='none' stroke='%230b5586' stroke-width='1' stroke-linecap='round' stroke-linejoin='round' opacity='0.12'><path d='M18 6v24M6 18h24M10 10l16 16M26 10L10 26'/></g><g fill='%23b9d7ff' opacity='0.18'><circle cx='6' cy='6' r='1.2'/><circle cx='30' cy='6' r='1.2'/><circle cx='6' cy='30' r='1.2'/><circle cx='30' cy='30' r='1.2'/></g></svg>");
  background-repeat: repeat;
  background-size: 36px 36px;
  border: 1px solid rgba(0,0,0,0.06);
  color: #111;
  padding: 2rem 2.2rem;
  border-radius: 14px;
  width: min(820px, 96vw);
  max-width: 96vw;
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
  transform-origin: center top;
  z-index: 2001;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.xmas-popup .title {
  line-height: 1.02;
  font-family: 'Caveat', 'Pacifico', cursive;
  color: var(--red-color);
  font-weight: 900;
  white-space: pre-line;
}
/* explicit sizes for each title line to control spacing */
.xmas-popup .title .line.small { display:block; font-size: 1.6rem; font-weight: 800; color: #000; margin: 0 0 0.06rem 0; line-height: 1; }
.xmas-popup .title .line.large {
  display: block;
  font-weight: 900;
  margin: 0;
  /* slightly increased line-height to avoid clipping of glyph descenders */
  line-height: 1.08;
  font-family: 'Dancing Script', 'Luckiest Guy', 'Gloria Hallelujah', cursive;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  white-space: nowrap; /* keep on a single line */
  overflow: visible; /* allow vertical glyphs to render fully */
  /* scale aggressively on small viewports so it fills most of the popup */
  font-size: clamp(3rem, 14vw, 9rem);
  padding-bottom: 0.12rem; /* small breathing space so text doesn't touch bottom */
}

@media (max-width: 800px) {
  /* reduce popup padding on very small screens and allow title to grow */
  .xmas-popup { padding: 1rem 1rem; }
  .xmas-popup .title .line.small { font-size: 1rem; }
  .xmas-popup .title .line.large { font-size: clamp(2.8rem, 18vw, 7rem); }
}

/* Backdrop effect while popup is open */
.xmas-popup-active header,
.xmas-popup-active main,
.xmas-popup-active footer {
  transition: filter 220ms ease, opacity 220ms ease;
  filter: blur(3px) brightness(0.65);
  opacity: 0.6;
  pointer-events: none;
}
.xmas-popup .body {
  font-size: 1.35rem;
  color: #222;
}

/* intro sentence uses the same handwriting font as 'Us desitgem' */
.xmas-popup .body .intro {
  display: block;
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

/* thank-you sentence color */
.xmas-popup .body .thanks {
  display: inline-block;
  color: var(--blue-color);
  font-weight: 800;
  font-size: 1.25rem;
}
.xmas-popup .actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.6rem;
}
.xmas-popup .btn {
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f6f6f6;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.98rem;
}
.xmas-popup .btn.primary {
  background: var(--red-color);
  color: white;
  border-color: transparent;
}

/* open/close animations */
@keyframes popup-open {
  from { transform: translateY(-12px) scale(0.96); opacity: 0 }
  to   { transform: translateY(0) scale(1); opacity: 1 }
}
@keyframes popup-close {
  from { transform: translateY(0) scale(1); opacity: 1 }
  to   { transform: translateY(-8px) scale(0.98); opacity: 0 }
}
.xmas-popup.open { animation: popup-open 340ms cubic-bezier(.2,.9,.2,1) both }
.xmas-popup.close { animation: popup-close 220ms ease both }

