.main-container {
    display: flex;
    justify-content: center;   /* CENTER THE WHOLE BLOCK */
    align-items: center;
    gap: 40px;                 /* space between text & heart */

    width: 100vh;
    height: 100vh;

    overflow: visible;   /* ✅ allow glow outside heart box */
}

* {
  box-sizing: border-box;
}

canvas {
  max-width: 100%;
  max-height: 100%;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  /* padding: 0; */
  overflow: hidden; /* overflow hidden clips overflow content (no scrollbars) */ 
}

/* TEXT stays centered inside its own area */
.text-section {
    position: relative;
    text-align: center;
    max-width: 400px;
}

/* HEART stays on the right of text */
.heart-section {
    display: flex;
    justify-content: center;
}

body {
  /* margin: 0;
  padding: 10px; */
  touch-action: none;
  overflow-x: hidden;

  background: lightpink;
  color: white;
  font-family: Arial, sans-serif;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
}


/* MAIN GRID LAYOUT (matches your diagram) */
.page-grid {
  width: 100vw;
  height: 100vh;
  padding: 18px;

  display: grid;
  gap: 18px;

  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr auto;

  grid-template-areas:
    "slot1 slot2 slot3"
    "scene center canvas"
    "slot4 . slot5";

  align-items: center;
  justify-items: center;
}

/* Place each box into the grid area */
#slot1 { grid-area: slot1; }
#slot2 { grid-area: slot2; }
#slot3 { grid-area: slot3; }
#slot4 { grid-area: slot4; }
#slot5 { grid-area: slot5; }

.scene-area { grid-area: scene; }
.center-area { grid-area: center; }
.canvas-area { grid-area: canvas; }

.middle-area {
  width: clamp(220px, 26vw, 440px);   /* ✅ smaller width */
  height: clamp(260px, 40vh, 520px);  /* ✅ smaller height */
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: rgba(255,255,255,0.10);
}


.middle-area {
  min-width: 0;
  min-height: 0;
}

/* .middle-overlay {
  background: rgba(0,0,0,0.35); 
} */

.middle-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 18px;

  /* ✅ strong dark layer so text is visible */
  background:transparent;
}

.middle-overlay h1,
.middle-overlay h2,
.middle-overlay p,
#message,
.final-love {
  color: white;
  /* text-shadow: 0 3px 10px rgba(0,0,0,0.9); */
  text-shadow: 0 3px 10px rgba(0,0,0,0.85); /* ✅ readable on photo */
}

/* Image 4: background image for middle text area */
#slot4Img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: contain;       /* ✅ NOT zoomed */
  object-position: center;

  display: none;             /* shown by JS */
}

#slot5{
  position: relative; /* ✅ required so canvas stays inside this box */
  overflow: hidden;
}

#slot5Img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;          /* shown when filled */
  position: relative;
  z-index: 1;             /* image layer */
}

.slot { border: none; }
.slot.filled { border: 3px solid rgba(255, 125, 0, 0.85); }

/* IMAGE SLOTS */
.slot {
  width: clamp(170px, 25vw, 420px);
  /* height: clamp(120px, 18vh, 240px); */
 height: clamp(240px, 34vh, 420px);


  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  /* border: 3px solid rgba(255, 125, 0, 0.85);  */
  border: none;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none; /* hidden until filled */
  opacity: 0;
  transition: opacity 0.6s ease;

}


.slot img[style*="display: block"] {
  display: block;
  opacity: 1;
}

.slot:has(img[style*="display: block"]) {
  border: 3px solid rgba(255, 125, 0, 0.85);
}

/* Center content */
.center-area {
  text-align: center;
  max-width: 420px;
}

.center-area h1 {
  color: #1a0d0d;
  margin: 0 0 6px 0;
}

.eng-date {
  margin: 0 0 10px 0;
}



/* body {
    background: lightpink;
    color: white;
    text-align: center;
    font-family: Arial;
} */

h1 {
    color: #110b0c;
}

button {
    padding: 10px 20px;
    margin: 10px;
    font-size: 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

#yesBtn {
    position: absolute;
    left: 20px;
    top: 35x;
    background: #ff4d6d;
    color: white;
}

.btn-area{
  position: relative;
  width: 320px;
  height: 110px;
  margin: 12px auto 0 auto;
}

#noBtn{
    position: absolute;
    right: 20px;
    top: 35px;
    background: gray;
    color: white;

  /* left: 180px;
  top: 20px; */
}

/* #noBtn {
    background: gray;
    color: white;
    position: absolute;
} */

#shareBtn {
    background: #25D366;
    color: white;
    font-weight: bold;
}

