/* Reset chuẩn */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background: #000;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* Khung fullscreen — căn giữa chữ bằng absolute giống tâm canvas */
.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
}

/* Canvas full vùng stage, trái tim được vẽ từ tâm trong script */
#pinkboard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/*
 * Chữ nhỏ vừa phần thân tim; lệch nhẹ lên (~1.5vmin) vì khối tim “đầy” phía trên tâm bbox.
 * Nhịp đập kép (lub–dub) — mọi keyframe giữ cùng translate để không bị giật.
 */
@keyframes text-heartbeat {
  0%, 100% {
    transform: translate(-50%, calc(-50% - 1.5vmin)) scale(1);
    text-shadow:
      0 0 10px rgba(255, 79, 163, 0.8),
      0 0 22px rgba(255, 105, 180, 0.45);
  }
  12% {
    transform: translate(-50%, calc(-50% - 1.5vmin)) scale(1.09);
    text-shadow:
      0 0 16px rgba(255, 79, 163, 0.95),
      0 0 34px rgba(255, 105, 180, 0.65);
  }
  22% {
    transform: translate(-50%, calc(-50% - 1.5vmin)) scale(1);
    text-shadow:
      0 0 10px rgba(255, 79, 163, 0.8),
      0 0 22px rgba(255, 105, 180, 0.45);
  }
  38% {
    transform: translate(-50%, calc(-50% - 1.5vmin)) scale(1.06);
    text-shadow:
      0 0 14px rgba(255, 79, 163, 0.88),
      0 0 28px rgba(255, 105, 180, 0.55);
  }
  48% {
    transform: translate(-50%, calc(-50% - 1.5vmin)) scale(1);
    text-shadow:
      0 0 10px rgba(255, 79, 163, 0.8),
      0 0 22px rgba(255, 105, 180, 0.45);
  }
}

/* Chữ NAILLA — tâm canvas + chỉnh nhẹ theo trực quan tim; nhịp đập */
#text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% - 1.5vmin));
  z-index: 2;
  pointer-events: none;

  color: #ff4fa3;
  font-weight: 800;

  font-size: clamp(16px, min(4vw, 3.4vh), 38px);
  letter-spacing: clamp(0.08em, 1.4vw, 0.24em);

  text-align: center;
  line-height: 1;
  white-space: nowrap;

  text-shadow:
    0 0 10px rgba(255, 79, 163, 0.8),
    0 0 22px rgba(255, 105, 180, 0.45);

  animation: text-heartbeat 1.15s ease-in-out infinite;
}

@media (max-width: 480px) {
  #text {
    font-size: clamp(14px, 6.5vw, 26px);
    letter-spacing: clamp(0.06em, 2vw, 0.18em);
  }
}

@media (prefers-reduced-motion: reduce) {
  #text {
    animation: none;
  }
}
