  html,
  body {
      margin: 0px;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
  }

  /* Hide pricing popup */
  #pricingContainer {
      display: none !important;
  }

  #orientation-lock {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.96);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 99999;
      color: #fff;
      text-align: center;
      font-family: 'Arial', sans-serif;
      font-size: 18px;
      display: none;
      transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #orientation-lock .phone-icon {
      font-size: 64px;
      opacity: 0.92;
      animation: phone-bounce-smooth 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
      filter: drop-shadow(0 4px 16px #fff3);
      transition: filter 0.4s, opacity 0.4s;
  }

  @keyframes phone-bounce-smooth {
      0% {
          transform: rotate(-45deg) scale(1);
          opacity: 0.8;
      }

      20% {
          transform: rotate(-45deg) scale(1.05);
          opacity: 1;
      }

      40% {
          transform: rotate(45deg) scale(1.1);
          opacity: 1;
      }

      60% {
          transform: rotate(45deg) scale(1.1);
          opacity: 1;
      }

      80% {
          transform: rotate(-45deg) scale(1.05);
          opacity: 1;
      }

      100% {
          transform: rotate(-45deg) scale(1);
          opacity: 0.8;
      }
  }

  #matrix-rain {
      position: fixed;
      top: 0;
      left: 0;
      width: 104%;
      height: 100%;
      z-index: 1;
      pointer-events: none;
  }

  #settingsModal {
      z-index: 11000 !important;
  }

  body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
      font-family: 'Arial', sans-serif;
      overflow: hidden;
      position: relative;
  }


  /* Enhanced Heart Effect */
  .heart {
      position: fixed;
      z-index: 1000;
      pointer-events: none;
      color: #ff6b6b;
      font-size: 20px;
      animation: float-heart 4s ease-in-out forwards;
  }

  @keyframes float-heart {
      0% {
          transform: translateY(0) scale(0);
          opacity: 0;
      }

      10% {
          transform: translateY(-20px) scale(1);
          opacity: 1;
      }

      90% {
          opacity: 1;
      }

      100% {
          transform: translateY(-700px) scale(0);
          opacity: 0;
      }
  }

  .book-container {
      perspective: 2000px;
      position: relative;
      display: none;
      opacity: 0;
      transform: scale(0.8) translateY(50px);
      transition: opacity 1s ease, transform 1s ease;
  }

  .book-container.show {
      display: block;
      opacity: 1;
      transform: scale(1) translateY(80px);
  }

  .content-display {
      position: fixed;
      top: 2%;
      left: 50%;
      transform: translateX(-50%);
      width: 85vw;
      max-width: 650px;
      min-height: 160px;
      max-height: 230px;
      /* Giữ nguyên để không che book */
      background:
          linear-gradient(145deg, #ffffff 0%, #fefefe 100%),
          radial-gradient(circle at 50% 50%, rgba(255, 192, 203, 0.05) 0%, transparent 60%);
      border: none;
      border-radius: 20px;
      padding: 40px 35px;
      box-shadow:
          0 20px 60px rgba(255, 105, 180, 0.15),
          0 10px 30px rgba(0, 0, 0, 0.08),
          inset 0 1px 0 rgba(255, 255, 255, 0.9),
          inset 0 -1px 0 rgba(255, 192, 203, 0.1);
      backdrop-filter: blur(20px);

      /* Mặc định ẩn */
      opacity: 0;
      display: none;
      pointer-events: none;

      font-family: 'Crimson Text', serif;
      overflow-y: auto;
      /* Luôn cho phép scroll */
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 105, 180, 0.3) transparent;
      scroll-behavior: smooth;
      box-sizing: border-box;
      z-index: 10;

      /* Romantic paper texture
            background-image:
                radial-gradient(circle at 100% 50%, transparent 20%, rgba(255, 240, 245, 0.3) 21%, rgba(255, 240, 245, 0.3) 34%, transparent 35%, transparent),
                linear-gradient(0deg, rgba(255, 240, 245, 0.1) 50%, transparent 50%);
            background-size: 30px 60px, 100% 4px; */

      /* Romantic border decoration */
      border: 3px solid transparent;
      /* background-clip: padding-box; */

      /* Animation cho hiệu ứng xuất hiện */
      transition: all 0.5s ease;
  }

  .content-display::after {
      content: '🎉';
      position: absolute;
      top: 15px;
      right: 20px;
      font-size: 24px;
      opacity: 0.6;
      animation: heartbeat 2s ease-in-out infinite;
  }

  .content-display.show {
      display: block;
      opacity: 1 !important;
      pointer-events: auto;
      background: rgba(255, 255, 255, 0.98) !important;
  }

  .content-display p {
      margin: 0;
      padding: 0;
      color: #2c1810;
      font-size: clamp(18px, 3vw, 24px);
      line-height: 2.2;
      text-align: center;
      font-weight: 400;
      font-family: 'Dancing Script', 'Brush Script MT', 'Lucida Handwriting', 'Comic Sans MS', cursive;
      width: 100%;
      opacity: 1;
      transform: translateY(0);
      transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
      min-height: fit-content;
      display: block;
      text-shadow: 0 1px 2px rgba(255, 105, 180, 0.1);
      letter-spacing: 0.5px;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;

      /* Romantic text effects */
      background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513, #6b3410);
      background-size: 400% 400%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      animation: romanticText 8s ease-in-out infinite;
  }

  @keyframes romanticBorder {

      0%,
      100% {
          background-position: 0% 50%;
      }

      50% {
          background-position: 100% 50%;
      }
  }

  @keyframes heartbeat {

      0%,
      100% {
          transform: scale(1);
          opacity: 0.6;
      }

      50% {
          transform: scale(1.2);
          opacity: 0.9;
      }
  }

  @keyframes floatingHearts {

      0%,
      100% {
          transform: translateY(0px);
      }

      50% {
          transform: translateY(-5px);
      }
  }


  .typewriter-text {
      display: inline;
  }

  .typewriter-cursor {
      display: inline-block;
      background-color: #333;
      margin-left: 2px;
      width: 2px;
      height: 1.2em;
      animation: blink 1s infinite;
  }

  @keyframes blink {

      0%,
      50% {
          opacity: 1;
      }

      51%,
      100% {
          opacity: 0;
      }
  }

  .book-container::before {
      content: '';
      position: absolute;
      top: -20px;
      left: -20px;
      right: -20px;
      bottom: -20px;
      background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
      z-index: -1;
      filter: blur(15px);
      animation: glowPulse 3s ease-in-out infinite;
  }

  @keyframes glowPulse {

      0%,
      100% {
          opacity: 0.5;
          transform: scale(1);
      }

      50% {
          opacity: 0.8;
          transform: scale(1.05);
      }
  }

  .book {
      width: 600px;
      height: 400px;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.5s ease;
      cursor: grab;
      user-select: none;
      display: none;
  }

  .book.show {
      display: block;
  }

  .page {
      width: 300px;
      height: 400px;
      position: absolute;
      top: 0;
      right: 0;
      transform-origin: left center;
      transform-style: preserve-3d;
      transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), 0 10px 20px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
      cursor: pointer;
      touch-action: pan-x;
  }

  .page-front,
  .page-back {
      position: absolute;
      width: 100%;
      height: 100%;
      backface-visibility: hidden;
      overflow: hidden;
      border: 2px solid #ddd;
      border-radius: 0 8px 8px 0;
  }

  .page-front {
      background: white;
      z-index: 2;
  }

  .page-back {
      background: white;
      transform: rotateY(180deg);
      border-radius: 8px 0 0 8px;
  }

  .page-front img,
  .page-back img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      border-radius: inherit;
      position: relative;
      z-index: 1;
  }

  .page-front::before,
  .page-back::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 0;
      pointer-events: none;
  }

  .page-front::before {
      background: linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 2%, transparent 10%);
  }

  .page-back::before {
      background: linear-gradient(90deg, transparent 90%, rgba(0, 0, 0, 0.05) 98%, rgba(0, 0, 0, 0.1) 100%);
  }

  .page.flipped {
      transform: rotateY(-180deg);
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), -10px 10px 20px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  }

  .page.flipping {
      transform: rotateY(-90deg);
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), -5px 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  }

  /* Dynamic z-index cho pages - hỗ trợ số lượng trang không giới hạn */
  .page {
      z-index: var(--page-z-index, 1);
  }

  .page.flipped {
      z-index: var(--page-flipped-z-index, 1);
  }

  /* Đảm bảo tất cả pages đều có z-index mặc định */
  .page {
      z-index: var(--page-z-index, 1);
  }

  .page.flipped {
      z-index: var(--page-flipped-z-index, 1);
  }

  .empty-page {
      background: #f9f9f9;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #ccc;
      font-size: 14px;
      font-style: italic;
  }

  @keyframes giftCelebration {
      0% {
          transform: translate(-50%, -50%) scale(0.5);
          opacity: 0;
      }

      50% {
          transform: translate(-50%, -50%) scale(1.1);
          opacity: 1;
      }

      100% {
          transform: translate(-50%, -50%) scale(1);
          opacity: 1;
      }
  }

  .page-config {
      position: relative;
  }

  .page-config-close {
      position: absolute;
      top: 5px;
      right: 5px;
      width: 24px;
      height: 24px;
      border: none;
      border-radius: 50%;
      color: rgb(255, 5, 5);
      font-size: 13px;
      font-weight: bold;
      line-height: 24px;
      text-align: center;
      cursor: pointer;
      z-index: 10;
      /* Ensure button is above other content */
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      transition: transform 0.2s ease, background 0.2s ease;
  }

  .page-config-close:hover {
      background: linear-gradient(135deg, #ff5a8c, #ff97b4);
      transform: scale(1.1);
  }

  .page-config-close:active {
      transform: scale(0.95);
  }



  .firework-container {
      position: fixed;
      top: 50%;
      left: 50%;
      width: 200px;
      height: 200px;
      pointer-events: none;
      opacity: 0;
      transform: translate(-50%, -50%);
      z-index: 200;
  }

  .firework {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 6px;
      height: 20px;
      background: radial-gradient(circle, #fff 0%, transparent 70%);
      border-radius: 50% 50% 0 0;
      transform-origin: bottom center;
      opacity: 0;
      animation: fireworkExplode 1s ease forwards;
  }

  @keyframes fireworkExplode {
      0% {
          opacity: 1;
          transform: translateY(0) scaleY(1);
      }

      100% {
          opacity: 0;
          transform: translateY(-100px) scaleY(3);
      }
  }

  .photo {
      position: fixed;
      width: 120px;
      height: 120px;
      border-radius: 20px;
      object-fit: cover;
      box-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
      opacity: 0;
      pointer-events: none;
      border: 5px solid white;
      background: white;
      z-index: 300;
      transition: transform 3s ease, opacity 3s ease;
      transform: translate(-50%, -50%);
  }

  @media screen and (max-height: 500px) and (orientation: landscape) {

      .book-container.show {
          display: block;
          opacity: 1;
          transform: scale(1) translateY(10px);
      }

      .content-display::after {
          top: 5px;
          right: 5px;
          font-size: 20px;
      }

      .book {
          width: 300px;
          height: 200px;
          transform: scale(0.7);
          margin-top: 0px;
      }

      .page {
          width: 150px;
          height: 200px;
      }

      .content-display {
          width: 45vw;
          min-height: 50px;
          max-height: 80px;
          padding: 5px 8px;
          top: 10px;
      }

      .content-display p {
          font-size: 13px !important;
      }

      .photo {
          width: 60px;
          height: 60px;
      }

      .firework-container {
          width: 100px;
          height: 100px;
      }
  }

  .music-control {
      position: fixed;
      top: 20px;
      right: 20px;
      width: 40px;
      height: 40px;
      background: none;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      z-index: 10001;
      box-shadow: 0 4px 15px rgba(250, 250, 250, 0.4);
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      color: rgb(205, 202, 202);
      outline: none;
  }

  .music-control:hover {
      transform: scale(1.1);
      box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
  }

  .music-control:active {
      transform: scale(0.95);
  }

  .music-control.playing {
      animation: musicPulse 1.5s infinite;
  }

  @keyframes musicPulse {

      0%,
      100% {
          transform: scale(1);
          box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
      }

      50% {
          transform: scale(1.05);
          box-shadow: 0 8px 25px rgba(255, 107, 157, 0.8);
      }
  }

  .settings-button {
      position: fixed;
      top: 20px;
      right: 90px;
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, #b20404, #2a1717);
      border: none;
      border-radius: 50%;
      cursor: pointer;
      z-index: 10001;
      box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      color: rgb(255, 255, 255);
      outline: none;
  }

  .settings-button:hover {
      transform: scale(1.1);
      box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
  }

  .settings-button:active {
      transform: scale(0.95);
  }

  /* Modal container */
  .modal {
      display: none;
      position: fixed;
      z-index: 10002;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      /* background-color: rgba(0, 0, 0, 0.5); */
      overflow: auto;
      animation: fadeIn 0.3s ease-in-out;
  }

  /* Modal animation */
  @keyframes fadeIn {
      from {
          opacity: 0;
      }

      to {
          opacity: 1;
      }
  }

  /* Modal content */
  .modal-content {
      background-color: #ffffff;
      margin: 3vh auto;
      padding: 0;
      border: none;
      width: 90%;
      max-width: 600px;
      height: 80vh;
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      display: flex;
      flex-direction: column;
      overflow: hidden;
  }

  /* Modal header */
  .modal-header {
      background: linear-gradient(135deg, #b69f08, #181818);
      padding: 15px 20px;
      border-radius: 12px 12px 0 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }

  .modal-header h2 {
      margin: 0;
      color: white;
      font-size: 24px;
      font-weight: 600;
  }

  .close {
      color: white;
      font-size: 28px;
      font-weight: bold;
      cursor: pointer;
      transition: color 0.2s ease;
  }

  .close:hover,
  .close:focus {
      color: #ffeb3b;
  }

  /* Modal body */
  .modal-body {
      flex: 1;
      padding: 20px;
      overflow-y: auto;
      background: #f9f9f9;
  }

  /* Settings section */
  .settings-section {
      margin-bottom: 20px;
      padding: 15px;
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .settings-section h3 {
      margin: 0 0 15px;
      font-size: 18px;
      color: #333;
      border-bottom: 2px solid #eee;
      padding-bottom: 8px;
  }

  /* Form group */
  .form-group {
      margin-bottom: 15px;
  }

  .form-group label {
      display: block;
      margin-bottom: 5px;
      font-weight: 600;
      color: #444;
      font-size: 14px;
  }
  .music-select-row {
      display: flex;
      gap: 10px;
      align-items: center;
  }

  .music-select-row select {
      flex: 1;
  }

  .music-preview-btn {
      flex-shrink: 0;
      min-width: 60px;
      padding: 6px 10px;
      font-size: 9px;
  }

  .music-preview-btn.playing {
      background: linear-gradient(135deg, #ff6b9d, #ff9270);
  }

  .music-preview-status {
      display: block;
      margin-top: 6px;
      font-size: 12px;
      color: #666;
  }

  .form-group input[type="color"] {
      width: 100%;
      height: 40px;
      padding: 0;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      background-color: transparent;
      box-shadow: inset 0 0 0 1px #ddd, inset 0 -1px 0 rgba(255, 255, 255, 0.5);
  }

  /* Form row for side-by-side inputs */
  .form-row {
      display: flex;
      gap: 15px;
  }

  .form-row .form-group {
      flex: 1;
  }

  /* Inputs and selects */
  .modal-content select,
  .modal-content input[type="text"],
  .modal-content input[type="file"],
  .modal-content input[type="color"],
  .modal-content textarea {
      width: 100%;
      padding: 10px;
      margin-bottom: 10px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-size: 14px;
      background: #fff;
      transition: border-color 0.2s ease;
      box-sizing: border-box;
      white-space: normal !important;
      /* Thêm dòng này */
      word-wrap: normal !important;
      /* Thêm dòng này */
  }

  .modal-content select:focus,
  .modal-content input[type="text"]:focus,
  .modal-content input[type="file"]:focus,
  .modal-content input[type="color"]:focus,
  .modal-content textarea:focus {
      border-color: #ff6b9d;
      outline: none;
  }

  .modal-content textarea {
      min-height: 80px;
      resize: vertical;
      font-family: inherit;
      line-height: 1.4;
      white-space: pre-wrap !important;
      /* Chỉ cho textarea */
  }

  /* Page config */
  .page-config {
      border: 1px solid #eee;
      padding: 15px;
      margin-bottom: 15px;
      border-radius: 8px;
      background: #fafafa;
  }

  .page-config h3 {
      margin: 0 0 10px;
      font-size: 16px;
      color: #333;
  }


  /* Buttons */
  .modal-content button {
      background: linear-gradient(135deg, #b69f08, #181818);
      color: white;
      padding: 12px 24px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-size: 16px;
      font-weight: 600;
      transition: background 0.2s ease, transform 0.2s ease;
  }

  .modal-content button:hover {
      background: linear-gradient(135deg, #181818, #b69f08);
      transform: translateY(-2px);
  }

  .modal-content button:active {
      transform: translateY(0);
  }

  .page-config {
      border: 1px solid #ddd;
      padding: 10px;
      margin-bottom: 10px;
      border-radius: 5px;
  }

  .page-config h3 {
      margin: 0 0 10px;
  }

  .stars-container {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 5;
      pointer-events: none;
      display: none;
  }

  .star {
      position: absolute;
      width: 2px;
      height: 2px;
      background: white;
      border-radius: 50%;
      animation: twinkle 2s infinite;
  }

  .star.large {
      width: 4px;
      height: 4px;
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  }

  .star.medium {
      width: 3px;
      height: 3px;
      box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  }

  .star.small {
      width: 2px;
      height: 2px;
      box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
  }

  @keyframes twinkle {

      0%,
      100% {
          opacity: 0.3;
          transform: scale(1);
      }

      50% {
          opacity: 1;
          transform: scale(1.2);
      }
  }

  .star:nth-child(2n) {
      animation-delay: 0.5s;
  }

  .star:nth-child(3n) {
      animation-delay: 1s;
  }

  .star:nth-child(4n) {
      animation-delay: 1.5s;
  }

  .star:nth-child(5n) {
      animation-delay: 0.8s;
  }

  .star:nth-child(6n) {
      animation-delay: 1.2s;
  }


  .copyright {
      position: fixed;
      bottom: 10px;
      right: 15px;
      font-size: 13px;
      color: rgba(255, 255, 255, 0.3);
      font-family: 'Arial', sans-serif;
      z-index: 5000;
      pointer-events: none;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
      user-select: none;
      transition: opacity 0.3s ease;
  }

  .copyright a {
      color: rgba(255, 255, 255, 0.4);
      font-weight: 600;
  }

  .copyright:hover {
      opacity: 0.8;
  }

  @media screen and (max-height: 500px) and (orientation: landscape) {
      .music-control {
          width: 35px;
          height: 35px;
          font-size: 18px;
          top: 10px;
          right: 10px;
      }

      .settings-button {
          width: 35px;
          height: 35px;
          font-size: 18px;
          top: 10px;
          right: 65px;
      }

      .modal-content {
          width: 89%;
          height: 88vh;
          padding-bottom: 0px;

      }

      #settingsModal .modal-header {
          position: static !important;
          /* Không sticky/fixed */
          background: none !important;
          /* Bỏ background */
          padding: 0px 8px !important;
          /* Giảm padding */
          min-height: 0 !important;
          height: auto !important;
          flex-direction: row !important;
          justify-content: flex-end !important;
          align-items: center !important;
          border-radius: 0 !important;
          box-shadow: none !important;
      }

      #settingsModal .modal-header h2 {
          display: none !important;
          /* Ẩn tiêu đề */
      }

      #settingsModal .close {
          font-size: 22px !important;
          color: #222 !important;
          margin: 0 !important;
          padding: 0 !important;
      }

      .modal-body {
          padding: 15px;
          overflow-y: auto;
          max-height: calc(90vh - 70px);
      }

      .settings-section {
          margin-bottom: 15px;
          padding: 10px;
      }

      .settings-section h3 {
          font-size: 16px;
          margin: 0 0 10px;
          padding-bottom: 5px;
      }

      .form-group {
          margin-bottom: 10px;
      }

      .form-group label {
          font-size: 13px;
          margin-bottom: 3px;
      }

      .form-group input[type="color"] {
          height: 30px;
      }

      .modal-content select,
      .modal-content input[type="text"],
      .modal-content input[type="file"],
      .modal-content input[type="color"],
      .modal-content textarea {
          padding: 6px;
          font-size: 13px;
          margin-bottom: 8px;
      }

      .modal-content textarea {
          min-height: 60px;
      }

      .page-config {
          display: flex !important;
          flex-direction: row !important;
          flex-wrap: wrap !important;
          align-items: flex-start !important;
          gap: 10px !important;
          padding: 6px !important;
          margin-bottom: 8px !important;
          background: #f9f9f9 !important;
          border-radius: 8px !important;
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
      }

      .page-config textarea {
          flex-basis: 100% !important;
          width: 100% !important;
          margin-left: 0 !important;
          margin-top: 8px !important;
          max-width: 100% !important;
          min-width: 100% !important;
          display: block !important;
      }

      .page-config h3 {
          font-size: 13px !important;
          margin: 0 0 4px 0 !important;
          min-width: 80px !important;
      }

      .page-config-close {
          font-size: 18px !important;
          width: 22px !important;
          height: 22px !important;
          line-height: 22px !important;
          margin-left: 4px !important;
          margin-right: 4px !important;
          cursor: pointer !important;
          align-self: flex-start !important;
      }

      .page-config label {
          font-size: 12px !important;
          margin-bottom: 2px !important;
          min-width: 70px !important;
      }

      .page-config input[type="file"] {
          font-size: 12px !important;
          padding: 2px !important;
          margin-bottom: 2px !important;
          width: 110px !important;
      }

      .page-config img {
          max-width: 70px !important;
          max-height: 70px !important;
          margin: 0 6px 0 0 !important;
          border-radius: 6px !important;
      }

      /* Nút thêm trang mới */
      #pageConfigs>button {
          font-size: 13px !important;
          padding: 7px 14px !important;
          margin-top: 8px !important;
          border-radius: 6px !important;
      }

      .settings-p {
          font-size: 12px;
      }

      /* Optimize form layout for landscape */
      .form-row {
          gap: 10px;
      }

      /* Ensure scrollable content */
      .modal-body {
          -webkit-overflow-scrolling: touch;
          scrollbar-width: thin;
      }

      /* Adjust page info section */
      .modal-body>div:first-child {
          padding: 8px;
          font-size: 12px;
      }

      /* Compact button styling */
      .apply-settings-btn {
          position: sticky;
          bottom: 0;
          background: linear-gradient(135deg, #b69f08, #181818) !important;
          border-radius: 20 !important;
          margin: 0 !important;
          padding: 7px !important;
          margin-bottom: 20px !important;
          width: 100% !important;
          position: static !important;

          box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
      }

      .copyright {
          bottom: 5px;
          right: 10px;
          font-size: 8px;
      }

      #pricingContainer {
          position: fixed !important;
          left: 0 !important;
          right: 0 !important;
          bottom: 0 !important;
          border-radius: 15px 15px 0 0 !important;
          height: 70vh !important;
          overflow-y: auto !important;
          padding-bottom: 0px !important;
          /* Để không che nút */
          z-index: 10000 !important;
      }

      .pricing-header span,
      strong {
          font-size: 12px !important;
      }

      #pricingDetails {
          font-size: 8px !important;
      }

      .pricing-tip label {
          font-size: 10px !important;
      }


      #voucherList {
          max-height: 60px !important;
          font-size: 10px !important;
          margin-bottom: 4px !important;
      }

      #voucherSection {
          padding-top: 4px !important;
          margin-top: 4px !important;
          font-size: 9px !important;
      }

      #voucherSection .voucher-item label {
          font-size: 10px !important;
      }

      #tipAmount {
          width: 55px !important;
          font-size: 11px !important;
          padding: 2px 4px !important;
          margin-left: 4px !important;
      }

      #totalPrice {
          font-size: 14px !important;
      }

      #actionButton {
          position: sticky;
          bottom: 0;
          left: 0;
          right: 0;
          width: 100%;
          padding: 5px !important;
          z-index: 10001;
          border-radius: 0 0 8px 8px;
          box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
          margin: 0;
      }

      #togglePricing {
          font-size: 14px !important;
          top: 2px !important;
          right: 2px !important;
          padding: 2px !important;
          border-radius: 2px !important;
      }

      #googleLoginBtn {
          font-size: 12px !important;
          padding: 6px 10px !important;
          min-width: 90px !important;
          height: 32px !important;
          border-radius: 6px !important;
          margin-bottom: 6px !important;
      }

      #logoutBtn {
          font-size: 12px !important;
          padding: 2px 5px !important;
          min-width: 90px !important;
          height: 32px !important;
          border-radius: 6px !important;
          margin-bottom: 6px !important;
      }

      #userInfo {
          font-size: 11px !important;
          gap: 4px !important;
      }

      #paymentModal>div {
          width: 50vw !important;
          padding: 8px !important;
          border-radius: 8px !important;
          margin: 2vw auto !important;
      }

      #paymentModal iframe {
          height: 36vw !important;
          min-height: 36vw !important;
          max-height: 36vh !important;
      }

      #paymentModal button {
          top: 6px !important;
          right: 6px !important;
          font-size: 18px !important;
      }

      .success-notification-popup {
          max-width: 90vw !important;
          width: 90vw !important;
          padding: 10px !important;
          font-size: 13px !important;
          top: 50% !important;
          left: 50% !important;
          transform: translate(-50%, -50%) !important;
      }

      .success-notification-popup h3 {
          font-size: 14px !important;
          margin-bottom: 5px !important;
      }

      .success-notification-popup button {
          padding: 2px 5px !important;
          font-size: 13px !important;
      }

      /* Payment Method Section Responsive for Landscape Mobile */
      #paymentMethodSection {
          margin-top: 4px !important;
          padding-top: 4px !important;
      }

      #paymentMethodSection > div:first-child {
          margin-bottom: 4px !important;
      }

      #paymentMethodSection > div:first-child span {
          font-size: 10px !important;
      }

      #paymentMethodSection > div:first-child strong {
          font-size: 10px !important;
      }

      #paymentMethodSection > div:last-child {
          gap: 4px !important;
      }

      .payment-method-container {
          padding: 4px !important;
          border-radius: 4px !important;
      }

      .payment-method-container label {
          font-size: 9px !important;
      }

      .payment-method-container input[type="radio"] {
          transform: scale(1.0) !important;
          margin-right: 6px !important;
      }

      .payment-method-container strong {
          font-size: 9px !important;
      }

      .payment-method-container div[style*="font-size: 11px"] {
          font-size: 7px !important;
      }

      .payment-method-container img {
          width: 12px !important;
          height: 12px !important;
          margin-right: 4px !important;
      }

      .payment-method-container span[style*="font-size: 16px"] {
          font-size: 12px !important;
          margin-right: 4px !important;
      }

  }

  /* Settings hint styling */
  .settings-hint {
      position: fixed;
      top: 70px;
      right: 90px;
      z-index: 10002;
      display: flex;
      align-items: center;
      gap: 8px;
      opacity: 0;
      animation: showHint 3s ease-in-out forwards;
      pointer-events: none;
  }

  .hint-text {
      background: rgba(0, 0, 0, 0.8);
      color: white;
      padding: 8px 12px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
      white-space: nowrap;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  @keyframes showHint {
      0% {
          opacity: 0;
          transform: translateY(-10px);
      }
      20% {
          opacity: 1;
          transform: translateY(0);
      }
      80% {
          opacity: 1;
          transform: translateY(0);
      }
      100% {
          opacity: 0;
          transform: translateY(-10px);
      }
  }

  /* Color theme buttons styling */
  .color-theme-buttons {
      display: flex;
      gap: 8px;
      margin-top: 10px;
      flex-wrap: nowrap;
      justify-content: space-between;
  }

  .color-theme-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 10px 8px;
      border: 2px solid #e0e0e0;
      border-radius: 8px;
      background: white;
      cursor: pointer;
      transition: all 0.3s ease;
      flex: 1;
      min-width: 0;
      text-align: center;
  }

  .color-theme-btn:hover {
      border-color: #ff6b6b;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
  }

  .color-theme-btn.active {
      border-color: #ff6b6b;
      background: #fff5f5;
      box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  }

  .color-preview {
      width: 25px;
      height: 25px;
      border-radius: 50%;
      margin-bottom: 8px;
      border: 2px solid #fff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .pink-preview {
      background: linear-gradient(135deg, #ff69b4, #ff1493);
  }

  .blue-preview {
      background: linear-gradient(135deg, #87ceeb, #4169e1);
  }

  .purple-preview {
      background: linear-gradient(135deg, #dda0dd, #9370db);
  }

  .custom-preview {
      background: linear-gradient(135deg, #ffb6c1, #ffc0cb, #d39b9b);
  }

  .color-theme-btn span {
      font-size: 12px;
      font-weight: 500;
      color: #fdfdfd;
  }

  .color-theme-btn.active span {
      color: #ff6b6b;
      font-weight: 600;
  }

  /* ============================================================
     Animated CSS Birthday Cake (ported from Birthday-master)
     Self-contained decorative element, fixed bottom-left.
     ============================================================ */
  .bday-cake-wrap {
      position: fixed;
      left: 22px;
      bottom: 18px;
      width: 140px;
      height: 165px;
      z-index: 5000;
      pointer-events: none;
      transform-origin: bottom left;
      opacity: 0;
      animation: cakeRise 1.2s ease forwards;
      animation-delay: 1.5s;
  }

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

  .bday-cake-caption {
      position: absolute;
      top: -22px;
      left: 50%;
      transform: translateX(-50%);
      white-space: nowrap;
      font-family: 'Dancing Script', cursive;
      font-size: 18px;
      color: rgba(255, 255, 255, 0.85);
      text-shadow: 0 1px 6px rgba(255, 105, 180, 0.6);
      user-select: none;
  }

  .cake {
      position: absolute;
      bottom: 0;
      left: 50%;
      margin-left: -70px;
      width: 140px;
      height: 140px;
  }

  .cake:after {
      background: rgba(255, 255, 255, 1);
      border-radius: 140px;
      content: "";
      position: absolute;
      bottom: 0; left: 0;
      width: 140px; height: 3px;
  }

  .velas {
      background: rgba(255, 255, 255, 1);
      border-radius: 100%;
      position: absolute;
      top: 50%; left: 50%;
      margin-left: -3.5px;
      margin-top: -11.7px;
      width: 7px; height: 23.3px;
  }

  .velas:after,
  .velas:before {
      background: rgba(255, 0, 0, 0.4);
      content: "";
      position: absolute;
      width: 100%; height: 3.1px;
  }

  .velas:after { top: 25%; left: 0; }
  .velas:before { top: 45%; left: 0; }

  .fuego {
      border-radius: 100%;
      box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
      position: absolute;
      top: -12px; left: 50%;
      margin-left: -4.7px;
      width: 9.3px; height: 17.5px;
  }

  .fuego:nth-child(1) { animation: fuego 2s infinite; }
  .fuego:nth-child(2) { animation: fuego 1.5s infinite; }
  .fuego:nth-child(3) { animation: fuego 1s infinite; }
  .fuego:nth-child(4) { animation: fuego 0.5s infinite; }
  .fuego:nth-child(5) { animation: fuego 0.2s infinite; }

  @keyframes fuego {
      0%   { background: rgba(254, 248, 97, 0.5); transform: translateY(0) scale(1); }
      50%  { background: rgba(255, 50, 0, 0.1);   transform: translateY(-28px) scale(0); }
      100% { background: rgba(254, 248, 97, 0.5); transform: translateY(0) scale(1); }
  }

  .cobertura {
      background: rgba(236, 231, 227, 1);
      border-radius: 70px;
      position: absolute;
      top: 60%; left: 50%;
      margin-left: -38.9px;
      margin-top: -7px;
      width: 77.8px; height: 17.5px;
      z-index: 10;
  }

  .cobertura:after,
  .cobertura:before {
      background: rgba(236, 231, 227, 1);
      border-radius: 140px;
      content: "";
      position: absolute;
      width: 7px; height: 14px;
  }

  .cobertura:after { top: 9.3px; right: 20px; }
  .cobertura:before { top: 14px; right: 12.7px; }

  .bizcocho {
      background: rgba(109, 56, 38, 1);
      position: absolute;
      bottom: 0; left: 50%;
      margin-left: -35px;
      width: 70px; height: 46.7px;
  }

  .bizcocho:after,
  .bizcocho:before {
      background: rgba(236, 231, 227, 0.6);
      content: "";
      position: absolute;
      width: 100%; height: 7px;
  }

  .bizcocho:after { top: 30%; left: 0; }
  .bizcocho:before { top: 60%; left: 0; }

  @media screen and (max-width: 600px) {
      .bday-cake-wrap {
          transform: scale(0.7);
          left: 6px;
          bottom: 6px;
      }
      .bday-cake-caption { font-size: 20px; }
  }

  /* ============================================================
     Festive string lights across the top (inspired by Birthday-master)
     ============================================================ */
  .string-lights {
      position: fixed;
      top: 0; left: 0;
      width: 100%;
      height: 56px;
      display: flex;
      justify-content: space-around;
      align-items: flex-start;
      z-index: 4000;
      pointer-events: none;
      border-top: 2px solid rgba(255, 255, 255, 0.15);
  }

  .string-lights .bulb {
      position: relative;
      width: 22px;
      height: 22px;
      margin-top: 9px;
      border-radius: 50%;
      animation: bulbGlow 1.6s infinite ease-in-out;
  }

  .string-lights .bulb::before {
      content: "";
      position: absolute;
      top: -9px; left: 50%;
      transform: translateX(-50%);
      width: 4px; height: 9px;
      background: rgba(255, 255, 255, 0.3);
  }

  .string-lights .bulb:nth-child(6n+1) { background: #ff4d6d; box-shadow: 0 0 20px 5px #ff4d6d; animation-delay: 0s; }
  .string-lights .bulb:nth-child(6n+2) { background: #ffd23f; box-shadow: 0 0 20px 5px #ffd23f; animation-delay: 0.2s; }
  .string-lights .bulb:nth-child(6n+3) { background: #4cc9f0; box-shadow: 0 0 20px 5px #4cc9f0; animation-delay: 0.4s; }
  .string-lights .bulb:nth-child(6n+4) { background: #80ed99; box-shadow: 0 0 20px 5px #80ed99; animation-delay: 0.6s; }
  .string-lights .bulb:nth-child(6n+5) { background: #c77dff; box-shadow: 0 0 20px 5px #c77dff; animation-delay: 0.8s; }
  .string-lights .bulb:nth-child(6n+6) { background: #ff8fab; box-shadow: 0 0 20px 5px #ff8fab; animation-delay: 1.0s; }

  @keyframes bulbGlow {
      0%, 100% { opacity: 1; filter: brightness(1.3); }
      50%      { opacity: 0.4; filter: brightness(0.6); }
  }

  /* ============================================================
     Festive finale message (replaces romantic heart montage)
     ============================================================ */
  .finale-message {
      position: fixed;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%) scale(0.7);
      text-align: center;
      z-index: 9000;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28);
      width: 90%;
      max-width: 700px;
  }

  .finale-message.show {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
  }

  /* Re-enable clicks on the finale buttons (parent is pointer-events:none) */
  .finale-message .cake-ceremony-btn,
  .finale-message .love-letter-btn,
  .finale-message .surprise-video-btn,
  .finale-message .cinematic-end-btn {
      pointer-events: auto;
  }

  .finale-message .finale-emoji {
      font-size: 64px;
      animation: finaleBounce 1.4s infinite ease-in-out;
  }

  .finale-message .finale-title {
      font-family: 'Pacifico', 'Dancing Script', cursive;
      font-size: 52px;
      color: #fff;
      margin: 10px 0;
      text-shadow: 0 0 18px rgba(255, 105, 180, 0.9), 0 2px 6px rgba(0, 0, 0, 0.6);
  }

  .finale-message .finale-sub {
      font-family: 'Dancing Script', cursive;
      font-size: 26px;
      color: rgba(255, 255, 255, 0.92);
      text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  }

  @keyframes finaleBounce {
      0%, 100% { transform: translateY(0); }
      50%      { transform: translateY(-14px); }
  }

  @media screen and (max-width: 600px) {
      .finale-message .finale-emoji { font-size: 44px; }
      .finale-message .finale-title { font-size: 34px; }
      .finale-message .finale-sub { font-size: 19px; }
      .string-lights .bulb { width: 16px; height: 16px; }
  }

 
/* ===== Surprise video reveal (birthday-of drop-in) ===== */
.surprise-video-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 22px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 20, 147, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: surprisePulse 1.8s ease-in-out infinite;
}
.surprise-video-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(255, 20, 147, 0.6);
}
@keyframes surprisePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.surprise-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.surprise-video-overlay.show {
    display: flex;
    opacity: 1;
}
.surprise-video-inner {
    position: relative;
    max-width: 900px;
    width: 100%;
    text-align: center;
}
.surprise-video-caption {
    color: #ffd6ec;
    font-size: 20px;
    margin-bottom: 14px;
    font-family: 'Dancing Script', cursive;
    font-weight: 600;
}
.surprise-video-el {
    width: 100%;
    max-height: 78vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(255, 20, 147, 0.4);
    background: #000;
}
.surprise-video-close {
    position: absolute;
    top: -42px;
    right: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* ===== Countdown gate (pre-birthday lock screen) ===== */
#birthday-gate {
    position: fixed;
    inset: 0;
    z-index: 2000000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 24px;
    color: #fff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: radial-gradient(circle at 30% 15%, #4a123c, #1a0620 70%);
}
#birthday-gate .gate-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}
.gate-gift {
    font-size: 72px;
    animation: gateBob 2.4s ease-in-out infinite;
}
@keyframes gateBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.gate-title {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    font-size: clamp(30px, 6vw, 54px);
    margin: 10px 0 8px;
    background: linear-gradient(90deg, #ff9ecf, #ffe0f0, #ff6fb5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gate-sub {
    font-size: clamp(15px, 3vw, 20px);
    color: #ffd6ec;
    margin: 0 0 28px;
}
.gate-timer {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.gate-unit {
    min-width: 84px;
    padding: 16px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 158, 207, 0.35);
    box-shadow: 0 8px 30px rgba(255, 20, 147, 0.25);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.gate-num {
    display: block;
    font-size: clamp(30px, 7vw, 48px);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.gate-label {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffb3da;
}
.gate-foot {
    margin-top: 30px;
    font-size: 16px;
    color: #ffc9e6;
}
.gate-hearts {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
.gate-heart {
    position: absolute;
    bottom: -48px;
    opacity: 0;
    animation: gateFloat linear infinite;
}
@keyframes gateFloat {
    0% { transform: translateY(0) rotate(0); opacity: 0; }
    12% { opacity: 0.9; }
    100% { transform: translateY(-112vh) rotate(240deg); opacity: 0; }
}
#birthday-gate.gate-opening {
    animation: gateFadeOut 1s ease forwards;
}
@keyframes gateFadeOut {
    to { opacity: 0; transform: scale(1.05); }
}
@media (max-width: 430px) {
    .gate-unit { min-width: 66px; padding: 12px 8px; }
    .gate-timer { gap: 10px; }
}

/* ===== "Tap the book" hint ===== */
.book-tap-hint {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 999999;
    padding: 12px 22px;
    border-radius: 30px;
    background: rgba(255, 105, 180, 0.92);
    color: #fff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    max-width: 90vw;
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.45);
    animation: tapHintPulse 1.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes tapHintPulse {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.95; }
    50% { transform: translateX(-50%) translateY(-6px); opacity: 1; }
}

/* ===== Love letter reveal ===== */
.love-letter-btn {
    display: inline-block;
    margin: 18px 8px 0;
    padding: 12px 22px;
    font-size: 17px;
    font-weight: 600;
    color: #b0125b;
    background: #fff0f7;
    border: 1.5px solid #ff9ecf;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 20, 147, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: surprisePulse 1.8s ease-in-out infinite;
}
.love-letter-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(255, 20, 147, 0.4);
}
.love-letter-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 20%, #4a123c, #150318 75%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.love-letter-overlay.show {
    display: flex;
    opacity: 1;
}
.love-letter-paper {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: 82vh;
    overflow: hidden;
    padding: 40px 34px;
    border-radius: 16px;
    background: linear-gradient(#fffdf8, #fff6ef);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.love-letter-lines {
    max-height: 62vh;
    overflow-y: auto;
    text-align: center;
}
.love-letter-line {
    margin: 0 0 14px;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(20px, 4.5vw, 28px);
    line-height: 1.35;
    color: #5a2a4a;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}
.love-letter-line.show {
    opacity: 1;
    transform: translateY(0);
}
.love-letter-line:first-child {
    font-size: clamp(24px, 5.5vw, 34px);
    color: #b0125b;
    font-weight: 700;
}
.love-letter-sign {
    margin-top: 18px;
    text-align: right;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(20px, 4vw, 26px);
    color: #b0125b;
    opacity: 0;
}
.love-letter-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

/* ===== Book front-cover overlay ("tap to open") ===== */
.book-cover-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    padding: 0 12px 26px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 40%, rgba(180,18,91,0.55) 100%);
    border-radius: inherit;
    pointer-events: none;
}
.cover-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(20px, 6vw, 30px);
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1;
}
.cover-name {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    font-size: clamp(34px, 11vw, 54px);
    color: #fff;
    text-shadow: 0 2px 14px rgba(255,20,147,0.8);
    margin-top: 2px;
}
.cover-open-hint {
    margin-top: 12px;
    padding: 7px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.95);
    color: #b0125b;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(255,20,147,0.4);
    animation: coverHintPulse 1.5s ease-in-out infinite;
}
@keyframes coverHintPulse {
    0%, 100% { transform: translateY(0); opacity: 0.95; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* ===== Beautified cake (bigger, glow, plate, sparkles) ===== */
.bday-cake-wrap { width: 180px !important; height: 210px !important; }
.bday-cake-wrap .cake {
    filter: drop-shadow(0 8px 22px rgba(255, 105, 180, 0.55));
}
.bday-cake-caption {
    font-size: 22px !important;
    color: #fff !important;
    font-weight: 600;
}
/* glowing plate under the cake */
.bday-cake-wrap::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 168px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255,182,224,0.55), rgba(255,182,224,0) 70%);
    z-index: 0;
}
/* twinkling sparkle beside the cake (uses the wrapper's free ::before, not the cake's pseudos) */
.bday-cake-wrap::before {
    content: "✨";
    position: absolute;
    top: 8px; right: 4px;
    font-size: 20px;
    z-index: 3;
    animation: cakeSparkle 1.8s ease-in-out infinite;
}
@keyframes cakeSparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===== Interactive cake ceremony ===== */
.cake-ceremony-btn {
    display: inline-block;
    margin: 18px 8px 0;
    padding: 12px 22px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ffb347, #ff7eb3);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 126, 179, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: surprisePulse 1.8s ease-in-out infinite;
}
.cake-ceremony-btn:hover { transform: translateY(-2px) scale(1.04); }

.cake-ceremony-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 25%, #3a1030, #150318 75%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.cake-ceremony-overlay.show { display: flex; opacity: 1; }
.cake-ceremony-caption {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(24px, 6vw, 38px);
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 2px 12px rgba(255, 105, 180, 0.6);
}
.cake-ceremony-hint {
    display: block;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #ffc9e6;
    margin-top: 6px;
    font-weight: 400;
}
.cake-stage {
    position: relative;
    width: 340px;
    max-width: 90vw;
    height: 360px;
}
.ceremony-cake {
    bottom: 40px !important;
    transform: scale(2.3);
    transform-origin: bottom center;
    cursor: pointer;
}
.ceremony-cake.blown .fuego {
    opacity: 0 !important;
    animation: none !important;
    transition: opacity 0.5s ease;
}
.ceremony-cake.cut { animation: cakeShake 0.45s ease; }
@keyframes cakeShake {
    0%, 100% { transform: scale(2.3) rotate(0); }
    25% { transform: scale(2.3) rotate(-2.5deg); }
    75% { transform: scale(2.3) rotate(2.5deg); }
}
.cake-smoke {
    position: absolute;
    bottom: 56%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgba(220, 220, 220, 0.75);
    filter: blur(2px);
    pointer-events: none;
    animation: cakeSmoke 1.6s ease-out forwards;
}
@keyframes cakeSmoke {
    0% { opacity: 0.8; transform: translateY(0) scale(0.6); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.7); }
}
.cake-knife {
    position: absolute;
    top: 26%;
    left: 50%;
    font-size: 46px;
    pointer-events: none;
    transform: translateX(-150px) rotate(-18deg);
    animation: cakeKnife 0.65s ease forwards;
}
@keyframes cakeKnife {
    to { transform: translateX(70px) rotate(18deg); }
}
.cake-slice {
    position: absolute;
    bottom: 34%;
    left: 56%;
    font-size: 42px;
    opacity: 0;
    pointer-events: none;
    animation: cakeSlice 0.7s ease forwards;
}
@keyframes cakeSlice {
    0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
    100% { opacity: 1; transform: translate(46px, -12px) scale(1); }
}
.cake-cut-btn {
    margin-top: 26px;
    padding: 12px 26px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ff1493);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 20, 147, 0.5);
    animation: surprisePulse 1.6s ease-in-out infinite;
}
.cake-ceremony-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