#message {
    margin-top: 12px;
    font-size: 18px;
    color: #fff;
    min-height: 26px;
}

.final-love {
  display: none;
  margin-top: 12px;
  font-size: 20px;
  font-weight: bold;
}

/* HEART SCENE (left) */
.scene-area {
  display: flex;
  justify-content: center;
  align-items: center;

  /* IMPORTANT: give room so glow doesn’t get cut */
  padding: 30px;
  overflow: visible;
}


p {
    margin-bottom: 5px;
}

#question {
    margin-top: 0;
}

#question {
    color: white;
    font-weight: bold;
}

/* canvas {
    margin-top: 20px;
    background: #111;
    align-items: center;
} */

/* canvas {
    display: block;
    margin: 20px auto;
} */

/* body {
    display: flex;
    flex-direction: column;
    align-items: center;
} */

canvas {
    display: block;
    margin: 20px auto;
}

/* #popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.8);

    z-index: 9999;

    flex-direction: column;
} */

/*#popup img {
    width: 250px;
    border-radius: 10px;
}*/

/* #popup img {
    width: 80%;
    max-width: 300px;
    border-radius: 10px;
} */

#popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.85);

    z-index: 9999;

    justify-content: center;
    align-items: center;
}

#popupContent {
    background: #222;
    padding: 20px;
    border-radius: 12px;
    text-align: center;

    max-width: 90%;
}

#popup img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

#popup button {
    margin-top: 10px;
    padding: 8px 15px;
    cursor: pointer;
}
------------------------------
/* 🌌 3D SCENE BACKGROUND */
/* body {
    overflow-x: hidden;
    background: radial-gradient(circle, #111, #000);
} */

/* 🧊 3D Scene */
.scene {
    width: 200px;
    height: 200px;
    margin: 40px auto;
    perspective: 800px;
    overflow: visible;   /* ✅ allow glow to extend */
    padding: 40px;  /* extra space for glow */
}



/* ❤️ HEART CORE */
.heart {
    width: 100px;
    height: 100px;
    background: #ff4d6d;
    position: relative;
    transform: rotate(-45deg);
    animation: rotate3d 4s infinite linear;
    /* box-shadow: 0 0 40px #ff4d6d; */
  /* box-shadow: 0 0 60px rgba(255, 77, 109, 0.8); */

  filter: drop-shadow(0 0 25px rgba(255, 77, 109, 0.9))
        drop-shadow(0 0 50px rgba(255, 77, 109, 0.55));

}

/* ❤️ HEART SHAPE PARTS */
.heart::before,
.heart::after {
    content: "";
    width: 100px;
    height: 100px;
    background: #ff4d6d;
    border-radius: 50%;
    position: absolute;
}

.heart::before {
    top: -50px;
    left: 0;
}

.heart::after {
    left: 50px;
    top: 0;
}


/* CANVAS RIGHT */
.canvas-area {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

#heartCanvas {
  /* width: clamp(180px, 25vw, 360px);
  height: auto; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 85%;
  height: auto;

  z-index: 10;            /* ✅ above the photo */
  display: none;          /* ✅ only show at the end */
  pointer-events: none;   /* ✅ canvas won't steal clicks */ 
  /* 【4-8504cf】 */

}


/* 🔄 3D ROTATION */
@keyframes rotate3d {
    0% {
        transform: rotateY(0deg) rotate(-45deg) scale(1);
    }
    50% {
        transform: rotateY(180deg) rotate(-45deg) scale(1.2);
    }
    100% {
        transform: rotateY(360deg) rotate(-45deg) scale(1);
    }
}

/* body {
    margin: 0;
    padding: 10px;
    overflow-x: hidden;
} */

button {
    touch-action: manipulation;
}

/* 📱 MOBILE RESPONSIVE DESIGN */

@media (max-width: 900px) {
  .page-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "slot1 slot2"
      "slot3 slot3"
      "center center"
      "scene canvas"
      "slot4 slot5";
    gap: 12px;
    padding: 12px;
  }

  .btn-area { width: 300px; }
}


/* @media screen and (max-width: 768px) {

    h1 {
        font-size: 22px;
        padding: 10px;
    }

    h2 {
        font-size: 18px;
    }

    button {
        font-size: 16px;
        padding: 8px 14px;
    }

    canvas {
        width: 90%;
        height: auto;
    }

    #popup img {
        width: 80%;
        max-width: 250px;
    }

    #message {
        font-size: 16px;
        padding: 10px;
    }

    .scene {
        transform: scale(0.8);
    }

    .main-container {
        flex-direction: column;
    }
} */

.heart-section canvas {
    width: 300px;
}