@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100;200;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pinyon+Script&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quattrocento:wght@100;200;300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Parisienne&display=swap');

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #000000;
}

body img {
  pointer-events: none;
  user-select: none;
}

/* Container */
.container {
  position: relative;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 70px;
  background: #faf1e1;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 1000;
  transition: top 0.3s ease;
  border-bottom: 1px solid rgba(188, 156, 47, 0.2);
  padding: 0 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar.visible {
  top: 0;
  opacity: 1;
}

.navbar a {
  text-decoration: none;
  color: #bc9c2f;
  font-weight: 400;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 0;
  transition: color 0.2s, transform 0.2s;
  cursor: pointer;
  font-family: 'Quattrocento', serif;
  letter-spacing: 0.5px;
}

.navbar a:hover {
  color: #d4b042;
  transform: translateY(-1px);
}

/* Button */
.open-invitation-btn {
  background: transparent;
  border: 1px solid #17320b;
  padding: 0.8rem 0.8rem;
  font-size: 12px;
  color: #17320b;
  font-family: 'Roboto Mono', monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-weight: 400;
}

.open-invitation-btn:hover {
  background: rgba(44, 44, 44, 0.1);
  transform: translateY(-2px);
}

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

/* Page sections */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.page-content {
  text-align: center;
  max-width: 600px;
}

.page h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.page p {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
}

/* Individual page colors */
#cover-page {
  /* full-page envelope background - put the image at ./images/background_cover.jpg or update the path below */
  background-image: url('./assets/background/background_cover.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  height: 100vh;
  /* fallback color if image fails to load */
}
#cover-page h1, #cover-page p { color: white; }

#cover-page .guest-name p {
  font-size: 1rem;
  color: #1f310c;
  font-weight: 400;
  font-family: 'Quattrocento', serif;
}

/* Layout for cover-page: use grid so wedding-of stays perfectly centered while guest-name sits above with space */
#cover-page .page-content {
  height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto 1fr; /* top flexible, middle auto (wedding), bottom flexible */
  align-items: center;
  justify-items: center;
  text-align: center;
}

#cover-page .guest-name {
  align-self: end; /* place at bottom of the top row */
  margin-bottom: 5rem; /* gap between guest-name and wedding-of */
}

#cover-page .wedding-of {
  grid-row: 2;
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#cover-page .wedding-of p {
  font-size: 1.1rem;
  margin-bottom: 0rem;
  color: #1f310c;
  font-weight: 300;
  font-family: 'Quattrocento', serif;
}

#cover-page .wedding-of h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #1f310c;
  font-weight: 400;
  font-family: 'Pinyon Script', cursive;
}

#cover-page .open-invitation-btn {
  /* remove grid placement, center inside .wedding-of */
  /* grid-row: 2; */
  justify-self: center;
  align-self: center;
  margin-top: 0;
}

#home-page {
  background-image: url('./assets/background/background_home.jpg');
  background-repeat: no-repeat;
  background-position: left;
  background-size: cover;
  background-color: #2d2b25; /* fallback color */
}
#home-page h1, #home-page p { color: white; }

#home-page .wedding-of {
  grid-row: 2;
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#home-page .wedding-of p {
  font-size: 1.1rem;
  margin-bottom: 0rem;
  color: #faf1e1;
  font-weight: 300;
  font-family: 'Quattrocento', serif;
}

#home-page .wedding-of h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #faf1e1;
  font-weight: 400;
  font-family: 'Pinyon Script', cursive;
}

.home-content {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.home-content.visible {
  opacity: 1;
}

#home-page .home-photo {
  /* wrapper: acts as a clipping container for the image */
  width: 11rem;
  height: 14rem;
  border-radius: 50% 50% 0 0;
  overflow: hidden; /* ensure the oversized inner image is clipped */
  display: block;
  position: relative;
  margin: 1.5rem auto; /* center horizontally */
}

