body {
  background-color: #0e1013;
  overflow: hidden;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: white;
  font-family: Arial, sans-serif;
}

body,
html {
  width: 100%;
  height: 100%;
}

.mainSVG {
  width: 100%;
  height: 100%;
  max-height: 800px;
  visibility: hidden; /* Sẽ hiện ra bằng JS */
}

/* Lớp phủ Click để bắt đầu */
#start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer;
}

.start-btn {
  font-size: 2rem;
  color: white;
  border: 2px solid white;
  padding: 20px 40px;
  border-radius: 50px;
  animation: pulse 1.5s infinite;
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Chữ chạy */
#message {
  position: absolute;
  bottom: 50px;
  width: 100%;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: #fffcf9;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 100;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
}

/* Tuyết rơi */
.snowflake {
  position: absolute;
  top: -20px;
  color: white;
  user-select: none;
  pointer-events: none;
  z-index: 50;
  text-shadow: 0 0 5px #000;
}

/* Thêm vào thẻ <style> hoặc file style.css */
.santa-container {
  position: fixed; /* Cố định vị trí trên màn hình */
  bottom: 5%; /* Cách đáy màn hình 5% */
  right: 15%; /* Cách bên phải 5% */
  width: 250px; /* Kích thước */
  z-index: 100;
  pointer-events: none;
}

.santa-container img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 15px rgba(255, 255, 255, 0.2));
}
/* OVERLAY */
#card-container {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
}

/* KHUNG THIỆP */
.card-box {
  width: 500px;
  height: 650px;
  background: #df0404;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
}

/* ẢNH TRÊN */
.card-box img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  flex-shrink: 0;
}

/* VÙNG CHỮ */
#typing-text {
  flex: 1;
  padding: 20px;
  color: #fff;
  font-size: 18px;
  font-family: "Courier New", monospace;
  line-height: 1.6;

  display: flex;
  align-items: flex-start; /* ⬆ chữ dính lên trên */
  justify-content: center;

  text-align: left; /* 📱 đọc dễ hơn */
  white-space: pre-line;
  overflow-y: auto;
}

/* SCROLL ĐẸP */
#typing-text::-webkit-scrollbar {
  width: 6px;
}

#typing-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
}

/* MOBILE */
@media (max-width: 520px) {
  .card-box {
    width: 90vw;
    height: 90vw;
  }
}
/* =========================
   MOBILE OPTIMIZATION
========================= */
@media (max-width: 768px) {
  /* BODY */
  body {
    align-items: stretch;
    justify-content: flex-start;
  }

  /* SVG cây thông */
  .mainSVG {
    max-height: 70vh;
  }

  /* CHỮ CHẠY */
  #message {
    bottom: 20px;
    font-size: 1.4rem;
    padding: 0 12px;
  }

  /* ÔNG GIÀ NOEL */
  .santa-container {
    width: 160px;
    right: 5%;
    bottom: 8%;
  }

  /* THIỆP */
  .card-box {
    width: 90vw;
    height: 85vh;
    border-radius: 18px;
  }

  .card-box img {
    height: 180px;
  }

  #typing-text {
    font-size: 16px;
    padding: 14px;
  }
}

/* MOBILE NHỎ (IPHONE SE, ETC.) */
@media (max-width: 420px) {
  #message {
    font-size: 1.2rem;
  }

  .card-box {
    width: 94vw;
    height: 88vh;
  }

  .card-box img {
    height: 160px;
  }

  #typing-text {
    font-size: 15px;
  }
}