/* ===== Cake ceremony decorations: string balloons, photo, floating balloons ===== */
/* String of balloons on a rope (rassi) across the top */
.ceremony-string {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding-top: 14px;
    border-top: 3px solid rgba(255, 255, 255, 0.25);
    z-index: 1;
    pointer-events: none;
}
.ceremony-string .cb {
    position: relative;
    width: 34px;
    height: 44px;
    border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
    box-shadow: inset -4px -6px 8px rgba(0, 0, 0, 0.15);
    transform-origin: top center;
    animation: cbSway 3s ease-in-out infinite;
}
.ceremony-string .cb::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 1px;
    height: 34px;
    background: rgba(255, 255, 255, 0.4);
}
.ceremony-string .cb:nth-child(even) { margin-top: 20px; animation-duration: 3.6s; }
.cb-red { background: #ff6b6b; } .cb-yellow { background: #ffd93d; }
.cb-blue { background: #4d96ff; } .cb-pink { background: #ff6bff; }
.cb-green { background: #6bcb77; } .cb-purple { background: #b47bff; }
.cb-orange { background: #ffa94d; }
@keyframes cbSway {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
}

/* Framed photo above the cake */
.ceremony-photo {
    position: relative;
    z-index: 2;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.55);
    margin-bottom: 10px;
    margin-top: 20px;
}

/* Floating balloons rising in the background */
.ceremony-balloons-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.ceremony-float-balloon {
    position: absolute;
    bottom: -70px;
    width: 30px;
    height: 40px;
    border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
    opacity: 0.55;
    box-shadow: inset -3px -5px 6px rgba(0, 0, 0, 0.15);
    animation: floatBalloonUp linear infinite;
}
.ceremony-float-balloon::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 1px;
    height: 26px;
    background: rgba(255, 255, 255, 0.4);
}
@keyframes floatBalloonUp {
    0% { transform: translateY(0) rotate(0); opacity: 0; }
    12% { opacity: 0.55; }
    100% { transform: translateY(-115vh) rotate(12deg); opacity: 0; }
}
/* keep the caption/cake above the decorations */
.cake-ceremony-caption, .cake-stage, .cake-cut-btn { position: relative; z-index: 2; }

/* ===== Letter balloons (override sizing to fit letters) ===== */
.ceremony-string .cb {
    width: 44px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.ceremony-string .cb-heart {
    font-weight: 400;
    font-size: 20px;
    background: #ff8fbf;
}

/* ===== Party poppers on cake cut ===== */
.cake-popper {
    position: absolute;
    left: 50%;
    top: 46%;
    font-size: 26px;
    pointer-events: none;
    z-index: 5;
    animation: cakePopper 1.05s ease-out forwards;
}
@keyframes cakePopper {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); opacity: 0; }
}

/* ===== Letter floating hearts + P.S. ===== */
.letter-float-heart {
    position: absolute;
    bottom: -30px;
    z-index: 1;
    pointer-events: none;
    animation: floatBalloonUp linear forwards;
}
.love-letter-ps {
    display: block;
    margin-top: 8px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-style: italic;
    color: #c76ba0;
    text-align: right;
}

/* ===== Premium ambient layer ===== */
#ambient-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.amb-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    will-change: transform;
}
.amb-orb-1 { width: 340px; height: 340px; background: #ff4d6d; top: -60px; left: -40px; }
.amb-orb-2 { width: 300px; height: 300px; background: #b47bff; bottom: -60px; right: -40px; }
.amb-orb-3 { width: 260px; height: 260px; background: #4d96ff; top: 40%; left: 58%; opacity: 0.22; animation: ambDrift 22s ease-in-out infinite; }
@keyframes ambDrift {
    0%, 100% { translate: 0 0; }
    50% { translate: -30px 30px; }
}
.amb-cursor-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    margin-left: -300px;
    margin-top: -300px;
    background: radial-gradient(circle, rgba(255,150,200,0.15), rgba(255,150,200,0) 60%);
    will-change: transform;
}
.amb-sparkle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    animation: ambSparkle 0.9s ease-out forwards;
}
@keyframes ambSparkle {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(0.2); opacity: 0; }
}