#home-page .home-photo-img {
  /* image itself should fill the wrapper and be cropped via object-fit */
  width: 115%;
  height: 115%;
  display: block;
  object-fit: cover;
  object-position: center 31%;
  transform: translateY(-9%) translateX(-5%);
}

#home-page .date-location p {
  font-size: 0.8rem;
  color: #faf1e1;
  font-weight: 200;
  align-items: center;
  font-family: 'Roboto Mono', monospace;
}

.date-location {
  text-align: center; /* center the two <p> lines horizontally */
}

.date-location p {
  margin: 0.25rem 0;
}

#home-page .home-hashtag p {
  font-size: 1.1rem;
  color: #bc9c2f;
  font-weight: 400;
  align-items: center;
  font-family: 'Quattrocento', serif;
  margin-top: 1rem;
}

#page3 {
  /* full-page envelope background - put the image at ./images/background_cover.jpg or update the path below */
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  /* fallback color if image fails to load */
  background-color: #1f310c;
}
#page3 h1, #page3 p { color: white; }

#page3 .surah-section p {
  text-align: center;
  padding-top: 3vh;
  padding-bottom: 3vh;
  font-size: 0.8rem;
  color: white;
  font-weight: 300;
  line-height: 1.4;
  font-family: 'Roboto Mono', monospace;
}

#page3 .ornament-surah {
  max-width: 90vw;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

#page3 .ornament-surah-reverse {
  max-width: 90vw;
  transform: rotate(180deg);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

#page3 .ornament-surah-flower {
  align-self: center;
  width: 4rem;
  display: block;
  margin: auto; /* centers horizontally (and with align-self helps vertical centering in flex/grid) */
  justify-self: center; /* for grid containers */
  transform: translateY(35%);
  pointer-events: none;
  user-select: none;
}

#page4 {
  position: relative;
  background-color: #faf1e1;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* rotated decorative background using a pseudo-element so it can be transformed */
#page4::before {
  content: "";
  position: absolute;
  width: 15rem;
  height: 15rem;
  background-image: url('./assets/ornament/ornament_flower_1.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotate(150deg) scaleX(-1) translateX(-30%) translateY(-155%);
  transform-origin: center;
  pointer-events: none;
  z-index: 1;
}

/* Add a second ornament on the opposite/top-left for #page4 using ::after */
#page4::after {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  left: 1.5rem;
  top: 1.5rem;
  background-image: url('./assets/ornament/ornament_flower_2.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* small rotation/translation to give a natural, offset look */
  transform: rotate(15deg) translateX(-40%) translateY(60%);
  transform-origin: center;
  pointer-events: none;
  opacity: 0.95;
  z-index: 1;
}

/* ensure the page content sits above the decorative pseudo-element */
#page4 .page-content {
  position: relative;
  z-index: 1;
}

#page4 .bride-groom-title p {
  font-size: 2rem;
  color: #2d2b25;
  font-family: 'Parisienne', cursive;
}

#page4 .ornament-bride-groom-title {
  width: 40vw;
  display: block;
  margin: auto; /* centers horizontally (and with align-self helps vertical centering in flex/grid) */
  justify-self: center; /* for grid containers */
  margin-bottom: 1rem;
}

.bride-groom-photo {
  /* make the image bigger than its wrapper; wrapper will clip it */
  width: 240%;
  height: 240%;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%);
  transform-origin: center center;
  transition: transform 300ms ease, width 300ms ease, height 300ms ease;
  pointer-events: none;
  user-select: none;
}

/* wrapper keeps layout size but clips the larger image */
.bride-groom {
  margin: 1rem 0;
  position: relative; /* makes absolute positioning of the photo align to this wrapper */
  width: 13rem; /* same visual size as before */
  height: 19rem;
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  border: 1px solid #d9af7e
}

.bride-groom-name h1{
  margin-top: 1rem;
  font-size: 1.5rem;
  color: #2d2b25;
  font-weight: 200;
  font-family: 'Quattrocento', serif;
}

