/* ---------- Layout & UI (Chuyển đổi từ Tailwind sang CSS thuần) ---------- */
#nks-santa-rope {
  position: fixed;
  top: 0;
  z-index: 99998;
  pointer-events: none;
  display: none;
  width: 6px;
  height: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #8b5e34 0 3px, #dcae6e 3px 6px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

#nks-santa-rope .nks-rope-top {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background-color: #64748b;
  border: 1px solid #334155;
}

#nks-santa-rope .nks-rope-bottom {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background-color: #8b5e34;
  border: 1px solid #5c3b1b;
}

#nks-santa-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 99999;
  width: 76px;
  height: 96px;
  will-change: transform;
}

#nks-santa-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  outline: none;
  cursor: pointer;
  box-shadow: none;
}

#nks-santa-btn:hover,
#nks-santa-btn:focus {
  background: transparent;
  border: none;
  outline: none;
}

#nks-santa-btn[data-phase="dropping"],
#nks-santa-btn[data-phase="climbing"],
#nks-santa-btn[data-phase="sliding"],
#nks-santa-btn[data-phase="retracting"] {
  cursor: default;
}

/* Tooltip */
.nks-santa-tooltip {
  pointer-events: none;
  position: absolute;
  top: -36px;
  right: 0;
  white-space: nowrap;
  border-radius: 9999px;
  background-color: #0f172a;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(4px);
  transition: all 150ms ease;
}

#nks-santa-btn[data-phase="idle"]:hover .nks-santa-tooltip,
#nks-santa-btn[data-phase="idle"]:focus-visible .nks-santa-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.nks-santa-tooltip-arrow {
  position: absolute;
  bottom: -4px;
  right: 32px;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background-color: #0f172a;
}

.nks-santa-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
}

/* ---------- Santa "Go to top" Animations ---------- */
@keyframes santa-wave {
  0%, 100% { transform: rotate(-135deg); }
  50% { transform: rotate(-172deg); }
}
@keyframes santa-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes santa-climb-l {
  0%, 100% { transform: rotate(-150deg); }
  50% { transform: rotate(-172deg); }
}
@keyframes santa-climb-r {
  0%, 100% { transform: rotate(-208deg); }
  50% { transform: rotate(-188deg); }
}
@keyframes santa-leg-l {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes santa-leg-r {
  0%, 100% { transform: translateY(-7px); }
  50% { transform: translateY(0); }
}

.santa-body { animation: santa-bob 1.4s ease-in-out infinite; }
.santa-arm-wave { transform-origin: 62px 47px; animation: santa-wave 0.7s ease-in-out infinite; }
.santa-arm-l { transform-origin: 18px 47px; }
.santa-arm-r { transform-origin: 62px 47px; }

.santa-holding .santa-arm-l { animation: santa-climb-l 0.45s ease-in-out infinite; }
.santa-holding .santa-arm-r { animation: santa-climb-r 0.45s ease-in-out infinite; }
.santa-holding .santa-leg-l { animation: santa-leg-l 0.45s ease-in-out infinite; }
.santa-holding .santa-leg-r { animation: santa-leg-r 0.45s ease-in-out infinite; }
.santa-holding .santa-body { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .santa-body, .santa-arm-wave, .santa-holding .santa-arm-l, .santa-holding .santa-arm-r,
  .santa-holding .santa-leg-l, .santa-holding .santa-leg-r { animation: none; }
}