/* ===== Typewriter caret for the love letter ===== */
.love-letter-line.typing::after {
    content: '|';
    margin-left: 1px;
    color: #b0125b;
    animation: caretBlink 0.8s steps(1) infinite;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ===== Cinematic ending ===== */
.cinematic-end-btn {
    display: inline-block;
    margin: 18px 8px 0;
    padding: 12px 24px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #b47bff, #ff4d6d);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(180, 123, 255, 0.5);
    animation: surprisePulse 1.8s ease-in-out infinite;
}
.cinematic-end-btn:hover { transform: translateY(-2px) scale(1.04); }

.cinematic-end-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000003;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 30%, #2a0e3a, #0d0416 78%);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.cinematic-end-overlay.show { display: flex; opacity: 1; }
.end-inner { text-align: center; max-width: 760px; }
.end-polaroids {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
}
.end-polaroid {
    background: #fff;
    padding: 8px 8px 0;
    border-radius: 3px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    transform: rotate(var(--r)) translateY(20px);
    opacity: 0;
    animation: polaroidIn 0.7s ease forwards;
    margin: 4px;
}
.end-polaroid-img {
    width: 116px;
    height: 116px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}
.end-polaroid-cap {
    font-family: 'Dancing Script', cursive;
    font-size: 18px;
    color: #333;
    padding: 4px 0 8px;
}
@keyframes polaroidIn {
    to { opacity: 1; transform: rotate(var(--r)) translateY(0); }
}
.end-title {
    font-family: 'Pacifico', 'Dancing Script', cursive;
    font-size: clamp(26px, 6vw, 46px);
    color: #fff;
    margin: 6px 0 8px;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
}
.end-sub {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(17px, 3.5vw, 24px);
    color: #ffd6ec;
    margin: 0 0 22px;
}
.end-cta {
    padding: 11px 26px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ff1493);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 20, 147, 0.5);
}
.cinematic-end-close {
    position: absolute;
    top: 18px; right: 18px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
@media (max-width: 500px) {
    .end-polaroid-img { width: 88px; height: 88px; }
}

/* ===== Finale button stack (so ALL buttons always show) ===== */
.finale-message { max-height: 92vh; overflow-y: auto; }
.finale-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    pointer-events: auto;
}
.finale-actions .fin-btn {
    width: min(340px, 86vw);
    margin: 0 !important;
    text-align: center;
}