/* Ensure any <b> or <strong> inside the h1 actually appears bold (override the h1's light weight) */
.bride-groom-name h1 b,
.bride-groom-name h1 strong {
  font-weight: 700;
}

.bride-groom-content {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.bride-groom-content.visible {
  opacity: 1;
}

.bride-groom-name p {
  font-size: 0.8rem;
  color: #2d2b25;
  font-weight: 200;
  font-family: 'Roboto Mono', monospace;
}

.instagram-icon {
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.3rem;
}

/* make the icon and the username inline and vertically centered */
.bride-groom-instagram {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem; /* space between icon and text */
  text-decoration: none;
}

.bride-groom-instagram p {
  font-size: 0.8rem;
  color: #bc9c2f;
  font-weight: 400;
  font-family: 'Quattrocento', serif;
  margin-top: 0; /* remove previous top margin so it sits inline with the icon */
  text-decoration: none;
}

#page5 {
  position: relative;
  background-color: #faf1e1;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

#page5 .page-content {
  position: relative;
  z-index: 1;
}

#page5 .bride-groom-title p {
  font-size: 2rem;
  color: #2d2b25;
  font-family: 'Parisienne', cursive;
}

#page5 .ornament-bride-groom-title {
  width: 40vw;
  display: block;
  margin: auto; /* centers horizontally (and with align-self helps vertical centering in flex/grid) */
  justify-self: center; /* for grid containers */
  margin-bottom: 1rem;
}
/* rotated decorative background using a pseudo-element so it can be transformed */
#page5::before {
  content: "";
  position: absolute;
  width: 19rem;
  height: 19rem;
  right: 0;
  bottom: 0;
  background-image: url('./assets/ornament/ornament_flower_2.svg');
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: contain;
  transform: translateX(35%) translateY(60%) rotate(-35deg) ;
  pointer-events: none;
  z-index: 1;
}

#page5::after {
  content: "";
  position: absolute;
  width: 20rem;
  height: 20rem;
  right: 0;
  bottom: 0;
  background-image: url('./assets/ornament/ornament_flower_4.svg');
  background-repeat: no-repeat;
  background-size: contain;
  transform: translateX(-65%) translateY(-90%) rotate(50deg);
  pointer-events: none;
  z-index: 1;
}

.bride-groom-photo-man {
  /* make the image bigger than its wrapper; wrapper will clip it */
  width: 160%;
  height: 160%;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -32%);
  transform-origin: center center;
  transition: transform 300ms ease, width 300ms ease, height 300ms ease;
  pointer-events: none;
  user-select: none;
}

/* Page 6 — Venue */
#page6 {
  position: relative;
  background-color: #1f310c;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

#page6::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  z-index: 1;
  pointer-events: none;
}
 
#page6::before {
  content: "";
  position: absolute;
  width: 45rem;
  height: 30rem;
  background-image: url('./assets/ornament/ornament_venue.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* small rotation/translation to give a natural, offset look */
  transform: translateX(0%) translateY(80%);
  transform-origin: center;
  pointer-events: none;
  opacity: 0.95;
  z-index: 0;
}

#page6 .page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

#page6 h2 {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  color: #faf1e1;
  font-family: 'Quattrocento', serif;
  font-weight: 200;
}

#page6 .venue-photo {
  width: 17rem;
  height: auto;
}

#page6 .venue-divider {
  width: 12rem;
  margin: 1.5rem 0;
}

.venue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.venue-info {
  padding: 1rem 0;
}

