
    :root {
      --sg-accent-rgb: 255, 107, 107;
      --sg-soft-rgb: 254, 168, 168;
      --sg-btn-rgb: 220, 38, 38;
      --sg-btn-hover-rgb: 239, 68, 68;
    }
    html, body {
      margin: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
    }
    canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
    #matrixCanvas {
      z-index: 0;
    }
    #shapeCanvas {
      z-index: 2;
    }
    #imageCanvas {
      z-index: 3;
      pointer-events: none;
    }

    /* --- Rotate overlay for portrait mobile --- */
    #rotateOverlay {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: 9999;
      background: rgba(0, 0, 0, 0.95);
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 24px;
    }
    #rotateOverlay .rotate-icon {
      width: 80px;
      height: 80px;
      animation: rotatePhone 2s ease-in-out infinite;
    }
    #rotateOverlay .rotate-text {
      color: #ffffff;
      font-family: 'Segoe UI', Arial, sans-serif;
      font-size: 18px;
      text-align: center;
      padding: 0 30px;
      line-height: 1.6;
    }
    @keyframes rotatePhone {
      0%, 100% { transform: rotate(0deg); }
      50% { transform: rotate(90deg); }
    }

    @media screen and (orientation: portrait) and (max-width: 900px) {
      #rotateOverlay {
        display: flex !important;
      }
    }
    @media screen and (orientation: landscape) {
      #rotateOverlay {
        display: none !important;
      }
    }

    /* --- Music Toggle --- */
    #musicToggle {
      position: fixed;
      top: 18px;
      right: 18px;
      width: 58px;
      height: 58px;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: transparent;
      cursor: pointer;
      z-index: 999;
      -webkit-tap-highlight-color: transparent;
      transition: transform 0.3s ease;
    }
    #musicToggle:hover { transform: scale(1.08); }
    #musicToggle:active { transform: scale(0.94); }
    #musicToggle .sg-cd {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      pointer-events: none;
      background:
        radial-gradient(circle at 50% 50%, #0b0b0f 0 9%, rgba(255,255,255,0.85) 9% 11%, rgba(var(--sg-accent-rgb), 1) 11% 30%, transparent 30%),
        repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 0 1px, transparent 1px 3px),
        conic-gradient(from 0deg, #1a1a22, #3a3a48 12%, rgba(var(--sg-soft-rgb), 0.9) 18%, #2a2a34 26%, #15151c 45%, #3a3a48 62%, rgba(var(--sg-soft-rgb), 0.9) 68%, #22222c 76%, #1a1a22);
      box-shadow: 0 0 0 2px rgba(var(--sg-btn-rgb), 0.7), 0 4px 14px rgba(0,0,0,0.5), 0 0 18px rgba(var(--sg-btn-rgb), 0.35);
      animation: sg-cd-spin 3.2s linear infinite;
      animation-play-state: paused;
      filter: saturate(0.6) brightness(0.8);
      transition: filter 0.4s ease, box-shadow 0.4s ease;
    }
    #musicToggle .sg-cd::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%;
      background: linear-gradient(135deg, rgba(255,255,255,0.28) 0%, transparent 38%, transparent 62%, rgba(255,255,255,0.12) 100%);
    }
    #musicToggle .sg-cd-mute {
      position: absolute;
      right: -2px;
      bottom: -2px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: rgba(var(--sg-btn-rgb), 0.95);
      box-shadow: 0 0 0 2px #000;
      pointer-events: none;
      transition: opacity 0.3s ease, transform 0.3s ease;
    }
    #musicToggle .sg-cd-mute::before {
      content: '';
      position: absolute;
      left: 4px;
      right: 4px;
      top: 50%;
      height: 2px;
      margin-top: -1px;
      border-radius: 2px;
      background: #fff;
      transform: rotate(-45deg);
    }
    #musicToggle.playing .sg-cd {
      animation-play-state: running;
      filter: none;
      box-shadow: 0 0 0 2px rgba(var(--sg-btn-hover-rgb), 0.9), 0 4px 14px rgba(0,0,0,0.5), 0 0 26px rgba(var(--sg-btn-hover-rgb), 0.6);
    }
    #musicToggle.playing .sg-cd-mute {
      opacity: 0;
      transform: scale(0.4);
    }
    @keyframes sg-cd-spin {
      to { transform: rotate(360deg); }
    }

    /* --- Book Flip (style 012) --- */
    #bookContainer {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: 10;
      justify-content: center;
      align-items: center;
      flex-direction: column-reverse;
      pointer-events: auto;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      perspective: 1000px;
      -webkit-perspective: 1000px;
    }
    #bookContainer.active {
      display: flex;
    }
    .book {
      width: 480px;
      height: 340px;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      -webkit-user-select: none;
      background: transparent;
      position: relative;
      transform-style: preserve-3d;
      -webkit-transform-style: preserve-3d;
    }
    .book-page-box {
      position: absolute;
      top: 0; left: 50%;
      width: 50%; height: 100%;
      transform-style: preserve-3d;
      -webkit-transform-style: preserve-3d;
      transform: translateZ(-3px);
    }
    .book-page {
      position: absolute;
      top: 0; left: 0;
      width: 240px;
      height: 340px;
      border: 2px solid #fff;
      box-sizing: border-box;
      text-align: center;
      background: #fff url('./bia.jpeg') no-repeat center;
      background-size: cover;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      transform: translateZ(1px);
    }
    .book-page p {
      font-size: 38px;
      color: #fff;
      margin-top: 100px;
      background-color: rgba(0,0,0,0.7);
      font-family: 'Be Vietnam Pro', sans-serif;
    }
    .book-page-back {
      position: absolute;
      top: 0; left: 0;
      width: 240px;
      height: 340px;
      border: 2px solid #fff;
      box-sizing: border-box;
      background-color: #fff;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      transform: rotateY(180deg) translateZ(1px);
    }
    .first-page {
      background: #fff url('./bia.jpeg') no-repeat center;
      background-size: cover;
    }
    .first-page-back {
      position: absolute;
      top: 0; left: 0;
      width: 240px;
      height: 340px;
      border: 2px solid #fff;
      box-sizing: border-box;
      background: #fff url('./bia.jpeg') no-repeat center;
      background-size: cover;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      transform: rotateY(180deg) translateZ(1px);
    }
    .first-page p {
      font-size: 30px;
      color: #fff;
      margin-top: 100px;
      background: none;
    }
    .book .point {
      position: absolute;
      top: 0; left: 50%;
      width: 240px; height: 340px;
      transform-origin: 0% 50%;
      -webkit-transform-origin: 0% 50%;
      transform-style: preserve-3d;
      -webkit-transform-style: preserve-3d;
      will-change: transform;
    }
    .point { transition: transform 2s ease-in-out; }
    .flip-animation-1 { transform: translateZ(3px) rotateY(0deg); }
    .flip-animation-2 { transform: translateZ(2px) rotateY(0deg); }
    .flip-animation-3 { transform: translateZ(1px) rotateY(0deg); }
    .flip-animation-1.flipped { transform: translateZ(1px) rotateY(-180deg); }
    .flip-animation-2.flipped { transform: translateZ(2px) rotateY(-180deg); }
    .flip-animation-3.flipped { transform: translateZ(3px) rotateY(-180deg); }
    .book-tap-hint {
      position: absolute;
      bottom: -35px;
      left: 50%;
      transform: translateX(-50%);
      color: rgba(255,255,255,0.7);
      font-family: 'Be Vietnam Pro', sans-serif;
      font-size: 14px;
      white-space: nowrap;
      animation: tapPulse 2s ease-in-out infinite;
    }
    @keyframes tapPulse {
      0%, 100% { opacity: 0.5; }
      50% { opacity: 1; }
    }

    #bookTypewriter {
      margin-bottom: 20px;
      color: #fff;
      font-size: 22px;
      font-family: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
      font-weight: bold;
      text-shadow: 0 0 10px rgba(var(--sg-soft-rgb),0.8);
      text-align: center;
      min-height: 40px;
    }

    /* --- Gift GIF overlay --- */
    #giftOverlay {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: 9;
      justify-content: center;
      align-items: center;
      pointer-events: none;
    }
    #giftOverlay.active {
      display: flex;
    }
    #giftOverlay img {
      max-width: 80%;
      max-height: 70%;
      object-fit: contain;
      animation: giftFadeIn 0.8s ease-out;
    }
    @keyframes giftFadeIn {
      from { opacity: 0; transform: scale(0.5); }
      to { opacity: 1; transform: scale(1); }
    }

    /* --- Heart overlay (from love4.html) --- */
    #heartOverlay {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: 20;
      pointer-events: none;
    }
    #heartOverlay.active {
      display: block;
    }
    #heartOverlay canvas {
      position: absolute;
      width: 100%;
      height: 100%;
    }
    #heartText {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 21;
      font-family: 'Dancing Script', 'STKaiti', cursive;
      font-size: 40px;
      color: rgb(var(--sg-accent-rgb));
      text-align: center;
      opacity: 0;
      transition: opacity 2s ease;
      pointer-events: none;
    }
    #heartText.active {
      opacity: 1;
      pointer-events: auto;
      cursor: pointer;
    }
    #heartText .tap-hint {
      display: block;
      font-size: 14px;
      color: rgba(var(--sg-accent-rgb),0.6);
      margin-top: 10px;
      animation: tapPulse 2s ease-in-out infinite;
    }

    /* --- Explode Canvas --- */
    #explodeCanvas {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      z-index: 22;
      pointer-events: none;
      display: none;
    }

    /* --- Thiệp (Letter Card) Overlay --- */
    #thiepOverlay {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: 30;
      justify-content: center;
      align-items: center;
      padding: 20px;
      box-sizing: border-box;
      background: rgba(0, 0, 0, 0.85);
    }
    #thiepOverlay.active {
      display: flex;
      animation: thiepFadeIn 1s ease;
    }
    #thiepOverlay img {
      max-width: min(360px, 70vw);
      max-height: 60vh;
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: 8px;
      box-shadow: 0 0 40px rgba(var(--sg-accent-rgb),0.4), 0 0 80px rgba(var(--sg-soft-rgb),0.2);
      animation: thiepZoomIn 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    @keyframes thiepFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @keyframes thiepZoomIn {
      from { opacity: 0; transform: scale(0.5); }
      to { opacity: 1; transform: scale(1); }
    }
    @media (max-width: 768px) {
      #thiepOverlay img {
        max-width: 75vw;
        max-height: 55vh;
      }
    }

    /* --- Birthday Popup Card --- */
    #bdayPopup {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: 35;
      justify-content: center;
      align-items: center;
      background: rgba(0, 0, 0, 0.8);
      padding: 20px;
      box-sizing: border-box;
    }
    #bdayPopup.active {
      display: flex;
      animation: thiepFadeIn 0.6s ease;
    }
    .bday-card {
      position: relative;
      background: #fff;
      border-radius: 16px;
      padding: 30px;
      max-width: 480px;
      width: 90vw;
      display: flex;
      gap: 20px;
      align-items: flex-start;
      box-shadow: 0 10px 40px rgba(0,0,0,0.4);
      animation: thiepZoomIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .bday-card-close {
      position: absolute;
      top: 12px;
      right: 16px;
      background: none;
      border: none;
      font-size: 20px;
      color: #999;
      cursor: pointer;
      line-height: 1;
      padding: 4px;
    }
    .bday-card-close:hover {
      color: #333;
    }
    .bday-card-title {
      font-family: 'Dancing Script', cursive;
      font-size: 28px;
      color: #e91e63;
      margin: 0 0 16px 0;
    }
    .bday-card-photo {
      width: 140px;
      min-width: 140px;
      height: 180px;
      border-radius: 10px;
      object-fit: cover;
      border: 3px solid #fce4ec;
      flex-shrink: 0;
    }
    .bday-card-right {
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    .bday-card-msg {
      font-family: 'Dancing Script', cursive;
      font-size: 18px;
      color: #555;
      line-height: 1.8;
      background: #fef7f7;
      border-radius: 10px;
      padding: 14px 16px;
      position: relative;
      min-height: 60px;
      max-height: 40vh;
      overflow-y: auto;
      word-wrap: break-word;
      overflow-wrap: break-word;
    }
    .bday-card-msg::before {
      content: '';
      position: absolute;
      left: -8px;
      top: 20px;
      width: 0; height: 0;
      border-top: 8px solid transparent;
      border-bottom: 8px solid transparent;
      border-right: 8px solid #fef7f7;
    }

    @media (max-width: 768px) {
      .bday-card {
        flex-direction: column;
        align-items: center;
        padding: 24px 20px;
        max-width: 340px;
      }
      .bday-card-photo {
        width: 120px;
        min-width: 120px;
        height: 150px;
      }
      .bday-card-title {
        font-size: 24px;
        text-align: center;
      }
      .bday-card-msg::before {
        display: none;
      }
      .bday-card-msg {
        font-size: 15px;
        max-height: 30vh;
      }
    }

    @media (max-width: 768px) {
      #bookContainer {
        flex-direction: column-reverse;
      }
      #bookTypewriter {
        font-size: 16px;
        margin-bottom: 15px;
      }
      .book { width: 360px; height: 280px; }
      .book-page { width: 180px; height: 280px; background-size: cover; }
      .first-page-back { width: 180px; height: 280px; }
      .book-page-back { width: 180px; height: 280px; }
      .book .point { width: 180px; height: 280px; }
      .book-page p { font-size: 20px; margin-top: 80px; }
      .first-page p { font-size: 18px; margin-top: 80px; }
      .book-tap-hint { bottom: auto; top: -30px; }
      #heartText { font-size: 28px; }
    }
  
    #rotateOverlay.dismissed {
      display: none !important;
    }
    #rotateOverlay .rotate-continue {
      margin-top: 8px;
      color: rgb(var(--sg-soft-rgb));
      font-family: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
      font-size: 14px;
      font-weight: 700;
      animation: tapPulse 2s ease-in-out infinite;
    }
    html, body, #app, #root {
      margin: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
    }
    #love-gift-root {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
    }