/* ===== Richer cake ceremony: banner, confetti rain, sprinkles ===== */
.ceremony-banner {
    position: relative;
    z-index: 2;
    font-family: 'Pacifico', 'Dancing Script', cursive;
    font-size: clamp(22px, 5vw, 34px);
    color: #fff;
    text-shadow: 0 0 18px rgba(255, 105, 180, 0.9);
    margin: 92px 0 4px;
    text-align: center;
}
.cake-confetti {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
    animation: cakeConfettiFall linear forwards;
}
@keyframes cakeConfettiFall {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(105vh) rotate(540deg); opacity: 0.9; }
}
/* sprinkles / cherries on the frosting */
.ceremony-cake .cobertura::after { content: none; }
.cake-sprinkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 12;
}

/* ===== Surprise: charity party reveal ===== */
.surprise-video-inner {
    max-height: 92vh;
    overflow-y: auto;
    padding: 10px 6px;
    -webkit-overflow-scrolling: touch;
}
.surprise-title {
    font-family: 'Pacifico', 'Dancing Script', cursive;
    font-size: clamp(24px, 6vw, 40px);
    color: #fff;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.7);
    margin-bottom: 10px;
}
.surprise-note {
    max-width: 620px;
    margin: 0 auto 18px;
    text-align: center;
    color: #ffe3f1;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-size: clamp(15px, 2.6vw, 18px);
    line-height: 1.65;
}
.surprise-note b { color: #fff; }
.surprise-yt-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}
.surprise-yt {
    width: min(340px, 82vw);
    height: min(600px, 66vh);
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    background: #000;
    box-shadow: 0 12px 40px rgba(255, 20, 147, 0.4);
}
.surprise-gallery-title {
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(20px, 4vw, 28px);
    color: #ffd6ec;
    margin-bottom: 14px;
}
.surprise-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-width: 760px;
    margin: 0 auto 8px;
    padding: 0 6px;
}
.party-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    background: #2a0e2a;
}
.party-photo:hover { transform: scale(1.06); }
@media (max-width: 500px) {
    .surprise-gallery { grid-template-columns: repeat(3, 1fr); gap: 7px; }
}