.venue-title {
  font-family: 'Quattrocento', serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.wedding-date p {
  font-size: 1rem;
  color: #faf1e1;
  font-family: 'Quattrocento', serif;
  font-weight: 600;
  margin-bottom: 1rem;
}

.wedding-time p {
  font-size: 0.9rem;
  color: #faf1e1;
  font-family: 'Roboto Mono', monospace;
  font-weight: 200;
}

.venue-date, .venue-address {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.95rem;
  color: #2d2b25;
  margin: 0.25rem 0;
}

.venue-times p {
  margin: 0.25rem 0;
  font-family: 'Roboto Mono', monospace;
  color: #2d2b25;
  font-size: 0.95rem;
}

#page6 .venue-name p {
  font-family: 'Quattrocento', serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #faf1e1;
}

#page6 .venue-address p {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  font-weight: 200;
  color: #faf1e1;
  margin-bottom: 1rem;
}

#page6 .venue-map {
  margin-top: 2rem;
}

#page6 .open-map-btn {
  border: 1px solid #faf1e1;
  padding: 0.3rem 1.5rem;
  font-size: 0.8rem;
  color: #faf1e1;
  font-family: 'Roboto Mono', monospace;
  font-weight: 200;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  background-color: #bc9c2f;
  text-decoration: none;
  z-index: 3;
}

/* Page 7 — RSVP */
#page7 {
  background-color: #1f310c;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  color: #faf1e1;
  z-index: 0;
}

#page7 .page-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

#page7 h2 {
  font-family: 'Quattrocento', serif;
  font-size: 1.8rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  color: #faf1e1;
  font-weight: 300;
  line-height: 1.3;
}

#page7 .rsvp-content {
  z-index: 1;
}

.rsvp-content p {
  color: #faf1e1;
  font-family: 'Quattrocento', serif;
  font-weight: 200;
  font-size: 0.9rem;
}

.rsvp-content p.rsvp-deadline {
  font-family: 'Quattrocento', serif;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  color: #faf1e1;
  font-weight: 600;
}

.rsvp-form {
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* #page7 .page-content::before {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  right: 0rem;
  top: 0rem;
  background-image: url('./assets/ornament/ornament_surah.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform-origin: center;
  transform: translateY(-35%);
}

.rsvp-form::after {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  right: 0rem;
  top: 0rem;
  background-image: url('./assets/ornament/ornament_surah.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform-origin: center;
  transform: translateY(120%) rotate(180deg);
} */

.rsvp-form label {
  font-size: 0.85rem;
  color: #2d2b25;
  font-weight: 500;
}

.rsvp-form input[type="text"],
.rsvp-form textarea,
.rsvp-form select {
  width: 100%;
  font-size: 0.8rem;;
  padding: 0.8rem 1.2rem;
  border: none;
  background: #faf1e1;
  font-family: 'Quattrocento', serif;
  font-size: 1rem;
  color: #bc9c2f;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  justify-self: center;
  align-items: center;
  border-radius: 0;
  text-align: left;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="%23c4a853"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 15px center;
}

/* Override disabled styling for guest-name input */
.rsvp-form input[type="text"]:disabled {
  opacity: 1;
  -webkit-text-fill-color: #bc9c2f;
  color: #bc9c2f;
  background: #faf1e1;
  cursor: default;
}

.rsvp-form input[type="text"]::placeholder {
  color: #bc9c2f;
  opacity: 1;
  text-align: left;
}

.rsvp-form textarea { resize: vertical; }

.attendance-group {
  border: 1px solid rgba(45,43,37,0.06);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.attendance-group legend { display: none; }

.attendance-group label {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.95rem;
}

/* Ensure the existing .open-invitation-btn looks right on the form */
#page7 .open-invitation-btn {
  width: max-content;
  padding: 0.7rem 1rem;
  margin-top: 0.5rem;
}

.attendance-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.attendance-btn {
  padding: 0.8rem 0.5rem;
  font-size: 0.7rem;
  font-family: 'Roboto Mono', monospace;
  font-weight: 200;
  text-transform: uppercase;
  border: 1px solid #faf1e1;
  background: transparent;
  color: #faf1e1;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.attendance-btn:hover {
  background: rgba(250, 241, 225, 0.1);
}

.attendance-btn.active {
  background: #bc9c2f;
  border-color: #faf1e1;
  color: #faf1e1;
  font-weight: 200;
}

.guest-details {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.guest-details.hidden {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.rsvp-form input[type="text"]::placeholder {
  color: #bc9c2f;
  opacity: 1;
}

.submit-rsvp-btn {
  width: 100%;
  padding: 1rem 1rem;
  font-size: 0.8rem;
  font-family: 'Roboto Mono', monospace;
  font-weight: 200;
  text-transform: uppercase;
  border: 2px solid #1f1f1f;
  background: #bc9c2f;
  color: #faf1e1;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  border: 1px solid #faf1e1;
}

.submit-rsvp-btn:hover {
  background: #d4b042;
  border-color: #d4b042;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(188, 156, 47, 0.3);
}

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

/* Thank you message styles */
.thank-you-message {
  text-align: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.attendance-summary {
  margin-bottom: 3rem;
}

.summary-box {
  margin-top: 2rem;
  display: inline-block;
  padding: 0.75rem;
  color: #faf1e1;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid #faf1e1;
}

#page7 .thank-you-title {
  font-family: 'Quattrocento', serif;
  font-size: 1rem;
  margin-top: 6rem;
  margin-bottom: 1.5rem;
  color: #faf1e1;
  font-weight: 300;
}

.thank-you-message .thank-you-text {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: #faf1e1;
  font-weight: 200;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* Page 8 — Gallery */
#page8 {
  background-color: #2d2b25;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  color: #2d2b25;
}

#page8 .page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

#page8 h2 {
  font-family: 'Parisienne', cursive;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.gallery-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(45,43,37,0.08);
  transition: transform 200ms ease, box-shadow 200ms ease, opacity 1s ease-in-out;
  cursor: pointer;
  opacity: 0;
}

.gallery-grid img.visible {
  opacity: 1;
}

/* Page 9 — Games */
#page9 {
  background-color: #faf1e1;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
}

#page9::before {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  left: -2rem;
  top: 2rem;
  background-image: url('./assets/ornament/ornament_flower_3.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotate(-20deg);
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
}

#page9::after {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  right: -2rem;
  bottom: 2rem;
  background-image: url('./assets/ornament/ornament_flower_4.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotate(20deg);
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
}

#page9 .page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

#page9 h2 {
  font-family: 'Quattrocento', serif;
  font-size: 1.8rem;
  color: #2d2b25;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 300;
  line-height: 1.3;
}

.page .games-subtitle {
  font-family: 'Quattrocento', serif;
  font-size: 0.9rem;
  color: #2d2b25;
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 300;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-family: 'Quattrocento', serif;
  font-size: 0.9rem;
  color: #2d2b25;
  font-weight: 400;
}

.stat-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.5rem;
  color: #bc9c2f;
  font-weight: 600;
}

.memory-game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  min-width: 300px;
  max-width: 300px;
  margin: 0 auto 2rem;
  perspective: 1000px;
}