/* ===== Hide the ugly scrollbars on overlay/finale scroll containers ===== */
.finale-message,
.surprise-video-inner,
.love-letter-lines,
.love-letter-paper {
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* old Edge/IE */
}
.finale-message::-webkit-scrollbar,
.surprise-video-inner::-webkit-scrollbar,
.love-letter-lines::-webkit-scrollbar,
.love-letter-paper::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;              /* Chrome/Safari */
}

/* ===== Surprise: group hero photos (the whole party) ===== */
.surprise-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 820px;
    margin: 0 auto 20px;
}
.group-photo {
    width: min(240px, 44vw);
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 14px;
    border: 3px solid #fff;
    box-shadow: 0 10px 30px rgba(255, 20, 147, 0.35);
    transition: transform 0.3s ease;
    background: #2a0e2a;
}
.group-photo:hover { transform: scale(1.04); }
@media (max-width: 560px) {
    .group-photo { width: 46vw; }
}

/* ===== Always-reachable close buttons for surprise + letter ===== */
.surprise-video-close,
.love-letter-close {
    position: fixed !important;
    top: 14px !important;
    right: 14px !important;
    left: auto !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #222 !important;
    font-size: 26px !important;
    line-height: 46px !important;
    text-align: center !important;
    cursor: pointer !important;
    z-index: 1000020 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    padding: 0 !important;
}