.memory-card {
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.memory-card.flipped {
  transform: rotateY(180deg);
}

.memory-card.matched .card-front img {
  opacity: 0.5;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(188, 156, 47, 0.3);
  background: white;
  border-radius: 8px;
}

.card-back {
  background: #d4b042;
  border: 2px solid #bc9c2f;
}

.card-back::before {
  content: '?';
  font-size: 3rem;
  color: #faf1e1;
  font-family: 'Quattrocento', serif;
}

.card-front {
  transform: rotateY(180deg);
  background: #faf1e1;
}

.card-front img {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

.card-emoji {
  font-size: 2rem;
  line-height: 1;
}

.reset-game-btn {
  display: block;
  margin: 0 auto;
  background: #bc9c2f;
  padding: 0.7rem 2rem;
  font-size: 0.8rem;
  color: #faf1e1;
  font-family: 'Roboto Mono', monospace;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #faf1e1;
  letter-spacing: 1.5px;
}

.reset-game-btn:hover {
  background: #d4b042;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(188, 156, 47, 0.3);
}

.show-leaderboard-btn {
  display: block;
  margin: 1.5rem auto 0;
  background: transparent;
  border: none;
  color: #bc9c2f;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Remove old game complete message styles */
.game-complete-message {
  display: none;
}

.game-complete-modal-content {
  text-align: center;
  background: #faf1e1;
  border: 2px solid #bc9c2f;
  padding: 1.5rem;
}

.game-complete-modal-content .modal-header {
  border-bottom: none;
  padding-bottom: 0;
  justify-content: center; /* Center the title */
  position: relative;
}

.game-complete-modal-content .modal-header h2 {
  font-family: 'Quattrocento', serif;
  font-size: 1.8rem;
  color: #2d2b25;
  margin: 0;
}

.game-complete-modal-content .close-btn {
  position: absolute;
  top: -5px;
  right: 5px;
  color: #2d2b25;
  font-size: 28px;
}

.game-complete-modal-content .modal-body {
  padding-top: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.game-complete-modal-content p {
  font-family: 'Quattrocento', serif;
  font-size: 1rem;
  color: #2d2b25;
  margin-bottom: 0.5rem;
}

.game-complete-modal-content .complete-stats {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  color: #bc9c2f;
  font-weight: 600;
  line-height: 1.8;
  margin: 1rem 0;
}

.game-complete-modal-content .autosave-info {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: #666;
}

.games-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.game-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(188, 156, 47, 0.2);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(188, 156, 47, 0.15);
  border-color: #bc9c2f;
}

.game-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.game-card h3 {
  font-family: 'Quattrocento', serif;
  font-size: 1.3rem;
  color: #2d2b25;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.game-card p {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.game-btn {
  background: #bc9c2f;
  border: 1px solid #bc9c2f;
  padding: 0.7rem 1.5rem;
  font-size: 0.85rem;
  color: #faf1e1;
  font-family: 'Roboto Mono', monospace;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-btn:hover {
  background: #d4b042;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(188, 156, 47, 0.3);
}

/* Page 10 — Gifts */
#page10 {
  background-color: #0a0a0a;
  background-image: url('./assets/background/background_gifts.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

#page10::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  z-index: 1;
  pointer-events: none;
}

#page10 .page-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#page10 .gifts-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 0;
}

.gifts-text-intro {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #faf1e1;
}

.page-content .gifts-main-text {
  font-family: 'Quattrocento', serif;
  font-size: 1rem;
  color: #faf1e1;
  margin-bottom: 1rem;
  font-weight: 200;
  text-align: left;
}

.page-content .gifts-secondary-text {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  color: #faf1e1;
  font-weight: 300;
  text-align: left;
}

.gift-info-card {
  background: #faf1e1;
  padding: 1.2rem 1.2rem;
  width: 100%;
  max-width: 400px;
  text-align: left;
}

.gift-section {
  margin-bottom: 0.75rem;
}

.gift-section.physical-gift {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.page-content .gift-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: #2d2b25;
  font-weight: 300;
}

.page-content .physical-gift-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: #2d2b25;
  font-weight: 300;
}

.page-content .gift-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: #2d2b25;
  margin: 0;
  line-height: 1.4;
  font-weight: 300;
}

.gift-value.gift-name {
  font-weight: 600;
  font-size: 0.8rem;
}

.gift-value.gift-account {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.gift-value.gift-address-text {
  font-size: 0.75rem;
  line-height: 1.6;
}

.copy-number-btn,
.copy-address-btn {
  width: 80%;
  background: #bc9c2f;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: #faf1e1;
  font-family: 'Roboto Mono', monospace;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.7rem;
  z-index: 2;
}

.copy-number-btn {
  margin-bottom: 0.7rem;
}

.copy-address-btn {
  margin-bottom: 0;
}

.copy-number-btn:hover,
.copy-address-btn:hover {
  background: #d4b042;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(188, 156, 47, 0.4);
}

.copy-number-btn:active,
.copy-address-btn:active {
  transform: translateY(0);
  background-color: #2b4b49;
}

/* Leaderboard Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #ffffff;
  margin: 30% auto;
  padding: 20px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px_30px rgba(0, 0, 0, 0.1);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

#page9 .modal-header h2 {
  font-family: 'Quattrocento', serif;
  font-size: 1.5rem;
  color: #bc9c2f;
  margin: 0;
  text-align: center;
}

.close-btn {
  color: #888;
  font-size: 24px;
  font-weight: normal;
  cursor: pointer;
}

.modal-body {
  padding-top: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  background-color: #f8f8f8;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.leaderboard-entry .rank {
  font-family: 'Quattrocento', serif;
  font-weight: bold;
  font-size: 1.2rem;
  color: #bc9c2f;
  margin-right: 16px;
}

.leaderboard-player-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-grow: 1;
}

.leaderboard-entry .name {
  font-family: 'Quattrocento', serif;
  font-size: 0.9rem;
  color: #4b5320;
  text-align: left;
  margin-bottom: 4px;
}

.leaderboard-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.leaderboard-entry .moves {
  font-family: 'Roboto Mono', monospace;
  font-weight: 400;
  color: #888;
  font-size: 0.7rem;
}

.leaderboard-entry .time {
  font-family: 'Roboto Mono', monospace;
  font-weight: bold;
  color: #bc9c2f;
  font-size: 0.7rem;
}

/* Page 11 — Wishes */
#page11 {
  background-color: #2d2b25;
  background-image: url('./assets/background/background_noise.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
  /* overflow-y: auto; */
  z-index: 0;
}

#page11::before {
  display: none;
}

#page11 .page-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
  z-index: 1;
}

#page11 h2 {
  font-family: 'Quattrocento', serif;
  font-size: 1.8rem;
  color: #faf1e1;
  text-align: center;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 300;
  line-height: 1.3;
}

#page11 h3 {
  font-family: 'Quattrocento', serif;
  font-size: 1.4rem;
  color: #faf1e1;
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  text-align: center;
  font-weight: 400;
}

.page .wishes-subtitle {
  font-family: 'Quattrocento', serif;
  font-size: 0.9rem;
  color: #faf1e1;
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.wishes-form-container {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 2rem;
}

.wishes-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wishes-form input[type="text"] {
  display: none;
}

.wishes-form textarea {
  width: 100%;
  padding: 1rem 1rem;
  border: none;
  background: rgba(250, 241, 225, 0.95);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: #2d2b25;
  transition: background 0.3s ease;
  resize: vertical;
  min-height: 50px;
  max-height: 120px;
  border-radius: 0;
}

.wishes-form textarea::placeholder {
  color: rgba(45, 43, 37, 0.5);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
}

.wishes-form textarea:focus {
  outline: none;
  background: #faf1e1;
}

.submit-wish-btn {
  width: 100%;
  padding: 0.7rem 0.7rem;
  font-size: 0.8rem;
  font-family: 'Roboto Mono', monospace;
  font-weight: 400;
  text-transform: uppercase;
  border: 1px solid #faf1e1;
  background: #bc9c2f;
  color: #faf1e1;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1.5px;
}

.submit-wish-btn:hover {
  background: #d4b042;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(188, 156, 47, 0.3);
}

.wishes-display {
  margin: 0 2rem 0 0;
  padding: 1rem 1rem 1rem 0.5rem;
  min-width: 75vw;
  min-height: 400px;
  max-height: 50vh;
  overflow-y: auto;
}

.wishes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wish-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(250, 241, 225, 0.2);
  padding: 0.3rem 0 1rem 0;
  transition: all 0.3s ease;
}

.wish-card:hover {
  border-bottom-color: rgba(250, 241, 225, 0.4);
}

.wish-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  padding-bottom: 0;
  border-bottom: none;
  gap: 0.3rem;
}

.wish-author {
  font-family: 'Quattrocento', serif;
  font-size: 0.95rem;
  color: #faf1e1;
  font-weight: 600;
}

.wish-date {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  color: rgba(250, 241, 225, 0.6);
}

.page .wish-text {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  text-align: left;
  color: #faf1e1;
  line-height: 1.7;
  font-weight: 300;
}

/* Footer */
.footer {
  position: relative;
  padding: 4rem 2rem;
  text-align: center;
  color: #faf1e1;
  font-family: 'Quattrocento', serif;
  min-height: 350px;
  z-index: 1;
  overflow: hidden; /* Prevent pseudo-element from overflowing */
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 150%;
  background-image: url('./assets/background/background_footer.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  pointer-events: none;
  transform: translateX(0) translateY(-5%);
  z-index: -1;
  filter: brightness(0.75);
  opacity: 1;
}

.footer-text p {
  font-family: 'Quattrocento', serif;
  color: #faf1e1;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin: 0.3rem 0;
  font-weight: 300;
}

.footer-names {
  font-weight: 400;
  font-family: 'Pinyon Script', cursive;
  font-size: 3.5rem;
  margin: 0.5rem 0 1rem 0;
  color: #faf1e1;
}

.credit-text {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: #ffffff;
  background-color: #000000;
  text-align: center;
  padding: 0.5rem;
  font-weight: 300;
  z-index: 1;
}

.credit-text p {
  font-size: 0.6rem;
  color: #ffffff;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

#music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1000;
}

#music-player img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.playing img {
  animation: spin 4s linear infinite;
}

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

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-indicator::before {
  content: '↓';
  font-size: 2rem;
  color: white;
}

/* Page indicators */
.page-indicators {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-indicators .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.page-indicators .dot.active {
  background: white;
  transform: scale(1.3);
}

/* Responsive */
@media (max-width: 900px) {
  .venue-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .games-container { grid-template-columns: 1fr; }
  .gift-options { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar {
    gap: 0.8rem;
    height: 60px;
    padding: 0 0.5rem;
  }

  .navbar a {
    font-size: 0.7rem;
    padding: 6px 5px;
  }
  
  .gallery-grid img { height: 200px; }
  .map-placeholder { height: 160px; }
  #page6 .page-content, #page7 .page-content { padding: 1rem; }
  #page9 .page-content, #page10 .page-content { padding: 2rem 1rem; }
  #page11 .page-content { padding: 3rem 1rem; }
}

@media (max-width: 480px) {
  .navbar {
    gap: 1.5rem;
    padding: 0 0.25rem;
  }
  
  .navbar a {
    font-size: 0.8rem;
    padding: 4px 4px;
  }
  
  .gallery-grid img { 
    height: 190px; 
  }
  .gallery-grid {
    margin-top: 1rem;
  }
  .map-placeholder { height: 160px; }
  #page6 .page-content, #page7 .page-content, #page8 .page-content { padding: 1rem; }
  #page9 .page-content { padding: 3rem 1rem 1rem 1rem; }
  #page10 .page-content { padding: 2rem 1rem; }
  #page11 .page-content { padding: 4rem 1rem 1rem 1rem; }
  
  .games-container { gap: 1.5rem; }
  .game-card { padding: 1.5rem 1rem; }
  .gift-card { padding: 2rem 1.5rem; }
}

/* Hide cover page with fade-out effect */
.cover-page.hidden {
  opacity: 0;
  transition: opacity 1s ease-out;
  pointer-events: none; /* Disable interaction while hiding */
}

body.no-scroll {
  overflow: hidden;
  position: fixed; /* More robust for mobile */
  width: 100%;
  overscroll-behavior: none;
}